@lazehq/cli 0.1.41 → 0.1.43
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 +292 -127
- package/package.json +1 -1
package/dist/laze.mjs
CHANGED
|
@@ -96,9 +96,9 @@ var require_node_gyp_build = __commonJS({
|
|
|
96
96
|
var debug = getFirst(path.join(dir, "build/Debug"), matchBuild);
|
|
97
97
|
if (debug) return debug;
|
|
98
98
|
}
|
|
99
|
-
var prebuild =
|
|
99
|
+
var prebuild = resolve18(dir);
|
|
100
100
|
if (prebuild) return prebuild;
|
|
101
|
-
var nearby =
|
|
101
|
+
var nearby = resolve18(path.dirname(process.execPath));
|
|
102
102
|
if (nearby) return nearby;
|
|
103
103
|
var target = [
|
|
104
104
|
"platform=" + platform,
|
|
@@ -114,7 +114,7 @@ var require_node_gyp_build = __commonJS({
|
|
|
114
114
|
// eslint-disable-line
|
|
115
115
|
].filter(Boolean).join(" ");
|
|
116
116
|
throw new Error("No native build was found for " + target + "\n loaded from: " + dir + "\n");
|
|
117
|
-
function
|
|
117
|
+
function resolve18(dir2) {
|
|
118
118
|
var tuples = readdirSync(path.join(dir2, "prebuilds")).map(parseTuple);
|
|
119
119
|
var tuple2 = tuples.filter(matchTuple(platform, arch)).sort(compareTuples)[0];
|
|
120
120
|
if (!tuple2) return;
|
|
@@ -6561,9 +6561,9 @@ var require_dispatcher_base = __commonJS({
|
|
|
6561
6561
|
}
|
|
6562
6562
|
close(callback) {
|
|
6563
6563
|
if (callback === void 0) {
|
|
6564
|
-
return new Promise((
|
|
6564
|
+
return new Promise((resolve18, reject) => {
|
|
6565
6565
|
this.close((err, data) => {
|
|
6566
|
-
return err ? reject(err) :
|
|
6566
|
+
return err ? reject(err) : resolve18(data);
|
|
6567
6567
|
});
|
|
6568
6568
|
});
|
|
6569
6569
|
}
|
|
@@ -6601,9 +6601,9 @@ var require_dispatcher_base = __commonJS({
|
|
|
6601
6601
|
err = null;
|
|
6602
6602
|
}
|
|
6603
6603
|
if (callback === void 0) {
|
|
6604
|
-
return new Promise((
|
|
6604
|
+
return new Promise((resolve18, reject) => {
|
|
6605
6605
|
this.destroy(err, (err2, data) => {
|
|
6606
|
-
return err2 ? reject(err2) :
|
|
6606
|
+
return err2 ? reject(err2) : resolve18(data);
|
|
6607
6607
|
});
|
|
6608
6608
|
});
|
|
6609
6609
|
}
|
|
@@ -11558,12 +11558,12 @@ upgrade: ${upgrade2}\r
|
|
|
11558
11558
|
cb();
|
|
11559
11559
|
}
|
|
11560
11560
|
}
|
|
11561
|
-
const waitForDrain = () => new Promise((
|
|
11561
|
+
const waitForDrain = () => new Promise((resolve18, reject) => {
|
|
11562
11562
|
assert2(callback === null);
|
|
11563
11563
|
if (socket[kError]) {
|
|
11564
11564
|
reject(socket[kError]);
|
|
11565
11565
|
} else {
|
|
11566
|
-
callback =
|
|
11566
|
+
callback = resolve18;
|
|
11567
11567
|
}
|
|
11568
11568
|
});
|
|
11569
11569
|
socket.on("close", onDrain).on("drain", onDrain);
|
|
@@ -12921,12 +12921,12 @@ var require_client_h2 = __commonJS({
|
|
|
12921
12921
|
cb();
|
|
12922
12922
|
}
|
|
12923
12923
|
}
|
|
12924
|
-
const waitForDrain = () => new Promise((
|
|
12924
|
+
const waitForDrain = () => new Promise((resolve18, reject) => {
|
|
12925
12925
|
assert2(callback === null);
|
|
12926
12926
|
if (socket[kError]) {
|
|
12927
12927
|
reject(socket[kError]);
|
|
12928
12928
|
} else {
|
|
12929
|
-
callback =
|
|
12929
|
+
callback = resolve18;
|
|
12930
12930
|
}
|
|
12931
12931
|
});
|
|
12932
12932
|
h2stream.on("close", onDrain).on("drain", onDrain);
|
|
@@ -13294,16 +13294,16 @@ var require_client = __commonJS({
|
|
|
13294
13294
|
return this[kNeedDrain] < 2;
|
|
13295
13295
|
}
|
|
13296
13296
|
[kClose]() {
|
|
13297
|
-
return new Promise((
|
|
13297
|
+
return new Promise((resolve18) => {
|
|
13298
13298
|
if (this[kSize]) {
|
|
13299
|
-
this[kClosedResolve] =
|
|
13299
|
+
this[kClosedResolve] = resolve18;
|
|
13300
13300
|
} else {
|
|
13301
|
-
|
|
13301
|
+
resolve18(null);
|
|
13302
13302
|
}
|
|
13303
13303
|
});
|
|
13304
13304
|
}
|
|
13305
13305
|
[kDestroy](err) {
|
|
13306
|
-
return new Promise((
|
|
13306
|
+
return new Promise((resolve18) => {
|
|
13307
13307
|
const requests2 = this[kQueue].splice(this[kPendingIdx]);
|
|
13308
13308
|
for (let i = 0; i < requests2.length; i++) {
|
|
13309
13309
|
const request2 = requests2[i];
|
|
@@ -13316,7 +13316,7 @@ var require_client = __commonJS({
|
|
|
13316
13316
|
this[kClosedResolve]();
|
|
13317
13317
|
this[kClosedResolve] = null;
|
|
13318
13318
|
}
|
|
13319
|
-
|
|
13319
|
+
resolve18(null);
|
|
13320
13320
|
};
|
|
13321
13321
|
if (this[kHTTPContext]) {
|
|
13322
13322
|
this[kHTTPContext].destroy(err, callback);
|
|
@@ -13729,8 +13729,8 @@ var require_pool_base = __commonJS({
|
|
|
13729
13729
|
}
|
|
13730
13730
|
return Promise.all(closeAll);
|
|
13731
13731
|
} else {
|
|
13732
|
-
return new Promise((
|
|
13733
|
-
this[kClosedResolve] =
|
|
13732
|
+
return new Promise((resolve18) => {
|
|
13733
|
+
this[kClosedResolve] = resolve18;
|
|
13734
13734
|
});
|
|
13735
13735
|
}
|
|
13736
13736
|
}
|
|
@@ -16241,7 +16241,7 @@ var require_readable = __commonJS({
|
|
|
16241
16241
|
if (this._readableState.closeEmitted) {
|
|
16242
16242
|
return Promise.resolve(null);
|
|
16243
16243
|
}
|
|
16244
|
-
return new Promise((
|
|
16244
|
+
return new Promise((resolve18, reject) => {
|
|
16245
16245
|
if (this[kContentLength] && this[kContentLength] > limit || this[kBytesRead] > limit) {
|
|
16246
16246
|
this.destroy(new AbortError());
|
|
16247
16247
|
}
|
|
@@ -16255,11 +16255,11 @@ var require_readable = __commonJS({
|
|
|
16255
16255
|
if (signal.aborted) {
|
|
16256
16256
|
reject(signal.reason ?? new AbortError());
|
|
16257
16257
|
} else {
|
|
16258
|
-
|
|
16258
|
+
resolve18(null);
|
|
16259
16259
|
}
|
|
16260
16260
|
});
|
|
16261
16261
|
} else {
|
|
16262
|
-
this.on("close",
|
|
16262
|
+
this.on("close", resolve18);
|
|
16263
16263
|
}
|
|
16264
16264
|
this.on("error", noop2).on("data", () => {
|
|
16265
16265
|
if (this[kBytesRead] > limit) {
|
|
@@ -16287,7 +16287,7 @@ var require_readable = __commonJS({
|
|
|
16287
16287
|
}
|
|
16288
16288
|
function consume(stream, type) {
|
|
16289
16289
|
assert2(!stream[kConsume]);
|
|
16290
|
-
return new Promise((
|
|
16290
|
+
return new Promise((resolve18, reject) => {
|
|
16291
16291
|
if (isUnusable(stream)) {
|
|
16292
16292
|
const rState = stream._readableState;
|
|
16293
16293
|
if (rState.destroyed && rState.closeEmitted === false) {
|
|
@@ -16302,7 +16302,7 @@ var require_readable = __commonJS({
|
|
|
16302
16302
|
stream[kConsume] = {
|
|
16303
16303
|
type,
|
|
16304
16304
|
stream,
|
|
16305
|
-
resolve:
|
|
16305
|
+
resolve: resolve18,
|
|
16306
16306
|
reject,
|
|
16307
16307
|
length: 0,
|
|
16308
16308
|
body: []
|
|
@@ -16380,18 +16380,18 @@ var require_readable = __commonJS({
|
|
|
16380
16380
|
return buffer;
|
|
16381
16381
|
}
|
|
16382
16382
|
function consumeEnd(consume2, encoding) {
|
|
16383
|
-
const { type, body, resolve:
|
|
16383
|
+
const { type, body, resolve: resolve18, stream, length } = consume2;
|
|
16384
16384
|
try {
|
|
16385
16385
|
if (type === "text") {
|
|
16386
|
-
|
|
16386
|
+
resolve18(chunksDecode(body, length, encoding));
|
|
16387
16387
|
} else if (type === "json") {
|
|
16388
|
-
|
|
16388
|
+
resolve18(JSON.parse(chunksDecode(body, length, encoding)));
|
|
16389
16389
|
} else if (type === "arrayBuffer") {
|
|
16390
|
-
|
|
16390
|
+
resolve18(chunksConcat(body, length).buffer);
|
|
16391
16391
|
} else if (type === "blob") {
|
|
16392
|
-
|
|
16392
|
+
resolve18(new Blob(body, { type: stream[kContentType] }));
|
|
16393
16393
|
} else if (type === "bytes") {
|
|
16394
|
-
|
|
16394
|
+
resolve18(chunksConcat(body, length));
|
|
16395
16395
|
}
|
|
16396
16396
|
consumeFinish(consume2);
|
|
16397
16397
|
} catch (err) {
|
|
@@ -16610,9 +16610,9 @@ var require_api_request = __commonJS({
|
|
|
16610
16610
|
};
|
|
16611
16611
|
function request2(opts, callback) {
|
|
16612
16612
|
if (callback === void 0) {
|
|
16613
|
-
return new Promise((
|
|
16613
|
+
return new Promise((resolve18, reject) => {
|
|
16614
16614
|
request2.call(this, opts, (err, data) => {
|
|
16615
|
-
return err ? reject(err) :
|
|
16615
|
+
return err ? reject(err) : resolve18(data);
|
|
16616
16616
|
});
|
|
16617
16617
|
});
|
|
16618
16618
|
}
|
|
@@ -16873,9 +16873,9 @@ var require_api_stream = __commonJS({
|
|
|
16873
16873
|
};
|
|
16874
16874
|
function stream(opts, factory, callback) {
|
|
16875
16875
|
if (callback === void 0) {
|
|
16876
|
-
return new Promise((
|
|
16876
|
+
return new Promise((resolve18, reject) => {
|
|
16877
16877
|
stream.call(this, opts, factory, (err, data) => {
|
|
16878
|
-
return err ? reject(err) :
|
|
16878
|
+
return err ? reject(err) : resolve18(data);
|
|
16879
16879
|
});
|
|
16880
16880
|
});
|
|
16881
16881
|
}
|
|
@@ -17175,9 +17175,9 @@ var require_api_upgrade = __commonJS({
|
|
|
17175
17175
|
};
|
|
17176
17176
|
function upgrade2(opts, callback) {
|
|
17177
17177
|
if (callback === void 0) {
|
|
17178
|
-
return new Promise((
|
|
17178
|
+
return new Promise((resolve18, reject) => {
|
|
17179
17179
|
upgrade2.call(this, opts, (err, data) => {
|
|
17180
|
-
return err ? reject(err) :
|
|
17180
|
+
return err ? reject(err) : resolve18(data);
|
|
17181
17181
|
});
|
|
17182
17182
|
});
|
|
17183
17183
|
}
|
|
@@ -17271,9 +17271,9 @@ var require_api_connect = __commonJS({
|
|
|
17271
17271
|
};
|
|
17272
17272
|
function connect6(opts, callback) {
|
|
17273
17273
|
if (callback === void 0) {
|
|
17274
|
-
return new Promise((
|
|
17274
|
+
return new Promise((resolve18, reject) => {
|
|
17275
17275
|
connect6.call(this, opts, (err, data) => {
|
|
17276
|
-
return err ? reject(err) :
|
|
17276
|
+
return err ? reject(err) : resolve18(data);
|
|
17277
17277
|
});
|
|
17278
17278
|
});
|
|
17279
17279
|
}
|
|
@@ -18734,7 +18734,7 @@ var require_snapshot_recorder = __commonJS({
|
|
|
18734
18734
|
"../../node_modules/.pnpm/undici@8.10.0/node_modules/undici/lib/mock/snapshot-recorder.js"(exports, module) {
|
|
18735
18735
|
"use strict";
|
|
18736
18736
|
var { writeFile: writeFile23, readFile: readFile39, mkdir: mkdir22 } = __require("node:fs/promises");
|
|
18737
|
-
var { dirname: dirname23, resolve:
|
|
18737
|
+
var { dirname: dirname23, resolve: resolve18 } = __require("node:path");
|
|
18738
18738
|
var { setTimeout: setTimeout2, clearTimeout: clearTimeout2 } = __require("node:timers");
|
|
18739
18739
|
var { InvalidArgumentError, UndiciError } = require_errors();
|
|
18740
18740
|
var { hashId, isUrlExcludedFactory, normalizeHeaders, createHeaderFilters } = require_snapshot_utils();
|
|
@@ -18950,7 +18950,7 @@ var require_snapshot_recorder = __commonJS({
|
|
|
18950
18950
|
throw new InvalidArgumentError("Snapshot path is required");
|
|
18951
18951
|
}
|
|
18952
18952
|
try {
|
|
18953
|
-
const data = await readFile39(
|
|
18953
|
+
const data = await readFile39(resolve18(path), "utf8");
|
|
18954
18954
|
const parsed = JSON.parse(data);
|
|
18955
18955
|
if (Array.isArray(parsed)) {
|
|
18956
18956
|
this.#snapshots.clear();
|
|
@@ -18979,7 +18979,7 @@ var require_snapshot_recorder = __commonJS({
|
|
|
18979
18979
|
if (!path) {
|
|
18980
18980
|
throw new InvalidArgumentError("Snapshot path is required");
|
|
18981
18981
|
}
|
|
18982
|
-
const resolvedPath =
|
|
18982
|
+
const resolvedPath = resolve18(path);
|
|
18983
18983
|
await mkdir22(dirname23(resolvedPath), { recursive: true });
|
|
18984
18984
|
const data = Array.from(this.#snapshots.entries()).map(([hash2, snapshot]) => ({
|
|
18985
18985
|
hash: hash2,
|
|
@@ -26477,7 +26477,7 @@ var require_fetch = __commonJS({
|
|
|
26477
26477
|
const hasTrailingQuestionMark = url2.search.length === 0 && url2.href[url2.href.length - url2.hash.length - 1] === "?";
|
|
26478
26478
|
return dispatchWithProtocolPreference(body);
|
|
26479
26479
|
function dispatchWithProtocolPreference(body2, allowH2) {
|
|
26480
|
-
return new Promise((
|
|
26480
|
+
return new Promise((resolve18, reject) => agent2.dispatch(
|
|
26481
26481
|
{
|
|
26482
26482
|
path: hasTrailingQuestionMark ? `${path}?` : path,
|
|
26483
26483
|
origin: url2.origin,
|
|
@@ -26560,7 +26560,7 @@ var require_fetch = __commonJS({
|
|
|
26560
26560
|
}
|
|
26561
26561
|
}
|
|
26562
26562
|
const onError = (err) => this.onResponseError(controller, err);
|
|
26563
|
-
|
|
26563
|
+
resolve18({
|
|
26564
26564
|
status: status9,
|
|
26565
26565
|
statusText,
|
|
26566
26566
|
headersList,
|
|
@@ -26593,7 +26593,7 @@ var require_fetch = __commonJS({
|
|
|
26593
26593
|
fetchParams.controller.off("terminated", this.abort);
|
|
26594
26594
|
}
|
|
26595
26595
|
if (request2.mode === "websocket" && allowH2 !== false && error62?.code === "UND_ERR_INFO" && error62?.message === "HTTP/2: Extended CONNECT protocol not supported by server") {
|
|
26596
|
-
|
|
26596
|
+
resolve18(dispatchWithProtocolPreference(body2, false));
|
|
26597
26597
|
return;
|
|
26598
26598
|
}
|
|
26599
26599
|
this.body?.destroy(error62);
|
|
@@ -26607,7 +26607,7 @@ var require_fetch = __commonJS({
|
|
|
26607
26607
|
const rawHeaders = controller?.rawHeaders ?? [];
|
|
26608
26608
|
const headersList = new HeadersList();
|
|
26609
26609
|
appendHeadersListFromResponseHeaders(headersList, headers, rawHeaders);
|
|
26610
|
-
|
|
26610
|
+
resolve18({
|
|
26611
26611
|
status: status9,
|
|
26612
26612
|
statusText: STATUS_CODES[status9],
|
|
26613
26613
|
headersList,
|
|
@@ -31581,7 +31581,7 @@ function runRedacted({
|
|
|
31581
31581
|
signal
|
|
31582
31582
|
}) {
|
|
31583
31583
|
const values = Object.values(env);
|
|
31584
|
-
return new Promise((
|
|
31584
|
+
return new Promise((resolve18, reject) => {
|
|
31585
31585
|
const [file3, ...args] = command;
|
|
31586
31586
|
const child = spawn(file3, args, {
|
|
31587
31587
|
env: { ...baseEnv, ...env },
|
|
@@ -31607,7 +31607,7 @@ function runRedacted({
|
|
|
31607
31607
|
child.on("error", reject);
|
|
31608
31608
|
child.on("close", (code, ended) => {
|
|
31609
31609
|
signal?.removeEventListener("abort", killGroup);
|
|
31610
|
-
void drained.then(() =>
|
|
31610
|
+
void drained.then(() => resolve18(code ?? (ended ? 128 + signalNumber(ended) : 1)));
|
|
31611
31611
|
});
|
|
31612
31612
|
});
|
|
31613
31613
|
}
|
|
@@ -35670,7 +35670,8 @@ var SWITCHES = /* @__PURE__ */ new Set([
|
|
|
35670
35670
|
"clear",
|
|
35671
35671
|
"wait-reply",
|
|
35672
35672
|
"no-publish",
|
|
35673
|
-
"local"
|
|
35673
|
+
"local",
|
|
35674
|
+
"done"
|
|
35674
35675
|
]);
|
|
35675
35676
|
function parseArgs({ argv }) {
|
|
35676
35677
|
const words = [];
|
|
@@ -35708,7 +35709,7 @@ function flagText({
|
|
|
35708
35709
|
}
|
|
35709
35710
|
|
|
35710
35711
|
// src/rules/cli-version.rules.ts
|
|
35711
|
-
var STAMPED = "0.1.
|
|
35712
|
+
var STAMPED = "0.1.43";
|
|
35712
35713
|
function cliVersionOf({ stamped = STAMPED } = {}) {
|
|
35713
35714
|
return stamped.startsWith("__") ? "dev" : stamped;
|
|
35714
35715
|
}
|
|
@@ -40747,7 +40748,7 @@ var recursive = /* @__PURE__ */ new WeakMap();
|
|
|
40747
40748
|
var NONE = 0;
|
|
40748
40749
|
var ASSUMED = 1;
|
|
40749
40750
|
var PROVEN = 2;
|
|
40750
|
-
function isRecursive(inst, stack,
|
|
40751
|
+
function isRecursive(inst, stack, resolve18) {
|
|
40751
40752
|
const cached2 = recursive.get(inst);
|
|
40752
40753
|
if (cached2 !== void 0)
|
|
40753
40754
|
return cached2 ? PROVEN : NONE;
|
|
@@ -40757,7 +40758,7 @@ function isRecursive(inst, stack, resolve17) {
|
|
|
40757
40758
|
let result = NONE;
|
|
40758
40759
|
const check3 = (child) => {
|
|
40759
40760
|
if (result !== PROVEN && child?._zod) {
|
|
40760
|
-
const answer4 = isRecursive(child, stack,
|
|
40761
|
+
const answer4 = isRecursive(child, stack, resolve18);
|
|
40761
40762
|
if (answer4 > result)
|
|
40762
40763
|
result = answer4;
|
|
40763
40764
|
}
|
|
@@ -40768,7 +40769,7 @@ function isRecursive(inst, stack, resolve17) {
|
|
|
40768
40769
|
const desc = Object.getOwnPropertyDescriptor(sh, key);
|
|
40769
40770
|
if (spread && !desc.enumerable)
|
|
40770
40771
|
continue;
|
|
40771
|
-
const child = desc.get ? ASSUMED : desc.value?._zod ? isRecursive(desc.value, stack,
|
|
40772
|
+
const child = desc.get ? ASSUMED : desc.value?._zod ? isRecursive(desc.value, stack, resolve18) : NONE;
|
|
40772
40773
|
if (child > answer4)
|
|
40773
40774
|
answer4 = child;
|
|
40774
40775
|
}
|
|
@@ -40832,7 +40833,7 @@ function isRecursive(inst, stack, resolve17) {
|
|
|
40832
40833
|
break;
|
|
40833
40834
|
// `$ZodLazy` caches its inner on the def, so a resolved edge is followed exactly
|
|
40834
40835
|
case "lazy": {
|
|
40835
|
-
const inner = def._cachedInner ?? (
|
|
40836
|
+
const inner = def._cachedInner ?? (resolve18 ? inst._zod.innerType : void 0);
|
|
40836
40837
|
merge2(inner ? isRecursive(inner, stack, false) : ASSUMED);
|
|
40837
40838
|
break;
|
|
40838
40839
|
}
|
|
@@ -60092,6 +60093,68 @@ var burstSummaryIntentSchemaDefinition = external_exports.object({
|
|
|
60092
60093
|
fromName: external_exports.string(),
|
|
60093
60094
|
since: external_exports.iso.datetime()
|
|
60094
60095
|
});
|
|
60096
|
+
var heldFeedPushSchema = external_exports.object({
|
|
60097
|
+
itemId: external_exports.string().min(1),
|
|
60098
|
+
idempotencyKey: external_exports.string().min(1),
|
|
60099
|
+
collapseId: external_exports.string().optional(),
|
|
60100
|
+
title: external_exports.string(),
|
|
60101
|
+
body: external_exports.string(),
|
|
60102
|
+
path: external_exports.string().min(1)
|
|
60103
|
+
});
|
|
60104
|
+
var heldBurstPushSchema = external_exports.object({
|
|
60105
|
+
fromKey: external_exports.string().min(1),
|
|
60106
|
+
fromName: external_exports.string(),
|
|
60107
|
+
since: external_exports.iso.datetime()
|
|
60108
|
+
});
|
|
60109
|
+
var heldPhonePushShape = {
|
|
60110
|
+
noticeId: external_exports.string().min(1).optional(),
|
|
60111
|
+
channelId: external_exports.string().min(1).optional(),
|
|
60112
|
+
messageId: external_exports.string().min(1).optional(),
|
|
60113
|
+
kind: noticeKindSchema.optional(),
|
|
60114
|
+
silent: external_exports.boolean().optional(),
|
|
60115
|
+
feed: heldFeedPushSchema.optional(),
|
|
60116
|
+
burst: heldBurstPushSchema.optional()
|
|
60117
|
+
};
|
|
60118
|
+
var phonePushHeldPayloadSchemaDefinition = external_exports.object({
|
|
60119
|
+
workspaceId: external_exports.string().min(1),
|
|
60120
|
+
userId: external_exports.string().min(1),
|
|
60121
|
+
...heldPhonePushShape,
|
|
60122
|
+
dueAt: external_exports.iso.datetime(),
|
|
60123
|
+
at: external_exports.iso.datetime()
|
|
60124
|
+
});
|
|
60125
|
+
var phonePushHoldStateSchemaDefinition = external_exports.object({
|
|
60126
|
+
workspaceId: external_exports.string(),
|
|
60127
|
+
userId: external_exports.string(),
|
|
60128
|
+
pending: external_exports.array(
|
|
60129
|
+
external_exports.object({
|
|
60130
|
+
...heldPhonePushShape,
|
|
60131
|
+
/** In epoch milliseconds. */
|
|
60132
|
+
dueAt: external_exports.number()
|
|
60133
|
+
})
|
|
60134
|
+
)
|
|
60135
|
+
});
|
|
60136
|
+
var heldPhonePushIntentSchemaDefinition = external_exports.object({
|
|
60137
|
+
workspaceId: external_exports.string().min(1),
|
|
60138
|
+
userId: external_exports.string().min(1),
|
|
60139
|
+
...heldPhonePushShape
|
|
60140
|
+
});
|
|
60141
|
+
var conversationQuietedPayloadSchemaDefinition = external_exports.object({
|
|
60142
|
+
workspaceId: external_exports.string().min(1),
|
|
60143
|
+
userId: external_exports.string().min(1),
|
|
60144
|
+
channelId: external_exports.string().min(1),
|
|
60145
|
+
changeId: external_exports.string().min(1),
|
|
60146
|
+
levelQuiets: external_exports.array(noticeKindSchema),
|
|
60147
|
+
muteQuiets: external_exports.array(noticeKindSchema),
|
|
60148
|
+
mutedUntil: external_exports.iso.datetime().nullable(),
|
|
60149
|
+
at: external_exports.iso.datetime()
|
|
60150
|
+
});
|
|
60151
|
+
var feedCardSettledPayloadSchemaDefinition = external_exports.object({
|
|
60152
|
+
workspaceId: external_exports.string().min(1),
|
|
60153
|
+
userId: external_exports.string().min(1),
|
|
60154
|
+
itemId: external_exports.string().min(1),
|
|
60155
|
+
changeId: external_exports.string().min(1),
|
|
60156
|
+
at: external_exports.iso.datetime()
|
|
60157
|
+
});
|
|
60095
60158
|
var feedDigestSetPayloadSchemaDefinition = external_exports.object({
|
|
60096
60159
|
workspaceId: external_exports.string().min(1),
|
|
60097
60160
|
userId: external_exports.string().min(1),
|
|
@@ -60128,6 +60191,16 @@ var NotificationDefaultHooksToken = notificationUi.hooks("channel-default");
|
|
|
60128
60191
|
var NotificationPauseDialogSlot = notificationUi.component("pause-dialog");
|
|
60129
60192
|
|
|
60130
60193
|
// ../../modules/chat/contract/src/chat.events.ts
|
|
60194
|
+
var memberNotifySetPayloadSchemaDefinition = external_exports.object({
|
|
60195
|
+
workspaceId: external_exports.string().min(1),
|
|
60196
|
+
channelId: external_exports.string().min(1),
|
|
60197
|
+
userId: external_exports.string().min(1),
|
|
60198
|
+
changeId: external_exports.string().min(1),
|
|
60199
|
+
levelQuiets: external_exports.array(noticeKindSchema),
|
|
60200
|
+
muteQuiets: external_exports.array(noticeKindSchema),
|
|
60201
|
+
mutedUntil: external_exports.iso.datetime().nullable(),
|
|
60202
|
+
at: external_exports.iso.datetime()
|
|
60203
|
+
});
|
|
60131
60204
|
var personErasedPayloadSchemaDefinition = external_exports.object({
|
|
60132
60205
|
workspaceId: external_exports.string().min(1),
|
|
60133
60206
|
channelId: external_exports.string().min(1),
|
|
@@ -68756,8 +68829,10 @@ var openclawConfig = Config.define((c) => ({
|
|
|
68756
68829
|
reconnectMaxSeconds: c.env("OPENCLAW_RECONNECT_MAX_SECONDS", positiveInt5.default(60)),
|
|
68757
68830
|
/** How long one inbox read waits for an agent's next message. */
|
|
68758
68831
|
inboxWaitSeconds: c.env("OPENCLAW_INBOX_WAIT_SECONDS", positiveInt5.max(55).default(25)),
|
|
68759
|
-
/** A run
|
|
68760
|
-
runTimeoutMinutes: c.env("OPENCLAW_RUN_TIMEOUT_MINUTES", positiveInt5.default(30))
|
|
68832
|
+
/** A run that shows no progress for this long is given up and said so in the conversation. */
|
|
68833
|
+
runTimeoutMinutes: c.env("OPENCLAW_RUN_TIMEOUT_MINUTES", positiveInt5.default(30)),
|
|
68834
|
+
/** The hard limit of one run, progress or not; OpenClaw gets it as the run's `timeoutMs`. */
|
|
68835
|
+
runMaxHours: c.env("OPENCLAW_RUN_MAX_HOURS", positiveInt5.default(6))
|
|
68761
68836
|
}));
|
|
68762
68837
|
|
|
68763
68838
|
// ../../modules/openclaw/contract/src/openclaw.events.ts
|
|
@@ -70107,8 +70182,8 @@ var CodexAppServer = class _CodexAppServer {
|
|
|
70107
70182
|
}
|
|
70108
70183
|
async call(method, params) {
|
|
70109
70184
|
const id2 = ++this.#nextId;
|
|
70110
|
-
const reply2 = await new Promise((
|
|
70111
|
-
this.#pending.set(id2,
|
|
70185
|
+
const reply2 = await new Promise((resolve18) => {
|
|
70186
|
+
this.#pending.set(id2, resolve18);
|
|
70112
70187
|
this.write({ id: id2, method, params });
|
|
70113
70188
|
});
|
|
70114
70189
|
if (reply2.error !== void 0) throw new Error(`${method}: ${JSON.stringify(reply2.error)}`);
|
|
@@ -70120,12 +70195,12 @@ var CodexAppServer = class _CodexAppServer {
|
|
|
70120
70195
|
/** Starts one turn; `done` settles when it completes, keeping its last agent message. */
|
|
70121
70196
|
async startTurn({ threadId, text: text2 }) {
|
|
70122
70197
|
const result = { answer: "" };
|
|
70123
|
-
const done = new Promise((
|
|
70198
|
+
const done = new Promise((resolve18) => {
|
|
70124
70199
|
const listen = (message2) => {
|
|
70125
70200
|
absorbTurnEvent({ result, message: message2 });
|
|
70126
70201
|
if (message2.method !== "turn/completed") return;
|
|
70127
70202
|
this.#listeners.delete(listen);
|
|
70128
|
-
|
|
70203
|
+
resolve18(result);
|
|
70129
70204
|
};
|
|
70130
70205
|
this.#listeners.add(listen);
|
|
70131
70206
|
});
|
|
@@ -75804,6 +75879,16 @@ async function profileOf({
|
|
|
75804
75879
|
...me.agent ? { agentId: me.agent.id } : {}
|
|
75805
75880
|
};
|
|
75806
75881
|
}
|
|
75882
|
+
async function signInFolder(input2) {
|
|
75883
|
+
const profile = await profileOf(input2);
|
|
75884
|
+
await input2.context.store.saveProfile({
|
|
75885
|
+
name: input2.name,
|
|
75886
|
+
profile,
|
|
75887
|
+
bindDirectory: input2.folder,
|
|
75888
|
+
onlyThere: true
|
|
75889
|
+
});
|
|
75890
|
+
return profile;
|
|
75891
|
+
}
|
|
75807
75892
|
async function login({ context, args }) {
|
|
75808
75893
|
const url2 = serverUrlOf({ context, args });
|
|
75809
75894
|
const name3 = flagText({ args, name: "profile", fallback: "default" });
|
|
@@ -76202,12 +76287,12 @@ async function browserTabCdp({
|
|
|
76202
76287
|
args,
|
|
76203
76288
|
client
|
|
76204
76289
|
}) {
|
|
76205
|
-
const channel = channelOf({ context, args });
|
|
76206
|
-
if (!channel.channel) return null;
|
|
76207
76290
|
try {
|
|
76291
|
+
const channel = channelOf({ context, args });
|
|
76208
76292
|
return await client.post(BROWSER_TAB_PATHS.cdp, { tab: word({ args, at: 2 }), ...channel });
|
|
76209
76293
|
} catch (error62) {
|
|
76210
|
-
|
|
76294
|
+
const missing = ["browser_tab_not_found", "not_found"];
|
|
76295
|
+
if (error62 instanceof LazeApiError && missing.includes(error62.code)) return null;
|
|
76211
76296
|
throw error62;
|
|
76212
76297
|
}
|
|
76213
76298
|
}
|
|
@@ -76241,7 +76326,7 @@ function tunnel({
|
|
|
76241
76326
|
host: host2,
|
|
76242
76327
|
port
|
|
76243
76328
|
}) {
|
|
76244
|
-
return new Promise((
|
|
76329
|
+
return new Promise((resolve18, reject) => {
|
|
76245
76330
|
const socket = connectTcp(proxy.port, proxy.host);
|
|
76246
76331
|
let answer4 = "";
|
|
76247
76332
|
const auth = proxy.authorization ? `Proxy-Authorization: ${proxy.authorization}\r
|
|
@@ -76258,7 +76343,7 @@ ${auth}\r
|
|
|
76258
76343
|
answer4 += chunk.toString("latin1");
|
|
76259
76344
|
if (!answer4.includes(HEADER_END)) return;
|
|
76260
76345
|
socket.off("data", onData);
|
|
76261
|
-
if (/^HTTP\/1\.[01] 200/.test(answer4)) return
|
|
76346
|
+
if (/^HTTP\/1\.[01] 200/.test(answer4)) return resolve18(socket);
|
|
76262
76347
|
socket.destroy();
|
|
76263
76348
|
reject(new Error(`proxy refused the tunnel: ${answer4.split("\r\n")[0] ?? ""}`));
|
|
76264
76349
|
};
|
|
@@ -76271,8 +76356,8 @@ async function upstreamOf({ target, proxy }) {
|
|
|
76271
76356
|
const raw = proxy ? await tunnel({ proxy, host: target.hostname, port }) : connectTcp(port, target.hostname);
|
|
76272
76357
|
if (!secure) return raw;
|
|
76273
76358
|
const tls = connectTls({ socket: raw, servername: target.hostname });
|
|
76274
|
-
await new Promise((
|
|
76275
|
-
tls.once("secureConnect", () =>
|
|
76359
|
+
await new Promise((resolve18, reject) => {
|
|
76360
|
+
tls.once("secureConnect", () => resolve18());
|
|
76276
76361
|
tls.once("error", reject);
|
|
76277
76362
|
});
|
|
76278
76363
|
return tls;
|
|
@@ -76314,8 +76399,8 @@ async function browserSocket({
|
|
|
76314
76399
|
createConnection: () => upstream,
|
|
76315
76400
|
perMessageDeflate: false
|
|
76316
76401
|
});
|
|
76317
|
-
await new Promise((
|
|
76318
|
-
socket.once("open", () =>
|
|
76402
|
+
await new Promise((resolve18, reject) => {
|
|
76403
|
+
socket.once("open", () => resolve18());
|
|
76319
76404
|
socket.once("error", reject);
|
|
76320
76405
|
});
|
|
76321
76406
|
return socket;
|
|
@@ -76328,20 +76413,45 @@ async function browserCall({
|
|
|
76328
76413
|
}) {
|
|
76329
76414
|
const socket = await browserSocket({ target, proxy });
|
|
76330
76415
|
try {
|
|
76331
|
-
return await new Promise((
|
|
76416
|
+
return await new Promise((resolve18, reject) => {
|
|
76332
76417
|
socket.on("message", (data) => {
|
|
76333
76418
|
const reply2 = JSON.parse(textOf2(data));
|
|
76334
76419
|
if (reply2.id !== 1) return;
|
|
76335
76420
|
if (reply2.error) reject(new Error(`${method}: ${JSON.stringify(reply2.error)}`));
|
|
76336
|
-
else
|
|
76421
|
+
else resolve18(reply2.result ?? {});
|
|
76337
76422
|
});
|
|
76338
|
-
socket.once(
|
|
76423
|
+
socket.once(
|
|
76424
|
+
"close",
|
|
76425
|
+
(_code, reason) => reject(
|
|
76426
|
+
new Error(`${method}: ${reason.toString("utf8") || "the machine closed the socket"}`)
|
|
76427
|
+
)
|
|
76428
|
+
);
|
|
76339
76429
|
socket.send(JSON.stringify({ id: 1, method, params }));
|
|
76340
76430
|
});
|
|
76341
76431
|
} finally {
|
|
76342
76432
|
socket.close();
|
|
76343
76433
|
}
|
|
76344
76434
|
}
|
|
76435
|
+
async function checkCdp({
|
|
76436
|
+
target,
|
|
76437
|
+
env,
|
|
76438
|
+
timeoutMs
|
|
76439
|
+
}) {
|
|
76440
|
+
let timer;
|
|
76441
|
+
const late = new Promise((_, reject) => {
|
|
76442
|
+
timer = setTimeout(() => reject(new Error(`no answer in ${timeoutMs / 1e3} s`)), timeoutMs);
|
|
76443
|
+
});
|
|
76444
|
+
const call = browserCall({
|
|
76445
|
+
target: new URL(target),
|
|
76446
|
+
proxy: proxyOfEnv({ env }),
|
|
76447
|
+
method: "Target.getTargets"
|
|
76448
|
+
});
|
|
76449
|
+
try {
|
|
76450
|
+
await Promise.race([call, late]);
|
|
76451
|
+
} finally {
|
|
76452
|
+
clearTimeout(timer);
|
|
76453
|
+
}
|
|
76454
|
+
}
|
|
76345
76455
|
function describeTarget({ info, port }) {
|
|
76346
76456
|
return {
|
|
76347
76457
|
id: info.targetId,
|
|
@@ -76472,18 +76582,18 @@ function retargetCdpBridge({
|
|
|
76472
76582
|
target,
|
|
76473
76583
|
expiresAt
|
|
76474
76584
|
}) {
|
|
76475
|
-
return new Promise((
|
|
76585
|
+
return new Promise((resolve18) => {
|
|
76476
76586
|
const call = httpRequest(
|
|
76477
76587
|
{ host: "127.0.0.1", port, path: TARGET_PATH, method: "PUT", timeout: 2e3 },
|
|
76478
76588
|
(response) => {
|
|
76479
76589
|
response.resume();
|
|
76480
|
-
|
|
76590
|
+
resolve18(response.statusCode === 204);
|
|
76481
76591
|
}
|
|
76482
76592
|
);
|
|
76483
76593
|
call.setHeader(KEY_HEADER, key);
|
|
76484
76594
|
call.setHeader("content-type", "application/json");
|
|
76485
76595
|
call.once("timeout", () => call.destroy());
|
|
76486
|
-
call.once("error", () =>
|
|
76596
|
+
call.once("error", () => resolve18(false));
|
|
76487
76597
|
call.end(JSON.stringify({ target, expiresAt }));
|
|
76488
76598
|
});
|
|
76489
76599
|
}
|
|
@@ -76532,15 +76642,15 @@ async function startCdpBridge({
|
|
|
76532
76642
|
(socket) => relayPage({ client: socket, targetId, target: url2, proxy })
|
|
76533
76643
|
);
|
|
76534
76644
|
});
|
|
76535
|
-
await new Promise((
|
|
76645
|
+
await new Promise((resolve18) => server.listen(0, "127.0.0.1", resolve18));
|
|
76536
76646
|
const port = server.address().port;
|
|
76537
76647
|
return {
|
|
76538
76648
|
port,
|
|
76539
|
-
close: () => new Promise((
|
|
76649
|
+
close: () => new Promise((resolve18) => {
|
|
76540
76650
|
for (const client of relayed) client.destroy();
|
|
76541
76651
|
pages.close();
|
|
76542
76652
|
server.closeAllConnections();
|
|
76543
|
-
server.close(() =>
|
|
76653
|
+
server.close(() => resolve18());
|
|
76544
76654
|
})
|
|
76545
76655
|
};
|
|
76546
76656
|
}
|
|
@@ -76557,7 +76667,7 @@ function launchCdpBridge({
|
|
|
76557
76667
|
stdio: ["ignore", "pipe", "ignore"],
|
|
76558
76668
|
env: { ...env, LAZE_CDP_TARGET: target, LAZE_CDP_EXPIRES_AT: expiresAt, LAZE_CDP_KEY: key }
|
|
76559
76669
|
});
|
|
76560
|
-
return new Promise((
|
|
76670
|
+
return new Promise((resolve18, reject) => {
|
|
76561
76671
|
let printed = "";
|
|
76562
76672
|
child.once("error", reject);
|
|
76563
76673
|
child.once("exit", (code) => reject(new Error(`the CDP bridge stopped (${code})`)));
|
|
@@ -76568,13 +76678,14 @@ function launchCdpBridge({
|
|
|
76568
76678
|
child.stdout.destroy();
|
|
76569
76679
|
child.removeAllListeners("exit");
|
|
76570
76680
|
child.unref();
|
|
76571
|
-
if (Number.isInteger(port) && port > 0)
|
|
76681
|
+
if (Number.isInteger(port) && port > 0) resolve18(port);
|
|
76572
76682
|
else reject(new Error("the CDP bridge printed no port"));
|
|
76573
76683
|
});
|
|
76574
76684
|
});
|
|
76575
76685
|
}
|
|
76576
76686
|
|
|
76577
76687
|
// src/services/browser-commands.service.ts
|
|
76688
|
+
var CDP_CHECK_MS = 3e4;
|
|
76578
76689
|
var PATHS2 = {
|
|
76579
76690
|
machines: "/api/compute/machines",
|
|
76580
76691
|
setup: "/api/compute/browser/setup",
|
|
@@ -76661,7 +76772,9 @@ The screen link goes to your requester's DM once it is ready. ${next}`
|
|
|
76661
76772
|
}
|
|
76662
76773
|
async function cdp({ context, args }) {
|
|
76663
76774
|
const client = await computeClient({ context, args });
|
|
76664
|
-
const
|
|
76775
|
+
const tab = await browserTabCdp({ context, args, client });
|
|
76776
|
+
if (tab) await answering({ context, access: tab });
|
|
76777
|
+
const access = tab ?? await client.post(PATHS2.cdp, { machine: machineArg({ args }) });
|
|
76665
76778
|
if (access.status === "waking") {
|
|
76666
76779
|
if (args.flags.json) return context.out(`${JSON.stringify(access, null, 2)}
|
|
76667
76780
|
`);
|
|
@@ -76679,6 +76792,17 @@ async function cdp({ context, args }) {
|
|
|
76679
76792
|
context.err(`Valid until ${access.expiresAt}. Use it with chromium.connectOverCDP(url).
|
|
76680
76793
|
`);
|
|
76681
76794
|
}
|
|
76795
|
+
async function answering({
|
|
76796
|
+
context,
|
|
76797
|
+
access
|
|
76798
|
+
}) {
|
|
76799
|
+
const env = context.environment.inherited;
|
|
76800
|
+
await checkCdp({ target: access.url, env, timeoutMs: CDP_CHECK_MS }).catch((cause) => {
|
|
76801
|
+
const why = cause instanceof Error ? cause.message : String(cause);
|
|
76802
|
+
const text2 = `${access.machine}'s browser did not answer over CDP (${why}). Try again in a minute`;
|
|
76803
|
+
throw new LazeApiError(502, "browser_cdp_unreachable", text2);
|
|
76804
|
+
});
|
|
76805
|
+
}
|
|
76682
76806
|
function bridgeStatePath({ context, machine: machine2 }) {
|
|
76683
76807
|
const safe = machine2.replace(/[^a-zA-Z0-9_-]/g, "_");
|
|
76684
76808
|
return join19(dirname17(context.environment.configPath), "bridges", `${safe}.json`);
|
|
@@ -78056,6 +78180,19 @@ var browserTabScreenDefinition = external_exports.discriminatedUnion("status", [
|
|
|
78056
78180
|
external_exports.object({ status: external_exports.literal("starting"), retryAfterSeconds: external_exports.number().int().positive() })
|
|
78057
78181
|
]);
|
|
78058
78182
|
var browserTabScreenSchema = browserTabScreenDefinition;
|
|
78183
|
+
var screenSizeDefinition = external_exports.object({
|
|
78184
|
+
...browserTabRefDefinition.shape,
|
|
78185
|
+
width: external_exports.number().int().positive().max(1e5),
|
|
78186
|
+
height: external_exports.number().int().positive().max(1e5),
|
|
78187
|
+
cause: external_exports.enum(["open", "resize", "input"])
|
|
78188
|
+
});
|
|
78189
|
+
var browserTabScreenSizeInputSchema = screenSizeDefinition;
|
|
78190
|
+
var screenSizeAnswerDefinition = external_exports.object({
|
|
78191
|
+
follows: external_exports.boolean(),
|
|
78192
|
+
width: external_exports.number().int().positive(),
|
|
78193
|
+
height: external_exports.number().int().positive()
|
|
78194
|
+
});
|
|
78195
|
+
var browserTabScreenSizeSchema = screenSizeAnswerDefinition;
|
|
78059
78196
|
var restOpenBrowserTabInputDefinition = openBrowserTabDefinition.omit({ workspaceId: true });
|
|
78060
78197
|
var restBrowserTabListInputDefinition = browserTabListInputDefinition.omit({ workspaceId: true });
|
|
78061
78198
|
var restBrowserTabInputDefinition = browserTabRefDefinition.omit({ workspaceId: true });
|
|
@@ -79303,7 +79440,7 @@ var ownMachineSshConnectDefinition = external_exports.object({
|
|
|
79303
79440
|
var ownMachineSshConnectSchema = ownMachineSshConnectDefinition;
|
|
79304
79441
|
var reconcileDefinition = external_exports.object({ workspaceId: workspaceIdSchema18, machineId: idSchema19 });
|
|
79305
79442
|
var ComputeApi = moduleApi()("compute");
|
|
79306
|
-
var computeCoreTrpc = defineTrpcContract("compute").query("status").withInput(computeWorkspaceInputSchema).withOutput(computeStatusSchema).query("browserTabs").withInput(browserTabListInputSchema).withOutput(browserTabListSchema).query("browserTab").withInput(browserTabInputSchema).withOutput(browserTabSchema).mutation("openBrowserTab").withInput(openBrowserTabInputSchema).withOutput(browserTabSchema).mutation("browserTabScreen").withInput(browserTabInputSchema).withOutput(browserTabScreenSchema).mutation("gotoBrowserTab").withInput(browserTabGotoInputSchema).withOutput(browserTabPageSchema).mutation("doneOnBrowserTab").withInput(browserTabInputSchema).withOutput(browserTabSchema).mutation("shareBrowserTab").withInput(browserTabShareInputSchema).withOutput(browserTabSchema).mutation("closeBrowserTab").withInput(browserTabInputSchema).withOutput(external_exports.object({ closed: external_exports.literal(true) })).query("computer").withInput(computeWorkspaceInputSchema).withOutput(computerStatusSchema).mutation("setComputerSize").withInput(setComputerSizeInputSchema).withOutput(computerSizeAnswerSchema).mutation("requestComputerSize").withInput(setComputerSizeInputSchema).withOutput(computerRequestSchema).mutation("cancelComputerRequest").withInput(computerRequestRefSchema).withOutput(computerRequestSchema).mutation("restartComputer").withInput(restartComputerInputSchema).withOutput(computerRestartAnswerSchema).query("computers").withInput(computeWorkspaceInputSchema).withOutput(computerListSchema).query("dedicatedIp").withInput(computeWorkspaceInputSchema).withOutput(dedicatedIpStatusSchema).mutation("setDedicatedIp").withInput(setDedicatedIpInputSchema).withOutput(dedicatedIpAnswerSchema).mutation("turnOffDedicatedIp").withInput(computeWorkspaceInputSchema).withOutput(dedicatedIpAnswerSchema).mutation("setDedicatedIpDomains").withInput(setDedicatedIpDomainsInputSchema).withOutput(dedicatedIpAnswerSchema).query("dedicatedIps").withInput(computeWorkspaceInputSchema).withOutput(dedicatedIpListSchema).query("dedicatedIpCountries").withInput(computeWorkspaceInputSchema).withOutput(dedicatedIpCountriesSchema).query("dedicatedIpOffer").withInput(dedicatedIpOfferInputSchema).withOutput(dedicatedIpOfferSchema).query("list").withInput(computeWorkspaceInputSchema).withOutput(external_exports.array(machineSchema)).query("get").withInput(machineRefSchema).withOutput(machineSchema).mutation("setupBrowser").withInput(setupBrowserInputSchema).withOutput(machineSchema).mutation("sleep").withInput(machineRefSchema).withOutput(machineSchema).mutation("wake").withInput(machineRefSchema).withOutput(machineSchema).mutation("delete").withInput(machineRefSchema).withOutput(machineSchema).mutation("rename").withInput(renameMachineInputSchema).withOutput(machineSchema).mutation("grant").withInput(machineGrantInputSchema).withOutput(machineSchema).mutation("revokeGrant").withInput(machineGrantInputSchema).withOutput(machineSchema).mutation("setBudget").withInput(setMachineBudgetInputSchema).withOutput(machineSchema).mutation("openScreen").withInput(openScreenInputSchema).withOutput(screenSessionSchema).mutation("finishScreen").withInput(screenRefSchema).withOutput(machineSchema).mutation("connectOwn").withInput(connectOwnMachineInputSchema).withOutput(ownMachineConnectSchema).mutation("newConnectCommand").withInput(machineRefSchema).withOutput(ownMachineConnectSchema).mutation("connectSsh").withInput(connectSshMachineInputSchema).withOutput(ownMachineSshConnectSchema).mutation("trustHostKey").withInput(trustHostKeyInputSchema).withOutput(machineSchema).mutation("checkHealth").withInput(machineRefSchema).withOutput(machineSchema).mutation("hostAgent").withInput(hostAgentInputSchema).withOutput(machineSchema).mutation("unhostAgent").withInput(unhostAgentInputSchema).withOutput(external_exports.object({ agentId: external_exports.string() })).mutation("pairWhatsapp").withInput(machineRefSchema).withOutput(whatsappPairingSchema).query("whatsappPairing").withInput(whatsappPairingRefSchema).withOutput(whatsappPairingSchema).mutation("cancelWhatsappPairing").withInput(whatsappPairingRefSchema).withOutput(whatsappPairingSchema).mutation("unpairWhatsapp").withInput(machineRefSchema).withOutput(machineSchema).build();
|
|
79443
|
+
var computeCoreTrpc = defineTrpcContract("compute").query("status").withInput(computeWorkspaceInputSchema).withOutput(computeStatusSchema).query("browserTabs").withInput(browserTabListInputSchema).withOutput(browserTabListSchema).query("browserTab").withInput(browserTabInputSchema).withOutput(browserTabSchema).mutation("openBrowserTab").withInput(openBrowserTabInputSchema).withOutput(browserTabSchema).mutation("browserTabScreen").withInput(browserTabInputSchema).withOutput(browserTabScreenSchema).mutation("sizeBrowserTabScreen").withInput(browserTabScreenSizeInputSchema).withOutput(browserTabScreenSizeSchema).mutation("gotoBrowserTab").withInput(browserTabGotoInputSchema).withOutput(browserTabPageSchema).mutation("doneOnBrowserTab").withInput(browserTabInputSchema).withOutput(browserTabSchema).mutation("shareBrowserTab").withInput(browserTabShareInputSchema).withOutput(browserTabSchema).mutation("closeBrowserTab").withInput(browserTabInputSchema).withOutput(external_exports.object({ closed: external_exports.literal(true) })).query("computer").withInput(computeWorkspaceInputSchema).withOutput(computerStatusSchema).mutation("setComputerSize").withInput(setComputerSizeInputSchema).withOutput(computerSizeAnswerSchema).mutation("requestComputerSize").withInput(setComputerSizeInputSchema).withOutput(computerRequestSchema).mutation("cancelComputerRequest").withInput(computerRequestRefSchema).withOutput(computerRequestSchema).mutation("restartComputer").withInput(restartComputerInputSchema).withOutput(computerRestartAnswerSchema).query("computers").withInput(computeWorkspaceInputSchema).withOutput(computerListSchema).query("dedicatedIp").withInput(computeWorkspaceInputSchema).withOutput(dedicatedIpStatusSchema).mutation("setDedicatedIp").withInput(setDedicatedIpInputSchema).withOutput(dedicatedIpAnswerSchema).mutation("turnOffDedicatedIp").withInput(computeWorkspaceInputSchema).withOutput(dedicatedIpAnswerSchema).mutation("setDedicatedIpDomains").withInput(setDedicatedIpDomainsInputSchema).withOutput(dedicatedIpAnswerSchema).query("dedicatedIps").withInput(computeWorkspaceInputSchema).withOutput(dedicatedIpListSchema).query("dedicatedIpCountries").withInput(computeWorkspaceInputSchema).withOutput(dedicatedIpCountriesSchema).query("dedicatedIpOffer").withInput(dedicatedIpOfferInputSchema).withOutput(dedicatedIpOfferSchema).query("list").withInput(computeWorkspaceInputSchema).withOutput(external_exports.array(machineSchema)).query("get").withInput(machineRefSchema).withOutput(machineSchema).mutation("setupBrowser").withInput(setupBrowserInputSchema).withOutput(machineSchema).mutation("sleep").withInput(machineRefSchema).withOutput(machineSchema).mutation("wake").withInput(machineRefSchema).withOutput(machineSchema).mutation("delete").withInput(machineRefSchema).withOutput(machineSchema).mutation("rename").withInput(renameMachineInputSchema).withOutput(machineSchema).mutation("grant").withInput(machineGrantInputSchema).withOutput(machineSchema).mutation("revokeGrant").withInput(machineGrantInputSchema).withOutput(machineSchema).mutation("setBudget").withInput(setMachineBudgetInputSchema).withOutput(machineSchema).mutation("openScreen").withInput(openScreenInputSchema).withOutput(screenSessionSchema).mutation("finishScreen").withInput(screenRefSchema).withOutput(machineSchema).mutation("connectOwn").withInput(connectOwnMachineInputSchema).withOutput(ownMachineConnectSchema).mutation("newConnectCommand").withInput(machineRefSchema).withOutput(ownMachineConnectSchema).mutation("connectSsh").withInput(connectSshMachineInputSchema).withOutput(ownMachineSshConnectSchema).mutation("trustHostKey").withInput(trustHostKeyInputSchema).withOutput(machineSchema).mutation("checkHealth").withInput(machineRefSchema).withOutput(machineSchema).mutation("hostAgent").withInput(hostAgentInputSchema).withOutput(machineSchema).mutation("unhostAgent").withInput(unhostAgentInputSchema).withOutput(external_exports.object({ agentId: external_exports.string() })).mutation("pairWhatsapp").withInput(machineRefSchema).withOutput(whatsappPairingSchema).query("whatsappPairing").withInput(whatsappPairingRefSchema).withOutput(whatsappPairingSchema).mutation("cancelWhatsappPairing").withInput(whatsappPairingRefSchema).withOutput(whatsappPairingSchema).mutation("unpairWhatsapp").withInput(machineRefSchema).withOutput(machineSchema).build();
|
|
79307
79444
|
var computeFleetTrpc = defineTrpcContract("compute").query("myComputers").withInput(computeWorkspaceInputSchema).withOutput(myComputersSchema).mutation("createComputer").withInput(createComputerInputSchema).withOutput(computerStatusSchema).mutation("deleteComputer").withInput(deleteComputerInputSchema).withOutput(deleteComputerAnswerSchema).mutation("setComputerCreators").withInput(setComputerCreatorsInputSchema).withOutput(computerStatusSchema).mutation("setAgentComputer").withInput(setAgentComputerInputSchema).withOutput(agentComputerAnswerSchema).build();
|
|
79308
79445
|
var computeTrpc = joinTrpcContracts("compute", computeCoreTrpc, computeFleetTrpc);
|
|
79309
79446
|
var restMachineInputDefinition = external_exports.object({ machine: external_exports.string().min(1).max(64) });
|
|
@@ -81189,7 +81326,9 @@ var feedActionSchemaDefinition = external_exports.object({
|
|
|
81189
81326
|
message: external_exports.string(),
|
|
81190
81327
|
style: external_exports.enum(["primary", "secondary"]).optional(),
|
|
81191
81328
|
/** What the button says once pressed, and the handled line: "Sent". */
|
|
81192
|
-
doneLabel: external_exports.string().optional()
|
|
81329
|
+
doneLabel: external_exports.string().optional(),
|
|
81330
|
+
/** A done action closes the card as it is pressed; the agent still hears which one. */
|
|
81331
|
+
done: external_exports.boolean().optional()
|
|
81193
81332
|
});
|
|
81194
81333
|
var feedActionSchema = feedActionSchemaDefinition;
|
|
81195
81334
|
var feedItemActionSchemaDefinition = external_exports.object({
|
|
@@ -81197,7 +81336,9 @@ var feedItemActionSchemaDefinition = external_exports.object({
|
|
|
81197
81336
|
label: external_exports.string(),
|
|
81198
81337
|
message: external_exports.string(),
|
|
81199
81338
|
style: external_exports.enum(["primary", "secondary"]),
|
|
81200
|
-
doneLabel: external_exports.string().nullable()
|
|
81339
|
+
doneLabel: external_exports.string().nullable(),
|
|
81340
|
+
/** Present only on a done action: pressing it closes the card for everyone who gets it. */
|
|
81341
|
+
done: external_exports.literal(true).optional()
|
|
81201
81342
|
});
|
|
81202
81343
|
var feedItemActionSchema = feedItemActionSchemaDefinition;
|
|
81203
81344
|
var feedLinkSchemaDefinition = external_exports.object({ label: external_exports.string(), url: external_exports.string() });
|
|
@@ -81313,7 +81454,9 @@ var replyFeedItemInputSchemaDefinition = external_exports.object({
|
|
|
81313
81454
|
agent: feedAgentSchema,
|
|
81314
81455
|
body: external_exports.string(),
|
|
81315
81456
|
/** Wakes the item now for everyone who snoozed it. */
|
|
81316
|
-
urgent: external_exports.boolean().default(false)
|
|
81457
|
+
urgent: external_exports.boolean().default(false),
|
|
81458
|
+
/** Closes the item with this reply: it leaves every feed and later replies keep it closed. */
|
|
81459
|
+
done: external_exports.boolean().default(false)
|
|
81317
81460
|
});
|
|
81318
81461
|
var feedEntrySchemaDefinition = external_exports.object({
|
|
81319
81462
|
id: external_exports.string(),
|
|
@@ -81485,10 +81628,16 @@ var actFeedItemInputSchemaDefinition = external_exports.object({
|
|
|
81485
81628
|
draft: external_exports.string().optional()
|
|
81486
81629
|
});
|
|
81487
81630
|
var actFeedItemInputSchema = actFeedItemInputSchemaDefinition;
|
|
81631
|
+
var feedCommentAfterSchemaDefinition = external_exports.discriminatedUnion("kind", [
|
|
81632
|
+
external_exports.object({ kind: external_exports.literal("done") }),
|
|
81633
|
+
external_exports.object({ kind: external_exports.literal("snooze"), until: external_exports.iso.datetime({ offset: true }) })
|
|
81634
|
+
]);
|
|
81488
81635
|
var commentFeedItemInputSchemaDefinition = external_exports.object({
|
|
81489
81636
|
...itemRef.shape,
|
|
81490
81637
|
body: external_exports.string(),
|
|
81491
|
-
draft: external_exports.string().optional()
|
|
81638
|
+
draft: external_exports.string().optional(),
|
|
81639
|
+
/** With an after-step the comment is a note on the card and the agent files no turn. */
|
|
81640
|
+
after: feedCommentAfterSchemaDefinition.nullable().default(null)
|
|
81492
81641
|
});
|
|
81493
81642
|
var commentFeedItemInputSchema = commentFeedItemInputSchemaDefinition;
|
|
81494
81643
|
var snoozeFeedItemInputSchemaDefinition = external_exports.object({
|
|
@@ -81625,6 +81774,7 @@ var feedCommentByKeyInputSchemaDefinition = external_exports.object({
|
|
|
81625
81774
|
itemId: external_exports.string().min(1),
|
|
81626
81775
|
body: external_exports.string(),
|
|
81627
81776
|
draft: external_exports.string().optional(),
|
|
81777
|
+
after: feedCommentAfterSchemaDefinition.nullable().default(null),
|
|
81628
81778
|
/** Post the text as written even when the readability check pushes it back. */
|
|
81629
81779
|
force: external_exports.boolean().default(false)
|
|
81630
81780
|
});
|
|
@@ -81821,12 +81971,19 @@ function pairsOf(args) {
|
|
|
81821
81971
|
});
|
|
81822
81972
|
}
|
|
81823
81973
|
const actions = args.lists.action ?? [];
|
|
81974
|
+
const doneLabels = new Set(args.lists["done-action"] ?? []);
|
|
81975
|
+
const labels = /* @__PURE__ */ new Set();
|
|
81824
81976
|
if (actions.length > 0) {
|
|
81825
81977
|
fields.actions = actions.map((value) => {
|
|
81826
81978
|
const [label3, message2] = pairOf({ value, flag: "action" });
|
|
81827
|
-
|
|
81979
|
+
labels.add(label3);
|
|
81980
|
+
return doneLabels.has(label3) ? { label: label3, message: message2, done: true } : { label: label3, message: message2 };
|
|
81828
81981
|
});
|
|
81829
81982
|
}
|
|
81983
|
+
for (const label3 of doneLabels) {
|
|
81984
|
+
if (!labels.has(label3))
|
|
81985
|
+
throw new Error(`--done-action "${label3}" names no --action of this card`);
|
|
81986
|
+
}
|
|
81830
81987
|
return fields;
|
|
81831
81988
|
}
|
|
81832
81989
|
function feedFlagsOf({ args }) {
|
|
@@ -81927,7 +82084,8 @@ var USAGE10 = `Usage:
|
|
|
81927
82084
|
[--draft <text|@file>] [--draft-header "To: ...\\nRe: ..."]
|
|
81928
82085
|
[--metric <json|@file.json> | --table <csv|@file.csv>]
|
|
81929
82086
|
[--image <path|url>]... [--file <path|url>]... (post only, at most 6)
|
|
81930
|
-
[--link <label>=<url>]... [--action <label>=<message>]... [--
|
|
82087
|
+
[--link <label>=<url>]... [--action <label>=<message>]... [--done-action <label>]...
|
|
82088
|
+
[--to <userId>]...
|
|
81931
82089
|
[--urgent] [--done-label <line>] [--show-at <ISO time>]
|
|
81932
82090
|
[--snooze-for <userId>... --until <ISO time>]
|
|
81933
82091
|
[--group <name> [--label <word>]...] [--loop <key> [--reopen]]
|
|
@@ -81935,7 +82093,7 @@ var USAGE10 = `Usage:
|
|
|
81935
82093
|
laze feed update <id> [the post flags that change] [--title <title>]
|
|
81936
82094
|
[--auto-send-on <YYYY-MM-DD>|none]
|
|
81937
82095
|
[--show-at <ISO time>|none] [--snooze-for <userId>... --until <ISO time>|none] [--reopen]
|
|
81938
|
-
laze feed reply <id> <text> [--urgent] [--force]
|
|
82096
|
+
laze feed reply <id> <text> [--done] [--urgent] [--force]
|
|
81939
82097
|
laze feed read <id>
|
|
81940
82098
|
laze feed inbox
|
|
81941
82099
|
laze feed close <id>|--loop <key> --note <text>
|
|
@@ -82036,7 +82194,8 @@ async function feedReply({ context, args }) {
|
|
|
82036
82194
|
itemId,
|
|
82037
82195
|
body: text2,
|
|
82038
82196
|
urgent: Boolean(args.flags.urgent),
|
|
82039
|
-
...args.flags.force ? { force: true } : {}
|
|
82197
|
+
...args.flags.force ? { force: true } : {},
|
|
82198
|
+
...args.flags.done === true ? { done: true } : {}
|
|
82040
82199
|
});
|
|
82041
82200
|
printItem({ context, args, item: replied });
|
|
82042
82201
|
}
|
|
@@ -84033,6 +84192,7 @@ async function notifications({ context, args }) {
|
|
|
84033
84192
|
}
|
|
84034
84193
|
|
|
84035
84194
|
// src/services/openclaw-commands.service.ts
|
|
84195
|
+
import { resolve as resolve12 } from "node:path";
|
|
84036
84196
|
var OPENCLAW_USAGE = `Usage (a person's key; a gateway belongs to the person who connects it):
|
|
84037
84197
|
laze openclaw list the gateways connected here and their agents
|
|
84038
84198
|
laze openclaw connect <wss url> [--label <label>] (< token | --from-file <file> | --from-vault <connection>)
|
|
@@ -84041,9 +84201,11 @@ var OPENCLAW_USAGE = `Usage (a person's key; a gateway belongs to the person who
|
|
|
84041
84201
|
laze openclaw connect --local [--gateway ws://127.0.0.1:18789] [--label <label>] (< token | --from-vault <connection>)
|
|
84042
84202
|
a gateway on this machine: Laze never dials it; the laze connect service relays it out to
|
|
84043
84203
|
Laze. Run it again to give the kept relay a new key
|
|
84044
|
-
laze openclaw agent <connectionId> <openclawAgentId> on|off make one of its
|
|
84045
|
-
|
|
84046
|
-
|
|
84204
|
+
laze openclaw agent <connectionId> <openclawAgentId> on|off [--login <folder>] make one of its
|
|
84205
|
+
agents a Laze agent; --login also signs its CLI in for its workspace folder on this machine
|
|
84206
|
+
laze openclaw agent-key <connectionId> <openclawAgentId> [--login <folder>] a Laze CLI key for an
|
|
84207
|
+
agent that is on, printed once as the login line to run on its machine, or with --login kept
|
|
84208
|
+
as its profile for that folder here, never printed; its previous key stops working
|
|
84047
84209
|
laze openclaw feed <connectionId> on|off temporary Workboard migration bridge, off by default
|
|
84048
84210
|
laze openclaw disconnect <connectionId> remove it, its Laze agents and its credentials`;
|
|
84049
84211
|
function wordAt4(args, index) {
|
|
@@ -84160,13 +84322,16 @@ var connect3 = async (input2) => {
|
|
|
84160
84322
|
});
|
|
84161
84323
|
answer2({ context, args, connection });
|
|
84162
84324
|
};
|
|
84163
|
-
var agent = async (
|
|
84325
|
+
var agent = async (input2) => {
|
|
84326
|
+
const { context, args, client } = input2;
|
|
84327
|
+
const enabled = switchAt(args, 4);
|
|
84164
84328
|
const connection = await client.post(OPENCLAW_KEY_PATHS.setAgent, {
|
|
84165
84329
|
connectionId: wordAt4(args, 2),
|
|
84166
84330
|
openclawAgentId: wordAt4(args, 3),
|
|
84167
|
-
enabled
|
|
84331
|
+
enabled
|
|
84168
84332
|
});
|
|
84169
84333
|
answer2({ context, args, connection });
|
|
84334
|
+
if (enabled && flagText({ args, name: "login" })) await agentKey(input2);
|
|
84170
84335
|
};
|
|
84171
84336
|
function profileNameOf(agentName) {
|
|
84172
84337
|
return agentName.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "") || "agent";
|
|
@@ -84176,6 +84341,17 @@ var agentKey = async ({ context, args, client, url: url2 }) => {
|
|
|
84176
84341
|
connectionId: wordAt4(args, 2),
|
|
84177
84342
|
openclawAgentId: wordAt4(args, 3)
|
|
84178
84343
|
});
|
|
84344
|
+
const login2 = flagText({ args, name: "login" });
|
|
84345
|
+
if (login2) {
|
|
84346
|
+
const folder = resolve12(context.cwd, login2);
|
|
84347
|
+
const profile = profileNameOf(key.agentName);
|
|
84348
|
+
await signInFolder({ context, url: url2, token: key.token, name: profile, folder });
|
|
84349
|
+
context.out(
|
|
84350
|
+
`Signed ${key.agentName} (${key.agentId}) in with a new key, profile "${profile}", used in ${folder} and below; its previous key stopped working.
|
|
84351
|
+
`
|
|
84352
|
+
);
|
|
84353
|
+
return;
|
|
84354
|
+
}
|
|
84179
84355
|
if (args.flags.json) return context.out(`${JSON.stringify(key)}
|
|
84180
84356
|
`);
|
|
84181
84357
|
context.out(
|
|
@@ -84266,17 +84442,13 @@ var MANAGERS = [
|
|
|
84266
84442
|
];
|
|
84267
84443
|
var NPM_PREFIX = /^(.+)[\\/]lib[\\/]node_modules[\\/]@lazehq[\\/]cli[\\/]/;
|
|
84268
84444
|
var NPX_CACHE2 = /[\\/]_npx[\\/]/;
|
|
84269
|
-
function releaseAgeOverrideOf({
|
|
84270
|
-
manager,
|
|
84271
|
-
nowMs
|
|
84272
|
-
}) {
|
|
84273
|
-
if (manager === "npm")
|
|
84274
|
-
return [`--before=${Temporal3.Instant.fromEpochMilliseconds(nowMs).toString()}`];
|
|
84445
|
+
function releaseAgeOverrideOf({ manager }) {
|
|
84446
|
+
if (manager === "npm") return ["--prefer-online", "--min-release-age=0"];
|
|
84275
84447
|
if (manager === "pnpm") return [`--config.minimum-release-age-exclude=${CLI_PACKAGE}`];
|
|
84276
84448
|
if (manager === "bun") return ["--minimum-release-age=0"];
|
|
84277
84449
|
return [];
|
|
84278
84450
|
}
|
|
84279
|
-
function updatePlanOf({ script
|
|
84451
|
+
function updatePlanOf({ script }) {
|
|
84280
84452
|
if (script === SANDBOX_CLI_PATH) return { kind: "sandbox" };
|
|
84281
84453
|
const found = MANAGERS.find(({ pattern }) => pattern.test(script));
|
|
84282
84454
|
if (!found) return { kind: "unmanaged", script };
|
|
@@ -84287,7 +84459,7 @@ function updatePlanOf({ script, nowMs }) {
|
|
|
84287
84459
|
command: [
|
|
84288
84460
|
...found.command,
|
|
84289
84461
|
...prefix ? ["--prefix", prefix] : [],
|
|
84290
|
-
...releaseAgeOverrideOf({ manager: found.manager
|
|
84462
|
+
...releaseAgeOverrideOf({ manager: found.manager }),
|
|
84291
84463
|
CLI_PACKAGE_LATEST
|
|
84292
84464
|
]
|
|
84293
84465
|
};
|
|
@@ -84361,7 +84533,7 @@ function releaseWarningOf({
|
|
|
84361
84533
|
sandbox
|
|
84362
84534
|
}) {
|
|
84363
84535
|
const skew = releaseSkewOf({ mine: mine4, server });
|
|
84364
|
-
if (!skew) return null;
|
|
84536
|
+
if (!skew || skew === "other_build") return null;
|
|
84365
84537
|
if (sandbox) {
|
|
84366
84538
|
return `laze: this CLI is ${mine4}, but the server ships ${server}. Laze updates the computer's CLI each time the agent connects, so restart the agent if this stays.
|
|
84367
84539
|
`;
|
|
@@ -84370,11 +84542,7 @@ function releaseWarningOf({
|
|
|
84370
84542
|
return `laze: this CLI is ${mine4}, newer than the server's ${server}; a command the server does not have yet fails.
|
|
84371
84543
|
`;
|
|
84372
84544
|
}
|
|
84373
|
-
|
|
84374
|
-
if (skew === "older")
|
|
84375
|
-
return `laze: this CLI is ${mine4}, older than the server's ${server}. ${how}
|
|
84376
|
-
`;
|
|
84377
|
-
return `laze: this CLI is ${mine4}, a different build from the server's ${server}. ${how}
|
|
84545
|
+
return `laze: this CLI is ${mine4}, older than the server's ${server}. Update it with npm i -g ${CLI_PACKAGE_LATEST} (or laze update).
|
|
84378
84546
|
`;
|
|
84379
84547
|
}
|
|
84380
84548
|
function selfUpdateLineOf({
|
|
@@ -84401,7 +84569,7 @@ async function startedUpdate({
|
|
|
84401
84569
|
server
|
|
84402
84570
|
}) {
|
|
84403
84571
|
if (context.environment.inherited.LAZE_AUTO_UPDATE === "0") return null;
|
|
84404
|
-
const plan2 = updatePlanOf({ script: await scriptOf(context)
|
|
84572
|
+
const plan2 = updatePlanOf({ script: await scriptOf(context) });
|
|
84405
84573
|
if (plan2.kind !== "install") return null;
|
|
84406
84574
|
const folder = dirname21(context.environment.configPath);
|
|
84407
84575
|
const stamp = join22(folder, "auto-update.json");
|
|
@@ -84662,7 +84830,7 @@ async function schedule({ context, args }) {
|
|
|
84662
84830
|
|
|
84663
84831
|
// src/services/skill-commands.service.ts
|
|
84664
84832
|
import { readdir as readdir7, readFile as readFile33 } from "node:fs/promises";
|
|
84665
|
-
import { join as join23, relative as relative6, resolve as
|
|
84833
|
+
import { join as join23, relative as relative6, resolve as resolve13 } from "node:path";
|
|
84666
84834
|
var USAGE16 = `Usage:
|
|
84667
84835
|
laze skill list [--agent <agentId>]
|
|
84668
84836
|
laze skill install <catalogue-id> [--as <name>] [--agent <agentId>]
|
|
@@ -84715,7 +84883,7 @@ async function skillInstall({ context, args }) {
|
|
|
84715
84883
|
if (!catalogueId === !from) throw new CliUsageError(USAGE16);
|
|
84716
84884
|
const name3 = flagText({ args, name: "as" });
|
|
84717
84885
|
const agent2 = flagText({ args, name: "agent" });
|
|
84718
|
-
const files2 = from ? await folderFiles({ root:
|
|
84886
|
+
const files2 = from ? await folderFiles({ root: resolve13(context.cwd, from) }) : void 0;
|
|
84719
84887
|
const { client } = await signedIn({ context, args });
|
|
84720
84888
|
const installed = await client.post("/api/skills/install", {
|
|
84721
84889
|
...catalogueId ? { catalogueId } : {},
|
|
@@ -84782,7 +84950,7 @@ async function skillUpdate({ context, args }) {
|
|
|
84782
84950
|
if (!name3 || !newName && description === void 0 && !skillMdFile) {
|
|
84783
84951
|
throw new CliUsageError(USAGE16);
|
|
84784
84952
|
}
|
|
84785
|
-
const skillMd = skillMdFile ? await readFile33(
|
|
84953
|
+
const skillMd = skillMdFile ? await readFile33(resolve13(context.cwd, skillMdFile), "utf8") : void 0;
|
|
84786
84954
|
const { client } = await signedIn({ context, args });
|
|
84787
84955
|
const updated = await client.post("/api/skills/update", {
|
|
84788
84956
|
name: name3,
|
|
@@ -84829,7 +84997,7 @@ async function skill({ context, args }) {
|
|
|
84829
84997
|
|
|
84830
84998
|
// src/services/slack-commands.service.ts
|
|
84831
84999
|
import { readFile as readFile34 } from "node:fs/promises";
|
|
84832
|
-
import { resolve as
|
|
85000
|
+
import { resolve as resolve14 } from "node:path";
|
|
84833
85001
|
var SLACK_USAGE = `Usage (a person's key; Slack stays the source, the bot joins no channel by itself):
|
|
84834
85002
|
laze slack overview connected Slack workspaces, mirrors, your link
|
|
84835
85003
|
laze slack link-prompts Slack workspaces you have not linked yet
|
|
@@ -84876,7 +85044,7 @@ async function secretLines({ context, args }) {
|
|
|
84876
85044
|
throw new CliUsageError("A secret never goes in a flag: pipe it on stdin or use --from-file.");
|
|
84877
85045
|
}
|
|
84878
85046
|
const file3 = flagText({ args, name: "from-file" });
|
|
84879
|
-
const text2 = file3 ? await readFile34(
|
|
85047
|
+
const text2 = file3 ? await readFile34(resolve14(context.cwd, file3), "utf8") : await context.readStdin();
|
|
84880
85048
|
return text2.split("\n").map((line) => line.trim()).filter(Boolean);
|
|
84881
85049
|
}
|
|
84882
85050
|
async function secretsOf({
|
|
@@ -85537,10 +85705,7 @@ async function update2({
|
|
|
85537
85705
|
args,
|
|
85538
85706
|
mine: mine4 = cliVersionOf()
|
|
85539
85707
|
}) {
|
|
85540
|
-
const plan2 = updatePlanOf({
|
|
85541
|
-
script: await realScriptOf({ program: context.program }),
|
|
85542
|
-
nowMs: context.nowMs()
|
|
85543
|
-
});
|
|
85708
|
+
const plan2 = updatePlanOf({ script: await realScriptOf({ program: context.program }) });
|
|
85544
85709
|
if (plan2.kind === "sandbox") {
|
|
85545
85710
|
context.out("This laze comes with your computer and updates with every Laze release.\n");
|
|
85546
85711
|
return 0;
|
|
@@ -85699,7 +85864,7 @@ async function vaultScrub({ context, args }) {
|
|
|
85699
85864
|
|
|
85700
85865
|
// src/services/whatsapp-business-commands.service.ts
|
|
85701
85866
|
import { readFile as readFile36 } from "node:fs/promises";
|
|
85702
|
-
import { resolve as
|
|
85867
|
+
import { resolve as resolve15 } from "node:path";
|
|
85703
85868
|
|
|
85704
85869
|
// ../../modules/whatsapp-business/contract/src/whatsapp-business.prices.ts
|
|
85705
85870
|
var whatsappBusinessCategorySchema = external_exports.enum([
|
|
@@ -86118,7 +86283,7 @@ async function secretsOf2({ context, args }) {
|
|
|
86118
86283
|
const fromConnection = flagText({ args, name: "from-vault" });
|
|
86119
86284
|
if (fromConnection) return { fromConnection };
|
|
86120
86285
|
const file3 = flagText({ args, name: "from-file" });
|
|
86121
|
-
const text2 = file3 ? await readFile36(
|
|
86286
|
+
const text2 = file3 ? await readFile36(resolve15(context.cwd, file3), "utf8") : await context.readStdin();
|
|
86122
86287
|
const lines2 = text2.split("\n").map((line) => line.trim()).filter(Boolean);
|
|
86123
86288
|
if (lines2.length !== 2) {
|
|
86124
86289
|
throw new CliUsageError(
|
|
@@ -86320,7 +86485,7 @@ async function whatsappBusiness({
|
|
|
86320
86485
|
|
|
86321
86486
|
// src/services/whatsapp-pairing-commands.service.ts
|
|
86322
86487
|
import { writeFile as writeFile22 } from "node:fs/promises";
|
|
86323
|
-
import { resolve as
|
|
86488
|
+
import { resolve as resolve16 } from "node:path";
|
|
86324
86489
|
var WHATSAPP_PAIRING_USAGE = [
|
|
86325
86490
|
" laze whatsapp pair <machine> [--qr <file.svg>] link WhatsApp on your machine; scan the code (owner)",
|
|
86326
86491
|
" laze whatsapp pairing <pairing-id> [--qr <file.svg>] where the linking stands, with a fresh code",
|
|
@@ -86339,7 +86504,7 @@ function svgOf(dataUrl) {
|
|
|
86339
86504
|
return decodeURIComponent(body);
|
|
86340
86505
|
}
|
|
86341
86506
|
async function report({ context, args, pairing: pairing2 }) {
|
|
86342
|
-
const qrFile = pairing2.qrSvg ?
|
|
86507
|
+
const qrFile = pairing2.qrSvg ? resolve16(context.cwd, flagText({ args, name: "qr", fallback: "whatsapp-qr.svg" })) : null;
|
|
86343
86508
|
if (qrFile && pairing2.qrSvg) await writeFile22(qrFile, svgOf(pairing2.qrSvg), "utf8");
|
|
86344
86509
|
if (args.flags.json) return context.out(`${JSON.stringify({ ...pairing2, qrFile }, null, 2)}
|
|
86345
86510
|
`);
|
|
@@ -86700,7 +86865,7 @@ async function flags({ context, args }) {
|
|
|
86700
86865
|
|
|
86701
86866
|
// src/services/workspace-commands.service.ts
|
|
86702
86867
|
import { readFile as readFile37 } from "node:fs/promises";
|
|
86703
|
-
import { resolve as
|
|
86868
|
+
import { resolve as resolve17 } from "node:path";
|
|
86704
86869
|
var ROLE_NAMES2 = {
|
|
86705
86870
|
OWNER: "Owner",
|
|
86706
86871
|
ADMIN: "Admin",
|
|
@@ -86882,7 +87047,7 @@ var LOGO_USAGE = "Usage: laze workspace logo set <file.png|jpg|webp> | laze work
|
|
|
86882
87047
|
async function readLogo({ context, file: file3 }) {
|
|
86883
87048
|
let bytes;
|
|
86884
87049
|
try {
|
|
86885
|
-
bytes = new Uint8Array(await readFile37(
|
|
87050
|
+
bytes = new Uint8Array(await readFile37(resolve17(context.cwd, file3)));
|
|
86886
87051
|
} catch {
|
|
86887
87052
|
throw new CliUsageError(`No file to read at ${file3}.`);
|
|
86888
87053
|
}
|
|
@@ -87683,15 +87848,15 @@ function terminalAsk() {
|
|
|
87683
87848
|
};
|
|
87684
87849
|
}
|
|
87685
87850
|
function sleep(ms, signal) {
|
|
87686
|
-
return new Promise((
|
|
87687
|
-
if (signal?.aborted) return
|
|
87851
|
+
return new Promise((resolve18) => {
|
|
87852
|
+
if (signal?.aborted) return resolve18();
|
|
87688
87853
|
const stop3 = () => {
|
|
87689
87854
|
clearTimeout(timer);
|
|
87690
|
-
|
|
87855
|
+
resolve18();
|
|
87691
87856
|
};
|
|
87692
87857
|
const timer = setTimeout(() => {
|
|
87693
87858
|
signal?.removeEventListener("abort", stop3);
|
|
87694
|
-
|
|
87859
|
+
resolve18();
|
|
87695
87860
|
}, ms);
|
|
87696
87861
|
signal?.addEventListener("abort", stop3, { once: true });
|
|
87697
87862
|
});
|
package/package.json
CHANGED