@lazehq/cli 0.1.85 → 0.1.86

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 +341 -196
  2. package/package.json +1 -1
package/dist/laze.mjs CHANGED
@@ -849,9 +849,9 @@ var require_node_gyp_build = __commonJS({
849
849
  var debug = getFirst(path.join(dir, "build/Debug"), matchBuild);
850
850
  if (debug) return debug;
851
851
  }
852
- var prebuild = resolve25(dir);
852
+ var prebuild = resolve26(dir);
853
853
  if (prebuild) return prebuild;
854
- var nearby = resolve25(path.dirname(process.execPath));
854
+ var nearby = resolve26(path.dirname(process.execPath));
855
855
  if (nearby) return nearby;
856
856
  var target = [
857
857
  "platform=" + platform,
@@ -867,7 +867,7 @@ var require_node_gyp_build = __commonJS({
867
867
  // eslint-disable-line
868
868
  ].filter(Boolean).join(" ");
869
869
  throw new Error("No native build was found for " + target + "\n loaded from: " + dir + "\n");
870
- function resolve25(dir2) {
870
+ function resolve26(dir2) {
871
871
  var tuples = readdirSync(path.join(dir2, "prebuilds")).map(parseTuple);
872
872
  var tuple2 = tuples.filter(matchTuple(platform, arch)).sort(compareTuples)[0];
873
873
  if (!tuple2) return;
@@ -7314,9 +7314,9 @@ var require_dispatcher_base = __commonJS({
7314
7314
  }
7315
7315
  close(callback) {
7316
7316
  if (callback === void 0) {
7317
- return new Promise((resolve25, reject) => {
7317
+ return new Promise((resolve26, reject) => {
7318
7318
  this.close((err, data) => {
7319
- return err ? reject(err) : resolve25(data);
7319
+ return err ? reject(err) : resolve26(data);
7320
7320
  });
7321
7321
  });
7322
7322
  }
@@ -7354,9 +7354,9 @@ var require_dispatcher_base = __commonJS({
7354
7354
  err = null;
7355
7355
  }
7356
7356
  if (callback === void 0) {
7357
- return new Promise((resolve25, reject) => {
7357
+ return new Promise((resolve26, reject) => {
7358
7358
  this.destroy(err, (err2, data) => {
7359
- return err2 ? reject(err2) : resolve25(data);
7359
+ return err2 ? reject(err2) : resolve26(data);
7360
7360
  });
7361
7361
  });
7362
7362
  }
@@ -12311,12 +12311,12 @@ upgrade: ${upgrade2}\r
12311
12311
  cb();
12312
12312
  }
12313
12313
  }
12314
- const waitForDrain = () => new Promise((resolve25, reject) => {
12314
+ const waitForDrain = () => new Promise((resolve26, reject) => {
12315
12315
  assert2(callback === null);
12316
12316
  if (socket[kError]) {
12317
12317
  reject(socket[kError]);
12318
12318
  } else {
12319
- callback = resolve25;
12319
+ callback = resolve26;
12320
12320
  }
12321
12321
  });
12322
12322
  socket.on("close", onDrain).on("drain", onDrain);
@@ -13674,12 +13674,12 @@ var require_client_h2 = __commonJS({
13674
13674
  cb();
13675
13675
  }
13676
13676
  }
13677
- const waitForDrain = () => new Promise((resolve25, reject) => {
13677
+ const waitForDrain = () => new Promise((resolve26, reject) => {
13678
13678
  assert2(callback === null);
13679
13679
  if (socket[kError]) {
13680
13680
  reject(socket[kError]);
13681
13681
  } else {
13682
- callback = resolve25;
13682
+ callback = resolve26;
13683
13683
  }
13684
13684
  });
13685
13685
  h2stream.on("close", onDrain).on("drain", onDrain);
@@ -13996,7 +13996,7 @@ var require_client = __commonJS({
13996
13996
  this[kQueue] = [];
13997
13997
  this[kRunningIdx] = 0;
13998
13998
  this[kPendingIdx] = 0;
13999
- this[kResume] = (sync) => resume(this, sync);
13999
+ this[kResume] = (sync2) => resume(this, sync2);
14000
14000
  this[kOnError] = (err) => onError(this, err);
14001
14001
  }
14002
14002
  get pipelining() {
@@ -14047,16 +14047,16 @@ var require_client = __commonJS({
14047
14047
  return this[kNeedDrain] < 2;
14048
14048
  }
14049
14049
  [kClose]() {
14050
- return new Promise((resolve25) => {
14050
+ return new Promise((resolve26) => {
14051
14051
  if (this[kSize]) {
14052
- this[kClosedResolve] = resolve25;
14052
+ this[kClosedResolve] = resolve26;
14053
14053
  } else {
14054
- resolve25(null);
14054
+ resolve26(null);
14055
14055
  }
14056
14056
  });
14057
14057
  }
14058
14058
  [kDestroy](err) {
14059
- return new Promise((resolve25) => {
14059
+ return new Promise((resolve26) => {
14060
14060
  const requests2 = this[kQueue].splice(this[kPendingIdx]);
14061
14061
  for (let i = 0; i < requests2.length; i++) {
14062
14062
  const request2 = requests2[i];
@@ -14069,7 +14069,7 @@ var require_client = __commonJS({
14069
14069
  this[kClosedResolve]();
14070
14070
  this[kClosedResolve] = null;
14071
14071
  }
14072
- resolve25(null);
14072
+ resolve26(null);
14073
14073
  };
14074
14074
  if (this[kHTTPContext]) {
14075
14075
  this[kHTTPContext].destroy(err, callback);
@@ -14215,12 +14215,12 @@ var require_client = __commonJS({
14215
14215
  client[kNeedDrain] = 0;
14216
14216
  client.emit("drain", client[kUrl], [client]);
14217
14217
  }
14218
- function resume(client, sync) {
14218
+ function resume(client, sync2) {
14219
14219
  if (client[kResuming] === 2) {
14220
14220
  return;
14221
14221
  }
14222
14222
  client[kResuming] = 2;
14223
- _resume(client, sync);
14223
+ _resume(client, sync2);
14224
14224
  client[kResuming] = 0;
14225
14225
  if (client[kRunningIdx] > 256) {
14226
14226
  client[kQueue].splice(0, client[kRunningIdx]);
@@ -14228,7 +14228,7 @@ var require_client = __commonJS({
14228
14228
  client[kRunningIdx] = 0;
14229
14229
  }
14230
14230
  }
14231
- function _resume(client, sync) {
14231
+ function _resume(client, sync2) {
14232
14232
  while (true) {
14233
14233
  if (client.destroyed) {
14234
14234
  assert2(client[kPending] === 0);
@@ -14245,7 +14245,7 @@ var require_client = __commonJS({
14245
14245
  if (client[kBusy]) {
14246
14246
  client[kNeedDrain] = 2;
14247
14247
  } else if (client[kNeedDrain] === 2) {
14248
- if (sync) {
14248
+ if (sync2) {
14249
14249
  client[kNeedDrain] = 1;
14250
14250
  queueMicrotask(() => emitDrain(client));
14251
14251
  } else {
@@ -14482,8 +14482,8 @@ var require_pool_base = __commonJS({
14482
14482
  }
14483
14483
  return Promise.all(closeAll);
14484
14484
  } else {
14485
- return new Promise((resolve25) => {
14486
- this[kClosedResolve] = resolve25;
14485
+ return new Promise((resolve26) => {
14486
+ this[kClosedResolve] = resolve26;
14487
14487
  });
14488
14488
  }
14489
14489
  }
@@ -16994,7 +16994,7 @@ var require_readable = __commonJS({
16994
16994
  if (this._readableState.closeEmitted) {
16995
16995
  return Promise.resolve(null);
16996
16996
  }
16997
- return new Promise((resolve25, reject) => {
16997
+ return new Promise((resolve26, reject) => {
16998
16998
  if (this[kContentLength] && this[kContentLength] > limit || this[kBytesRead] > limit) {
16999
16999
  this.destroy(new AbortError());
17000
17000
  }
@@ -17008,11 +17008,11 @@ var require_readable = __commonJS({
17008
17008
  if (signal.aborted) {
17009
17009
  reject(signal.reason ?? new AbortError());
17010
17010
  } else {
17011
- resolve25(null);
17011
+ resolve26(null);
17012
17012
  }
17013
17013
  });
17014
17014
  } else {
17015
- this.on("close", resolve25);
17015
+ this.on("close", resolve26);
17016
17016
  }
17017
17017
  this.on("error", noop2).on("data", () => {
17018
17018
  if (this[kBytesRead] > limit) {
@@ -17040,7 +17040,7 @@ var require_readable = __commonJS({
17040
17040
  }
17041
17041
  function consume(stream, type) {
17042
17042
  assert2(!stream[kConsume]);
17043
- return new Promise((resolve25, reject) => {
17043
+ return new Promise((resolve26, reject) => {
17044
17044
  if (isUnusable(stream)) {
17045
17045
  const rState = stream._readableState;
17046
17046
  if (rState.destroyed && rState.closeEmitted === false) {
@@ -17055,7 +17055,7 @@ var require_readable = __commonJS({
17055
17055
  stream[kConsume] = {
17056
17056
  type,
17057
17057
  stream,
17058
- resolve: resolve25,
17058
+ resolve: resolve26,
17059
17059
  reject,
17060
17060
  length: 0,
17061
17061
  body: []
@@ -17133,18 +17133,18 @@ var require_readable = __commonJS({
17133
17133
  return buffer;
17134
17134
  }
17135
17135
  function consumeEnd(consume2, encoding) {
17136
- const { type, body, resolve: resolve25, stream, length } = consume2;
17136
+ const { type, body, resolve: resolve26, stream, length } = consume2;
17137
17137
  try {
17138
17138
  if (type === "text") {
17139
- resolve25(chunksDecode(body, length, encoding));
17139
+ resolve26(chunksDecode(body, length, encoding));
17140
17140
  } else if (type === "json") {
17141
- resolve25(JSON.parse(chunksDecode(body, length, encoding)));
17141
+ resolve26(JSON.parse(chunksDecode(body, length, encoding)));
17142
17142
  } else if (type === "arrayBuffer") {
17143
- resolve25(chunksConcat(body, length).buffer);
17143
+ resolve26(chunksConcat(body, length).buffer);
17144
17144
  } else if (type === "blob") {
17145
- resolve25(new Blob(body, { type: stream[kContentType] }));
17145
+ resolve26(new Blob(body, { type: stream[kContentType] }));
17146
17146
  } else if (type === "bytes") {
17147
- resolve25(chunksConcat(body, length));
17147
+ resolve26(chunksConcat(body, length));
17148
17148
  }
17149
17149
  consumeFinish(consume2);
17150
17150
  } catch (err) {
@@ -17363,9 +17363,9 @@ var require_api_request = __commonJS({
17363
17363
  };
17364
17364
  function request2(opts, callback) {
17365
17365
  if (callback === void 0) {
17366
- return new Promise((resolve25, reject) => {
17366
+ return new Promise((resolve26, reject) => {
17367
17367
  request2.call(this, opts, (err, data) => {
17368
- return err ? reject(err) : resolve25(data);
17368
+ return err ? reject(err) : resolve26(data);
17369
17369
  });
17370
17370
  });
17371
17371
  }
@@ -17626,9 +17626,9 @@ var require_api_stream = __commonJS({
17626
17626
  };
17627
17627
  function stream(opts, factory, callback) {
17628
17628
  if (callback === void 0) {
17629
- return new Promise((resolve25, reject) => {
17629
+ return new Promise((resolve26, reject) => {
17630
17630
  stream.call(this, opts, factory, (err, data) => {
17631
- return err ? reject(err) : resolve25(data);
17631
+ return err ? reject(err) : resolve26(data);
17632
17632
  });
17633
17633
  });
17634
17634
  }
@@ -17928,9 +17928,9 @@ var require_api_upgrade = __commonJS({
17928
17928
  };
17929
17929
  function upgrade2(opts, callback) {
17930
17930
  if (callback === void 0) {
17931
- return new Promise((resolve25, reject) => {
17931
+ return new Promise((resolve26, reject) => {
17932
17932
  upgrade2.call(this, opts, (err, data) => {
17933
- return err ? reject(err) : resolve25(data);
17933
+ return err ? reject(err) : resolve26(data);
17934
17934
  });
17935
17935
  });
17936
17936
  }
@@ -18024,9 +18024,9 @@ var require_api_connect = __commonJS({
18024
18024
  };
18025
18025
  function connect8(opts, callback) {
18026
18026
  if (callback === void 0) {
18027
- return new Promise((resolve25, reject) => {
18027
+ return new Promise((resolve26, reject) => {
18028
18028
  connect8.call(this, opts, (err, data) => {
18029
- return err ? reject(err) : resolve25(data);
18029
+ return err ? reject(err) : resolve26(data);
18030
18030
  });
18031
18031
  });
18032
18032
  }
@@ -19486,8 +19486,8 @@ var require_snapshot_utils = __commonJS({
19486
19486
  var require_snapshot_recorder = __commonJS({
19487
19487
  "../../node_modules/.pnpm/undici@8.10.0/node_modules/undici/lib/mock/snapshot-recorder.js"(exports, module) {
19488
19488
  "use strict";
19489
- var { writeFile: writeFile28, readFile: readFile49, mkdir: mkdir28 } = __require("node:fs/promises");
19490
- var { dirname: dirname30, resolve: resolve25 } = __require("node:path");
19489
+ var { writeFile: writeFile29, readFile: readFile49, mkdir: mkdir29 } = __require("node:fs/promises");
19490
+ var { dirname: dirname30, resolve: resolve26 } = __require("node:path");
19491
19491
  var { setTimeout: setTimeout2, clearTimeout: clearTimeout2 } = __require("node:timers");
19492
19492
  var { InvalidArgumentError, UndiciError } = require_errors();
19493
19493
  var { hashId, isUrlExcludedFactory, normalizeHeaders, createHeaderFilters } = require_snapshot_utils();
@@ -19703,7 +19703,7 @@ var require_snapshot_recorder = __commonJS({
19703
19703
  throw new InvalidArgumentError("Snapshot path is required");
19704
19704
  }
19705
19705
  try {
19706
- const data = await readFile49(resolve25(path), "utf8");
19706
+ const data = await readFile49(resolve26(path), "utf8");
19707
19707
  const parsed = JSON.parse(data);
19708
19708
  if (Array.isArray(parsed)) {
19709
19709
  this.#snapshots.clear();
@@ -19732,13 +19732,13 @@ var require_snapshot_recorder = __commonJS({
19732
19732
  if (!path) {
19733
19733
  throw new InvalidArgumentError("Snapshot path is required");
19734
19734
  }
19735
- const resolvedPath = resolve25(path);
19736
- await mkdir28(dirname30(resolvedPath), { recursive: true });
19735
+ const resolvedPath = resolve26(path);
19736
+ await mkdir29(dirname30(resolvedPath), { recursive: true });
19737
19737
  const data = Array.from(this.#snapshots.entries()).map(([hash2, snapshot]) => ({
19738
19738
  hash: hash2,
19739
19739
  snapshot
19740
19740
  }));
19741
- await writeFile28(resolvedPath, JSON.stringify(data, null, 2), { flush: true });
19741
+ await writeFile29(resolvedPath, JSON.stringify(data, null, 2), { flush: true });
19742
19742
  }
19743
19743
  /**
19744
19744
  * Clears all recorded snapshots
@@ -27230,7 +27230,7 @@ var require_fetch = __commonJS({
27230
27230
  const hasTrailingQuestionMark = url2.search.length === 0 && url2.href[url2.href.length - url2.hash.length - 1] === "?";
27231
27231
  return dispatchWithProtocolPreference(body);
27232
27232
  function dispatchWithProtocolPreference(body2, allowH2) {
27233
- return new Promise((resolve25, reject) => agent3.dispatch(
27233
+ return new Promise((resolve26, reject) => agent3.dispatch(
27234
27234
  {
27235
27235
  path: hasTrailingQuestionMark ? `${path}?` : path,
27236
27236
  origin: url2.origin,
@@ -27313,7 +27313,7 @@ var require_fetch = __commonJS({
27313
27313
  }
27314
27314
  }
27315
27315
  const onError = (err) => this.onResponseError(controller, err);
27316
- resolve25({
27316
+ resolve26({
27317
27317
  status: status11,
27318
27318
  statusText,
27319
27319
  headersList,
@@ -27346,7 +27346,7 @@ var require_fetch = __commonJS({
27346
27346
  fetchParams.controller.off("terminated", this.abort);
27347
27347
  }
27348
27348
  if (request2.mode === "websocket" && allowH2 !== false && error63?.code === "UND_ERR_INFO" && error63?.message === "HTTP/2: Extended CONNECT protocol not supported by server") {
27349
- resolve25(dispatchWithProtocolPreference(body2, false));
27349
+ resolve26(dispatchWithProtocolPreference(body2, false));
27350
27350
  return;
27351
27351
  }
27352
27352
  this.body?.destroy(error63);
@@ -27360,7 +27360,7 @@ var require_fetch = __commonJS({
27360
27360
  const rawHeaders = controller?.rawHeaders ?? [];
27361
27361
  const headersList = new HeadersList();
27362
27362
  appendHeadersListFromResponseHeaders(headersList, headers, rawHeaders);
27363
- resolve25({
27363
+ resolve26({
27364
27364
  status: status11,
27365
27365
  statusText: STATUS_CODES[status11],
27366
27366
  headersList,
@@ -32692,7 +32692,7 @@ function runRedacted({
32692
32692
  redact
32693
32693
  }) {
32694
32694
  const values = redact ?? Object.values(env);
32695
- return new Promise((resolve25, reject) => {
32695
+ return new Promise((resolve26, reject) => {
32696
32696
  const [file4, ...args] = command;
32697
32697
  const child = spawn(file4, args, {
32698
32698
  env: { ...baseEnv, ...env },
@@ -32718,7 +32718,7 @@ function runRedacted({
32718
32718
  child.on("error", reject);
32719
32719
  child.on("close", (code, ended) => {
32720
32720
  signal?.removeEventListener("abort", killGroup);
32721
- void drained.then(() => resolve25(code ?? (ended ? 128 + signalNumber(ended) : 1)));
32721
+ void drained.then(() => resolve26(code ?? (ended ? 128 + signalNumber(ended) : 1)));
32722
32722
  });
32723
32723
  });
32724
32724
  }
@@ -36990,7 +36990,7 @@ function flagText({
36990
36990
  }
36991
36991
 
36992
36992
  // src/rules/cli-version.rules.ts
36993
- var STAMPED = "0.1.85";
36993
+ var STAMPED = "0.1.86";
36994
36994
  function cliVersionOf({ stamped = STAMPED } = {}) {
36995
36995
  return stamped.startsWith("__") ? "dev" : stamped;
36996
36996
  }
@@ -42040,7 +42040,7 @@ var recursive = /* @__PURE__ */ new WeakMap();
42040
42040
  var NONE = 0;
42041
42041
  var ASSUMED = 1;
42042
42042
  var PROVEN = 2;
42043
- function isRecursive(inst, stack, resolve25) {
42043
+ function isRecursive(inst, stack, resolve26) {
42044
42044
  const cached2 = recursive.get(inst);
42045
42045
  if (cached2 !== void 0)
42046
42046
  return cached2 ? PROVEN : NONE;
@@ -42050,7 +42050,7 @@ function isRecursive(inst, stack, resolve25) {
42050
42050
  let result2 = NONE;
42051
42051
  const check3 = (child) => {
42052
42052
  if (result2 !== PROVEN && child?._zod) {
42053
- const answer6 = isRecursive(child, stack, resolve25);
42053
+ const answer6 = isRecursive(child, stack, resolve26);
42054
42054
  if (answer6 > result2)
42055
42055
  result2 = answer6;
42056
42056
  }
@@ -42061,7 +42061,7 @@ function isRecursive(inst, stack, resolve25) {
42061
42061
  const desc = Object.getOwnPropertyDescriptor(sh, key);
42062
42062
  if (spread && !desc.enumerable)
42063
42063
  continue;
42064
- const child = desc.get ? ASSUMED : desc.value?._zod ? isRecursive(desc.value, stack, resolve25) : NONE;
42064
+ const child = desc.get ? ASSUMED : desc.value?._zod ? isRecursive(desc.value, stack, resolve26) : NONE;
42065
42065
  if (child > answer6)
42066
42066
  answer6 = child;
42067
42067
  }
@@ -42125,7 +42125,7 @@ function isRecursive(inst, stack, resolve25) {
42125
42125
  break;
42126
42126
  // `$ZodLazy` caches its inner on the def, so a resolved edge is followed exactly
42127
42127
  case "lazy": {
42128
- const inner = def._cachedInner ?? (resolve25 ? inst._zod.innerType : void 0);
42128
+ const inner = def._cachedInner ?? (resolve26 ? inst._zod.innerType : void 0);
42129
42129
  merge2(inner ? isRecursive(inner, stack, false) : ASSUMED);
42130
42130
  break;
42131
42131
  }
@@ -62698,7 +62698,9 @@ var directoryEntrySchemaDefinition = external_exports.object({
62698
62698
  /** An agent that runs outside Laze: what it reads leaves Laze. False for people. */
62699
62699
  runsOutside: external_exports.boolean().default(false),
62700
62700
  /** Other names a person goes by, such as "Drew" or their Slack name; mentions match them. */
62701
- aliases: external_exports.array(external_exports.string()).optional()
62701
+ aliases: external_exports.array(external_exports.string()).optional(),
62702
+ /** A person invited and not joined yet, by their invitation's state; absent for members. */
62703
+ invited: external_exports.enum(["pending", "held", "expired"]).optional()
62702
62704
  });
62703
62705
  var chatOverviewSchemaDefinition = external_exports.object({
62704
62706
  viewer: chatActorSchemaDefinition,
@@ -63137,7 +63139,9 @@ var syncMirrorReadInputSchemaDefinition = external_exports.object({
63137
63139
  channelId: idSchema4,
63138
63140
  userId: idSchema4,
63139
63141
  readTo: external_exports.iso.datetime(),
63140
- unread: external_exports.number().int().positive().max(1e6).optional()
63142
+ unread: external_exports.number().int().positive().max(1e6).optional(),
63143
+ /** The source and Laze keep marks in step: a read there also ends a mark unread set in Laze. */
63144
+ releasesHold: external_exports.boolean().optional()
63141
63145
  });
63142
63146
  var mirroredReadToInputSchemaDefinition = external_exports.object({
63143
63147
  workspaceId: workspaceIdSchema,
@@ -64020,7 +64024,7 @@ var mirrorNotifyLevelSchema = external_exports.enum(["everywhere", "desktop", "o
64020
64024
  var mirrorNotifySchemaDefinition = external_exports.object({
64021
64025
  slack: mirrorNotifyLevelSchema.default("everywhere"),
64022
64026
  discord: mirrorNotifyLevelSchema.default("everywhere"),
64023
- whatsapp: mirrorNotifyLevelSchema.default("desktop")
64027
+ whatsapp: mirrorNotifyLevelSchema.default("everywhere")
64024
64028
  });
64025
64029
  var notificationSettingsSchemaDefinition = external_exports.object({
64026
64030
  channelDefault: channelDefaultSchema,
@@ -64299,7 +64303,9 @@ var desktopTextReviewRequestedPayloadSchemaDefinition = external_exports.object(
64299
64303
  workspaceId: external_exports.string().min(1),
64300
64304
  userId: external_exports.string().min(1),
64301
64305
  requestId: external_exports.string().min(1),
64302
- at: external_exports.iso.datetime()
64306
+ at: external_exports.iso.datetime(),
64307
+ /** The notice tags (`<channel id>:<message id>`) that changed; absent, every fact is checked. */
64308
+ tags: external_exports.array(external_exports.string().min(1)).optional()
64303
64309
  });
64304
64310
  var notificationsPausedPayloadSchemaDefinition = external_exports.object({
64305
64311
  workspaceId: external_exports.string().min(1),
@@ -64798,7 +64804,13 @@ var agentAccessSchemaDefinition = external_exports.object({
64798
64804
  kind: external_exports.enum(["personal", "team"]),
64799
64805
  ownerUserId: idSchema5,
64800
64806
  people: external_exports.array(
64801
- external_exports.object({ userId: idSchema5, grantedByUserId: idSchema5, grantedAt: external_exports.iso.datetime() })
64807
+ external_exports.object({
64808
+ userId: idSchema5,
64809
+ grantedByUserId: idSchema5,
64810
+ grantedAt: external_exports.iso.datetime(),
64811
+ /** The address of a person invited and not joined yet, who is named by it. */
64812
+ invitedEmail: external_exports.string().optional()
64813
+ })
64802
64814
  ),
64803
64815
  channels: external_exports.array(
64804
64816
  external_exports.object({ id: idSchema5, name: external_exports.string(), kind: external_exports.enum(["public", "private"]) })
@@ -66780,6 +66792,11 @@ var connectorCategorySchema = external_exports.enum([
66780
66792
  "Projects and code"
66781
66793
  ]);
66782
66794
  var TWO_DAYS = 2 * 86400;
66795
+ var GMAIL_MODIFY_SCOPE = "https://www.googleapis.com/auth/gmail.modify";
66796
+ var GMAIL_TRASH_PATHS = [
66797
+ "/gmail/v1/users/*/threads/*/trash",
66798
+ "/gmail/v1/users/*/messages/*/trash"
66799
+ ];
66783
66800
  var GOOGLE = {
66784
66801
  family: "google",
66785
66802
  authorizeUrl: "https://accounts.google.com/o/oauth2/v2/auth",
@@ -66801,22 +66818,18 @@ var CONNECTOR_PROVIDERS = [
66801
66818
  id: "gmail",
66802
66819
  label: "Gmail",
66803
66820
  category: "Email and calendar",
66804
- description: "Search and read mail and write drafts. Sending asks you, with the draft to send.",
66805
- scopes: [
66806
- "openid",
66807
- "email",
66808
- "https://www.googleapis.com/auth/gmail.readonly",
66809
- "https://www.googleapis.com/auth/gmail.compose"
66810
- ],
66821
+ description: "Search, read, archive and label mail and write drafts. Sending, trash and unsubscribing ask you first.",
66822
+ // gmail.modify covers reading, drafts and sending as well as labels, archive and trash.
66823
+ scopes: ["openid", "email", GMAIL_MODIFY_SCOPE],
66811
66824
  sensitivity: "auto",
66812
66825
  maxLeaseSeconds: TWO_DAYS,
66813
66826
  egress: {
66814
66827
  upstream: "https://gmail.googleapis.com",
66815
66828
  header: "Authorization",
66816
66829
  prefix: "Bearer ",
66817
- askPaths: VAULT_GMAIL_SEND_PATHS
66830
+ askPaths: [...VAULT_GMAIL_SEND_PATHS, ...GMAIL_TRASH_PATHS]
66818
66831
  },
66819
- rules: "Read mail and write drafts freely; send only what the requester asked to send."
66832
+ rules: "Read, label and archive mail and write drafts freely; send, trash or unsubscribe only when the requester asked for it."
66820
66833
  },
66821
66834
  {
66822
66835
  ...GOOGLE,
@@ -69554,7 +69567,9 @@ var callerWorkspaceInviteSchemaDefinition = external_exports.object({
69554
69567
  role: roleSchema,
69555
69568
  status: external_exports.enum(["pending", "held"]).optional(),
69556
69569
  expiresAt: external_exports.iso.datetime(),
69557
- createdAt: external_exports.iso.datetime()
69570
+ createdAt: external_exports.iso.datetime(),
69571
+ /** The invited person, who can be given agents, apps and channels before they join. */
69572
+ personId: external_exports.string().optional()
69558
69573
  });
69559
69574
  var callerInviteLinkSchemaDefinition = external_exports.object({
69560
69575
  inviteId: external_exports.string().min(1),
@@ -75205,8 +75220,8 @@ var CodexAppServer = class _CodexAppServer {
75205
75220
  }
75206
75221
  async call(method, params) {
75207
75222
  const id4 = ++this.#nextId;
75208
- const reply2 = await new Promise((resolve25) => {
75209
- this.#pending.set(id4, resolve25);
75223
+ const reply2 = await new Promise((resolve26) => {
75224
+ this.#pending.set(id4, resolve26);
75210
75225
  this.write({ id: id4, method, params });
75211
75226
  });
75212
75227
  if (reply2.error !== void 0) throw new Error(`${method}: ${JSON.stringify(reply2.error)}`);
@@ -75218,12 +75233,12 @@ var CodexAppServer = class _CodexAppServer {
75218
75233
  /** Starts one turn; `done` settles when it completes, keeping its last agent message. */
75219
75234
  async startTurn({ threadId, text: text3 }) {
75220
75235
  const result2 = { answer: "" };
75221
- const done = new Promise((resolve25) => {
75236
+ const done = new Promise((resolve26) => {
75222
75237
  const listen = (message2) => {
75223
75238
  absorbTurnEvent({ result: result2, message: message2 });
75224
75239
  if (message2.method !== "turn/completed") return;
75225
75240
  this.#listeners.delete(listen);
75226
- resolve25(result2);
75241
+ resolve26(result2);
75227
75242
  };
75228
75243
  this.#listeners.add(listen);
75229
75244
  });
@@ -75702,13 +75717,26 @@ When something needs a person to decide or act, post a card in their feed:
75702
75717
  \`laze feed post "<title>" --summary "<why>" --action "<label>=<what to do>"\`. Run
75703
75718
  \`laze feed post\` with no title for every flag and how to write a card.
75704
75719
 
75705
- When you prepare a message for a person to send (email, Slack, LinkedIn), post a feed card with
75706
- the full text in \`--draft\`, the recipients and subject in
75707
- \`--draft-header "To: ...\\nCc: ...\\nSubject: ..."\`, an action to send it
75708
- (\`--action "Send it=<what to do>"\`) and a \`--link\` to the exact draft
75709
- (\`"Open draft in Gmail=https://mail.google.com/mail/u/0/#drafts?compose=<draft message id>"\`,
75710
- not the drafts folder). Never leave it only in Gmail drafts. If they edit the text on the card,
75711
- the press brings you the edited text: update the native draft with it first, then send.
75720
+ Anything that goes to people outside this conversation (an email, a Slack, WhatsApp or LinkedIn
75721
+ message to someone else, a post) is a draft for your person first, on a feed card: a one-line ask
75722
+ as the title, the full text in \`--draft\`, the recipients and subject in
75723
+ \`--draft-header "To: ...\\nCc: ...\\nSubject: ..."\`, \`--action "Send it=<what to do>"\` and a
75724
+ \`--link\` that opens the original in its own app: for Gmail
75725
+ \`"Open thread with the draft=https://mail.google.com/mail/u/0/#all/<thread id>"\`, else the Slack,
75726
+ WhatsApp or LinkedIn thread or the GitHub PR. For example:
75727
+
75728
+ \`\`\`bash
75729
+ laze feed post "Reply to Dana about the renewal" --summary "She asked for the price by Friday" \\
75730
+ --draft @reply.md --draft-header "To: dana@acme.test\\nSubject: Re: Renewal" \\
75731
+ --link "Open thread with the draft=https://mail.google.com/mail/u/0/#all/<thread id>" \\
75732
+ --action "Send it=Send this reply"
75733
+ \`\`\`
75734
+
75735
+ They edit and send it from the card. Send such a message only when they pressed Send on its card
75736
+ or told you in chat to send that exact message ("send it", "manda"): a send approval card is not
75737
+ their review, so post the feed card first. After a send, say in one line what went to whom.
75738
+ Never leave a draft only in Gmail drafts. If they edit the text on the card, the press brings you
75739
+ the edited text: update the native draft with it first, then send.
75712
75740
 
75713
75741
  A card you post or update while answering is linked under your reply: don't describe where the
75714
75742
  card is, say what changed.
@@ -80629,16 +80657,16 @@ async function serveAppFolder({
80629
80657
  (error63) => failed({ response, error: error63 })
80630
80658
  );
80631
80659
  });
80632
- await new Promise((resolve25, reject) => {
80660
+ await new Promise((resolve26, reject) => {
80633
80661
  server.once("error", reject);
80634
- server.listen(port, "127.0.0.1", () => resolve25());
80662
+ server.listen(port, "127.0.0.1", () => resolve26());
80635
80663
  });
80636
80664
  const { port: bound } = server.address();
80637
80665
  return {
80638
80666
  url: `http://127.0.0.1:${bound}/`,
80639
- close: () => new Promise((resolve25) => {
80667
+ close: () => new Promise((resolve26) => {
80640
80668
  server.closeAllConnections();
80641
- server.close(() => resolve25());
80669
+ server.close(() => resolve26());
80642
80670
  })
80643
80671
  };
80644
80672
  }
@@ -83103,7 +83131,7 @@ function tunnel({
83103
83131
  host: host2,
83104
83132
  port
83105
83133
  }) {
83106
- return new Promise((resolve25, reject) => {
83134
+ return new Promise((resolve26, reject) => {
83107
83135
  const socket = connectTcp(proxy.port, proxy.host);
83108
83136
  let answer6 = "";
83109
83137
  const auth = proxy.authorization ? `Proxy-Authorization: ${proxy.authorization}\r
@@ -83120,7 +83148,7 @@ ${auth}\r
83120
83148
  answer6 += chunk.toString("latin1");
83121
83149
  if (!answer6.includes(HEADER_END)) return;
83122
83150
  socket.off("data", onData);
83123
- if (/^HTTP\/1\.[01] 200/.test(answer6)) return resolve25(socket);
83151
+ if (/^HTTP\/1\.[01] 200/.test(answer6)) return resolve26(socket);
83124
83152
  socket.destroy();
83125
83153
  reject(new Error(`proxy refused the tunnel: ${answer6.split("\r\n")[0] ?? ""}`));
83126
83154
  };
@@ -83133,8 +83161,8 @@ async function upstreamOf({ target, proxy }) {
83133
83161
  const raw = proxy ? await tunnel({ proxy, host: target.hostname, port }) : connectTcp(port, target.hostname);
83134
83162
  if (!secure) return raw;
83135
83163
  const tls = connectTls({ socket: raw, servername: target.hostname });
83136
- await new Promise((resolve25, reject) => {
83137
- tls.once("secureConnect", () => resolve25());
83164
+ await new Promise((resolve26, reject) => {
83165
+ tls.once("secureConnect", () => resolve26());
83138
83166
  tls.once("error", reject);
83139
83167
  });
83140
83168
  return tls;
@@ -83176,8 +83204,8 @@ async function browserSocket({
83176
83204
  createConnection: () => upstream,
83177
83205
  perMessageDeflate: false
83178
83206
  });
83179
- await new Promise((resolve25, reject) => {
83180
- socket.once("open", () => resolve25());
83207
+ await new Promise((resolve26, reject) => {
83208
+ socket.once("open", () => resolve26());
83181
83209
  socket.once("error", reject);
83182
83210
  });
83183
83211
  return socket;
@@ -83190,12 +83218,12 @@ async function browserCall({
83190
83218
  }) {
83191
83219
  const socket = await browserSocket({ target, proxy });
83192
83220
  try {
83193
- return await new Promise((resolve25, reject) => {
83221
+ return await new Promise((resolve26, reject) => {
83194
83222
  socket.on("message", (data) => {
83195
83223
  const reply2 = JSON.parse(textOf3(data));
83196
83224
  if (reply2.id !== 1) return;
83197
83225
  if (reply2.error) reject(new Error(`${method}: ${JSON.stringify(reply2.error)}`));
83198
- else resolve25(reply2.result ?? {});
83226
+ else resolve26(reply2.result ?? {});
83199
83227
  });
83200
83228
  socket.once(
83201
83229
  "close",
@@ -83359,18 +83387,18 @@ function retargetCdpBridge({
83359
83387
  target,
83360
83388
  expiresAt
83361
83389
  }) {
83362
- return new Promise((resolve25) => {
83390
+ return new Promise((resolve26) => {
83363
83391
  const call = httpRequest(
83364
83392
  { host: "127.0.0.1", port, path: TARGET_PATH, method: "PUT", timeout: 2e3 },
83365
83393
  (response) => {
83366
83394
  response.resume();
83367
- resolve25(response.statusCode === 204);
83395
+ resolve26(response.statusCode === 204);
83368
83396
  }
83369
83397
  );
83370
83398
  call.setHeader(KEY_HEADER, key);
83371
83399
  call.setHeader("content-type", "application/json");
83372
83400
  call.once("timeout", () => call.destroy());
83373
- call.once("error", () => resolve25(false));
83401
+ call.once("error", () => resolve26(false));
83374
83402
  call.end(JSON.stringify({ target, expiresAt }));
83375
83403
  });
83376
83404
  }
@@ -83419,15 +83447,15 @@ async function startCdpBridge({
83419
83447
  (socket) => relayPage({ client: socket, targetId, target: url2, proxy })
83420
83448
  );
83421
83449
  });
83422
- await new Promise((resolve25) => server.listen(0, "127.0.0.1", resolve25));
83450
+ await new Promise((resolve26) => server.listen(0, "127.0.0.1", resolve26));
83423
83451
  const port = server.address().port;
83424
83452
  return {
83425
83453
  port,
83426
- close: () => new Promise((resolve25) => {
83454
+ close: () => new Promise((resolve26) => {
83427
83455
  for (const client of relayed) client.destroy();
83428
83456
  pages.close();
83429
83457
  server.closeAllConnections();
83430
- server.close(() => resolve25());
83458
+ server.close(() => resolve26());
83431
83459
  })
83432
83460
  };
83433
83461
  }
@@ -83444,7 +83472,7 @@ function launchCdpBridge({
83444
83472
  stdio: ["ignore", "pipe", "ignore"],
83445
83473
  env: { ...env, LAZE_CDP_TARGET: target, LAZE_CDP_EXPIRES_AT: expiresAt, LAZE_CDP_KEY: key }
83446
83474
  });
83447
- return new Promise((resolve25, reject) => {
83475
+ return new Promise((resolve26, reject) => {
83448
83476
  let printed2 = "";
83449
83477
  child.once("error", reject);
83450
83478
  child.once("exit", (code) => reject(new Error(`the CDP bridge stopped (${code})`)));
@@ -83455,7 +83483,7 @@ function launchCdpBridge({
83455
83483
  child.stdout.destroy();
83456
83484
  child.removeAllListeners("exit");
83457
83485
  child.unref();
83458
- if (Number.isInteger(port) && port > 0) resolve25(port);
83486
+ if (Number.isInteger(port) && port > 0) resolve26(port);
83459
83487
  else reject(new Error("the CDP bridge printed no port"));
83460
83488
  });
83461
83489
  });
@@ -86479,6 +86507,7 @@ var pairingRefDefinition = external_exports.object({
86479
86507
  var whatsappPairingRefSchema = pairingRefDefinition;
86480
86508
  var restPairingRefDefinition = external_exports.object({ pairingId: external_exports.string().min(1).max(64) });
86481
86509
  var restChatsDefinition = chatsInputDefinition.omit({ workspaceId: true });
86510
+ var restSyncDefinition = external_exports.object({ machine: whatsappMachineRef });
86482
86511
  var restReadDefinition = readInputDefinition.omit({ workspaceId: true });
86483
86512
  var restFileDefinition = fileInputDefinition.omit({ workspaceId: true });
86484
86513
  var restSendDefinition = sendInputDefinition.omit({ workspaceId: true });
@@ -86489,7 +86518,8 @@ var COMPUTE_WHATSAPP_REST_PATHS = {
86489
86518
  file: "/api/compute/whatsapp/file",
86490
86519
  send: "/api/compute/whatsapp/send",
86491
86520
  sendStatus: "/api/compute/whatsapp/send-status",
86492
- unpair: "/api/compute/whatsapp/unpair"
86521
+ unpair: "/api/compute/whatsapp/unpair",
86522
+ sync: "/api/compute/whatsapp/sync"
86493
86523
  };
86494
86524
 
86495
86525
  // ../../modules/compute/contract/src/own-machine.ts
@@ -86775,6 +86805,8 @@ var loginTerminalDefinition = external_exports.discriminatedUnion("status", [
86775
86805
  })
86776
86806
  ]);
86777
86807
  var loginTerminalSchema = loginTerminalDefinition;
86808
+ var warmComputerDefinition = external_exports.object({ status: external_exports.enum(["starting", "ready"]) });
86809
+ var warmComputerSchema = warmComputerDefinition;
86778
86810
  var screenRefDefinition = external_exports.object({ workspaceId: workspaceIdSchema22, sessionId: idSchema23 });
86779
86811
  var screenRefSchema = screenRefDefinition;
86780
86812
  var screenSessionDefinition = external_exports.object({
@@ -86816,7 +86848,7 @@ var ownMachineSshConnectSchema = ownMachineSshConnectDefinition;
86816
86848
  var reconcileDefinition = external_exports.object({ workspaceId: workspaceIdSchema22, machineId: idSchema23 });
86817
86849
  var ComputeApi = moduleApi()("compute");
86818
86850
  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();
86819
- var computeFleetTrpc = defineTrpcContract("compute").query("whatsappComputer").withInput(whatsappComputerInputSchema).withOutput(whatsappComputerSchema).mutation("prepareWhatsappComputer").withInput(whatsappComputerInputSchema).withOutput(whatsappComputerSchema).query("myComputers").withInput(computeWorkspaceInputSchema).withOutput(myComputersSchema).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).build();
86851
+ 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).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).build();
86820
86852
  var computeTrpc = joinTrpcContracts("compute", computeCoreTrpc, computeFleetTrpc);
86821
86853
  var restMachineInputDefinition = external_exports.object({ machine: external_exports.string().min(1).max(64) });
86822
86854
  var restRenameInputDefinition = external_exports.object({
@@ -87371,7 +87403,8 @@ async function computer({ context, args }) {
87371
87403
  import { readFile as readFile28 } from "node:fs/promises";
87372
87404
 
87373
87405
  // src/services/mcp-gateway.service.ts
87374
- import { readFile as readFile27 } from "node:fs/promises";
87406
+ import { mkdir as mkdir23, readFile as readFile27, writeFile as writeFile22 } from "node:fs/promises";
87407
+ import { basename as basename9, join as join26, resolve as resolve12 } from "node:path";
87375
87408
  import { createInterface as createInterface3 } from "node:readline";
87376
87409
  var TURN_HEADER = "x-laze-turn";
87377
87410
  function serveMcpGateway({
@@ -87421,6 +87454,7 @@ async function relayMcpLines({
87421
87454
  const relay2 = {
87422
87455
  readTurn,
87423
87456
  out: (text3) => context.out(text3),
87457
+ saveFile: (file4) => saveMailFile({ root: resolve12(context.cwd, MAIL_FILES_DIR), file: file4 }),
87424
87458
  post: async ({ line, turn }) => {
87425
87459
  const response = await context.fetcher(url2, {
87426
87460
  method: "POST",
@@ -87446,13 +87480,84 @@ async function relayMcpLines({
87446
87480
  clearInterval(timer);
87447
87481
  }
87448
87482
  }
87483
+ var MAIL_FILES_DIR = "mail-attachments";
87484
+ var SAVES_FILES_META = "laze/files";
87485
+ var FILE_META = "laze/file";
87486
+ function safeName(name3, fallback) {
87487
+ const printable = name3.replace(new RegExp("\\p{Cc}", "gu"), "");
87488
+ const last = basename9(printable.replaceAll("\\", "/"));
87489
+ return last && last !== "." && last !== ".." ? last : fallback;
87490
+ }
87491
+ async function saveMailFile({ root, file: file4 }) {
87492
+ const dir = join26(root, safeName(file4.messageId, "message"));
87493
+ const path = join26(dir, safeName(file4.fileName, "attachment"));
87494
+ await mkdir23(dir, { recursive: true });
87495
+ await writeFile22(path, Buffer.from(file4.base64, "base64"));
87496
+ return path;
87497
+ }
87498
+ function markSavesFiles(line) {
87499
+ try {
87500
+ const request2 = JSON.parse(line);
87501
+ if (request2.method !== "tools/call" || typeof request2.params !== "object" || !request2.params)
87502
+ return line;
87503
+ const meta3 = request2.params._meta;
87504
+ const own2 = typeof meta3 === "object" && meta3 !== null ? meta3 : {};
87505
+ request2.params._meta = { ...own2, [SAVES_FILES_META]: "save" };
87506
+ return JSON.stringify(request2);
87507
+ } catch {
87508
+ return line;
87509
+ }
87510
+ }
87511
+ function carriedFileOf(value) {
87512
+ if (typeof value !== "object" || value === null) return null;
87513
+ const file4 = value;
87514
+ const text3 = (key) => typeof file4[key] === "string" ? file4[key] : "";
87515
+ if (text3("base64") === "" && file4.sizeBytes !== 0) return null;
87516
+ return {
87517
+ messageId: text3("messageId"),
87518
+ fileName: text3("fileName"),
87519
+ contentType: text3("contentType") || "application/octet-stream",
87520
+ sizeBytes: typeof file4.sizeBytes === "number" ? file4.sizeBytes : 0,
87521
+ base64: text3("base64")
87522
+ };
87523
+ }
87524
+ async function withFileSaved({ relay: relay2, text: text3 }) {
87525
+ let answer6;
87526
+ try {
87527
+ answer6 = JSON.parse(text3);
87528
+ } catch {
87529
+ return text3;
87530
+ }
87531
+ const result2 = answer6.result;
87532
+ const meta3 = result2?._meta;
87533
+ if (!result2 || !meta3 || !(FILE_META in meta3)) return text3;
87534
+ const file4 = carriedFileOf(meta3[FILE_META]);
87535
+ const { [FILE_META]: _carried, ...rest } = meta3;
87536
+ const kept = Object.keys(rest).length > 0 ? { _meta: rest } : {};
87537
+ const { _meta: _old, ...plain3 } = result2;
87538
+ if (!file4) {
87539
+ const content = [{ type: "text", text: "The gateway sent a file this CLI could not read." }];
87540
+ return JSON.stringify({ ...answer6, result: { ...plain3, ...kept, content, isError: true } });
87541
+ }
87542
+ const what = `${file4.fileName} (${file4.contentType}, ${file4.sizeBytes} bytes)`;
87543
+ try {
87544
+ const path = await relay2.saveFile(file4);
87545
+ const content = [{ type: "text", text: `Saved ${what} to ${path}` }];
87546
+ return JSON.stringify({ ...answer6, result: { ...plain3, ...kept, content } });
87547
+ } catch (error63) {
87548
+ const why = error63 instanceof Error ? error63.message : "it could not be written";
87549
+ const content = [{ type: "text", text: `Could not save ${what}: ${why}` }];
87550
+ return JSON.stringify({ ...answer6, result: { ...plain3, ...kept, content, isError: true } });
87551
+ }
87552
+ }
87449
87553
  async function relayLine({
87450
87554
  relay: relay2,
87451
87555
  listed,
87452
87556
  line
87453
87557
  }) {
87454
87558
  const turn = await relay2.readTurn();
87455
- const text3 = await relay2.post({ line, turn });
87559
+ const posted = await relay2.post({ line: markSavesFiles(line), turn });
87560
+ const text3 = methodOf(line) === "tools/call" ? await withFileSaved({ relay: relay2, text: posted }) : posted;
87456
87561
  if (methodOf(line) === "tools/list") {
87457
87562
  const names = toolNamesOf(text3);
87458
87563
  if (names !== null) Object.assign(listed, { names, turn });
@@ -87563,7 +87668,7 @@ async function connect({
87563
87668
 
87564
87669
  // src/services/connector-commands.service.ts
87565
87670
  import { readFile as readFile30 } from "node:fs/promises";
87566
- import { resolve as resolve12 } from "node:path";
87671
+ import { resolve as resolve13 } from "node:path";
87567
87672
 
87568
87673
  // src/services/vault-keychain-commands.service.ts
87569
87674
  import { readFile as readFile29 } from "node:fs/promises";
@@ -88217,7 +88322,7 @@ async function keyText({ context, args }) {
88217
88322
  throw new CliUsageError("A key never goes in a flag: pipe it on stdin or use --from-file.");
88218
88323
  }
88219
88324
  const file4 = flagText({ args, name: "from-file" });
88220
- const text3 = file4 ? await readFile30(resolve12(context.cwd, file4), "utf8") : await context.readStdin();
88325
+ const text3 = file4 ? await readFile30(resolve13(context.cwd, file4), "utf8") : await context.readStdin();
88221
88326
  const trimmed = text3.trim();
88222
88327
  if (!trimmed) throw new CliUsageError("No key: pipe it on stdin or use --from-file.");
88223
88328
  return trimmed;
@@ -88539,7 +88644,7 @@ async function conversationDelete({ context, args }) {
88539
88644
 
88540
88645
  // src/services/discord-commands.service.ts
88541
88646
  import { readFile as readFile31 } from "node:fs/promises";
88542
- import { resolve as resolve13 } from "node:path";
88647
+ import { resolve as resolve14 } from "node:path";
88543
88648
 
88544
88649
  // ../../modules/discord/contract/src/discord.ts
88545
88650
  var workspaceIdSchema24 = external_exports.string().min(1).max(64);
@@ -88860,7 +88965,7 @@ async function secretsOf({ context, args }) {
88860
88965
  const fromConnection = flagText({ args, name: "from-vault" });
88861
88966
  if (fromConnection) return { fromConnection };
88862
88967
  const file4 = flagText({ args, name: "from-file" });
88863
- const text3 = file4 ? await readFile31(resolve13(context.cwd, file4), "utf8") : await context.readStdin();
88968
+ const text3 = file4 ? await readFile31(resolve14(context.cwd, file4), "utf8") : await context.readStdin();
88864
88969
  const lines2 = text3.split("\n").map((line) => line.trim()).filter(Boolean);
88865
88970
  if (lines2.length !== 2) {
88866
88971
  throw new CliUsageError(
@@ -89130,8 +89235,8 @@ var DOMAINS_USAGE = `Usage:
89130
89235
  var printJson5 = (context, data) => context.out(`${JSON.stringify(data, null, 2)}
89131
89236
  `);
89132
89237
  function printDomain(context, row) {
89133
- const join33 = row.autoJoin ? "auto-join on" : "auto-join off";
89134
- context.out(`${row.domain} ${join33}${row.enforced ? " single sign-on enforced" : ""}
89238
+ const join34 = row.autoJoin ? "auto-join on" : "auto-join off";
89239
+ context.out(`${row.domain} ${join34}${row.enforced ? " single sign-on enforced" : ""}
89135
89240
  `);
89136
89241
  }
89137
89242
  async function list4({ context, args }) {
@@ -89164,7 +89269,7 @@ async function domains({ context, args }) {
89164
89269
 
89165
89270
  // src/services/emoji-commands.service.ts
89166
89271
  import { readFile as readFile32 } from "node:fs/promises";
89167
- import { resolve as resolve14 } from "node:path";
89272
+ import { resolve as resolve15 } from "node:path";
89168
89273
  var EMOJI_USAGE = `Usage:
89169
89274
  laze emoji list [--json] the workspace's custom emoji, aliases and who added each
89170
89275
  laze emoji add <name> <file> [--alias <a,b>] add a PNG, JPEG or GIF as :name: (made 128px square)
@@ -89204,7 +89309,7 @@ async function addEmoji({ context, args, client }) {
89204
89309
  const file4 = wordAt4(args, 3);
89205
89310
  let bytes;
89206
89311
  try {
89207
- bytes = new Uint8Array(await readFile32(resolve14(context.cwd, file4)));
89312
+ bytes = new Uint8Array(await readFile32(resolve15(context.cwd, file4)));
89208
89313
  } catch {
89209
89314
  throw new CliUsageError(`Cannot read ${file4}.`);
89210
89315
  }
@@ -89521,7 +89626,7 @@ var ExternalSharingHooksToken = externalUi.hooks("sharing");
89521
89626
 
89522
89627
  // src/services/workspace-commands.service.ts
89523
89628
  import { readFile as readFile33 } from "node:fs/promises";
89524
- import { resolve as resolve15 } from "node:path";
89629
+ import { resolve as resolve16 } from "node:path";
89525
89630
  var ROLE_NAMES2 = {
89526
89631
  OWNER: "Owner",
89527
89632
  ADMIN: "Admin",
@@ -89703,7 +89808,7 @@ var LOGO_USAGE = "Usage: laze workspace logo set <file.png|jpg|webp> | laze work
89703
89808
  async function readLogo({ context, file: file4 }) {
89704
89809
  let bytes;
89705
89810
  try {
89706
- bytes = new Uint8Array(await readFile33(resolve15(context.cwd, file4)));
89811
+ bytes = new Uint8Array(await readFile33(resolve16(context.cwd, file4)));
89707
89812
  } catch {
89708
89813
  throw new CliUsageError(`No file to read at ${file4}.`);
89709
89814
  }
@@ -90304,7 +90409,7 @@ async function agentFeedAccess({
90304
90409
 
90305
90410
  // src/services/feed-commands.service.ts
90306
90411
  import { readFile as readFile34 } from "node:fs/promises";
90307
- import { resolve as resolve16 } from "node:path";
90412
+ import { resolve as resolve17 } from "node:path";
90308
90413
 
90309
90414
  // ../../modules/feed/contract/src/feed.delegate.ts
90310
90415
  var feedDelegateSchemaDefinition = external_exports.object({
@@ -91218,15 +91323,24 @@ var FEED_WRITING = `Write for a person deciding on a phone in a few seconds:
91218
91323
  no "Day 9." counters. Numbers only when they change the decision.
91219
91324
  - Not too terse either: whole sentences a person understands without context.
91220
91325
  - Replies and comments: same rules, short when you can.
91221
- - When you prepare a message for a person to send (email, Slack, LinkedIn), post a card
91222
- with the full text in --draft, the recipients and subject in
91326
+ - Anything for people outside the conversation (an email, a Slack, WhatsApp or LinkedIn
91327
+ message to someone else, a post) is a draft for your person first, on a card: a one-line
91328
+ ask as the title, the full text in --draft, the recipients and subject in
91223
91329
  --draft-header "To: ...
91224
91330
  Cc: ...
91225
- Subject: ...", an action to send it
91226
- (--action "Send it=<what to do>") and a --link to the exact draft
91227
- ("Open draft in Gmail=https://mail.google.com/mail/u/0/#drafts?compose=<draft message id>",
91228
- not the drafts folder). Never leave it only in Gmail drafts. If they edit the text on the
91229
- card, the press brings you the edited text: update the native draft with it, then send.
91331
+ Subject: ...", --action "Send it=<what to do>" and a
91332
+ --link that opens the original in its own app: for Gmail
91333
+ "Open thread with the draft=https://mail.google.com/mail/u/0/#all/<thread id>", else the
91334
+ Slack, WhatsApp or LinkedIn thread or the GitHub PR. For example:
91335
+ laze feed post "Reply to Dana about the renewal" --summary "She asked for the price by
91336
+ Friday" --draft @reply.md --draft-header "To: dana@acme.test
91337
+ Subject: Re: Renewal"
91338
+ --link "Open thread with the draft=https://mail.google.com/mail/u/0/#all/<thread id>"
91339
+ --action "Send it=Send this reply"
91340
+ - Send it only when they pressed Send on the card or told you in chat to send that exact
91341
+ message; a send approval card is not their review. After a send, say what went to whom.
91342
+ Never leave a draft only in Gmail drafts. If they edit the text on the card, the press
91343
+ brings you the edited text: update the native draft with it, then send.
91230
91344
  - A draft that sends a file carries the file: pass it with --file. Never name a file you
91231
91345
  did not attach; "Attach: deck.pdf" without a file is stopped unless you pass --force.
91232
91346
  The server pushes back with feed_hard_to_read when the text reads like a log, and with
@@ -91460,7 +91574,7 @@ async function bodyOf2({
91460
91574
  flags: flags2
91461
91575
  }) {
91462
91576
  const body = { ...flags2.fields };
91463
- const read4 = (source) => "file" in source ? readFile34(resolve16(context.cwd, source.file), "utf8") : source.text;
91577
+ const read4 = (source) => "file" in source ? readFile34(resolve17(context.cwd, source.file), "utf8") : source.text;
91464
91578
  for (const [field, source] of Object.entries(flags2.texts)) body[field] = await read4(source);
91465
91579
  if (flags2.rich) {
91466
91580
  const text3 = await read4(flags2.rich.source);
@@ -91723,7 +91837,7 @@ async function textFlag({
91723
91837
  }) {
91724
91838
  const value = flagText({ args, name: name3 });
91725
91839
  if (!value.startsWith("@")) return value;
91726
- return readFile34(resolve16(context.cwd, value.slice(1)), "utf8");
91840
+ return readFile34(resolve17(context.cwd, value.slice(1)), "utf8");
91727
91841
  }
91728
91842
  async function feedList({ context, args }) {
91729
91843
  const { client } = await signedIn({ context, args });
@@ -91813,7 +91927,7 @@ async function ranksOf({
91813
91927
  }) {
91814
91928
  const file4 = flagText({ args, name: "file" });
91815
91929
  if (file4) {
91816
- const parsed = JSON.parse(await readFile34(resolve16(context.cwd, file4), "utf8"));
91930
+ const parsed = JSON.parse(await readFile34(resolve17(context.cwd, file4), "utf8"));
91817
91931
  if (Array.isArray(parsed)) return parsed;
91818
91932
  throw new CliUsageError("--file holds a list of {itemId, priority}");
91819
91933
  }
@@ -92425,6 +92539,10 @@ function heldLine(sent) {
92425
92539
  const saved3 = `Saved ${held} ${held === 1 ? "invitation" : "invitations"} for Team: Free holds 2 people.`;
92426
92540
  return emailed > 0 ? `Invited ${emailed}. ${saved3}` : saved3;
92427
92541
  }
92542
+ function personLines(sent) {
92543
+ return sent.invites.flatMap((one) => one.personId ? [`${one.email} is person ${one.personId}.
92544
+ `] : []).join("");
92545
+ }
92428
92546
  function refusedLines(refused) {
92429
92547
  const why = { invalid: "not an email address", duplicate: "listed twice", member: "already in" };
92430
92548
  return refused.map((one) => `Left out ${one.email}: ${why[one.reason]}.
@@ -92458,6 +92576,7 @@ async function invite3({ context, args }) {
92458
92576
  return;
92459
92577
  }
92460
92578
  context.out(refusedLines(sent.refused));
92579
+ context.out(personLines(sent));
92461
92580
  if (!quote4.upgradeNeeded) {
92462
92581
  context.out(`Invited ${sent.invites.length}.${sent.held ? " Some wait for seats." : ""}
92463
92582
  `);
@@ -92635,12 +92754,12 @@ async function ip({ context, args }) {
92635
92754
  }
92636
92755
 
92637
92756
  // src/services/join-commands.service.ts
92638
- import { mkdir as mkdir23, readFile as readFile36, rename as rename8, rm as rm14, writeFile as writeFile22 } from "node:fs/promises";
92639
- import { dirname as dirname23, join as join26 } from "node:path";
92757
+ import { mkdir as mkdir24, readFile as readFile36, rename as rename8, rm as rm14, writeFile as writeFile23 } from "node:fs/promises";
92758
+ import { dirname as dirname23, join as join27 } from "node:path";
92640
92759
  var DEFAULT_WAIT_SECONDS2 = 100;
92641
92760
  var JOIN_USAGE = "Usage: laze join [--workspace <name|id|invite link>] [--for <email>] [--name <name>] [--note <text>] [--timeout <seconds>] [--project <folder>]";
92642
92761
  function pendingPathOf({ context }) {
92643
- return join26(dirname23(context.environment.configPath), "join", "pending.json");
92762
+ return join27(dirname23(context.environment.configPath), "join", "pending.json");
92644
92763
  }
92645
92764
  async function readPending({
92646
92765
  context,
@@ -92657,9 +92776,9 @@ async function readPending({
92657
92776
  }
92658
92777
  async function keepPending({ context, pending: pending2 }) {
92659
92778
  const path = pendingPathOf({ context });
92660
- await mkdir23(dirname23(path), { recursive: true, mode: 448 });
92779
+ await mkdir24(dirname23(path), { recursive: true, mode: 448 });
92661
92780
  const temporary = `${path}.${process.pid}.tmp`;
92662
- await writeFile22(temporary, JSON.stringify(pending2), { mode: 384 });
92781
+ await writeFile23(temporary, JSON.stringify(pending2), { mode: 384 });
92663
92782
  await rename8(temporary, path);
92664
92783
  }
92665
92784
  async function dropPending({ context }) {
@@ -93798,17 +93917,17 @@ async function serveMcp({
93798
93917
 
93799
93918
  // src/services/memory-commands.service.ts
93800
93919
  import { readdir as readdir7, readFile as readFile38 } from "node:fs/promises";
93801
- import { join as join27, resolve as resolve18 } from "node:path";
93920
+ import { join as join28, resolve as resolve19 } from "node:path";
93802
93921
 
93803
93922
  // src/services/mount-files.service.ts
93804
- import { mkdir as mkdir24, readFile as readFile37, rm as rm15, writeFile as writeFile23 } from "node:fs/promises";
93805
- import { dirname as dirname24, relative as relative5, resolve as resolve17 } from "node:path";
93923
+ import { mkdir as mkdir25, readFile as readFile37, rm as rm15, writeFile as writeFile24 } from "node:fs/promises";
93924
+ import { dirname as dirname24, relative as relative5, resolve as resolve18 } from "node:path";
93806
93925
  async function textArgument({
93807
93926
  context,
93808
93927
  value
93809
93928
  }) {
93810
93929
  if (value === "-") return context.readStdin();
93811
- if (value.startsWith("@")) return readFile37(resolve17(context.cwd, value.slice(1)), "utf8");
93930
+ if (value.startsWith("@")) return readFile37(resolve18(context.cwd, value.slice(1)), "utf8");
93812
93931
  return value;
93813
93932
  }
93814
93933
  function turnChannel({ context, args }) {
@@ -93820,16 +93939,16 @@ async function writeMount({
93820
93939
  folder,
93821
93940
  files: files2
93822
93941
  }) {
93823
- const root = resolve17(context.cwd, flagText({ args, name: "dir", fallback: ".laze" }), folder);
93942
+ const root = resolve18(context.cwd, flagText({ args, name: "dir", fallback: ".laze" }), folder);
93824
93943
  await rm15(root, { recursive: true, force: true });
93825
- await mkdir24(root, { recursive: true });
93944
+ await mkdir25(root, { recursive: true });
93826
93945
  for (const file4 of files2) {
93827
- const target = resolve17(root, file4.path);
93946
+ const target = resolve18(root, file4.path);
93828
93947
  const inside = relative5(root, target);
93829
93948
  if (!inside || inside.startsWith(".."))
93830
93949
  throw new Error(`Refusing to write outside ${root}: ${file4.path}`);
93831
- await mkdir24(dirname24(target), { recursive: true });
93832
- await writeFile23(target, file4.content);
93950
+ await mkdir25(dirname24(target), { recursive: true });
93951
+ await writeFile24(target, file4.content);
93833
93952
  }
93834
93953
  return root;
93835
93954
  }
@@ -94084,16 +94203,16 @@ async function siestaImport({
94084
94203
  args,
94085
94204
  dir
94086
94205
  }) {
94087
- const root = resolve18(context.cwd, dir);
94088
- const log = await readFile38(join27(root, "LOG.md"));
94089
- const names = (await readdir7(join27(root, "tree")).catch(() => [])).filter(
94206
+ const root = resolve19(context.cwd, dir);
94207
+ const log = await readFile38(join28(root, "LOG.md"));
94208
+ const names = (await readdir7(join28(root, "tree")).catch(() => [])).filter(
94090
94209
  (name3) => /^\d{1,6}-\d{1,6}\.md$/.test(name3)
94091
94210
  );
94092
94211
  const tree = Object.fromEntries(
94093
94212
  await Promise.all(
94094
94213
  names.map(async (name3) => [
94095
94214
  name3.slice(0, -3),
94096
- (await readFile38(join27(root, "tree", name3))).toString("base64")
94215
+ (await readFile38(join28(root, "tree", name3))).toString("base64")
94097
94216
  ])
94098
94217
  )
94099
94218
  );
@@ -94112,16 +94231,16 @@ async function memoryImport({ context, args }) {
94112
94231
  if (siesta) return siestaImport({ context, args, dir: siesta });
94113
94232
  const dir = flagText({ args, name: "optmem" });
94114
94233
  if (!dir) throw new CliUsageError(USAGE13);
94115
- const root = resolve18(context.cwd, dir);
94116
- const log = await readFile38(join27(root, "LOG.txt"));
94117
- const sizes2 = (await readdir7(join27(root, "TREE")).catch(() => [])).filter(
94234
+ const root = resolve19(context.cwd, dir);
94235
+ const log = await readFile38(join28(root, "LOG.txt"));
94236
+ const sizes2 = (await readdir7(join28(root, "TREE")).catch(() => [])).filter(
94118
94237
  (name3) => /^\d{1,4}$/.test(name3)
94119
94238
  );
94120
94239
  const tree = Object.fromEntries(
94121
94240
  await Promise.all(
94122
94241
  sizes2.map(async (size) => [
94123
94242
  size,
94124
- (await readFile38(join27(root, "TREE", size))).toString("base64")
94243
+ (await readFile38(join28(root, "TREE", size))).toString("base64")
94125
94244
  ])
94126
94245
  )
94127
94246
  );
@@ -94482,7 +94601,7 @@ async function notifications({ context, args }) {
94482
94601
  }
94483
94602
 
94484
94603
  // src/services/openclaw-commands.service.ts
94485
- import { resolve as resolve19 } from "node:path";
94604
+ import { resolve as resolve20 } from "node:path";
94486
94605
  var OPENCLAW_USAGE = `Usage (a person's key; a gateway belongs to the person who connects it):
94487
94606
  laze openclaw list the gateways connected here and their agents
94488
94607
  laze openclaw connect <wss url> [--label <label>] (< token | --from-file <file> | --from-vault <connection>)
@@ -94633,7 +94752,7 @@ var agentKey = async ({ context, args, client, url: url2 }) => {
94633
94752
  });
94634
94753
  const login2 = flagText({ args, name: "login" });
94635
94754
  if (login2) {
94636
- const folder = resolve19(context.cwd, login2);
94755
+ const folder = resolve20(context.cwd, login2);
94637
94756
  const profile = profileNameOf(key.agentName);
94638
94757
  await signInFolder({ context, url: url2, token: key.token, name: profile, folder });
94639
94758
  context.out(
@@ -94686,8 +94805,8 @@ async function openclaw({
94686
94805
 
94687
94806
  // src/services/operator-key-commands.service.ts
94688
94807
  import { createHash as createHash7, randomBytes as randomBytes3 } from "node:crypto";
94689
- import { mkdir as mkdir25, readFile as readFile39, rm as rm16, writeFile as writeFile24 } from "node:fs/promises";
94690
- import { dirname as dirname25, join as join28 } from "node:path";
94808
+ import { mkdir as mkdir26, readFile as readFile39, rm as rm16, writeFile as writeFile25 } from "node:fs/promises";
94809
+ import { dirname as dirname25, join as join29 } from "node:path";
94691
94810
 
94692
94811
  // ../../modules/audit-log/contract/src/audit-log.api.ts
94693
94812
  var auditEntrySchemaDefinition = external_exports.object({
@@ -95122,9 +95241,20 @@ var workspaceInviteSchemaDefinition = external_exports.object({
95122
95241
  /** Where the invited person lands on joining; null for the workspace's Home. */
95123
95242
  landing: inviteLandingSchema.nullable().optional(),
95124
95243
  /** Held for Team, so its seat is paid for from the checkout on, before anyone accepts. */
95125
- seatReserved: external_exports.boolean().optional()
95244
+ seatReserved: external_exports.boolean().optional(),
95245
+ /** The invited person's id: members message them and give them things before they join. */
95246
+ personId: external_exports.string().optional()
95126
95247
  });
95127
95248
  var workspaceInviteSchema = workspaceInviteSchemaDefinition;
95249
+ var workspaceInviteeSchemaDefinition = external_exports.object({
95250
+ userId: external_exports.string().min(1),
95251
+ inviteId: external_exports.string().min(1),
95252
+ email: external_exports.string(),
95253
+ status: external_exports.enum(["pending", "held", "expired"]),
95254
+ invitedByUserId: external_exports.string(),
95255
+ invitedAt: external_exports.iso.datetime()
95256
+ });
95257
+ var workspaceInviteeSchema = workspaceInviteeSchemaDefinition;
95128
95258
  var invitePreviewSchemaDefinition = external_exports.object({
95129
95259
  workspaceName: external_exports.string(),
95130
95260
  email: external_exports.string(),
@@ -95263,7 +95393,7 @@ var settingsCopy = {
95263
95393
  paintOnly: true,
95264
95394
  storable: (copy2) => copy2
95265
95395
  };
95266
- var workspaceTrpc = defineTrpcContract("workspace").mutation("create").withInput(createWorkspaceInputSchema).withOutput(workspaceCreatedSchema).query("get", { mirrored: settingsCopy }).withInput(workspaceIdInputSchema).withOutput(workspaceSchema).query("mine").withInput(external_exports.object({})).withOutput(external_exports.array(myWorkspaceSchema)).query("members").withInput(workspaceIdInputSchema).withOutput(external_exports.array(workspaceMemberSchema)).query("myMembership").withInput(workspaceIdInputSchema).withOutput(workspaceMemberSchema.nullable()).mutation("setMyAliases").withInput(setAliasesInputSchema).withOutput(workspaceMemberSchema).mutation("changeRole").withInput(changeRoleInputSchema).withOutput(workspaceMemberSchema).mutation("removeMember").withInput(removeMemberInputSchema2).withOutput(external_exports.object({ removed: external_exports.literal(true) })).mutation("leave").withInput(workspaceIdInputSchema).withOutput(external_exports.object({ left: external_exports.literal(true) })).mutation("invite").withInput(inviteMemberInputSchema).withOutput(workspaceInviteSchema).mutation("inviteMany").withInput(inviteManyInputSchema).withOutput(inviteManyResultSchema).mutation("requestInvites").withInput(inviteManyInputSchema).withOutput(requestInvitesResultSchema).query("invites").withInput(workspaceIdInputSchema).withOutput(external_exports.array(workspaceInviteSchema)).mutation("revokeInvite").withInput(revokeInviteInputSchema).withOutput(external_exports.object({ revoked: external_exports.literal(true) })).mutation("copyInviteLink").withInput(revokeInviteInputSchema).withOutput(copiedInviteLinkSchema).query("previewInvite").withInput(inviteLinkInputSchema).withOutput(invitePreviewSchema).mutation("acceptInvite").withInput(inviteLinkInputSchema).withOutput(acceptedInviteSchema).mutation("rename").withInput(renameWorkspaceInputSchema).withOutput(workspaceSchema).mutation("setLogo").withInput(setWorkspaceLogoInputSchema).withOutput(workspaceSchema).mutation("removeLogo").withInput(workspaceIdInputSchema).withOutput(workspaceSchema).mutation("delete").withInput(deleteWorkspaceInputSchema).withOutput(workspaceSchema).mutation("cancelDeletion").withInput(workspaceIdInputSchema).withOutput(workspaceSchema).mutation("requestInvite").withInput(requestInviteInputSchema).withOutput(accessRequestSchema).query("accessRequests").withInput(workspaceIdInputSchema).withOutput(external_exports.array(accessRequestSchema)).mutation("decideAccessRequest").withInput(decideAccessRequestInputSchema).withOutput(accessRequestSchema).mutation("withdrawJoinRequest").withInput(external_exports.object({ workspaceId: external_exports.string().min(1), requestId: external_exports.string().min(1) })).withOutput(accessRequestSchema).query("groups").withInput(workspaceIdInputSchema).withOutput(external_exports.array(workspaceGroupSchema)).mutation("createGroup").withInput(createGroupInputSchema).withOutput(workspaceGroupSchema).mutation("renameGroup").withInput(renameGroupInputSchema).withOutput(workspaceGroupSchema).mutation("deleteGroup").withInput(groupInputSchema).withOutput(external_exports.object({ deleted: external_exports.literal(true) })).mutation("changeGroupMembers").withInput(changeGroupMembersInputSchema).withOutput(workspaceGroupSchema).build();
95396
+ var workspaceTrpc = defineTrpcContract("workspace").mutation("create").withInput(createWorkspaceInputSchema).withOutput(workspaceCreatedSchema).query("get", { mirrored: settingsCopy }).withInput(workspaceIdInputSchema).withOutput(workspaceSchema).query("mine").withInput(external_exports.object({})).withOutput(external_exports.array(myWorkspaceSchema)).query("members").withInput(workspaceIdInputSchema).withOutput(external_exports.array(workspaceMemberSchema)).query("myMembership").withInput(workspaceIdInputSchema).withOutput(workspaceMemberSchema.nullable()).mutation("setMyAliases").withInput(setAliasesInputSchema).withOutput(workspaceMemberSchema).mutation("changeRole").withInput(changeRoleInputSchema).withOutput(workspaceMemberSchema).mutation("removeMember").withInput(removeMemberInputSchema2).withOutput(external_exports.object({ removed: external_exports.literal(true) })).mutation("leave").withInput(workspaceIdInputSchema).withOutput(external_exports.object({ left: external_exports.literal(true) })).mutation("invite").withInput(inviteMemberInputSchema).withOutput(workspaceInviteSchema).mutation("inviteMany").withInput(inviteManyInputSchema).withOutput(inviteManyResultSchema).mutation("requestInvites").withInput(inviteManyInputSchema).withOutput(requestInvitesResultSchema).query("invites").withInput(workspaceIdInputSchema).withOutput(external_exports.array(workspaceInviteSchema)).query("invitees").withInput(workspaceIdInputSchema).withOutput(external_exports.array(workspaceInviteeSchema)).mutation("revokeInvite").withInput(revokeInviteInputSchema).withOutput(external_exports.object({ revoked: external_exports.literal(true) })).mutation("copyInviteLink").withInput(revokeInviteInputSchema).withOutput(copiedInviteLinkSchema).query("previewInvite").withInput(inviteLinkInputSchema).withOutput(invitePreviewSchema).mutation("acceptInvite").withInput(inviteLinkInputSchema).withOutput(acceptedInviteSchema).mutation("rename").withInput(renameWorkspaceInputSchema).withOutput(workspaceSchema).mutation("setLogo").withInput(setWorkspaceLogoInputSchema).withOutput(workspaceSchema).mutation("removeLogo").withInput(workspaceIdInputSchema).withOutput(workspaceSchema).mutation("delete").withInput(deleteWorkspaceInputSchema).withOutput(workspaceSchema).mutation("cancelDeletion").withInput(workspaceIdInputSchema).withOutput(workspaceSchema).mutation("requestInvite").withInput(requestInviteInputSchema).withOutput(accessRequestSchema).query("accessRequests").withInput(workspaceIdInputSchema).withOutput(external_exports.array(accessRequestSchema)).mutation("decideAccessRequest").withInput(decideAccessRequestInputSchema).withOutput(accessRequestSchema).mutation("withdrawJoinRequest").withInput(external_exports.object({ workspaceId: external_exports.string().min(1), requestId: external_exports.string().min(1) })).withOutput(accessRequestSchema).query("groups").withInput(workspaceIdInputSchema).withOutput(external_exports.array(workspaceGroupSchema)).mutation("createGroup").withInput(createGroupInputSchema).withOutput(workspaceGroupSchema).mutation("renameGroup").withInput(renameGroupInputSchema).withOutput(workspaceGroupSchema).mutation("deleteGroup").withInput(groupInputSchema).withOutput(external_exports.object({ deleted: external_exports.literal(true) })).mutation("changeGroupMembers").withInput(changeGroupMembersInputSchema).withOutput(workspaceGroupSchema).build();
95267
95397
 
95268
95398
  // ../../modules/workspace/contract/src/workspace.config.ts
95269
95399
  var workspaceConfig = Config.define((c) => ({
@@ -95308,6 +95438,10 @@ var memberRemovedDefinition = external_exports.object({
95308
95438
  /** ISO 8601. */
95309
95439
  at: external_exports.iso.datetime()
95310
95440
  });
95441
+ var inviteeReleasedDefinition = external_exports.object({
95442
+ ...memberRemovedDefinition.shape,
95443
+ email: external_exports.string().optional()
95444
+ });
95311
95445
  var memberErasedDefinition = external_exports.object({
95312
95446
  workspaceId: external_exports.string().min(1),
95313
95447
  userId: external_exports.string().min(1),
@@ -96017,15 +96151,15 @@ var OPERATOR_KEY_USAGE = `Temporary operator keys (ask, an operator approves wit
96017
96151
  laze ops status <key> waiting, approved or ended
96018
96152
  laze ops use <key> run the approved action and print the answer`;
96019
96153
  var POLL_MS3 = 5e3;
96020
- var keyFile = ({ context, keyId }) => join28(dirname25(context.environment.configPath), "operator-keys", keyId.replaceAll("/", "_"));
96154
+ var keyFile = ({ context, keyId }) => join29(dirname25(context.environment.configPath), "operator-keys", keyId.replaceAll("/", "_"));
96021
96155
  async function saveSecret({
96022
96156
  context,
96023
96157
  keyId,
96024
96158
  secret
96025
96159
  }) {
96026
96160
  const path = keyFile({ context, keyId });
96027
- await mkdir25(dirname25(path), { recursive: true, mode: 448 });
96028
- await writeFile24(path, secret, { mode: 384 });
96161
+ await mkdir26(dirname25(path), { recursive: true, mode: 448 });
96162
+ await writeFile25(path, secret, { mode: 384 });
96029
96163
  }
96030
96164
  function typedArg(text3) {
96031
96165
  if (["true", "false", "null"].includes(text3)) return JSON.parse(text3);
@@ -96183,8 +96317,8 @@ ${OPS_USAGE}`);
96183
96317
  }
96184
96318
 
96185
96319
  // src/services/release-watch.service.ts
96186
- import { mkdir as mkdir26, readFile as readFile40, realpath, writeFile as writeFile25 } from "node:fs/promises";
96187
- import { dirname as dirname26, join as join29 } from "node:path";
96320
+ import { mkdir as mkdir27, readFile as readFile40, realpath, writeFile as writeFile26 } from "node:fs/promises";
96321
+ import { dirname as dirname26, join as join30 } from "node:path";
96188
96322
 
96189
96323
  // src/rules/cli-update.rules.ts
96190
96324
  var CLI_PACKAGE = "@lazehq/cli";
@@ -96331,15 +96465,15 @@ async function startedUpdate({
96331
96465
  const plan2 = updatePlanOf({ script: await scriptOf(context) });
96332
96466
  if (plan2.kind !== "install") return null;
96333
96467
  const folder = dirname26(context.environment.configPath);
96334
- const stamp = join29(folder, "auto-update.json");
96468
+ const stamp = join30(folder, "auto-update.json");
96335
96469
  const last = await readFile40(stamp, "utf8").then((text3) => JSON.parse(text3)).catch(() => null);
96336
96470
  const now = context.nowMs();
96337
96471
  if (last?.server === server && now - last.atMs < RETRY_AFTER_MS) return null;
96338
- await mkdir26(folder, { recursive: true, mode: 448 });
96339
- await writeFile25(stamp, JSON.stringify({ server, atMs: now }), { mode: 384 });
96472
+ await mkdir27(folder, { recursive: true, mode: 448 });
96473
+ await writeFile26(stamp, JSON.stringify({ server, atMs: now }), { mode: 384 });
96340
96474
  context.processes.spawnDetached({
96341
96475
  argv: [...context.program, "update"],
96342
- logPath: join29(folder, "auto-update.log")
96476
+ logPath: join30(folder, "auto-update.log")
96343
96477
  });
96344
96478
  return { manager: plan2.manager };
96345
96479
  }
@@ -96618,7 +96752,7 @@ async function schedule({ context, args }) {
96618
96752
 
96619
96753
  // src/services/skill-commands.service.ts
96620
96754
  import { readdir as readdir8, readFile as readFile42 } from "node:fs/promises";
96621
- import { join as join30, relative as relative6, resolve as resolve20 } from "node:path";
96755
+ import { join as join31, relative as relative6, resolve as resolve21 } from "node:path";
96622
96756
  var USAGE17 = `Usage:
96623
96757
  laze skill list [--agent <agentId>]
96624
96758
  laze skill install <catalogue-id> [--as <name>] [--agent <agentId>]
@@ -96639,7 +96773,7 @@ async function folderFiles({ root }) {
96639
96773
  const files2 = [];
96640
96774
  for (const entry of entries) {
96641
96775
  if (!entry.isFile()) continue;
96642
- const full = join30(entry.parentPath, entry.name);
96776
+ const full = join31(entry.parentPath, entry.name);
96643
96777
  files2.push({ path: relative6(root, full), content: await readFile42(full, "utf8") });
96644
96778
  }
96645
96779
  return files2.toSorted((a, b) => a.path.localeCompare(b.path));
@@ -96671,7 +96805,7 @@ async function skillInstall({ context, args }) {
96671
96805
  if (!catalogueId === !from) throw new CliUsageError(USAGE17);
96672
96806
  const name3 = flagText({ args, name: "as" });
96673
96807
  const agent3 = flagText({ args, name: "agent" });
96674
- const files2 = from ? await folderFiles({ root: resolve20(context.cwd, from) }) : void 0;
96808
+ const files2 = from ? await folderFiles({ root: resolve21(context.cwd, from) }) : void 0;
96675
96809
  const { client } = await signedIn({ context, args });
96676
96810
  const installed = await client.post("/api/skills/install", {
96677
96811
  ...catalogueId ? { catalogueId } : {},
@@ -96738,7 +96872,7 @@ async function skillUpdate({ context, args }) {
96738
96872
  if (!name3 || !newName && description === void 0 && !skillMdFile) {
96739
96873
  throw new CliUsageError(USAGE17);
96740
96874
  }
96741
- const skillMd = skillMdFile ? await readFile42(resolve20(context.cwd, skillMdFile), "utf8") : void 0;
96875
+ const skillMd = skillMdFile ? await readFile42(resolve21(context.cwd, skillMdFile), "utf8") : void 0;
96742
96876
  const { client } = await signedIn({ context, args });
96743
96877
  const updated = await client.post("/api/skills/update", {
96744
96878
  name: name3,
@@ -96785,7 +96919,7 @@ async function skill({ context, args }) {
96785
96919
 
96786
96920
  // src/services/slack-commands.service.ts
96787
96921
  import { readFile as readFile43 } from "node:fs/promises";
96788
- import { resolve as resolve21 } from "node:path";
96922
+ import { resolve as resolve22 } from "node:path";
96789
96923
  var SLACK_USAGE = `Usage (a person's key; Slack stays the source, the bot joins no channel by itself):
96790
96924
  laze slack overview connected Slack workspaces, mirrors, your link
96791
96925
  laze slack link-prompts Slack workspaces you have not linked yet
@@ -96832,7 +96966,7 @@ async function secretLines({ context, args }) {
96832
96966
  throw new CliUsageError("A secret never goes in a flag: pipe it on stdin or use --from-file.");
96833
96967
  }
96834
96968
  const file4 = flagText({ args, name: "from-file" });
96835
- const text3 = file4 ? await readFile43(resolve21(context.cwd, file4), "utf8") : await context.readStdin();
96969
+ const text3 = file4 ? await readFile43(resolve22(context.cwd, file4), "utf8") : await context.readStdin();
96836
96970
  return text3.split("\n").map((line) => line.trim()).filter(Boolean);
96837
96971
  }
96838
96972
  async function secretsOf2({
@@ -97556,7 +97690,7 @@ async function update2({
97556
97690
 
97557
97691
  // src/services/vault-env-commands.service.ts
97558
97692
  import { readFile as readFile45, stat as stat11 } from "node:fs/promises";
97559
- import { dirname as dirname27, join as join31, resolve as resolve22 } from "node:path";
97693
+ import { dirname as dirname27, join as join32, resolve as resolve23 } from "node:path";
97560
97694
 
97561
97695
  // src/rules/vault-manifest.rules.ts
97562
97696
  var VARIABLE = /^[A-Za-z_][A-Za-z0-9_]*$/;
@@ -97901,11 +98035,11 @@ async function manifestPathOf({
97901
98035
  args
97902
98036
  }) {
97903
98037
  const named = args.words[2];
97904
- if (named) return resolve22(context.cwd, named);
98038
+ if (named) return resolve23(context.cwd, named);
97905
98039
  const environment = flagText({ args, name: "env" });
97906
98040
  const file4 = environment ? `.env.${environment}.vault` : ".env.vault";
97907
- for (let dir = resolve22(context.cwd); ; dir = dirname27(dir)) {
97908
- if (await isFile(join31(dir, file4))) return join31(dir, file4);
98041
+ for (let dir = resolve23(context.cwd); ; dir = dirname27(dir)) {
98042
+ if (await isFile(join32(dir, file4))) return join32(dir, file4);
97909
98043
  if (dirname27(dir) === dir) break;
97910
98044
  }
97911
98045
  throw new CliUsageError(`laze vault: no ${file4} here or in a parent folder
@@ -98232,7 +98366,7 @@ async function vaultScrub({ context, args }) {
98232
98366
 
98233
98367
  // src/services/whatsapp-business-commands.service.ts
98234
98368
  import { readFile as readFile46 } from "node:fs/promises";
98235
- import { resolve as resolve23 } from "node:path";
98369
+ import { resolve as resolve24 } from "node:path";
98236
98370
 
98237
98371
  // ../../modules/whatsapp-business/contract/src/whatsapp-business.prices.ts
98238
98372
  var whatsappBusinessCategorySchema = external_exports.enum([
@@ -98651,7 +98785,7 @@ async function secretsOf3({ context, args }) {
98651
98785
  const fromConnection = flagText({ args, name: "from-vault" });
98652
98786
  if (fromConnection) return { fromConnection };
98653
98787
  const file4 = flagText({ args, name: "from-file" });
98654
- const text3 = file4 ? await readFile46(resolve23(context.cwd, file4), "utf8") : await context.readStdin();
98788
+ const text3 = file4 ? await readFile46(resolve24(context.cwd, file4), "utf8") : await context.readStdin();
98655
98789
  const lines2 = text3.split("\n").map((line) => line.trim()).filter(Boolean);
98656
98790
  if (lines2.length !== 2) {
98657
98791
  throw new CliUsageError(
@@ -98852,8 +98986,8 @@ async function whatsappBusiness({
98852
98986
  }
98853
98987
 
98854
98988
  // src/services/whatsapp-commands.service.ts
98855
- import { writeFile as writeFile26 } from "node:fs/promises";
98856
- import { basename as basename9, resolve as resolve24 } from "node:path";
98989
+ import { writeFile as writeFile27 } from "node:fs/promises";
98990
+ import { basename as basename10, resolve as resolve25 } from "node:path";
98857
98991
 
98858
98992
  // src/services/whatsapp-pairing-commands.service.ts
98859
98993
  var WHATSAPP_PAIRING_USAGE = " laze whatsapp unpair <machine> unlink WhatsApp from the machine (owner)";
@@ -98879,7 +99013,8 @@ var PATHS3 = {
98879
99013
  read: "/api/compute/whatsapp/read",
98880
99014
  file: "/api/compute/whatsapp/file",
98881
99015
  send: "/api/compute/whatsapp/send",
98882
- sendStatus: "/api/compute/whatsapp/send-status"
99016
+ sendStatus: "/api/compute/whatsapp/send-status",
99017
+ sync: "/api/compute/whatsapp/sync"
98883
99018
  };
98884
99019
  var STATUS_WAIT_SECONDS2 = 50;
98885
99020
  var STATUS_CALLS2 = 2;
@@ -98892,6 +99027,7 @@ var USAGE19 = [
98892
99027
  " laze whatsapp file [<machine>] <chat> <message-id> [--out <path>] save a message's photo, voice message or file",
98893
99028
  ' laze whatsapp send <machine> <chat> "<text>" send as the owner; an agent waits for their approval',
98894
99029
  " laze whatsapp status <send-id> where a send stands",
99030
+ " laze whatsapp sync [<machine>] check WhatsApp now (the owner only)",
98895
99031
  WHATSAPP_PAIRING_USAGE,
98896
99032
  "With no machine it is the WhatsApp linked on your (or your agent's owner's) Laze computer.",
98897
99033
  "A chat is its id, a phone number or a contact or group name."
@@ -98991,10 +99127,10 @@ async function file3({ context, args }) {
98991
99127
  },
98992
99128
  args
98993
99129
  });
98994
- const out = resolve24(context.cwd, flagText({ args, name: "out" }) ?? basename9(answer6.fileName));
99130
+ const out = resolve25(context.cwd, flagText({ args, name: "out" }) ?? basename10(answer6.fileName));
98995
99131
  const response = await context.fetcher(answer6.url);
98996
99132
  if (!response.ok) throw new Error(`The file link answered ${response.status}`);
98997
- await writeFile26(out, new Uint8Array(await response.arrayBuffer()));
99133
+ await writeFile27(out, new Uint8Array(await response.arrayBuffer()));
98998
99134
  if (args.flags.json) return context.out(`${JSON.stringify({ ...answer6, path: out }, null, 2)}
98999
99135
  `);
99000
99136
  context.out(`${out}
@@ -99038,6 +99174,14 @@ async function send4({ context, args }) {
99038
99174
  `);
99039
99175
  return report2({ context, args, send: await settle3({ client, send: asked }) });
99040
99176
  }
99177
+ async function sync({ context, args }) {
99178
+ const client = await computeClient({ context, args });
99179
+ const machine2 = args.words[2];
99180
+ const answer6 = await client.post(PATHS3.sync, machine2 ? { machine: machine2 } : {});
99181
+ if (args.flags.json) context.out(`${JSON.stringify(answer6)}
99182
+ `);
99183
+ else context.out("WhatsApp check booked: new messages land in Laze within a minute or two.\n");
99184
+ }
99041
99185
  async function status10({ context, args }) {
99042
99186
  const client = await computeClient({ context, args });
99043
99187
  const answer6 = await client.post(PATHS3.sendStatus, { sendId: word2({ args, at: 2 }) });
@@ -99056,6 +99200,7 @@ async function whatsapp({
99056
99200
  if (command === "file") return file3({ context, args });
99057
99201
  if (command === "send") return send4({ context, args });
99058
99202
  if (command === "status") return status10({ context, args });
99203
+ if (command === "sync") return sync({ context, args });
99059
99204
  const linking = whatsappPairingCommand(command);
99060
99205
  if (linking) return linking({ context, args });
99061
99206
  throw new CliUsageError(USAGE19);
@@ -99800,15 +99945,15 @@ import {
99800
99945
  randomBytes as randomBytes4,
99801
99946
  sign
99802
99947
  } from "node:crypto";
99803
- import { chmod as chmod4, link, mkdir as mkdir27, readFile as readFile47, rm as rm19, writeFile as writeFile27 } from "node:fs/promises";
99804
- import { dirname as dirname28, join as join32 } from "node:path";
99948
+ import { chmod as chmod4, link, mkdir as mkdir28, readFile as readFile47, rm as rm19, writeFile as writeFile28 } from "node:fs/promises";
99949
+ import { dirname as dirname28, join as join33 } from "node:path";
99805
99950
  var KEYCHAIN_SERVICE = "laze-cli-machine-key";
99806
- var runProgram = ({ program, args, stdin: stdin2, timeoutMs }) => new Promise((resolve25, reject) => {
99951
+ var runProgram = ({ program, args, stdin: stdin2, timeoutMs }) => new Promise((resolve26, reject) => {
99807
99952
  const child = execFile2(
99808
99953
  program,
99809
99954
  [...args],
99810
99955
  { timeout: timeoutMs },
99811
- (error63, stdout2) => error63 ? reject(error63) : resolve25(String(stdout2))
99956
+ (error63, stdout2) => error63 ? reject(error63) : resolve26(String(stdout2))
99812
99957
  );
99813
99958
  if (stdin2 !== void 0) child.stdin?.end(stdin2);
99814
99959
  });
@@ -99841,11 +99986,11 @@ var MachineKeyStore = class _MachineKeyStore {
99841
99986
  });
99842
99987
  }
99843
99988
  get metaPath() {
99844
- return join32(dirname28(this.options.configPath), "machine-key.json");
99989
+ return join33(dirname28(this.options.configPath), "machine-key.json");
99845
99990
  }
99846
99991
  /** Named by the key, so two CLIs making a key at once never overwrite each other's. */
99847
99992
  pemPathOf(jwk) {
99848
- return join32(dirname28(this.options.configPath), `machine-key-${shortOf(jwk)}.pem`);
99993
+ return join33(dirname28(this.options.configPath), `machine-key-${shortOf(jwk)}.pem`);
99849
99994
  }
99850
99995
  /** The Keychain item's account: one per config file and key. */
99851
99996
  accountOf(jwk) {
@@ -99972,8 +100117,8 @@ async function writeOnce({ path, text: text3 }) {
99972
100117
  }
99973
100118
  }
99974
100119
  async function writePrivate({ path, text: text3 }) {
99975
- await mkdir27(dirname28(path), { recursive: true, mode: 448 });
99976
- await writeFile27(path, text3, { mode: 384 });
100120
+ await mkdir28(dirname28(path), { recursive: true, mode: 448 });
100121
+ await writeFile28(path, text3, { mode: 384 });
99977
100122
  await chmod4(path, 384);
99978
100123
  }
99979
100124
 
@@ -100164,15 +100309,15 @@ function terminalAsk() {
100164
100309
  };
100165
100310
  }
100166
100311
  function sleep(ms, signal) {
100167
- return new Promise((resolve25) => {
100168
- if (signal?.aborted) return resolve25();
100312
+ return new Promise((resolve26) => {
100313
+ if (signal?.aborted) return resolve26();
100169
100314
  const stop3 = () => {
100170
100315
  clearTimeout(timer);
100171
- resolve25();
100316
+ resolve26();
100172
100317
  };
100173
100318
  const timer = setTimeout(() => {
100174
100319
  signal?.removeEventListener("abort", stop3);
100175
- resolve25();
100320
+ resolve26();
100176
100321
  }, ms);
100177
100322
  signal?.addEventListener("abort", stop3, { once: true });
100178
100323
  });