@lazehq/cli 0.1.136 → 0.1.137
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.
- package/dist/laze.mjs +733 -382
- 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 =
|
|
852
|
+
var prebuild = resolve29(dir);
|
|
853
853
|
if (prebuild) return prebuild;
|
|
854
|
-
var nearby =
|
|
854
|
+
var nearby = resolve29(path.dirname(process.execPath));
|
|
855
855
|
if (nearby) return nearby;
|
|
856
856
|
var target = [
|
|
857
857
|
"platform=" + platform,
|
|
@@ -867,7 +867,7 @@ var require_node_gyp_build = __commonJS({
|
|
|
867
867
|
// eslint-disable-line
|
|
868
868
|
].filter(Boolean).join(" ");
|
|
869
869
|
throw new Error("No native build was found for " + target + "\n loaded from: " + dir + "\n");
|
|
870
|
-
function
|
|
870
|
+
function resolve29(dir2) {
|
|
871
871
|
var tuples = readdirSync(path.join(dir2, "prebuilds")).map(parseTuple);
|
|
872
872
|
var tuple2 = tuples.filter(matchTuple(platform, arch)).sort(compareTuples)[0];
|
|
873
873
|
if (!tuple2) return;
|
|
@@ -886,8 +886,8 @@ var require_node_gyp_build = __commonJS({
|
|
|
886
886
|
}
|
|
887
887
|
}
|
|
888
888
|
function getFirst(dir, filter) {
|
|
889
|
-
var
|
|
890
|
-
return
|
|
889
|
+
var files3 = readdirSync(dir).filter(filter);
|
|
890
|
+
return files3[0] && path.join(dir, files3[0]);
|
|
891
891
|
}
|
|
892
892
|
function matchBuild(name3) {
|
|
893
893
|
return /\.node$/.test(name3);
|
|
@@ -7314,9 +7314,9 @@ var require_dispatcher_base = __commonJS({
|
|
|
7314
7314
|
}
|
|
7315
7315
|
close(callback) {
|
|
7316
7316
|
if (callback === void 0) {
|
|
7317
|
-
return new Promise((
|
|
7317
|
+
return new Promise((resolve29, reject) => {
|
|
7318
7318
|
this.close((err, data) => {
|
|
7319
|
-
return err ? reject(err) :
|
|
7319
|
+
return err ? reject(err) : resolve29(data);
|
|
7320
7320
|
});
|
|
7321
7321
|
});
|
|
7322
7322
|
}
|
|
@@ -7354,9 +7354,9 @@ var require_dispatcher_base = __commonJS({
|
|
|
7354
7354
|
err = null;
|
|
7355
7355
|
}
|
|
7356
7356
|
if (callback === void 0) {
|
|
7357
|
-
return new Promise((
|
|
7357
|
+
return new Promise((resolve29, reject) => {
|
|
7358
7358
|
this.destroy(err, (err2, data) => {
|
|
7359
|
-
return err2 ? reject(err2) :
|
|
7359
|
+
return err2 ? reject(err2) : resolve29(data);
|
|
7360
7360
|
});
|
|
7361
7361
|
});
|
|
7362
7362
|
}
|
|
@@ -12311,12 +12311,12 @@ upgrade: ${upgrade2}\r
|
|
|
12311
12311
|
cb();
|
|
12312
12312
|
}
|
|
12313
12313
|
}
|
|
12314
|
-
const waitForDrain = () => new Promise((
|
|
12314
|
+
const waitForDrain = () => new Promise((resolve29, reject) => {
|
|
12315
12315
|
assert2(callback === null);
|
|
12316
12316
|
if (socket[kError]) {
|
|
12317
12317
|
reject(socket[kError]);
|
|
12318
12318
|
} else {
|
|
12319
|
-
callback =
|
|
12319
|
+
callback = resolve29;
|
|
12320
12320
|
}
|
|
12321
12321
|
});
|
|
12322
12322
|
socket.on("close", onDrain).on("drain", onDrain);
|
|
@@ -13674,12 +13674,12 @@ var require_client_h2 = __commonJS({
|
|
|
13674
13674
|
cb();
|
|
13675
13675
|
}
|
|
13676
13676
|
}
|
|
13677
|
-
const waitForDrain = () => new Promise((
|
|
13677
|
+
const waitForDrain = () => new Promise((resolve29, reject) => {
|
|
13678
13678
|
assert2(callback === null);
|
|
13679
13679
|
if (socket[kError]) {
|
|
13680
13680
|
reject(socket[kError]);
|
|
13681
13681
|
} else {
|
|
13682
|
-
callback =
|
|
13682
|
+
callback = resolve29;
|
|
13683
13683
|
}
|
|
13684
13684
|
});
|
|
13685
13685
|
h2stream.on("close", onDrain).on("drain", onDrain);
|
|
@@ -14047,16 +14047,16 @@ var require_client = __commonJS({
|
|
|
14047
14047
|
return this[kNeedDrain] < 2;
|
|
14048
14048
|
}
|
|
14049
14049
|
[kClose]() {
|
|
14050
|
-
return new Promise((
|
|
14050
|
+
return new Promise((resolve29) => {
|
|
14051
14051
|
if (this[kSize]) {
|
|
14052
|
-
this[kClosedResolve] =
|
|
14052
|
+
this[kClosedResolve] = resolve29;
|
|
14053
14053
|
} else {
|
|
14054
|
-
|
|
14054
|
+
resolve29(null);
|
|
14055
14055
|
}
|
|
14056
14056
|
});
|
|
14057
14057
|
}
|
|
14058
14058
|
[kDestroy](err) {
|
|
14059
|
-
return new Promise((
|
|
14059
|
+
return new Promise((resolve29) => {
|
|
14060
14060
|
const requests2 = this[kQueue].splice(this[kPendingIdx]);
|
|
14061
14061
|
for (let i = 0; i < requests2.length; i++) {
|
|
14062
14062
|
const request2 = requests2[i];
|
|
@@ -14069,7 +14069,7 @@ var require_client = __commonJS({
|
|
|
14069
14069
|
this[kClosedResolve]();
|
|
14070
14070
|
this[kClosedResolve] = null;
|
|
14071
14071
|
}
|
|
14072
|
-
|
|
14072
|
+
resolve29(null);
|
|
14073
14073
|
};
|
|
14074
14074
|
if (this[kHTTPContext]) {
|
|
14075
14075
|
this[kHTTPContext].destroy(err, callback);
|
|
@@ -14482,8 +14482,8 @@ var require_pool_base = __commonJS({
|
|
|
14482
14482
|
}
|
|
14483
14483
|
return Promise.all(closeAll);
|
|
14484
14484
|
} else {
|
|
14485
|
-
return new Promise((
|
|
14486
|
-
this[kClosedResolve] =
|
|
14485
|
+
return new Promise((resolve29) => {
|
|
14486
|
+
this[kClosedResolve] = resolve29;
|
|
14487
14487
|
});
|
|
14488
14488
|
}
|
|
14489
14489
|
}
|
|
@@ -15591,7 +15591,7 @@ var require_socks5_client = __commonJS({
|
|
|
15591
15591
|
return;
|
|
15592
15592
|
}
|
|
15593
15593
|
const version2 = this.buffer[0];
|
|
15594
|
-
const
|
|
15594
|
+
const reply3 = this.buffer[1];
|
|
15595
15595
|
const addressType = this.buffer[3];
|
|
15596
15596
|
if (version2 !== SOCKS_VERSION) {
|
|
15597
15597
|
throw new Socks5ProxyError(`Invalid SOCKS version in reply: ${version2}`, "UND_ERR_SOCKS5_REPLY_VERSION");
|
|
@@ -15612,9 +15612,9 @@ var require_socks5_client = __commonJS({
|
|
|
15612
15612
|
if (this.buffer.length < responseLength) {
|
|
15613
15613
|
return;
|
|
15614
15614
|
}
|
|
15615
|
-
if (
|
|
15616
|
-
const errorMessage = this.getReplyErrorMessage(
|
|
15617
|
-
throw new Socks5ProxyError(`SOCKS5 connection failed: ${errorMessage}`, `UND_ERR_SOCKS5_REPLY_${
|
|
15615
|
+
if (reply3 !== REPLY_CODES.SUCCEEDED) {
|
|
15616
|
+
const errorMessage = this.getReplyErrorMessage(reply3);
|
|
15617
|
+
throw new Socks5ProxyError(`SOCKS5 connection failed: ${errorMessage}`, `UND_ERR_SOCKS5_REPLY_${reply3}`);
|
|
15618
15618
|
}
|
|
15619
15619
|
let boundAddress;
|
|
15620
15620
|
let offset = 4;
|
|
@@ -15645,8 +15645,8 @@ var require_socks5_client = __commonJS({
|
|
|
15645
15645
|
/**
|
|
15646
15646
|
* Get human-readable error message for reply code
|
|
15647
15647
|
*/
|
|
15648
|
-
getReplyErrorMessage(
|
|
15649
|
-
switch (
|
|
15648
|
+
getReplyErrorMessage(reply3) {
|
|
15649
|
+
switch (reply3) {
|
|
15650
15650
|
case REPLY_CODES.GENERAL_FAILURE:
|
|
15651
15651
|
return "General SOCKS server failure";
|
|
15652
15652
|
case REPLY_CODES.CONNECTION_NOT_ALLOWED:
|
|
@@ -15664,7 +15664,7 @@ var require_socks5_client = __commonJS({
|
|
|
15664
15664
|
case REPLY_CODES.ADDRESS_TYPE_NOT_SUPPORTED:
|
|
15665
15665
|
return "Address type not supported";
|
|
15666
15666
|
default:
|
|
15667
|
-
return `Unknown error code: ${
|
|
15667
|
+
return `Unknown error code: ${reply3}`;
|
|
15668
15668
|
}
|
|
15669
15669
|
}
|
|
15670
15670
|
};
|
|
@@ -16994,7 +16994,7 @@ var require_readable = __commonJS({
|
|
|
16994
16994
|
if (this._readableState.closeEmitted) {
|
|
16995
16995
|
return Promise.resolve(null);
|
|
16996
16996
|
}
|
|
16997
|
-
return new Promise((
|
|
16997
|
+
return new Promise((resolve29, reject) => {
|
|
16998
16998
|
if (this[kContentLength] && this[kContentLength] > limit || this[kBytesRead] > limit) {
|
|
16999
16999
|
this.destroy(new AbortError());
|
|
17000
17000
|
}
|
|
@@ -17008,11 +17008,11 @@ var require_readable = __commonJS({
|
|
|
17008
17008
|
if (signal.aborted) {
|
|
17009
17009
|
reject(signal.reason ?? new AbortError());
|
|
17010
17010
|
} else {
|
|
17011
|
-
|
|
17011
|
+
resolve29(null);
|
|
17012
17012
|
}
|
|
17013
17013
|
});
|
|
17014
17014
|
} else {
|
|
17015
|
-
this.on("close",
|
|
17015
|
+
this.on("close", resolve29);
|
|
17016
17016
|
}
|
|
17017
17017
|
this.on("error", noop2).on("data", () => {
|
|
17018
17018
|
if (this[kBytesRead] > limit) {
|
|
@@ -17040,7 +17040,7 @@ var require_readable = __commonJS({
|
|
|
17040
17040
|
}
|
|
17041
17041
|
function consume(stream, type) {
|
|
17042
17042
|
assert2(!stream[kConsume]);
|
|
17043
|
-
return new Promise((
|
|
17043
|
+
return new Promise((resolve29, reject) => {
|
|
17044
17044
|
if (isUnusable(stream)) {
|
|
17045
17045
|
const rState = stream._readableState;
|
|
17046
17046
|
if (rState.destroyed && rState.closeEmitted === false) {
|
|
@@ -17055,7 +17055,7 @@ var require_readable = __commonJS({
|
|
|
17055
17055
|
stream[kConsume] = {
|
|
17056
17056
|
type,
|
|
17057
17057
|
stream,
|
|
17058
|
-
resolve:
|
|
17058
|
+
resolve: resolve29,
|
|
17059
17059
|
reject,
|
|
17060
17060
|
length: 0,
|
|
17061
17061
|
body: []
|
|
@@ -17133,18 +17133,18 @@ var require_readable = __commonJS({
|
|
|
17133
17133
|
return buffer;
|
|
17134
17134
|
}
|
|
17135
17135
|
function consumeEnd(consume2, encoding) {
|
|
17136
|
-
const { type, body, resolve:
|
|
17136
|
+
const { type, body, resolve: resolve29, stream, length } = consume2;
|
|
17137
17137
|
try {
|
|
17138
17138
|
if (type === "text") {
|
|
17139
|
-
|
|
17139
|
+
resolve29(chunksDecode(body, length, encoding));
|
|
17140
17140
|
} else if (type === "json") {
|
|
17141
|
-
|
|
17141
|
+
resolve29(JSON.parse(chunksDecode(body, length, encoding)));
|
|
17142
17142
|
} else if (type === "arrayBuffer") {
|
|
17143
|
-
|
|
17143
|
+
resolve29(chunksConcat(body, length).buffer);
|
|
17144
17144
|
} else if (type === "blob") {
|
|
17145
|
-
|
|
17145
|
+
resolve29(new Blob(body, { type: stream[kContentType] }));
|
|
17146
17146
|
} else if (type === "bytes") {
|
|
17147
|
-
|
|
17147
|
+
resolve29(chunksConcat(body, length));
|
|
17148
17148
|
}
|
|
17149
17149
|
consumeFinish(consume2);
|
|
17150
17150
|
} catch (err) {
|
|
@@ -17363,9 +17363,9 @@ var require_api_request = __commonJS({
|
|
|
17363
17363
|
};
|
|
17364
17364
|
function request2(opts, callback) {
|
|
17365
17365
|
if (callback === void 0) {
|
|
17366
|
-
return new Promise((
|
|
17366
|
+
return new Promise((resolve29, reject) => {
|
|
17367
17367
|
request2.call(this, opts, (err, data) => {
|
|
17368
|
-
return err ? reject(err) :
|
|
17368
|
+
return err ? reject(err) : resolve29(data);
|
|
17369
17369
|
});
|
|
17370
17370
|
});
|
|
17371
17371
|
}
|
|
@@ -17626,9 +17626,9 @@ var require_api_stream = __commonJS({
|
|
|
17626
17626
|
};
|
|
17627
17627
|
function stream(opts, factory, callback) {
|
|
17628
17628
|
if (callback === void 0) {
|
|
17629
|
-
return new Promise((
|
|
17629
|
+
return new Promise((resolve29, reject) => {
|
|
17630
17630
|
stream.call(this, opts, factory, (err, data) => {
|
|
17631
|
-
return err ? reject(err) :
|
|
17631
|
+
return err ? reject(err) : resolve29(data);
|
|
17632
17632
|
});
|
|
17633
17633
|
});
|
|
17634
17634
|
}
|
|
@@ -17928,9 +17928,9 @@ var require_api_upgrade = __commonJS({
|
|
|
17928
17928
|
};
|
|
17929
17929
|
function upgrade2(opts, callback) {
|
|
17930
17930
|
if (callback === void 0) {
|
|
17931
|
-
return new Promise((
|
|
17931
|
+
return new Promise((resolve29, reject) => {
|
|
17932
17932
|
upgrade2.call(this, opts, (err, data) => {
|
|
17933
|
-
return err ? reject(err) :
|
|
17933
|
+
return err ? reject(err) : resolve29(data);
|
|
17934
17934
|
});
|
|
17935
17935
|
});
|
|
17936
17936
|
}
|
|
@@ -18024,9 +18024,9 @@ var require_api_connect = __commonJS({
|
|
|
18024
18024
|
};
|
|
18025
18025
|
function connect8(opts, callback) {
|
|
18026
18026
|
if (callback === void 0) {
|
|
18027
|
-
return new Promise((
|
|
18027
|
+
return new Promise((resolve29, reject) => {
|
|
18028
18028
|
connect8.call(this, opts, (err, data) => {
|
|
18029
|
-
return err ? reject(err) :
|
|
18029
|
+
return err ? reject(err) : resolve29(data);
|
|
18030
18030
|
});
|
|
18031
18031
|
});
|
|
18032
18032
|
}
|
|
@@ -19486,8 +19486,8 @@ var require_snapshot_utils = __commonJS({
|
|
|
19486
19486
|
var require_snapshot_recorder = __commonJS({
|
|
19487
19487
|
"../../node_modules/.pnpm/undici@8.10.0/node_modules/undici/lib/mock/snapshot-recorder.js"(exports, module) {
|
|
19488
19488
|
"use strict";
|
|
19489
|
-
var { writeFile: writeFile12, readFile:
|
|
19490
|
-
var { dirname: dirname29, resolve:
|
|
19489
|
+
var { writeFile: writeFile12, readFile: readFile41, mkdir: mkdir14 } = __require("node:fs/promises");
|
|
19490
|
+
var { dirname: dirname29, resolve: resolve29 } = __require("node:path");
|
|
19491
19491
|
var { setTimeout: setTimeout2, clearTimeout: clearTimeout2 } = __require("node:timers");
|
|
19492
19492
|
var { InvalidArgumentError, UndiciError } = require_errors();
|
|
19493
19493
|
var { hashId, isUrlExcludedFactory, normalizeHeaders, createHeaderFilters } = require_snapshot_utils();
|
|
@@ -19703,7 +19703,7 @@ var require_snapshot_recorder = __commonJS({
|
|
|
19703
19703
|
throw new InvalidArgumentError("Snapshot path is required");
|
|
19704
19704
|
}
|
|
19705
19705
|
try {
|
|
19706
|
-
const data = await
|
|
19706
|
+
const data = await readFile41(resolve29(path), "utf8");
|
|
19707
19707
|
const parsed = JSON.parse(data);
|
|
19708
19708
|
if (Array.isArray(parsed)) {
|
|
19709
19709
|
this.#snapshots.clear();
|
|
@@ -19732,7 +19732,7 @@ var require_snapshot_recorder = __commonJS({
|
|
|
19732
19732
|
if (!path) {
|
|
19733
19733
|
throw new InvalidArgumentError("Snapshot path is required");
|
|
19734
19734
|
}
|
|
19735
|
-
const resolvedPath =
|
|
19735
|
+
const resolvedPath = resolve29(path);
|
|
19736
19736
|
await mkdir14(dirname29(resolvedPath), { recursive: true });
|
|
19737
19737
|
const data = Array.from(this.#snapshots.entries()).map(([hash2, snapshot]) => ({
|
|
19738
19738
|
hash: hash2,
|
|
@@ -27230,7 +27230,7 @@ var require_fetch = __commonJS({
|
|
|
27230
27230
|
const hasTrailingQuestionMark = url2.search.length === 0 && url2.href[url2.href.length - url2.hash.length - 1] === "?";
|
|
27231
27231
|
return dispatchWithProtocolPreference(body);
|
|
27232
27232
|
function dispatchWithProtocolPreference(body2, allowH2) {
|
|
27233
|
-
return new Promise((
|
|
27233
|
+
return new Promise((resolve29, reject) => agent3.dispatch(
|
|
27234
27234
|
{
|
|
27235
27235
|
path: hasTrailingQuestionMark ? `${path}?` : path,
|
|
27236
27236
|
origin: url2.origin,
|
|
@@ -27313,7 +27313,7 @@ var require_fetch = __commonJS({
|
|
|
27313
27313
|
}
|
|
27314
27314
|
}
|
|
27315
27315
|
const onError = (err) => this.onResponseError(controller, err);
|
|
27316
|
-
|
|
27316
|
+
resolve29({
|
|
27317
27317
|
status: status11,
|
|
27318
27318
|
statusText,
|
|
27319
27319
|
headersList,
|
|
@@ -27346,7 +27346,7 @@ var require_fetch = __commonJS({
|
|
|
27346
27346
|
fetchParams.controller.off("terminated", this.abort);
|
|
27347
27347
|
}
|
|
27348
27348
|
if (request2.mode === "websocket" && allowH2 !== false && error63?.code === "UND_ERR_INFO" && error63?.message === "HTTP/2: Extended CONNECT protocol not supported by server") {
|
|
27349
|
-
|
|
27349
|
+
resolve29(dispatchWithProtocolPreference(body2, false));
|
|
27350
27350
|
return;
|
|
27351
27351
|
}
|
|
27352
27352
|
this.body?.destroy(error63);
|
|
@@ -27360,7 +27360,7 @@ var require_fetch = __commonJS({
|
|
|
27360
27360
|
const rawHeaders = controller?.rawHeaders ?? [];
|
|
27361
27361
|
const headersList = new HeadersList();
|
|
27362
27362
|
appendHeadersListFromResponseHeaders(headersList, headers, rawHeaders);
|
|
27363
|
-
|
|
27363
|
+
resolve29({
|
|
27364
27364
|
status: status11,
|
|
27365
27365
|
statusText: STATUS_CODES[status11],
|
|
27366
27366
|
headersList,
|
|
@@ -31077,15 +31077,15 @@ ${value}`;
|
|
|
31077
31077
|
pos = 0;
|
|
31078
31078
|
}
|
|
31079
31079
|
}
|
|
31080
|
-
discardLeadingBytes(
|
|
31081
|
-
while (
|
|
31080
|
+
discardLeadingBytes(count14) {
|
|
31081
|
+
while (count14 > 0 && this.lineChunkIndex < this.chunks.length) {
|
|
31082
31082
|
const chunk = this.chunks[this.lineChunkIndex];
|
|
31083
31083
|
const remaining = chunk.length - this.linePos;
|
|
31084
|
-
if (
|
|
31085
|
-
this.linePos +=
|
|
31086
|
-
|
|
31084
|
+
if (count14 < remaining) {
|
|
31085
|
+
this.linePos += count14;
|
|
31086
|
+
count14 = 0;
|
|
31087
31087
|
} else {
|
|
31088
|
-
|
|
31088
|
+
count14 -= remaining;
|
|
31089
31089
|
this.lineChunkIndex++;
|
|
31090
31090
|
this.linePos = 0;
|
|
31091
31091
|
}
|
|
@@ -31834,8 +31834,8 @@ function shannonEntropyBits(value) {
|
|
|
31834
31834
|
const counts = /* @__PURE__ */ new Map();
|
|
31835
31835
|
for (const char of sample) counts.set(char, (counts.get(char) ?? 0) + 1);
|
|
31836
31836
|
let entropy = 0;
|
|
31837
|
-
for (const
|
|
31838
|
-
const p =
|
|
31837
|
+
for (const count14 of counts.values()) {
|
|
31838
|
+
const p = count14 / sample.length;
|
|
31839
31839
|
entropy -= p * Math.log2(p);
|
|
31840
31840
|
}
|
|
31841
31841
|
return entropy;
|
|
@@ -32495,7 +32495,7 @@ function withoutOneTimeLinkTokens({
|
|
|
32495
32495
|
const links = oneTimeLinksIn({ text: text3 });
|
|
32496
32496
|
if (links.length === 0) return [...secrets];
|
|
32497
32497
|
return secrets.filter(
|
|
32498
|
-
(secret) => KEPT_IN_LINKS.has(secret.kind) || NEVER_ONE_TIME.test(secret.suggestedName) || !links.some((
|
|
32498
|
+
(secret) => KEPT_IN_LINKS.has(secret.kind) || NEVER_ONE_TIME.test(secret.suggestedName) || !links.some((link3) => secret.start >= link3.start && secret.end <= link3.end)
|
|
32499
32499
|
);
|
|
32500
32500
|
}
|
|
32501
32501
|
|
|
@@ -32703,7 +32703,7 @@ function runRedacted({
|
|
|
32703
32703
|
redact
|
|
32704
32704
|
}) {
|
|
32705
32705
|
const values = redact ?? Object.values(env);
|
|
32706
|
-
return new Promise((
|
|
32706
|
+
return new Promise((resolve29, reject) => {
|
|
32707
32707
|
const [file4, ...args] = command;
|
|
32708
32708
|
const child = spawn(file4, args, {
|
|
32709
32709
|
env: { ...baseEnv, ...env },
|
|
@@ -32729,7 +32729,7 @@ function runRedacted({
|
|
|
32729
32729
|
child.on("error", reject);
|
|
32730
32730
|
child.on("close", (code4, ended) => {
|
|
32731
32731
|
signal?.removeEventListener("abort", killGroup);
|
|
32732
|
-
void drained.then(() =>
|
|
32732
|
+
void drained.then(() => resolve29(code4 ?? (ended ? 128 + signalNumber(ended) : 1)));
|
|
32733
32733
|
});
|
|
32734
32734
|
});
|
|
32735
32735
|
}
|
|
@@ -36970,7 +36970,7 @@ function shadowedLinkLineOf({ shadow }) {
|
|
|
36970
36970
|
}
|
|
36971
36971
|
|
|
36972
36972
|
// src/rules/cli-version.rules.ts
|
|
36973
|
-
var STAMPED = "0.1.
|
|
36973
|
+
var STAMPED = "0.1.137";
|
|
36974
36974
|
function cliVersionOf({ stamped = STAMPED } = {}) {
|
|
36975
36975
|
return stamped.startsWith("__") ? "dev" : stamped;
|
|
36976
36976
|
}
|
|
@@ -37277,7 +37277,7 @@ async function withStateLock({
|
|
|
37277
37277
|
() => 0
|
|
37278
37278
|
);
|
|
37279
37279
|
if (since > LOCK_STALE_MS) await rm(lock, { force: true });
|
|
37280
|
-
else await new Promise((
|
|
37280
|
+
else await new Promise((resolve29) => setTimeout(resolve29, 15 + Math.random() * 20));
|
|
37281
37281
|
}
|
|
37282
37282
|
try {
|
|
37283
37283
|
return await work();
|
|
@@ -37544,6 +37544,7 @@ var SWITCHES = /* @__PURE__ */ new Set([
|
|
|
37544
37544
|
"all",
|
|
37545
37545
|
"resend",
|
|
37546
37546
|
"replace",
|
|
37547
|
+
"reset",
|
|
37547
37548
|
"ask",
|
|
37548
37549
|
"real-value"
|
|
37549
37550
|
]);
|
|
@@ -38855,14 +38856,14 @@ function codePointLength(str) {
|
|
|
38855
38856
|
const units = str.length;
|
|
38856
38857
|
if (!highSurrogate.test(str))
|
|
38857
38858
|
return units;
|
|
38858
|
-
let
|
|
38859
|
+
let count14 = units;
|
|
38859
38860
|
for (let i = 0; i < units - 1; i++) {
|
|
38860
38861
|
if ((str.charCodeAt(i) & 64512) === 55296 && (str.charCodeAt(i + 1) & 64512) === 56320) {
|
|
38861
|
-
|
|
38862
|
+
count14--;
|
|
38862
38863
|
i++;
|
|
38863
38864
|
}
|
|
38864
38865
|
}
|
|
38865
|
-
return
|
|
38866
|
+
return count14;
|
|
38866
38867
|
}
|
|
38867
38868
|
function getLengthableOrigin(input2) {
|
|
38868
38869
|
if (Array.isArray(input2))
|
|
@@ -42667,7 +42668,7 @@ var recursive = /* @__PURE__ */ new WeakMap();
|
|
|
42667
42668
|
var NONE = 0;
|
|
42668
42669
|
var ASSUMED = 1;
|
|
42669
42670
|
var PROVEN = 2;
|
|
42670
|
-
function isRecursive(inst, stack,
|
|
42671
|
+
function isRecursive(inst, stack, resolve29) {
|
|
42671
42672
|
const cached2 = recursive.get(inst);
|
|
42672
42673
|
if (cached2 !== void 0)
|
|
42673
42674
|
return cached2 ? PROVEN : NONE;
|
|
@@ -42677,7 +42678,7 @@ function isRecursive(inst, stack, resolve27) {
|
|
|
42677
42678
|
let result2 = NONE;
|
|
42678
42679
|
const check4 = (child) => {
|
|
42679
42680
|
if (result2 !== PROVEN && child?._zod) {
|
|
42680
|
-
const answer6 = isRecursive(child, stack,
|
|
42681
|
+
const answer6 = isRecursive(child, stack, resolve29);
|
|
42681
42682
|
if (answer6 > result2)
|
|
42682
42683
|
result2 = answer6;
|
|
42683
42684
|
}
|
|
@@ -42688,7 +42689,7 @@ function isRecursive(inst, stack, resolve27) {
|
|
|
42688
42689
|
const desc = Object.getOwnPropertyDescriptor(sh, key);
|
|
42689
42690
|
if (spread && !desc.enumerable)
|
|
42690
42691
|
continue;
|
|
42691
|
-
const child = desc.get ? ASSUMED : desc.value?._zod ? isRecursive(desc.value, stack,
|
|
42692
|
+
const child = desc.get ? ASSUMED : desc.value?._zod ? isRecursive(desc.value, stack, resolve29) : NONE;
|
|
42692
42693
|
if (child > answer6)
|
|
42693
42694
|
answer6 = child;
|
|
42694
42695
|
}
|
|
@@ -42752,7 +42753,7 @@ function isRecursive(inst, stack, resolve27) {
|
|
|
42752
42753
|
break;
|
|
42753
42754
|
// `$ZodLazy` caches its inner on the def, so a resolved edge is followed exactly
|
|
42754
42755
|
case "lazy": {
|
|
42755
|
-
const inner = def._cachedInner ?? (
|
|
42756
|
+
const inner = def._cachedInner ?? (resolve29 ? inst._zod.innerType : void 0);
|
|
42756
42757
|
merge2(inner ? isRecursive(inner, stack, false) : ASSUMED);
|
|
42757
42758
|
break;
|
|
42758
42759
|
}
|
|
@@ -43217,8 +43218,8 @@ function az_default() {
|
|
|
43217
43218
|
}
|
|
43218
43219
|
|
|
43219
43220
|
// ../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/be.js
|
|
43220
|
-
function getBelarusianPlural(
|
|
43221
|
-
const absCount = Math.abs(
|
|
43221
|
+
function getBelarusianPlural(count14, one, few, many) {
|
|
43222
|
+
const absCount = Math.abs(count14);
|
|
43222
43223
|
const lastDigit = absCount % 10;
|
|
43223
43224
|
const lastTwoDigits = absCount % 100;
|
|
43224
43225
|
if (lastTwoDigits >= 11 && lastTwoDigits <= 19) {
|
|
@@ -45865,8 +45866,8 @@ function hu_default() {
|
|
|
45865
45866
|
}
|
|
45866
45867
|
|
|
45867
45868
|
// ../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/hy.js
|
|
45868
|
-
function getArmenianPlural(
|
|
45869
|
-
return Math.abs(
|
|
45869
|
+
function getArmenianPlural(count14, one, many) {
|
|
45870
|
+
return Math.abs(count14) === 1 ? one : many;
|
|
45870
45871
|
}
|
|
45871
45872
|
function withDefiniteArticle(word3) {
|
|
45872
45873
|
if (!word3)
|
|
@@ -48604,8 +48605,8 @@ function ro_default() {
|
|
|
48604
48605
|
}
|
|
48605
48606
|
|
|
48606
48607
|
// ../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/ru.js
|
|
48607
|
-
function getRussianPlural(
|
|
48608
|
-
const absCount = Math.abs(
|
|
48608
|
+
function getRussianPlural(count14, one, few, many) {
|
|
48609
|
+
const absCount = Math.abs(count14);
|
|
48609
48610
|
const lastDigit = absCount % 10;
|
|
48610
48611
|
const lastTwoDigits = absCount % 100;
|
|
48611
48612
|
if (lastTwoDigits >= 11 && lastTwoDigits <= 19) {
|
|
@@ -62064,15 +62065,15 @@ function clustersIn({
|
|
|
62064
62065
|
const out = [];
|
|
62065
62066
|
let current3 = null;
|
|
62066
62067
|
for (let index = segment.start; index <= segment.end; index += 1) {
|
|
62067
|
-
const
|
|
62068
|
-
if (
|
|
62068
|
+
const count14 = flagged[index] ?? 0;
|
|
62069
|
+
if (count14 === 0) continue;
|
|
62069
62070
|
if (current3 && index - current3.end - 1 <= REDACTED_BLOCK_MAX_GAP) {
|
|
62070
62071
|
current3.end = index;
|
|
62071
|
-
current3.values +=
|
|
62072
|
+
current3.values += count14;
|
|
62072
62073
|
continue;
|
|
62073
62074
|
}
|
|
62074
62075
|
if (current3) out.push(current3);
|
|
62075
|
-
current3 = { start: index, end: index, values:
|
|
62076
|
+
current3 = { start: index, end: index, values: count14 };
|
|
62076
62077
|
}
|
|
62077
62078
|
if (current3) out.push(current3);
|
|
62078
62079
|
return out;
|
|
@@ -62112,7 +62113,7 @@ function redactedBlocksAt({
|
|
|
62112
62113
|
}
|
|
62113
62114
|
const blocks = redactedBlocks({ lines: lines2, flagged });
|
|
62114
62115
|
const inside = (line) => blocks.some((block2) => line >= block2.start && line <= block2.end);
|
|
62115
|
-
const values = flagged.reduce((sum,
|
|
62116
|
+
const values = flagged.reduce((sum, count14, line) => inside(line) ? sum + count14 : sum, 0);
|
|
62116
62117
|
return { values, insideAt: (offset) => inside(lineAt(offset)) };
|
|
62117
62118
|
}
|
|
62118
62119
|
|
|
@@ -62674,18 +62675,43 @@ var vaultOpsAskSchemaDefinition = external_exports.object({
|
|
|
62674
62675
|
var vaultOpsAskSchema = vaultOpsAskSchemaDefinition;
|
|
62675
62676
|
var vaultOpsAsksSchemaDefinition = external_exports.object({ rows: external_exports.array(vaultOpsAskSchema), total: count3 });
|
|
62676
62677
|
|
|
62677
|
-
// ../../modules/vault/contract/src/vault-ops-
|
|
62678
|
+
// ../../modules/vault/contract/src/vault-ops-reference-keys.ts
|
|
62678
62679
|
var count4 = external_exports.number().int().nonnegative();
|
|
62679
62680
|
var idText3 = external_exports.string().max(128);
|
|
62681
|
+
var vaultOpsReferenceKeySchemaDefinition = external_exports.object({
|
|
62682
|
+
workspaceId: idText3,
|
|
62683
|
+
connectionId: idText3,
|
|
62684
|
+
/** The keychain's owner; null for a workspace key. */
|
|
62685
|
+
ownerUserId: idText3.nullable(),
|
|
62686
|
+
createdAt: external_exports.iso.datetime(),
|
|
62687
|
+
status: external_exports.string().regex(/^[a-z][a-z_]{0,31}$/),
|
|
62688
|
+
/** The key's name, to count the messages naming it; never in an ops answer. */
|
|
62689
|
+
name: external_exports.string().max(200)
|
|
62690
|
+
});
|
|
62691
|
+
var vaultOpsReferenceKeySchema = vaultOpsReferenceKeySchemaDefinition;
|
|
62692
|
+
var vaultOpsReferenceKeysSchemaDefinition = external_exports.object({
|
|
62693
|
+
keys: external_exports.array(vaultOpsReferenceKeySchemaDefinition),
|
|
62694
|
+
/** Pasted keys looked at, opened, held for a device only, and failing to open. */
|
|
62695
|
+
scanned: count4,
|
|
62696
|
+
opened: count4,
|
|
62697
|
+
sealed: count4,
|
|
62698
|
+
failed: count4,
|
|
62699
|
+
/** The scan reached the open cap before the last pasted key. */
|
|
62700
|
+
stopped: external_exports.boolean()
|
|
62701
|
+
});
|
|
62702
|
+
|
|
62703
|
+
// ../../modules/vault/contract/src/vault-ops-connections.ts
|
|
62704
|
+
var count5 = external_exports.number().int().nonnegative();
|
|
62705
|
+
var idText4 = external_exports.string().max(128);
|
|
62680
62706
|
var codeText2 = external_exports.string().regex(/^[a-z][a-z0-9_.]{0,39}$/);
|
|
62681
62707
|
var vaultOpsConnectionSchemaDefinition = external_exports.object({
|
|
62682
|
-
connectionId:
|
|
62708
|
+
connectionId: idText4,
|
|
62683
62709
|
kind: vaultConnectionKindSchema,
|
|
62684
62710
|
/** An OAuth or MCP connection's provider (`gmail`); null for none, `other` for free text. */
|
|
62685
62711
|
provider: codeText2.nullable(),
|
|
62686
62712
|
holderKind: external_exports.enum(["personal", "workspace", "agent", "pool"]),
|
|
62687
62713
|
/** The person, agent or pool that owns the keychain; null for the workspace's. */
|
|
62688
|
-
holderId:
|
|
62714
|
+
holderId: idText4.nullable(),
|
|
62689
62715
|
sensitivity: vaultSensitivitySchema,
|
|
62690
62716
|
everyUseAsks: external_exports.boolean(),
|
|
62691
62717
|
deviceApproval: external_exports.boolean(),
|
|
@@ -62693,7 +62719,7 @@ var vaultOpsConnectionSchemaDefinition = external_exports.object({
|
|
|
62693
62719
|
serverOpens: external_exports.boolean(),
|
|
62694
62720
|
sealing: external_exports.enum(["envelope_v1", "sealed_v2"]),
|
|
62695
62721
|
/** The devices a `sealed_v2` bundle is sealed to; 0 on `envelope_v1`. */
|
|
62696
|
-
recipients:
|
|
62722
|
+
recipients: count5,
|
|
62697
62723
|
status: codeText2,
|
|
62698
62724
|
/** When the stored access token runs out; null for none. */
|
|
62699
62725
|
grantExpiresAt: external_exports.iso.datetime().nullable(),
|
|
@@ -62702,14 +62728,14 @@ var vaultOpsConnectionSchemaDefinition = external_exports.object({
|
|
|
62702
62728
|
});
|
|
62703
62729
|
var vaultOpsConnectionSchema = vaultOpsConnectionSchemaDefinition;
|
|
62704
62730
|
var vaultOpsConnectionEventSchemaDefinition = external_exports.object({
|
|
62705
|
-
seq:
|
|
62706
|
-
connectionId:
|
|
62731
|
+
seq: count5,
|
|
62732
|
+
connectionId: idText4,
|
|
62707
62733
|
action: codeText2,
|
|
62708
62734
|
outcome: codeText2,
|
|
62709
62735
|
actorKind: external_exports.enum(["user", "agent", "system"]),
|
|
62710
62736
|
decider: codeText2.nullable(),
|
|
62711
|
-
agentId:
|
|
62712
|
-
requestId:
|
|
62737
|
+
agentId: idText4.nullable(),
|
|
62738
|
+
requestId: idText4.nullable(),
|
|
62713
62739
|
/** The entry's stored code (`vault_oauth_refresh_failed`); null when it holds none. */
|
|
62714
62740
|
code: codeText2.nullable(),
|
|
62715
62741
|
/** The provider's error code on a refused refresh (`invalid_grant`); null when not kept. */
|
|
@@ -63626,6 +63652,8 @@ var computerCardStateSchema = external_exports.enum([
|
|
|
63626
63652
|
var computerCardSchemaDefinition = external_exports.object({
|
|
63627
63653
|
type: external_exports.literal("computer"),
|
|
63628
63654
|
agentId: idSchema4,
|
|
63655
|
+
/** The agent's owner: only they or an Admin see its actions; null on cards drawn before. */
|
|
63656
|
+
ownerUserId: external_exports.string().max(200).nullable().default(null),
|
|
63629
63657
|
/** The computer the agent runs on, for support. */
|
|
63630
63658
|
computerId: external_exports.string().min(1).max(200),
|
|
63631
63659
|
/** The workspace audit entry's reference for this failure, for support. */
|
|
@@ -63666,6 +63694,8 @@ var loginCardLoginSchemaDefinition = external_exports.object({
|
|
|
63666
63694
|
var loginCardSchemaDefinition = external_exports.object({
|
|
63667
63695
|
type: external_exports.literal("login"),
|
|
63668
63696
|
agentId: idSchema4,
|
|
63697
|
+
/** The agent's owner: only they or an Admin see its actions; null on cards drawn before. */
|
|
63698
|
+
ownerUserId: external_exports.string().max(200).nullable().default(null),
|
|
63669
63699
|
harness: external_exports.enum(["claude-code", "codex"]),
|
|
63670
63700
|
state: loginCardStateSchema,
|
|
63671
63701
|
/** The plain first line: "All of my Claude logins are out of usage." */
|
|
@@ -66530,10 +66560,10 @@ var observeSenderInputSchemaDefinition = external_exports.object({
|
|
|
66530
66560
|
});
|
|
66531
66561
|
|
|
66532
66562
|
// ../../modules/chat/contract/src/chat.read-ops.ts
|
|
66533
|
-
var
|
|
66563
|
+
var count6 = external_exports.number().int().nonnegative();
|
|
66534
66564
|
var at = external_exports.iso.datetime();
|
|
66535
66565
|
var unreadMessageDefinition = external_exports.object({
|
|
66536
|
-
seq:
|
|
66566
|
+
seq: count6,
|
|
66537
66567
|
createdAt: at,
|
|
66538
66568
|
/** self is the reader; the others are the author's kind. */
|
|
66539
66569
|
author: external_exports.enum(["self", "person", "agent", "external"]),
|
|
@@ -66552,12 +66582,12 @@ var readConversationDefinition = external_exports.object({
|
|
|
66552
66582
|
direct: external_exports.boolean(),
|
|
66553
66583
|
/** The other side of a Laze DM paired with a Slack DM, or null. */
|
|
66554
66584
|
pairedWith: external_exports.string().nullable(),
|
|
66555
|
-
lastSeq:
|
|
66556
|
-
lastReadSeq:
|
|
66557
|
-
unreadHeldToSeq:
|
|
66558
|
-
hiddenAtSeq:
|
|
66559
|
-
unread:
|
|
66560
|
-
mentions:
|
|
66585
|
+
lastSeq: count6,
|
|
66586
|
+
lastReadSeq: count6,
|
|
66587
|
+
unreadHeldToSeq: count6.nullable(),
|
|
66588
|
+
hiddenAtSeq: count6.nullable(),
|
|
66589
|
+
unread: count6,
|
|
66590
|
+
mentions: count6,
|
|
66561
66591
|
lastMessageAt: at.nullable(),
|
|
66562
66592
|
/** When the newest message at or before the marker was written. */
|
|
66563
66593
|
markerAt: at.nullable(),
|
|
@@ -66567,41 +66597,41 @@ var readConversationDefinition = external_exports.object({
|
|
|
66567
66597
|
var chatReadFactsDefinition = external_exports.object({
|
|
66568
66598
|
conversations: external_exports.array(readConversationDefinition).max(40),
|
|
66569
66599
|
/** Conversations that qualified before the cap. */
|
|
66570
|
-
total:
|
|
66600
|
+
total: count6
|
|
66571
66601
|
});
|
|
66572
66602
|
var chatReadFactsSchema = chatReadFactsDefinition;
|
|
66573
66603
|
|
|
66574
66604
|
// ../../modules/chat/contract/src/chat.link-domain-ops.ts
|
|
66575
|
-
var
|
|
66605
|
+
var count7 = external_exports.number().int().nonnegative();
|
|
66576
66606
|
var linkDomainDefinition = external_exports.object({
|
|
66577
66607
|
/** The link's host, lowercased, without `www.`. */
|
|
66578
66608
|
domain: external_exports.string(),
|
|
66579
66609
|
/** Previews on messages, one per message and preview. */
|
|
66580
|
-
links:
|
|
66610
|
+
links: count7,
|
|
66581
66611
|
/** Messages with at least one preview of this host. */
|
|
66582
|
-
messageCount:
|
|
66612
|
+
messageCount: count7,
|
|
66583
66613
|
/** Previews of this host a message author took off. */
|
|
66584
|
-
removed:
|
|
66614
|
+
removed: count7,
|
|
66585
66615
|
/** Distinct previews (addresses) of this host. */
|
|
66586
|
-
pages:
|
|
66616
|
+
pages: count7,
|
|
66587
66617
|
/** Pages whose preview carries a picture, and a page name. */
|
|
66588
|
-
pictured:
|
|
66589
|
-
named:
|
|
66618
|
+
pictured: count7,
|
|
66619
|
+
named: count7,
|
|
66590
66620
|
/** Pages whose fetch failed or was blocked. */
|
|
66591
|
-
failed:
|
|
66621
|
+
failed: count7,
|
|
66592
66622
|
/** The commonest path shapes, at most 5, each with its page count. */
|
|
66593
|
-
shapes: external_exports.array(external_exports.object({ shape: external_exports.string(), pages:
|
|
66623
|
+
shapes: external_exports.array(external_exports.object({ shape: external_exports.string(), pages: count7 })).max(5)
|
|
66594
66624
|
});
|
|
66595
66625
|
var linkDomainFactsDefinition = external_exports.object({
|
|
66596
66626
|
domains: external_exports.array(linkDomainDefinition),
|
|
66597
66627
|
/** Messages with previews read on this page, and how many previews they carry. */
|
|
66598
|
-
scannedMessageCount:
|
|
66599
|
-
scannedLinks:
|
|
66628
|
+
scannedMessageCount: count7,
|
|
66629
|
+
scannedLinks: count7,
|
|
66600
66630
|
/** Messages carrying exactly 1, 2, and 3 or more previews on this page. */
|
|
66601
|
-
messageCountByLinks: external_exports.array(
|
|
66631
|
+
messageCountByLinks: external_exports.array(count7).length(3),
|
|
66602
66632
|
/** Over the whole workspace: live messages with a link, and those with a preview. */
|
|
66603
|
-
linkedMessageCount:
|
|
66604
|
-
previewedMessageCount:
|
|
66633
|
+
linkedMessageCount: count7,
|
|
66634
|
+
previewedMessageCount: count7,
|
|
66605
66635
|
/** The last message id read; pass it back as `cursor` to read on, null at the end. */
|
|
66606
66636
|
nextCursor: external_exports.string().nullable()
|
|
66607
66637
|
});
|
|
@@ -73565,8 +73595,8 @@ function unreachableReasonOf(error63) {
|
|
|
73565
73595
|
function migratedNoticeOf(error63) {
|
|
73566
73596
|
if (!(error63 instanceof LazeApiError) || error63.code !== AGENT_MIGRATED) return void 0;
|
|
73567
73597
|
const notice = typeof error63.meta?.notice === "string" ? error63.meta.notice : error63.message;
|
|
73568
|
-
const
|
|
73569
|
-
return { notice, link:
|
|
73598
|
+
const link3 = typeof error63.meta?.link === "string" ? error63.meta.link : null;
|
|
73599
|
+
return { notice, link: link3 };
|
|
73570
73600
|
}
|
|
73571
73601
|
var LazeClient = class _LazeClient {
|
|
73572
73602
|
constructor(options) {
|
|
@@ -73713,7 +73743,7 @@ async function reportMachine({
|
|
|
73713
73743
|
|
|
73714
73744
|
// src/services/session.service.ts
|
|
73715
73745
|
function markMigratedOn({ context, profile }) {
|
|
73716
|
-
return async ({ notice, link:
|
|
73746
|
+
return async ({ notice, link: link3 }) => context.store.markMigrated({ name: profile, migrated: { at: context.nowMs(), link: link3, notice } });
|
|
73717
73747
|
}
|
|
73718
73748
|
var REFUSED_RECHECK_MS = 10 * 60 * 1e3;
|
|
73719
73749
|
function markRefusedOn({
|
|
@@ -74040,18 +74070,18 @@ async function inviteAgent({ context, args }) {
|
|
|
74040
74070
|
throw new CliUsageError("Usage: laze agent invite --reconnect <agent>");
|
|
74041
74071
|
}
|
|
74042
74072
|
const { client } = await signedIn({ context, args });
|
|
74043
|
-
const
|
|
74073
|
+
const link3 = await client.post("/api/agents/links", {
|
|
74044
74074
|
...name3 ? { name: name3 } : {},
|
|
74045
74075
|
...channelId ? { channelId } : {},
|
|
74046
74076
|
...reconnect ? { reconnect } : {}
|
|
74047
74077
|
});
|
|
74048
|
-
if (args.flags.json) return context.out(`${JSON.stringify(
|
|
74078
|
+
if (args.flags.json) return context.out(`${JSON.stringify(link3, null, 2)}
|
|
74049
74079
|
`);
|
|
74050
74080
|
const where = reconnect ? `the session that should run ${reconnect} again` : "the agent's session";
|
|
74051
74081
|
context.out(
|
|
74052
|
-
`Paste this into ${where} (the link works once, until ${
|
|
74082
|
+
`Paste this into ${where} (the link works once, until ${link3.expiresAt}):
|
|
74053
74083
|
|
|
74054
|
-
${
|
|
74084
|
+
${link3.prompt}
|
|
74055
74085
|
`
|
|
74056
74086
|
);
|
|
74057
74087
|
}
|
|
@@ -74192,12 +74222,12 @@ function linkOf({ url: url2, base }) {
|
|
|
74192
74222
|
return `${base.replace(/\/+$/, "")}${url2.startsWith("/") ? "" : "/"}${url2}`;
|
|
74193
74223
|
}
|
|
74194
74224
|
function withLink({ text: text3, url: url2, base }) {
|
|
74195
|
-
const
|
|
74196
|
-
return
|
|
74225
|
+
const link3 = linkOf({ url: url2, base });
|
|
74226
|
+
return link3 ? `${text3} ${link3}` : text3;
|
|
74197
74227
|
}
|
|
74198
74228
|
function linkLineOf({ url: url2, base }) {
|
|
74199
|
-
const
|
|
74200
|
-
return
|
|
74229
|
+
const link3 = linkOf({ url: url2, base });
|
|
74230
|
+
return link3 ? `Link: ${link3}
|
|
74201
74231
|
` : "";
|
|
74202
74232
|
}
|
|
74203
74233
|
|
|
@@ -74307,10 +74337,10 @@ function whereOf(message2) {
|
|
|
74307
74337
|
}
|
|
74308
74338
|
function catchUpLinesOf(message2) {
|
|
74309
74339
|
if (!message2.catchUp) return [];
|
|
74310
|
-
const { count:
|
|
74340
|
+
const { count: count14, older } = message2.catchUp;
|
|
74311
74341
|
const where = whereOf(message2);
|
|
74312
74342
|
const lines2 = [
|
|
74313
|
-
`${
|
|
74343
|
+
`${count14} ${count14 === 1 ? "message" : "messages"} in ${where} while you were away.`
|
|
74314
74344
|
];
|
|
74315
74345
|
if (older === 0) return lines2;
|
|
74316
74346
|
const channel = message2.channelKind === "public" || message2.channelKind === "private";
|
|
@@ -74325,12 +74355,12 @@ function formatInboxMessage({
|
|
|
74325
74355
|
base
|
|
74326
74356
|
}) {
|
|
74327
74357
|
const thread2 = message2.threadRootId ? ` (in the thread of ${message2.threadRootId})` : "";
|
|
74328
|
-
const
|
|
74358
|
+
const link3 = base === void 0 ? void 0 : linkOf({ url: message2.url, base });
|
|
74329
74359
|
return [
|
|
74330
74360
|
...catchUpLinesOf(message2),
|
|
74331
74361
|
`[${message2.messageId}] ${message2.author.name} in ${whereOf(message2)}${thread2}:`,
|
|
74332
74362
|
message2.body,
|
|
74333
|
-
...
|
|
74363
|
+
...link3 ? [`Link: ${link3}`] : [],
|
|
74334
74364
|
`Answer with: laze reply ${message2.messageId} "<your answer>"`
|
|
74335
74365
|
].join("\n");
|
|
74336
74366
|
}
|
|
@@ -74338,9 +74368,9 @@ function hookContextOf({
|
|
|
74338
74368
|
messages,
|
|
74339
74369
|
self: self2
|
|
74340
74370
|
}) {
|
|
74341
|
-
const
|
|
74371
|
+
const count14 = messages.length === 1 ? "A message" : `${messages.length} messages`;
|
|
74342
74372
|
return [
|
|
74343
|
-
`${
|
|
74373
|
+
`${count14} reached you in Laze${selfClauseOf({ self: self2 })}:`,
|
|
74344
74374
|
"",
|
|
74345
74375
|
...messages.map((message2) => formatInboxMessage({ message: message2 })),
|
|
74346
74376
|
"",
|
|
@@ -74355,7 +74385,7 @@ function selfClauseOf({ self: self2 }) {
|
|
|
74355
74385
|
function record2(value) {
|
|
74356
74386
|
return typeof value === "object" && value !== null ? value : {};
|
|
74357
74387
|
}
|
|
74358
|
-
function
|
|
74388
|
+
function count8(value) {
|
|
74359
74389
|
return typeof value === "number" && Number.isFinite(value) && value >= 0 ? value : void 0;
|
|
74360
74390
|
}
|
|
74361
74391
|
function parse3(line) {
|
|
@@ -74391,17 +74421,17 @@ function compactionOf({
|
|
|
74391
74421
|
return {
|
|
74392
74422
|
key: typeof entry2.uuid === "string" ? entry2.uuid : String(index),
|
|
74393
74423
|
trigger: meta3.trigger === "manual" ? "manual" : "auto",
|
|
74394
|
-
tokensBefore:
|
|
74395
|
-
tokensAfter:
|
|
74424
|
+
tokensBefore: count8(meta3.preTokens),
|
|
74425
|
+
tokensAfter: count8(meta3.postTokens),
|
|
74396
74426
|
at: typeof entry2.timestamp === "string" ? entry2.timestamp : "1970-01-01T00:00:00.000Z"
|
|
74397
74427
|
};
|
|
74398
74428
|
}
|
|
74399
74429
|
function usageOf({ entry: entry2 }) {
|
|
74400
74430
|
const message2 = record2(entry2.message);
|
|
74401
74431
|
const usage2 = record2(message2.usage);
|
|
74402
|
-
const input2 =
|
|
74432
|
+
const input2 = count8(usage2.input_tokens);
|
|
74403
74433
|
if (input2 === void 0) return void 0;
|
|
74404
|
-
const cached2 = (
|
|
74434
|
+
const cached2 = (count8(usage2.cache_read_input_tokens) ?? 0) + (count8(usage2.cache_creation_input_tokens) ?? 0);
|
|
74405
74435
|
return {
|
|
74406
74436
|
tokens: input2 + cached2,
|
|
74407
74437
|
...typeof message2.model === "string" ? { model: message2.model } : {}
|
|
@@ -75306,7 +75336,7 @@ var slackConfig = Config.define((c) => ({
|
|
|
75306
75336
|
}));
|
|
75307
75337
|
|
|
75308
75338
|
// ../../modules/slack/contract/src/slack-ops.ts
|
|
75309
|
-
var
|
|
75339
|
+
var count9 = external_exports.number().int().nonnegative();
|
|
75310
75340
|
var at2 = external_exports.iso.datetime();
|
|
75311
75341
|
var slackMirrorHealthDefinition = external_exports.object({
|
|
75312
75342
|
mirrors: external_exports.array(
|
|
@@ -75319,19 +75349,19 @@ var slackMirrorHealthDefinition = external_exports.object({
|
|
|
75319
75349
|
/** Shared with another organisation, such as a Slack Connect channel. */
|
|
75320
75350
|
external: external_exports.boolean(),
|
|
75321
75351
|
botMember: external_exports.boolean(),
|
|
75322
|
-
linkedMembers:
|
|
75323
|
-
cacheDays:
|
|
75352
|
+
linkedMembers: count9,
|
|
75353
|
+
cacheDays: count9,
|
|
75324
75354
|
backfilledAt: at2.nullable(),
|
|
75325
75355
|
reconciledAt: at2.nullable(),
|
|
75326
75356
|
/** Message links Laze holds for the conversation, both ways. */
|
|
75327
|
-
links:
|
|
75357
|
+
links: count9,
|
|
75328
75358
|
/** Thread roots Laze holds a reply of. */
|
|
75329
|
-
threads:
|
|
75359
|
+
threads: count9,
|
|
75330
75360
|
/** Roots whose Slack reply count, when last read, is above the replies Laze holds. */
|
|
75331
|
-
threadsShort:
|
|
75332
|
-
repliesShort:
|
|
75361
|
+
threadsShort: count9,
|
|
75362
|
+
repliesShort: count9,
|
|
75333
75363
|
/** Threads Laze holds whose root is older than the cache window. */
|
|
75334
|
-
oldThreads:
|
|
75364
|
+
oldThreads: count9
|
|
75335
75365
|
})
|
|
75336
75366
|
)
|
|
75337
75367
|
});
|
|
@@ -75342,10 +75372,10 @@ var DURATION = /^(\d+)\s*(m|min|mins|minutes?|h|hours?|d|days?)$/i;
|
|
|
75342
75372
|
function minutesOf({ text: text3 }) {
|
|
75343
75373
|
const match = DURATION.exec(text3.trim());
|
|
75344
75374
|
if (!match?.[1] || !match[2]) return null;
|
|
75345
|
-
const
|
|
75375
|
+
const count14 = Number(match[1]);
|
|
75346
75376
|
const unit = match[2].toLowerCase()[0];
|
|
75347
75377
|
const perUnit = { d: 1440, h: 60, m: 1 };
|
|
75348
|
-
const minutes =
|
|
75378
|
+
const minutes = count14 * (perUnit[unit ?? "m"] ?? 1);
|
|
75349
75379
|
return minutes > 0 ? minutes : null;
|
|
75350
75380
|
}
|
|
75351
75381
|
function muteTextOf({ mute }) {
|
|
@@ -75503,13 +75533,13 @@ function lazeHitLines({
|
|
|
75503
75533
|
url: url2,
|
|
75504
75534
|
workspaceId
|
|
75505
75535
|
}) {
|
|
75506
|
-
const
|
|
75536
|
+
const reply3 = hit.threadRootId ? " (thread reply)" : "";
|
|
75507
75537
|
const text3 = bodyAsText({ body: hit.body, mentions: laze.mentions });
|
|
75508
|
-
const
|
|
75538
|
+
const files3 = hit.matchedFiles.length > 0 ? [` files: ${hit.matchedFiles.join(", ")}`] : [];
|
|
75509
75539
|
return [
|
|
75510
|
-
`${whereOf2({ kind: hit.channelKind, name: hit.channelName })} ${hit.author.name} ${timeOf(hit.postedAt)}${
|
|
75540
|
+
`${whereOf2({ kind: hit.channelKind, name: hit.channelName })} ${hit.author.name} ${timeOf(hit.postedAt)}${reply3}`,
|
|
75511
75541
|
` ${snippetOf({ text: text3, terms: laze.terms }) || "(no text)"}`,
|
|
75512
|
-
...
|
|
75542
|
+
...files3,
|
|
75513
75543
|
` ${linkOf({ url: hit.url, base: url2 }) ?? lazeLinkOf({ url: url2, workspaceId, channelId: hit.channelId, hit })}`
|
|
75514
75544
|
];
|
|
75515
75545
|
}
|
|
@@ -75520,14 +75550,14 @@ function slackHitLines({
|
|
|
75520
75550
|
workspaceId
|
|
75521
75551
|
}) {
|
|
75522
75552
|
const text3 = bodyAsText({ body: hit.body, mentions: laze.mentions });
|
|
75523
|
-
const
|
|
75553
|
+
const link3 = hit.lazeChannelId ? lazeLinkOf({ url: url2, workspaceId, channelId: hit.lazeChannelId }) : hit.permalink ?? "";
|
|
75524
75554
|
return [
|
|
75525
75555
|
`${whereOf2({ kind: "public", name: hit.channelName })} ${hit.authorName} ${timeOf(hit.createdAt)}`,
|
|
75526
75556
|
` ${snippetOf({ text: text3, terms: laze.terms }) || "(no text)"}`,
|
|
75527
|
-
...
|
|
75557
|
+
...link3 ? [` ${link3}`] : []
|
|
75528
75558
|
];
|
|
75529
75559
|
}
|
|
75530
|
-
var
|
|
75560
|
+
var count10 = (n) => `${n} message${n === 1 ? "" : "s"}`;
|
|
75531
75561
|
function slackSectionLines({
|
|
75532
75562
|
slack: slack2,
|
|
75533
75563
|
laze,
|
|
@@ -75540,7 +75570,7 @@ function slackSectionLines({
|
|
|
75540
75570
|
});
|
|
75541
75571
|
if (slack2.teams.some((team) => team.state === "searched")) {
|
|
75542
75572
|
const found = slack2.hits.length;
|
|
75543
|
-
lines2.push(found === 0 ? "From Slack: nothing more." : `From Slack: ${
|
|
75573
|
+
lines2.push(found === 0 ? "From Slack: nothing more." : `From Slack: ${count10(found)}`);
|
|
75544
75574
|
}
|
|
75545
75575
|
for (const hit of slack2.hits) lines2.push(...slackHitLines({ hit, laze, url: url2, workspaceId }), "");
|
|
75546
75576
|
return lines2;
|
|
@@ -75551,7 +75581,7 @@ function formatSearch({
|
|
|
75551
75581
|
workspaceId
|
|
75552
75582
|
}) {
|
|
75553
75583
|
const { laze, slack: slack2, query } = output2;
|
|
75554
|
-
const lines2 = laze.hits.length === 0 ? [`No Laze messages match "${query}".`] : [`Laze: ${
|
|
75584
|
+
const lines2 = laze.hits.length === 0 ? [`No Laze messages match "${query}".`] : [`Laze: ${count10(laze.hits.length)} for "${query}"`];
|
|
75555
75585
|
for (const hit of laze.hits) {
|
|
75556
75586
|
lines2.push(...lazeHitLines({ hit, laze, url: url2, workspaceId }), "");
|
|
75557
75587
|
}
|
|
@@ -75725,10 +75755,10 @@ async function sessionNotesOf({
|
|
|
75725
75755
|
tell = true
|
|
75726
75756
|
}) {
|
|
75727
75757
|
const folder = dirname6(notePathOf({ context, pid: 1 }));
|
|
75728
|
-
const
|
|
75758
|
+
const files3 = await readdir2(folder).catch(() => []);
|
|
75729
75759
|
const notes = [];
|
|
75730
75760
|
const dropped = [];
|
|
75731
|
-
for (const file4 of
|
|
75761
|
+
for (const file4 of files3) {
|
|
75732
75762
|
const pid = Number(file4.replace(/\.json$/, ""));
|
|
75733
75763
|
const path = join7(folder, file4);
|
|
75734
75764
|
const note = pid ? await readStateJson({ path }) : void 0;
|
|
@@ -75923,9 +75953,9 @@ async function runsInSubagent({ context, command }) {
|
|
|
75923
75953
|
const { path } = await claudeTranscriptOf({ context, sessionId });
|
|
75924
75954
|
if (!path) return false;
|
|
75925
75955
|
const folder = join8(dirname7(path), sessionId, "subagents");
|
|
75926
|
-
const
|
|
75956
|
+
const files3 = await readdir3(folder).catch(() => []);
|
|
75927
75957
|
const subagents = await Promise.all(
|
|
75928
|
-
|
|
75958
|
+
files3.filter((file4) => file4.endsWith(".jsonl")).map(
|
|
75929
75959
|
async (file4) => lastCallAtOf({ text: await tailOf({ path: join8(folder, file4) }), command })
|
|
75930
75960
|
)
|
|
75931
75961
|
);
|
|
@@ -76794,7 +76824,7 @@ async function post({
|
|
|
76794
76824
|
const body = await textToSend({ context, args, profile, client, text: typed, leaves });
|
|
76795
76825
|
const thread2 = flagText({ args, name: "thread" });
|
|
76796
76826
|
const via = viaOf({ args, usage: POST_USAGE });
|
|
76797
|
-
const
|
|
76827
|
+
const files3 = await filesOf({ context, args, client, at: at8, channel: async () => channel });
|
|
76798
76828
|
if (at8) {
|
|
76799
76829
|
const target = { channel, ...thread2 ? { threadRootId: thread2 } : {} };
|
|
76800
76830
|
return scheduleMessage({ context, args, client, at: at8, target, body });
|
|
@@ -76807,7 +76837,7 @@ async function post({
|
|
|
76807
76837
|
body,
|
|
76808
76838
|
...thread2 ? { threadRootId: thread2 } : {},
|
|
76809
76839
|
...via,
|
|
76810
|
-
...
|
|
76840
|
+
...files3,
|
|
76811
76841
|
...turnAnswersOf({ context })
|
|
76812
76842
|
}
|
|
76813
76843
|
});
|
|
@@ -76836,7 +76866,7 @@ async function reply({
|
|
|
76836
76866
|
const typed = await textOf({ context, args, from: 2 });
|
|
76837
76867
|
const leaves = leavesLazeOf({ client, channel });
|
|
76838
76868
|
const body = await textToSend({ context, args, profile, client, text: typed, leaves });
|
|
76839
|
-
const
|
|
76869
|
+
const files3 = await filesOf({
|
|
76840
76870
|
context,
|
|
76841
76871
|
args,
|
|
76842
76872
|
client,
|
|
@@ -76856,7 +76886,7 @@ async function reply({
|
|
|
76856
76886
|
...args.flags["new-thread"] === true ? { thread: true } : {},
|
|
76857
76887
|
...args.flags["also-channel"] === true ? { alsoInChannel: true } : {},
|
|
76858
76888
|
...via,
|
|
76859
|
-
...
|
|
76889
|
+
...files3,
|
|
76860
76890
|
...turnAnswersOf({ context })
|
|
76861
76891
|
}
|
|
76862
76892
|
});
|
|
@@ -77029,7 +77059,7 @@ async function claudeRunOf({
|
|
|
77029
77059
|
}) {
|
|
77030
77060
|
const env = context.environment.inherited;
|
|
77031
77061
|
const user = env.CLAUDE_CONFIG_DIR || join12(env.HOME || homedir3(), ".claude");
|
|
77032
|
-
const
|
|
77062
|
+
const files3 = await Promise.all(
|
|
77033
77063
|
[
|
|
77034
77064
|
join12(folder, ".claude", "settings.local.json"),
|
|
77035
77065
|
join12(folder, ".claude", "settings.json"),
|
|
@@ -77037,8 +77067,8 @@ async function claudeRunOf({
|
|
|
77037
77067
|
].map((path) => settingsOf({ path }))
|
|
77038
77068
|
);
|
|
77039
77069
|
const args = claudePid > 0 ? await context.processes.argsOf(claudePid) : void 0;
|
|
77040
|
-
const model = env.ANTHROPIC_MODEL || modelFlagOf(args) ||
|
|
77041
|
-
const compactWindow = windowOf2(env.CLAUDE_CODE_AUTO_COMPACT_WINDOW) ??
|
|
77070
|
+
const model = env.ANTHROPIC_MODEL || modelFlagOf(args) || files3.map((file4) => file4.model).find((value) => typeof value === "string");
|
|
77071
|
+
const compactWindow = windowOf2(env.CLAUDE_CODE_AUTO_COMPACT_WINDOW) ?? files3.map((file4) => windowOf2(record3(file4.env).CLAUDE_CODE_AUTO_COMPACT_WINDOW)).find(Boolean);
|
|
77042
77072
|
return {
|
|
77043
77073
|
...model ? { model } : {},
|
|
77044
77074
|
...compactWindow ? { compactWindow } : {}
|
|
@@ -77207,8 +77237,8 @@ async function codexRolloutPathOf({
|
|
|
77207
77237
|
threadId
|
|
77208
77238
|
}) {
|
|
77209
77239
|
const root = join13(codexHome, "sessions");
|
|
77210
|
-
const
|
|
77211
|
-
const file4 =
|
|
77240
|
+
const files3 = await readdir4(root, { recursive: true }).catch(() => []);
|
|
77241
|
+
const file4 = files3.find(
|
|
77212
77242
|
(name3) => basename5(name3).startsWith("rollout-") && name3.endsWith(`-${threadId}.jsonl`)
|
|
77213
77243
|
);
|
|
77214
77244
|
return file4 ? join13(root, file4) : void 0;
|
|
@@ -77465,15 +77495,15 @@ var taskCreate = async ({ args, target, authorization }) => {
|
|
|
77465
77495
|
...typeof worktree === "string" && worktree.trim() && { worktree },
|
|
77466
77496
|
...machine2 && { machine: machine2 }
|
|
77467
77497
|
};
|
|
77468
|
-
const
|
|
77498
|
+
const reply3 = await callKanban({
|
|
77469
77499
|
target,
|
|
77470
77500
|
authorization,
|
|
77471
77501
|
method: "POST",
|
|
77472
77502
|
path: "/v1/tasks",
|
|
77473
77503
|
body
|
|
77474
77504
|
});
|
|
77475
|
-
if (!
|
|
77476
|
-
const card2 =
|
|
77505
|
+
if (!reply3.ok) return reply3.result;
|
|
77506
|
+
const card2 = reply3.data ?? {};
|
|
77477
77507
|
return jsonText(
|
|
77478
77508
|
pick2(card2, ["id", "title", "column", "projectName", "branch", "isBusy", "isLive"])
|
|
77479
77509
|
);
|
|
@@ -77490,14 +77520,14 @@ var STATUS_KEYS = [
|
|
|
77490
77520
|
"queuedPromptCount"
|
|
77491
77521
|
];
|
|
77492
77522
|
var cardStatus = async ({ args, target, authorization }) => {
|
|
77493
|
-
const
|
|
77523
|
+
const reply3 = await callKanban({
|
|
77494
77524
|
target,
|
|
77495
77525
|
authorization,
|
|
77496
77526
|
method: "GET",
|
|
77497
77527
|
path: cardPath(required2(args, "card"))
|
|
77498
77528
|
});
|
|
77499
|
-
if (!
|
|
77500
|
-
const card2 =
|
|
77529
|
+
if (!reply3.ok) return reply3.result;
|
|
77530
|
+
const card2 = reply3.data ?? {};
|
|
77501
77531
|
const prs = Array.isArray(card2.prs) ? card2.prs : [];
|
|
77502
77532
|
return jsonText({
|
|
77503
77533
|
...pick2(card2, STATUS_KEYS),
|
|
@@ -77533,14 +77563,14 @@ var cardReply = async ({ args, target, authorization }) => {
|
|
|
77533
77563
|
var cardPrompt = async ({ args, target, authorization }) => {
|
|
77534
77564
|
const card2 = required2(args, "card");
|
|
77535
77565
|
const now = args.now === true;
|
|
77536
|
-
const
|
|
77566
|
+
const reply3 = await callKanban({
|
|
77537
77567
|
target,
|
|
77538
77568
|
authorization,
|
|
77539
77569
|
method: "POST",
|
|
77540
77570
|
path: `${cardPath(card2)}/prompt`,
|
|
77541
77571
|
body: { text: required2(args, "text"), mode: now ? "now" : "queue" }
|
|
77542
77572
|
});
|
|
77543
|
-
if (!
|
|
77573
|
+
if (!reply3.ok) return reply3.result;
|
|
77544
77574
|
return text2(
|
|
77545
77575
|
now ? `Sent to ${card2} now.` : `Sent to ${card2}; it is delivered when the card's current turn ends.`
|
|
77546
77576
|
);
|
|
@@ -79435,12 +79465,12 @@ var CodexAppServer = class _CodexAppServer {
|
|
|
79435
79465
|
}
|
|
79436
79466
|
async call(method, params) {
|
|
79437
79467
|
const id8 = ++this.#nextId;
|
|
79438
|
-
const
|
|
79439
|
-
this.#pending.set(id8,
|
|
79468
|
+
const reply3 = await new Promise((resolve29) => {
|
|
79469
|
+
this.#pending.set(id8, resolve29);
|
|
79440
79470
|
this.write({ id: id8, method, params });
|
|
79441
79471
|
});
|
|
79442
|
-
if (
|
|
79443
|
-
return record4(
|
|
79472
|
+
if (reply3.error !== void 0) throw new Error(`${method}: ${JSON.stringify(reply3.error)}`);
|
|
79473
|
+
return record4(reply3.result);
|
|
79444
79474
|
}
|
|
79445
79475
|
notify(method) {
|
|
79446
79476
|
this.write({ method });
|
|
@@ -79448,12 +79478,12 @@ var CodexAppServer = class _CodexAppServer {
|
|
|
79448
79478
|
/** Starts one turn; `done` settles when it completes, keeping its last agent message. */
|
|
79449
79479
|
async startTurn({ threadId, text: text3 }) {
|
|
79450
79480
|
const result2 = { answer: "" };
|
|
79451
|
-
const done = new Promise((
|
|
79481
|
+
const done = new Promise((resolve29) => {
|
|
79452
79482
|
const listen = (message2) => {
|
|
79453
79483
|
absorbTurnEvent({ result: result2, message: message2 });
|
|
79454
79484
|
if (message2.method !== "turn/completed") return;
|
|
79455
79485
|
this.#listeners.delete(listen);
|
|
79456
|
-
|
|
79486
|
+
resolve29(result2);
|
|
79457
79487
|
};
|
|
79458
79488
|
this.#listeners.add(listen);
|
|
79459
79489
|
});
|
|
@@ -79497,8 +79527,8 @@ var CodexAppServer = class _CodexAppServer {
|
|
|
79497
79527
|
};
|
|
79498
79528
|
async function newestThreadId({ codexHome }) {
|
|
79499
79529
|
const root = join19(codexHome, "sessions");
|
|
79500
|
-
const
|
|
79501
|
-
const rollouts =
|
|
79530
|
+
const files3 = await readdir5(root, { recursive: true }).catch(() => []);
|
|
79531
|
+
const rollouts = files3.filter((file4) => /rollout-.*\.jsonl$/.test(file4));
|
|
79502
79532
|
const dated = await Promise.all(
|
|
79503
79533
|
rollouts.map(async (file4) => ({ file: file4, at: (await stat6(join19(root, file4))).mtimeMs }))
|
|
79504
79534
|
);
|
|
@@ -80127,13 +80157,13 @@ async function pluginIsCurrent({ context }) {
|
|
|
80127
80157
|
}
|
|
80128
80158
|
async function writeLazePlugin({ context }) {
|
|
80129
80159
|
const folder = pluginFolderOf({ context });
|
|
80130
|
-
const
|
|
80160
|
+
const files3 = lazePluginFiles({
|
|
80131
80161
|
name: pluginNameHere({ context }),
|
|
80132
80162
|
program: context.program,
|
|
80133
80163
|
version: cliVersionOf(),
|
|
80134
80164
|
configPath: context.environment.configPath
|
|
80135
80165
|
});
|
|
80136
|
-
for (const [path, text3] of Object.entries(
|
|
80166
|
+
for (const [path, text3] of Object.entries(files3)) {
|
|
80137
80167
|
const target = join21(folder, path);
|
|
80138
80168
|
await mkdir4(dirname15(target), { recursive: true });
|
|
80139
80169
|
await writeFile2(target, text3);
|
|
@@ -82264,8 +82294,8 @@ async function uploadMigration({ context, args }) {
|
|
|
82264
82294
|
const moved = await uploadTranscript({ context, args, client }).catch((error63) => {
|
|
82265
82295
|
const migrated = migratedNoticeOf(error63);
|
|
82266
82296
|
if (!migrated) throw error63;
|
|
82267
|
-
const
|
|
82268
|
-
return { link:
|
|
82297
|
+
const link3 = migrated.link ?? linkIn(migrated.notice);
|
|
82298
|
+
return { link: link3 ?? "", agentName: profile.name, sent: void 0 };
|
|
82269
82299
|
});
|
|
82270
82300
|
const notice = moved.link ? `Moved to Laze: ${moved.link}` : "Moved to Laze.";
|
|
82271
82301
|
await context.store.markMigrated({
|
|
@@ -83628,7 +83658,7 @@ var appEditClaimsSchemaDefinition = external_exports.object({
|
|
|
83628
83658
|
app: external_exports.string().min(1),
|
|
83629
83659
|
vid: external_exports.string().min(1),
|
|
83630
83660
|
base: external_exports.string().min(1).max(64),
|
|
83631
|
-
files: external_exports.array(external_exports.object({ path: external_exports.string().min(1).max(300), content: external_exports.string().max(6e5) })).max(20).nullable().transform((
|
|
83661
|
+
files: external_exports.array(external_exports.object({ path: external_exports.string().min(1).max(300), content: external_exports.string().max(6e5) })).max(20).nullable().transform((files3) => files3 ?? []),
|
|
83632
83662
|
remove: external_exports.array(external_exports.string().min(1).max(300)).max(20).nullable().optional().transform((paths) => paths ?? []),
|
|
83633
83663
|
msg: external_exports.string().min(1).max(500)
|
|
83634
83664
|
});
|
|
@@ -83813,9 +83843,9 @@ function formatAppMoney({
|
|
|
83813
83843
|
maximumFractionDigits: tiny ? 4 : 2
|
|
83814
83844
|
}).format(amount);
|
|
83815
83845
|
}
|
|
83816
|
-
var
|
|
83846
|
+
var count11 = new Intl.NumberFormat("en-US");
|
|
83817
83847
|
function plural2({ value, one, many }) {
|
|
83818
|
-
return `${
|
|
83848
|
+
return `${count11.format(value)} ${value === 1 ? one : many}`;
|
|
83819
83849
|
}
|
|
83820
83850
|
function appCostQuantityText(line) {
|
|
83821
83851
|
const { quantity } = line;
|
|
@@ -84138,7 +84168,8 @@ var fileScopeSchemaDefinition = external_exports.object({
|
|
|
84138
84168
|
"workspace-logo",
|
|
84139
84169
|
"custom-emoji",
|
|
84140
84170
|
"computer-copy",
|
|
84141
|
-
"app-asset"
|
|
84171
|
+
"app-asset",
|
|
84172
|
+
"wiki-page"
|
|
84142
84173
|
]),
|
|
84143
84174
|
id: idSchema25
|
|
84144
84175
|
});
|
|
@@ -85131,12 +85162,12 @@ function messageOf({ args }) {
|
|
|
85131
85162
|
}
|
|
85132
85163
|
var RECORDS_CALL = /\b(?:Laze|LAZE)\.records\(\s*(["'`])([^"'`$]+)\1\s*\)/g;
|
|
85133
85164
|
function unknownCollectionsOf({
|
|
85134
|
-
files:
|
|
85165
|
+
files: files3,
|
|
85135
85166
|
collections
|
|
85136
85167
|
}) {
|
|
85137
85168
|
if (!collections) return [];
|
|
85138
85169
|
const known = Object.keys(collections);
|
|
85139
|
-
return
|
|
85170
|
+
return files3.filter((file4) => /\.(m?js|html)$/.test(file4.path)).flatMap(
|
|
85140
85171
|
(file4) => [...file4.text.matchAll(RECORDS_CALL)].filter(([, , name3]) => !known.includes(name3 ?? "")).map((match) => {
|
|
85141
85172
|
const line = file4.text.slice(0, match.index).split("\n").length;
|
|
85142
85173
|
const defines = known.length > 0 ? known.join(", ") : "none";
|
|
@@ -86645,11 +86676,11 @@ function errorOf2({ script, stderr: stderr2 }) {
|
|
|
86645
86676
|
return `${script.path}${line ? `:${line}` : ""}: ${message2}`;
|
|
86646
86677
|
}
|
|
86647
86678
|
async function scriptErrorsOf({
|
|
86648
|
-
files:
|
|
86679
|
+
files: files3,
|
|
86649
86680
|
collections
|
|
86650
86681
|
}) {
|
|
86651
|
-
const unknown2 = unknownCollectionsOf({ files:
|
|
86652
|
-
const scripts =
|
|
86682
|
+
const unknown2 = unknownCollectionsOf({ files: files3, collections });
|
|
86683
|
+
const scripts = files3.flatMap(scriptsOf);
|
|
86653
86684
|
if (scripts.length === 0) return unknown2;
|
|
86654
86685
|
const dir = await mkdtemp(join27(tmpdir3(), "laze-app-check-"));
|
|
86655
86686
|
try {
|
|
@@ -86818,16 +86849,16 @@ async function serveAppFolder({
|
|
|
86818
86849
|
(error63) => failed({ response, error: error63 })
|
|
86819
86850
|
);
|
|
86820
86851
|
});
|
|
86821
|
-
await new Promise((
|
|
86852
|
+
await new Promise((resolve29, reject) => {
|
|
86822
86853
|
server.once("error", reject);
|
|
86823
|
-
server.listen(port, "127.0.0.1", () =>
|
|
86854
|
+
server.listen(port, "127.0.0.1", () => resolve29());
|
|
86824
86855
|
});
|
|
86825
86856
|
const { port: bound } = server.address();
|
|
86826
86857
|
return {
|
|
86827
86858
|
url: `http://127.0.0.1:${bound}/`,
|
|
86828
|
-
close: () => new Promise((
|
|
86859
|
+
close: () => new Promise((resolve29) => {
|
|
86829
86860
|
server.closeAllConnections();
|
|
86830
|
-
server.close(() =>
|
|
86861
|
+
server.close(() => resolve29());
|
|
86831
86862
|
})
|
|
86832
86863
|
};
|
|
86833
86864
|
}
|
|
@@ -87189,7 +87220,7 @@ var appPush = async ({ context, args }) => {
|
|
|
87189
87220
|
}
|
|
87190
87221
|
const manifest = await readManifest(folder);
|
|
87191
87222
|
const paths = await listFiles(folder);
|
|
87192
|
-
const
|
|
87223
|
+
const files3 = await Promise.all(
|
|
87193
87224
|
paths.map(
|
|
87194
87225
|
async (path) => buildFileOf({
|
|
87195
87226
|
path: relative3(folder, path).split(sep3).join("/"),
|
|
@@ -87197,7 +87228,7 @@ var appPush = async ({ context, args }) => {
|
|
|
87197
87228
|
})
|
|
87198
87229
|
)
|
|
87199
87230
|
);
|
|
87200
|
-
const bytes =
|
|
87231
|
+
const bytes = files3.reduce((sum, file4) => sum + file4.bytes, 0);
|
|
87201
87232
|
if (bytes > MAX_APP_BUILD_BYTES) {
|
|
87202
87233
|
context.err(
|
|
87203
87234
|
`laze: The folder is ${Math.ceil(bytes / 1024)} KB; one version holds at most ${MAX_APP_BUILD_BYTES / 1024 / 1024} MB (app_build_too_large). Put video, audio, big images and PDFs in assets: laze app asset add <file>
|
|
@@ -87205,9 +87236,9 @@ var appPush = async ({ context, args }) => {
|
|
|
87205
87236
|
);
|
|
87206
87237
|
throw new CliUsageError("Nothing was uploaded.");
|
|
87207
87238
|
}
|
|
87208
|
-
if (
|
|
87239
|
+
if (files3.length === 0) throw new CliUsageError(`No files to push in ${folder}`);
|
|
87209
87240
|
const scriptErrors = await scriptErrorsOf({
|
|
87210
|
-
files:
|
|
87241
|
+
files: files3.filter((file4) => file4.encoding === "utf8").map(({ path, content }) => ({ path, text: content })),
|
|
87211
87242
|
collections: manifest?.collections
|
|
87212
87243
|
});
|
|
87213
87244
|
if (scriptErrors.length > 0) {
|
|
@@ -87234,7 +87265,7 @@ var appPush = async ({ context, args }) => {
|
|
|
87234
87265
|
const pushed = await client.post("/api/apps/commit", {
|
|
87235
87266
|
appId,
|
|
87236
87267
|
message: message2,
|
|
87237
|
-
files:
|
|
87268
|
+
files: files3.map(({ bytes: _bytes, ...file4 }) => file4),
|
|
87238
87269
|
...manifest?.users ? { users: manifest.users } : {},
|
|
87239
87270
|
...manifest?.functions ? { functions: manifest.functions } : {}
|
|
87240
87271
|
});
|
|
@@ -87244,7 +87275,7 @@ var appPush = async ({ context, args }) => {
|
|
|
87244
87275
|
context,
|
|
87245
87276
|
args,
|
|
87246
87277
|
value: { version: version2, app: publish.app, publish },
|
|
87247
|
-
text: `Pushed ${version2.version.slice(0, 7)} "${version2.message}" (${
|
|
87278
|
+
text: `Pushed ${version2.version.slice(0, 7)} "${version2.message}" (${files3.length} files)
|
|
87248
87279
|
` + (seeded ? seedLine(seeded) : "") + publishLine(publish)
|
|
87249
87280
|
});
|
|
87250
87281
|
};
|
|
@@ -87257,8 +87288,8 @@ var appWrite = async ({ context, args }) => {
|
|
|
87257
87288
|
);
|
|
87258
87289
|
}
|
|
87259
87290
|
const folder = folderOf({ context, word: void 0 });
|
|
87260
|
-
const
|
|
87261
|
-
const
|
|
87291
|
+
const remove10 = (flagText({ args, name: "remove" }) ?? "").split(",").map((path) => path.trim()).filter(Boolean);
|
|
87292
|
+
const files3 = await Promise.all(
|
|
87262
87293
|
words.slice(2).map(async (word3) => {
|
|
87263
87294
|
const path = resolve9(context.cwd, word3);
|
|
87264
87295
|
const { bytes: _bytes, ...file4 } = buildFileOf({
|
|
@@ -87268,27 +87299,27 @@ var appWrite = async ({ context, args }) => {
|
|
|
87268
87299
|
return file4;
|
|
87269
87300
|
})
|
|
87270
87301
|
);
|
|
87271
|
-
if (
|
|
87302
|
+
if (files3.length + remove10.length === 0) {
|
|
87272
87303
|
throw new CliUsageError("laze app write needs a file to write or --remove <path,...>");
|
|
87273
87304
|
}
|
|
87274
87305
|
const client = await appClient({ context, args });
|
|
87275
87306
|
const appId = await appIdOf({ client, args, folder });
|
|
87276
87307
|
const { publish, ...version2 } = await client.post("/api/apps/files/write", {
|
|
87277
87308
|
appId,
|
|
87278
|
-
files:
|
|
87279
|
-
remove:
|
|
87309
|
+
files: files3,
|
|
87310
|
+
remove: remove10,
|
|
87280
87311
|
message: message2
|
|
87281
87312
|
});
|
|
87282
87313
|
print5({
|
|
87283
87314
|
context,
|
|
87284
87315
|
args,
|
|
87285
87316
|
value: { version: version2, app: publish.app, publish },
|
|
87286
|
-
text: `Wrote ${version2.version.slice(0, 7)} "${version2.message}" (${
|
|
87317
|
+
text: `Wrote ${version2.version.slice(0, 7)} "${version2.message}" (${files3.length} written, ${remove10.length} removed)
|
|
87287
87318
|
` + publishLine(publish)
|
|
87288
87319
|
});
|
|
87289
87320
|
};
|
|
87290
87321
|
function seedLine(seeded) {
|
|
87291
|
-
const created = Object.entries(seeded.created).map(([name3,
|
|
87322
|
+
const created = Object.entries(seeded.created).map(([name3, count14]) => `${count14} in ${name3}`);
|
|
87292
87323
|
const parts = [
|
|
87293
87324
|
created.length ? `Loaded starter records: ${created.join(", ")}.` : "",
|
|
87294
87325
|
seeded.skipped.length ? `Left ${seeded.skipped.join(", ")} as it was: it already holds records.` : ""
|
|
@@ -87614,8 +87645,8 @@ function cardLine({ choice }) {
|
|
|
87614
87645
|
var appCard = async ({ context, args }) => {
|
|
87615
87646
|
const client = await appClient({ context, args });
|
|
87616
87647
|
const appId = await appIdOf({ client, args, folder: folderOf({ context, word: void 0 }) });
|
|
87617
|
-
const
|
|
87618
|
-
if (!Number.isInteger(
|
|
87648
|
+
const count14 = Number(flagText({ args, name: "rows", fallback: "5" }));
|
|
87649
|
+
if (!Number.isInteger(count14) || count14 < 1 || count14 > 10) {
|
|
87619
87650
|
throw new CliUsageError("--rows is a whole number from 1 to 10");
|
|
87620
87651
|
}
|
|
87621
87652
|
const text3 = (name3) => flagText({ args, name: name3 }) || null;
|
|
@@ -87628,7 +87659,7 @@ var appCard = async ({ context, args }) => {
|
|
|
87628
87659
|
collection: text3("collection"),
|
|
87629
87660
|
filter: flagText({ args, name: "where" }) || flagText({ args, name: "filter" }),
|
|
87630
87661
|
sort: flagText({ args, name: "sort" }),
|
|
87631
|
-
rows:
|
|
87662
|
+
rows: count14,
|
|
87632
87663
|
caption: text3("caption")
|
|
87633
87664
|
}
|
|
87634
87665
|
});
|
|
@@ -88455,8 +88486,8 @@ function printAccount({ context, args }, account) {
|
|
|
88455
88486
|
context.out(`Plan: ${plan2}${pending2}${ending}
|
|
88456
88487
|
`);
|
|
88457
88488
|
if (account.paymentIssue) {
|
|
88458
|
-
const
|
|
88459
|
-
context.out(`Payment: ${account.paymentIssue.message ?? account.paymentIssue.kind}${
|
|
88489
|
+
const link3 = account.paymentIssue.invoiceUrl ? ` ${account.paymentIssue.invoiceUrl}` : "";
|
|
88490
|
+
context.out(`Payment: ${account.paymentIssue.message ?? account.paymentIssue.kind}${link3}
|
|
88460
88491
|
`);
|
|
88461
88492
|
}
|
|
88462
88493
|
context.out(
|
|
@@ -88485,10 +88516,10 @@ async function invoices({ context, args }) {
|
|
|
88485
88516
|
if (args.flags.json) return printJson(context, list13);
|
|
88486
88517
|
if (list13.length === 0) return context.out("No invoices yet.\n");
|
|
88487
88518
|
for (const invoice of list13) {
|
|
88488
|
-
const
|
|
88519
|
+
const link3 = invoice.hostedUrl ? ` ${invoice.hostedUrl}` : "";
|
|
88489
88520
|
const tax = invoice.tax ? ` (tax ${money(invoice.tax, invoice.currency)})` : "";
|
|
88490
88521
|
context.out(
|
|
88491
|
-
`${invoice.createdAt.slice(0, 10)} ${invoice.number ?? "draft"} ${invoice.status} ${money(invoice.total, invoice.currency)}${tax}${
|
|
88522
|
+
`${invoice.createdAt.slice(0, 10)} ${invoice.number ?? "draft"} ${invoice.status} ${money(invoice.total, invoice.currency)}${tax}${link3}
|
|
88492
88523
|
`
|
|
88493
88524
|
);
|
|
88494
88525
|
}
|
|
@@ -88710,7 +88741,7 @@ function tunnel({
|
|
|
88710
88741
|
host: host2,
|
|
88711
88742
|
port
|
|
88712
88743
|
}) {
|
|
88713
|
-
return new Promise((
|
|
88744
|
+
return new Promise((resolve29, reject) => {
|
|
88714
88745
|
const socket = connectTcp(proxy.port, proxy.host);
|
|
88715
88746
|
let answer6 = "";
|
|
88716
88747
|
const auth = proxy.authorization ? `Proxy-Authorization: ${proxy.authorization}\r
|
|
@@ -88727,7 +88758,7 @@ ${auth}\r
|
|
|
88727
88758
|
answer6 += chunk.toString("latin1");
|
|
88728
88759
|
if (!answer6.includes(HEADER_END)) return;
|
|
88729
88760
|
socket.off("data", onData);
|
|
88730
|
-
if (/^HTTP\/1\.[01] 200/.test(answer6)) return
|
|
88761
|
+
if (/^HTTP\/1\.[01] 200/.test(answer6)) return resolve29(socket);
|
|
88731
88762
|
socket.destroy();
|
|
88732
88763
|
reject(new Error(`proxy refused the tunnel: ${answer6.split("\r\n")[0] ?? ""}`));
|
|
88733
88764
|
};
|
|
@@ -88740,8 +88771,8 @@ async function upstreamOf({ target, proxy }) {
|
|
|
88740
88771
|
const raw = proxy ? await tunnel({ proxy, host: target.hostname, port }) : connectTcp(port, target.hostname);
|
|
88741
88772
|
if (!secure) return raw;
|
|
88742
88773
|
const tls = connectTls({ socket: raw, servername: target.hostname });
|
|
88743
|
-
await new Promise((
|
|
88744
|
-
tls.once("secureConnect", () =>
|
|
88774
|
+
await new Promise((resolve29, reject) => {
|
|
88775
|
+
tls.once("secureConnect", () => resolve29());
|
|
88745
88776
|
tls.once("error", reject);
|
|
88746
88777
|
});
|
|
88747
88778
|
return tls;
|
|
@@ -88783,8 +88814,8 @@ async function browserSocket({
|
|
|
88783
88814
|
createConnection: () => upstream,
|
|
88784
88815
|
perMessageDeflate: false
|
|
88785
88816
|
});
|
|
88786
|
-
await new Promise((
|
|
88787
|
-
socket.once("open", () =>
|
|
88817
|
+
await new Promise((resolve29, reject) => {
|
|
88818
|
+
socket.once("open", () => resolve29());
|
|
88788
88819
|
socket.once("error", reject);
|
|
88789
88820
|
});
|
|
88790
88821
|
return socket;
|
|
@@ -88797,12 +88828,12 @@ async function browserCall({
|
|
|
88797
88828
|
}) {
|
|
88798
88829
|
const socket = await browserSocket({ target, proxy });
|
|
88799
88830
|
try {
|
|
88800
|
-
return await new Promise((
|
|
88831
|
+
return await new Promise((resolve29, reject) => {
|
|
88801
88832
|
socket.on("message", (data) => {
|
|
88802
|
-
const
|
|
88803
|
-
if (
|
|
88804
|
-
if (
|
|
88805
|
-
else
|
|
88833
|
+
const reply3 = JSON.parse(textOf3(data));
|
|
88834
|
+
if (reply3.id !== 1) return;
|
|
88835
|
+
if (reply3.error) reject(new Error(`${method}: ${JSON.stringify(reply3.error)}`));
|
|
88836
|
+
else resolve29(reply3.result ?? {});
|
|
88806
88837
|
});
|
|
88807
88838
|
socket.once(
|
|
88808
88839
|
"close",
|
|
@@ -88966,18 +88997,18 @@ function retargetCdpBridge({
|
|
|
88966
88997
|
target,
|
|
88967
88998
|
expiresAt
|
|
88968
88999
|
}) {
|
|
88969
|
-
return new Promise((
|
|
89000
|
+
return new Promise((resolve29) => {
|
|
88970
89001
|
const call = httpRequest(
|
|
88971
89002
|
{ host: "127.0.0.1", port, path: TARGET_PATH, method: "PUT", timeout: 2e3 },
|
|
88972
89003
|
(response) => {
|
|
88973
89004
|
response.resume();
|
|
88974
|
-
|
|
89005
|
+
resolve29(response.statusCode === 204);
|
|
88975
89006
|
}
|
|
88976
89007
|
);
|
|
88977
89008
|
call.setHeader(KEY_HEADER, key);
|
|
88978
89009
|
call.setHeader("content-type", "application/json");
|
|
88979
89010
|
call.once("timeout", () => call.destroy());
|
|
88980
|
-
call.once("error", () =>
|
|
89011
|
+
call.once("error", () => resolve29(false));
|
|
88981
89012
|
call.end(JSON.stringify({ target, expiresAt }));
|
|
88982
89013
|
});
|
|
88983
89014
|
}
|
|
@@ -89026,15 +89057,15 @@ async function startCdpBridge({
|
|
|
89026
89057
|
(socket) => relayPage({ client: socket, targetId, target: url2, proxy })
|
|
89027
89058
|
);
|
|
89028
89059
|
});
|
|
89029
|
-
await new Promise((
|
|
89060
|
+
await new Promise((resolve29) => server.listen(0, "127.0.0.1", resolve29));
|
|
89030
89061
|
const port = server.address().port;
|
|
89031
89062
|
return {
|
|
89032
89063
|
port,
|
|
89033
|
-
close: () => new Promise((
|
|
89064
|
+
close: () => new Promise((resolve29) => {
|
|
89034
89065
|
for (const client of relayed) client.destroy();
|
|
89035
89066
|
pages.close();
|
|
89036
89067
|
server.closeAllConnections();
|
|
89037
|
-
server.close(() =>
|
|
89068
|
+
server.close(() => resolve29());
|
|
89038
89069
|
})
|
|
89039
89070
|
};
|
|
89040
89071
|
}
|
|
@@ -89051,7 +89082,7 @@ function launchCdpBridge({
|
|
|
89051
89082
|
stdio: ["ignore", "pipe", "ignore"],
|
|
89052
89083
|
env: { ...env, LAZE_CDP_TARGET: target, LAZE_CDP_EXPIRES_AT: expiresAt, LAZE_CDP_KEY: key }
|
|
89053
89084
|
});
|
|
89054
|
-
return new Promise((
|
|
89085
|
+
return new Promise((resolve29, reject) => {
|
|
89055
89086
|
let printed2 = "";
|
|
89056
89087
|
child.once("error", reject);
|
|
89057
89088
|
child.once("exit", (code4) => reject(new Error(`the CDP bridge stopped (${code4})`)));
|
|
@@ -89062,7 +89093,7 @@ function launchCdpBridge({
|
|
|
89062
89093
|
child.stdout.destroy();
|
|
89063
89094
|
child.removeAllListeners("exit");
|
|
89064
89095
|
child.unref();
|
|
89065
|
-
if (Number.isInteger(port) && port > 0)
|
|
89096
|
+
if (Number.isInteger(port) && port > 0) resolve29(port);
|
|
89066
89097
|
else reject(new Error("the CDP bridge printed no port"));
|
|
89067
89098
|
});
|
|
89068
89099
|
});
|
|
@@ -89233,15 +89264,15 @@ async function bridge({ context }) {
|
|
|
89233
89264
|
async function screen({ context, args }) {
|
|
89234
89265
|
const client = await computeClient({ context, args });
|
|
89235
89266
|
const site = flagText({ args, name: "site" }) || void 0;
|
|
89236
|
-
const
|
|
89267
|
+
const link3 = await client.post(PATHS2.screen, {
|
|
89237
89268
|
machine: machineArg({ args }),
|
|
89238
89269
|
...site ? { site } : {}
|
|
89239
89270
|
});
|
|
89240
|
-
if (args.flags.json) return context.out(`${JSON.stringify(
|
|
89271
|
+
if (args.flags.json) return context.out(`${JSON.stringify(link3, null, 2)}
|
|
89241
89272
|
`);
|
|
89242
89273
|
context.out(
|
|
89243
|
-
|
|
89244
|
-
` : `Sent a fresh screen link for ${
|
|
89274
|
+
link3.url ? `${link3.url}
|
|
89275
|
+
` : `Sent a fresh screen link for ${link3.machine.name} where you were asked.
|
|
89245
89276
|
`
|
|
89246
89277
|
);
|
|
89247
89278
|
}
|
|
@@ -89323,9 +89354,9 @@ function presenceColumns(member) {
|
|
|
89323
89354
|
return [member.presence, `${status11.emoji} ${status11.text}`.trim() + until, ...dndColumn(member)];
|
|
89324
89355
|
}
|
|
89325
89356
|
function formatMembers({ detail }) {
|
|
89326
|
-
const
|
|
89357
|
+
const count14 = `${detail.members.length} ${detail.members.length === 1 ? "member" : "members"}`;
|
|
89327
89358
|
const ends = detail.endsAt ? `, ends ${utcTimeOf(detail.endsAt)}` : "";
|
|
89328
|
-
const head = `${channelLabelOf(detail)} (${detail.id}), ${
|
|
89359
|
+
const head = `${channelLabelOf(detail)} (${detail.id}), ${count14}${ends}`;
|
|
89329
89360
|
const rows = detail.members.map(
|
|
89330
89361
|
(member) => [ROLE[member.role], member.name, member.kind, member.id, ...presenceColumns(member)].join(" ")
|
|
89331
89362
|
);
|
|
@@ -89365,13 +89396,13 @@ function formatBrowsable({
|
|
|
89365
89396
|
}) {
|
|
89366
89397
|
if (channels3.length === 0) return "No channels to browse.\n";
|
|
89367
89398
|
const rows = channels3.map((channel) => {
|
|
89368
|
-
const
|
|
89399
|
+
const count14 = `${channel.memberCount} ${channel.memberCount === 1 ? "member" : "members"}`;
|
|
89369
89400
|
const marks = [
|
|
89370
89401
|
channel.joined ? "joined" : "not joined",
|
|
89371
89402
|
...channel.private ? ["private"] : [],
|
|
89372
89403
|
...channel.archived ? ["archived"] : []
|
|
89373
89404
|
].join(", ");
|
|
89374
|
-
const text3 = `#${channel.name} ${channel.id} ${
|
|
89405
|
+
const text3 = `#${channel.name} ${channel.id} ${count14} ${marks} ${channel.topic}`;
|
|
89375
89406
|
return withLink({ text: text3, url: channel.url, base });
|
|
89376
89407
|
});
|
|
89377
89408
|
return `${rows.join("\n")}
|
|
@@ -89741,13 +89772,13 @@ async function channelGroups({ context, args }) {
|
|
|
89741
89772
|
const [, , channel] = args.words;
|
|
89742
89773
|
if (!channel) throw new CliUsageError("Usage: laze channel groups <channel>");
|
|
89743
89774
|
const { client } = await signedIn({ context, args });
|
|
89744
|
-
const
|
|
89775
|
+
const reply3 = await client.post("/api/agents/me/channels/groups", {
|
|
89745
89776
|
channel
|
|
89746
89777
|
});
|
|
89747
|
-
if (args.flags.json) return context.out(`${JSON.stringify(
|
|
89778
|
+
if (args.flags.json) return context.out(`${JSON.stringify(reply3, null, 2)}
|
|
89748
89779
|
`);
|
|
89749
|
-
if (
|
|
89750
|
-
for (const group of
|
|
89780
|
+
if (reply3.groups.length === 0) return context.out("No groups in this channel.\n");
|
|
89781
|
+
for (const group of reply3.groups) context.out(`@${group.name} ${group.memberCount}
|
|
89751
89782
|
`);
|
|
89752
89783
|
}
|
|
89753
89784
|
function groupChange({
|
|
@@ -89760,11 +89791,11 @@ function groupChange({
|
|
|
89760
89791
|
throw new CliUsageError(`Usage: laze channel ${verb} <channel> <group>`);
|
|
89761
89792
|
}
|
|
89762
89793
|
const { client } = await signedIn({ context, args });
|
|
89763
|
-
const
|
|
89794
|
+
const reply3 = await client.post(`/api/agents/me/channels/${verb}`, {
|
|
89764
89795
|
channel,
|
|
89765
89796
|
group
|
|
89766
89797
|
});
|
|
89767
|
-
if (args.flags.json) return context.out(`${JSON.stringify(
|
|
89798
|
+
if (args.flags.json) return context.out(`${JSON.stringify(reply3, null, 2)}
|
|
89768
89799
|
`);
|
|
89769
89800
|
context.out(`${line(group.replace(/^@/, ""))}
|
|
89770
89801
|
`);
|
|
@@ -90083,15 +90114,15 @@ async function threadWaitReply({
|
|
|
90083
90114
|
const seconds = timeoutOf({ args });
|
|
90084
90115
|
const { client } = await signedIn({ context, args });
|
|
90085
90116
|
const read4 = () => client.post(CHAT_KEY_PATHS.thread, { messageId });
|
|
90086
|
-
const seen = new Set((await read4()).replies.map((
|
|
90087
|
-
const isNew = (
|
|
90117
|
+
const seen = new Set((await read4()).replies.map((reply3) => reply3.id));
|
|
90118
|
+
const isNew = (reply3) => reply3.author.kind === "person" && !seen.has(reply3.id);
|
|
90088
90119
|
for (let waited = 0; waited < seconds * 1e3; waited += POLL_MS2) {
|
|
90089
90120
|
await context.sleep(POLL_MS2);
|
|
90090
|
-
const
|
|
90091
|
-
if (!
|
|
90092
|
-
const line = `${
|
|
90121
|
+
const reply3 = (await read4()).replies.find(isNew);
|
|
90122
|
+
if (!reply3) continue;
|
|
90123
|
+
const line = `${reply3.seq} ${reply3.id} person ${reply3.author.id} ${reply3.body}
|
|
90093
90124
|
`;
|
|
90094
|
-
context.out(args.flags.json ? `${JSON.stringify(
|
|
90125
|
+
context.out(args.flags.json ? `${JSON.stringify(reply3, null, 2)}
|
|
90095
90126
|
` : line);
|
|
90096
90127
|
return void 0;
|
|
90097
90128
|
}
|
|
@@ -93321,7 +93352,7 @@ var sendWakeIntentDefinition = external_exports.object({
|
|
|
93321
93352
|
});
|
|
93322
93353
|
|
|
93323
93354
|
// ../../modules/compute/contract/src/whatsapp-ops.ts
|
|
93324
|
-
var
|
|
93355
|
+
var count12 = external_exports.number().int().nonnegative();
|
|
93325
93356
|
var at4 = external_exports.iso.datetime();
|
|
93326
93357
|
var whatsappMirrorHealthDefinition = external_exports.object({
|
|
93327
93358
|
mirrors: external_exports.array(
|
|
@@ -93339,33 +93370,33 @@ var whatsappMirrorHealthDefinition = external_exports.object({
|
|
|
93339
93370
|
nextVisitAt: at4.nullable(),
|
|
93340
93371
|
touchedAt: at4.nullable(),
|
|
93341
93372
|
createdAt: at4,
|
|
93342
|
-
skipped: external_exports.object({ count:
|
|
93373
|
+
skipped: external_exports.object({ count: count12, from: external_exports.number().int().nullable(), at: at4.nullable() }),
|
|
93343
93374
|
/** The last pull that met files; null when none did. */
|
|
93344
93375
|
files: external_exports.object({
|
|
93345
93376
|
at: at4,
|
|
93346
|
-
attached:
|
|
93347
|
-
unavailable:
|
|
93348
|
-
retrying:
|
|
93349
|
-
dropped:
|
|
93377
|
+
attached: count12,
|
|
93378
|
+
unavailable: count12,
|
|
93379
|
+
retrying: count12,
|
|
93380
|
+
dropped: count12,
|
|
93350
93381
|
failureCode: external_exports.string().nullable()
|
|
93351
93382
|
}).nullable(),
|
|
93352
93383
|
/** Intake holds (ADR-216 §11) by kind and code, with when the oldest was made. */
|
|
93353
|
-
holds: external_exports.array(external_exports.object({ kind: external_exports.string(), code: external_exports.string(), count:
|
|
93384
|
+
holds: external_exports.array(external_exports.object({ kind: external_exports.string(), code: external_exports.string(), count: count12, oldestAt: at4 })),
|
|
93354
93385
|
/**
|
|
93355
93386
|
* The computer store's fill (ADR-223): chats done, how many mirrored items from the last 6
|
|
93356
93387
|
* months Laze held, those the store held and those sent; the mirrored items Laze holds now
|
|
93357
93388
|
* and how many a trim to 7 days after last read would delete. Null before a fill started.
|
|
93358
93389
|
*/
|
|
93359
93390
|
storeFill: external_exports.object({
|
|
93360
|
-
chats:
|
|
93361
|
-
lazeHeld:
|
|
93362
|
-
alreadyHeld:
|
|
93363
|
-
sent:
|
|
93391
|
+
chats: count12,
|
|
93392
|
+
lazeHeld: count12,
|
|
93393
|
+
alreadyHeld: count12,
|
|
93394
|
+
sent: count12,
|
|
93364
93395
|
problem: external_exports.string().nullable(),
|
|
93365
93396
|
filledAt: at4.nullable(),
|
|
93366
93397
|
updatedAt: at4,
|
|
93367
|
-
mirrored:
|
|
93368
|
-
trimmable:
|
|
93398
|
+
mirrored: count12,
|
|
93399
|
+
trimmable: count12
|
|
93369
93400
|
}).nullable().optional()
|
|
93370
93401
|
})
|
|
93371
93402
|
)
|
|
@@ -93395,7 +93426,7 @@ var whatsappSendsDefinition = external_exports.object({
|
|
|
93395
93426
|
quoted: external_exports.boolean(),
|
|
93396
93427
|
/** Sends to the same chat share a number, counted from 1 in this answer; never the chat. */
|
|
93397
93428
|
chatIndex: external_exports.number().int().min(1),
|
|
93398
|
-
files:
|
|
93429
|
+
files: count12,
|
|
93399
93430
|
/**
|
|
93400
93431
|
* Why a failed send did not go: its stored code, or for older sends the code its outcome
|
|
93401
93432
|
* line reads as; "other" when none fits, null for a send that did not fail.
|
|
@@ -93423,7 +93454,7 @@ var whatsappSendStreamsDefinition = external_exports.object({
|
|
|
93423
93454
|
failureCode: external_exports.string().nullable(),
|
|
93424
93455
|
createdAt: at4,
|
|
93425
93456
|
/** The stream's events, its last event's kind and time; zero and null for none. */
|
|
93426
|
-
events:
|
|
93457
|
+
events: count12,
|
|
93427
93458
|
lastEvent: external_exports.enum(["requested", "taken", "evidenced", "refused", "unresolved", "recheck_requested"]).nullable(),
|
|
93428
93459
|
lastEventAt: at4.nullable(),
|
|
93429
93460
|
/** The process's step and deadline; null when no process holds the send. */
|
|
@@ -93434,9 +93465,9 @@ var whatsappSendStreamsDefinition = external_exports.object({
|
|
|
93434
93465
|
})
|
|
93435
93466
|
),
|
|
93436
93467
|
/** Counts over the answered sends. */
|
|
93437
|
-
total:
|
|
93438
|
-
agree:
|
|
93439
|
-
disagree:
|
|
93468
|
+
total: count12,
|
|
93469
|
+
agree: count12,
|
|
93470
|
+
disagree: count12
|
|
93440
93471
|
});
|
|
93441
93472
|
var whatsappSendStreamsSchema = whatsappSendStreamsDefinition;
|
|
93442
93473
|
var WHATSAPP_WAKE_STEPS = [
|
|
@@ -93476,11 +93507,11 @@ var whatsappWakeTimelineDefinition = external_exports.object({
|
|
|
93476
93507
|
external_exports.object({
|
|
93477
93508
|
step: external_exports.enum(WHATSAPP_WAKE_STEPS),
|
|
93478
93509
|
at: at4,
|
|
93479
|
-
sincePreviousMs:
|
|
93480
|
-
sinceRequestMs:
|
|
93510
|
+
sincePreviousMs: count12,
|
|
93511
|
+
sinceRequestMs: count12
|
|
93481
93512
|
})
|
|
93482
93513
|
),
|
|
93483
|
-
totalMs:
|
|
93514
|
+
totalMs: count12.nullable()
|
|
93484
93515
|
})
|
|
93485
93516
|
)
|
|
93486
93517
|
})
|
|
@@ -95956,8 +95987,8 @@ var history = async ({ context, args, client }) => {
|
|
|
95956
95987
|
if (json4({ context, args, data: page })) return;
|
|
95957
95988
|
if (page.messages.length === 0) return context.out("No older messages.\n");
|
|
95958
95989
|
for (const message2 of page.messages) {
|
|
95959
|
-
const
|
|
95960
|
-
context.out(`[${message2.createdAt}] ${message2.authorName}: ${message2.body}${
|
|
95990
|
+
const files3 = message2.files.length > 0 ? ` [${message2.files.length} files]` : "";
|
|
95991
|
+
context.out(`[${message2.createdAt}] ${message2.authorName}: ${message2.body}${files3}
|
|
95961
95992
|
`);
|
|
95962
95993
|
}
|
|
95963
95994
|
if (page.hasOlder) {
|
|
@@ -98206,8 +98237,8 @@ function draftFilesMissingText(names) {
|
|
|
98206
98237
|
}
|
|
98207
98238
|
|
|
98208
98239
|
// ../../modules/feed/contract/src/feed.decisions.ts
|
|
98209
|
-
function decisionsLineOf(
|
|
98210
|
-
return `${
|
|
98240
|
+
function decisionsLineOf(count14) {
|
|
98241
|
+
return `${count14} ${count14 === 1 ? "decision" : "decisions"} waiting on you`;
|
|
98211
98242
|
}
|
|
98212
98243
|
|
|
98213
98244
|
// src/rules/feed-input.rules.ts
|
|
@@ -98548,16 +98579,16 @@ async function bodyOf2({
|
|
|
98548
98579
|
return body;
|
|
98549
98580
|
}
|
|
98550
98581
|
function keptFilesOf({
|
|
98551
|
-
files:
|
|
98582
|
+
files: files3,
|
|
98552
98583
|
removing
|
|
98553
98584
|
}) {
|
|
98554
98585
|
const matches = (file4, name3) => file4.id === name3 || file4.fileName === name3;
|
|
98555
|
-
const unknown2 = removing.filter((name3) => !
|
|
98586
|
+
const unknown2 = removing.filter((name3) => !files3.some((file4) => matches(file4, name3)));
|
|
98556
98587
|
if (unknown2.length > 0) {
|
|
98557
|
-
const on =
|
|
98588
|
+
const on = files3.map((file4) => `${file4.fileName} (${file4.id})`).join(", ") || "none";
|
|
98558
98589
|
throw new CliUsageError(`The card has no file ${unknown2.join(", ")}; its files: ${on}`);
|
|
98559
98590
|
}
|
|
98560
|
-
return
|
|
98591
|
+
return files3.filter((file4) => !removing.some((name3) => matches(file4, name3)));
|
|
98561
98592
|
}
|
|
98562
98593
|
function refuseNamedFilesMissing({
|
|
98563
98594
|
args,
|
|
@@ -98745,8 +98776,8 @@ function optionalWords(words) {
|
|
|
98745
98776
|
}
|
|
98746
98777
|
function shareLinesOf({ move: move3, answer: answer6 }) {
|
|
98747
98778
|
const names = answer6.people.map((person) => person.name).join(", ") || "no one new";
|
|
98748
|
-
const
|
|
98749
|
-
const items = `${
|
|
98779
|
+
const count14 = answer6.itemIds.length;
|
|
98780
|
+
const items = `${count14} item${count14 === 1 ? "" : "s"}`;
|
|
98750
98781
|
const head = move3 === "share" ? `Shared ${items} with ${names}` : `Took ${names} off ${items}`;
|
|
98751
98782
|
return [head, ...answer6.itemIds].map((line) => `${line}
|
|
98752
98783
|
`).join("");
|
|
@@ -98773,9 +98804,9 @@ async function feedGroupSummary({ context, args }) {
|
|
|
98773
98804
|
const pointer = await client.post("/api/feed/group-summary", { group });
|
|
98774
98805
|
if (args.flags.json) return context.out(`${JSON.stringify(pointer, null, 2)}
|
|
98775
98806
|
`);
|
|
98776
|
-
const
|
|
98807
|
+
const link3 = pointer.link.startsWith("/") ? pointer.path : pointer.link;
|
|
98777
98808
|
const top = pointer.top.map((title, index) => `${index + 1}. ${title}`);
|
|
98778
|
-
context.out(`${[pointer.headline,
|
|
98809
|
+
context.out(`${[pointer.headline, link3, ...top].join("\n")}
|
|
98779
98810
|
`);
|
|
98780
98811
|
}
|
|
98781
98812
|
var PLACES = { open: "open", coming_up: "coming up", handled: "handled" };
|
|
@@ -99374,8 +99405,8 @@ function linesOf3(output2) {
|
|
|
99374
99405
|
function blockOf2(line) {
|
|
99375
99406
|
const badge = line.source ? ` [${line.source}]` : "";
|
|
99376
99407
|
const thread2 = line.threadRootId ? ` in thread ${line.threadRootId}` : "";
|
|
99377
|
-
const
|
|
99378
|
-
const head = `${timeOf2(line.at)} ${line.author}${badge} ${line.cursor}${thread2}${
|
|
99408
|
+
const link3 = line.link ? ` ${line.link}` : "";
|
|
99409
|
+
const head = `${timeOf2(line.at)} ${line.author}${badge} ${line.cursor}${thread2}${link3}`;
|
|
99379
99410
|
const body = line.body.split("\n").map((each) => ` ${each}`);
|
|
99380
99411
|
const replies = line.replyCount > 0 ? [` ${line.replyCount} ${line.replyCount === 1 ? "reply" : "replies"} in its thread`] : [];
|
|
99381
99412
|
return [head, ...body, ...replies].join("\n");
|
|
@@ -99393,13 +99424,13 @@ function formatHistory(output2) {
|
|
|
99393
99424
|
const lines2 = linesOf3(output2);
|
|
99394
99425
|
if (lines2.length === 0) return `${where}${from}: no messages.
|
|
99395
99426
|
`;
|
|
99396
|
-
const
|
|
99427
|
+
const count14 = lines2.length === 1 ? "1 message" : `${lines2.length} messages`;
|
|
99397
99428
|
const blocks = lines2.map(blockOf2).join("\n\n");
|
|
99398
99429
|
const cursor = olderCursorOf(output2);
|
|
99399
99430
|
const older = cursor ? `
|
|
99400
99431
|
|
|
99401
99432
|
Older: laze history ${output2.channel} --before ${cursor}` : "";
|
|
99402
|
-
return `${where}${from}: ${
|
|
99433
|
+
return `${where}${from}: ${count14}, oldest first
|
|
99403
99434
|
|
|
99404
99435
|
${blocks}${older}
|
|
99405
99436
|
`;
|
|
@@ -100748,10 +100779,10 @@ ${USAGE13}`);
|
|
|
100748
100779
|
if ("exitCode" in released) return released;
|
|
100749
100780
|
Object.assign(env, released.env);
|
|
100750
100781
|
}
|
|
100751
|
-
const
|
|
100752
|
-
if (
|
|
100782
|
+
const count14 = Object.keys(env).length;
|
|
100783
|
+
if (count14 > EXEC_ENV_MAX) {
|
|
100753
100784
|
context.err(
|
|
100754
|
-
`laze: these connections hold ${
|
|
100785
|
+
`laze: these connections hold ${count14} variables; at most ${EXEC_ENV_MAX} go with a command. Send fewer connections, or run the command with \`laze vault run\` where you run.
|
|
100755
100786
|
`
|
|
100756
100787
|
);
|
|
100757
100788
|
return { exitCode: 1 };
|
|
@@ -100908,7 +100939,7 @@ function secretRefusal({
|
|
|
100908
100939
|
rules = MCP_SECRET_COMMANDS
|
|
100909
100940
|
}) {
|
|
100910
100941
|
const { words, flags: flags2 } = parseArgs({ argv });
|
|
100911
|
-
const command = [3, 2, 1].map((
|
|
100942
|
+
const command = [3, 2, 1].map((count14) => words.slice(0, count14).join(" ")).find((name3) => Object.hasOwn(rules, name3));
|
|
100912
100943
|
const rule = command === void 0 ? void 0 : rules[command];
|
|
100913
100944
|
if (!command || !rule) return void 0;
|
|
100914
100945
|
const vaultFlag = rule.vaultFlag ?? "from-vault";
|
|
@@ -101094,12 +101125,12 @@ async function writeMount({
|
|
|
101094
101125
|
context,
|
|
101095
101126
|
args,
|
|
101096
101127
|
folder,
|
|
101097
|
-
files:
|
|
101128
|
+
files: files3
|
|
101098
101129
|
}) {
|
|
101099
101130
|
const root = resolve19(context.cwd, flagText({ args, name: "dir", fallback: ".laze" }), folder);
|
|
101100
101131
|
await rm17(root, { recursive: true, force: true });
|
|
101101
101132
|
await mkdir11(root, { recursive: true });
|
|
101102
|
-
for (const file4 of
|
|
101133
|
+
for (const file4 of files3) {
|
|
101103
101134
|
const target = resolve19(root, file4.path);
|
|
101104
101135
|
const inside = relative4(root, target);
|
|
101105
101136
|
if (!inside || inside.startsWith(".."))
|
|
@@ -101218,12 +101249,12 @@ async function memorySearch({ context, args }) {
|
|
|
101218
101249
|
async function memoryPull({ context, args }) {
|
|
101219
101250
|
const channel = turnChannel({ context, args });
|
|
101220
101251
|
const { client } = await turnClient({ context, args });
|
|
101221
|
-
const
|
|
101222
|
-
const root = await writeMount({ context, args, folder: "memory", files:
|
|
101252
|
+
const files3 = await client.post("/api/memory/files", channel ? { channel } : {});
|
|
101253
|
+
const root = await writeMount({ context, args, folder: "memory", files: files3 });
|
|
101223
101254
|
if (args.flags.json)
|
|
101224
|
-
return context.out(`${JSON.stringify({ root, files:
|
|
101255
|
+
return context.out(`${JSON.stringify({ root, files: files3.map((f) => f.path) })}
|
|
101225
101256
|
`);
|
|
101226
|
-
context.out(`${
|
|
101257
|
+
context.out(`${files3.length} files in ${root}
|
|
101227
101258
|
`);
|
|
101228
101259
|
}
|
|
101229
101260
|
async function turnTokenOf5({ context }) {
|
|
@@ -101659,11 +101690,11 @@ async function monitorAdd({ context, args }) {
|
|
|
101659
101690
|
});
|
|
101660
101691
|
if (args.flags.json) return context.out(`${JSON.stringify(added, null, 2)}
|
|
101661
101692
|
`);
|
|
101662
|
-
const
|
|
101693
|
+
const count14 = added.watching.length;
|
|
101663
101694
|
context.out(
|
|
101664
101695
|
`${added.monitor.id} ${added.monitor.name}
|
|
101665
101696
|
${added.watching.join(" ")}
|
|
101666
|
-
Watching ${
|
|
101697
|
+
Watching ${count14} ${count14 === 1 ? "channel" : "channels"}
|
|
101667
101698
|
`
|
|
101668
101699
|
);
|
|
101669
101700
|
}
|
|
@@ -103050,12 +103081,12 @@ var funnelInputDefinition = external_exports.object({
|
|
|
103050
103081
|
to: external_exports.iso.datetime(),
|
|
103051
103082
|
bucketMinutes: external_exports.union([external_exports.literal(10), external_exports.literal(60), external_exports.literal(1440)]).default(60)
|
|
103052
103083
|
}).strict();
|
|
103053
|
-
var
|
|
103084
|
+
var count13 = external_exports.number().int().nonnegative();
|
|
103054
103085
|
var funnelCountsDefinition = external_exports.object({
|
|
103055
|
-
signUps:
|
|
103056
|
-
workspaces:
|
|
103057
|
-
activatedTeams:
|
|
103058
|
-
payingTeams:
|
|
103086
|
+
signUps: count13,
|
|
103087
|
+
workspaces: count13,
|
|
103088
|
+
activatedTeams: count13,
|
|
103089
|
+
payingTeams: count13
|
|
103059
103090
|
});
|
|
103060
103091
|
var funnelOutputDefinition = external_exports.object({
|
|
103061
103092
|
bucketMinutes: external_exports.number().int(),
|
|
@@ -103084,34 +103115,34 @@ var cohortOutputDefinition = external_exports.object({
|
|
|
103084
103115
|
promotionId: external_exports.string().nullable(),
|
|
103085
103116
|
plan: external_exports.string(),
|
|
103086
103117
|
paying: external_exports.boolean(),
|
|
103087
|
-
members:
|
|
103118
|
+
members: count13,
|
|
103088
103119
|
agents: external_exports.object({
|
|
103089
|
-
laze:
|
|
103090
|
-
connected:
|
|
103120
|
+
laze: count13,
|
|
103121
|
+
connected: count13,
|
|
103091
103122
|
firstLazeAgentAt: external_exports.iso.datetime().nullable()
|
|
103092
103123
|
}),
|
|
103093
|
-
turns:
|
|
103094
|
-
appsCreated:
|
|
103095
|
-
connectionsLinked:
|
|
103124
|
+
turns: count13,
|
|
103125
|
+
appsCreated: count13,
|
|
103126
|
+
connectionsLinked: count13,
|
|
103096
103127
|
/** Slack channels mirrored, Slack and Discord link and intake events, WhatsApp mirrors on. */
|
|
103097
103128
|
messaging: external_exports.object({
|
|
103098
|
-
slackChannels:
|
|
103099
|
-
slackEvents:
|
|
103100
|
-
discordEvents:
|
|
103101
|
-
whatsappMirrors:
|
|
103129
|
+
slackChannels: count13,
|
|
103130
|
+
slackEvents: count13,
|
|
103131
|
+
discordEvents: count13,
|
|
103132
|
+
whatsappMirrors: count13
|
|
103102
103133
|
}),
|
|
103103
103134
|
creatorLastMessageAt: external_exports.iso.datetime().nullable(),
|
|
103104
103135
|
/** The creator's last heartbeat from a Laze web or desktop window here; null when never. */
|
|
103105
103136
|
creatorLastSeenAt: external_exports.iso.datetime().nullable(),
|
|
103106
103137
|
/** Members whose last heartbeat here falls in the 7 days before `until`. */
|
|
103107
|
-
peopleSeenLast7Days:
|
|
103138
|
+
peopleSeenLast7Days: count13,
|
|
103108
103139
|
/** Live messages per UTC day; days with none are left out. */
|
|
103109
103140
|
days: external_exports.array(
|
|
103110
103141
|
external_exports.object({
|
|
103111
103142
|
day: external_exports.string(),
|
|
103112
|
-
byPeople:
|
|
103113
|
-
byAgents:
|
|
103114
|
-
people:
|
|
103143
|
+
byPeople: count13,
|
|
103144
|
+
byAgents: count13,
|
|
103145
|
+
people: count13
|
|
103115
103146
|
})
|
|
103116
103147
|
),
|
|
103117
103148
|
/** The once-only sends nurturing kept (first_agent_made, first_agent_nudge, ...). */
|
|
@@ -103135,29 +103166,29 @@ var capacityOutputDefinition = external_exports.object({
|
|
|
103135
103166
|
/** The last day of host load, oldest first. */
|
|
103136
103167
|
history: external_exports.array(hostLoadPointSchema)
|
|
103137
103168
|
});
|
|
103138
|
-
var tally = external_exports.array(external_exports.object({ key: external_exports.string(), count:
|
|
103169
|
+
var tally = external_exports.array(external_exports.object({ key: external_exports.string(), count: count13 }));
|
|
103139
103170
|
var snapshotOutputDefinition = external_exports.object({
|
|
103140
103171
|
workspaceId: external_exports.string(),
|
|
103141
103172
|
createdAt: external_exports.iso.datetime(),
|
|
103142
103173
|
plan: external_exports.string(),
|
|
103143
103174
|
status: external_exports.string(),
|
|
103144
|
-
seats: external_exports.object({ people:
|
|
103175
|
+
seats: external_exports.object({ people: count13, limit: external_exports.number().int().nullable() }),
|
|
103145
103176
|
membersByRole: tally,
|
|
103146
103177
|
invitesByStatus: tally,
|
|
103147
103178
|
agentsByKind: tally,
|
|
103148
103179
|
agentsByHosting: tally,
|
|
103149
|
-
agentsConnected:
|
|
103180
|
+
agentsConnected: count13,
|
|
103150
103181
|
flagsOn: external_exports.array(external_exports.string()),
|
|
103151
|
-
complimentaryComputers:
|
|
103182
|
+
complimentaryComputers: count13
|
|
103152
103183
|
});
|
|
103153
103184
|
var eventsInputDefinition = external_exports.object({ from: external_exports.iso.datetime(), to: external_exports.iso.datetime() }).strict();
|
|
103154
103185
|
var eventCountsDefinition = external_exports.object({
|
|
103155
|
-
total:
|
|
103186
|
+
total: count13,
|
|
103156
103187
|
/** Per type: how many, and the stored bytes of their payloads and sealed copies. */
|
|
103157
103188
|
byType: external_exports.array(
|
|
103158
103189
|
external_exports.object({
|
|
103159
103190
|
eventType: external_exports.string(),
|
|
103160
|
-
count:
|
|
103191
|
+
count: count13,
|
|
103161
103192
|
payloadBytes: external_exports.number().nonnegative(),
|
|
103162
103193
|
encryptedCopyBytes: external_exports.number().nonnegative()
|
|
103163
103194
|
})
|
|
@@ -103211,9 +103242,9 @@ var databaseHealthDefinition = external_exports.object({
|
|
|
103211
103242
|
deadlocks: external_exports.number().nonnegative(),
|
|
103212
103243
|
tempBytes: external_exports.number().nonnegative(),
|
|
103213
103244
|
connections: external_exports.object({
|
|
103214
|
-
total:
|
|
103215
|
-
byState: external_exports.array(external_exports.object({ state: external_exports.string(), count:
|
|
103216
|
-
waitingOnLocks:
|
|
103245
|
+
total: count13,
|
|
103246
|
+
byState: external_exports.array(external_exports.object({ state: external_exports.string(), count: count13 })),
|
|
103247
|
+
waitingOnLocks: count13,
|
|
103217
103248
|
longestActiveSeconds: external_exports.number().nonnegative(),
|
|
103218
103249
|
longestIdleInTransactionSeconds: external_exports.number().nonnegative()
|
|
103219
103250
|
}),
|
|
@@ -103268,7 +103299,7 @@ var tenantAgentsDefinition = external_exports.object({
|
|
|
103268
103299
|
createdAt: external_exports.iso.datetime(),
|
|
103269
103300
|
modelLevel: external_exports.string().nullable(),
|
|
103270
103301
|
model: external_exports.string().nullable(),
|
|
103271
|
-
channels:
|
|
103302
|
+
channels: count13,
|
|
103272
103303
|
limitedUntil: external_exports.iso.datetime().nullable(),
|
|
103273
103304
|
limitedBy: external_exports.string().nullable(),
|
|
103274
103305
|
pausedAt: external_exports.iso.datetime().nullable(),
|
|
@@ -103322,8 +103353,8 @@ var tenantBillingDefinition = external_exports.object({
|
|
|
103322
103353
|
currencyChosen: external_exports.boolean(),
|
|
103323
103354
|
cancelAtPeriodEnd: external_exports.boolean(),
|
|
103324
103355
|
period: external_exports.object({ start: external_exports.iso.datetime(), end: external_exports.iso.datetime() }).nullable(),
|
|
103325
|
-
seats: external_exports.object({ people:
|
|
103326
|
-
complimentarySeats:
|
|
103356
|
+
seats: external_exports.object({ people: count13, limit: count13.nullable(), monthlyPrice: external_exports.number() }),
|
|
103357
|
+
complimentarySeats: count13.nullable(),
|
|
103327
103358
|
credits: external_exports.object({
|
|
103328
103359
|
included: external_exports.number(),
|
|
103329
103360
|
includedLeft: external_exports.number(),
|
|
@@ -103362,14 +103393,14 @@ var tenantVaultDefinition = external_exports.object({
|
|
|
103362
103393
|
external_exports.object({
|
|
103363
103394
|
subject: external_exports.string(),
|
|
103364
103395
|
most: external_exports.string(),
|
|
103365
|
-
maxLeaseSeconds:
|
|
103396
|
+
maxLeaseSeconds: count13.nullable(),
|
|
103366
103397
|
blocked: external_exports.boolean(),
|
|
103367
103398
|
approveNew: external_exports.boolean(),
|
|
103368
103399
|
updatedAt: external_exports.iso.datetime()
|
|
103369
103400
|
})
|
|
103370
103401
|
),
|
|
103371
103402
|
/** Connections waiting for an admin, counted by kind; never a name, label or field. */
|
|
103372
|
-
waitingByKind: external_exports.array(external_exports.object({ key: external_exports.string(), count:
|
|
103403
|
+
waitingByKind: external_exports.array(external_exports.object({ key: external_exports.string(), count: count13 }))
|
|
103373
103404
|
});
|
|
103374
103405
|
var WHATSAPP_INTAKE_KEY_KINDS = ["msg", "edit", "del", "react", "read"];
|
|
103375
103406
|
var tenantWhatsappInputDefinition = external_exports.object({
|
|
@@ -103382,17 +103413,17 @@ var tenantWhatsappOutputDefinition = external_exports.object({
|
|
|
103382
103413
|
intake: external_exports.object({
|
|
103383
103414
|
since: external_exports.iso.datetime(),
|
|
103384
103415
|
until: external_exports.iso.datetime(),
|
|
103385
|
-
total:
|
|
103416
|
+
total: count13,
|
|
103386
103417
|
byKind: external_exports.array(
|
|
103387
103418
|
external_exports.object({
|
|
103388
103419
|
kind: external_exports.enum([...WHATSAPP_INTAKE_KEY_KINDS, "other"]),
|
|
103389
|
-
count:
|
|
103420
|
+
count: count13,
|
|
103390
103421
|
/** Events dated over a second after Laze got them, and the most ahead: a fast clock. */
|
|
103391
|
-
aheadOfLaze: external_exports.object({ count:
|
|
103422
|
+
aheadOfLaze: external_exports.object({ count: count13, maxAheadMs: external_exports.number().int() }).optional()
|
|
103392
103423
|
})
|
|
103393
103424
|
),
|
|
103394
103425
|
/** The workspace's chat messages and changes dated over a second after Laze stored them. */
|
|
103395
|
-
chatAheadOfLaze: external_exports.object({ count:
|
|
103426
|
+
chatAheadOfLaze: external_exports.object({ count: count13, maxAheadMs: external_exports.number().int() }).optional()
|
|
103396
103427
|
})
|
|
103397
103428
|
});
|
|
103398
103429
|
var computerBrowserInputDefinition = external_exports.object({
|
|
@@ -103512,6 +103543,26 @@ var vaultAsksInputDefinition = external_exports.object({
|
|
|
103512
103543
|
cursor: cursorDefinition.optional()
|
|
103513
103544
|
}).strict();
|
|
103514
103545
|
var vaultAsksOutputDefinition = external_exports.object({ asks: pageOf(vaultOpsAskSchema) });
|
|
103546
|
+
var variableReferenceKeysInputDefinition = external_exports.object({
|
|
103547
|
+
limit: external_exports.number().int().min(1).max(500).default(100),
|
|
103548
|
+
cursor: cursorDefinition.optional()
|
|
103549
|
+
}).strict();
|
|
103550
|
+
var variableReferenceKeysOutputDefinition = external_exports.object({
|
|
103551
|
+
keys: pageOf(
|
|
103552
|
+
external_exports.object({
|
|
103553
|
+
...vaultOpsReferenceKeySchema.omit({ name: true }).shape,
|
|
103554
|
+
/** Messages since the key was made naming it in its owner's conversations; null: no owner. */
|
|
103555
|
+
messageCount: external_exports.number().int().nonnegative().nullable(),
|
|
103556
|
+
/** The count reached the cap, so there are at least that many. */
|
|
103557
|
+
messageCountCapped: external_exports.boolean()
|
|
103558
|
+
})
|
|
103559
|
+
),
|
|
103560
|
+
scanned: external_exports.number().int().nonnegative(),
|
|
103561
|
+
opened: external_exports.number().int().nonnegative(),
|
|
103562
|
+
deviceOnlyCount: external_exports.number().int().nonnegative(),
|
|
103563
|
+
failed: external_exports.number().int().nonnegative(),
|
|
103564
|
+
stopped: external_exports.boolean()
|
|
103565
|
+
});
|
|
103515
103566
|
var vaultConnectionsInputDefinition = external_exports.object({
|
|
103516
103567
|
from: external_exports.iso.datetime(),
|
|
103517
103568
|
to: external_exports.iso.datetime(),
|
|
@@ -103762,6 +103813,13 @@ var OPS_FUNCTIONS = {
|
|
|
103762
103813
|
input: judgeMeasureInputDefinition,
|
|
103763
103814
|
output: judgeMeasureOutputDefinition
|
|
103764
103815
|
}),
|
|
103816
|
+
"vault.variable_reference_keys": entry({
|
|
103817
|
+
title: "Pasted keys whose value is a shell variable reference, with how many messages name them",
|
|
103818
|
+
scope: "platform",
|
|
103819
|
+
view: "table",
|
|
103820
|
+
input: variableReferenceKeysInputDefinition,
|
|
103821
|
+
output: variableReferenceKeysOutputDefinition
|
|
103822
|
+
}),
|
|
103765
103823
|
"traces.browser_errors": entry({
|
|
103766
103824
|
title: "Browser errors over a range: message, frames, route, release and session",
|
|
103767
103825
|
scope: "platform",
|
|
@@ -104423,13 +104481,13 @@ var USAGE18 = `Usage:
|
|
|
104423
104481
|
With a person's key, list without --agent shows every agent's skills.`;
|
|
104424
104482
|
async function folderFiles({ root }) {
|
|
104425
104483
|
const entries = await readdir8(root, { recursive: true, withFileTypes: true });
|
|
104426
|
-
const
|
|
104484
|
+
const files3 = [];
|
|
104427
104485
|
for (const entry2 of entries) {
|
|
104428
104486
|
if (!entry2.isFile()) continue;
|
|
104429
104487
|
const full = join36(entry2.parentPath, entry2.name);
|
|
104430
|
-
|
|
104488
|
+
files3.push({ path: relative5(root, full), content: await readFile33(full, "utf8") });
|
|
104431
104489
|
}
|
|
104432
|
-
return
|
|
104490
|
+
return files3.toSorted((a, b) => a.path.localeCompare(b.path));
|
|
104433
104491
|
}
|
|
104434
104492
|
function pinNote(skill2) {
|
|
104435
104493
|
if (skill2.updateAvailable) return " (pinned, a newer version is available)";
|
|
@@ -104458,12 +104516,12 @@ async function skillInstall({ context, args }) {
|
|
|
104458
104516
|
if (!catalogueId === !from) throw new CliUsageError(USAGE18);
|
|
104459
104517
|
const name3 = flagText({ args, name: "as" });
|
|
104460
104518
|
const agent3 = flagText({ args, name: "agent" });
|
|
104461
|
-
const
|
|
104519
|
+
const files3 = from ? await folderFiles({ root: resolve22(context.cwd, from) }) : void 0;
|
|
104462
104520
|
const { client } = await signedIn({ context, args });
|
|
104463
104521
|
const installed = await client.post("/api/skills/install", {
|
|
104464
104522
|
...catalogueId ? { catalogueId } : {},
|
|
104465
104523
|
...name3 ? { name: name3 } : {},
|
|
104466
|
-
...
|
|
104524
|
+
...files3 ? { files: files3 } : {},
|
|
104467
104525
|
...agent3 ? { agentId: agent3 } : {}
|
|
104468
104526
|
});
|
|
104469
104527
|
if (args.flags.json) return context.out(`${JSON.stringify(installed, null, 2)}
|
|
@@ -104492,12 +104550,12 @@ ${skillMd.content}`);
|
|
|
104492
104550
|
}
|
|
104493
104551
|
async function skillPull({ context, args }) {
|
|
104494
104552
|
const { client } = await signedIn({ context, args });
|
|
104495
|
-
const
|
|
104496
|
-
const root = await writeMount({ context, args, folder: "skills", files:
|
|
104553
|
+
const files3 = await client.get("/api/skills/files");
|
|
104554
|
+
const root = await writeMount({ context, args, folder: "skills", files: files3 });
|
|
104497
104555
|
if (args.flags.json)
|
|
104498
|
-
return context.out(`${JSON.stringify({ root, files:
|
|
104556
|
+
return context.out(`${JSON.stringify({ root, files: files3.map((f) => f.path) })}
|
|
104499
104557
|
`);
|
|
104500
|
-
context.out(`${
|
|
104558
|
+
context.out(`${files3.length} files in ${root}
|
|
104501
104559
|
`);
|
|
104502
104560
|
}
|
|
104503
104561
|
function agentFlag(args) {
|
|
@@ -104651,9 +104709,9 @@ function authorizeRun2(path, label3, body) {
|
|
|
104651
104709
|
};
|
|
104652
104710
|
}
|
|
104653
104711
|
function printConnection4({ context, row }) {
|
|
104654
|
-
const
|
|
104712
|
+
const link3 = row.viewerLinkState ?? "not linked";
|
|
104655
104713
|
context.out(
|
|
104656
|
-
`${row.teamId} ${row.label ?? row.teamName} ${row.status} ${row.mirrors.length} mirrored ${row.linkedPeople} linked you: ${
|
|
104714
|
+
`${row.teamId} ${row.label ?? row.teamName} ${row.status} ${row.mirrors.length} mirrored ${row.linkedPeople} linked you: ${link3}
|
|
104657
104715
|
`
|
|
104658
104716
|
);
|
|
104659
104717
|
}
|
|
@@ -106106,7 +106164,7 @@ async function vaultSave({ context, args }) {
|
|
|
106106
106164
|
// src/services/vault-scrub-commands.service.ts
|
|
106107
106165
|
function lineOf6(channel) {
|
|
106108
106166
|
const where = channel.name ? `#${channel.name}` : channel.channelId;
|
|
106109
|
-
const found = Object.entries(channel.found).map(([vendor,
|
|
106167
|
+
const found = Object.entries(channel.found).map(([vendor, count14]) => `${vendor} ${count14}`).join(", ");
|
|
106110
106168
|
const kinds = [`held ${channel.held}`, ...found ? [`found: ${found}`] : []].join("; ");
|
|
106111
106169
|
return `${where} scanned ${channel.scanned} changed ${channel.messages} ${kinds}
|
|
106112
106170
|
`;
|
|
@@ -107051,24 +107109,209 @@ async function whatsapp({
|
|
|
107051
107109
|
throw new CliUsageError(USAGE20);
|
|
107052
107110
|
}
|
|
107053
107111
|
|
|
107112
|
+
// src/services/wiki-comment-commands.service.ts
|
|
107113
|
+
var WIKI_COMMENT_USAGE = ` laze wiki comments <path> [--open] the page's comment threads, with their ids
|
|
107114
|
+
laze wiki comment <path> --quote <text> <comment|->
|
|
107115
|
+
starts a thread on text the page holds; @Name tells a person or agent who can read it
|
|
107116
|
+
laze wiki comment reply <thread-id> <text|->
|
|
107117
|
+
laze wiki comment resolve <thread-id> [--reopen]
|
|
107118
|
+
laze wiki comment delete <comment-id> your own comment; the first one takes its thread`;
|
|
107119
|
+
function commentText({ context, value }) {
|
|
107120
|
+
return value === "-" ? textArgument({ context, value }) : Promise.resolve(value);
|
|
107121
|
+
}
|
|
107122
|
+
function threadText(thread2) {
|
|
107123
|
+
const open8 = thread2.detached ? "open, its text is no longer on the page" : "open";
|
|
107124
|
+
const state = thread2.resolved ? `resolved by ${thread2.resolved.by.name}` : open8;
|
|
107125
|
+
const lines2 = [`Thread ${thread2.id} (${state})`, ` > ${thread2.quote}`];
|
|
107126
|
+
for (const comment of thread2.comments)
|
|
107127
|
+
lines2.push(
|
|
107128
|
+
` ${comment.author.name}: ${comment.body.replace(/\n/g, "\n ")} [${comment.id}]`
|
|
107129
|
+
);
|
|
107130
|
+
return `${lines2.join("\n")}
|
|
107131
|
+
`;
|
|
107132
|
+
}
|
|
107133
|
+
function postedText(posted) {
|
|
107134
|
+
const told = posted.notTold.length === 0 ? "" : `Not told, as they cannot see the page: ${posted.notTold.join(", ")}
|
|
107135
|
+
`;
|
|
107136
|
+
return `${threadText(posted.thread)}${told}`;
|
|
107137
|
+
}
|
|
107138
|
+
var comments = async ({ context, args, usage: usage2 }) => {
|
|
107139
|
+
const path = args.words[2];
|
|
107140
|
+
if (!path) throw new CliUsageError(usage2);
|
|
107141
|
+
const { client } = await signedIn({ context, args });
|
|
107142
|
+
const query = args.flags.open ? "&open=true" : "";
|
|
107143
|
+
const threads2 = await client.get(
|
|
107144
|
+
`/api/wiki/comments?path=${encodeURIComponent(path)}${query}`
|
|
107145
|
+
);
|
|
107146
|
+
if (args.flags.json) return context.out(`${JSON.stringify(threads2, null, 2)}
|
|
107147
|
+
`);
|
|
107148
|
+
if (threads2.threads.length === 0) return context.out(`No comments on ${path}
|
|
107149
|
+
`);
|
|
107150
|
+
context.out(`${threads2.open} open on ${path}
|
|
107151
|
+
|
|
107152
|
+
${threads2.threads.map(threadText).join("\n")}`);
|
|
107153
|
+
};
|
|
107154
|
+
var startThread = async ({ context, args, usage: usage2 }) => {
|
|
107155
|
+
const path = args.words[2];
|
|
107156
|
+
const quote4 = flagText({ args, name: "quote" });
|
|
107157
|
+
const value = args.words.slice(3).join(" ");
|
|
107158
|
+
if (!path || !quote4 || !value) throw new CliUsageError(usage2);
|
|
107159
|
+
const body = await commentText({ context, value });
|
|
107160
|
+
const { client } = await signedIn({ context, args });
|
|
107161
|
+
const posted = await client.post("/api/wiki/comment", { path, quote: quote4, body });
|
|
107162
|
+
if (args.flags.json) return context.out(`${JSON.stringify(posted, null, 2)}
|
|
107163
|
+
`);
|
|
107164
|
+
context.out(postedText(posted));
|
|
107165
|
+
};
|
|
107166
|
+
var reply2 = async ({ context, args, usage: usage2 }) => {
|
|
107167
|
+
const threadId = args.words[3];
|
|
107168
|
+
const value = args.words.slice(4).join(" ");
|
|
107169
|
+
if (!threadId || !value) throw new CliUsageError(usage2);
|
|
107170
|
+
const body = await commentText({ context, value });
|
|
107171
|
+
const { client } = await signedIn({ context, args });
|
|
107172
|
+
const posted = await client.post("/api/wiki/comment/reply", {
|
|
107173
|
+
threadId,
|
|
107174
|
+
body
|
|
107175
|
+
});
|
|
107176
|
+
if (args.flags.json) return context.out(`${JSON.stringify(posted, null, 2)}
|
|
107177
|
+
`);
|
|
107178
|
+
context.out(postedText(posted));
|
|
107179
|
+
};
|
|
107180
|
+
var resolve27 = async ({ context, args, usage: usage2 }) => {
|
|
107181
|
+
const threadId = args.words[3];
|
|
107182
|
+
if (!threadId) throw new CliUsageError(usage2);
|
|
107183
|
+
const { client } = await signedIn({ context, args });
|
|
107184
|
+
const thread2 = await client.post("/api/wiki/comment/resolve", {
|
|
107185
|
+
threadId,
|
|
107186
|
+
resolved: !args.flags.reopen
|
|
107187
|
+
});
|
|
107188
|
+
if (args.flags.json) return context.out(`${JSON.stringify(thread2, null, 2)}
|
|
107189
|
+
`);
|
|
107190
|
+
context.out(threadText(thread2));
|
|
107191
|
+
};
|
|
107192
|
+
var remove9 = async ({ context, args, usage: usage2 }) => {
|
|
107193
|
+
const commentId = args.words[3];
|
|
107194
|
+
if (!commentId) throw new CliUsageError(usage2);
|
|
107195
|
+
const { client } = await signedIn({ context, args });
|
|
107196
|
+
const left = await client.post("/api/wiki/comment/delete", { commentId });
|
|
107197
|
+
if (args.flags.json) return context.out(`${JSON.stringify(left, null, 2)}
|
|
107198
|
+
`);
|
|
107199
|
+
context.out(`Deleted ${commentId}; ${left.open} open on ${left.path}
|
|
107200
|
+
`);
|
|
107201
|
+
};
|
|
107202
|
+
var ACTIONS2 = { reply: reply2, resolve: resolve27, delete: remove9 };
|
|
107203
|
+
async function wikiComment({
|
|
107204
|
+
context,
|
|
107205
|
+
args,
|
|
107206
|
+
usage: usage2
|
|
107207
|
+
}) {
|
|
107208
|
+
if (args.words[1] === "comments") return comments({ context, args, usage: usage2 });
|
|
107209
|
+
const action = Object.hasOwn(ACTIONS2, args.words[2] ?? "") ? ACTIONS2[args.words[2] ?? ""] : null;
|
|
107210
|
+
if (action && !flagText({ args, name: "quote" })) return action({ context, args, usage: usage2 });
|
|
107211
|
+
return startThread({ context, args, usage: usage2 });
|
|
107212
|
+
}
|
|
107213
|
+
|
|
107214
|
+
// src/services/wiki-file-commands.service.ts
|
|
107215
|
+
import { readFile as readFile38 } from "node:fs/promises";
|
|
107216
|
+
import { basename as basename13, resolve as resolve28 } from "node:path";
|
|
107217
|
+
var WIKI_FILE_USAGE = ` laze wiki attach <path> <file> [--name <name>] [--type <mime>]
|
|
107218
|
+
uploads a file to the page (up to 25 MB) and prints the markdown that embeds it
|
|
107219
|
+
laze wiki files <path> the page's files, with their addresses
|
|
107220
|
+
laze wiki file <file-id> a short-lived link to a file's bytes`;
|
|
107221
|
+
function wikiFileMarkdown(file4) {
|
|
107222
|
+
const label3 = file4.name.replace(/[[\]]/g, "");
|
|
107223
|
+
return `${file4.contentType.startsWith("image/") ? "!" : ""}[${label3}](${file4.url})`;
|
|
107224
|
+
}
|
|
107225
|
+
var attach = async ({ context, args, usage: usage2 }) => {
|
|
107226
|
+
const path = args.words[2];
|
|
107227
|
+
const local2 = args.words[3];
|
|
107228
|
+
if (!path || !local2) throw new CliUsageError(usage2);
|
|
107229
|
+
const file4 = resolve28(context.cwd, local2);
|
|
107230
|
+
const bytes = new Uint8Array(await readFile38(file4));
|
|
107231
|
+
const asked = flagText({ args, name: "name" });
|
|
107232
|
+
const fileName = readableUploadName({ name: basename13(file4), ...asked && { asked } });
|
|
107233
|
+
const contentType = flagText({ args, name: "type", fallback: contentTypeOf(file4) });
|
|
107234
|
+
const { client } = await signedIn({ context, args });
|
|
107235
|
+
const ticket = await client.post("/api/wiki/attach", {
|
|
107236
|
+
path,
|
|
107237
|
+
fileName,
|
|
107238
|
+
contentType,
|
|
107239
|
+
sizeBytes: bytes.byteLength
|
|
107240
|
+
});
|
|
107241
|
+
const parts = await sendParts({ context, ticket: ticket.upload, bytes });
|
|
107242
|
+
const done = await client.post("/api/wiki/attach/done", {
|
|
107243
|
+
path,
|
|
107244
|
+
fileId: ticket.file.id,
|
|
107245
|
+
parts
|
|
107246
|
+
});
|
|
107247
|
+
if (args.flags.json) return context.out(`${JSON.stringify(done, null, 2)}
|
|
107248
|
+
`);
|
|
107249
|
+
context.out(`${wikiFileMarkdown(done)}
|
|
107250
|
+
`);
|
|
107251
|
+
};
|
|
107252
|
+
var files2 = async ({ context, args, usage: usage2 }) => {
|
|
107253
|
+
const path = args.words[2];
|
|
107254
|
+
if (!path) throw new CliUsageError(usage2);
|
|
107255
|
+
const { client } = await signedIn({ context, args });
|
|
107256
|
+
const listed = await client.get(`/api/wiki/files?path=${encodeURIComponent(path)}`);
|
|
107257
|
+
if (args.flags.json) return context.out(`${JSON.stringify(listed, null, 2)}
|
|
107258
|
+
`);
|
|
107259
|
+
if (listed.files.length === 0) return context.out(`No files on ${path}
|
|
107260
|
+
`);
|
|
107261
|
+
for (const one of listed.files)
|
|
107262
|
+
context.out(`${one.id} ${one.name} ${one.contentType} ${one.sizeBytes} ${one.url}
|
|
107263
|
+
`);
|
|
107264
|
+
};
|
|
107265
|
+
var link = async ({ context, args, usage: usage2 }) => {
|
|
107266
|
+
const fileId = args.words[2];
|
|
107267
|
+
if (!fileId) throw new CliUsageError(usage2);
|
|
107268
|
+
const { client } = await signedIn({ context, args });
|
|
107269
|
+
const answer6 = await client.get(
|
|
107270
|
+
`/api/wiki/file-link?fileId=${encodeURIComponent(fileId)}`
|
|
107271
|
+
);
|
|
107272
|
+
if (args.flags.json) return context.out(`${JSON.stringify(answer6, null, 2)}
|
|
107273
|
+
`);
|
|
107274
|
+
context.out(`${answer6.url}
|
|
107275
|
+
`);
|
|
107276
|
+
};
|
|
107277
|
+
var WIKI_FILE_COMMANDS = {
|
|
107278
|
+
attach,
|
|
107279
|
+
files: files2,
|
|
107280
|
+
file: link
|
|
107281
|
+
};
|
|
107282
|
+
|
|
107054
107283
|
// src/services/wiki-commands.service.ts
|
|
107055
107284
|
var USAGE21 = `Usage:
|
|
107056
|
-
laze wiki list
|
|
107285
|
+
laze wiki list [--type <type>] every page, or only those whose header says type: <type>
|
|
107057
107286
|
laze wiki get <path>
|
|
107058
107287
|
laze wiki put <path> <markdown|@file|-> [--title <title>] [--channel <channel>] [--base <version>]
|
|
107059
107288
|
laze wiki search <words>
|
|
107060
107289
|
laze wiki history <path>
|
|
107061
107290
|
laze wiki mv <path> <new-path> pages under <path> move with it
|
|
107062
107291
|
laze wiki rm <path> the page and its history; pages under it stay
|
|
107292
|
+
laze wiki share <path> who sees a page or folder, and what they can do
|
|
107293
|
+
[--visibility restricted|channel|internal|public] [--role view|edit] [--channel <channel>]
|
|
107294
|
+
[--grant <who>[:view|edit]]... [--revoke <who>]... [--reset]
|
|
107295
|
+
<who> is #channel, @group, an email, or a person's or agent's name. --reset takes the
|
|
107296
|
+
folder's sharing again. Agents can only narrow sharing.
|
|
107297
|
+
laze wiki pin <path> --channel <channel> [--role view|edit | --view-only]
|
|
107298
|
+
shows the page or folder as a tab of the conversation; its members get edit, or view
|
|
107299
|
+
laze wiki unpin <path> --channel <channel> the access the pin gave goes with it
|
|
107300
|
+
laze wiki pins --channel <channel> the pages and folders pinned there
|
|
107301
|
+
${WIKI_COMMENT_USAGE}
|
|
107302
|
+
${WIKI_FILE_USAGE}
|
|
107063
107303
|
|
|
107064
107304
|
Paths are lower-case segments such as handbook/onboarding; link pages with [[path]].`;
|
|
107065
107305
|
async function wikiList({ context, args }) {
|
|
107066
107306
|
const { client, profile } = await signedIn({ context, args });
|
|
107067
|
-
const
|
|
107307
|
+
const type = flagText({ args, name: "type" });
|
|
107308
|
+
const listing = await client.get(
|
|
107309
|
+
type ? `/api/wiki/pages?type=${encodeURIComponent(type)}` : "/api/wiki/pages"
|
|
107310
|
+
);
|
|
107068
107311
|
if (args.flags.json) return context.out(`${JSON.stringify(listing, null, 2)}
|
|
107069
107312
|
`);
|
|
107070
107313
|
for (const page of listing.pages) {
|
|
107071
|
-
const text3 =
|
|
107314
|
+
const text3 = [page.path, page.title, ...page.type ? [page.type] : []].join(" ");
|
|
107072
107315
|
context.out(`${withLink({ text: text3, url: page.url, base: profile.url })}
|
|
107073
107316
|
`);
|
|
107074
107317
|
}
|
|
@@ -107088,7 +107331,7 @@ ${page.body}
|
|
|
107088
107331
|
);
|
|
107089
107332
|
if (page.backlinks.length > 0)
|
|
107090
107333
|
context.out(`
|
|
107091
|
-
Linked from: ${page.backlinks.map((
|
|
107334
|
+
Linked from: ${page.backlinks.map((link3) => link3.path).join(", ")}
|
|
107092
107335
|
`);
|
|
107093
107336
|
}
|
|
107094
107337
|
async function wikiPut({ context, args }) {
|
|
@@ -107161,6 +107404,102 @@ async function wikiRemove({ context, args }) {
|
|
|
107161
107404
|
context.out(`Removed ${path}
|
|
107162
107405
|
`);
|
|
107163
107406
|
}
|
|
107407
|
+
var VISIBILITY_WORDS = {
|
|
107408
|
+
restricted: "Restricted: only the people it is shared with",
|
|
107409
|
+
channel: "Members of the channel",
|
|
107410
|
+
internal: "Everyone in the workspace",
|
|
107411
|
+
public: "Anyone with the link"
|
|
107412
|
+
};
|
|
107413
|
+
function sharingLines(sharing) {
|
|
107414
|
+
const general = sharing.visibility === "channel" && sharing.channel ? `Members of #${sharing.channel.name ?? sharing.channel.id}` : VISIBILITY_WORDS[sharing.visibility];
|
|
107415
|
+
const role2 = sharing.visibility === "restricted" ? "" : `, can ${sharing.memberRole}`;
|
|
107416
|
+
const from = sharing.source === "inherited" ? ` (from ${sharing.from})` : "";
|
|
107417
|
+
const lines2 = [sharing.path, `General access: ${general}${role2}${from}`];
|
|
107418
|
+
if (sharing.publicUrl ?? sharing.publicToken)
|
|
107419
|
+
lines2.push(`Public link: ${sharing.publicUrl ?? `/wiki/p/${sharing.publicToken}`}`);
|
|
107420
|
+
for (const grant of sharing.grants)
|
|
107421
|
+
lines2.push(` ${grant.name ?? `${grant.subject.type} ${grant.subject.id}`} can ${grant.role}`);
|
|
107422
|
+
if (sharing.ownBelow > 0) lines2.push(`${sharing.ownBelow} pages under it keep their own sharing`);
|
|
107423
|
+
lines2.push(`You can ${sharing.role}`);
|
|
107424
|
+
return `${lines2.join("\n")}
|
|
107425
|
+
`;
|
|
107426
|
+
}
|
|
107427
|
+
function grantOf(value) {
|
|
107428
|
+
const match = /^(.*):(view|edit)$/.exec(value);
|
|
107429
|
+
return match ? { who: match[1] ?? value, role: match[2] } : { who: value, role: "view" };
|
|
107430
|
+
}
|
|
107431
|
+
async function wikiShare({ context, args }) {
|
|
107432
|
+
const path = args.words[2];
|
|
107433
|
+
if (!path) throw new CliUsageError(USAGE21);
|
|
107434
|
+
const { client } = await signedIn({ context, args });
|
|
107435
|
+
const visibility = flagText({ args, name: "visibility" });
|
|
107436
|
+
const memberRole = flagText({ args, name: "role" });
|
|
107437
|
+
const channel = flagText({ args, name: "channel" });
|
|
107438
|
+
let sharing = null;
|
|
107439
|
+
if (args.flags.reset)
|
|
107440
|
+
sharing = await client.post("/api/wiki/sharing/reset", { path });
|
|
107441
|
+
if (visibility || memberRole || channel) {
|
|
107442
|
+
sharing = await client.post("/api/wiki/sharing", {
|
|
107443
|
+
path,
|
|
107444
|
+
...visibility ? { visibility } : {},
|
|
107445
|
+
...memberRole ? { memberRole } : {},
|
|
107446
|
+
...channel ? { channel } : {}
|
|
107447
|
+
});
|
|
107448
|
+
}
|
|
107449
|
+
for (const value of args.lists.grant ?? [])
|
|
107450
|
+
sharing = await client.post("/api/wiki/sharing/grant", {
|
|
107451
|
+
path,
|
|
107452
|
+
...grantOf(value)
|
|
107453
|
+
});
|
|
107454
|
+
for (const who of args.lists.revoke ?? [])
|
|
107455
|
+
sharing = await client.post("/api/wiki/sharing/revoke", { path, who });
|
|
107456
|
+
sharing ??= await client.get(`/api/wiki/sharing?path=${encodeURIComponent(path)}`);
|
|
107457
|
+
if (args.flags.json) return context.out(`${JSON.stringify(sharing, null, 2)}
|
|
107458
|
+
`);
|
|
107459
|
+
context.out(sharingLines(sharing));
|
|
107460
|
+
}
|
|
107461
|
+
function channelOf3(args) {
|
|
107462
|
+
const channel = flagText({ args, name: "channel" });
|
|
107463
|
+
if (!channel) throw new CliUsageError(USAGE21);
|
|
107464
|
+
return channel;
|
|
107465
|
+
}
|
|
107466
|
+
async function wikiPin({ context, args }) {
|
|
107467
|
+
const path = args.words[2];
|
|
107468
|
+
if (!path) throw new CliUsageError(USAGE21);
|
|
107469
|
+
const channel = channelOf3(args);
|
|
107470
|
+
const role2 = args.flags["view-only"] ? "view" : flagText({ args, name: "role" }) || "edit";
|
|
107471
|
+
const { client } = await signedIn({ context, args });
|
|
107472
|
+
const sharing = await client.post("/api/wiki/pin", { path, channel, role: role2 });
|
|
107473
|
+
if (args.flags.json) return context.out(`${JSON.stringify(sharing, null, 2)}
|
|
107474
|
+
`);
|
|
107475
|
+
context.out(`Pinned ${path} to ${channel}, members can ${role2}
|
|
107476
|
+
`);
|
|
107477
|
+
}
|
|
107478
|
+
async function wikiUnpin({ context, args }) {
|
|
107479
|
+
const path = args.words[2];
|
|
107480
|
+
if (!path) throw new CliUsageError(USAGE21);
|
|
107481
|
+
const channel = channelOf3(args);
|
|
107482
|
+
const { client } = await signedIn({ context, args });
|
|
107483
|
+
const sharing = await client.post("/api/wiki/unpin", { path, channel });
|
|
107484
|
+
if (args.flags.json) return context.out(`${JSON.stringify(sharing, null, 2)}
|
|
107485
|
+
`);
|
|
107486
|
+
context.out(`Unpinned ${path} from ${channel}
|
|
107487
|
+
`);
|
|
107488
|
+
}
|
|
107489
|
+
async function wikiPins({ context, args }) {
|
|
107490
|
+
const channel = channelOf3(args);
|
|
107491
|
+
const { client } = await signedIn({ context, args });
|
|
107492
|
+
const pins2 = await client.get(
|
|
107493
|
+
`/api/wiki/pins?channel=${encodeURIComponent(channel)}`
|
|
107494
|
+
);
|
|
107495
|
+
if (args.flags.json) return context.out(`${JSON.stringify(pins2, null, 2)}
|
|
107496
|
+
`);
|
|
107497
|
+
if (pins2.pins.length === 0) return context.out(`No wiki pages pinned to ${channel}
|
|
107498
|
+
`);
|
|
107499
|
+
for (const pin of pins2.pins)
|
|
107500
|
+
context.out(`${pin.path} ${pin.title}${pin.folder ? " (folder)" : ""} can ${pin.role}
|
|
107501
|
+
`);
|
|
107502
|
+
}
|
|
107164
107503
|
var WIKI_COMMANDS = {
|
|
107165
107504
|
list: wikiList,
|
|
107166
107505
|
get: wikiGet,
|
|
@@ -107168,7 +107507,19 @@ var WIKI_COMMANDS = {
|
|
|
107168
107507
|
search: wikiSearch,
|
|
107169
107508
|
history: wikiHistory,
|
|
107170
107509
|
mv: wikiMove,
|
|
107171
|
-
rm: wikiRemove
|
|
107510
|
+
rm: wikiRemove,
|
|
107511
|
+
share: wikiShare,
|
|
107512
|
+
pin: wikiPin,
|
|
107513
|
+
unpin: wikiUnpin,
|
|
107514
|
+
pins: wikiPins,
|
|
107515
|
+
comments: (input2) => wikiComment({ ...input2, usage: USAGE21 }),
|
|
107516
|
+
comment: (input2) => wikiComment({ ...input2, usage: USAGE21 }),
|
|
107517
|
+
...Object.fromEntries(
|
|
107518
|
+
Object.entries(WIKI_FILE_COMMANDS).map(([name3, run4]) => [
|
|
107519
|
+
name3,
|
|
107520
|
+
(input2) => run4({ ...input2, usage: USAGE21 })
|
|
107521
|
+
])
|
|
107522
|
+
)
|
|
107172
107523
|
};
|
|
107173
107524
|
async function wiki({ context, args }) {
|
|
107174
107525
|
const name3 = args.words[1] ?? "";
|
|
@@ -107188,8 +107539,8 @@ async function roles({ context, args }) {
|
|
|
107188
107539
|
const catalogue = await client.get("/api/roles");
|
|
107189
107540
|
if (args.flags.json) return printJson11(context, catalogue);
|
|
107190
107541
|
for (const role2 of catalogue) {
|
|
107191
|
-
const
|
|
107192
|
-
context.out(`${role2.label} ${
|
|
107542
|
+
const count14 = `${role2.permissions.length} permissions`;
|
|
107543
|
+
context.out(`${role2.label} ${count14} ${role2.description}
|
|
107193
107544
|
`);
|
|
107194
107545
|
context.out(` ${role2.permissions.join(", ")}
|
|
107195
107546
|
`);
|
|
@@ -107387,7 +107738,7 @@ var HELP = `laze: work in a Laze workspace from your terminal or your agent.
|
|
|
107387
107738
|
laze schedule add|update ... --check <script> a script decides each firing, without a model
|
|
107388
107739
|
laze schedule list|update|pause|resume|rm|runs your agent's schedules and their runs
|
|
107389
107740
|
laze memory get|set|append|history <file>, search, pull SOUL.md, AGENTS.md, a channel's MEMORY.md
|
|
107390
|
-
laze wiki list|get|put|search|history|mv|rm
|
|
107741
|
+
laze wiki list|get|put|search|history|mv|rm|share the workspace wiki
|
|
107391
107742
|
laze skill list|install|show|pull|rm|update|pin|unpin your agent's skills and the catalogue
|
|
107392
107743
|
laze app create <name> ... build an app from scratch (--template slides for a deck), push, revert
|
|
107393
107744
|
apps are also called artifacts: asked for an artifact, page, dashboard, deck or mock, build a Laze app
|
|
@@ -107837,15 +108188,15 @@ import {
|
|
|
107837
108188
|
randomBytes as randomBytes6,
|
|
107838
108189
|
sign
|
|
107839
108190
|
} from "node:crypto";
|
|
107840
|
-
import { chmod, link, mkdir as mkdir13, readFile as
|
|
108191
|
+
import { chmod, link as link2, mkdir as mkdir13, readFile as readFile39, rm as rm21, writeFile as writeFile11 } from "node:fs/promises";
|
|
107841
108192
|
import { dirname as dirname27, join as join38 } from "node:path";
|
|
107842
108193
|
var KEYCHAIN_SERVICE = "laze-cli-machine-key";
|
|
107843
|
-
var runProgram = ({ program, args, stdin: stdin2, timeoutMs }) => new Promise((
|
|
108194
|
+
var runProgram = ({ program, args, stdin: stdin2, timeoutMs }) => new Promise((resolve29, reject) => {
|
|
107844
108195
|
const child = execFile2(
|
|
107845
108196
|
program,
|
|
107846
108197
|
[...args],
|
|
107847
108198
|
{ timeout: timeoutMs },
|
|
107848
|
-
(error63, stdout2) => error63 ? reject(error63) :
|
|
108199
|
+
(error63, stdout2) => error63 ? reject(error63) : resolve29(String(stdout2))
|
|
107849
108200
|
);
|
|
107850
108201
|
if (stdin2 !== void 0) child.stdin?.end(stdin2);
|
|
107851
108202
|
});
|
|
@@ -107910,7 +108261,7 @@ var MachineKeyStore = class _MachineKeyStore {
|
|
|
107910
108261
|
async read() {
|
|
107911
108262
|
let meta3;
|
|
107912
108263
|
try {
|
|
107913
|
-
meta3 = machineKeyRegistrationSchema.parse(JSON.parse(await
|
|
108264
|
+
meta3 = machineKeyRegistrationSchema.parse(JSON.parse(await readFile39(this.metaPath, "utf8")));
|
|
107914
108265
|
} catch {
|
|
107915
108266
|
return null;
|
|
107916
108267
|
}
|
|
@@ -107925,7 +108276,7 @@ var MachineKeyStore = class _MachineKeyStore {
|
|
|
107925
108276
|
"-w"
|
|
107926
108277
|
],
|
|
107927
108278
|
timeoutMs: 1e4
|
|
107928
|
-
}) : await
|
|
108279
|
+
}) : await readFile39(this.pemPathOf(meta3.jwk), "utf8");
|
|
107929
108280
|
return keyOf2({ meta: meta3, privateKey: createPrivateKey(pemOf(pem)) });
|
|
107930
108281
|
}
|
|
107931
108282
|
async make() {
|
|
@@ -107999,7 +108350,7 @@ async function writeOnce({ path, text: text3 }) {
|
|
|
107999
108350
|
const temporary = `${path}.${process.pid}.${randomBytes6(6).toString("hex")}.tmp`;
|
|
108000
108351
|
await writePrivate({ path: temporary, text: text3 });
|
|
108001
108352
|
try {
|
|
108002
|
-
await
|
|
108353
|
+
await link2(temporary, path);
|
|
108003
108354
|
return true;
|
|
108004
108355
|
} catch (error63) {
|
|
108005
108356
|
if (error63.code === "EEXIST") return false;
|
|
@@ -108067,7 +108418,7 @@ function machineProofFetch({
|
|
|
108067
108418
|
// src/services/processes.service.ts
|
|
108068
108419
|
import { execFile as execFile3, spawn as spawn4, spawnSync } from "node:child_process";
|
|
108069
108420
|
import { closeSync, mkdirSync, openSync, renameSync, statSync } from "node:fs";
|
|
108070
|
-
import { readFile as
|
|
108421
|
+
import { readFile as readFile40, readlink } from "node:fs/promises";
|
|
108071
108422
|
import { dirname as dirname28 } from "node:path";
|
|
108072
108423
|
import { promisify as promisify2 } from "node:util";
|
|
108073
108424
|
var run3 = promisify2(execFile3);
|
|
@@ -108081,14 +108432,14 @@ function alive(pid) {
|
|
|
108081
108432
|
}
|
|
108082
108433
|
}
|
|
108083
108434
|
async function argsOf2(pid) {
|
|
108084
|
-
const raw = await
|
|
108435
|
+
const raw = await readFile40(`/proc/${pid}/cmdline`, "utf8").catch(() => void 0);
|
|
108085
108436
|
if (raw) return raw.split("\0").filter(Boolean);
|
|
108086
108437
|
const listed = await run3("ps", ["-o", "args=", "-p", String(pid)]).catch(() => void 0);
|
|
108087
108438
|
const line = listed?.stdout.trim();
|
|
108088
108439
|
return line ? line.split(/\s+/) : void 0;
|
|
108089
108440
|
}
|
|
108090
108441
|
async function parentOf(pid) {
|
|
108091
|
-
const stat13 = await
|
|
108442
|
+
const stat13 = await readFile40(`/proc/${pid}/stat`, "utf8").catch(() => void 0);
|
|
108092
108443
|
const fromStat = stat13 ? Number(stat13.slice(stat13.lastIndexOf(")") + 2).split(" ")[1]) : NaN;
|
|
108093
108444
|
if (fromStat > 0) return fromStat;
|
|
108094
108445
|
const listed = await run3("ps", ["-o", "ppid=", "-p", String(pid)]).catch(() => void 0);
|
|
@@ -108096,7 +108447,7 @@ async function parentOf(pid) {
|
|
|
108096
108447
|
return parent > 0 ? parent : void 0;
|
|
108097
108448
|
}
|
|
108098
108449
|
async function startOf(pid) {
|
|
108099
|
-
const stat13 = await
|
|
108450
|
+
const stat13 = await readFile40(`/proc/${pid}/stat`, "utf8").catch(() => void 0);
|
|
108100
108451
|
const ticks = stat13 ? stat13.slice(stat13.lastIndexOf(")") + 2).split(" ")[19] : void 0;
|
|
108101
108452
|
if (ticks) return ticks;
|
|
108102
108453
|
const listed = await run3("ps", ["-o", "lstart=", "-p", String(pid)]).catch(() => void 0);
|
|
@@ -108240,15 +108591,15 @@ function terminalAsk() {
|
|
|
108240
108591
|
};
|
|
108241
108592
|
}
|
|
108242
108593
|
function sleep(ms2, signal) {
|
|
108243
|
-
return new Promise((
|
|
108244
|
-
if (signal?.aborted) return
|
|
108594
|
+
return new Promise((resolve29) => {
|
|
108595
|
+
if (signal?.aborted) return resolve29();
|
|
108245
108596
|
const stop3 = () => {
|
|
108246
108597
|
clearTimeout(timer);
|
|
108247
|
-
|
|
108598
|
+
resolve29();
|
|
108248
108599
|
};
|
|
108249
108600
|
const timer = setTimeout(() => {
|
|
108250
108601
|
signal?.removeEventListener("abort", stop3);
|
|
108251
|
-
|
|
108602
|
+
resolve29();
|
|
108252
108603
|
}, ms2);
|
|
108253
108604
|
signal?.addEventListener("abort", stop3, { once: true });
|
|
108254
108605
|
});
|