@lazehq/cli 0.1.77 → 0.1.79
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 +2268 -379
- package/package.json +1 -1
package/dist/laze.mjs
CHANGED
|
@@ -3224,7 +3224,7 @@ var require_websocket = __commonJS({
|
|
|
3224
3224
|
var http = __require("http");
|
|
3225
3225
|
var net = __require("net");
|
|
3226
3226
|
var tls = __require("tls");
|
|
3227
|
-
var { randomBytes:
|
|
3227
|
+
var { randomBytes: randomBytes5, createHash: createHash7 } = __require("crypto");
|
|
3228
3228
|
var { Duplex, Readable } = __require("stream");
|
|
3229
3229
|
var { URL: URL3 } = __require("url");
|
|
3230
3230
|
var PerMessageDeflate2 = require_permessage_deflate();
|
|
@@ -3762,7 +3762,7 @@ var require_websocket = __commonJS({
|
|
|
3762
3762
|
}
|
|
3763
3763
|
}
|
|
3764
3764
|
const defaultPort = isSecure ? 443 : 80;
|
|
3765
|
-
const key =
|
|
3765
|
+
const key = randomBytes5(16).toString("base64");
|
|
3766
3766
|
const request2 = isSecure ? https.request : http.request;
|
|
3767
3767
|
const protocolSet = /* @__PURE__ */ new Set();
|
|
3768
3768
|
let perMessageDeflate;
|
|
@@ -3892,7 +3892,7 @@ var require_websocket = __commonJS({
|
|
|
3892
3892
|
abortHandshake(websocket, socket, "Invalid Upgrade header");
|
|
3893
3893
|
return;
|
|
3894
3894
|
}
|
|
3895
|
-
const digest =
|
|
3895
|
+
const digest = createHash7("sha1").update(key + GUID).digest("base64");
|
|
3896
3896
|
if (res.headers["sec-websocket-accept"] !== digest) {
|
|
3897
3897
|
abortHandshake(websocket, socket, "Invalid Sec-WebSocket-Accept header");
|
|
3898
3898
|
return;
|
|
@@ -4005,16 +4005,16 @@ var require_websocket = __commonJS({
|
|
|
4005
4005
|
process.nextTick(cb, err);
|
|
4006
4006
|
}
|
|
4007
4007
|
}
|
|
4008
|
-
function receiverOnConclude(code,
|
|
4008
|
+
function receiverOnConclude(code, reason2) {
|
|
4009
4009
|
const websocket = this[kWebSocket];
|
|
4010
4010
|
websocket._closeFrameReceived = true;
|
|
4011
|
-
websocket._closeMessage =
|
|
4011
|
+
websocket._closeMessage = reason2;
|
|
4012
4012
|
websocket._closeCode = code;
|
|
4013
4013
|
if (websocket._socket[kWebSocket] === void 0) return;
|
|
4014
4014
|
websocket._socket.removeListener("data", socketOnData);
|
|
4015
4015
|
process.nextTick(resume, websocket._socket);
|
|
4016
4016
|
if (code === 1005) websocket.close();
|
|
4017
|
-
else websocket.close(code,
|
|
4017
|
+
else websocket.close(code, reason2);
|
|
4018
4018
|
}
|
|
4019
4019
|
function receiverOnDrain() {
|
|
4020
4020
|
const websocket = this[kWebSocket];
|
|
@@ -4261,7 +4261,7 @@ var require_websocket_server = __commonJS({
|
|
|
4261
4261
|
var EventEmitter = __require("events");
|
|
4262
4262
|
var http = __require("http");
|
|
4263
4263
|
var { Duplex } = __require("stream");
|
|
4264
|
-
var { createHash:
|
|
4264
|
+
var { createHash: createHash7 } = __require("crypto");
|
|
4265
4265
|
var extension2 = require_extension();
|
|
4266
4266
|
var PerMessageDeflate2 = require_permessage_deflate();
|
|
4267
4267
|
var subprotocol2 = require_subprotocol();
|
|
@@ -4568,7 +4568,7 @@ var require_websocket_server = __commonJS({
|
|
|
4568
4568
|
);
|
|
4569
4569
|
}
|
|
4570
4570
|
if (this._state > RUNNING) return abortHandshake(socket, 503);
|
|
4571
|
-
const digest =
|
|
4571
|
+
const digest = createHash7("sha1").update(key + GUID).digest("base64");
|
|
4572
4572
|
const headers = [
|
|
4573
4573
|
"HTTP/1.1 101 Switching Protocols",
|
|
4574
4574
|
"Upgrade: websocket",
|
|
@@ -6722,12 +6722,12 @@ var require_diagnostics = __commonJS({
|
|
|
6722
6722
|
diagnosticsChannel.subscribe(
|
|
6723
6723
|
"undici:websocket:close",
|
|
6724
6724
|
(evt) => {
|
|
6725
|
-
const { websocket, code, reason } = evt;
|
|
6725
|
+
const { websocket, code, reason: reason2 } = evt;
|
|
6726
6726
|
debugLog(
|
|
6727
6727
|
"closed connection to %s - %s %s",
|
|
6728
6728
|
websocket.url,
|
|
6729
6729
|
code,
|
|
6730
|
-
|
|
6730
|
+
reason2
|
|
6731
6731
|
);
|
|
6732
6732
|
}
|
|
6733
6733
|
);
|
|
@@ -6828,11 +6828,11 @@ var require_request = __commonJS({
|
|
|
6828
6828
|
this[kResume]?.();
|
|
6829
6829
|
}
|
|
6830
6830
|
}
|
|
6831
|
-
abort(
|
|
6831
|
+
abort(reason2) {
|
|
6832
6832
|
if (!this.#aborted) {
|
|
6833
6833
|
this.#aborted = true;
|
|
6834
|
-
this.#reason =
|
|
6835
|
-
this.#abort(
|
|
6834
|
+
this.#reason = reason2;
|
|
6835
|
+
this.#abort(reason2);
|
|
6836
6836
|
}
|
|
6837
6837
|
}
|
|
6838
6838
|
get aborted() {
|
|
@@ -12895,8 +12895,8 @@ var require_client_h2 = __commonJS({
|
|
|
12895
12895
|
}
|
|
12896
12896
|
this[kClient][kOnError](err);
|
|
12897
12897
|
}
|
|
12898
|
-
function onHttp2FrameError(type, code,
|
|
12899
|
-
if (
|
|
12898
|
+
function onHttp2FrameError(type, code, id4) {
|
|
12899
|
+
if (id4 === 0) {
|
|
12900
12900
|
if (this[kReceivedGoAway]) {
|
|
12901
12901
|
return;
|
|
12902
12902
|
}
|
|
@@ -15093,7 +15093,7 @@ var require_dispatcher1_wrapper = __commonJS({
|
|
|
15093
15093
|
this.#handler = handler;
|
|
15094
15094
|
}
|
|
15095
15095
|
onRequestStart(controller, context) {
|
|
15096
|
-
this.#handler.onConnect?.((
|
|
15096
|
+
this.#handler.onConnect?.((reason2) => controller.abort(reason2), context);
|
|
15097
15097
|
}
|
|
15098
15098
|
onRequestUpgrade(controller, statusCode, headers, socket) {
|
|
15099
15099
|
const rawHeaders = controller?.rawHeaders ?? toRawHeaders(headers ?? {});
|
|
@@ -16342,8 +16342,8 @@ var require_retry_handler = __commonJS({
|
|
|
16342
16342
|
resume() {
|
|
16343
16343
|
this.target?.resume();
|
|
16344
16344
|
}
|
|
16345
|
-
abort(
|
|
16346
|
-
this.target?.abort(
|
|
16345
|
+
abort(reason2) {
|
|
16346
|
+
this.target?.abort(reason2);
|
|
16347
16347
|
}
|
|
16348
16348
|
get paused() {
|
|
16349
16349
|
return this.target?.paused ?? false;
|
|
@@ -17240,7 +17240,7 @@ var require_api_request = __commonJS({
|
|
|
17240
17240
|
}
|
|
17241
17241
|
assert2(this.callback);
|
|
17242
17242
|
this.controller = controller;
|
|
17243
|
-
this.abort = (
|
|
17243
|
+
this.abort = (reason2) => controller.abort(reason2);
|
|
17244
17244
|
this.context = context;
|
|
17245
17245
|
}
|
|
17246
17246
|
onResponseStart(controller, statusCode, headers, statusText) {
|
|
@@ -17258,7 +17258,7 @@ var require_api_request = __commonJS({
|
|
|
17258
17258
|
const contentLength = parsedHeaders?.["content-length"];
|
|
17259
17259
|
const res = new Readable({
|
|
17260
17260
|
resume: () => controller.resume(),
|
|
17261
|
-
abort: (
|
|
17261
|
+
abort: (reason2) => controller.abort(reason2),
|
|
17262
17262
|
contentType,
|
|
17263
17263
|
contentLength: this.method !== "HEAD" && contentLength ? Number(contentLength) : null,
|
|
17264
17264
|
highWaterMark
|
|
@@ -17520,7 +17520,7 @@ var require_api_stream = __commonJS({
|
|
|
17520
17520
|
}
|
|
17521
17521
|
assert2(this.callback);
|
|
17522
17522
|
this.controller = controller;
|
|
17523
|
-
this.abort = (
|
|
17523
|
+
this.abort = (reason2) => controller.abort(reason2);
|
|
17524
17524
|
this.context = context;
|
|
17525
17525
|
}
|
|
17526
17526
|
onResponseStart(controller, statusCode, headers, _statusMessage) {
|
|
@@ -17753,7 +17753,7 @@ var require_api_pipeline = __commonJS({
|
|
|
17753
17753
|
return;
|
|
17754
17754
|
}
|
|
17755
17755
|
assert2(!res, "pipeline cannot be retried");
|
|
17756
|
-
this.abort = (
|
|
17756
|
+
this.abort = (reason2) => controller.abort(reason2);
|
|
17757
17757
|
this.context = context;
|
|
17758
17758
|
}
|
|
17759
17759
|
onResponseStart(controller, statusCode, headers, _statusMessage) {
|
|
@@ -17870,7 +17870,7 @@ var require_api_upgrade = __commonJS({
|
|
|
17870
17870
|
return;
|
|
17871
17871
|
}
|
|
17872
17872
|
assert2(this.callback);
|
|
17873
|
-
this.abort = (
|
|
17873
|
+
this.abort = (reason2) => controller.abort(reason2);
|
|
17874
17874
|
this.context = context;
|
|
17875
17875
|
}
|
|
17876
17876
|
onResponseStart() {
|
|
@@ -17968,7 +17968,7 @@ var require_api_connect = __commonJS({
|
|
|
17968
17968
|
return;
|
|
17969
17969
|
}
|
|
17970
17970
|
assert2(this.callback);
|
|
17971
|
-
this.abort = (
|
|
17971
|
+
this.abort = (reason2) => controller.abort(reason2);
|
|
17972
17972
|
this.context = context;
|
|
17973
17973
|
}
|
|
17974
17974
|
onResponseStart() {
|
|
@@ -18392,7 +18392,7 @@ var require_mock_utils = __commonJS({
|
|
|
18392
18392
|
resume() {
|
|
18393
18393
|
this.paused = false;
|
|
18394
18394
|
},
|
|
18395
|
-
abort: (
|
|
18395
|
+
abort: (reason2) => {
|
|
18396
18396
|
if (aborted2) {
|
|
18397
18397
|
return;
|
|
18398
18398
|
}
|
|
@@ -18401,7 +18401,7 @@ var require_mock_utils = __commonJS({
|
|
|
18401
18401
|
clearTimeout(timer);
|
|
18402
18402
|
timer = null;
|
|
18403
18403
|
}
|
|
18404
|
-
handler.onResponseError?.(controller,
|
|
18404
|
+
handler.onResponseError?.(controller, reason2);
|
|
18405
18405
|
}
|
|
18406
18406
|
};
|
|
18407
18407
|
let replyOpts = opts;
|
|
@@ -19466,8 +19466,8 @@ var require_snapshot_utils = __commonJS({
|
|
|
19466
19466
|
var require_snapshot_recorder = __commonJS({
|
|
19467
19467
|
"../../node_modules/.pnpm/undici@8.10.0/node_modules/undici/lib/mock/snapshot-recorder.js"(exports, module) {
|
|
19468
19468
|
"use strict";
|
|
19469
|
-
var { writeFile:
|
|
19470
|
-
var { dirname:
|
|
19469
|
+
var { writeFile: writeFile27, readFile: readFile48, mkdir: mkdir26 } = __require("node:fs/promises");
|
|
19470
|
+
var { dirname: dirname28, resolve: resolve24 } = __require("node:path");
|
|
19471
19471
|
var { setTimeout: setTimeout2, clearTimeout: clearTimeout2 } = __require("node:timers");
|
|
19472
19472
|
var { InvalidArgumentError, UndiciError } = require_errors();
|
|
19473
19473
|
var { hashId, isUrlExcludedFactory, normalizeHeaders, createHeaderFilters } = require_snapshot_utils();
|
|
@@ -19683,7 +19683,7 @@ var require_snapshot_recorder = __commonJS({
|
|
|
19683
19683
|
throw new InvalidArgumentError("Snapshot path is required");
|
|
19684
19684
|
}
|
|
19685
19685
|
try {
|
|
19686
|
-
const data = await
|
|
19686
|
+
const data = await readFile48(resolve24(path), "utf8");
|
|
19687
19687
|
const parsed = JSON.parse(data);
|
|
19688
19688
|
if (Array.isArray(parsed)) {
|
|
19689
19689
|
this.#snapshots.clear();
|
|
@@ -19713,12 +19713,12 @@ var require_snapshot_recorder = __commonJS({
|
|
|
19713
19713
|
throw new InvalidArgumentError("Snapshot path is required");
|
|
19714
19714
|
}
|
|
19715
19715
|
const resolvedPath = resolve24(path);
|
|
19716
|
-
await
|
|
19716
|
+
await mkdir26(dirname28(resolvedPath), { recursive: true });
|
|
19717
19717
|
const data = Array.from(this.#snapshots.entries()).map(([hash2, snapshot]) => ({
|
|
19718
19718
|
hash: hash2,
|
|
19719
19719
|
snapshot
|
|
19720
19720
|
}));
|
|
19721
|
-
await
|
|
19721
|
+
await writeFile27(resolvedPath, JSON.stringify(data, null, 2), { flush: true });
|
|
19722
19722
|
}
|
|
19723
19723
|
/**
|
|
19724
19724
|
* Clears all recorded snapshots
|
|
@@ -20013,9 +20013,9 @@ var require_snapshot_agent = __commonJS({
|
|
|
20013
20013
|
},
|
|
20014
20014
|
resume() {
|
|
20015
20015
|
},
|
|
20016
|
-
abort(
|
|
20016
|
+
abort(reason2) {
|
|
20017
20017
|
this.aborted = true;
|
|
20018
|
-
this.reason =
|
|
20018
|
+
this.reason = reason2;
|
|
20019
20019
|
},
|
|
20020
20020
|
aborted: false,
|
|
20021
20021
|
paused: false
|
|
@@ -20582,9 +20582,9 @@ var require_dump = __commonJS({
|
|
|
20582
20582
|
super(handler);
|
|
20583
20583
|
this.#maxSize = maxSize ?? this.#maxSize;
|
|
20584
20584
|
}
|
|
20585
|
-
#abort(
|
|
20585
|
+
#abort(reason2) {
|
|
20586
20586
|
this.aborted = true;
|
|
20587
|
-
this.reason =
|
|
20587
|
+
this.reason = reason2;
|
|
20588
20588
|
}
|
|
20589
20589
|
onRequestStart(controller, context) {
|
|
20590
20590
|
controller.abort = this.#abort.bind(this);
|
|
@@ -23099,9 +23099,9 @@ var require_cache2 = __commonJS({
|
|
|
23099
23099
|
resume() {
|
|
23100
23100
|
this.paused = false;
|
|
23101
23101
|
},
|
|
23102
|
-
abort: (
|
|
23102
|
+
abort: (reason2) => {
|
|
23103
23103
|
aborted2 = true;
|
|
23104
|
-
handler.onResponseError?.(controller,
|
|
23104
|
+
handler.onResponseError?.(controller, reason2 ?? new AbortError());
|
|
23105
23105
|
}
|
|
23106
23106
|
};
|
|
23107
23107
|
try {
|
|
@@ -23145,8 +23145,8 @@ var require_cache2 = __commonJS({
|
|
|
23145
23145
|
get reason() {
|
|
23146
23146
|
return stream.errored;
|
|
23147
23147
|
},
|
|
23148
|
-
abort(
|
|
23149
|
-
stream.destroy(
|
|
23148
|
+
abort(reason2) {
|
|
23149
|
+
stream.destroy(reason2 ?? new AbortError());
|
|
23150
23150
|
}
|
|
23151
23151
|
};
|
|
23152
23152
|
stream.on("error", function(err) {
|
|
@@ -23888,9 +23888,9 @@ var require_deduplication_handler = __commonJS({
|
|
|
23888
23888
|
get reason() {
|
|
23889
23889
|
return state.reason;
|
|
23890
23890
|
},
|
|
23891
|
-
abort: (
|
|
23891
|
+
abort: (reason2) => {
|
|
23892
23892
|
state.aborted = true;
|
|
23893
|
-
state.reason =
|
|
23893
|
+
state.reason = reason2 ?? null;
|
|
23894
23894
|
waitingHandler.done = true;
|
|
23895
23895
|
waitingHandler.pendingTrailers = null;
|
|
23896
23896
|
waitingHandler.bufferedChunks = [];
|
|
@@ -25129,13 +25129,13 @@ var require_response = __commonJS({
|
|
|
25129
25129
|
urlList: init?.urlList ? [...init.urlList] : []
|
|
25130
25130
|
};
|
|
25131
25131
|
}
|
|
25132
|
-
function makeNetworkError(
|
|
25133
|
-
const isError = isErrorLike(
|
|
25132
|
+
function makeNetworkError(reason2) {
|
|
25133
|
+
const isError = isErrorLike(reason2);
|
|
25134
25134
|
return makeResponse({
|
|
25135
25135
|
type: "error",
|
|
25136
25136
|
status: 0,
|
|
25137
|
-
error: isError ?
|
|
25138
|
-
aborted:
|
|
25137
|
+
error: isError ? reason2 : new Error(reason2 ? String(reason2) : reason2),
|
|
25138
|
+
aborted: reason2 && reason2.name === "AbortError"
|
|
25139
25139
|
});
|
|
25140
25140
|
}
|
|
25141
25141
|
function isNetworkError(response) {
|
|
@@ -26317,13 +26317,13 @@ var require_fetch = __commonJS({
|
|
|
26317
26317
|
this.dump = false;
|
|
26318
26318
|
this.state = "ongoing";
|
|
26319
26319
|
}
|
|
26320
|
-
terminate(
|
|
26320
|
+
terminate(reason2) {
|
|
26321
26321
|
if (this.state !== "ongoing") {
|
|
26322
26322
|
return;
|
|
26323
26323
|
}
|
|
26324
26324
|
this.state = "terminated";
|
|
26325
|
-
this.connection?.destroy(
|
|
26326
|
-
this.emit("terminated",
|
|
26325
|
+
this.connection?.destroy(reason2);
|
|
26326
|
+
this.emit("terminated", reason2);
|
|
26327
26327
|
}
|
|
26328
26328
|
// https://fetch.spec.whatwg.org/#fetch-controller-abort
|
|
26329
26329
|
abort(error63) {
|
|
@@ -26612,7 +26612,7 @@ var require_fetch = __commonJS({
|
|
|
26612
26612
|
fetchParams.controller.dump = true;
|
|
26613
26613
|
}
|
|
26614
26614
|
if (request2.integrity) {
|
|
26615
|
-
const processBodyError = (
|
|
26615
|
+
const processBodyError = (reason2) => fetchFinale(fetchParams, makeNetworkError(reason2));
|
|
26616
26616
|
if (request2.responseTainting === "opaque" || response.body == null) {
|
|
26617
26617
|
processBodyError(response.error);
|
|
26618
26618
|
return;
|
|
@@ -27125,9 +27125,9 @@ var require_fetch = __commonJS({
|
|
|
27125
27125
|
const pullAlgorithm = () => {
|
|
27126
27126
|
return fetchParams.controller.resume();
|
|
27127
27127
|
};
|
|
27128
|
-
const cancelAlgorithm = (
|
|
27128
|
+
const cancelAlgorithm = (reason2) => {
|
|
27129
27129
|
if (!isCancelled(fetchParams)) {
|
|
27130
|
-
fetchParams.controller.abort(
|
|
27130
|
+
fetchParams.controller.abort(reason2);
|
|
27131
27131
|
}
|
|
27132
27132
|
};
|
|
27133
27133
|
const stream = new ReadableStream(
|
|
@@ -27185,7 +27185,7 @@ var require_fetch = __commonJS({
|
|
|
27185
27185
|
}
|
|
27186
27186
|
}
|
|
27187
27187
|
};
|
|
27188
|
-
function onAborted(
|
|
27188
|
+
function onAborted(reason2) {
|
|
27189
27189
|
if (isAborted(fetchParams)) {
|
|
27190
27190
|
response.aborted = true;
|
|
27191
27191
|
if (isReadable(stream)) {
|
|
@@ -27196,7 +27196,7 @@ var require_fetch = __commonJS({
|
|
|
27196
27196
|
} else {
|
|
27197
27197
|
if (isReadable(stream)) {
|
|
27198
27198
|
fetchParams.controller.controller.error(new TypeError("terminated", {
|
|
27199
|
-
cause: isErrorLike(
|
|
27199
|
+
cause: isErrorLike(reason2) ? reason2 : void 0
|
|
27200
27200
|
}));
|
|
27201
27201
|
}
|
|
27202
27202
|
}
|
|
@@ -27229,7 +27229,7 @@ var require_fetch = __commonJS({
|
|
|
27229
27229
|
onRequestStart(controller) {
|
|
27230
27230
|
const { connection } = fetchParams.controller;
|
|
27231
27231
|
timingInfo.finalConnectionTimingInfo = clampAndCoarsenConnectionTimingInfo(void 0, timingInfo.postRedirectStartTime, fetchParams.crossOriginIsolatedCapability);
|
|
27232
|
-
const abort = (
|
|
27232
|
+
const abort = (reason2) => controller.abort(reason2);
|
|
27233
27233
|
if (connection.destroyed) {
|
|
27234
27234
|
abort(new DOMException("The operation was aborted.", "AbortError"));
|
|
27235
27235
|
} else {
|
|
@@ -28997,14 +28997,14 @@ var require_util5 = __commonJS({
|
|
|
28997
28997
|
}
|
|
28998
28998
|
return urlRecord;
|
|
28999
28999
|
}
|
|
29000
|
-
function validateCloseCodeAndReason(code,
|
|
29000
|
+
function validateCloseCodeAndReason(code, reason2) {
|
|
29001
29001
|
if (code !== null) {
|
|
29002
29002
|
if (code !== 1e3 && (code < 3e3 || code > 4999)) {
|
|
29003
29003
|
throw new DOMException("invalid code", "InvalidAccessError");
|
|
29004
29004
|
}
|
|
29005
29005
|
}
|
|
29006
|
-
if (
|
|
29007
|
-
const reasonBytesLength = Buffer.byteLength(
|
|
29006
|
+
if (reason2 !== null) {
|
|
29007
|
+
const reasonBytesLength = Buffer.byteLength(reason2);
|
|
29008
29008
|
if (reasonBytesLength > 123) {
|
|
29009
29009
|
throw new DOMException(`Reason must be less than 123 bytes; received ${reasonBytesLength}`, "SyntaxError");
|
|
29010
29010
|
}
|
|
@@ -29249,29 +29249,29 @@ var require_connection = __commonJS({
|
|
|
29249
29249
|
});
|
|
29250
29250
|
return controller;
|
|
29251
29251
|
}
|
|
29252
|
-
function closeWebSocketConnection(object2, code,
|
|
29252
|
+
function closeWebSocketConnection(object2, code, reason2, validate2 = false) {
|
|
29253
29253
|
code ??= null;
|
|
29254
|
-
|
|
29255
|
-
if (validate2) validateCloseCodeAndReason(code,
|
|
29254
|
+
reason2 ??= "";
|
|
29255
|
+
if (validate2) validateCloseCodeAndReason(code, reason2);
|
|
29256
29256
|
if (isClosed(object2.readyState) || isClosing(object2.readyState)) {
|
|
29257
29257
|
} else if (!isEstablished(object2.readyState)) {
|
|
29258
29258
|
failWebsocketConnection(object2);
|
|
29259
29259
|
object2.readyState = states.CLOSING;
|
|
29260
29260
|
} else if (!object2.closeState.has(sentCloseFrameState.SENT) && !object2.closeState.has(sentCloseFrameState.RECEIVED)) {
|
|
29261
29261
|
const frame = new WebsocketFrameSend();
|
|
29262
|
-
if (
|
|
29262
|
+
if (reason2.length !== 0 && code === null) {
|
|
29263
29263
|
code = 1e3;
|
|
29264
29264
|
}
|
|
29265
29265
|
assert2(code === null || Number.isInteger(code));
|
|
29266
|
-
if (code === null &&
|
|
29266
|
+
if (code === null && reason2.length === 0) {
|
|
29267
29267
|
frame.frameData = emptyBuffer;
|
|
29268
|
-
} else if (code !== null &&
|
|
29268
|
+
} else if (code !== null && reason2 === null) {
|
|
29269
29269
|
frame.frameData = Buffer.allocUnsafe(2);
|
|
29270
29270
|
frame.frameData.writeUInt16BE(code, 0);
|
|
29271
|
-
} else if (code !== null &&
|
|
29272
|
-
frame.frameData = Buffer.allocUnsafe(2 + Buffer.byteLength(
|
|
29271
|
+
} else if (code !== null && reason2 !== null) {
|
|
29272
|
+
frame.frameData = Buffer.allocUnsafe(2 + Buffer.byteLength(reason2));
|
|
29273
29273
|
frame.frameData.writeUInt16BE(code, 0);
|
|
29274
|
-
frame.frameData.write(
|
|
29274
|
+
frame.frameData.write(reason2, 2, "utf-8");
|
|
29275
29275
|
} else {
|
|
29276
29276
|
frame.frameData = emptyBuffer;
|
|
29277
29277
|
}
|
|
@@ -29282,9 +29282,9 @@ var require_connection = __commonJS({
|
|
|
29282
29282
|
object2.readyState = states.CLOSING;
|
|
29283
29283
|
}
|
|
29284
29284
|
}
|
|
29285
|
-
function failWebsocketConnection(handler, code,
|
|
29285
|
+
function failWebsocketConnection(handler, code, reason2, cause) {
|
|
29286
29286
|
if (isEstablished(handler.readyState)) {
|
|
29287
|
-
closeWebSocketConnection(handler, code,
|
|
29287
|
+
closeWebSocketConnection(handler, code, reason2, false);
|
|
29288
29288
|
}
|
|
29289
29289
|
handler.controller.abort();
|
|
29290
29290
|
if (isConnecting(handler.readyState)) {
|
|
@@ -29679,16 +29679,16 @@ var require_receiver2 = __commonJS({
|
|
|
29679
29679
|
if (code !== void 0 && !isValidStatusCode(code)) {
|
|
29680
29680
|
return { code: 1002, reason: "Invalid status code", error: true };
|
|
29681
29681
|
}
|
|
29682
|
-
let
|
|
29683
|
-
if (
|
|
29684
|
-
|
|
29682
|
+
let reason2 = data.subarray(2);
|
|
29683
|
+
if (reason2[0] === 239 && reason2[1] === 187 && reason2[2] === 191) {
|
|
29684
|
+
reason2 = reason2.subarray(3);
|
|
29685
29685
|
}
|
|
29686
29686
|
try {
|
|
29687
|
-
|
|
29687
|
+
reason2 = utf8Decode(reason2);
|
|
29688
29688
|
} catch {
|
|
29689
29689
|
return { code: 1007, reason: "Invalid UTF-8", error: true };
|
|
29690
29690
|
}
|
|
29691
|
-
return { code, reason, error: false };
|
|
29691
|
+
return { code, reason: reason2, error: false };
|
|
29692
29692
|
}
|
|
29693
29693
|
/**
|
|
29694
29694
|
* Parses control frames.
|
|
@@ -29703,8 +29703,8 @@ var require_receiver2 = __commonJS({
|
|
|
29703
29703
|
}
|
|
29704
29704
|
this.#info.closeInfo = this.parseCloseBody(body);
|
|
29705
29705
|
if (this.#info.closeInfo.error) {
|
|
29706
|
-
const { code, reason } = this.#info.closeInfo;
|
|
29707
|
-
failWebsocketConnection(this.#handler, code,
|
|
29706
|
+
const { code, reason: reason2 } = this.#info.closeInfo;
|
|
29707
|
+
failWebsocketConnection(this.#handler, code, reason2);
|
|
29708
29708
|
return false;
|
|
29709
29709
|
}
|
|
29710
29710
|
if (!this.#handler.closeState.has(sentCloseFrameState.SENT) && !this.#handler.closeState.has(sentCloseFrameState.RECEIVED)) {
|
|
@@ -29975,18 +29975,18 @@ var require_websocket2 = __commonJS({
|
|
|
29975
29975
|
* @param {number|undefined} code
|
|
29976
29976
|
* @param {string|undefined} reason
|
|
29977
29977
|
*/
|
|
29978
|
-
close(code = void 0,
|
|
29978
|
+
close(code = void 0, reason2 = void 0) {
|
|
29979
29979
|
webidl.brandCheck(this, _WebSocket);
|
|
29980
29980
|
const prefix = "WebSocket.close";
|
|
29981
29981
|
if (code !== void 0) {
|
|
29982
29982
|
code = webidl.converters["unsigned short"](code, prefix, "code", webidl.attributes.Clamp);
|
|
29983
29983
|
}
|
|
29984
|
-
if (
|
|
29985
|
-
|
|
29984
|
+
if (reason2 !== void 0) {
|
|
29985
|
+
reason2 = webidl.converters.USVString(reason2);
|
|
29986
29986
|
}
|
|
29987
29987
|
code ??= null;
|
|
29988
|
-
|
|
29989
|
-
closeWebSocketConnection(this.#handler, code,
|
|
29988
|
+
reason2 ??= "";
|
|
29989
|
+
closeWebSocketConnection(this.#handler, code, reason2, true);
|
|
29990
29990
|
}
|
|
29991
29991
|
/**
|
|
29992
29992
|
* @see https://websockets.spec.whatwg.org/#dom-websocket-send
|
|
@@ -30203,29 +30203,29 @@ var require_websocket2 = __commonJS({
|
|
|
30203
30203
|
#onSocketClose() {
|
|
30204
30204
|
const wasClean = this.#handler.closeState.has(sentCloseFrameState.SENT) && this.#handler.closeState.has(sentCloseFrameState.RECEIVED);
|
|
30205
30205
|
let code = 1005;
|
|
30206
|
-
let
|
|
30206
|
+
let reason2 = "";
|
|
30207
30207
|
const result2 = this.#parser?.closingInfo;
|
|
30208
30208
|
if (result2 && !result2.error) {
|
|
30209
30209
|
code = result2.code ?? 1005;
|
|
30210
|
-
|
|
30210
|
+
reason2 = result2.reason;
|
|
30211
30211
|
}
|
|
30212
30212
|
this.#handler.readyState = states.CLOSED;
|
|
30213
30213
|
if (!this.#handler.closeState.has(sentCloseFrameState.RECEIVED)) {
|
|
30214
30214
|
code = 1006;
|
|
30215
30215
|
fireEvent("error", this, (type, init) => new ErrorEvent(type, init), {
|
|
30216
|
-
error: new TypeError(
|
|
30216
|
+
error: new TypeError(reason2)
|
|
30217
30217
|
});
|
|
30218
30218
|
}
|
|
30219
30219
|
fireEvent("close", this, (type, init) => new CloseEvent(type, init), {
|
|
30220
30220
|
wasClean,
|
|
30221
30221
|
code,
|
|
30222
|
-
reason
|
|
30222
|
+
reason: reason2
|
|
30223
30223
|
});
|
|
30224
30224
|
if (channels3.close.hasSubscribers) {
|
|
30225
30225
|
channels3.close.publish({
|
|
30226
30226
|
websocket: this,
|
|
30227
30227
|
code,
|
|
30228
|
-
reason
|
|
30228
|
+
reason: reason2
|
|
30229
30229
|
});
|
|
30230
30230
|
}
|
|
30231
30231
|
}
|
|
@@ -30370,13 +30370,13 @@ var require_websocketerror = __commonJS({
|
|
|
30370
30370
|
init = webidl.converters.WebSocketCloseInfo(init);
|
|
30371
30371
|
}
|
|
30372
30372
|
let code = init.closeCode ?? null;
|
|
30373
|
-
const
|
|
30374
|
-
validateCloseCodeAndReason(code,
|
|
30375
|
-
if (
|
|
30373
|
+
const reason2 = init.reason ?? "";
|
|
30374
|
+
validateCloseCodeAndReason(code, reason2);
|
|
30375
|
+
if (reason2.length !== 0 && code === null) {
|
|
30376
30376
|
code = 1e3;
|
|
30377
30377
|
}
|
|
30378
30378
|
this.#closeCode = code;
|
|
30379
|
-
this.#reason =
|
|
30379
|
+
this.#reason = reason2;
|
|
30380
30380
|
}
|
|
30381
30381
|
get closeCode() {
|
|
30382
30382
|
return this.#closeCode;
|
|
@@ -30389,10 +30389,10 @@ var require_websocketerror = __commonJS({
|
|
|
30389
30389
|
* @param {number|null} code
|
|
30390
30390
|
* @param {string} reason
|
|
30391
30391
|
*/
|
|
30392
|
-
static createUnvalidatedWebSocketError(message2, code,
|
|
30392
|
+
static createUnvalidatedWebSocketError(message2, code, reason2) {
|
|
30393
30393
|
const error63 = new _WebSocketError(message2, kConstruct);
|
|
30394
30394
|
error63.#closeCode = code;
|
|
30395
|
-
error63.#reason =
|
|
30395
|
+
error63.#reason = reason2;
|
|
30396
30396
|
return error63;
|
|
30397
30397
|
}
|
|
30398
30398
|
};
|
|
@@ -30550,8 +30550,8 @@ var require_websocketstream = __commonJS({
|
|
|
30550
30550
|
closeInfo = webidl.converters.WebSocketCloseInfo(closeInfo);
|
|
30551
30551
|
}
|
|
30552
30552
|
const code = closeInfo.closeCode ?? null;
|
|
30553
|
-
const
|
|
30554
|
-
closeWebSocketConnection(this.#handler, code,
|
|
30553
|
+
const reason2 = closeInfo.reason;
|
|
30554
|
+
closeWebSocketConnection(this.#handler, code, reason2, true);
|
|
30555
30555
|
}
|
|
30556
30556
|
#write(chunk) {
|
|
30557
30557
|
chunk = webidl.converters.WebSocketStreamWrite(chunk);
|
|
@@ -30599,12 +30599,12 @@ var require_websocketstream = __commonJS({
|
|
|
30599
30599
|
start: (controller) => {
|
|
30600
30600
|
this.#readableStreamController = controller;
|
|
30601
30601
|
},
|
|
30602
|
-
cancel: (
|
|
30602
|
+
cancel: (reason2) => this.#cancel(reason2)
|
|
30603
30603
|
});
|
|
30604
30604
|
const writable = new WritableStream({
|
|
30605
30605
|
write: (chunk) => this.#write(chunk),
|
|
30606
30606
|
close: () => closeWebSocketConnection(this.#handler, null, null),
|
|
30607
|
-
abort: (
|
|
30607
|
+
abort: (reason2) => this.#closeUsingReason(reason2)
|
|
30608
30608
|
});
|
|
30609
30609
|
this.#readableStream = readable;
|
|
30610
30610
|
this.#writableStream = writable;
|
|
@@ -30648,7 +30648,7 @@ var require_websocketstream = __commonJS({
|
|
|
30648
30648
|
if (!this.#handler.closeState.has(sentCloseFrameState.SENT) && !this.#handler.closeState.has(sentCloseFrameState.RECEIVED)) {
|
|
30649
30649
|
code = 1006;
|
|
30650
30650
|
}
|
|
30651
|
-
const
|
|
30651
|
+
const reason2 = result2?.reason == null ? "" : utf8DecodeBytes(Buffer.from(result2.reason));
|
|
30652
30652
|
if (wasClean) {
|
|
30653
30653
|
readableStreamClose(this.#readableStreamController);
|
|
30654
30654
|
if (!this.#writableStream.locked) {
|
|
@@ -30656,27 +30656,27 @@ var require_websocketstream = __commonJS({
|
|
|
30656
30656
|
}
|
|
30657
30657
|
this.#closedPromise.resolve({
|
|
30658
30658
|
closeCode: code,
|
|
30659
|
-
reason
|
|
30659
|
+
reason: reason2
|
|
30660
30660
|
});
|
|
30661
30661
|
} else {
|
|
30662
|
-
const error63 = createUnvalidatedWebSocketError("unclean close", code,
|
|
30662
|
+
const error63 = createUnvalidatedWebSocketError("unclean close", code, reason2);
|
|
30663
30663
|
this.#readableStreamController?.error(error63);
|
|
30664
30664
|
this.#writableStream?.abort(error63);
|
|
30665
30665
|
this.#closedPromise.reject(error63);
|
|
30666
30666
|
}
|
|
30667
30667
|
}
|
|
30668
|
-
#closeUsingReason(
|
|
30668
|
+
#closeUsingReason(reason2) {
|
|
30669
30669
|
let code = null;
|
|
30670
30670
|
let reasonString = "";
|
|
30671
|
-
if (webidl.is.WebSocketError(
|
|
30672
|
-
code =
|
|
30673
|
-
reasonString =
|
|
30671
|
+
if (webidl.is.WebSocketError(reason2)) {
|
|
30672
|
+
code = reason2.closeCode;
|
|
30673
|
+
reasonString = reason2.reason;
|
|
30674
30674
|
}
|
|
30675
30675
|
closeWebSocketConnection(this.#handler, code, reasonString);
|
|
30676
30676
|
}
|
|
30677
30677
|
// To cancel a WebSocketStream stream given reason , close using reason giving stream and reason .
|
|
30678
|
-
#cancel(
|
|
30679
|
-
this.#closeUsingReason(
|
|
30678
|
+
#cancel(reason2) {
|
|
30679
|
+
this.#closeUsingReason(reason2);
|
|
30680
30680
|
}
|
|
30681
30681
|
};
|
|
30682
30682
|
Object.defineProperties(WebSocketStream.prototype, {
|
|
@@ -34675,8 +34675,8 @@ function queryTimeZone(rawTimeZoneId) {
|
|
|
34675
34675
|
}
|
|
34676
34676
|
var queryTimeZoneRecord = /* @__PURE__ */ memoize((normTimeZoneId, record4) => "named" === record4.kind ? new IntlTimeZone(normTimeZoneId, record4.m, record4.format) : new FixedTimeZone(normTimeZoneId, record4.m, "fixed" === record4.kind ? record4.X : 0));
|
|
34677
34677
|
var FixedTimeZone = class {
|
|
34678
|
-
constructor(
|
|
34679
|
-
this.id =
|
|
34678
|
+
constructor(id4, compareKey, offsetNano) {
|
|
34679
|
+
this.id = id4, this.m = compareKey, this.X = offsetNano;
|
|
34680
34680
|
}
|
|
34681
34681
|
B() {
|
|
34682
34682
|
return this.X;
|
|
@@ -34688,8 +34688,8 @@ var FixedTimeZone = class {
|
|
|
34688
34688
|
}
|
|
34689
34689
|
};
|
|
34690
34690
|
var IntlTimeZone = class {
|
|
34691
|
-
constructor(
|
|
34692
|
-
this.id =
|
|
34691
|
+
constructor(id4, compareKey, format2) {
|
|
34692
|
+
this.id = id4, this.m = compareKey, this.ke = ((computeOffsetSec, periodDays) => {
|
|
34693
34693
|
const getSample = memoize(computeOffsetSec);
|
|
34694
34694
|
const getSplit = memoize(createSplitTuple);
|
|
34695
34695
|
const periodSec = 86400 * periodDays;
|
|
@@ -34771,7 +34771,7 @@ var IntlTimeZone = class {
|
|
|
34771
34771
|
})(format2), ((timeZoneId) => {
|
|
34772
34772
|
const timeZoneName = timeZoneId.split("/").pop();
|
|
34773
34773
|
return timeZonePeriodDaysByName[timeZoneName] || 60;
|
|
34774
|
-
})(
|
|
34774
|
+
})(id4));
|
|
34775
34775
|
}
|
|
34776
34776
|
B(epochNano) {
|
|
34777
34777
|
return this.ke.we(((epochNano2) => epochNanoToSecMod(epochNano2)[0])(epochNano)) * nanoInSec2;
|
|
@@ -36884,6 +36884,7 @@ var SWITCHES = /* @__PURE__ */ new Set([
|
|
|
36884
36884
|
// retired: accepted and ignored, every push is live
|
|
36885
36885
|
"local",
|
|
36886
36886
|
"done",
|
|
36887
|
+
"quiet",
|
|
36887
36888
|
"names",
|
|
36888
36889
|
"shell",
|
|
36889
36890
|
"self",
|
|
@@ -36927,7 +36928,7 @@ function flagText({
|
|
|
36927
36928
|
}
|
|
36928
36929
|
|
|
36929
36930
|
// src/rules/cli-version.rules.ts
|
|
36930
|
-
var STAMPED = "0.1.
|
|
36931
|
+
var STAMPED = "0.1.79";
|
|
36931
36932
|
function cliVersionOf({ stamped = STAMPED } = {}) {
|
|
36932
36933
|
return stamped.startsWith("__") ? "dev" : stamped;
|
|
36933
36934
|
}
|
|
@@ -40530,15 +40531,15 @@ var $ZodObjectJIT = /* @__PURE__ */ $constructor("$ZodObjectJIT", (inst, def) =>
|
|
|
40530
40531
|
const syms = normalized.symbolKeys;
|
|
40531
40532
|
const doc = new Doc(["payload", "ctx"], { shape, inst, memo: memo2, syms });
|
|
40532
40533
|
const parseStr = (k) => `shape[${k}]._zod.run({ value: input[${k}], issues: [] }, ctx)`;
|
|
40533
|
-
const prefixStr = (
|
|
40534
|
-
let ${
|
|
40535
|
-
for (let i = 0; i < ${
|
|
40536
|
-
const iss = ${
|
|
40534
|
+
const prefixStr = (id4, k) => `
|
|
40535
|
+
let ${id4}_ab = false;
|
|
40536
|
+
for (let i = 0; i < ${id4}.issues.length; i++) {
|
|
40537
|
+
const iss = ${id4}.issues[i];
|
|
40537
40538
|
iss.path = iss.path ? [${k}, ...iss.path] : [${k}];
|
|
40538
40539
|
payload.issues.push(iss);
|
|
40539
|
-
if (iss.continue !== true) ${
|
|
40540
|
+
if (iss.continue !== true) ${id4}_ab = true;
|
|
40540
40541
|
}
|
|
40541
|
-
if (${
|
|
40542
|
+
if (${id4}_ab && ctx && ctx.abortEarly) {
|
|
40542
40543
|
payload.value = newResult;
|
|
40543
40544
|
return payload;
|
|
40544
40545
|
}`;
|
|
@@ -40552,34 +40553,34 @@ var $ZodObjectJIT = /* @__PURE__ */ $constructor("$ZodObjectJIT", (inst, def) =>
|
|
|
40552
40553
|
for (const key of normalized.allKeys) {
|
|
40553
40554
|
if (key === "__proto__")
|
|
40554
40555
|
continue;
|
|
40555
|
-
const
|
|
40556
|
+
const id4 = ids[key];
|
|
40556
40557
|
const k = typeof key === "symbol" ? `syms[${syms.indexOf(key)}]` : esc(key);
|
|
40557
40558
|
const isPresent = `${k} in input`;
|
|
40558
40559
|
const schema = shape[key];
|
|
40559
40560
|
const optin = schema?._zod?.optin;
|
|
40560
40561
|
const isOptionalIn = optin !== void 0;
|
|
40561
40562
|
const isOptionalOut = schema?._zod?.optout === "optional";
|
|
40562
|
-
doc.write(`const ${
|
|
40563
|
+
doc.write(`const ${id4} = ${parseStr(k)};`);
|
|
40563
40564
|
if (isOptionalIn && isOptionalOut) {
|
|
40564
|
-
const assign = optin === "optional" ? `${
|
|
40565
|
+
const assign = optin === "optional" ? `${id4}_present` : `${id4}.value !== undefined || ${id4}_present`;
|
|
40565
40566
|
doc.write(`
|
|
40566
|
-
const ${
|
|
40567
|
-
if (!${
|
|
40568
|
-
if (${
|
|
40567
|
+
const ${id4}_present = ${isPresent};
|
|
40568
|
+
if (!${id4}.issues.length || ${id4}_present) {
|
|
40569
|
+
if (${id4}.issues.length) {${prefixStr(id4, k)}
|
|
40569
40570
|
}
|
|
40570
40571
|
|
|
40571
40572
|
if (${assign}) {
|
|
40572
|
-
newResult[${k}] = ${
|
|
40573
|
+
newResult[${k}] = ${id4}.value;
|
|
40573
40574
|
}
|
|
40574
40575
|
}
|
|
40575
40576
|
|
|
40576
40577
|
`);
|
|
40577
40578
|
} else if (!isOptionalIn) {
|
|
40578
40579
|
doc.write(`
|
|
40579
|
-
const ${
|
|
40580
|
-
if (${
|
|
40580
|
+
const ${id4}_present = ${isPresent};
|
|
40581
|
+
if (${id4}.issues.length) {${prefixStr(id4, k)}
|
|
40581
40582
|
}
|
|
40582
|
-
if (!${
|
|
40583
|
+
if (!${id4}_present && !${id4}.issues.length) {
|
|
40583
40584
|
payload.issues.push({
|
|
40584
40585
|
code: "invalid_type",
|
|
40585
40586
|
expected: "nonoptional",
|
|
@@ -40592,22 +40593,22 @@ var $ZodObjectJIT = /* @__PURE__ */ $constructor("$ZodObjectJIT", (inst, def) =>
|
|
|
40592
40593
|
}
|
|
40593
40594
|
}
|
|
40594
40595
|
|
|
40595
|
-
if (${
|
|
40596
|
-
newResult[${k}] = ${
|
|
40596
|
+
if (${id4}_present) {
|
|
40597
|
+
newResult[${k}] = ${id4}.value;
|
|
40597
40598
|
}
|
|
40598
40599
|
|
|
40599
40600
|
`);
|
|
40600
40601
|
} else {
|
|
40601
40602
|
doc.write(`
|
|
40602
|
-
if (${
|
|
40603
|
+
if (${id4}.issues.length) {${prefixStr(id4, k)}
|
|
40603
40604
|
}
|
|
40604
40605
|
`);
|
|
40605
40606
|
if (optin === "defaulted") {
|
|
40606
|
-
doc.write(`newResult[${k}] = ${
|
|
40607
|
+
doc.write(`newResult[${k}] = ${id4}.value;`);
|
|
40607
40608
|
} else {
|
|
40608
40609
|
doc.write(`
|
|
40609
|
-
if (${
|
|
40610
|
-
newResult[${k}] = ${
|
|
40610
|
+
if (${id4}.value !== undefined || ${isPresent}) {
|
|
40611
|
+
newResult[${k}] = ${id4}.value;
|
|
40611
40612
|
}
|
|
40612
40613
|
`);
|
|
40613
40614
|
}
|
|
@@ -52625,26 +52626,26 @@ function extractDefs(ctx, schema) {
|
|
|
52625
52626
|
return;
|
|
52626
52627
|
const idToSchema = /* @__PURE__ */ new Map();
|
|
52627
52628
|
for (const entry of ctx.seen.entries()) {
|
|
52628
|
-
const
|
|
52629
|
-
if (
|
|
52630
|
-
const existing = idToSchema.get(
|
|
52629
|
+
const id4 = ctx.metadataRegistry.get(entry[0])?.id;
|
|
52630
|
+
if (id4) {
|
|
52631
|
+
const existing = idToSchema.get(id4);
|
|
52631
52632
|
if (existing && existing !== entry[0]) {
|
|
52632
|
-
throw new Error(`Duplicate schema id "${
|
|
52633
|
+
throw new Error(`Duplicate schema id "${id4}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);
|
|
52633
52634
|
}
|
|
52634
|
-
idToSchema.set(
|
|
52635
|
+
idToSchema.set(id4, entry[0]);
|
|
52635
52636
|
}
|
|
52636
52637
|
}
|
|
52637
52638
|
const makeURI = (entry) => {
|
|
52638
52639
|
const defsSegment = ctx.target === "draft-2020-12" ? "$defs" : "definitions";
|
|
52639
52640
|
if (ctx.external) {
|
|
52640
52641
|
const externalId = ctx.external.registry.get(entry[0])?.id;
|
|
52641
|
-
const uriGenerator = ctx.external.uri ?? ((
|
|
52642
|
+
const uriGenerator = ctx.external.uri ?? ((id5) => id5);
|
|
52642
52643
|
if (externalId) {
|
|
52643
52644
|
return { ref: uriGenerator(externalId) };
|
|
52644
52645
|
}
|
|
52645
|
-
const
|
|
52646
|
-
entry[1].defId =
|
|
52647
|
-
return { defId:
|
|
52646
|
+
const id4 = entry[1].defId ?? entry[1].schema.id ?? `schema${ctx.counter++}`;
|
|
52647
|
+
entry[1].defId = id4;
|
|
52648
|
+
return { defId: id4, ref: `${uriGenerator("__shared")}#/${defsSegment}/${encodeJSONPointerSegment(id4)}` };
|
|
52648
52649
|
}
|
|
52649
52650
|
const uriPrefix = `#`;
|
|
52650
52651
|
const defUriPrefix = `${uriPrefix}/${defsSegment}/`;
|
|
@@ -52692,8 +52693,8 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
52692
52693
|
continue;
|
|
52693
52694
|
}
|
|
52694
52695
|
}
|
|
52695
|
-
const
|
|
52696
|
-
if (
|
|
52696
|
+
const id4 = ctx.metadataRegistry.get(entry[0])?.id;
|
|
52697
|
+
if (id4) {
|
|
52697
52698
|
extractToDef(entry);
|
|
52698
52699
|
continue;
|
|
52699
52700
|
}
|
|
@@ -52926,10 +52927,10 @@ function finalize(ctx, schema) {
|
|
|
52926
52927
|
} else {
|
|
52927
52928
|
}
|
|
52928
52929
|
if (ctx.external?.uri) {
|
|
52929
|
-
const
|
|
52930
|
-
if (!
|
|
52930
|
+
const id4 = ctx.external.registry.get(schema)?.id;
|
|
52931
|
+
if (!id4)
|
|
52931
52932
|
throw new Error("Schema is missing an `id` property");
|
|
52932
|
-
result2.$id = ctx.external.uri(
|
|
52933
|
+
result2.$id = ctx.external.uri(id4);
|
|
52933
52934
|
}
|
|
52934
52935
|
assignProps(result2, root.defId ? root.schema : root.def ?? root.schema);
|
|
52935
52936
|
const rootMetaId = ctx.metadataRegistry.get(schema)?.id;
|
|
@@ -53535,7 +53536,7 @@ function stringifyKeyNames(bySchema, json7, visited) {
|
|
|
53535
53536
|
const values = json7.enum ?? (json7.const !== void 0 ? [json7.const] : void 0);
|
|
53536
53537
|
if (!numericType && !values?.some((v) => typeof v === "number"))
|
|
53537
53538
|
return json7;
|
|
53538
|
-
const { minimum, maximum, exclusiveMinimum, exclusiveMaximum, multipleOf, format: format2, id:
|
|
53539
|
+
const { minimum, maximum, exclusiveMinimum, exclusiveMaximum, multipleOf, format: format2, id: id4, ...rest } = json7;
|
|
53539
53540
|
if (rest.enum)
|
|
53540
53541
|
rest.enum = rest.enum.map((v) => typeof v === "number" ? String(v) : v);
|
|
53541
53542
|
else if (typeof rest.const === "number")
|
|
@@ -57412,12 +57413,12 @@ var isHex = new Uint8Array([
|
|
|
57412
57413
|
1,
|
|
57413
57414
|
1
|
|
57414
57415
|
]);
|
|
57415
|
-
function isValidHex(
|
|
57416
|
-
if (typeof
|
|
57416
|
+
function isValidHex(id4, length) {
|
|
57417
|
+
if (typeof id4 !== "string" || id4.length !== length)
|
|
57417
57418
|
return false;
|
|
57418
57419
|
let r = 0;
|
|
57419
|
-
for (let i = 0; i <
|
|
57420
|
-
r += (isHex[
|
|
57420
|
+
for (let i = 0; i < id4.length; i += 4) {
|
|
57421
|
+
r += (isHex[id4.charCodeAt(i)] | 0) + (isHex[id4.charCodeAt(i + 1)] | 0) + (isHex[id4.charCodeAt(i + 2)] | 0) + (isHex[id4.charCodeAt(i + 3)] | 0);
|
|
57421
57422
|
}
|
|
57422
57423
|
return r === length;
|
|
57423
57424
|
}
|
|
@@ -58864,7 +58865,7 @@ var ModuleApiToken = class _ModuleApiToken extends FeatureApiIdentity {
|
|
|
58864
58865
|
};
|
|
58865
58866
|
function moduleApi(name3) {
|
|
58866
58867
|
if (name3 === void 0) {
|
|
58867
|
-
return (
|
|
58868
|
+
return (id4) => ModuleApiToken.create(id4);
|
|
58868
58869
|
}
|
|
58869
58870
|
return ModuleApiToken.create(name3);
|
|
58870
58871
|
}
|
|
@@ -59403,6 +59404,35 @@ function cleanResolutionNote(text3) {
|
|
|
59403
59404
|
}
|
|
59404
59405
|
var resolutionNoteSchema = external_exports.string().max(RESOLUTION_NOTE_INPUT_MAX_CHARS).default("").transform((text3) => cleanResolutionNote(text3));
|
|
59405
59406
|
|
|
59407
|
+
// ../../modules/vault/contract/src/vault-agent-rules.ts
|
|
59408
|
+
var VAULT_AGENT_RULES = ["off", "ask", "allow"];
|
|
59409
|
+
var vaultAgentRuleSchema = external_exports.enum(VAULT_AGENT_RULES);
|
|
59410
|
+
var vaultAgentRuleEntrySchemaDefinition = external_exports.object({
|
|
59411
|
+
agentId: external_exports.string().min(1),
|
|
59412
|
+
rule: vaultAgentRuleSchema,
|
|
59413
|
+
/** False for an Always allow the key has since outgrown: it waits to be confirmed again. */
|
|
59414
|
+
inForce: external_exports.boolean(),
|
|
59415
|
+
setByUserId: external_exports.string(),
|
|
59416
|
+
/** ISO 8601 */
|
|
59417
|
+
setAt: external_exports.iso.datetime()
|
|
59418
|
+
});
|
|
59419
|
+
var vaultAgentRuleEntrySchema = vaultAgentRuleEntrySchemaDefinition;
|
|
59420
|
+
var listVaultAgentRulesInputSchemaDefinition = external_exports.object({
|
|
59421
|
+
workspaceId: external_exports.string().min(1),
|
|
59422
|
+
connectionId: external_exports.string().min(1)
|
|
59423
|
+
});
|
|
59424
|
+
var listVaultAgentRulesInputSchema = listVaultAgentRulesInputSchemaDefinition;
|
|
59425
|
+
var setVaultAgentRuleInputSchemaDefinition = external_exports.object({
|
|
59426
|
+
workspaceId: external_exports.string().min(1),
|
|
59427
|
+
connectionId: external_exports.string().min(1),
|
|
59428
|
+
agentId: external_exports.string().min(1),
|
|
59429
|
+
rule: external_exports.enum([...VAULT_AGENT_RULES, "default"]),
|
|
59430
|
+
/** A fresh passkey proof, when the change needs one. */
|
|
59431
|
+
reauthToken: external_exports.string().min(1).optional()
|
|
59432
|
+
});
|
|
59433
|
+
var setVaultAgentRuleInputSchema = setVaultAgentRuleInputSchemaDefinition;
|
|
59434
|
+
var VaultAgentRulesDialogSlot = uiTokens("vault").component("agentRulesDialog");
|
|
59435
|
+
|
|
59406
59436
|
// ../../modules/vault/contract/src/vault-devices.ts
|
|
59407
59437
|
var base64Url = external_exports.string().regex(/^[A-Za-z0-9_-]+$/).max(16384);
|
|
59408
59438
|
var name = external_exports.string().regex(/^[a-z0-9][a-z0-9-]{0,62}$/);
|
|
@@ -59707,8 +59737,8 @@ var COMMAND_STARTS = new Set(
|
|
|
59707
59737
|
" "
|
|
59708
59738
|
)
|
|
59709
59739
|
);
|
|
59710
|
-
function checkVaultReason(
|
|
59711
|
-
const text3 = (
|
|
59740
|
+
function checkVaultReason(reason2) {
|
|
59741
|
+
const text3 = (reason2 ?? "").trim();
|
|
59712
59742
|
if (text3 === "") return "missing";
|
|
59713
59743
|
if (text3.includes("\n") || Array.from(text3).length > 200) return "too_long";
|
|
59714
59744
|
const words = text3.split(/\s+/);
|
|
@@ -59717,8 +59747,8 @@ function checkVaultReason(reason) {
|
|
|
59717
59747
|
if (words.length < 4) return "too_short";
|
|
59718
59748
|
return "ok";
|
|
59719
59749
|
}
|
|
59720
|
-
var vaultReasonSchema = external_exports.string().transform((
|
|
59721
|
-
const problem = checkVaultReason(
|
|
59750
|
+
var vaultReasonSchema = external_exports.string().transform((reason2) => reason2.trim()).superRefine((reason2, context) => {
|
|
59751
|
+
const problem = checkVaultReason(reason2);
|
|
59722
59752
|
if (problem !== "ok")
|
|
59723
59753
|
context.addIssue({ code: "custom", message: problem, params: { problem } });
|
|
59724
59754
|
});
|
|
@@ -60360,6 +60390,18 @@ var vaultConnectionUseSchemaDefinition = external_exports.object({
|
|
|
60360
60390
|
}).nullable().optional()
|
|
60361
60391
|
});
|
|
60362
60392
|
var vaultConnectionUseSchema = vaultConnectionUseSchemaDefinition;
|
|
60393
|
+
var vaultKeyActivitySchemaDefinition = external_exports.object({
|
|
60394
|
+
connectionId: external_exports.string(),
|
|
60395
|
+
uses: external_exports.array(vaultConnectionUseSchema).nullable(),
|
|
60396
|
+
grants: external_exports.array(vaultGrantSchema).nullable()
|
|
60397
|
+
});
|
|
60398
|
+
var vaultKeyActivitySchema = vaultKeyActivitySchemaDefinition;
|
|
60399
|
+
var VAULT_KEY_ACTIVITY_MAX_KEYS = 50;
|
|
60400
|
+
var listVaultKeyActivityInputSchemaDefinition = external_exports.object({
|
|
60401
|
+
workspaceId: external_exports.string(),
|
|
60402
|
+
connectionIds: external_exports.array(external_exports.string()).min(1).max(VAULT_KEY_ACTIVITY_MAX_KEYS)
|
|
60403
|
+
});
|
|
60404
|
+
var listVaultKeyActivityInputSchema = listVaultKeyActivityInputSchemaDefinition;
|
|
60363
60405
|
var vaultRevokeAtProviderSchema = external_exports.enum(["revoked", "failed", "not_supported"]);
|
|
60364
60406
|
var saveGithubInstallationInputSchemaDefinition = external_exports.object({
|
|
60365
60407
|
workspaceId: external_exports.string().min(1),
|
|
@@ -60450,7 +60492,7 @@ var connectionInput = external_exports.object({
|
|
|
60450
60492
|
workspaceId: external_exports.string().min(1),
|
|
60451
60493
|
connectionId: external_exports.string().min(1)
|
|
60452
60494
|
});
|
|
60453
|
-
var
|
|
60495
|
+
var vaultCoreTrpc = defineTrpcContract("vault").mutation("createConnection").withInput(createVaultConnectionInputSchema).withOutput(vaultConnectionSchema).query("listConnections").withInput(workspaceInput).withOutput(external_exports.array(vaultConnectionSchema)).mutation("updateConnection").withInput(updateVaultConnectionInputSchema).withOutput(vaultConnectionSchema).mutation("deleteConnection").withInput(connectionInput).withOutput(external_exports.object({ deleted: external_exports.literal(true) })).mutation("revokeConnection").withInput(connectionInput).withOutput(external_exports.object({ atProvider: vaultRevokeAtProviderSchema })).query("listConnectionUses").withInput(
|
|
60454
60496
|
external_exports.object({ ...connectionInput.shape, limit: external_exports.number().int().min(1).max(200).optional() })
|
|
60455
60497
|
).withOutput(external_exports.array(vaultConnectionUseSchema)).mutation("revealConnection").withInput(
|
|
60456
60498
|
external_exports.object({
|
|
@@ -60458,7 +60500,7 @@ var vaultTrpc = defineTrpcContract("vault").mutation("createConnection").withInp
|
|
|
60458
60500
|
reason: external_exports.string().trim().min(1).max(200),
|
|
60459
60501
|
reauthToken: external_exports.string().min(1).max(200).optional()
|
|
60460
60502
|
})
|
|
60461
|
-
).withOutput(external_exports.object({ fields: external_exports.record(external_exports.string(), external_exports.string()) })).mutation("beginReauth").withInput(beginVaultReauthInputSchema).withOutput(vaultReauthChallengeSchema).mutation("confirmReauth").withInput(confirmVaultReauthInputSchema).withOutput(vaultReauthProofSchema).mutation("grantConnection").withInput(grantVaultConnectionInputSchema).withOutput(vaultGrantSchema).mutation("lendToChannel").withInput(lendVaultConnectionInputSchema).withOutput(vaultGrantSchema).mutation("revokeGrant").withInput(revokeVaultGrantInputSchema).withOutput(external_exports.object({ revoked: external_exports.literal(true) })).query("listGrants").withInput(connectionInput).withOutput(external_exports.array(vaultGrantSchema)).mutation("shareConnection").withInput(shareVaultConnectionInputSchema).withOutput(vaultGrantSchema).mutation("approveShare").withInput(approveVaultShareInputSchema).withOutput(vaultGrantSchema).mutation("approveMachineKey").withInput(approveVaultMachineKeyInputSchema).withOutput(approvedVaultMachineKeySchema).query("readLock").withInput(external_exports.object({ workspaceId: external_exports.string().min(1) })).withOutput(vaultReadLockSchema).query("referenceHolder").withInput(vaultReferenceHolderInputSchema).withOutput(vaultReferenceHolderSchema).mutation("unlockReads").withInput(unlockVaultReadsInputSchema).withOutput(vaultReadLockSchema).mutation("sealConnection").withInput(sealVaultConnectionInputSchema).withOutput(vaultConnectionSchema).query("listApprovals").withInput(external_exports.object({ ...workspaceInput.shape, state: vaultApprovalListStateSchema.optional() })).withOutput(external_exports.array(vaultApprovalRequestSchema)).mutation("answerApproval").withInput(answerVaultApprovalInputSchema).withOutput(vaultApprovalRequestSchema).query("listAudit").withInput(vaultAuditReadInputSchema).withOutput(vaultAuditPageSchema).query("listActivity").withInput(vaultAuditReadInputSchema).withOutput(external_exports.array(vaultAuditEntrySchema)).query("listLeases").withInput(workspaceInput).withOutput(external_exports.array(vaultLeaseSchema)).mutation("endLease").withInput(endVaultLeaseInputSchema).withOutput(external_exports.object({ ended: external_exports.literal(true) })).query("mostAsked").withInput(vaultMostAskedInputSchema).withOutput(vaultMostAskedSchema).query("judgeStatus").withInput(workspaceInput).withOutput(vaultJudgeStatusSchema).query("listLevelLimits").withInput(workspaceInput).withOutput(external_exports.array(vaultLevelLimitSchema)).mutation("setLevelLimit").withInput(setVaultLevelLimitInputSchema).withOutput(external_exports.array(vaultLevelLimitSchema)).query("listDevices").withInput(listVaultDevicesInput).withOutput(external_exports.array(vaultDeviceSchema)).mutation("beginDeviceEnrolment").withInput(workspaceInput).withOutput(vaultDeviceEnrolmentSchema).mutation("finishDeviceEnrolment").withInput(finishVaultDeviceEnrolmentInputSchema).withOutput(vaultDeviceSchema).mutation("beginDeviceApproval").withInput(external_exports.object({ ...workspaceInput.shape, deviceId: external_exports.string().min(1) })).withOutput(external_exports.object({ challenge: external_exports.string(), sealed: external_exports.array(vaultSealedMaterialSchema) })).mutation("approveDevice").withInput(approveVaultDeviceInputSchema).withOutput(vaultDeviceSchema).mutation("renameDevice").withInput(renameVaultDeviceInputSchema).withOutput(vaultDeviceSchema).mutation("removeDevice").withInput(
|
|
60503
|
+
).withOutput(external_exports.object({ fields: external_exports.record(external_exports.string(), external_exports.string()) })).mutation("beginReauth").withInput(beginVaultReauthInputSchema).withOutput(vaultReauthChallengeSchema).mutation("confirmReauth").withInput(confirmVaultReauthInputSchema).withOutput(vaultReauthProofSchema).mutation("grantConnection").withInput(grantVaultConnectionInputSchema).withOutput(vaultGrantSchema).mutation("lendToChannel").withInput(lendVaultConnectionInputSchema).withOutput(vaultGrantSchema).mutation("revokeGrant").withInput(revokeVaultGrantInputSchema).withOutput(external_exports.object({ revoked: external_exports.literal(true) })).query("listGrants").withInput(connectionInput).withOutput(external_exports.array(vaultGrantSchema)).query("listKeyActivity").withInput(listVaultKeyActivityInputSchema).withOutput(external_exports.array(vaultKeyActivitySchema)).mutation("shareConnection").withInput(shareVaultConnectionInputSchema).withOutput(vaultGrantSchema).mutation("approveShare").withInput(approveVaultShareInputSchema).withOutput(vaultGrantSchema).mutation("approveMachineKey").withInput(approveVaultMachineKeyInputSchema).withOutput(approvedVaultMachineKeySchema).query("readLock").withInput(external_exports.object({ workspaceId: external_exports.string().min(1) })).withOutput(vaultReadLockSchema).query("referenceHolder").withInput(vaultReferenceHolderInputSchema).withOutput(vaultReferenceHolderSchema).mutation("unlockReads").withInput(unlockVaultReadsInputSchema).withOutput(vaultReadLockSchema).mutation("sealConnection").withInput(sealVaultConnectionInputSchema).withOutput(vaultConnectionSchema).query("listApprovals").withInput(external_exports.object({ ...workspaceInput.shape, state: vaultApprovalListStateSchema.optional() })).withOutput(external_exports.array(vaultApprovalRequestSchema)).mutation("answerApproval").withInput(answerVaultApprovalInputSchema).withOutput(vaultApprovalRequestSchema).query("listAudit").withInput(vaultAuditReadInputSchema).withOutput(vaultAuditPageSchema).query("listActivity").withInput(vaultAuditReadInputSchema).withOutput(external_exports.array(vaultAuditEntrySchema)).query("listLeases").withInput(workspaceInput).withOutput(external_exports.array(vaultLeaseSchema)).mutation("endLease").withInput(endVaultLeaseInputSchema).withOutput(external_exports.object({ ended: external_exports.literal(true) })).query("mostAsked").withInput(vaultMostAskedInputSchema).withOutput(vaultMostAskedSchema).query("judgeStatus").withInput(workspaceInput).withOutput(vaultJudgeStatusSchema).query("listLevelLimits").withInput(workspaceInput).withOutput(external_exports.array(vaultLevelLimitSchema)).mutation("setLevelLimit").withInput(setVaultLevelLimitInputSchema).withOutput(external_exports.array(vaultLevelLimitSchema)).query("listDevices").withInput(listVaultDevicesInput).withOutput(external_exports.array(vaultDeviceSchema)).mutation("beginDeviceEnrolment").withInput(workspaceInput).withOutput(vaultDeviceEnrolmentSchema).mutation("finishDeviceEnrolment").withInput(finishVaultDeviceEnrolmentInputSchema).withOutput(vaultDeviceSchema).mutation("beginDeviceApproval").withInput(external_exports.object({ ...workspaceInput.shape, deviceId: external_exports.string().min(1) })).withOutput(external_exports.object({ challenge: external_exports.string(), sealed: external_exports.array(vaultSealedMaterialSchema) })).mutation("approveDevice").withInput(approveVaultDeviceInputSchema).withOutput(vaultDeviceSchema).mutation("renameDevice").withInput(renameVaultDeviceInputSchema).withOutput(vaultDeviceSchema).mutation("removeDevice").withInput(
|
|
60462
60504
|
external_exports.object({
|
|
60463
60505
|
...workspaceInput.shape,
|
|
60464
60506
|
deviceId: external_exports.string().min(1),
|
|
@@ -60471,6 +60513,8 @@ var vaultTrpc = defineTrpcContract("vault").mutation("createConnection").withInp
|
|
|
60471
60513
|
reauthToken: external_exports.string().min(1).max(200).optional()
|
|
60472
60514
|
})
|
|
60473
60515
|
).withOutput(vaultSealedMaterialSchema).query("getSealedApproval").withInput(external_exports.object({ ...workspaceInput.shape, requestId: external_exports.string().min(1) })).withOutput(vaultSealedApprovalSchema).mutation("answerSealedApproval").withInput(answerSealedApprovalInputSchema).withOutput(vaultApprovalRequestSchema).mutation("compareSecret").withInput(compareVaultSecretInputSchema).withOutput(vaultSecretComparisonSchema).mutation("replaceSecretValue").withInput(replaceVaultSecretValueInputSchema).withOutput(vaultConnectionSchema).mutation("savePastedSecret").withInput(external_exports.object({ ...workspaceInput.shape, ...saveVaultPastedSecretBodySchema.shape })).withOutput(vaultPastedSecretSavedSchema).build();
|
|
60516
|
+
var vaultAgentRuleTrpc = defineTrpcContract("vault").query("listAgentRules").withInput(listVaultAgentRulesInputSchema).withOutput(external_exports.array(vaultAgentRuleEntrySchema)).mutation("setAgentRule").withInput(setVaultAgentRuleInputSchema).withOutput(external_exports.array(vaultAgentRuleEntrySchema)).build();
|
|
60517
|
+
var vaultTrpc = joinTrpcContracts("vault", vaultCoreTrpc, vaultAgentRuleTrpc);
|
|
60474
60518
|
|
|
60475
60519
|
// ../../modules/vault/contract/src/vault.config.ts
|
|
60476
60520
|
var positiveInt = external_exports.coerce.number().int().positive();
|
|
@@ -61242,6 +61286,7 @@ var vaultPasskeyAssertionSchemaDefinition = external_exports.object({
|
|
|
61242
61286
|
clientDataJSON: b64url2,
|
|
61243
61287
|
signature: b64url2
|
|
61244
61288
|
});
|
|
61289
|
+
var vaultPasskeyAssertionSchema = vaultPasskeyAssertionSchemaDefinition;
|
|
61245
61290
|
var RFC3339 = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d{1,9})?(?:Z|[+-]\d{2}:\d{2})$/;
|
|
61246
61291
|
var vaultWatchOverrideSchemaDefinition = external_exports.object({
|
|
61247
61292
|
ceilingPerHour: external_exports.number().int().positive().max(1e12),
|
|
@@ -61250,6 +61295,7 @@ var vaultWatchOverrideSchemaDefinition = external_exports.object({
|
|
|
61250
61295
|
nonce: external_exports.string().regex(/^[A-Za-z0-9_-]{16,128}$/, "16 to 128 base64url characters"),
|
|
61251
61296
|
assertion: vaultPasskeyAssertionSchemaDefinition
|
|
61252
61297
|
});
|
|
61298
|
+
var vaultWatchOverrideSchema = vaultWatchOverrideSchemaDefinition;
|
|
61253
61299
|
var vaultOperatorSignerSchema = external_exports.object({ rpId: external_exports.string().min(1), credentialId: b64url2 });
|
|
61254
61300
|
var vaultBreakerChallengeSchemaDefinition = external_exports.object({
|
|
61255
61301
|
challenge: b64url2,
|
|
@@ -61258,6 +61304,7 @@ var vaultBreakerChallengeSchemaDefinition = external_exports.object({
|
|
|
61258
61304
|
/** Every trusted passkey; the page signs with the one for its own host. */
|
|
61259
61305
|
passkeys: external_exports.array(vaultOperatorSignerSchema).default([])
|
|
61260
61306
|
});
|
|
61307
|
+
var vaultBreakerChallengeSchema = vaultBreakerChallengeSchemaDefinition;
|
|
61261
61308
|
var vaultOperatorPasskeySchemaDefinition = external_exports.object({
|
|
61262
61309
|
credentialId: b64url2,
|
|
61263
61310
|
rpId: external_exports.string().min(1),
|
|
@@ -61277,12 +61324,14 @@ var vaultOperatorProposalSchemaDefinition = external_exports.object({
|
|
|
61277
61324
|
rpId: external_exports.string().min(1),
|
|
61278
61325
|
fingerprint: external_exports.string()
|
|
61279
61326
|
});
|
|
61327
|
+
var vaultOperatorProposalSchema = vaultOperatorProposalSchemaDefinition;
|
|
61280
61328
|
var vaultOperatorProposeSchemaDefinition = external_exports.object({
|
|
61281
61329
|
publicKey: external_exports.string().min(1).max(512),
|
|
61282
61330
|
credentialId: b64url2,
|
|
61283
61331
|
rpId: external_exports.string().min(1).max(253),
|
|
61284
61332
|
origin: external_exports.url().max(300)
|
|
61285
61333
|
});
|
|
61334
|
+
var vaultOperatorProposeSchema = vaultOperatorProposeSchemaDefinition;
|
|
61286
61335
|
var VAULT_OPERATOR_ACTIONS = ["add", "prove", "remove", "label"];
|
|
61287
61336
|
var VAULT_OPERATOR_LABEL_MAX = 40;
|
|
61288
61337
|
var vaultOperatorChallengeInputSchemaDefinition = external_exports.object({
|
|
@@ -61292,11 +61341,13 @@ var vaultOperatorChallengeInputSchemaDefinition = external_exports.object({
|
|
|
61292
61341
|
/** The name a label record signs. */
|
|
61293
61342
|
label: external_exports.string().min(1).max(VAULT_OPERATOR_LABEL_MAX).optional()
|
|
61294
61343
|
});
|
|
61344
|
+
var vaultOperatorChallengeInputSchema = vaultOperatorChallengeInputSchemaDefinition;
|
|
61295
61345
|
var vaultOperatorChallengeSchemaDefinition = external_exports.object({
|
|
61296
61346
|
challenge: b64url2,
|
|
61297
61347
|
/** The passkeys vaultd would accept this record from. */
|
|
61298
61348
|
passkeys: external_exports.array(vaultOperatorSignerSchema)
|
|
61299
61349
|
});
|
|
61350
|
+
var vaultOperatorChallengeSchema = vaultOperatorChallengeSchemaDefinition;
|
|
61300
61351
|
var vaultOperatorChainSchemaDefinition = external_exports.object({
|
|
61301
61352
|
records: external_exports.array(external_exports.record(external_exports.string(), external_exports.unknown()))
|
|
61302
61353
|
});
|
|
@@ -61329,6 +61380,7 @@ var vaultLockdownOverrideSchemaDefinition = external_exports.object({
|
|
|
61329
61380
|
setByUserId: external_exports.string(),
|
|
61330
61381
|
setAt: external_exports.iso.datetime()
|
|
61331
61382
|
});
|
|
61383
|
+
var vaultLockdownOverrideSchema = vaultLockdownOverrideSchemaDefinition;
|
|
61332
61384
|
var vaultLockdownSchemaDefinition = external_exports.object({
|
|
61333
61385
|
vaultd: vaultdStateSchemaDefinition,
|
|
61334
61386
|
/** False while VAULT_WATCH_REPORT_TOKEN is unset: the watchdog routes answer 404. */
|
|
@@ -61341,6 +61393,13 @@ var vaultLockdownSchemaDefinition = external_exports.object({
|
|
|
61341
61393
|
}).nullable(),
|
|
61342
61394
|
override: vaultLockdownOverrideSchemaDefinition.nullable()
|
|
61343
61395
|
});
|
|
61396
|
+
var vaultLockdownSchema = vaultLockdownSchemaDefinition;
|
|
61397
|
+
var vaultOperatorKeyChallengeSchemaDefinition = external_exports.object({
|
|
61398
|
+
challenge: b64url2,
|
|
61399
|
+
passkeys: external_exports.array(vaultOperatorSignerSchema)
|
|
61400
|
+
});
|
|
61401
|
+
var vaultOperatorKeyChallengeSchema = vaultOperatorKeyChallengeSchemaDefinition;
|
|
61402
|
+
var vaultOperatorKeyProofSchemaDefinition = external_exports.object({ credentialId: b64url2 });
|
|
61344
61403
|
var vaultAlertsSettleRequestedPayloadSchemaDefinition = external_exports.object({
|
|
61345
61404
|
workspaceId: external_exports.string().min(1),
|
|
61346
61405
|
kind: external_exports.string().regex(/^[a-z_]{1,64}$/),
|
|
@@ -62040,7 +62099,13 @@ var unfurlSchemaDefinition = external_exports.object({
|
|
|
62040
62099
|
/** The site has an icon, read with `unfurlImage` and part `icon`. */
|
|
62041
62100
|
icon: external_exports.boolean().default(false)
|
|
62042
62101
|
});
|
|
62043
|
-
var mirrorSourceSchema = external_exports.enum([
|
|
62102
|
+
var mirrorSourceSchema = external_exports.enum([
|
|
62103
|
+
"slack",
|
|
62104
|
+
"whatsapp_business",
|
|
62105
|
+
"whatsapp",
|
|
62106
|
+
"discord",
|
|
62107
|
+
"laze"
|
|
62108
|
+
]);
|
|
62044
62109
|
var mirrorDeliverySchema = external_exports.enum(["waiting", "failed"]);
|
|
62045
62110
|
var messageOriginSchemaDefinition = external_exports.object({
|
|
62046
62111
|
source: mirrorSourceSchema,
|
|
@@ -64784,7 +64849,9 @@ var lazeAgentEventSchemaDefinition = external_exports.discriminatedUnion("type",
|
|
|
64784
64849
|
external_exports.object({
|
|
64785
64850
|
type: external_exports.literal("turn_alive"),
|
|
64786
64851
|
turnId: external_exports.string().min(1).optional(),
|
|
64787
|
-
messageIds: external_exports.array(external_exports.string().min(1)).optional()
|
|
64852
|
+
messageIds: external_exports.array(external_exports.string().min(1)).optional(),
|
|
64853
|
+
/** The harness or what it runs did something since the last beat. */
|
|
64854
|
+
progressing: external_exports.literal(true).optional()
|
|
64788
64855
|
}),
|
|
64789
64856
|
/** A supervisor process came up with empty queues: Laze sends it what is still unanswered. */
|
|
64790
64857
|
external_exports.object({ type: external_exports.literal("supervisor_started"), bootId: external_exports.string().min(1) }),
|
|
@@ -65233,6 +65300,14 @@ var hostFrameSchemaDefinition = external_exports.discriminatedUnion("type", [
|
|
|
65233
65300
|
/** Counts what would change and writes nothing. */
|
|
65234
65301
|
dryRun: external_exports.boolean().default(false)
|
|
65235
65302
|
}),
|
|
65303
|
+
/** Runs a schedule's check script without a turn; answered with `check_done`. */
|
|
65304
|
+
external_exports.object({
|
|
65305
|
+
type: external_exports.literal("run_check"),
|
|
65306
|
+
requestId: external_exports.string().min(1).max(80),
|
|
65307
|
+
script: external_exports.string().min(1).max(240),
|
|
65308
|
+
timeoutMs: external_exports.number().int().positive(),
|
|
65309
|
+
outputMax: external_exports.number().int().positive()
|
|
65310
|
+
}),
|
|
65236
65311
|
/** Drops a message still queued for the agent; answered with `withdrawn`. */
|
|
65237
65312
|
external_exports.object({
|
|
65238
65313
|
type: external_exports.literal("withdraw"),
|
|
@@ -65277,6 +65352,15 @@ var supervisorFrameSchemaDefinition = external_exports.discriminatedUnion("type"
|
|
|
65277
65352
|
lines: external_exports.number().int().nonnegative(),
|
|
65278
65353
|
kept: external_exports.number().int().nonnegative().default(0)
|
|
65279
65354
|
}),
|
|
65355
|
+
/** A `run_check` done: how it ended and what it printed on stdout. */
|
|
65356
|
+
external_exports.object({
|
|
65357
|
+
type: external_exports.literal("check_done"),
|
|
65358
|
+
requestId: external_exports.string().min(1).max(80),
|
|
65359
|
+
ending: external_exports.enum(["exited", "timed_out", "missing"]),
|
|
65360
|
+
exitCode: external_exports.number().int().nullable(),
|
|
65361
|
+
output: external_exports.string(),
|
|
65362
|
+
cut: external_exports.boolean()
|
|
65363
|
+
}),
|
|
65280
65364
|
/** A `laze` CLI call made inside the sandbox; the host sends it to Laze with the agent's key. */
|
|
65281
65365
|
external_exports.object({
|
|
65282
65366
|
type: external_exports.literal("api_request"),
|
|
@@ -65543,6 +65627,7 @@ var capacityNumbersDefinition = external_exports.object({
|
|
|
65543
65627
|
placedDiskGb: external_exports.number(),
|
|
65544
65628
|
diskLimitGb: external_exports.number()
|
|
65545
65629
|
});
|
|
65630
|
+
var capacityNumbersSchema = capacityNumbersDefinition;
|
|
65546
65631
|
var computerPoolFactDefinition = external_exports.discriminatedUnion("kind", [
|
|
65547
65632
|
external_exports.object({
|
|
65548
65633
|
kind: external_exports.literal("host_registered"),
|
|
@@ -66263,7 +66348,7 @@ var NAMING_FREE_CLI_COMMANDS = [
|
|
|
66263
66348
|
];
|
|
66264
66349
|
var NAMING_IS_SILENT = "Naming or renaming a conversation is silent: never post a message about it, and leave it out of your final text.";
|
|
66265
66350
|
function namingFirstTextOf({ channelIds }) {
|
|
66266
|
-
const lines2 = channelIds.map((
|
|
66351
|
+
const lines2 = channelIds.map((id4) => ` laze conversation rename ${id4} "<a few words>"`);
|
|
66267
66352
|
return [
|
|
66268
66353
|
"Name your new conversation first, in a few words that say what it is about:",
|
|
66269
66354
|
...lines2,
|
|
@@ -69561,6 +69646,11 @@ var LazeApiError = class extends Error {
|
|
|
69561
69646
|
meta;
|
|
69562
69647
|
};
|
|
69563
69648
|
var AGENT_MIGRATED = "agent_migrated";
|
|
69649
|
+
function unreachableReasonOf(error63) {
|
|
69650
|
+
if (!(error63 instanceof TypeError) || error63.message !== "fetch failed") return void 0;
|
|
69651
|
+
const { cause } = error63;
|
|
69652
|
+
return cause instanceof Error && cause.message ? cause.message : "the connection failed";
|
|
69653
|
+
}
|
|
69564
69654
|
function migratedNoticeOf(error63) {
|
|
69565
69655
|
if (!(error63 instanceof LazeApiError) || error63.code !== AGENT_MIGRATED) return void 0;
|
|
69566
69656
|
const notice = typeof error63.meta?.notice === "string" ? error63.meta.notice : error63.message;
|
|
@@ -71109,17 +71199,17 @@ function bodyAsText({
|
|
|
71109
71199
|
body,
|
|
71110
71200
|
mentions
|
|
71111
71201
|
}) {
|
|
71112
|
-
const actorName = (kind2,
|
|
71202
|
+
const actorName = (kind2, id4) => mentions.actors.find((actor) => actor.kind === kind2 && actor.id === id4)?.name ?? kind2;
|
|
71113
71203
|
const written = withSlackMarkupAsText(body);
|
|
71114
71204
|
let text3 = "";
|
|
71115
71205
|
let from = 0;
|
|
71116
71206
|
for (const token2 of written.matchAll(TOKEN)) {
|
|
71117
|
-
const [whole, kind2,
|
|
71207
|
+
const [whole, kind2, id4, broadcast, channelId] = token2;
|
|
71118
71208
|
text3 += plain2(written.slice(from, token2.index));
|
|
71119
71209
|
from = token2.index + whole.length;
|
|
71120
71210
|
if (channelId) {
|
|
71121
71211
|
text3 += `#${mentions.channels.find((channel) => channel.id === channelId)?.name ?? "channel"}`;
|
|
71122
|
-
} else if (kind2 &&
|
|
71212
|
+
} else if (kind2 && id4) text3 += `@${actorName(kind2, id4)}`;
|
|
71123
71213
|
else text3 += `@${broadcast ?? "channel"}`;
|
|
71124
71214
|
}
|
|
71125
71215
|
text3 += plain2(written.slice(from));
|
|
@@ -71297,13 +71387,13 @@ function rushSessionOf({
|
|
|
71297
71387
|
parentArgs
|
|
71298
71388
|
}) {
|
|
71299
71389
|
if (!parentArgs) return void 0;
|
|
71300
|
-
const [program = "", verb, action,
|
|
71390
|
+
const [program = "", verb, action, id4] = parentArgs;
|
|
71301
71391
|
const isRush = program === "rush" || program.endsWith("/rush");
|
|
71302
|
-
if (!isRush || verb !== "host" || action !== "run" || !
|
|
71303
|
-
return { id:
|
|
71392
|
+
if (!isRush || verb !== "host" || action !== "run" || !id4) return void 0;
|
|
71393
|
+
return { id: id4, program };
|
|
71304
71394
|
}
|
|
71305
|
-
function rushSendCommand({ program, id:
|
|
71306
|
-
return ["sh", "-c", 'printf "%s\\n" "$LAZE_WAKE_TEXT" | "$0" session send "$1"', program,
|
|
71395
|
+
function rushSendCommand({ program, id: id4 }) {
|
|
71396
|
+
return ["sh", "-c", 'printf "%s\\n" "$LAZE_WAKE_TEXT" | "$0" session send "$1"', program, id4];
|
|
71307
71397
|
}
|
|
71308
71398
|
function rushListedOf({ listed }) {
|
|
71309
71399
|
try {
|
|
@@ -71816,15 +71906,15 @@ async function preToolHook({ context, args }) {
|
|
|
71816
71906
|
const answer6 = await beat({ client, state, working: true });
|
|
71817
71907
|
if (!answer6.stop) return;
|
|
71818
71908
|
await turnEnded({ context, client, agent: name3 });
|
|
71819
|
-
const
|
|
71909
|
+
const reason2 = `Stopped by ${answer6.stoppedBy ?? "someone"} in Laze.`;
|
|
71820
71910
|
context.out(
|
|
71821
71911
|
JSON.stringify({
|
|
71822
71912
|
continue: false,
|
|
71823
|
-
stopReason:
|
|
71913
|
+
stopReason: reason2,
|
|
71824
71914
|
hookSpecificOutput: {
|
|
71825
71915
|
hookEventName: "PreToolUse",
|
|
71826
71916
|
permissionDecision: "deny",
|
|
71827
|
-
permissionDecisionReason:
|
|
71917
|
+
permissionDecisionReason: reason2
|
|
71828
71918
|
}
|
|
71829
71919
|
})
|
|
71830
71920
|
);
|
|
@@ -72142,14 +72232,14 @@ async function scheduleMessage({
|
|
|
72142
72232
|
var USAGE = "Usage: laze scheduled [--channel <channel>] [--json], laze scheduled send|cancel <id>, laze scheduled edit <id> [--text <text|->] [--at <time> [--tz <zone>]]";
|
|
72143
72233
|
var EDIT_USAGE = "Usage: laze scheduled edit <id> [--text <text|->] [--at <time> [--tz <zone>]]; give the text, the time or both";
|
|
72144
72234
|
async function scheduled({ context, args }) {
|
|
72145
|
-
const [, action,
|
|
72235
|
+
const [, action, id4] = args.words;
|
|
72146
72236
|
if (action === "send" || action === "cancel") {
|
|
72147
|
-
if (!
|
|
72148
|
-
return actOn({ context, args, action, id:
|
|
72237
|
+
if (!id4) throw new CliUsageError(USAGE);
|
|
72238
|
+
return actOn({ context, args, action, id: id4 });
|
|
72149
72239
|
}
|
|
72150
72240
|
if (action === "edit") {
|
|
72151
|
-
if (!
|
|
72152
|
-
return editOne({ context, args, id:
|
|
72241
|
+
if (!id4) throw new CliUsageError(EDIT_USAGE);
|
|
72242
|
+
return editOne({ context, args, id: id4 });
|
|
72153
72243
|
}
|
|
72154
72244
|
if (action !== void 0) throw new CliUsageError(USAGE);
|
|
72155
72245
|
const { client } = await signedIn({ context, args });
|
|
@@ -72175,14 +72265,14 @@ async function newTextOf({
|
|
|
72175
72265
|
async function editOne({
|
|
72176
72266
|
context,
|
|
72177
72267
|
args,
|
|
72178
|
-
id:
|
|
72268
|
+
id: id4
|
|
72179
72269
|
}) {
|
|
72180
72270
|
const at = scheduleAtOf({ args, usage: EDIT_USAGE });
|
|
72181
72271
|
const body = await newTextOf({ context, args });
|
|
72182
72272
|
if (!at && body === void 0) throw new CliUsageError(EDIT_USAGE);
|
|
72183
72273
|
const { client } = await signedIn({ context, args });
|
|
72184
72274
|
const edited = await client.post("/api/agents/me/scheduled/edit", {
|
|
72185
|
-
scheduledId:
|
|
72275
|
+
scheduledId: id4,
|
|
72186
72276
|
...body === void 0 ? {} : { body },
|
|
72187
72277
|
...at ? { sendAt: at.sendAt } : {}
|
|
72188
72278
|
});
|
|
@@ -72195,11 +72285,11 @@ async function actOn({
|
|
|
72195
72285
|
context,
|
|
72196
72286
|
args,
|
|
72197
72287
|
action,
|
|
72198
|
-
id:
|
|
72288
|
+
id: id4
|
|
72199
72289
|
}) {
|
|
72200
72290
|
const { client } = await signedIn({ context, args });
|
|
72201
72291
|
const done = await client.post(`/api/agents/me/scheduled/${action}`, {
|
|
72202
|
-
scheduledId:
|
|
72292
|
+
scheduledId: id4
|
|
72203
72293
|
});
|
|
72204
72294
|
if (args.flags.json) return context.out(`${JSON.stringify(done, null, 2)}
|
|
72205
72295
|
`);
|
|
@@ -72362,7 +72452,7 @@ function leavesLazeOf({
|
|
|
72362
72452
|
}
|
|
72363
72453
|
function turnAnswersOf({ context }) {
|
|
72364
72454
|
const listed = context.environment.inherited.LAZE_TURN_MESSAGES ?? "";
|
|
72365
|
-
const answers = listed.split(",").flatMap((
|
|
72455
|
+
const answers = listed.split(",").flatMap((id4) => id4.trim() ? [id4.trim()] : []);
|
|
72366
72456
|
return answers.length > 0 ? { answers } : {};
|
|
72367
72457
|
}
|
|
72368
72458
|
var FILES_USAGE = "[--image <path|url|fileId>]... [--file <path|url|fileId>]... (at most 6)";
|
|
@@ -72682,11 +72772,11 @@ function rolloutSessionOf({
|
|
|
72682
72772
|
}) {
|
|
72683
72773
|
try {
|
|
72684
72774
|
const parsed = JSON.parse(firstLine);
|
|
72685
|
-
const { id:
|
|
72686
|
-
if (parsed.type !== "session_meta" || typeof
|
|
72775
|
+
const { id: id4, cwd } = parsed.payload ?? {};
|
|
72776
|
+
if (parsed.type !== "session_meta" || typeof id4 !== "string" || typeof cwd !== "string") {
|
|
72687
72777
|
return void 0;
|
|
72688
72778
|
}
|
|
72689
|
-
return { id:
|
|
72779
|
+
return { id: id4, cwd };
|
|
72690
72780
|
} catch {
|
|
72691
72781
|
return void 0;
|
|
72692
72782
|
}
|
|
@@ -72715,7 +72805,7 @@ function rolloutEventOf({
|
|
|
72715
72805
|
if (type === "task_complete" || type === "turn_aborted") return { kind: "ended" };
|
|
72716
72806
|
const text3 = userTextOf({ parsed });
|
|
72717
72807
|
if (text3 === void 0) return void 0;
|
|
72718
|
-
const held = messageIds.filter((
|
|
72808
|
+
const held = messageIds.filter((id4) => text3.includes(`[${id4}]`));
|
|
72719
72809
|
return held.length > 0 ? { kind: "holds", messageIds: held } : void 0;
|
|
72720
72810
|
}
|
|
72721
72811
|
|
|
@@ -72805,8 +72895,8 @@ var CodexTurnWatch = class _CodexTurnWatch {
|
|
|
72805
72895
|
async #follow({ line }) {
|
|
72806
72896
|
const event = rolloutEventOf({ line, messageIds: [...this.#queued.keys()] });
|
|
72807
72897
|
if (event?.kind === "holds") {
|
|
72808
|
-
const held = event.messageIds.flatMap((
|
|
72809
|
-
for (const
|
|
72898
|
+
const held = event.messageIds.flatMap((id4) => this.#queued.get(id4) ?? []);
|
|
72899
|
+
for (const id4 of event.messageIds) this.#queued.delete(id4);
|
|
72810
72900
|
this.#answering = [...this.#answering, ...held];
|
|
72811
72901
|
await this.#tell({ working: true });
|
|
72812
72902
|
} else if (event?.kind === "ended" && this.#answering.length > 0) {
|
|
@@ -73097,8 +73187,8 @@ var answer = (status11, value) => ({
|
|
|
73097
73187
|
headers: value === void 0 ? {} : JSON_HEADERS,
|
|
73098
73188
|
body: value === void 0 ? "" : JSON.stringify(value)
|
|
73099
73189
|
});
|
|
73100
|
-
var result = (
|
|
73101
|
-
var error62 = (
|
|
73190
|
+
var result = (id4, value) => answer(200, { jsonrpc: "2.0", id: id4, result: value });
|
|
73191
|
+
var error62 = (id4, code, message2) => answer(200, { jsonrpc: "2.0", id: id4 ?? null, error: { code, message: message2 } });
|
|
73102
73192
|
function headerOf(headers, name3) {
|
|
73103
73193
|
const found = Object.entries(headers).find(([key]) => key.toLowerCase() === name3);
|
|
73104
73194
|
return found?.[1];
|
|
@@ -73527,8 +73617,8 @@ function decodeRelayEnvelope(bytes) {
|
|
|
73527
73617
|
payload: bytes.subarray(2 + size)
|
|
73528
73618
|
};
|
|
73529
73619
|
}
|
|
73530
|
-
function relayClosePayload({ code, reason }) {
|
|
73531
|
-
const text3 = encoder.encode(
|
|
73620
|
+
function relayClosePayload({ code, reason: reason2 }) {
|
|
73621
|
+
const text3 = encoder.encode(reason2.slice(0, 120));
|
|
73532
73622
|
const out = new Uint8Array(2 + text3.length);
|
|
73533
73623
|
out[0] = code >> 8 & 255;
|
|
73534
73624
|
out[1] = code & 255;
|
|
@@ -73677,13 +73767,13 @@ var RelaySession = class {
|
|
|
73677
73767
|
send({ socket: relay2, kind: binary ? "binary" : "text", line, payload: bytesOf(data) });
|
|
73678
73768
|
});
|
|
73679
73769
|
socket.on("error", () => void 0);
|
|
73680
|
-
socket.on("close", (code,
|
|
73770
|
+
socket.on("close", (code, reason2) => {
|
|
73681
73771
|
const known = this.#lines.get(line) === entry;
|
|
73682
73772
|
this.#lines.delete(line);
|
|
73683
73773
|
if (!known) return;
|
|
73684
73774
|
const closed = relayClosePayload({
|
|
73685
73775
|
code: code || 1006,
|
|
73686
|
-
reason:
|
|
73776
|
+
reason: reason2.toString() || "the gateway closed"
|
|
73687
73777
|
});
|
|
73688
73778
|
send({ socket: relay2, kind: "closed", line, payload: closed });
|
|
73689
73779
|
});
|
|
@@ -74041,9 +74131,9 @@ async function cliStampOf({ context }) {
|
|
|
74041
74131
|
);
|
|
74042
74132
|
}
|
|
74043
74133
|
var CodexQueueError = class extends Error {
|
|
74044
|
-
constructor(
|
|
74134
|
+
constructor(reason2, detail) {
|
|
74045
74135
|
super(detail);
|
|
74046
|
-
this.reason =
|
|
74136
|
+
this.reason = reason2;
|
|
74047
74137
|
this.detail = detail;
|
|
74048
74138
|
}
|
|
74049
74139
|
reason;
|
|
@@ -74821,10 +74911,10 @@ var CodexAppServer = class _CodexAppServer {
|
|
|
74821
74911
|
return new _CodexAppServer(spawn2("codex", ["app-server"], { env, stdio: "pipe" }));
|
|
74822
74912
|
}
|
|
74823
74913
|
async call(method, params) {
|
|
74824
|
-
const
|
|
74914
|
+
const id4 = ++this.#nextId;
|
|
74825
74915
|
const reply2 = await new Promise((resolve24) => {
|
|
74826
|
-
this.#pending.set(
|
|
74827
|
-
this.write({ id:
|
|
74916
|
+
this.#pending.set(id4, resolve24);
|
|
74917
|
+
this.write({ id: id4, method, params });
|
|
74828
74918
|
});
|
|
74829
74919
|
if (reply2.error !== void 0) throw new Error(`${method}: ${JSON.stringify(reply2.error)}`);
|
|
74830
74920
|
return record3(reply2.result);
|
|
@@ -74890,9 +74980,9 @@ async function newestThreadId({ codexHome }) {
|
|
|
74890
74980
|
rollouts.map(async (file3) => ({ file: file3, at: (await stat5(join14(root, file3))).mtimeMs }))
|
|
74891
74981
|
);
|
|
74892
74982
|
const newest = dated.toSorted((a, b) => b.at - a.at)[0]?.file ?? "";
|
|
74893
|
-
const
|
|
74894
|
-
if (!
|
|
74895
|
-
return
|
|
74983
|
+
const id4 = /([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})\.jsonl$/.exec(newest);
|
|
74984
|
+
if (!id4?.[1]) throw new CliUsageError("No Codex session found: pass --thread <id>.");
|
|
74985
|
+
return id4[1];
|
|
74896
74986
|
}
|
|
74897
74987
|
function promptOf({ message: message2, self: self2 }) {
|
|
74898
74988
|
return [
|
|
@@ -75299,6 +75389,10 @@ without a recap; the person's DM already shows your messages elsewhere.
|
|
|
75299
75389
|
|
|
75300
75390
|
## The feed
|
|
75301
75391
|
|
|
75392
|
+
A schedule that only polls for changes should not run a turn each time: give it a check with
|
|
75393
|
+
\`laze schedule add|update ... --check <script>\`. The script prints something to wake you with
|
|
75394
|
+
that output, prints nothing to let you sleep, and keeps its own state in a file.
|
|
75395
|
+
|
|
75302
75396
|
When something needs a person to decide or act, post a card in their feed:
|
|
75303
75397
|
\`laze feed post "<title>" --summary "<why>" --action "<label>=<what to do>"\`. Run
|
|
75304
75398
|
\`laze feed post\` with no title for every flag and how to write a card.
|
|
@@ -75314,6 +75408,12 @@ the press brings you the edited text: update the native draft with it first, the
|
|
|
75314
75408
|
A card you post or update while answering is linked under your reply: don't describe where the
|
|
75315
75409
|
card is, say what changed.
|
|
75316
75410
|
|
|
75411
|
+
Labels and priority are optional. \`--label <word>\` adds a topic word people filter by: run
|
|
75412
|
+
\`laze feed labels\` and reuse one first; they show across the workspace, so never a person,
|
|
75413
|
+
customer or deal name. \`--priority high|low|<0 to 100>\` orders the feed under urgent cards:
|
|
75414
|
+
leave it out by default, high is rare. With Manage my feed, \`laze feed rank\` lists your owner's
|
|
75415
|
+
open cards by title and ranks them for them alone.
|
|
75416
|
+
|
|
75317
75417
|
## Apps
|
|
75318
75418
|
|
|
75319
75419
|
Asked for an app (a tracker, a CRM, a dashboard, a page that explains something), read the full
|
|
@@ -76449,8 +76549,8 @@ async function pauseAgent({
|
|
|
76449
76549
|
const agent3 = args.words[2];
|
|
76450
76550
|
if (!agent3) throw new CliUsageError(PAUSE_USAGE);
|
|
76451
76551
|
const { client } = await signedIn({ context, args });
|
|
76452
|
-
const
|
|
76453
|
-
const body = { agent: agent3, paused, ...
|
|
76552
|
+
const reason2 = paused && typeof args.flags.reason === "string" ? args.flags.reason : void 0;
|
|
76553
|
+
const body = { agent: agent3, paused, ...reason2 && { pauseReason: reason2 } };
|
|
76454
76554
|
const updated = await client.post("/api/agents/update", body);
|
|
76455
76555
|
if (args.flags.json) return context.out(`${JSON.stringify(updated, null, 2)}
|
|
76456
76556
|
`);
|
|
@@ -77264,8 +77364,8 @@ async function uploadTranscript({ context, args, client }) {
|
|
|
77264
77364
|
args,
|
|
77265
77365
|
usage: "Usage: laze agent migrate upload <migrationId>"
|
|
77266
77366
|
});
|
|
77267
|
-
const
|
|
77268
|
-
const ticket = await client.get(`/api/agents/me/migrations/${
|
|
77367
|
+
const id4 = encodeURIComponent(migrationId);
|
|
77368
|
+
const ticket = await client.get(`/api/agents/me/migrations/${id4}`);
|
|
77269
77369
|
if (ticket.status === "cancelled") {
|
|
77270
77370
|
throw new CliUsageError("This migration was cancelled; nothing was uploaded.");
|
|
77271
77371
|
}
|
|
@@ -77284,10 +77384,10 @@ async function uploadTranscript({ context, args, client }) {
|
|
|
77284
77384
|
maxParts: Math.min(ticket.partsMax, MIGRATION_PARTS_MAX)
|
|
77285
77385
|
});
|
|
77286
77386
|
const upload = { parts, truncated, redactions: redacted.redactions };
|
|
77287
|
-
await uploadParts({ client, migrationId:
|
|
77387
|
+
await uploadParts({ client, migrationId: id4, upload });
|
|
77288
77388
|
const fileName = basename5(found.path);
|
|
77289
77389
|
const completed = await client.post(
|
|
77290
|
-
`/api/agents/me/migrations/${
|
|
77390
|
+
`/api/agents/me/migrations/${id4}/complete`,
|
|
77291
77391
|
{
|
|
77292
77392
|
parts: parts.length,
|
|
77293
77393
|
sha256: sha256Of({ text: parts.join("") }),
|
|
@@ -77380,13 +77480,13 @@ async function mintedRequestProfile({
|
|
|
77380
77480
|
token: agent3.token,
|
|
77381
77481
|
fetcher: context.fetcher
|
|
77382
77482
|
});
|
|
77383
|
-
const { requestKey } = await client.post(
|
|
77483
|
+
const { requestKey: requestKey2 } = await client.post(
|
|
77384
77484
|
"/api/agents/me/request-key",
|
|
77385
77485
|
{}
|
|
77386
77486
|
);
|
|
77387
77487
|
const profile = {
|
|
77388
77488
|
url: agent3.url,
|
|
77389
|
-
token:
|
|
77489
|
+
token: requestKey2,
|
|
77390
77490
|
workspaceId: agent3.workspaceId,
|
|
77391
77491
|
kind: "request",
|
|
77392
77492
|
name: agent3.name
|
|
@@ -77836,7 +77936,7 @@ var createAppInputSchemaDefinition = external_exports.object({
|
|
|
77836
77936
|
/** Defaults to the name in lower case words. */
|
|
77837
77937
|
slug: appSlugSchema.optional(),
|
|
77838
77938
|
channelId: external_exports.string().min(1).optional(),
|
|
77839
|
-
/** Restricted unless chosen: owner,
|
|
77939
|
+
/** Restricted unless chosen: its owner, shares and the conversations it is pinned to. */
|
|
77840
77940
|
visibility: appVisibilitySchema.default("restricted"),
|
|
77841
77941
|
/** The agent a person hands the new app to, which becomes its creator and a Builder. */
|
|
77842
77942
|
creatorAgentId: external_exports.string().min(1).optional(),
|
|
@@ -78414,6 +78514,35 @@ var visibilityOutcomeSchemaDefinition = external_exports.object({
|
|
|
78414
78514
|
});
|
|
78415
78515
|
var visibilityOutcomeSchema = visibilityOutcomeSchemaDefinition;
|
|
78416
78516
|
|
|
78517
|
+
// ../../modules/app/contract/src/app.admin.ts
|
|
78518
|
+
var workspaceAppSchemaDefinition = external_exports.object({
|
|
78519
|
+
id: external_exports.string().min(1),
|
|
78520
|
+
name: external_exports.string(),
|
|
78521
|
+
slug: external_exports.string(),
|
|
78522
|
+
owner: appActorSchema,
|
|
78523
|
+
/** The person the app belongs to, else the agent that built it; null when neither is known. */
|
|
78524
|
+
ownerName: external_exports.string().nullable(),
|
|
78525
|
+
/** The person the app belongs to left the workspace, or no person stands behind its agent. */
|
|
78526
|
+
ownerLeft: external_exports.boolean(),
|
|
78527
|
+
visibility: appVisibilitySchema,
|
|
78528
|
+
live: external_exports.boolean(),
|
|
78529
|
+
archived: external_exports.boolean(),
|
|
78530
|
+
/** Bytes the app stores on the host; null when the host did not answer. */
|
|
78531
|
+
bytes: external_exports.number().int().nonnegative().nullable()
|
|
78532
|
+
});
|
|
78533
|
+
var workspaceAppSchema = workspaceAppSchemaDefinition;
|
|
78534
|
+
var listWorkspaceAppsInputSchemaDefinition = external_exports.object({ workspaceId: external_exports.string().min(1) });
|
|
78535
|
+
var listWorkspaceAppsInputSchema = listWorkspaceAppsInputSchemaDefinition;
|
|
78536
|
+
var setAppOwnerInputSchemaDefinition = external_exports.object({
|
|
78537
|
+
workspaceId: external_exports.string().min(1),
|
|
78538
|
+
appId: external_exports.string().min(1),
|
|
78539
|
+
ownerUserId: external_exports.string().min(1)
|
|
78540
|
+
});
|
|
78541
|
+
var setAppOwnerInputSchema = setAppOwnerInputSchemaDefinition;
|
|
78542
|
+
var setAppOwnerByKeyInputSchemaDefinition = setAppOwnerInputSchemaDefinition.omit({
|
|
78543
|
+
workspaceId: true
|
|
78544
|
+
});
|
|
78545
|
+
|
|
78417
78546
|
// ../../modules/app/contract/src/app.users.ts
|
|
78418
78547
|
var appUserSchemaDefinition = external_exports.object({
|
|
78419
78548
|
id: external_exports.string().min(1),
|
|
@@ -78614,7 +78743,7 @@ var appCostSchemaDefinition = external_exports.object({
|
|
|
78614
78743
|
/** The last 30 days, oldest first, with every day present. */
|
|
78615
78744
|
days: external_exports.array(appCostDaySchemaDefinition),
|
|
78616
78745
|
budget: appBudgetSchemaDefinition,
|
|
78617
|
-
/** Whether the caller may set the budget: the app's Builders
|
|
78746
|
+
/** Whether the caller may set the budget: the app's Builders. */
|
|
78618
78747
|
canSetBudget: external_exports.boolean(),
|
|
78619
78748
|
/** What the app uses against its limits; null when the apps host did not answer. */
|
|
78620
78749
|
quota: appQuotaSchema.nullable().default(null)
|
|
@@ -79038,7 +79167,7 @@ var appsCopy = {
|
|
|
79038
79167
|
var appMainTrpc = defineTrpcContract("app").query("list", { mirrored: appsCopy }).withInput(listAppsInputSchema).withOutput(external_exports.array(appSchema)).query("get").withInput(appRefSchema).withOutput(appSchema).mutation("create").withInput(createAppInputSchema).withOutput(appSchema).mutation("rename").withInput(renameAppInputSchema).withOutput(appSchema).mutation("archive").withInput(appRefSchema).withOutput(appSchema).mutation("unarchive").withInput(appRefSchema).withOutput(appSchema).mutation("delete").withInput(deleteAppInputSchema).withOutput(external_exports.object({ deleted: external_exports.literal(true) })).query("versions").withInput(appRefSchema).withOutput(external_exports.array(appVersionSchema)).mutation("revert").withInput(revertInputSchema).withOutput(appPushSchema).mutation("publish").withInput(publishInputSchema).withOutput(publishOutcomeSchema).query("collections").withInput(appDataRefSchema).withOutput(external_exports.array(collectionSchema)).query("records").withInput(listRecordsInputSchema).withOutput(recordPageSchema).mutation("writeRecord").withInput(writeRecordInputSchema).withOutput(appRecordSchema).mutation("deleteRecord").withInput(deleteRecordInputSchema).withOutput(external_exports.object({ deleted: external_exports.literal(true) })).query("views").withInput(appDataRefSchema).withOutput(external_exports.array(appViewSchema)).mutation("saveView").withInput(saveViewInputSchema).withOutput(appViewSchema).mutation("deleteView").withInput(deleteViewInputSchema).withOutput(external_exports.object({ deleted: external_exports.literal(true) })).mutation("chooseCardRows").withInput(chooseCardRowsInputSchema).withOutput(appCardChoiceSchema).query("exportRecords").withInput(exportRecordsInputSchema).withOutput(recordExportSchema).mutation("importRecords").withInput(importRecordsInputSchema).withOutput(recordImportSchema).mutation("decidePublish").withInput(decidePublishInputSchema).withOutput(publishOutcomeSchema).mutation("nameVersion").withInput(nameVersionInputSchema).withOutput(appVersionSchema).mutation("makeInternal").withInput(appRefSchema).withOutput(appSchema).mutation("revokePublishLease").withInput(appRefSchema).withOutput(appSchema).mutation("signInHandoff").withInput(signInHandoffInputSchema).withOutput(signInHandoffSchema).query("functionLogs").withInput(listFunctionLogsInputSchema).withOutput(external_exports.array(appFunctionLogEntrySchema)).query("access").withInput(appRefSchema).withOutput(appAccessSchema).query("members").withInput(appRefSchema).withOutput(appMembersSchema).mutation("grantAccess").withInput(grantAppAccessInputSchema).withOutput(appAccessSchema).mutation("revokeAccess").withInput(revokeAppAccessInputSchema).withOutput(appAccessSchema).mutation("setVisibility").withInput(setAppVisibilityInputSchema).withOutput(visibilityOutcomeSchema).mutation("setMemberRole").withInput(setMemberRoleInputSchema).withOutput(appAccessSchema).mutation("unpublish").withInput(appRefSchema).withOutput(appSchema).query("door").withInput(appRefSchema).withOutput(appDoorSchema).mutation("requestAccess").withInput(appRefSchema).withOutput(appDoorSchema).mutation("decideAccess").withInput(decideAppAccessInputSchema).withOutput(appAccessRequestSchema).query("users").withInput(appRefSchema).withOutput(appUsersSchema).mutation("blockUser").withInput(blockAppUserInputSchema).withOutput(appUsersSchema).mutation("deleteUser").withInput(deleteAppUserInputSchema).withOutput(deletedAppUserSchema).query("backups").withInput(appRefSchema).withOutput(appBackupStatusSchema).mutation("restoreData").withInput(restoreAppDataInputSchema).withOutput(appRestoreSchema).query("cost").withInput(appRefSchema).withOutput(appCostSchema).mutation("setBudget").withInput(setAppBudgetInputSchema).withOutput(appCostSchema).query("triggers").withInput(appRefSchema).withOutput(appTriggersSchema).mutation("setTriggerPaused").withInput(setAppTriggerPausedInputSchema).withOutput(appTriggerSchema).mutation("removeTrigger").withInput(appTriggerRefSchema).withOutput(external_exports.object({ removed: external_exports.literal(true) })).build();
|
|
79039
79168
|
var appConnectionsTrpc = defineTrpcContract("app").query("connections").withInput(appRefSchema).withOutput(appConnectionsSchema).mutation("allowConnection").withInput(appConnectionRefSchema).withOutput(appConnectionsSchema).mutation("revokeConnection").withInput(appConnectionRefSchema).withOutput(appConnectionsSchema).build();
|
|
79040
79169
|
var appPinsTrpc = defineTrpcContract("app").query("pins").withInput(channelPinsInputSchema).withOutput(channelAppPinsSchema).mutation("pin").withInput(pinAppInputSchema).withOutput(channelAppPinsSchema).mutation("unpin").withInput(pinAppInputSchema).withOutput(channelAppPinsSchema).mutation("setPinView").withInput(setPinViewInputSchema).withOutput(channelAppPinsSchema).mutation("reorderPins").withInput(reorderPinsInputSchema).withOutput(channelAppPinsSchema).mutation("setPinRole").withInput(setPinRoleInputSchema).withOutput(appAccessSchema).build();
|
|
79041
|
-
var appSettingsTrpc = defineTrpcContract("app").query("workspaceSettings").withInput(appWorkspaceRefSchema).withOutput(appWorkspaceSettingsSchema).query("functionSettings").withInput(appWorkspaceRefSchema).withOutput(appFunctionSettingsSchema).mutation("setFunctionsEnabled").withInput(setFunctionsEnabledInputSchema).withOutput(appFunctionSettingsSchema).mutation("setPublicAppsAllowed").withInput(setPublicAppsAllowedInputSchema).withOutput(appFunctionSettingsSchema).query("templates").withInput(appWorkspaceRefSchema).withOutput(external_exports.array(appTemplateSchema)).build();
|
|
79170
|
+
var appSettingsTrpc = defineTrpcContract("app").query("workspaceSettings").withInput(appWorkspaceRefSchema).withOutput(appWorkspaceSettingsSchema).query("functionSettings").withInput(appWorkspaceRefSchema).withOutput(appFunctionSettingsSchema).mutation("setFunctionsEnabled").withInput(setFunctionsEnabledInputSchema).withOutput(appFunctionSettingsSchema).mutation("setPublicAppsAllowed").withInput(setPublicAppsAllowedInputSchema).withOutput(appFunctionSettingsSchema).query("workspaceApps").withInput(listWorkspaceAppsInputSchema).withOutput(external_exports.array(workspaceAppSchema)).mutation("setOwner").withInput(setAppOwnerInputSchema).withOutput(workspaceAppSchema).mutation("unpublishAsAdmin").withInput(appRefSchema).withOutput(external_exports.object({ unpublished: external_exports.literal(true) })).query("templates").withInput(appWorkspaceRefSchema).withOutput(external_exports.array(appTemplateSchema)).build();
|
|
79042
79171
|
var appTrpc = joinTrpcContracts(
|
|
79043
79172
|
"app",
|
|
79044
79173
|
appMainTrpc,
|
|
@@ -79352,6 +79481,24 @@ var appCliCommands = [
|
|
|
79352
79481
|
arguments: ["[app]", "--confirm <the app's name>"],
|
|
79353
79482
|
summary: "Delete the app: it stops serving at once (owner or admin)"
|
|
79354
79483
|
},
|
|
79484
|
+
{
|
|
79485
|
+
command: "laze app admin-list",
|
|
79486
|
+
operation: "listWorkspaceApps",
|
|
79487
|
+
arguments: [],
|
|
79488
|
+
summary: "Every app in the workspace with its owner, sharing and size, and no content (admins, a person's key)"
|
|
79489
|
+
},
|
|
79490
|
+
{
|
|
79491
|
+
command: "laze app set-owner",
|
|
79492
|
+
operation: "setAppOwner",
|
|
79493
|
+
arguments: ["<app id>", "<person>"],
|
|
79494
|
+
summary: "Give an app a new owner; the old owner keeps access (admins, a person's key)"
|
|
79495
|
+
},
|
|
79496
|
+
{
|
|
79497
|
+
command: "laze app admin-unpublish",
|
|
79498
|
+
operation: "unpublishAsAdmin",
|
|
79499
|
+
arguments: ["<app id>"],
|
|
79500
|
+
summary: "Take an app offline without opening it (admins, a person's key)"
|
|
79501
|
+
},
|
|
79355
79502
|
{
|
|
79356
79503
|
command: "laze app revoke-lease",
|
|
79357
79504
|
operation: "revokePublishLease",
|
|
@@ -79708,6 +79855,39 @@ var revokeLease = async ({ context, args, open: open5 }) => {
|
|
|
79708
79855
|
`;
|
|
79709
79856
|
print2({ context, args, value: app2, text: text3 });
|
|
79710
79857
|
};
|
|
79858
|
+
function workspaceAppLine(app2) {
|
|
79859
|
+
const size = app2.bytes === null ? "size unknown" : `${app2.bytes} bytes`;
|
|
79860
|
+
const left = app2.ownerLeft ? " (owner left)" : "";
|
|
79861
|
+
const state = [app2.live ? "live" : "offline", ...app2.archived ? ["archived"] : []].join(", ");
|
|
79862
|
+
return `${app2.id} ${app2.name} ${app2.ownerName ?? "no owner"}${left} ${app2.visibility} ${state} ${size}
|
|
79863
|
+
`;
|
|
79864
|
+
}
|
|
79865
|
+
var adminList = async ({ context, args, signed: signed2 }) => {
|
|
79866
|
+
const client = await signed2();
|
|
79867
|
+
const apps = await client.post("/api/apps/admin/list", {});
|
|
79868
|
+
const text3 = apps.length > 0 ? apps.map(workspaceAppLine).join("") : "No apps yet.\n";
|
|
79869
|
+
print2({ context, args, value: apps, text: text3 });
|
|
79870
|
+
};
|
|
79871
|
+
var setOwner = async ({ context, args, signed: signed2 }) => {
|
|
79872
|
+
const [appId, ownerUserId] = args.words.slice(2);
|
|
79873
|
+
if (!appId || !ownerUserId) {
|
|
79874
|
+
throw new CliUsageError("Usage: laze app set-owner <app id> <person id>");
|
|
79875
|
+
}
|
|
79876
|
+
const client = await signed2();
|
|
79877
|
+
const app2 = await client.post("/api/apps/admin/owner", { appId, ownerUserId });
|
|
79878
|
+
const text3 = `${app2.name} now belongs to ${app2.ownerName ?? ownerUserId}. The old owner keeps access and is told.
|
|
79879
|
+
`;
|
|
79880
|
+
print2({ context, args, value: app2, text: text3 });
|
|
79881
|
+
};
|
|
79882
|
+
var adminUnpublish = async ({ context, args, signed: signed2 }) => {
|
|
79883
|
+
const appId = args.words[2];
|
|
79884
|
+
if (!appId) throw new CliUsageError("Usage: laze app admin-unpublish <app id>");
|
|
79885
|
+
const client = await signed2();
|
|
79886
|
+
await client.post("/api/apps/admin/unpublish", { appId });
|
|
79887
|
+
const text3 = `${appId} is offline. Its data and versions stay.
|
|
79888
|
+
`;
|
|
79889
|
+
print2({ context, args, value: { unpublished: appId }, text: text3 });
|
|
79890
|
+
};
|
|
79711
79891
|
var publicApps = async ({ context, args, signed: signed2 }) => {
|
|
79712
79892
|
const word3 = args.words[2];
|
|
79713
79893
|
if (word3 !== void 0 && word3 !== "on" && word3 !== "off") {
|
|
@@ -79799,6 +79979,9 @@ var appManageCommands = {
|
|
|
79799
79979
|
unarchive,
|
|
79800
79980
|
delete: remove,
|
|
79801
79981
|
"revoke-lease": revokeLease,
|
|
79982
|
+
"admin-list": adminList,
|
|
79983
|
+
"set-owner": setOwner,
|
|
79984
|
+
"admin-unpublish": adminUnpublish,
|
|
79802
79985
|
"public-apps": publicApps,
|
|
79803
79986
|
backups,
|
|
79804
79987
|
restore,
|
|
@@ -79890,7 +80073,7 @@ async function appPinsCommand({
|
|
|
79890
80073
|
if (!channel) throw new CliUsageError(USAGE3);
|
|
79891
80074
|
const client = await signed2();
|
|
79892
80075
|
const order = flagText({ args, name: "order" });
|
|
79893
|
-
const appIds = order.split(",").map((
|
|
80076
|
+
const appIds = order.split(",").map((id4) => id4.trim()).filter(Boolean);
|
|
79894
80077
|
const listed = appIds.length ? await client.post("/api/apps/pins/order", { channel, appIds }) : await client.post("/api/apps/pins", { channel });
|
|
79895
80078
|
print3({ context, args, value: listed, text: pinsText({ channel, listed }) });
|
|
79896
80079
|
}
|
|
@@ -81051,11 +81234,11 @@ function isSubjectType(type) {
|
|
|
81051
81234
|
}
|
|
81052
81235
|
function subjectOf(word3) {
|
|
81053
81236
|
const [type, ...rest] = (word3 ?? "").split(":");
|
|
81054
|
-
const
|
|
81055
|
-
if (!isSubjectType(type) || !
|
|
81237
|
+
const id4 = rest.join(":");
|
|
81238
|
+
if (!isSubjectType(type) || !id4) {
|
|
81056
81239
|
throw new CliUsageError("Name who with user:<id>, agent:<id>, channel:<id> or group:<id>");
|
|
81057
81240
|
}
|
|
81058
|
-
return { type, id:
|
|
81241
|
+
return { type, id: id4 };
|
|
81059
81242
|
}
|
|
81060
81243
|
function agentPathText(path) {
|
|
81061
81244
|
if (!path) return "you cannot open the app yourself, so you cannot let it in";
|
|
@@ -81362,6 +81545,9 @@ var APP_COMMANDS = {
|
|
|
81362
81545
|
unarchive: managed(appManageCommands.unarchive),
|
|
81363
81546
|
delete: managed(appManageCommands.delete),
|
|
81364
81547
|
"revoke-lease": managed(appManageCommands["revoke-lease"]),
|
|
81548
|
+
"admin-list": managed(appManageCommands["admin-list"]),
|
|
81549
|
+
"set-owner": managed(appManageCommands["set-owner"]),
|
|
81550
|
+
"admin-unpublish": managed(appManageCommands["admin-unpublish"]),
|
|
81365
81551
|
"public-apps": managed(appManageCommands["public-apps"]),
|
|
81366
81552
|
backups: managed(appManageCommands.backups),
|
|
81367
81553
|
restore: managed(appManageCommands.restore),
|
|
@@ -82077,13 +82263,13 @@ async function vaultRelease({
|
|
|
82077
82263
|
context,
|
|
82078
82264
|
args,
|
|
82079
82265
|
connection,
|
|
82080
|
-
reason,
|
|
82266
|
+
reason: reason2,
|
|
82081
82267
|
command
|
|
82082
82268
|
}) {
|
|
82083
82269
|
const deadline = deadlineOf({ args, nowMs: context.nowMs() });
|
|
82084
82270
|
const env = context.environment.inherited;
|
|
82085
82271
|
const proxy = proxyOf({ env });
|
|
82086
|
-
if (!proxy) return keyRelease({ context, args, connection, reason, command, deadline });
|
|
82272
|
+
if (!proxy) return keyRelease({ context, args, connection, reason: reason2, command, deadline });
|
|
82087
82273
|
const turnFile = turnFileOf({ env });
|
|
82088
82274
|
const headers = {
|
|
82089
82275
|
"proxy-authorization": proxy.authorization,
|
|
@@ -82091,7 +82277,7 @@ async function vaultRelease({
|
|
|
82091
82277
|
};
|
|
82092
82278
|
const keyPath = runKeyPathOf({ turnFile, connection });
|
|
82093
82279
|
const run4 = await runKeyAt({ path: keyPath });
|
|
82094
|
-
const body = JSON.stringify({ connection, reason, command, recipient: run4.publicKey });
|
|
82280
|
+
const body = JSON.stringify({ connection, reason: reason2, command, recipient: run4.publicKey });
|
|
82095
82281
|
let release2;
|
|
82096
82282
|
try {
|
|
82097
82283
|
const first = await releaseOf({
|
|
@@ -82164,7 +82350,7 @@ async function keyRelease({
|
|
|
82164
82350
|
context,
|
|
82165
82351
|
args,
|
|
82166
82352
|
connection,
|
|
82167
|
-
reason,
|
|
82353
|
+
reason: reason2,
|
|
82168
82354
|
command,
|
|
82169
82355
|
deadline
|
|
82170
82356
|
}) {
|
|
@@ -82177,7 +82363,7 @@ async function keyRelease({
|
|
|
82177
82363
|
const client = forSession({ client: signed2.client, session: harnessSession });
|
|
82178
82364
|
const keyPath = runKeyPathOf({ turnFile: void 0, connection, profile: name3 });
|
|
82179
82365
|
const run4 = await runKeyAt({ path: keyPath });
|
|
82180
|
-
const body = { connection, reason, command, recipient: run4.publicKey };
|
|
82366
|
+
const body = { connection, reason: reason2, command, recipient: run4.publicKey };
|
|
82181
82367
|
const door = signed2.profile.kind === "person" ? {
|
|
82182
82368
|
ask: "/api/vault/session/release",
|
|
82183
82369
|
status: "/api/vault/session/release-status",
|
|
@@ -82197,9 +82383,9 @@ async function vaultRun({
|
|
|
82197
82383
|
args
|
|
82198
82384
|
}) {
|
|
82199
82385
|
const connection = args.words[2];
|
|
82200
|
-
const
|
|
82386
|
+
const reason2 = flagText({ args, name: "reason" });
|
|
82201
82387
|
if (!connection || args.rest.length === 0) throw new CliUsageError(USAGE6);
|
|
82202
|
-
if (!
|
|
82388
|
+
if (!reason2) throw new CliUsageError(`Say why with --reason "<one plain sentence>"
|
|
82203
82389
|
${USAGE6}`);
|
|
82204
82390
|
const foreign = commandReferenceNames({ command: args.rest }).find(
|
|
82205
82391
|
(name3) => vaultReferenceConnectionName({ name: name3 }) !== connection
|
|
@@ -82212,7 +82398,7 @@ ${USAGE6}`);
|
|
|
82212
82398
|
);
|
|
82213
82399
|
return 1;
|
|
82214
82400
|
}
|
|
82215
|
-
const released = await vaultRelease({ context, args, connection, reason, command: args.rest });
|
|
82401
|
+
const released = await vaultRelease({ context, args, connection, reason: reason2, command: args.rest });
|
|
82216
82402
|
if ("exitCode" in released) return released.exitCode;
|
|
82217
82403
|
const prepared = preparedCommand({
|
|
82218
82404
|
command: args.rest,
|
|
@@ -82402,12 +82588,12 @@ async function loginOnTab(run4) {
|
|
|
82402
82588
|
`Name the saved sign-in with --vault <connection>
|
|
82403
82589
|
${BROWSER_TAB_USAGE}`
|
|
82404
82590
|
);
|
|
82405
|
-
const
|
|
82591
|
+
const reason2 = flagText({ args, name: "reason" }) || `Sign in on the ${tab} browser tab of the conversation`;
|
|
82406
82592
|
const released = await vaultRelease({
|
|
82407
82593
|
context,
|
|
82408
82594
|
args,
|
|
82409
82595
|
connection,
|
|
82410
|
-
reason,
|
|
82596
|
+
reason: reason2,
|
|
82411
82597
|
command: ["laze", "browser", "login", tab]
|
|
82412
82598
|
});
|
|
82413
82599
|
if ("exitCode" in released) return released.exitCode;
|
|
@@ -82662,8 +82848,8 @@ async function browserCall({
|
|
|
82662
82848
|
});
|
|
82663
82849
|
socket.once(
|
|
82664
82850
|
"close",
|
|
82665
|
-
(_code,
|
|
82666
|
-
new Error(`${method}: ${
|
|
82851
|
+
(_code, reason2) => reject(
|
|
82852
|
+
new Error(`${method}: ${reason2.toString("utf8") || "the machine closed the socket"}`)
|
|
82667
82853
|
)
|
|
82668
82854
|
);
|
|
82669
82855
|
socket.send(JSON.stringify({ id: 1, method, params }));
|
|
@@ -84538,7 +84724,7 @@ var billingConfig = Config.define((c) => ({
|
|
|
84538
84724
|
earlierTeamPriceIds: c.env(
|
|
84539
84725
|
"STRIPE_PRICES_TEAM_EARLIER",
|
|
84540
84726
|
external_exports.string().optional().transform(
|
|
84541
|
-
(value) => (value ?? "").split(",").map((
|
|
84727
|
+
(value) => (value ?? "").split(",").map((id4) => id4.trim()).filter(Boolean)
|
|
84542
84728
|
)
|
|
84543
84729
|
),
|
|
84544
84730
|
/** The product every top-up and auto-recharge line names; a bare line without it. */
|
|
@@ -85167,6 +85353,7 @@ var complimentaryComputerDefinition = external_exports.object({
|
|
|
85167
85353
|
grantedByUserId: external_exports.string(),
|
|
85168
85354
|
grantedAt: external_exports.iso.datetime()
|
|
85169
85355
|
});
|
|
85356
|
+
var complimentaryComputerSchema = complimentaryComputerDefinition;
|
|
85170
85357
|
var setComplimentaryComputerInputDefinition = external_exports.object({
|
|
85171
85358
|
workspaceId: external_exports.string().min(1),
|
|
85172
85359
|
userId: external_exports.string().min(1),
|
|
@@ -85561,10 +85748,46 @@ var whatsappPairingDefinition = external_exports.object({
|
|
|
85561
85748
|
state: external_exports.enum(["starting", "scan", "paired", "failed"]),
|
|
85562
85749
|
/** The code as an SVG data URL, while `state` is `scan`. */
|
|
85563
85750
|
qrSvg: external_exports.string().nullable(),
|
|
85751
|
+
/** The code to type on the phone, when the pairing named a phone number. */
|
|
85752
|
+
phoneCode: external_exports.string().nullable().default(null),
|
|
85564
85753
|
/** "Mia (+31 6 1234 5678)" once paired. */
|
|
85565
85754
|
linkedAs: external_exports.string().nullable(),
|
|
85566
85755
|
error: external_exports.string().nullable()
|
|
85567
85756
|
});
|
|
85757
|
+
var pairInputDefinition = external_exports.object({
|
|
85758
|
+
workspaceId: workspaceIdSchema20,
|
|
85759
|
+
machine: machineRefText2,
|
|
85760
|
+
/** The person's number with country code; absent, only a QR code is made. */
|
|
85761
|
+
phone: external_exports.string().trim().min(7).max(24).regex(/^\+?[0-9 ()-]+$/).optional()
|
|
85762
|
+
});
|
|
85763
|
+
var whatsappPairInputSchema = pairInputDefinition;
|
|
85764
|
+
var whatsappOnlineModeSchema = external_exports.enum(["never", "active"]);
|
|
85765
|
+
var mirrorSettingsDefinition = external_exports.object({
|
|
85766
|
+
machineId: external_exports.string(),
|
|
85767
|
+
mirrorOn: external_exports.boolean(),
|
|
85768
|
+
onlineMode: whatsappOnlineModeSchema,
|
|
85769
|
+
agentsRead: external_exports.boolean()
|
|
85770
|
+
});
|
|
85771
|
+
var whatsappMirrorSettingsSchema = mirrorSettingsDefinition;
|
|
85772
|
+
var setMirrorSettingsDefinition = external_exports.object({
|
|
85773
|
+
workspaceId: workspaceIdSchema20,
|
|
85774
|
+
machine: machineRefText2,
|
|
85775
|
+
mirrorOn: external_exports.boolean().optional(),
|
|
85776
|
+
onlineMode: whatsappOnlineModeSchema.optional(),
|
|
85777
|
+
agentsRead: external_exports.boolean().optional()
|
|
85778
|
+
});
|
|
85779
|
+
var setWhatsappMirrorInputSchema = setMirrorSettingsDefinition;
|
|
85780
|
+
var whatsappChangeDefinition = external_exports.object({
|
|
85781
|
+
chat: external_exports.string().min(1).max(200),
|
|
85782
|
+
chatName: external_exports.string().max(500),
|
|
85783
|
+
group: external_exports.boolean(),
|
|
85784
|
+
id: external_exports.string().min(1).max(200),
|
|
85785
|
+
at: external_exports.string(),
|
|
85786
|
+
fromMe: external_exports.boolean(),
|
|
85787
|
+
sender: external_exports.string().max(500),
|
|
85788
|
+
text: external_exports.string(),
|
|
85789
|
+
deleted: external_exports.boolean()
|
|
85790
|
+
});
|
|
85568
85791
|
var whatsappPairingSchema = whatsappPairingDefinition;
|
|
85569
85792
|
var pairingRefDefinition = external_exports.object({
|
|
85570
85793
|
workspaceId: workspaceIdSchema20,
|
|
@@ -85894,7 +86117,7 @@ var ownMachineSshConnectDefinition = external_exports.object({
|
|
|
85894
86117
|
var ownMachineSshConnectSchema = ownMachineSshConnectDefinition;
|
|
85895
86118
|
var reconcileDefinition = external_exports.object({ workspaceId: workspaceIdSchema22, machineId: idSchema23 });
|
|
85896
86119
|
var ComputeApi = moduleApi()("compute");
|
|
85897
|
-
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(
|
|
86120
|
+
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(whatsappPairInputSchema).withOutput(whatsappPairingSchema).query("whatsappMirror").withInput(machineRefSchema).withOutput(whatsappMirrorSettingsSchema).mutation("setWhatsappMirror").withInput(setWhatsappMirrorInputSchema).withOutput(whatsappMirrorSettingsSchema).query("whatsappPairing").withInput(whatsappPairingRefSchema).withOutput(whatsappPairingSchema).mutation("cancelWhatsappPairing").withInput(whatsappPairingRefSchema).withOutput(whatsappPairingSchema).mutation("unpairWhatsapp").withInput(machineRefSchema).withOutput(machineSchema).build();
|
|
85898
86121
|
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();
|
|
85899
86122
|
var computeTrpc = joinTrpcContracts("compute", computeCoreTrpc, computeFleetTrpc);
|
|
85900
86123
|
var restMachineInputDefinition = external_exports.object({ machine: external_exports.string().min(1).max(64) });
|
|
@@ -86545,8 +86768,8 @@ async function recheckTools({ relay: relay2, listed }) {
|
|
|
86545
86768
|
listed.busy = true;
|
|
86546
86769
|
try {
|
|
86547
86770
|
listed.asked += 1;
|
|
86548
|
-
const
|
|
86549
|
-
const line = JSON.stringify({ jsonrpc: "2.0", id:
|
|
86771
|
+
const id4 = `laze-relist-${listed.asked}`;
|
|
86772
|
+
const line = JSON.stringify({ jsonrpc: "2.0", id: id4, method: "tools/list" });
|
|
86550
86773
|
const names = toolNamesOf(await relay2.post({ line, turn }));
|
|
86551
86774
|
listed.turn = turn;
|
|
86552
86775
|
if (names !== null && names !== listed.names) {
|
|
@@ -86619,8 +86842,8 @@ async function connect({
|
|
|
86619
86842
|
`);
|
|
86620
86843
|
return;
|
|
86621
86844
|
}
|
|
86622
|
-
const
|
|
86623
|
-
if (!service || !
|
|
86845
|
+
const reason2 = flagText({ args, name: "reason" }).trim();
|
|
86846
|
+
if (!service || !reason2) {
|
|
86624
86847
|
throw new CliUsageError(
|
|
86625
86848
|
'Usage: laze connect suggest <service> --reason "<one plain sentence>"'
|
|
86626
86849
|
);
|
|
@@ -86631,7 +86854,7 @@ async function connect({
|
|
|
86631
86854
|
}
|
|
86632
86855
|
const answer6 = await turned.post("/api/connectors/suggest", {
|
|
86633
86856
|
service,
|
|
86634
|
-
reason,
|
|
86857
|
+
reason: reason2,
|
|
86635
86858
|
keychain: keychain2
|
|
86636
86859
|
});
|
|
86637
86860
|
if (args.flags.json) return context.out(`${JSON.stringify(answer6, null, 2)}
|
|
@@ -86723,15 +86946,15 @@ function printGrant({ context, grant }) {
|
|
|
86723
86946
|
var grantTo = async ({ context, args }) => {
|
|
86724
86947
|
const [kind2 = "", ...rest] = flagText({ args, name: "to" }).split(":");
|
|
86725
86948
|
const subject = SUBJECTS.find((one) => one === kind2);
|
|
86726
|
-
const
|
|
86727
|
-
if (!subject || !
|
|
86949
|
+
const id4 = rest.join(":");
|
|
86950
|
+
if (!subject || !id4) {
|
|
86728
86951
|
throw new CliUsageError("--to is person:<id>, group:<id>, channel:<id> or agent:<id>.");
|
|
86729
86952
|
}
|
|
86730
86953
|
const { client } = await signedIn({ context, args });
|
|
86731
86954
|
const target = await connectionOf({ client, args, word: args.words[2] });
|
|
86732
86955
|
const grant = await client.post("/api/vault/grants", {
|
|
86733
86956
|
connectionId: target.id,
|
|
86734
|
-
subject: { kind: subject, id:
|
|
86957
|
+
subject: { kind: subject, id: id4 },
|
|
86735
86958
|
...durationOf(args)
|
|
86736
86959
|
});
|
|
86737
86960
|
if (args.flags.json) return printJson4({ context, data: grant });
|
|
@@ -88208,8 +88431,8 @@ var DOMAINS_USAGE = `Usage:
|
|
|
88208
88431
|
var printJson5 = (context, data) => context.out(`${JSON.stringify(data, null, 2)}
|
|
88209
88432
|
`);
|
|
88210
88433
|
function printDomain(context, row) {
|
|
88211
|
-
const
|
|
88212
|
-
context.out(`${row.domain} ${
|
|
88434
|
+
const join32 = row.autoJoin ? "auto-join on" : "auto-join off";
|
|
88435
|
+
context.out(`${row.domain} ${join32}${row.enforced ? " single sign-on enforced" : ""}
|
|
88213
88436
|
`);
|
|
88214
88437
|
}
|
|
88215
88438
|
async function list4({ context, args }) {
|
|
@@ -89412,6 +89635,52 @@ var feedPinByKeyInputSchemaDefinition = external_exports.object({
|
|
|
89412
89635
|
pinned: external_exports.boolean()
|
|
89413
89636
|
});
|
|
89414
89637
|
|
|
89638
|
+
// ../../modules/feed/contract/src/feed.priority.ts
|
|
89639
|
+
var FEED_PRIORITY = { low: 25, normal: 50, high: 75 };
|
|
89640
|
+
var FEED_PRIORITY_MAX = 100;
|
|
89641
|
+
var FEED_RANK_MAX = 200;
|
|
89642
|
+
var feedPrioritySchemaDefinition = external_exports.union([
|
|
89643
|
+
external_exports.enum(["low", "normal", "high"]).transform((word3) => FEED_PRIORITY[word3]),
|
|
89644
|
+
external_exports.number().int().min(0).max(FEED_PRIORITY_MAX)
|
|
89645
|
+
]);
|
|
89646
|
+
var feedPrioritySchema = feedPrioritySchemaDefinition;
|
|
89647
|
+
function feedPriorityWordOf(priority) {
|
|
89648
|
+
if (priority > FEED_PRIORITY.normal) return "high";
|
|
89649
|
+
return priority < FEED_PRIORITY.normal ? "low" : "normal";
|
|
89650
|
+
}
|
|
89651
|
+
var feedRankEntrySchemaDefinition = external_exports.object({
|
|
89652
|
+
itemId: external_exports.string().min(1),
|
|
89653
|
+
/** Null goes back to the card's own priority. */
|
|
89654
|
+
priority: feedPrioritySchema.nullable()
|
|
89655
|
+
});
|
|
89656
|
+
var feedRankByKeyInputSchemaDefinition = external_exports.object({
|
|
89657
|
+
ranks: external_exports.array(feedRankEntrySchemaDefinition).min(1).max(FEED_RANK_MAX)
|
|
89658
|
+
});
|
|
89659
|
+
var feedRankAnswerSchemaDefinition = external_exports.object({
|
|
89660
|
+
ranked: external_exports.array(external_exports.string()),
|
|
89661
|
+
refused: external_exports.array(external_exports.object({ itemId: external_exports.string(), reason: external_exports.enum(["not_found", "approval"]) }))
|
|
89662
|
+
});
|
|
89663
|
+
var feedRankCardSchemaDefinition = external_exports.object({
|
|
89664
|
+
id: external_exports.string(),
|
|
89665
|
+
title: external_exports.string(),
|
|
89666
|
+
tag: external_exports.string(),
|
|
89667
|
+
labels: external_exports.array(external_exports.string()),
|
|
89668
|
+
author: external_exports.string(),
|
|
89669
|
+
urgent: external_exports.boolean(),
|
|
89670
|
+
pinned: external_exports.boolean(),
|
|
89671
|
+
/** What the person reads now, 50 for normal. */
|
|
89672
|
+
priority: external_exports.number().int(),
|
|
89673
|
+
/** The person's own rank holds, not the card's priority. */
|
|
89674
|
+
ranked: external_exports.boolean(),
|
|
89675
|
+
sortAt: external_exports.iso.datetime()
|
|
89676
|
+
});
|
|
89677
|
+
var feedRankViewSchemaDefinition = external_exports.object({
|
|
89678
|
+
cards: external_exports.array(feedRankCardSchemaDefinition),
|
|
89679
|
+
/** Every open card that can be ranked; `cards` stops at FEED_RANK_MAX. */
|
|
89680
|
+
total: external_exports.number().int().nonnegative()
|
|
89681
|
+
});
|
|
89682
|
+
var feedLabelListSchemaDefinition = external_exports.object({ labels: external_exports.array(external_exports.string()) });
|
|
89683
|
+
|
|
89415
89684
|
// ../../modules/feed/contract/src/feed.ts
|
|
89416
89685
|
var feedAuthorSchemaDefinition = external_exports.object({
|
|
89417
89686
|
kind: external_exports.enum(["agent", "person", "system"]),
|
|
@@ -89430,7 +89699,9 @@ var feedActionSchemaDefinition = external_exports.object({
|
|
|
89430
89699
|
/** What the button says once pressed, and the handled line: "Sent". */
|
|
89431
89700
|
doneLabel: external_exports.string().optional(),
|
|
89432
89701
|
/** A done action closes the card as it is pressed; the agent still hears which one. */
|
|
89433
|
-
done: external_exports.boolean().optional()
|
|
89702
|
+
done: external_exports.boolean().optional(),
|
|
89703
|
+
/** Needs words: pressing opens the comment box prefilled with the label and sends nothing. */
|
|
89704
|
+
comment: external_exports.boolean().optional()
|
|
89434
89705
|
});
|
|
89435
89706
|
var feedActionSchema = feedActionSchemaDefinition;
|
|
89436
89707
|
var feedItemActionSchemaDefinition = external_exports.object({
|
|
@@ -89440,7 +89711,9 @@ var feedItemActionSchemaDefinition = external_exports.object({
|
|
|
89440
89711
|
style: external_exports.enum(["primary", "secondary"]),
|
|
89441
89712
|
doneLabel: external_exports.string().nullable(),
|
|
89442
89713
|
/** Present only on a done action: pressing it closes the card for everyone who gets it. */
|
|
89443
|
-
done: external_exports.literal(true).optional()
|
|
89714
|
+
done: external_exports.literal(true).optional(),
|
|
89715
|
+
/** Present only on a needs-words action; a client without it sends `message` as a plain press. */
|
|
89716
|
+
comment: external_exports.literal(true).optional()
|
|
89444
89717
|
});
|
|
89445
89718
|
var feedItemActionSchema = feedItemActionSchemaDefinition;
|
|
89446
89719
|
var feedLinkSchemaDefinition = external_exports.object({ label: external_exports.string(), url: external_exports.string() });
|
|
@@ -89492,7 +89765,7 @@ var feedContentSchemaDefinition = external_exports.object({
|
|
|
89492
89765
|
rich: feedRichBodySchemaDefinition.nullable().default(null)
|
|
89493
89766
|
});
|
|
89494
89767
|
var feedGroupSchema = external_exports.string().trim().min(1).max(80);
|
|
89495
|
-
var feedLabelSchema = external_exports.string().trim().min(1).max(24)
|
|
89768
|
+
var feedLabelSchema = external_exports.string().trim().min(1).max(24);
|
|
89496
89769
|
var feedLabelsSchema = external_exports.array(feedLabelSchema).max(5);
|
|
89497
89770
|
var feedDateSchema = external_exports.string().regex(/^\d{4}-\d{2}-\d{2}$/, "a date like 2026-10-14");
|
|
89498
89771
|
var feedSnoozeForSchemaDefinition = external_exports.object({
|
|
@@ -89514,9 +89787,11 @@ var postFeedItemInputSchemaDefinition = external_exports.object({
|
|
|
89514
89787
|
/** Keeps the item under "Coming up" for everyone until then. */
|
|
89515
89788
|
showAt: external_exports.iso.datetime({ offset: true }).nullable().default(null),
|
|
89516
89789
|
snoozeFor: feedSnoozeForSchema.nullable().default(null),
|
|
89517
|
-
/** The group the card belongs to, and its labels, the group's
|
|
89790
|
+
/** The group the card belongs to, and its labels, which also filter the group's cards. */
|
|
89518
89791
|
group: feedGroupSchema.nullable().default(null),
|
|
89519
89792
|
labels: feedLabelsSchema.default([]),
|
|
89793
|
+
/** A word or 0 to 100; left out it reads as normal, and the feed sorts by it. */
|
|
89794
|
+
priority: feedPrioritySchema.nullable().default(null),
|
|
89520
89795
|
/** One card per open loop: a second post with the same key updates that card instead. */
|
|
89521
89796
|
loop: external_exports.string().trim().min(1).max(120).nullable().default(null),
|
|
89522
89797
|
/** The day the agent acts unless a person says stop; the card counts down to it. */
|
|
@@ -89545,6 +89820,8 @@ var updateFeedItemInputSchemaDefinition = external_exports.object({
|
|
|
89545
89820
|
snoozeFor: feedSnoozeForSchema.optional(),
|
|
89546
89821
|
group: feedGroupSchema.nullable().optional(),
|
|
89547
89822
|
labels: feedLabelsSchema.optional(),
|
|
89823
|
+
/** Null goes back to normal. A person's own rank stays over it. */
|
|
89824
|
+
priority: feedPrioritySchema.nullable().optional(),
|
|
89548
89825
|
/** Null removes the countdown. */
|
|
89549
89826
|
autoSendOn: feedDateSchema.nullable().optional(),
|
|
89550
89827
|
/** Puts the item back in front of everyone who handled it, without a reply. */
|
|
@@ -89560,7 +89837,11 @@ var replyFeedItemInputSchemaDefinition = external_exports.object({
|
|
|
89560
89837
|
/** Wakes the item now for everyone who snoozed it. */
|
|
89561
89838
|
urgent: external_exports.boolean().default(false),
|
|
89562
89839
|
/** Closes the item with this reply: it leaves every feed and later replies keep it closed. */
|
|
89563
|
-
done: external_exports.boolean().default(false)
|
|
89840
|
+
done: external_exports.boolean().default(false),
|
|
89841
|
+
/** A plain acknowledgement: it lands on the card, which stays where it is, and nobody is told. */
|
|
89842
|
+
quiet: external_exports.boolean().default(false),
|
|
89843
|
+
/** Snoozes the item for these people in the same step, as `update` does. */
|
|
89844
|
+
snoozeFor: feedSnoozeForSchema.optional()
|
|
89564
89845
|
});
|
|
89565
89846
|
var feedEntrySchemaDefinition = external_exports.object({
|
|
89566
89847
|
id: external_exports.string(),
|
|
@@ -89658,7 +89939,9 @@ var feedViewerStateSchemaDefinition = external_exports.object({
|
|
|
89658
89939
|
/** The reader has seen the newest thing on the card, or marked it read. */
|
|
89659
89940
|
isRead: external_exports.boolean().optional(),
|
|
89660
89941
|
/** The card's text names the reader. */
|
|
89661
|
-
mentioned: external_exports.boolean().optional()
|
|
89942
|
+
mentioned: external_exports.boolean().optional(),
|
|
89943
|
+
/** What the reader's rank or the card says, 0 to 100; absent reads as normal. */
|
|
89944
|
+
priority: external_exports.number().int().optional()
|
|
89662
89945
|
});
|
|
89663
89946
|
var feedViewerStateSchema = feedViewerStateSchemaDefinition;
|
|
89664
89947
|
var feedAssigneeSchemaDefinition = external_exports.object({
|
|
@@ -89667,6 +89950,13 @@ var feedAssigneeSchemaDefinition = external_exports.object({
|
|
|
89667
89950
|
/** Who added them; null for the owner. */
|
|
89668
89951
|
sharedByName: external_exports.string().nullable()
|
|
89669
89952
|
});
|
|
89953
|
+
var feedParticipantSchemaDefinition = external_exports.object({
|
|
89954
|
+
userId: external_exports.string(),
|
|
89955
|
+
/** Empty when only the workspace knows it: the reader's member list names them. */
|
|
89956
|
+
name: external_exports.string(),
|
|
89957
|
+
sharedByName: external_exports.string().nullable().optional(),
|
|
89958
|
+
sharedById: external_exports.string().nullable().optional()
|
|
89959
|
+
});
|
|
89670
89960
|
var feedSharingSchemaDefinition = external_exports.object({
|
|
89671
89961
|
ownerUserId: external_exports.string(),
|
|
89672
89962
|
ownerName: external_exports.string(),
|
|
@@ -89700,6 +89990,8 @@ var feedItemSchemaDefinition = external_exports.object({
|
|
|
89700
89990
|
deviceApproval: external_exports.object({ deviceId: external_exports.string() }).optional(),
|
|
89701
89991
|
group: external_exports.string().nullable(),
|
|
89702
89992
|
labels: external_exports.array(external_exports.string()),
|
|
89993
|
+
/** What the card's author set, 0 to 100; absent reads as normal. */
|
|
89994
|
+
priority: external_exports.number().int().optional(),
|
|
89703
89995
|
loop: external_exports.string().nullable(),
|
|
89704
89996
|
/** How many groups the card has been posted in: 2 shows "Seen 2 times". */
|
|
89705
89997
|
groupDays: external_exports.number().int().nonnegative(),
|
|
@@ -89711,6 +90003,8 @@ var feedItemSchemaDefinition = external_exports.object({
|
|
|
89711
90003
|
lastReplyAt: external_exports.iso.datetime().nullable(),
|
|
89712
90004
|
/** Set once the item is shared with someone besides its owner. */
|
|
89713
90005
|
sharing: feedSharingSchemaDefinition.nullable().optional(),
|
|
90006
|
+
/** Who is on an agent's plain card, for its faces; absent on a card with no one to show. */
|
|
90007
|
+
participants: external_exports.array(feedParticipantSchemaDefinition).optional(),
|
|
89714
90008
|
me: feedViewerStateSchema
|
|
89715
90009
|
});
|
|
89716
90010
|
var feedItemSchema = feedItemSchemaDefinition;
|
|
@@ -89745,7 +90039,8 @@ var feedFilterCardSchemaDefinition = external_exports.object({
|
|
|
89745
90039
|
channelId: external_exports.string().nullable(),
|
|
89746
90040
|
author: feedAuthorSchema,
|
|
89747
90041
|
unread: external_exports.boolean().optional(),
|
|
89748
|
-
mentioned: external_exports.boolean().optional()
|
|
90042
|
+
mentioned: external_exports.boolean().optional(),
|
|
90043
|
+
labels: external_exports.array(external_exports.string()).optional()
|
|
89749
90044
|
});
|
|
89750
90045
|
var feedFilterCardSchema = feedFilterCardSchemaDefinition;
|
|
89751
90046
|
var feedPageSchemaDefinition = external_exports.object({
|
|
@@ -89765,7 +90060,9 @@ var feedAgentItemSchemaDefinition = external_exports.object({
|
|
|
89765
90060
|
/** Person entries newer than the agent's own last reply, as messages ready to act on. */
|
|
89766
90061
|
messages: external_exports.array(external_exports.string()),
|
|
89767
90062
|
/** On a post or update in a turn: the turn's reply will link the card. */
|
|
89768
|
-
linkedToReply: external_exports.boolean().optional()
|
|
90063
|
+
linkedToReply: external_exports.boolean().optional(),
|
|
90064
|
+
/** On a quiet reply: what the agent still owes the people on the card. */
|
|
90065
|
+
reminder: external_exports.string().optional()
|
|
89769
90066
|
});
|
|
89770
90067
|
var feedAgentItemSchema = feedAgentItemSchemaDefinition;
|
|
89771
90068
|
var itemRef = external_exports.object({ workspaceId: external_exports.string().min(1), itemId: external_exports.string().min(1) });
|
|
@@ -90058,7 +90355,8 @@ var feedItemChangedPayloadSchemaDefinition = external_exports.object({
|
|
|
90058
90355
|
"approval_resolved",
|
|
90059
90356
|
"closed",
|
|
90060
90357
|
"pinned",
|
|
90061
|
-
"read_marked"
|
|
90358
|
+
"read_marked",
|
|
90359
|
+
"ranked"
|
|
90062
90360
|
]),
|
|
90063
90361
|
byKind,
|
|
90064
90362
|
byId: external_exports.string(),
|
|
@@ -90066,6 +90364,8 @@ var feedItemChangedPayloadSchemaDefinition = external_exports.object({
|
|
|
90066
90364
|
entryId: external_exports.string().nullable(),
|
|
90067
90365
|
/** Written as a reply in the item card's chat thread, so it is already there. */
|
|
90068
90366
|
fromThread: external_exports.boolean().optional(),
|
|
90367
|
+
/** A quiet reply: it reaches the card and pushes nobody. */
|
|
90368
|
+
quiet: external_exports.boolean().optional(),
|
|
90069
90369
|
/** The agent the item answers to, so its runtime can pick up the entry. */
|
|
90070
90370
|
agentId: external_exports.string(),
|
|
90071
90371
|
showAt: external_exports.iso.datetime().nullable(),
|
|
@@ -90235,19 +90535,47 @@ function pairsOf(args) {
|
|
|
90235
90535
|
}
|
|
90236
90536
|
const actions = args.lists.action ?? [];
|
|
90237
90537
|
const doneLabels = new Set(args.lists["done-action"] ?? []);
|
|
90538
|
+
const commentLabels = new Set(args.lists["comment-action"] ?? []);
|
|
90238
90539
|
const labels = /* @__PURE__ */ new Set();
|
|
90239
90540
|
if (actions.length > 0) {
|
|
90240
90541
|
fields.actions = actions.map((value) => {
|
|
90241
90542
|
const [label3, message2] = pairOf({ value, flag: "action" });
|
|
90242
90543
|
labels.add(label3);
|
|
90243
|
-
return
|
|
90544
|
+
return {
|
|
90545
|
+
label: label3,
|
|
90546
|
+
message: message2,
|
|
90547
|
+
...doneLabels.has(label3) ? { done: true } : {},
|
|
90548
|
+
...commentLabels.has(label3) ? { comment: true } : {}
|
|
90549
|
+
};
|
|
90244
90550
|
});
|
|
90245
90551
|
}
|
|
90552
|
+
refuseActionFlags({ labels, doneLabels, commentLabels });
|
|
90553
|
+
return fields;
|
|
90554
|
+
}
|
|
90555
|
+
function refuseActionFlags({
|
|
90556
|
+
labels,
|
|
90557
|
+
doneLabels,
|
|
90558
|
+
commentLabels
|
|
90559
|
+
}) {
|
|
90246
90560
|
for (const label3 of doneLabels) {
|
|
90247
90561
|
if (!labels.has(label3))
|
|
90248
90562
|
throw new Error(`--done-action "${label3}" names no --action of this card`);
|
|
90249
90563
|
}
|
|
90250
|
-
|
|
90564
|
+
for (const label3 of commentLabels) {
|
|
90565
|
+
if (!labels.has(label3))
|
|
90566
|
+
throw new Error(`--comment-action "${label3}" names no --action of this card`);
|
|
90567
|
+
if (doneLabels.has(label3))
|
|
90568
|
+
throw new Error(`"${label3}" cannot be both --done-action and --comment-action`);
|
|
90569
|
+
}
|
|
90570
|
+
}
|
|
90571
|
+
function priorityOf(text3) {
|
|
90572
|
+
if (text3 === "high" || text3 === "low" || text3 === "normal") return text3;
|
|
90573
|
+
const number4 = Number(text3);
|
|
90574
|
+
if (text3.trim() !== "" && Number.isInteger(number4) && number4 >= 0 && number4 <= 100) return number4;
|
|
90575
|
+
throw new Error(`Priority "${text3}" is not high, low, normal or a number from 0 to 100`);
|
|
90576
|
+
}
|
|
90577
|
+
function rankOf(text3) {
|
|
90578
|
+
return text3 === "default" ? null : priorityOf(text3);
|
|
90251
90579
|
}
|
|
90252
90580
|
function feedFlagsOf({ args }) {
|
|
90253
90581
|
if (args.flags.body !== void 0) throw new Error(FEED_NO_BODY);
|
|
@@ -90265,6 +90593,8 @@ function feedFlagsOf({ args }) {
|
|
|
90265
90593
|
if (group) fields.group = group;
|
|
90266
90594
|
const labels = args.lists.label ?? [];
|
|
90267
90595
|
if (labels.length > 0) fields.labels = [...labels];
|
|
90596
|
+
const priority = flagText({ args, name: "priority" });
|
|
90597
|
+
if (priority) fields.priority = priority === "none" ? null : priorityOf(priority);
|
|
90268
90598
|
const autoSendOn = flagText({ args, name: "auto-send-on" });
|
|
90269
90599
|
if (autoSendOn) fields.autoSendOn = dateOf(autoSendOn);
|
|
90270
90600
|
const rich = richOf(args);
|
|
@@ -90335,16 +90665,18 @@ var USAGE10 = `Usage:
|
|
|
90335
90665
|
[--metric <json|@file.json> | --table <csv|@file.csv>]
|
|
90336
90666
|
[--image <path|url|fileId>]... [--file <path|url|fileId>]... (at most 6 on a card)
|
|
90337
90667
|
[--link <label>=<url>]... [--action <label>=<message>]... [--done-action <label>]...
|
|
90668
|
+
[--comment-action <label>]...
|
|
90338
90669
|
[--to <userId>]...
|
|
90339
|
-
[--urgent] [--
|
|
90340
|
-
[--snooze-for <userId>... --until <ISO time>]
|
|
90341
|
-
[--group <name> [--label <word>]...
|
|
90670
|
+
[--urgent] [--priority high|low|normal|<0 to 100>] [--done-label <line>]
|
|
90671
|
+
[--show-at <ISO time>] [--snooze-for <userId>... --until <ISO time>]
|
|
90672
|
+
[--group <name>] [--label <word>]... [--loop <key> [--reopen]]
|
|
90342
90673
|
[--auto-send-on <YYYY-MM-DD>] [--force]
|
|
90343
90674
|
laze feed update <id> [the post flags that change] [--title <title>]
|
|
90344
90675
|
[--image|--file <path|url|fileId>]... (adds) [--remove-file <fileId|name>]...
|
|
90345
|
-
[--auto-send-on <YYYY-MM-DD>|none]
|
|
90676
|
+
[--auto-send-on <YYYY-MM-DD>|none] [--priority high|low|normal|<0 to 100>|none]
|
|
90346
90677
|
[--show-at <ISO time>|none] [--snooze-for <userId>... --until <ISO time>|none] [--reopen]
|
|
90347
|
-
laze feed reply <id> <text> [--done] [--urgent] [--force]
|
|
90678
|
+
laze feed reply <id> <text> [--done] [--quiet] [--urgent] [--force]
|
|
90679
|
+
[--snooze-for <userId>... --until <ISO time>]
|
|
90348
90680
|
laze feed read <id>
|
|
90349
90681
|
laze feed inbox
|
|
90350
90682
|
laze feed close <id>|--loop <key> --note <text>
|
|
@@ -90360,6 +90692,10 @@ var USAGE10 = `Usage:
|
|
|
90360
90692
|
laze feed done|put-back|unsnooze|pin|unpin <id>
|
|
90361
90693
|
laze feed snooze <id> --until <ISO time>
|
|
90362
90694
|
laze feed channel <channelId>
|
|
90695
|
+
laze feed labels [--json]
|
|
90696
|
+
laze feed rank [--json]
|
|
90697
|
+
laze feed rank <id> high|low|normal|<0 to 100>|default
|
|
90698
|
+
laze feed rank --set <id>=<priority>... | --file <ranks.json>
|
|
90363
90699
|
|
|
90364
90700
|
Managing your owner's feed: when your owner turned on Manage my feed for you (in your settings,
|
|
90365
90701
|
or laze agent feed-access <you> on), laze feed list, count, decisions, done, put-back, snooze,
|
|
@@ -90367,6 +90703,13 @@ unsnooze, pin and unpin work on their whole feed, cards from every agent include
|
|
|
90367
90703
|
is stale, snooze what can wait, pin what matters. You never press actions, comment or answer
|
|
90368
90704
|
approvals there: those stay your owner's. Each change shows on the card as yours.
|
|
90369
90705
|
|
|
90706
|
+
Labels and priority are optional. A label is a word people filter by: run laze feed labels and
|
|
90707
|
+
reuse one before adding a word. Labels show across the workspace, so never a person, customer or
|
|
90708
|
+
deal name. Priority orders the feed under Urgent: leave it out for most cards, high is rare and
|
|
90709
|
+
never your default, low is for what can wait. With Manage my feed, laze feed rank lists your
|
|
90710
|
+
owner's open cards by title and ranks them for them alone, like a secretary would; lower what
|
|
90711
|
+
went stale. Read titles there rather than the whole feed.
|
|
90712
|
+
|
|
90370
90713
|
${FEED_WRITING}`;
|
|
90371
90714
|
function flagsOf(args) {
|
|
90372
90715
|
try {
|
|
@@ -90514,9 +90857,13 @@ async function feedReply({ context, args }) {
|
|
|
90514
90857
|
body: text3,
|
|
90515
90858
|
urgent: Boolean(args.flags.urgent),
|
|
90516
90859
|
...args.flags.force ? { force: true } : {},
|
|
90517
|
-
...args.flags.done === true ? { done: true } : {}
|
|
90860
|
+
...args.flags.done === true ? { done: true } : {},
|
|
90861
|
+
...args.flags.quiet === true ? { quiet: true } : {},
|
|
90862
|
+
...snoozeOf(args)
|
|
90518
90863
|
});
|
|
90519
90864
|
printItem({ context, args, item: replied });
|
|
90865
|
+
if (replied.reminder && !args.flags.json) context.out(`${replied.reminder}
|
|
90866
|
+
`);
|
|
90520
90867
|
}
|
|
90521
90868
|
async function feedRead({ context, args }) {
|
|
90522
90869
|
const itemId = args.words[2];
|
|
@@ -90612,7 +90959,9 @@ function printCard2({ context, item }) {
|
|
|
90612
90959
|
const when = item.me.place === "coming_up" ? ` (back ${item.me.snoozedUntil ?? item.showAt ?? ""})` : "";
|
|
90613
90960
|
const handled = item.me.place === "handled" && item.me.handledLabel;
|
|
90614
90961
|
const pinned = item.me.pinned ? " (pinned)" : "";
|
|
90615
|
-
const
|
|
90962
|
+
const word3 = feedPriorityWordOf(item.me.priority ?? FEED_PRIORITY.normal);
|
|
90963
|
+
const marks = `${pinned}${word3 === "normal" ? "" : ` (${word3})`}${item.labels.map((one) => ` [${one}]`).join("")}`;
|
|
90964
|
+
const shown2 = `${item.title}${marks}${when}${handled ? ` ${handled}` : ""}`;
|
|
90616
90965
|
context.out(`${item.id} ${item.tag} ${shown2}
|
|
90617
90966
|
`);
|
|
90618
90967
|
if (item.me.place === "handled") return;
|
|
@@ -90721,6 +91070,73 @@ function moveItem(path) {
|
|
|
90721
91070
|
printMoved({ context, args, item });
|
|
90722
91071
|
};
|
|
90723
91072
|
}
|
|
91073
|
+
async function ranksOf({
|
|
91074
|
+
context,
|
|
91075
|
+
args
|
|
91076
|
+
}) {
|
|
91077
|
+
const file3 = flagText({ args, name: "file" });
|
|
91078
|
+
if (file3) {
|
|
91079
|
+
const parsed = JSON.parse(await readFile33(resolve15(context.cwd, file3), "utf8"));
|
|
91080
|
+
if (Array.isArray(parsed)) return parsed;
|
|
91081
|
+
throw new CliUsageError("--file holds a list of {itemId, priority}");
|
|
91082
|
+
}
|
|
91083
|
+
const [itemId, priority] = args.words.slice(2);
|
|
91084
|
+
const named = itemId && priority ? [`${itemId}=${priority}`] : [];
|
|
91085
|
+
return [...named, ...args.lists.set ?? []].map((pair2) => {
|
|
91086
|
+
const at = pair2.indexOf("=");
|
|
91087
|
+
if (at < 1) throw new CliUsageError(USAGE10);
|
|
91088
|
+
try {
|
|
91089
|
+
return { itemId: pair2.slice(0, at), priority: rankOf(pair2.slice(at + 1)) };
|
|
91090
|
+
} catch (error63) {
|
|
91091
|
+
throw new CliUsageError(error63 instanceof Error ? error63.message : String(error63));
|
|
91092
|
+
}
|
|
91093
|
+
});
|
|
91094
|
+
}
|
|
91095
|
+
function printRankView({
|
|
91096
|
+
context,
|
|
91097
|
+
args,
|
|
91098
|
+
view
|
|
91099
|
+
}) {
|
|
91100
|
+
if (args.flags.json) return context.out(`${JSON.stringify(view, null, 2)}
|
|
91101
|
+
`);
|
|
91102
|
+
if (view.cards.length === 0) return context.out("No open cards to rank.\n");
|
|
91103
|
+
for (const card2 of view.cards) {
|
|
91104
|
+
const marks = `${card2.urgent ? " (urgent)" : ""}${card2.pinned ? " (pinned)" : ""}`;
|
|
91105
|
+
const labels = card2.labels.map((one) => ` [${one}]`).join("");
|
|
91106
|
+
context.out(`${card2.id} ${card2.priority} ${card2.title}${marks}${labels} ${card2.author}
|
|
91107
|
+
`);
|
|
91108
|
+
}
|
|
91109
|
+
if (view.total > view.cards.length) {
|
|
91110
|
+
context.out(`${view.cards.length} of ${view.total} open cards
|
|
91111
|
+
`);
|
|
91112
|
+
}
|
|
91113
|
+
}
|
|
91114
|
+
async function feedRank({ context, args }) {
|
|
91115
|
+
const single = args.words[2] !== void 0;
|
|
91116
|
+
const ranks = await ranksOf({ context, args });
|
|
91117
|
+
if (single && ranks.length === 0) throw new CliUsageError(USAGE10);
|
|
91118
|
+
const { client } = await signedIn({ context, args });
|
|
91119
|
+
if (ranks.length === 0) {
|
|
91120
|
+
const view = await client.get("/api/feed/mine/rank");
|
|
91121
|
+
return printRankView({ context, args, view });
|
|
91122
|
+
}
|
|
91123
|
+
const answer6 = await client.post("/api/feed/mine/rank", { ranks });
|
|
91124
|
+
if (args.flags.json) return context.out(`${JSON.stringify(answer6, null, 2)}
|
|
91125
|
+
`);
|
|
91126
|
+
context.out(`Ranked ${answer6.ranked.length} of ${ranks.length}
|
|
91127
|
+
`);
|
|
91128
|
+
for (const one of answer6.refused) context.out(` ${one.itemId} ${one.reason}
|
|
91129
|
+
`);
|
|
91130
|
+
}
|
|
91131
|
+
async function feedLabels({ context, args }) {
|
|
91132
|
+
const { client } = await signedIn({ context, args });
|
|
91133
|
+
const { labels } = await client.get("/api/feed/labels");
|
|
91134
|
+
if (args.flags.json) return context.out(`${JSON.stringify(labels, null, 2)}
|
|
91135
|
+
`);
|
|
91136
|
+
if (labels.length === 0) return context.out("No labels yet.\n");
|
|
91137
|
+
context.out(`${labels.join("\n")}
|
|
91138
|
+
`);
|
|
91139
|
+
}
|
|
90724
91140
|
async function feedSnooze({ context, args }) {
|
|
90725
91141
|
const itemId = args.words[2];
|
|
90726
91142
|
const until = flagText({ args, name: "until" });
|
|
@@ -90758,6 +91174,8 @@ var FEED_COMMANDS = {
|
|
|
90758
91174
|
done: moveItem("done"),
|
|
90759
91175
|
"put-back": moveItem("put-back"),
|
|
90760
91176
|
unsnooze: moveItem("unsnooze"),
|
|
91177
|
+
rank: feedRank,
|
|
91178
|
+
labels: feedLabels,
|
|
90761
91179
|
pin: pinItem(true),
|
|
90762
91180
|
unpin: pinItem(false),
|
|
90763
91181
|
snooze: feedSnooze,
|
|
@@ -91693,7 +92111,7 @@ async function connect2({ context, args }) {
|
|
|
91693
92111
|
sensitivity: sensitivity2
|
|
91694
92112
|
});
|
|
91695
92113
|
const { connection, relayKey } = answer6;
|
|
91696
|
-
const rest = Object.fromEntries(Object.entries(relays).filter(([
|
|
92114
|
+
const rest = Object.fromEntries(Object.entries(relays).filter(([id4]) => id4 !== kept?.[0]));
|
|
91697
92115
|
await saveMcpRelays({
|
|
91698
92116
|
context,
|
|
91699
92117
|
relays: {
|
|
@@ -92298,12 +92716,12 @@ async function vaultEnv({
|
|
|
92298
92716
|
throw new CliUsageError(`--vault takes a connection name
|
|
92299
92717
|
${USAGE12}`);
|
|
92300
92718
|
if (connections.length === 0) return {};
|
|
92301
|
-
const
|
|
92302
|
-
if (!
|
|
92719
|
+
const reason2 = flagText({ args, name: "reason" });
|
|
92720
|
+
if (!reason2) throw new CliUsageError(`Say why with --reason "<one plain sentence>"
|
|
92303
92721
|
${USAGE12}`);
|
|
92304
92722
|
const env = {};
|
|
92305
92723
|
for (const connection of new Set(connections)) {
|
|
92306
|
-
const released = await vaultRelease({ context, args, connection, reason, command: args.rest });
|
|
92724
|
+
const released = await vaultRelease({ context, args, connection, reason: reason2, command: args.rest });
|
|
92307
92725
|
if ("exitCode" in released) return released;
|
|
92308
92726
|
Object.assign(env, released.env);
|
|
92309
92727
|
}
|
|
@@ -92453,8 +92871,8 @@ function recordOf3(value) {
|
|
|
92453
92871
|
function idsOf(message2) {
|
|
92454
92872
|
const messages = Array.isArray(message2) ? message2 : [message2];
|
|
92455
92873
|
return messages.flatMap((each) => {
|
|
92456
|
-
const
|
|
92457
|
-
return
|
|
92874
|
+
const id4 = recordOf3(each).id;
|
|
92875
|
+
return id4 === void 0 || id4 === null ? [] : [id4];
|
|
92458
92876
|
});
|
|
92459
92877
|
}
|
|
92460
92878
|
function toolResultOf({ text: text3, isError }) {
|
|
@@ -92517,11 +92935,11 @@ function refusedLines2({
|
|
|
92517
92935
|
}) {
|
|
92518
92936
|
const migrated = status11 === 401 ? migratedNoticeOf(apiErrorOf({ status: status11, text: text3 })) : void 0;
|
|
92519
92937
|
const refused = status11 === 401 ? "Laze refused this key: run `laze login` or link the agent again" : `Laze answered ${status11}`;
|
|
92520
|
-
const
|
|
92521
|
-
const errors = idsOf(message2).map((
|
|
92938
|
+
const reason2 = migrated?.notice ?? refused;
|
|
92939
|
+
const errors = idsOf(message2).map((id4) => ({
|
|
92522
92940
|
jsonrpc: "2.0",
|
|
92523
|
-
id:
|
|
92524
|
-
error: { code: SERVER_REFUSED, message:
|
|
92941
|
+
id: id4,
|
|
92942
|
+
error: { code: SERVER_REFUSED, message: reason2 }
|
|
92525
92943
|
}));
|
|
92526
92944
|
if (errors.length === 0) return [];
|
|
92527
92945
|
return [JSON.stringify(Array.isArray(message2) ? errors : errors[0])];
|
|
@@ -92806,7 +93224,7 @@ function logTarget({
|
|
|
92806
93224
|
const layer = flagText({ args, name: "layer", fallback: "person" });
|
|
92807
93225
|
if (layer !== "person" && layer !== "agent") throw new CliUsageError(USAGE13);
|
|
92808
93226
|
const channel = turn ? flagText({ args, name: "channel" }) : turnChannel({ context, args });
|
|
92809
|
-
const messages = (context.environment.inherited.LAZE_TURN_MESSAGES ?? "").split(",").map((
|
|
93227
|
+
const messages = (context.environment.inherited.LAZE_TURN_MESSAGES ?? "").split(",").map((id4) => id4.trim()).filter(Boolean);
|
|
92810
93228
|
const message2 = flagText({ args, name: "message" }) || messages.at(-1) || "";
|
|
92811
93229
|
const person = flagText({ args, name: "person" });
|
|
92812
93230
|
return {
|
|
@@ -92862,9 +93280,9 @@ async function logCall({
|
|
|
92862
93280
|
printAnswer2({ context, args, answer: answer6 });
|
|
92863
93281
|
}
|
|
92864
93282
|
function entryId(args) {
|
|
92865
|
-
const
|
|
92866
|
-
if (!Number.isInteger(
|
|
92867
|
-
return
|
|
93283
|
+
const id4 = Number((args.words[2] ?? "").replace(/^#/, ""));
|
|
93284
|
+
if (!Number.isInteger(id4) || id4 < 0) throw new CliUsageError(USAGE13);
|
|
93285
|
+
return id4;
|
|
92868
93286
|
}
|
|
92869
93287
|
function blockArg(args) {
|
|
92870
93288
|
const block2 = (args.words[2] ?? "").replace(/^#/, "");
|
|
@@ -92876,9 +93294,9 @@ async function memoryNote({ context, args }) {
|
|
|
92876
93294
|
await logCall({ context, args, path: "note", body: line });
|
|
92877
93295
|
}
|
|
92878
93296
|
async function memoryCorrect({ context, args }) {
|
|
92879
|
-
const
|
|
93297
|
+
const id4 = entryId(args);
|
|
92880
93298
|
const line = await taggedLine({ context, args, from: 3 });
|
|
92881
|
-
await logCall({ context, args, path: "correct", body: { id:
|
|
93299
|
+
await logCall({ context, args, path: "correct", body: { id: id4, ...line } });
|
|
92882
93300
|
}
|
|
92883
93301
|
async function memoryRemove({ context, args }) {
|
|
92884
93302
|
await logCall({ context, args, path: "remove", body: { id: entryId(args) } });
|
|
@@ -93418,7 +93836,7 @@ var connectLocal = async ({ context, args, client, url: url2 }) => {
|
|
|
93418
93836
|
...label3 && { label: label3 }
|
|
93419
93837
|
});
|
|
93420
93838
|
const { connection, relayKey } = answer6;
|
|
93421
|
-
const rest = Object.fromEntries(Object.entries(relays).filter(([
|
|
93839
|
+
const rest = Object.fromEntries(Object.entries(relays).filter(([id4]) => id4 !== kept?.[0]));
|
|
93422
93840
|
await saveRelays({
|
|
93423
93841
|
context,
|
|
93424
93842
|
relays: { ...rest, [connection.id]: { url: url2, relayKey, gatewayUrl: gatewayUrl2, label: connection.label } }
|
|
@@ -93517,17 +93935,1465 @@ async function openclaw({
|
|
|
93517
93935
|
await run4({ context, args, client, url: profile.url });
|
|
93518
93936
|
}
|
|
93519
93937
|
|
|
93938
|
+
// src/services/operator-key-commands.service.ts
|
|
93939
|
+
import { createHash as createHash5, randomBytes as randomBytes3 } from "node:crypto";
|
|
93940
|
+
import { mkdir as mkdir23, readFile as readFile38, rm as rm14, writeFile as writeFile23 } from "node:fs/promises";
|
|
93941
|
+
import { dirname as dirname23, join as join27 } from "node:path";
|
|
93942
|
+
|
|
93943
|
+
// ../../modules/audit-log/contract/src/audit-log.api.ts
|
|
93944
|
+
var auditEntrySchemaDefinition = external_exports.object({
|
|
93945
|
+
id: external_exports.string(),
|
|
93946
|
+
workspaceId: external_exports.string(),
|
|
93947
|
+
actorType: external_exports.enum(["user", "api_key", "system", "internal", "anonymous"]),
|
|
93948
|
+
actorId: external_exports.string().nullable(),
|
|
93949
|
+
/** Laze staff viewing Laze as the actor when this happened; null otherwise. */
|
|
93950
|
+
impersonatorId: external_exports.string().nullable().default(null),
|
|
93951
|
+
action: external_exports.string(),
|
|
93952
|
+
targetKind: external_exports.string().nullable(),
|
|
93953
|
+
targetId: external_exports.string().nullable(),
|
|
93954
|
+
errorCode: external_exports.string().nullable(),
|
|
93955
|
+
ipAddress: external_exports.string().nullable(),
|
|
93956
|
+
/** ISO 8601. */
|
|
93957
|
+
createdAt: external_exports.iso.datetime()
|
|
93958
|
+
});
|
|
93959
|
+
var auditEntrySchema = auditEntrySchemaDefinition;
|
|
93960
|
+
var listAuditEntriesInputSchemaDefinition = external_exports.object({
|
|
93961
|
+
workspaceId: external_exports.string().min(1),
|
|
93962
|
+
limit: external_exports.number().int().min(1).max(200).default(50)
|
|
93963
|
+
});
|
|
93964
|
+
var listAuditEntriesInputSchema = listAuditEntriesInputSchemaDefinition;
|
|
93965
|
+
var AuditLogApi = moduleApi()("audit-log");
|
|
93966
|
+
|
|
93967
|
+
// ../../modules/audit-log/contract/src/audit-log.trpc.ts
|
|
93968
|
+
var auditLogTrpc = defineTrpcContract("auditLog").query("list").withInput(listAuditEntriesInputSchema).withOutput(external_exports.array(auditEntrySchema)).build();
|
|
93969
|
+
|
|
93970
|
+
// ../../modules/auth/contract/src/auth-sign-up-guard.ts
|
|
93971
|
+
var captchaSettingsSchemaDefinition = external_exports.object({
|
|
93972
|
+
siteKey: external_exports.string().min(1),
|
|
93973
|
+
exemptDomains: external_exports.array(external_exports.string())
|
|
93974
|
+
});
|
|
93975
|
+
var captchaSettingsSchema = captchaSettingsSchemaDefinition;
|
|
93976
|
+
var verificationStatusSchemaDefinition = external_exports.discriminatedUnion("state", [
|
|
93977
|
+
external_exports.object({ state: external_exports.literal("none") }),
|
|
93978
|
+
external_exports.object({ state: external_exports.literal("verified") }),
|
|
93979
|
+
external_exports.object({ state: external_exports.literal("pending"), email: external_exports.string() })
|
|
93980
|
+
]);
|
|
93981
|
+
|
|
93982
|
+
// ../../modules/auth/contract/src/auth.api.ts
|
|
93983
|
+
var authUserSchemaDefinition = external_exports.object({
|
|
93984
|
+
id: external_exports.string().min(1),
|
|
93985
|
+
email: external_exports.string(),
|
|
93986
|
+
name: external_exports.string(),
|
|
93987
|
+
image: external_exports.string().nullable(),
|
|
93988
|
+
emailVerified: external_exports.boolean(),
|
|
93989
|
+
/** BCP 47; absent or en-US until the person picks another (language.feature). */
|
|
93990
|
+
language: external_exports.string().optional()
|
|
93991
|
+
});
|
|
93992
|
+
var authUserSchema = authUserSchemaDefinition;
|
|
93993
|
+
var deviceKeysSchemaDefinition = external_exports.object({
|
|
93994
|
+
userId: external_exports.string().min(1),
|
|
93995
|
+
cacheKey: external_exports.string().min(1),
|
|
93996
|
+
previousCacheKey: external_exports.string().min(1),
|
|
93997
|
+
/** Seals what the person typed; the same on every session, so it survives one ending. */
|
|
93998
|
+
draftKey: external_exports.string().min(1)
|
|
93999
|
+
});
|
|
94000
|
+
var deviceKeysSchema = deviceKeysSchemaDefinition;
|
|
94001
|
+
var ssoConnectionSchemaDefinition = external_exports.object({
|
|
94002
|
+
/** The address segment of the sign-in callback, `/api/auth/sso/callback/<providerId>`. */
|
|
94003
|
+
providerId: external_exports.string().regex(/^[a-z0-9-]{3,64}$/),
|
|
94004
|
+
workspaceId: external_exports.string().min(1),
|
|
94005
|
+
/** Email domain whose people this connection signs in, verified by its owner. */
|
|
94006
|
+
domain: external_exports.string().min(3),
|
|
94007
|
+
issuer: external_exports.url(),
|
|
94008
|
+
clientId: external_exports.string().min(1),
|
|
94009
|
+
clientSecret: external_exports.string().min(1),
|
|
94010
|
+
authorizationEndpoint: external_exports.url(),
|
|
94011
|
+
tokenEndpoint: external_exports.url(),
|
|
94012
|
+
jwksEndpoint: external_exports.url(),
|
|
94013
|
+
userInfoEndpoint: external_exports.url().optional()
|
|
94014
|
+
});
|
|
94015
|
+
var domainRouteSchemaDefinition = external_exports.object({
|
|
94016
|
+
domain: external_exports.string().min(3),
|
|
94017
|
+
workspaceId: external_exports.string().min(1),
|
|
94018
|
+
/** `google`: Google Workspace, whose hosted domain must be `domain`. `oidc`: a connection. */
|
|
94019
|
+
provider: external_exports.enum(["google", "oidc"]),
|
|
94020
|
+
/** The connection an `oidc` route signs in through; null for Google Workspace. */
|
|
94021
|
+
providerId: external_exports.string().nullable(),
|
|
94022
|
+
/** Enforced: the domain's people sign in through this route and no other way. */
|
|
94023
|
+
enforced: external_exports.boolean()
|
|
94024
|
+
});
|
|
94025
|
+
var signInRouteSchemaDefinition = external_exports.discriminatedUnion("kind", [
|
|
94026
|
+
external_exports.object({ kind: external_exports.literal("open") }),
|
|
94027
|
+
external_exports.object({ kind: external_exports.literal("google"), domain: external_exports.string(), enforced: external_exports.boolean() }),
|
|
94028
|
+
external_exports.object({
|
|
94029
|
+
kind: external_exports.literal("sso"),
|
|
94030
|
+
domain: external_exports.string(),
|
|
94031
|
+
providerId: external_exports.string(),
|
|
94032
|
+
enforced: external_exports.boolean()
|
|
94033
|
+
})
|
|
94034
|
+
]);
|
|
94035
|
+
var signInRouteSchema = signInRouteSchemaDefinition;
|
|
94036
|
+
var presenceMethodsSchemaDefinition = external_exports.object({ password: external_exports.boolean(), google: external_exports.boolean() });
|
|
94037
|
+
var signInOptionsSchemaDefinition = external_exports.object({
|
|
94038
|
+
google: external_exports.boolean(),
|
|
94039
|
+
apple: external_exports.boolean(),
|
|
94040
|
+
/** The sign-up captcha for plus addresses; absent from servers older than it. */
|
|
94041
|
+
captcha: captchaSettingsSchema.optional()
|
|
94042
|
+
});
|
|
94043
|
+
var signInOptionsSchema = signInOptionsSchemaDefinition;
|
|
94044
|
+
var appSiteAssociationSchemaDefinition = external_exports.discriminatedUnion("kind", [
|
|
94045
|
+
external_exports.object({ kind: external_exports.literal("off") }),
|
|
94046
|
+
external_exports.object({ kind: external_exports.literal("on"), json: external_exports.string() })
|
|
94047
|
+
]);
|
|
94048
|
+
var pictureSourceSchema = external_exports.enum(["google", "slack", "discord", "upload"]);
|
|
94049
|
+
var AuthApi = moduleApi()("auth");
|
|
94050
|
+
var nativePairingSchemaDefinition = external_exports.object({
|
|
94051
|
+
/** Two groups of four, such as `BCDF-GHJK`; typed in any case, with or without the dash. */
|
|
94052
|
+
code: external_exports.string(),
|
|
94053
|
+
expiresAt: external_exports.iso.datetime(),
|
|
94054
|
+
/** `laze://pair?code=...&server=...`, what a QR code would carry. */
|
|
94055
|
+
link: external_exports.string(),
|
|
94056
|
+
/** The same code as an https link on this server. */
|
|
94057
|
+
url: external_exports.string()
|
|
94058
|
+
});
|
|
94059
|
+
|
|
94060
|
+
// ../../modules/auth/contract/src/auth-join.ts
|
|
94061
|
+
var joinWaySchema = external_exports.enum(["request", "join", "provider"]);
|
|
94062
|
+
var joinOfferSchemaDefinition = external_exports.object({
|
|
94063
|
+
workspaceId: external_exports.string().min(1),
|
|
94064
|
+
workspaceName: external_exports.string(),
|
|
94065
|
+
/** Coarse: exact below 10, then rounded down to 10s, 50s from 100 and 100s from 1000. */
|
|
94066
|
+
colleagues: external_exports.number().int().min(0),
|
|
94067
|
+
way: joinWaySchema
|
|
94068
|
+
});
|
|
94069
|
+
var joinOfferSchema = joinOfferSchemaDefinition;
|
|
94070
|
+
var pendingJoinSchemaDefinition = external_exports.object({
|
|
94071
|
+
requestId: external_exports.string().min(1),
|
|
94072
|
+
workspaceId: external_exports.string().min(1),
|
|
94073
|
+
workspaceName: external_exports.string(),
|
|
94074
|
+
/** ISO 8601. */
|
|
94075
|
+
createdAt: external_exports.iso.datetime()
|
|
94076
|
+
});
|
|
94077
|
+
var pendingJoinSchema = pendingJoinSchemaDefinition;
|
|
94078
|
+
var joinOfferReadingSchemaDefinition = external_exports.object({
|
|
94079
|
+
offers: external_exports.array(joinOfferSchema),
|
|
94080
|
+
/** The person's own requests still waiting for an admin. */
|
|
94081
|
+
pending: external_exports.array(pendingJoinSchema)
|
|
94082
|
+
});
|
|
94083
|
+
var joinOfferReadingSchema = joinOfferReadingSchemaDefinition;
|
|
94084
|
+
var joinAnswerSchemaDefinition = external_exports.object({
|
|
94085
|
+
workspaceId: external_exports.string().min(1),
|
|
94086
|
+
requestId: external_exports.string().min(1),
|
|
94087
|
+
/** True when the person is now a Member; false while the request waits for an admin. */
|
|
94088
|
+
joined: external_exports.boolean()
|
|
94089
|
+
});
|
|
94090
|
+
var joinAnswerSchema = joinAnswerSchemaDefinition;
|
|
94091
|
+
var joinDomainSchemaDefinition = external_exports.object({
|
|
94092
|
+
domain: external_exports.string(),
|
|
94093
|
+
/** People with a verified address on the domain join as Members without asking. */
|
|
94094
|
+
autoJoin: external_exports.boolean(),
|
|
94095
|
+
/** The domain signs in through its provider alone, which adds its people itself. */
|
|
94096
|
+
enforced: external_exports.boolean()
|
|
94097
|
+
});
|
|
94098
|
+
var joinDomainSchema = joinDomainSchemaDefinition;
|
|
94099
|
+
var setDomainAutoJoinInputSchemaDefinition = external_exports.object({
|
|
94100
|
+
workspaceId: external_exports.string().min(1),
|
|
94101
|
+
domain: external_exports.string().trim().toLowerCase().min(3).max(253),
|
|
94102
|
+
autoJoin: external_exports.boolean()
|
|
94103
|
+
});
|
|
94104
|
+
var setDomainAutoJoinInputSchema = setDomainAutoJoinInputSchemaDefinition;
|
|
94105
|
+
|
|
94106
|
+
// ../../modules/auth/contract/src/auth-analytics-consent.ts
|
|
94107
|
+
var analyticsConsentSourceSchema = external_exports.enum([
|
|
94108
|
+
"sign_up",
|
|
94109
|
+
"this_browser",
|
|
94110
|
+
"app_prompt",
|
|
94111
|
+
"app_prompt_closed",
|
|
94112
|
+
"settings"
|
|
94113
|
+
]);
|
|
94114
|
+
var chosenDefinition = external_exports.object({
|
|
94115
|
+
kind: external_exports.literal("chosen"),
|
|
94116
|
+
analytics: external_exports.boolean(),
|
|
94117
|
+
decidedAt: external_exports.string(),
|
|
94118
|
+
source: analyticsConsentSourceSchema
|
|
94119
|
+
});
|
|
94120
|
+
var analyticsConsentReadingDefinition = external_exports.discriminatedUnion("kind", [
|
|
94121
|
+
chosenDefinition,
|
|
94122
|
+
external_exports.object({ kind: external_exports.literal("not_chosen") })
|
|
94123
|
+
]);
|
|
94124
|
+
var analyticsConsentReadingSchema = analyticsConsentReadingDefinition;
|
|
94125
|
+
var setAnalyticsConsentInputDefinition = external_exports.object({
|
|
94126
|
+
analytics: external_exports.boolean(),
|
|
94127
|
+
/** `sign_up` is only ever taken from the sign-up answer, never sent. */
|
|
94128
|
+
source: analyticsConsentSourceSchema.exclude(["sign_up"])
|
|
94129
|
+
});
|
|
94130
|
+
var setAnalyticsConsentInputSchema = setAnalyticsConsentInputDefinition;
|
|
94131
|
+
|
|
94132
|
+
// ../../modules/auth/contract/src/auth-impersonation.ts
|
|
94133
|
+
var IMPERSONATION_MAX_MINUTES = 60;
|
|
94134
|
+
var personDefinition2 = external_exports.object({ id: external_exports.string(), name: external_exports.string(), email: external_exports.string() });
|
|
94135
|
+
var impersonationDefinition = external_exports.object({
|
|
94136
|
+
id: external_exports.string(),
|
|
94137
|
+
operator: personDefinition2,
|
|
94138
|
+
target: personDefinition2,
|
|
94139
|
+
workspaceId: external_exports.string().nullable(),
|
|
94140
|
+
reason: external_exports.string(),
|
|
94141
|
+
startedAt: external_exports.iso.datetime(),
|
|
94142
|
+
endsAt: external_exports.iso.datetime()
|
|
94143
|
+
});
|
|
94144
|
+
var impersonationSchema = impersonationDefinition;
|
|
94145
|
+
var startImpersonationDefinition = external_exports.object({
|
|
94146
|
+
targetUserId: external_exports.string().min(1),
|
|
94147
|
+
workspaceId: external_exports.string().min(1).nullable(),
|
|
94148
|
+
reason: external_exports.string().trim().min(3).max(500),
|
|
94149
|
+
minutes: external_exports.number().int().min(1).max(IMPERSONATION_MAX_MINUTES)
|
|
94150
|
+
});
|
|
94151
|
+
var userSummaryDefinition = external_exports.object({
|
|
94152
|
+
id: external_exports.string(),
|
|
94153
|
+
name: external_exports.string(),
|
|
94154
|
+
email: external_exports.string(),
|
|
94155
|
+
emailVerified: external_exports.boolean(),
|
|
94156
|
+
createdAt: external_exports.iso.datetime()
|
|
94157
|
+
});
|
|
94158
|
+
var authUserSummarySchema = userSummaryDefinition;
|
|
94159
|
+
|
|
94160
|
+
// ../../modules/workspace/contract/src/sign-up-source.ts
|
|
94161
|
+
var TAG = /^[\p{L}\p{N} ._\-+:/@|]{1,100}$/u;
|
|
94162
|
+
var PERSONA = /^[a-z0-9-]{1,40}$/;
|
|
94163
|
+
var REFERRAL_CODE = /^[0-9A-Za-z]{4,64}$/;
|
|
94164
|
+
var HOST = /^[a-z0-9.-]{1,253}$/;
|
|
94165
|
+
var tagSchema = external_exports.string().regex(TAG).nullable();
|
|
94166
|
+
var signUpSourceSchemaDefinition = external_exports.object({
|
|
94167
|
+
source: tagSchema,
|
|
94168
|
+
medium: tagSchema,
|
|
94169
|
+
campaign: tagSchema,
|
|
94170
|
+
content: tagSchema,
|
|
94171
|
+
term: tagSchema,
|
|
94172
|
+
/** The host of the outside page that sent the visitor; null for none or Laze's own pages. */
|
|
94173
|
+
referrer: external_exports.string().regex(HOST).nullable(),
|
|
94174
|
+
/** The path of the first page the visitor opened, without its query. */
|
|
94175
|
+
landingPath: external_exports.string().startsWith("/").max(200).nullable(),
|
|
94176
|
+
/** The persona page the visitor came through, such as `sales` for `/for/sales`. */
|
|
94177
|
+
persona: external_exports.string().regex(PERSONA).nullable(),
|
|
94178
|
+
/** The code of the referral link the visitor first opened. */
|
|
94179
|
+
referralCode: external_exports.string().regex(REFERRAL_CODE).nullable()
|
|
94180
|
+
});
|
|
94181
|
+
var signUpSourceSchema = signUpSourceSchemaDefinition;
|
|
94182
|
+
var HEARD_FROM_ANSWERS = [
|
|
94183
|
+
"reddit",
|
|
94184
|
+
"linkedin",
|
|
94185
|
+
"x",
|
|
94186
|
+
"search",
|
|
94187
|
+
"ai-assistant",
|
|
94188
|
+
"newsletter",
|
|
94189
|
+
"friend",
|
|
94190
|
+
"other"
|
|
94191
|
+
];
|
|
94192
|
+
var heardFromSchema = external_exports.enum(HEARD_FROM_ANSWERS);
|
|
94193
|
+
var heardFromOtherSchema = external_exports.string().trim().min(1).max(120);
|
|
94194
|
+
|
|
94195
|
+
// ../../modules/workspace/contract/src/workspace-access.ts
|
|
94196
|
+
var MAX_INVITES_PER_BATCH = 50;
|
|
94197
|
+
var inviteLandingSchemaDefinition = external_exports.discriminatedUnion("kind", [
|
|
94198
|
+
external_exports.object({ kind: external_exports.literal("conversation"), channelId: external_exports.string().min(1).max(200) }),
|
|
94199
|
+
external_exports.object({
|
|
94200
|
+
kind: external_exports.literal("agent"),
|
|
94201
|
+
agentId: external_exports.string().min(1).max(200),
|
|
94202
|
+
/** The agent's chat, opened on joining. */
|
|
94203
|
+
channelId: external_exports.string().min(1).max(200)
|
|
94204
|
+
})
|
|
94205
|
+
]);
|
|
94206
|
+
var inviteLandingSchema = inviteLandingSchemaDefinition;
|
|
94207
|
+
var accessRequestKindSchema = external_exports.enum(["invite", "join"]);
|
|
94208
|
+
var accessRequestStatusSchema = external_exports.enum([
|
|
94209
|
+
"pending",
|
|
94210
|
+
"approved",
|
|
94211
|
+
"denied",
|
|
94212
|
+
"withdrawn",
|
|
94213
|
+
"expired"
|
|
94214
|
+
]);
|
|
94215
|
+
var accessRequestSchemaDefinition = external_exports.object({
|
|
94216
|
+
id: external_exports.string().min(1),
|
|
94217
|
+
workspaceId: external_exports.string().min(1),
|
|
94218
|
+
kind: accessRequestKindSchema,
|
|
94219
|
+
/** The person who would join. */
|
|
94220
|
+
email: external_exports.string(),
|
|
94221
|
+
name: external_exports.string(),
|
|
94222
|
+
role: workspaceRoleSchema,
|
|
94223
|
+
requestedByUserId: external_exports.string(),
|
|
94224
|
+
requestedByName: external_exports.string(),
|
|
94225
|
+
status: accessRequestStatusSchema,
|
|
94226
|
+
/** `admin`, `policy` (a domain that admits its people) or `invite` (an invitation answered). */
|
|
94227
|
+
decidedVia: external_exports.enum(["admin", "policy", "invite"]).nullable(),
|
|
94228
|
+
decidedByUserId: external_exports.string().nullable(),
|
|
94229
|
+
/** ISO 8601. */
|
|
94230
|
+
createdAt: external_exports.iso.datetime(),
|
|
94231
|
+
expiresAt: external_exports.iso.datetime(),
|
|
94232
|
+
/** Where an invite request's person lands on joining; null for the workspace's Home. */
|
|
94233
|
+
landing: inviteLandingSchemaDefinition.nullable().optional()
|
|
94234
|
+
});
|
|
94235
|
+
var accessRequestSchema = accessRequestSchemaDefinition;
|
|
94236
|
+
var requestInviteInputSchemaDefinition = external_exports.object({
|
|
94237
|
+
workspaceId: external_exports.string().min(1),
|
|
94238
|
+
email: external_exports.email().max(320),
|
|
94239
|
+
role: workspaceRoleSchema
|
|
94240
|
+
});
|
|
94241
|
+
var requestInviteInputSchema = requestInviteInputSchemaDefinition;
|
|
94242
|
+
var decideAccessRequestInputSchemaDefinition = external_exports.object({
|
|
94243
|
+
workspaceId: external_exports.string().min(1),
|
|
94244
|
+
requestId: external_exports.string().min(1),
|
|
94245
|
+
decision: external_exports.enum(["approved", "denied"])
|
|
94246
|
+
});
|
|
94247
|
+
var decideAccessRequestInputSchema = decideAccessRequestInputSchemaDefinition;
|
|
94248
|
+
var seatSourceSchema = external_exports.enum([
|
|
94249
|
+
"creator",
|
|
94250
|
+
"invite",
|
|
94251
|
+
"join_request",
|
|
94252
|
+
"domain",
|
|
94253
|
+
"single_sign_on",
|
|
94254
|
+
"directory"
|
|
94255
|
+
]);
|
|
94256
|
+
var seatAddedSchemaDefinition = external_exports.object({
|
|
94257
|
+
workspaceId: external_exports.string().min(1),
|
|
94258
|
+
userId: external_exports.string().min(1),
|
|
94259
|
+
email: external_exports.string(),
|
|
94260
|
+
source: seatSourceSchema,
|
|
94261
|
+
/** ISO 8601. */
|
|
94262
|
+
at: external_exports.iso.datetime(),
|
|
94263
|
+
/** The invitation's landing: the module that owns it adds the person there. */
|
|
94264
|
+
landing: inviteLandingSchemaDefinition.nullable().optional(),
|
|
94265
|
+
/** Who sent the invitation, whose right to add the person to the landing is checked. */
|
|
94266
|
+
invitedByUserId: external_exports.string().nullable().optional()
|
|
94267
|
+
});
|
|
94268
|
+
|
|
94269
|
+
// ../../modules/workspace/contract/src/workspace-groups.ts
|
|
94270
|
+
var GROUP_MEMBERS_MAX_PER_CALL = 200;
|
|
94271
|
+
var idSchema25 = external_exports.string().min(1).max(80);
|
|
94272
|
+
var workspaceGroupSchemaDefinition = external_exports.object({
|
|
94273
|
+
id: idSchema25,
|
|
94274
|
+
name: external_exports.string(),
|
|
94275
|
+
/** Who is in it, by user id. */
|
|
94276
|
+
memberIds: external_exports.array(external_exports.string()),
|
|
94277
|
+
createdByUserId: external_exports.string(),
|
|
94278
|
+
createdAt: external_exports.iso.datetime()
|
|
94279
|
+
});
|
|
94280
|
+
var workspaceGroupSchema = workspaceGroupSchemaDefinition;
|
|
94281
|
+
var memberIdsSchema = external_exports.array(idSchema25).max(GROUP_MEMBERS_MAX_PER_CALL);
|
|
94282
|
+
var createGroupInputSchemaDefinition = external_exports.object({
|
|
94283
|
+
workspaceId: external_exports.string().min(1),
|
|
94284
|
+
name: external_exports.string().trim().min(1).max(80),
|
|
94285
|
+
memberIds: memberIdsSchema.default([])
|
|
94286
|
+
});
|
|
94287
|
+
var createGroupInputSchema = createGroupInputSchemaDefinition;
|
|
94288
|
+
var renameGroupInputSchemaDefinition = external_exports.object({
|
|
94289
|
+
workspaceId: external_exports.string().min(1),
|
|
94290
|
+
groupId: idSchema25,
|
|
94291
|
+
name: external_exports.string().trim().min(1).max(80)
|
|
94292
|
+
});
|
|
94293
|
+
var renameGroupInputSchema = renameGroupInputSchemaDefinition;
|
|
94294
|
+
var groupInputSchemaDefinition = external_exports.object({
|
|
94295
|
+
workspaceId: external_exports.string().min(1),
|
|
94296
|
+
groupId: idSchema25
|
|
94297
|
+
});
|
|
94298
|
+
var groupInputSchema = groupInputSchemaDefinition;
|
|
94299
|
+
var changeGroupMembersInputSchemaDefinition = external_exports.object({
|
|
94300
|
+
workspaceId: external_exports.string().min(1),
|
|
94301
|
+
groupId: idSchema25,
|
|
94302
|
+
add: memberIdsSchema.default([]),
|
|
94303
|
+
remove: memberIdsSchema.default([])
|
|
94304
|
+
});
|
|
94305
|
+
var changeGroupMembersInputSchema = changeGroupMembersInputSchemaDefinition;
|
|
94306
|
+
|
|
94307
|
+
// ../../modules/workspace/contract/src/workspace.ts
|
|
94308
|
+
var workspaceNameSchema = external_exports.string().trim().min(1).max(80);
|
|
94309
|
+
var WORKSPACE_LOGO_MAX_BYTES = 512 * 1024;
|
|
94310
|
+
var workspaceSchemaDefinition = external_exports.object({
|
|
94311
|
+
id: external_exports.string().min(1),
|
|
94312
|
+
name: external_exports.string(),
|
|
94313
|
+
createdByUserId: external_exports.string(),
|
|
94314
|
+
/** ISO 8601: tRPC carries plain JSON here. */
|
|
94315
|
+
createdAt: external_exports.iso.datetime(),
|
|
94316
|
+
/** When an Owner asked to delete it; null while it is not scheduled for deletion. */
|
|
94317
|
+
deletionScheduledAt: external_exports.iso.datetime().nullable().default(null),
|
|
94318
|
+
/** When it will be purged; null while it is not scheduled for deletion. */
|
|
94319
|
+
deletesAt: external_exports.iso.datetime().nullable().default(null),
|
|
94320
|
+
/** How many people its plan holds: one on Free; null or absent on Team, which takes everyone. */
|
|
94321
|
+
seatLimit: external_exports.number().int().positive().nullable().optional(),
|
|
94322
|
+
/** A short-lived link to the company logo; null while it has none and shows the Laze mark. */
|
|
94323
|
+
logoUrl: external_exports.string().nullable().optional()
|
|
94324
|
+
});
|
|
94325
|
+
var workspaceSchema = workspaceSchemaDefinition;
|
|
94326
|
+
var workspaceSummaryDefinition = external_exports.object({
|
|
94327
|
+
id: external_exports.string().min(1),
|
|
94328
|
+
name: external_exports.string(),
|
|
94329
|
+
createdByUserId: external_exports.string(),
|
|
94330
|
+
createdAt: external_exports.iso.datetime(),
|
|
94331
|
+
deletionScheduledAt: external_exports.iso.datetime().nullable(),
|
|
94332
|
+
seatLimit: external_exports.number().int().positive().nullable(),
|
|
94333
|
+
members: external_exports.number().int().nonnegative()
|
|
94334
|
+
});
|
|
94335
|
+
var workspaceSummarySchema = workspaceSummaryDefinition;
|
|
94336
|
+
var myWorkspaceSchemaDefinition = external_exports.object({
|
|
94337
|
+
id: external_exports.string().min(1),
|
|
94338
|
+
name: external_exports.string(),
|
|
94339
|
+
role: workspaceRoleSchema,
|
|
94340
|
+
/** A short-lived link to the company logo; null while it has none. */
|
|
94341
|
+
logoUrl: external_exports.string().nullable().optional()
|
|
94342
|
+
});
|
|
94343
|
+
var myWorkspaceSchema = myWorkspaceSchemaDefinition;
|
|
94344
|
+
var workspaceMemberSchemaDefinition = external_exports.object({
|
|
94345
|
+
userId: external_exports.string().min(1),
|
|
94346
|
+
email: external_exports.string(),
|
|
94347
|
+
name: external_exports.string(),
|
|
94348
|
+
role: workspaceRoleSchema,
|
|
94349
|
+
joinedAt: external_exports.iso.datetime(),
|
|
94350
|
+
/** Their picture, an uploaded or Google one; null or absent without one. */
|
|
94351
|
+
image: external_exports.string().nullable().optional(),
|
|
94352
|
+
/** Other names they go by in this workspace ("Also known as"); absent or empty without any. */
|
|
94353
|
+
aliases: external_exports.array(external_exports.string()).optional()
|
|
94354
|
+
});
|
|
94355
|
+
var workspaceMemberSchema = workspaceMemberSchemaDefinition;
|
|
94356
|
+
var ALIASES_MAX_COUNT = 5;
|
|
94357
|
+
var ALIAS_MAX_LENGTH = 40;
|
|
94358
|
+
var setAliasesInputSchemaDefinition = external_exports.object({
|
|
94359
|
+
workspaceId: external_exports.string().min(1),
|
|
94360
|
+
/** Trimmed; blank ones, repeats in any case and the person's own name are dropped. */
|
|
94361
|
+
aliases: external_exports.array(external_exports.string().trim().max(ALIAS_MAX_LENGTH)).max(ALIASES_MAX_COUNT)
|
|
94362
|
+
});
|
|
94363
|
+
var setAliasesInputSchema = setAliasesInputSchemaDefinition;
|
|
94364
|
+
var workspaceInviteSchemaDefinition = external_exports.object({
|
|
94365
|
+
id: external_exports.string().min(1),
|
|
94366
|
+
email: external_exports.string(),
|
|
94367
|
+
role: workspaceRoleSchema,
|
|
94368
|
+
invitedByUserId: external_exports.string(),
|
|
94369
|
+
expiresAt: external_exports.iso.datetime(),
|
|
94370
|
+
createdAt: external_exports.iso.datetime(),
|
|
94371
|
+
/** `held`: saved past the seat limit, not emailed, sent once on Team. Absent reads as pending. */
|
|
94372
|
+
status: external_exports.enum(["pending", "held"]).optional(),
|
|
94373
|
+
/** Where the invited person lands on joining; null for the workspace's Home. */
|
|
94374
|
+
landing: inviteLandingSchema.nullable().optional(),
|
|
94375
|
+
/** Held for Team, so its seat is paid for from the checkout on, before anyone accepts. */
|
|
94376
|
+
seatReserved: external_exports.boolean().optional()
|
|
94377
|
+
});
|
|
94378
|
+
var workspaceInviteSchema = workspaceInviteSchemaDefinition;
|
|
94379
|
+
var invitePreviewSchemaDefinition = external_exports.object({
|
|
94380
|
+
workspaceName: external_exports.string(),
|
|
94381
|
+
email: external_exports.string(),
|
|
94382
|
+
role: workspaceRoleSchema,
|
|
94383
|
+
status: external_exports.enum(["pending", "accepted", "revoked", "expired", "declined"])
|
|
94384
|
+
});
|
|
94385
|
+
var invitePreviewSchema = invitePreviewSchemaDefinition;
|
|
94386
|
+
var myInviteSchemaDefinition = external_exports.object({
|
|
94387
|
+
id: external_exports.string().min(1),
|
|
94388
|
+
workspaceId: external_exports.string().min(1),
|
|
94389
|
+
workspaceName: external_exports.string(),
|
|
94390
|
+
/** A short-lived link to the company logo; null while it has none. */
|
|
94391
|
+
logoUrl: external_exports.string().nullable(),
|
|
94392
|
+
role: workspaceRoleSchema,
|
|
94393
|
+
/** The member who sent it; `name` is null once they left the workspace. */
|
|
94394
|
+
invitedBy: external_exports.object({ userId: external_exports.string(), name: external_exports.string().nullable() }),
|
|
94395
|
+
expiresAt: external_exports.iso.datetime(),
|
|
94396
|
+
createdAt: external_exports.iso.datetime()
|
|
94397
|
+
});
|
|
94398
|
+
var myInviteSchema = myInviteSchemaDefinition;
|
|
94399
|
+
var createWorkspaceInputSchemaDefinition = external_exports.object({
|
|
94400
|
+
name: workspaceNameSchema,
|
|
94401
|
+
/** Where its creator came from, kept with the workspace; absent when the browser knew nothing. */
|
|
94402
|
+
source: signUpSourceSchema.nullable().optional()
|
|
94403
|
+
});
|
|
94404
|
+
var createWorkspaceInputSchema = createWorkspaceInputSchemaDefinition;
|
|
94405
|
+
var workspaceCreatedSchemaDefinition = external_exports.object({ id: external_exports.string().min(1) });
|
|
94406
|
+
var workspaceCreatedSchema = workspaceCreatedSchemaDefinition;
|
|
94407
|
+
var renameWorkspaceInputSchemaDefinition = external_exports.object({
|
|
94408
|
+
workspaceId: external_exports.string().min(1),
|
|
94409
|
+
name: workspaceNameSchema
|
|
94410
|
+
});
|
|
94411
|
+
var renameWorkspaceInputSchema = renameWorkspaceInputSchemaDefinition;
|
|
94412
|
+
var setWorkspaceLogoInputSchemaDefinition = external_exports.object({
|
|
94413
|
+
workspaceId: external_exports.string().min(1),
|
|
94414
|
+
/** Any type, so that a wrong one is refused as `workspace_logo_invalid`. */
|
|
94415
|
+
contentType: external_exports.string().min(1).max(100),
|
|
94416
|
+
/** The picture, base64; past the size limit it is refused as `workspace_logo_invalid`. */
|
|
94417
|
+
dataBase64: external_exports.string().min(1).max(Math.ceil(WORKSPACE_LOGO_MAX_BYTES * 8 / 3))
|
|
94418
|
+
});
|
|
94419
|
+
var setWorkspaceLogoInputSchema = setWorkspaceLogoInputSchemaDefinition;
|
|
94420
|
+
var memberErasureSchemaDefinition = external_exports.object({
|
|
94421
|
+
/** Workspaces shared with others that the person left. */
|
|
94422
|
+
left: external_exports.array(external_exports.string()),
|
|
94423
|
+
/** Workspaces only the person belonged to, deleted with the account. */
|
|
94424
|
+
deleted: external_exports.array(external_exports.string())
|
|
94425
|
+
});
|
|
94426
|
+
var deleteWorkspaceInputSchemaDefinition = external_exports.object({
|
|
94427
|
+
workspaceId: external_exports.string().min(1),
|
|
94428
|
+
/** The workspace's name, typed by the Owner to confirm. */
|
|
94429
|
+
confirmName: external_exports.string().max(200)
|
|
94430
|
+
});
|
|
94431
|
+
var deleteWorkspaceInputSchema = deleteWorkspaceInputSchemaDefinition;
|
|
94432
|
+
var myJoinRequestSchemaDefinition = external_exports.object({
|
|
94433
|
+
request: accessRequestSchema,
|
|
94434
|
+
workspaceName: external_exports.string()
|
|
94435
|
+
});
|
|
94436
|
+
var workspaceIdInputSchemaDefinition = external_exports.object({ workspaceId: external_exports.string().min(1) });
|
|
94437
|
+
var workspaceIdInputSchema = workspaceIdInputSchemaDefinition;
|
|
94438
|
+
var inviteMemberInputSchemaDefinition = external_exports.object({
|
|
94439
|
+
workspaceId: external_exports.string().min(1),
|
|
94440
|
+
email: external_exports.email().max(320),
|
|
94441
|
+
role: workspaceRoleSchema
|
|
94442
|
+
});
|
|
94443
|
+
var inviteMemberInputSchema = inviteMemberInputSchemaDefinition;
|
|
94444
|
+
var inviteManyInputSchemaDefinition = external_exports.object({
|
|
94445
|
+
workspaceId: external_exports.string().min(1),
|
|
94446
|
+
emails: external_exports.array(external_exports.string().max(320)).min(1).max(MAX_INVITES_PER_BATCH),
|
|
94447
|
+
role: workspaceRoleSchema,
|
|
94448
|
+
landing: inviteLandingSchema.nullable().default(null)
|
|
94449
|
+
});
|
|
94450
|
+
var inviteManyInputSchema = inviteManyInputSchemaDefinition;
|
|
94451
|
+
var inviteRefusalSchema = external_exports.enum(["invalid", "duplicate", "member"]);
|
|
94452
|
+
var inviteManyResultSchemaDefinition = external_exports.object({
|
|
94453
|
+
/** One open invitation per address that was not refused: new, or the one it already had. */
|
|
94454
|
+
invites: external_exports.array(workspaceInviteSchemaDefinition),
|
|
94455
|
+
refused: external_exports.array(external_exports.object({ email: external_exports.string(), reason: inviteRefusalSchema })),
|
|
94456
|
+
/** Some invitations wait for Team (the seat limit): none of those was emailed. */
|
|
94457
|
+
held: external_exports.boolean()
|
|
94458
|
+
});
|
|
94459
|
+
var inviteManyResultSchema = inviteManyResultSchemaDefinition;
|
|
94460
|
+
var requestInvitesResultSchemaDefinition = external_exports.object({
|
|
94461
|
+
requests: external_exports.array(accessRequestSchema),
|
|
94462
|
+
refused: external_exports.array(external_exports.object({ email: external_exports.string(), reason: inviteRefusalSchema })),
|
|
94463
|
+
/** Who approves them, the Owners and Admins by name: "Sent to Olga for approval". */
|
|
94464
|
+
approvers: external_exports.array(external_exports.string()).default([])
|
|
94465
|
+
});
|
|
94466
|
+
var requestInvitesResultSchema = requestInvitesResultSchemaDefinition;
|
|
94467
|
+
var acceptedInviteSchemaDefinition = external_exports.object({
|
|
94468
|
+
workspaceId: external_exports.string(),
|
|
94469
|
+
landing: inviteLandingSchema.nullable().default(null)
|
|
94470
|
+
});
|
|
94471
|
+
var acceptedInviteSchema = acceptedInviteSchemaDefinition;
|
|
94472
|
+
var revokeInviteInputSchemaDefinition = external_exports.object({
|
|
94473
|
+
workspaceId: external_exports.string().min(1),
|
|
94474
|
+
inviteId: external_exports.string().min(1)
|
|
94475
|
+
});
|
|
94476
|
+
var revokeInviteInputSchema = revokeInviteInputSchemaDefinition;
|
|
94477
|
+
var copiedInviteLinkSchemaDefinition = external_exports.object({
|
|
94478
|
+
inviteId: external_exports.string().min(1),
|
|
94479
|
+
email: external_exports.string(),
|
|
94480
|
+
url: external_exports.url(),
|
|
94481
|
+
expiresAt: external_exports.iso.datetime()
|
|
94482
|
+
});
|
|
94483
|
+
var copiedInviteLinkSchema = copiedInviteLinkSchemaDefinition;
|
|
94484
|
+
var inviteLinkInputSchemaDefinition = external_exports.object({
|
|
94485
|
+
inviteId: external_exports.string().min(1),
|
|
94486
|
+
secret: external_exports.string().min(1).max(200)
|
|
94487
|
+
});
|
|
94488
|
+
var inviteLinkInputSchema = inviteLinkInputSchemaDefinition;
|
|
94489
|
+
var changeRoleInputSchemaDefinition = external_exports.object({
|
|
94490
|
+
workspaceId: external_exports.string().min(1),
|
|
94491
|
+
userId: external_exports.string().min(1),
|
|
94492
|
+
role: workspaceRoleSchema
|
|
94493
|
+
});
|
|
94494
|
+
var changeRoleInputSchema = changeRoleInputSchemaDefinition;
|
|
94495
|
+
var removeMemberInputSchemaDefinition2 = external_exports.object({
|
|
94496
|
+
workspaceId: external_exports.string().min(1),
|
|
94497
|
+
userId: external_exports.string().min(1)
|
|
94498
|
+
});
|
|
94499
|
+
var removeMemberInputSchema2 = removeMemberInputSchemaDefinition2;
|
|
94500
|
+
var sessionPersonSchemaDefinition = external_exports.object({
|
|
94501
|
+
name: external_exports.string().nullable(),
|
|
94502
|
+
email: external_exports.string().nullable(),
|
|
94503
|
+
image: external_exports.string().nullable()
|
|
94504
|
+
}).nullable();
|
|
94505
|
+
var sessionPersonContext = defineMiddlewareContext(
|
|
94506
|
+
"workspaceSessionPerson",
|
|
94507
|
+
sessionPersonSchemaDefinition
|
|
94508
|
+
);
|
|
94509
|
+
var joinTargetSchemaDefinition = external_exports.object({ workspaceId: external_exports.string().min(1), name: external_exports.string() });
|
|
94510
|
+
var WorkspaceApi = moduleApi()("workspace");
|
|
94511
|
+
var WORKSPACE_GET_PATH = "workspace.get";
|
|
94512
|
+
var settingsCopy = {
|
|
94513
|
+
path: WORKSPACE_GET_PATH,
|
|
94514
|
+
paintOnly: true,
|
|
94515
|
+
storable: (copy2) => copy2
|
|
94516
|
+
};
|
|
94517
|
+
var workspaceTrpc = defineTrpcContract("workspace").mutation("create").withInput(createWorkspaceInputSchema).withOutput(workspaceCreatedSchema).query("get", { mirrored: settingsCopy }).withInput(workspaceIdInputSchema).withOutput(workspaceSchema).query("mine").withInput(external_exports.object({})).withOutput(external_exports.array(myWorkspaceSchema)).query("members").withInput(workspaceIdInputSchema).withOutput(external_exports.array(workspaceMemberSchema)).query("myMembership").withInput(workspaceIdInputSchema).withOutput(workspaceMemberSchema.nullable()).mutation("setMyAliases").withInput(setAliasesInputSchema).withOutput(workspaceMemberSchema).mutation("changeRole").withInput(changeRoleInputSchema).withOutput(workspaceMemberSchema).mutation("removeMember").withInput(removeMemberInputSchema2).withOutput(external_exports.object({ removed: external_exports.literal(true) })).mutation("leave").withInput(workspaceIdInputSchema).withOutput(external_exports.object({ left: external_exports.literal(true) })).mutation("invite").withInput(inviteMemberInputSchema).withOutput(workspaceInviteSchema).mutation("inviteMany").withInput(inviteManyInputSchema).withOutput(inviteManyResultSchema).mutation("requestInvites").withInput(inviteManyInputSchema).withOutput(requestInvitesResultSchema).query("invites").withInput(workspaceIdInputSchema).withOutput(external_exports.array(workspaceInviteSchema)).mutation("revokeInvite").withInput(revokeInviteInputSchema).withOutput(external_exports.object({ revoked: external_exports.literal(true) })).mutation("copyInviteLink").withInput(revokeInviteInputSchema).withOutput(copiedInviteLinkSchema).query("previewInvite").withInput(inviteLinkInputSchema).withOutput(invitePreviewSchema).mutation("acceptInvite").withInput(inviteLinkInputSchema).withOutput(acceptedInviteSchema).mutation("rename").withInput(renameWorkspaceInputSchema).withOutput(workspaceSchema).mutation("setLogo").withInput(setWorkspaceLogoInputSchema).withOutput(workspaceSchema).mutation("removeLogo").withInput(workspaceIdInputSchema).withOutput(workspaceSchema).mutation("delete").withInput(deleteWorkspaceInputSchema).withOutput(workspaceSchema).mutation("cancelDeletion").withInput(workspaceIdInputSchema).withOutput(workspaceSchema).mutation("requestInvite").withInput(requestInviteInputSchema).withOutput(accessRequestSchema).query("accessRequests").withInput(workspaceIdInputSchema).withOutput(external_exports.array(accessRequestSchema)).mutation("decideAccessRequest").withInput(decideAccessRequestInputSchema).withOutput(accessRequestSchema).mutation("withdrawJoinRequest").withInput(external_exports.object({ workspaceId: external_exports.string().min(1), requestId: external_exports.string().min(1) })).withOutput(accessRequestSchema).query("groups").withInput(workspaceIdInputSchema).withOutput(external_exports.array(workspaceGroupSchema)).mutation("createGroup").withInput(createGroupInputSchema).withOutput(workspaceGroupSchema).mutation("renameGroup").withInput(renameGroupInputSchema).withOutput(workspaceGroupSchema).mutation("deleteGroup").withInput(groupInputSchema).withOutput(external_exports.object({ deleted: external_exports.literal(true) })).mutation("changeGroupMembers").withInput(changeGroupMembersInputSchema).withOutput(workspaceGroupSchema).build();
|
|
94518
|
+
|
|
94519
|
+
// ../../modules/workspace/contract/src/workspace.config.ts
|
|
94520
|
+
var workspaceConfig = Config.define((c) => ({
|
|
94521
|
+
publicBaseUrl,
|
|
94522
|
+
/** Plan seat limits (Free holds one person); off on a server that takes no payment. */
|
|
94523
|
+
seatLimits: c.env("LAZE_SEAT_LIMITS", external_exports.enum(["on", "off"]).default("on"))
|
|
94524
|
+
}));
|
|
94525
|
+
|
|
94526
|
+
// ../../modules/workspace/contract/src/workspace.ui.ts
|
|
94527
|
+
var workspaceUi = uiTokens("workspace");
|
|
94528
|
+
var ProfileSettingsSlot = workspaceUi.extension("settings.profile");
|
|
94529
|
+
var AccountSettingsSlot = workspaceUi.extension("settings.account");
|
|
94530
|
+
var PrivacySettingsSlot = workspaceUi.extension("settings.privacy");
|
|
94531
|
+
var NotificationSettingsSlot = workspaceUi.extension("settings.notifications");
|
|
94532
|
+
var ChatDisplaySettingsSlot = workspaceUi.extension("settings.chatDisplay");
|
|
94533
|
+
var CliKeysSettingsSlot = workspaceUi.extension("settings.cliKeys");
|
|
94534
|
+
var SignInSettingsSlot = workspaceUi.extension("settings.signIn");
|
|
94535
|
+
var AppsSettingsSlot = workspaceUi.extension("settings.apps");
|
|
94536
|
+
var BillingSettingsSlot = workspaceUi.extension("settings.billing");
|
|
94537
|
+
var ModelSettingsSlot = workspaceUi.extension("settings.models");
|
|
94538
|
+
var AgentLoginsSettingsSlot = workspaceUi.extension("settings.agentLogins");
|
|
94539
|
+
var LoginPoolsSettingsSlot = workspaceUi.extension("settings.loginPools");
|
|
94540
|
+
var MachinesSettingsSlot = workspaceUi.extension("settings.machines");
|
|
94541
|
+
var MessagingSettingsSlot = workspaceUi.extension("settings.messaging");
|
|
94542
|
+
var ExternalConnectionsSettingsSlot = workspaceUi.extension("settings.externalConnections");
|
|
94543
|
+
var LangwatchSettingsSlot = workspaceUi.extension("settings.langwatch");
|
|
94544
|
+
var LoginPoolsNavGateSlot = workspaceUi.extension("settings.loginPools.navGate");
|
|
94545
|
+
var WorkspaceRailSlot = workspaceUi.component("rail");
|
|
94546
|
+
var WorkspaceAlertsSlot = workspaceUi.extension("frame.alerts");
|
|
94547
|
+
var WorkspaceSidebarSlot = workspaceUi.component("sidebar");
|
|
94548
|
+
var WorkspaceSidebarHeadSlot = workspaceUi.component("sidebar.head");
|
|
94549
|
+
var WorkspaceSidebarTopSlot = workspaceUi.component("sidebar.top");
|
|
94550
|
+
var WorkspaceSidebarFooterSlot = workspaceUi.extension("sidebar.footer");
|
|
94551
|
+
var WorkspaceInviteDialogSlot = workspaceUi.component("inviteDialog");
|
|
94552
|
+
var ProfileHooksToken = workspaceUi.hooks("profile");
|
|
94553
|
+
|
|
94554
|
+
// ../../modules/workspace/contract/src/workspace.events.ts
|
|
94555
|
+
var memberRemovedDefinition = external_exports.object({
|
|
94556
|
+
workspaceId: external_exports.string().min(1),
|
|
94557
|
+
userId: external_exports.string().min(1),
|
|
94558
|
+
/** ISO 8601. */
|
|
94559
|
+
at: external_exports.iso.datetime()
|
|
94560
|
+
});
|
|
94561
|
+
var memberErasedDefinition = external_exports.object({
|
|
94562
|
+
workspaceId: external_exports.string().min(1),
|
|
94563
|
+
userId: external_exports.string().min(1),
|
|
94564
|
+
/** ISO 8601. */
|
|
94565
|
+
at: external_exports.iso.datetime()
|
|
94566
|
+
});
|
|
94567
|
+
var groupChangedDefinition = external_exports.object({
|
|
94568
|
+
workspaceId: external_exports.string().min(1),
|
|
94569
|
+
groupId: external_exports.string().min(1),
|
|
94570
|
+
/** Who joined the group. */
|
|
94571
|
+
added: external_exports.array(external_exports.string().min(1)),
|
|
94572
|
+
/** Who left it; everyone in it when it was deleted. */
|
|
94573
|
+
removed: external_exports.array(external_exports.string().min(1)),
|
|
94574
|
+
/** The group is gone, so anything linked to it drops the link. */
|
|
94575
|
+
deleted: external_exports.boolean(),
|
|
94576
|
+
/** A workspace member named for the notices this causes. */
|
|
94577
|
+
byUserId: external_exports.string().min(1),
|
|
94578
|
+
/** Unique per change. */
|
|
94579
|
+
changeId: external_exports.string().min(1),
|
|
94580
|
+
/** ISO 8601. */
|
|
94581
|
+
at: external_exports.iso.datetime()
|
|
94582
|
+
});
|
|
94583
|
+
var requestApprovedDefinition = external_exports.object({
|
|
94584
|
+
workspaceId: external_exports.string().min(1),
|
|
94585
|
+
requestId: external_exports.string().min(1),
|
|
94586
|
+
email: external_exports.string(),
|
|
94587
|
+
approvedByUserId: external_exports.string().min(1),
|
|
94588
|
+
/** ISO 8601. */
|
|
94589
|
+
at: external_exports.iso.datetime()
|
|
94590
|
+
});
|
|
94591
|
+
var deletionScheduledDefinition = external_exports.object({
|
|
94592
|
+
workspaceId: external_exports.string().min(1),
|
|
94593
|
+
byUserId: external_exports.string().min(1),
|
|
94594
|
+
/** ISO 8601: when it was asked, which names this schedule. */
|
|
94595
|
+
at: external_exports.iso.datetime(),
|
|
94596
|
+
/** ISO 8601: when the workspace is purged. */
|
|
94597
|
+
deletesAt: external_exports.iso.datetime()
|
|
94598
|
+
});
|
|
94599
|
+
var deletionCancelledDefinition = external_exports.object({
|
|
94600
|
+
workspaceId: external_exports.string().min(1),
|
|
94601
|
+
byUserId: external_exports.string().min(1),
|
|
94602
|
+
/** ISO 8601. */
|
|
94603
|
+
at: external_exports.iso.datetime()
|
|
94604
|
+
});
|
|
94605
|
+
var workspaceCreatedDefinition = external_exports.object({
|
|
94606
|
+
workspaceId: external_exports.string().min(1),
|
|
94607
|
+
createdByUserId: external_exports.string().min(1),
|
|
94608
|
+
/** Where the creator came from (first touch); null when their tab kept no visit. */
|
|
94609
|
+
source: signUpSourceSchema.nullable(),
|
|
94610
|
+
/** ISO 8601. */
|
|
94611
|
+
at: external_exports.iso.datetime()
|
|
94612
|
+
});
|
|
94613
|
+
var inviteSentDefinition = external_exports.object({
|
|
94614
|
+
workspaceId: external_exports.string().min(1),
|
|
94615
|
+
inviteId: external_exports.string().min(1),
|
|
94616
|
+
invitedByUserId: external_exports.string().min(1),
|
|
94617
|
+
role: external_exports.string().min(1),
|
|
94618
|
+
/** ISO 8601. */
|
|
94619
|
+
at: external_exports.iso.datetime()
|
|
94620
|
+
});
|
|
94621
|
+
var workspaceDeletedDefinition = external_exports.object({
|
|
94622
|
+
workspaceId: external_exports.string().min(1),
|
|
94623
|
+
/** ISO 8601. */
|
|
94624
|
+
at: external_exports.iso.datetime()
|
|
94625
|
+
});
|
|
94626
|
+
var deletionStateDefinition = external_exports.object({
|
|
94627
|
+
workspaceId: external_exports.string(),
|
|
94628
|
+
/** ISO 8601 of the schedule waiting to purge; null when none waits. */
|
|
94629
|
+
scheduledAt: external_exports.iso.datetime().nullable(),
|
|
94630
|
+
/** Epoch milliseconds of the purge; null when none waits. */
|
|
94631
|
+
deletesAt: external_exports.number().nullable()
|
|
94632
|
+
});
|
|
94633
|
+
var purgeIntentDefinition = external_exports.object({
|
|
94634
|
+
workspaceId: external_exports.string().min(1),
|
|
94635
|
+
/** ISO 8601 of the schedule this purge belongs to. */
|
|
94636
|
+
scheduledAt: external_exports.iso.datetime()
|
|
94637
|
+
});
|
|
94638
|
+
|
|
94639
|
+
// ../../modules/workspace/contract/src/workspace-invites.ts
|
|
94640
|
+
var addressSchema = external_exports.email().max(320);
|
|
94641
|
+
|
|
94642
|
+
// ../../modules/workspace/contract/src/team-activation.ts
|
|
94643
|
+
var ACTIVATION_DAYS = 7;
|
|
94644
|
+
var ACTIVATION_WINDOW_MS = ACTIVATION_DAYS * 24 * 60 * 60 * 1e3;
|
|
94645
|
+
|
|
94646
|
+
// ../../modules/auth/contract/src/auth-ad-conversion.ts
|
|
94647
|
+
var metaCookieSchema = external_exports.string().regex(/^fb\.\d\.\d{10,16}\.[A-Za-z0-9_.-]{1,500}$/).nullable();
|
|
94648
|
+
var adClickSchemaDefinition = external_exports.object({
|
|
94649
|
+
/** Meta's click id cookie, or one built from the first visit's `fbclid`. */
|
|
94650
|
+
fbc: metaCookieSchema,
|
|
94651
|
+
/** Meta's browser id cookie. */
|
|
94652
|
+
fbp: metaCookieSchema
|
|
94653
|
+
});
|
|
94654
|
+
var adClickSchema = adClickSchemaDefinition;
|
|
94655
|
+
|
|
94656
|
+
// ../../modules/auth/contract/src/auth-sign-up-source.ts
|
|
94657
|
+
var setHeardFromInputSchemaDefinition = external_exports.object({
|
|
94658
|
+
answer: heardFromSchema,
|
|
94659
|
+
/** Only with `other`: what the person typed. */
|
|
94660
|
+
other: heardFromOtherSchema.nullable().optional()
|
|
94661
|
+
});
|
|
94662
|
+
var setHeardFromInputSchema = setHeardFromInputSchemaDefinition;
|
|
94663
|
+
var consentAtSignUpSchema = external_exports.enum(["accepted", "rejected", "unanswered"]);
|
|
94664
|
+
var recordSignUpSourceInputSchemaDefinition = external_exports.object({
|
|
94665
|
+
...signUpSourceSchema.shape,
|
|
94666
|
+
/** Absent from browsers older than the consent state; kept as none then. */
|
|
94667
|
+
consentAtSignUp: consentAtSignUpSchema.optional(),
|
|
94668
|
+
/** Whether the banner answer allowed Advertising; absent reads as not allowed. */
|
|
94669
|
+
advertisingAtSignUp: external_exports.boolean().optional(),
|
|
94670
|
+
/** The ad network ids the browser held, sent only with Advertising allowed. */
|
|
94671
|
+
adClick: adClickSchema.optional()
|
|
94672
|
+
});
|
|
94673
|
+
var recordSignUpSourceInputSchema = recordSignUpSourceInputSchemaDefinition;
|
|
94674
|
+
var recordConsentAtSignUpInputSchemaDefinition = external_exports.object({ consent: consentAtSignUpSchema });
|
|
94675
|
+
var recordConsentAtSignUpInputSchema = recordConsentAtSignUpInputSchemaDefinition;
|
|
94676
|
+
var signUpKeptViaSchema = external_exports.enum(["visit", "invite", "join_offer", "unrecorded"]);
|
|
94677
|
+
|
|
94678
|
+
// ../../modules/auth/contract/src/auth.events.ts
|
|
94679
|
+
var impersonationStartedPayloadDefinition = external_exports.object({
|
|
94680
|
+
visitId: external_exports.string().min(1),
|
|
94681
|
+
operatorUserId: external_exports.string().min(1),
|
|
94682
|
+
targetUserId: external_exports.string().min(1),
|
|
94683
|
+
workspaceId: external_exports.string().nullable(),
|
|
94684
|
+
reason: external_exports.string(),
|
|
94685
|
+
startedAt: external_exports.iso.datetime(),
|
|
94686
|
+
endsAt: external_exports.iso.datetime()
|
|
94687
|
+
});
|
|
94688
|
+
var impersonationEndingSchema = external_exports.enum(["stopped", "timed_out"]);
|
|
94689
|
+
var impersonationEndedPayloadDefinition = external_exports.object({
|
|
94690
|
+
visitId: external_exports.string().min(1),
|
|
94691
|
+
operatorUserId: external_exports.string().min(1),
|
|
94692
|
+
targetUserId: external_exports.string().min(1),
|
|
94693
|
+
reason: external_exports.string(),
|
|
94694
|
+
endedAt: external_exports.iso.datetime(),
|
|
94695
|
+
how: impersonationEndingSchema
|
|
94696
|
+
});
|
|
94697
|
+
var signUpSourceRecordedPayloadDefinition = external_exports.object({
|
|
94698
|
+
userId: external_exports.string().min(1),
|
|
94699
|
+
source: signUpSourceSchema,
|
|
94700
|
+
/** When the account was created, ISO 8601. */
|
|
94701
|
+
signedUpAt: external_exports.iso.datetime(),
|
|
94702
|
+
at: external_exports.iso.datetime(),
|
|
94703
|
+
/** How the source was kept; facts from before it existed were all `visit`. */
|
|
94704
|
+
keptVia: signUpKeptViaSchema.optional(),
|
|
94705
|
+
/** The colleague's workspace the person joined, for `invite` and `join_offer`. */
|
|
94706
|
+
joinedWorkspaceId: external_exports.string().min(1).nullable().optional()
|
|
94707
|
+
});
|
|
94708
|
+
var emailVerifiedPayloadDefinition = external_exports.object({
|
|
94709
|
+
userId: external_exports.string().min(1),
|
|
94710
|
+
/** When the address was verified; the account's creation for one created verified. */
|
|
94711
|
+
at: external_exports.iso.datetime(),
|
|
94712
|
+
/** `link`: opened the verification email; `provider`: Google, Apple, SSO or a magic link. */
|
|
94713
|
+
via: external_exports.enum(["link", "provider"])
|
|
94714
|
+
});
|
|
94715
|
+
|
|
94716
|
+
// ../../modules/auth/contract/src/auth-language.ts
|
|
94717
|
+
var languageOptionDefinition = external_exports.object({ tag: external_exports.string(), label: external_exports.string() });
|
|
94718
|
+
var languageOptionSchema = languageOptionDefinition;
|
|
94719
|
+
var setLanguageInputDefinition = external_exports.object({ language: external_exports.string().trim().min(1).max(35) });
|
|
94720
|
+
var setLanguageInputSchema = setLanguageInputDefinition;
|
|
94721
|
+
|
|
94722
|
+
// ../../modules/auth/contract/src/auth.trpc.ts
|
|
94723
|
+
var authTrpc = defineTrpcContract("auth").query("me").withInput(external_exports.object({})).withOutput(authUserSchema.nullable()).query("languages").withInput(external_exports.object({})).withOutput(external_exports.array(languageOptionSchema)).mutation("setLanguage").withInput(setLanguageInputSchema).withOutput(authUserSchema).mutation("recordSignUpSource").withInput(recordSignUpSourceInputSchema).withOutput(external_exports.object({ kept: external_exports.boolean() })).mutation("recordConsentAtSignUp").withInput(recordConsentAtSignUpInputSchema).withOutput(external_exports.object({ kept: external_exports.boolean() })).query("analyticsConsent").withInput(external_exports.object({})).withOutput(analyticsConsentReadingSchema).mutation("setAnalyticsConsent").withInput(setAnalyticsConsentInputSchema).withOutput(analyticsConsentReadingSchema).mutation("setHeardFrom").withInput(setHeardFromInputSchema).withOutput(external_exports.object({ saved: external_exports.literal(true) })).query("deviceKeys").withInput(external_exports.object({})).withOutput(deviceKeysSchema).mutation("deleteAccount").withInput(external_exports.object({ confirmEmail: external_exports.string().trim().min(1).max(320) })).withOutput(external_exports.object({ deleted: external_exports.literal(true) })).query("impersonation").withInput(external_exports.object({})).withOutput(impersonationSchema.nullable()).mutation("stopImpersonation").withInput(external_exports.object({})).withOutput(impersonationSchema.nullable()).query("signInOptions").withInput(external_exports.object({})).withOutput(signInOptionsSchema).query("signInRoute").withInput(external_exports.object({ email: external_exports.string().trim().min(3).max(320) })).withOutput(signInRouteSchema).query("joinOffer").withInput(external_exports.object({})).withOutput(joinOfferReadingSchema).query("myInvites").withInput(external_exports.object({})).withOutput(external_exports.array(myInviteSchema)).mutation("acceptMyInvite").withInput(external_exports.object({ inviteId: external_exports.string().min(1).max(200) })).withOutput(acceptedInviteSchema).mutation("declineMyInvite").withInput(external_exports.object({ inviteId: external_exports.string().min(1).max(200) })).withOutput(external_exports.object({ declined: external_exports.literal(true) })).mutation("requestToJoin").withInput(external_exports.object({ workspaceId: external_exports.string().min(1) })).withOutput(joinAnswerSchema).query("joinDomains").withInput(external_exports.object({ workspaceId: external_exports.string().min(1) })).withOutput(external_exports.array(joinDomainSchema)).mutation("setDomainAutoJoin").withInput(setDomainAutoJoinInputSchema).withOutput(joinDomainSchema).build();
|
|
94724
|
+
|
|
94725
|
+
// ../../modules/auth/contract/src/auth.config.ts
|
|
94726
|
+
var originListSchema = external_exports.string().optional().transform(
|
|
94727
|
+
(value) => (value ?? "").split(",").map((origin) => origin.trim()).filter((origin) => origin !== "")
|
|
94728
|
+
);
|
|
94729
|
+
var blankIsUnset = external_exports.string().optional().transform((value) => value?.trim() ? value.trim() : void 0);
|
|
94730
|
+
var authConfig = Config.define((c) => ({
|
|
94731
|
+
publicBaseUrl,
|
|
94732
|
+
publicOriginAliases,
|
|
94733
|
+
trustedOrigins: c.env("AUTH_TRUSTED_ORIGINS", originListSchema),
|
|
94734
|
+
googleClientId: c.env("GOOGLE_CLIENT_ID", blankIsUnset),
|
|
94735
|
+
googleIssuer: c.env("GOOGLE_ISSUER", blankIsUnset),
|
|
94736
|
+
/** Sign in with Apple's Services ID, team and key id; APPLE_SIGNIN_KEY_P8 turns it on. */
|
|
94737
|
+
appleServicesId: c.env("APPLE_SERVICES_ID", blankIsUnset),
|
|
94738
|
+
appleTeamId: c.env("APPLE_TEAM_ID", blankIsUnset),
|
|
94739
|
+
appleKeyId: c.env("APPLE_SIGNIN_KEY_ID", blankIsUnset),
|
|
94740
|
+
/** The iPhone app's `<team id>.<bundle id>` names for universal links; none turns them off. */
|
|
94741
|
+
iosAppIds: c.env("IOS_APP_IDS", originListSchema),
|
|
94742
|
+
/** Cloudflare Turnstile's public site key; TURNSTILE_SECRET_KEY is its secret half. */
|
|
94743
|
+
turnstileSiteKey: c.env("TURNSTILE_SITE_KEY", blankIsUnset),
|
|
94744
|
+
/** Domains whose plus addresses sign up without the captcha (Laze's own QA addresses). */
|
|
94745
|
+
captchaExemptDomains: c.env(
|
|
94746
|
+
"AUTH_CAPTCHA_EXEMPT_DOMAINS",
|
|
94747
|
+
external_exports.string().optional().transform(
|
|
94748
|
+
(value) => (value ?? "langwatch.ai").split(",").map((domain2) => domain2.trim().toLowerCase()).filter((domain2) => domain2 !== "")
|
|
94749
|
+
)
|
|
94750
|
+
)
|
|
94751
|
+
}));
|
|
94752
|
+
|
|
94753
|
+
// ../../modules/auth/contract/src/auth.ui.ts
|
|
94754
|
+
var AccountOperationsToken = uiTokens("auth").operations("account");
|
|
94755
|
+
var ImpersonationBannerSlot = uiTokens("auth").component("impersonationBanner");
|
|
94756
|
+
|
|
94757
|
+
// ../../modules/authz/contract/src/authz.api.ts
|
|
94758
|
+
var platformPermissionSchema = external_exports.enum(["ops:view", "ops:manage"]);
|
|
94759
|
+
var platformGrantDefinition = external_exports.object({
|
|
94760
|
+
userId: external_exports.string().min(1),
|
|
94761
|
+
permission: platformPermissionSchema,
|
|
94762
|
+
/** The operator who granted it, or `system` for the box task. */
|
|
94763
|
+
grantedBy: external_exports.string().min(1),
|
|
94764
|
+
reason: external_exports.string().min(1),
|
|
94765
|
+
grantedAt: external_exports.iso.datetime()
|
|
94766
|
+
});
|
|
94767
|
+
var platformGrantSchema = platformGrantDefinition;
|
|
94768
|
+
var AuthzApi = moduleApi()("authz");
|
|
94769
|
+
|
|
94770
|
+
// ../../modules/authz/contract/src/authz.trpc.ts
|
|
94771
|
+
var authzTrpc = defineTrpcContract("authz").query("myPermissions").withInput(external_exports.object({ workspaceId: external_exports.string().min(1) })).withOutput(external_exports.array(authzPermissionSchema)).build();
|
|
94772
|
+
|
|
94773
|
+
// ../../modules/feature-flag/contract/src/feature-flag.api.ts
|
|
94774
|
+
var featureFlagKeySchema = external_exports.string().regex(/^[a-z][a-z0-9_]{1,63}$/, "a flag key is lower-case letters, digits and underscores");
|
|
94775
|
+
var featureFlagSchemaDefinition = external_exports.object({ key: featureFlagKeySchema, enabled: external_exports.boolean() });
|
|
94776
|
+
var featureFlagSchema = featureFlagSchemaDefinition;
|
|
94777
|
+
var setFeatureFlagInputSchemaDefinition = external_exports.object({
|
|
94778
|
+
workspaceId: external_exports.string().min(1),
|
|
94779
|
+
key: featureFlagKeySchema,
|
|
94780
|
+
enabled: external_exports.boolean()
|
|
94781
|
+
});
|
|
94782
|
+
var setFeatureFlagInputSchema = setFeatureFlagInputSchemaDefinition;
|
|
94783
|
+
var listFeatureFlagsInputSchemaDefinition = external_exports.object({ workspaceId: external_exports.string().min(1) });
|
|
94784
|
+
var listFeatureFlagsInputSchema = listFeatureFlagsInputSchemaDefinition;
|
|
94785
|
+
var setPersonFeatureFlagInputSchemaDefinition = external_exports.object({
|
|
94786
|
+
userId: external_exports.string().min(1),
|
|
94787
|
+
key: featureFlagKeySchema,
|
|
94788
|
+
enabled: external_exports.boolean()
|
|
94789
|
+
});
|
|
94790
|
+
var FeatureFlagApi = moduleApi()("feature-flag");
|
|
94791
|
+
|
|
94792
|
+
// ../../modules/feature-flag/contract/src/feature-flag.trpc.ts
|
|
94793
|
+
var featureFlagTrpc = defineTrpcContract("featureFlag").query("list").withInput(listFeatureFlagsInputSchema).withOutput(external_exports.array(featureFlagSchema)).mutation("set").withInput(setFeatureFlagInputSchema).withOutput(featureFlagSchema).build();
|
|
94794
|
+
|
|
94795
|
+
// ../../modules/ops/contract/src/ops.api.ts
|
|
94796
|
+
var reasonSchema = external_exports.string().trim().min(3).max(500);
|
|
94797
|
+
var searchDefinition = external_exports.object({
|
|
94798
|
+
query: external_exports.string().trim().max(200).default(""),
|
|
94799
|
+
limit: external_exports.number().int().min(1).max(100).default(50)
|
|
94800
|
+
});
|
|
94801
|
+
var opsSearchInputSchema = searchDefinition;
|
|
94802
|
+
var operatorDefinition = external_exports.object({
|
|
94803
|
+
userId: external_exports.string(),
|
|
94804
|
+
/** Holds `ops:manage`: plan changes, credits, flags, parked work and impersonation. */
|
|
94805
|
+
manage: external_exports.boolean()
|
|
94806
|
+
});
|
|
94807
|
+
var opsOperatorSchema = operatorDefinition;
|
|
94808
|
+
var workspaceRowDefinition = external_exports.object({
|
|
94809
|
+
...workspaceSummarySchema.shape,
|
|
94810
|
+
plan: external_exports.enum(["free", "team"]),
|
|
94811
|
+
status: external_exports.string(),
|
|
94812
|
+
complimentarySeats: external_exports.number().int().positive().nullable(),
|
|
94813
|
+
/** Spent this billing period, in the workspace's currency. */
|
|
94814
|
+
spent: external_exports.number(),
|
|
94815
|
+
currency: external_exports.string()
|
|
94816
|
+
});
|
|
94817
|
+
var opsWorkspaceRowSchema = workspaceRowDefinition;
|
|
94818
|
+
var workspaceDetailDefinition = external_exports.object({
|
|
94819
|
+
workspace: workspaceSummarySchema,
|
|
94820
|
+
members: external_exports.array(workspaceMemberSchema),
|
|
94821
|
+
invites: external_exports.array(workspaceInviteSchema),
|
|
94822
|
+
agents: external_exports.array(agentListEntrySchema),
|
|
94823
|
+
billing: billingAccountViewSchema,
|
|
94824
|
+
flags: external_exports.array(featureFlagSchema),
|
|
94825
|
+
activity: external_exports.array(auditEntrySchema),
|
|
94826
|
+
/** The members' complimentary computer sizes that hold now. */
|
|
94827
|
+
computers: external_exports.array(complimentaryComputerSchema).default([])
|
|
94828
|
+
});
|
|
94829
|
+
var opsWorkspaceDetailSchema = workspaceDetailDefinition;
|
|
94830
|
+
var userRowDefinition = external_exports.object({
|
|
94831
|
+
...authUserSummarySchema.shape,
|
|
94832
|
+
workspaces: external_exports.array(myWorkspaceSchema)
|
|
94833
|
+
});
|
|
94834
|
+
var opsUserRowSchema = userRowDefinition;
|
|
94835
|
+
var setPlanDefinition = external_exports.object({
|
|
94836
|
+
workspaceId: external_exports.string().min(1),
|
|
94837
|
+
/** People on the complimentary Team; null ends it and returns the workspace to Free. */
|
|
94838
|
+
seats: external_exports.number().int().positive().max(1e4).nullable(),
|
|
94839
|
+
reason: reasonSchema
|
|
94840
|
+
});
|
|
94841
|
+
var opsSetPlanInputSchema = setPlanDefinition;
|
|
94842
|
+
var setComputerDefinition = external_exports.object({
|
|
94843
|
+
workspaceId: external_exports.string().min(1),
|
|
94844
|
+
userId: external_exports.string().min(1),
|
|
94845
|
+
/** Medium, Large or XL for free; null ends the person's complimentary size. */
|
|
94846
|
+
size: complimentarySizeSchema.nullable(),
|
|
94847
|
+
/** When it ends; null keeps it until staff end it. */
|
|
94848
|
+
until: external_exports.iso.datetime().nullable().default(null),
|
|
94849
|
+
reason: reasonSchema
|
|
94850
|
+
});
|
|
94851
|
+
var opsSetComputerInputSchema = setComputerDefinition;
|
|
94852
|
+
var grantCreditsDefinition = external_exports.object({
|
|
94853
|
+
workspaceId: external_exports.string().min(1),
|
|
94854
|
+
amount: external_exports.number().positive().max(1e4),
|
|
94855
|
+
reason: reasonSchema
|
|
94856
|
+
});
|
|
94857
|
+
var opsGrantCreditsInputSchema = grantCreditsDefinition;
|
|
94858
|
+
var setFlagDefinition = external_exports.object({
|
|
94859
|
+
workspaceId: external_exports.string().min(1),
|
|
94860
|
+
key: featureFlagKeySchema,
|
|
94861
|
+
enabled: external_exports.boolean(),
|
|
94862
|
+
reason: reasonSchema
|
|
94863
|
+
});
|
|
94864
|
+
var opsSetFlagInputSchema = setFlagDefinition;
|
|
94865
|
+
var parkedDefinition = external_exports.object({
|
|
94866
|
+
/** False when this process runs without eventing, so nothing can be read. */
|
|
94867
|
+
available: external_exports.boolean(),
|
|
94868
|
+
dead: external_exports.object({
|
|
94869
|
+
total: external_exports.number().int().nonnegative(),
|
|
94870
|
+
messages: external_exports.array(
|
|
94871
|
+
external_exports.object({
|
|
94872
|
+
id: external_exports.string(),
|
|
94873
|
+
processName: external_exports.string(),
|
|
94874
|
+
intentType: external_exports.string(),
|
|
94875
|
+
attempts: external_exports.number().int(),
|
|
94876
|
+
updatedAt: external_exports.iso.datetime()
|
|
94877
|
+
})
|
|
94878
|
+
)
|
|
94879
|
+
}),
|
|
94880
|
+
blocked: external_exports.array(
|
|
94881
|
+
external_exports.object({
|
|
94882
|
+
queueName: external_exports.string(),
|
|
94883
|
+
groupId: external_exports.string(),
|
|
94884
|
+
error: external_exports.string(),
|
|
94885
|
+
staged: external_exports.number().int(),
|
|
94886
|
+
poisoned: external_exports.boolean()
|
|
94887
|
+
})
|
|
94888
|
+
),
|
|
94889
|
+
deadLettered: external_exports.array(
|
|
94890
|
+
external_exports.object({
|
|
94891
|
+
queueName: external_exports.string(),
|
|
94892
|
+
groupId: external_exports.string(),
|
|
94893
|
+
jobs: external_exports.number().int(),
|
|
94894
|
+
error: external_exports.string()
|
|
94895
|
+
})
|
|
94896
|
+
)
|
|
94897
|
+
});
|
|
94898
|
+
var opsParkedSchema = parkedDefinition;
|
|
94899
|
+
var parkedActDefinition = external_exports.discriminatedUnion("action", [
|
|
94900
|
+
external_exports.object({ action: external_exports.enum(["redrive", "discard"]), id: external_exports.string().min(1), reason: reasonSchema }),
|
|
94901
|
+
external_exports.object({
|
|
94902
|
+
action: external_exports.enum(["unblock", "replay", "drop"]),
|
|
94903
|
+
queueName: external_exports.string().min(1),
|
|
94904
|
+
groupId: external_exports.string().min(1),
|
|
94905
|
+
reason: reasonSchema
|
|
94906
|
+
})
|
|
94907
|
+
]);
|
|
94908
|
+
var opsParkedActInputSchema = parkedActDefinition;
|
|
94909
|
+
var impersonateDefinition = external_exports.object({
|
|
94910
|
+
targetUserId: external_exports.string().min(1),
|
|
94911
|
+
workspaceId: external_exports.string().min(1).nullable(),
|
|
94912
|
+
reason: reasonSchema,
|
|
94913
|
+
minutes: external_exports.number().int().min(1).max(60).default(30)
|
|
94914
|
+
});
|
|
94915
|
+
var opsImpersonateInputSchema = impersonateDefinition;
|
|
94916
|
+
var auditRowDefinition = external_exports.object({
|
|
94917
|
+
id: external_exports.string(),
|
|
94918
|
+
operatorUserId: external_exports.string(),
|
|
94919
|
+
action: external_exports.string(),
|
|
94920
|
+
targetKind: external_exports.string(),
|
|
94921
|
+
targetId: external_exports.string(),
|
|
94922
|
+
reason: external_exports.string(),
|
|
94923
|
+
args: external_exports.record(external_exports.string(), external_exports.unknown()),
|
|
94924
|
+
createdAt: external_exports.iso.datetime()
|
|
94925
|
+
});
|
|
94926
|
+
var opsAuditRowSchema = auditRowDefinition;
|
|
94927
|
+
var grantOperatorDefinition = external_exports.object({
|
|
94928
|
+
email: external_exports.string().trim().min(3).max(320),
|
|
94929
|
+
permission: external_exports.enum(["ops:view", "ops:manage"]),
|
|
94930
|
+
reason: reasonSchema
|
|
94931
|
+
});
|
|
94932
|
+
var resetVaultBreakerDefinition = external_exports.object({
|
|
94933
|
+
assertion: vaultPasskeyAssertionSchema,
|
|
94934
|
+
reason: reasonSchema
|
|
94935
|
+
});
|
|
94936
|
+
var opsResetVaultBreakerInputSchema = resetVaultBreakerDefinition;
|
|
94937
|
+
var proposeOperatorPasskeyDefinition = external_exports.object({
|
|
94938
|
+
...vaultOperatorProposeSchema.shape,
|
|
94939
|
+
reason: reasonSchema
|
|
94940
|
+
});
|
|
94941
|
+
var opsProposeOperatorPasskeyInputSchema = proposeOperatorPasskeyDefinition;
|
|
94942
|
+
var commitOperatorRecordDefinition = external_exports.object({
|
|
94943
|
+
assertion: vaultPasskeyAssertionSchema,
|
|
94944
|
+
action: external_exports.enum(VAULT_OPERATOR_ACTIONS),
|
|
94945
|
+
credentialId: external_exports.string().max(512).optional(),
|
|
94946
|
+
label: external_exports.string().max(VAULT_OPERATOR_LABEL_MAX).optional(),
|
|
94947
|
+
reason: reasonSchema
|
|
94948
|
+
});
|
|
94949
|
+
var opsCommitOperatorRecordInputSchema = commitOperatorRecordDefinition;
|
|
94950
|
+
var setVaultOverrideDefinition = external_exports.object({
|
|
94951
|
+
...vaultWatchOverrideSchema.shape,
|
|
94952
|
+
reason: reasonSchema
|
|
94953
|
+
});
|
|
94954
|
+
var opsSetVaultOverrideInputSchema = setVaultOverrideDefinition;
|
|
94955
|
+
var endVaultOverrideDefinition = external_exports.object({ reason: reasonSchema });
|
|
94956
|
+
var opsEndVaultOverrideInputSchema = endVaultOverrideDefinition;
|
|
94957
|
+
var acquisitionReportInputDefinition = external_exports.object({
|
|
94958
|
+
/** Inclusive. */
|
|
94959
|
+
from: external_exports.iso.datetime(),
|
|
94960
|
+
/** Exclusive. */
|
|
94961
|
+
to: external_exports.iso.datetime()
|
|
94962
|
+
});
|
|
94963
|
+
var countSchema = external_exports.number().int().nonnegative();
|
|
94964
|
+
var acquisitionCountsDefinition = external_exports.object({
|
|
94965
|
+
signUps: countSchema,
|
|
94966
|
+
workspaces: countSchema,
|
|
94967
|
+
/** Workspaces with 2+ people and an agent in a shared channel with 2+ posters within 7 days. */
|
|
94968
|
+
activatedTeams: countSchema,
|
|
94969
|
+
/** Workspaces on a paid Team now (active or past due, not complimentary). */
|
|
94970
|
+
payingTeams: countSchema
|
|
94971
|
+
});
|
|
94972
|
+
var acquisitionReportDefinition = external_exports.object({
|
|
94973
|
+
from: external_exports.iso.datetime(),
|
|
94974
|
+
to: external_exports.iso.datetime(),
|
|
94975
|
+
/** One row per source, campaign and persona; most sign-ups first. */
|
|
94976
|
+
rows: external_exports.array(
|
|
94977
|
+
external_exports.object({
|
|
94978
|
+
/** utm_source, else the referring host, else `direct`. */
|
|
94979
|
+
source: external_exports.string(),
|
|
94980
|
+
/** utm_campaign, or `none`. */
|
|
94981
|
+
campaign: external_exports.string(),
|
|
94982
|
+
/** The persona page, or `none`. */
|
|
94983
|
+
persona: external_exports.string(),
|
|
94984
|
+
...acquisitionCountsDefinition.shape
|
|
94985
|
+
})
|
|
94986
|
+
),
|
|
94987
|
+
totals: acquisitionCountsDefinition,
|
|
94988
|
+
/** Sign-ups by their "How did you hear about Laze?" answer; `not answered` for none. */
|
|
94989
|
+
heardFrom: external_exports.array(external_exports.object({ answer: external_exports.string(), signUps: countSchema })),
|
|
94990
|
+
/**
|
|
94991
|
+
* The funnel by the cookie banner answer at sign-up: `accepted`, `rejected`, `no answer`,
|
|
94992
|
+
* `not recorded`, and `signed up earlier` for workspaces whose creator signed up before the
|
|
94993
|
+
* range. Workspaces count under their creator's state; states with nothing are left out.
|
|
94994
|
+
*/
|
|
94995
|
+
consent: external_exports.array(
|
|
94996
|
+
external_exports.object({
|
|
94997
|
+
state: external_exports.string(),
|
|
94998
|
+
signUps: countSchema,
|
|
94999
|
+
workspaces: countSchema,
|
|
95000
|
+
activatedTeams: countSchema
|
|
95001
|
+
})
|
|
95002
|
+
)
|
|
95003
|
+
});
|
|
95004
|
+
var operatorPersonDefinition = external_exports.object({ name: external_exports.string(), email: external_exports.string() });
|
|
95005
|
+
var operatorGrantDefinition = external_exports.object({
|
|
95006
|
+
...platformGrantSchema.shape,
|
|
95007
|
+
/** Who holds the grant, from auth; null once the account is deleted. */
|
|
95008
|
+
person: operatorPersonDefinition.nullable(),
|
|
95009
|
+
/** Who gave it, from auth; null for `system` and for a deleted account. */
|
|
95010
|
+
grantedByPerson: operatorPersonDefinition.nullable()
|
|
95011
|
+
});
|
|
95012
|
+
var opsOperatorGrantSchema = operatorGrantDefinition;
|
|
95013
|
+
var OpsApi = moduleApi()("ops");
|
|
95014
|
+
|
|
95015
|
+
// ../../modules/ops/contract/src/break-glass.ts
|
|
95016
|
+
var BREAK_GLASS = {
|
|
95017
|
+
maxHours: 24,
|
|
95018
|
+
maxRangeDays: 7,
|
|
95019
|
+
maxMessageIds: 100,
|
|
95020
|
+
/** A request nobody answered expires this long after it was made. */
|
|
95021
|
+
pendingHours: 24,
|
|
95022
|
+
pageSize: 50
|
|
95023
|
+
};
|
|
95024
|
+
var id2 = external_exports.string().trim().min(1).max(200);
|
|
95025
|
+
var scopeDefinition = external_exports.discriminatedUnion("kind", [
|
|
95026
|
+
external_exports.object({
|
|
95027
|
+
kind: external_exports.literal("conversation"),
|
|
95028
|
+
conversationId: id2,
|
|
95029
|
+
from: external_exports.iso.datetime(),
|
|
95030
|
+
to: external_exports.iso.datetime()
|
|
95031
|
+
}),
|
|
95032
|
+
external_exports.object({
|
|
95033
|
+
kind: external_exports.literal("messages"),
|
|
95034
|
+
messageIds: external_exports.array(id2).min(1).max(BREAK_GLASS.maxMessageIds)
|
|
95035
|
+
})
|
|
95036
|
+
]);
|
|
95037
|
+
var breakGlassScopeSchema = scopeDefinition;
|
|
95038
|
+
var requestInputDefinition = external_exports.object({
|
|
95039
|
+
workspaceId: id2,
|
|
95040
|
+
scope: breakGlassScopeSchema,
|
|
95041
|
+
reason: external_exports.string().trim().min(3).max(500),
|
|
95042
|
+
hours: external_exports.number().int().min(1).max(BREAK_GLASS.maxHours)
|
|
95043
|
+
});
|
|
95044
|
+
var breakGlassRequestInputSchema = requestInputDefinition;
|
|
95045
|
+
var breakGlassStatusSchema = external_exports.enum(["pending", "approved", "denied", "expired", "ended"]);
|
|
95046
|
+
var requestDefinition = external_exports.object({
|
|
95047
|
+
id: external_exports.string(),
|
|
95048
|
+
workspaceId: external_exports.string(),
|
|
95049
|
+
scope: breakGlassScopeSchema,
|
|
95050
|
+
reason: external_exports.string(),
|
|
95051
|
+
hours: external_exports.number().int(),
|
|
95052
|
+
status: breakGlassStatusSchema,
|
|
95053
|
+
requestedBy: external_exports.string(),
|
|
95054
|
+
requestedAt: external_exports.iso.datetime(),
|
|
95055
|
+
/** A pending request expires then. */
|
|
95056
|
+
pendingUntil: external_exports.iso.datetime(),
|
|
95057
|
+
decidedBy: external_exports.string().nullable(),
|
|
95058
|
+
decidedAt: external_exports.iso.datetime().nullable(),
|
|
95059
|
+
/** How the approver proved presence; null unless approved. */
|
|
95060
|
+
proofMethod: external_exports.enum(["passkey", "secure_enclave"]).nullable(),
|
|
95061
|
+
denyReason: external_exports.string().nullable(),
|
|
95062
|
+
/** Reads are allowed until then; null unless approved. */
|
|
95063
|
+
accessEndsAt: external_exports.iso.datetime().nullable()
|
|
95064
|
+
});
|
|
95065
|
+
var breakGlassRequestSchema = requestDefinition;
|
|
95066
|
+
var requestIdDefinition = external_exports.object({ requestId: id2 });
|
|
95067
|
+
var breakGlassRequestIdSchema = requestIdDefinition;
|
|
95068
|
+
var approveDefinition = external_exports.object({
|
|
95069
|
+
requestId: id2,
|
|
95070
|
+
challenge: external_exports.string().min(1),
|
|
95071
|
+
assertion: external_exports.union([vaultDeviceAssertionSchema, vaultNativeAssertionSchema])
|
|
95072
|
+
});
|
|
95073
|
+
var breakGlassApproveInputSchema = approveDefinition;
|
|
95074
|
+
var denyDefinition = external_exports.object({ requestId: id2, reason: external_exports.string().trim().min(3).max(500) });
|
|
95075
|
+
var breakGlassDenyInputSchema = denyDefinition;
|
|
95076
|
+
var readDefinition = external_exports.object({ requestId: id2, cursor: external_exports.string().max(300).nullable() });
|
|
95077
|
+
var breakGlassReadInputSchema = readDefinition;
|
|
95078
|
+
var messageDefinition2 = external_exports.object({
|
|
95079
|
+
id: external_exports.string(),
|
|
95080
|
+
conversationId: external_exports.string(),
|
|
95081
|
+
threadRootId: external_exports.string().nullable(),
|
|
95082
|
+
author: external_exports.object({ kind: external_exports.enum(["person", "agent", "external"]), id: external_exports.string() }),
|
|
95083
|
+
kind: external_exports.string(),
|
|
95084
|
+
body: external_exports.string(),
|
|
95085
|
+
undecryptable: external_exports.boolean(),
|
|
95086
|
+
deleted: external_exports.boolean(),
|
|
95087
|
+
createdAt: external_exports.iso.datetime()
|
|
95088
|
+
});
|
|
95089
|
+
var pageDefinition = external_exports.object({
|
|
95090
|
+
messages: external_exports.array(messageDefinition2),
|
|
95091
|
+
/** Pass back as `cursor` for the next page; null on the last one. */
|
|
95092
|
+
cursor: external_exports.string().nullable(),
|
|
95093
|
+
accessEndsAt: external_exports.iso.datetime()
|
|
95094
|
+
});
|
|
95095
|
+
var breakGlassPageSchema = pageDefinition;
|
|
95096
|
+
var BREAK_GLASS_COPY = {
|
|
95097
|
+
break_glass_self_approval: "A second staff member must approve; you cannot approve your own request",
|
|
95098
|
+
break_glass_proof_refused: "Your passkey or device could not confirm it is you",
|
|
95099
|
+
break_glass_not_pending: "This request was already answered or has expired",
|
|
95100
|
+
break_glass_not_open: "This request is not approved, or its time is over",
|
|
95101
|
+
break_glass_not_requester: "Only the staff member who asked can read under this request",
|
|
95102
|
+
break_glass_not_found: "There is no such break-glass request",
|
|
95103
|
+
break_glass_unknown_workspace: "There is no such workspace",
|
|
95104
|
+
break_glass_bad_cursor: "That page cursor did not come from this request",
|
|
95105
|
+
break_glass_bad_range: `The range must end after it starts and span at most ${BREAK_GLASS.maxRangeDays} days`
|
|
95106
|
+
};
|
|
95107
|
+
|
|
95108
|
+
// ../../modules/ops/contract/src/operator-key.ts
|
|
95109
|
+
var OPERATOR_KEY = {
|
|
95110
|
+
lifetimeMinutes: 15,
|
|
95111
|
+
/** A key nobody answered expires this long after it was asked for. */
|
|
95112
|
+
pendingMinutes: 60,
|
|
95113
|
+
/** Requests one API key may have waiting at once. */
|
|
95114
|
+
maxWaiting: 3
|
|
95115
|
+
};
|
|
95116
|
+
var OPERATOR_KEY_ACTIONS = [
|
|
95117
|
+
"workspace.owner-email",
|
|
95118
|
+
"workspace.detail",
|
|
95119
|
+
"user.lookup",
|
|
95120
|
+
"workspace.flag",
|
|
95121
|
+
"workspace.credits",
|
|
95122
|
+
"workspace.plan"
|
|
95123
|
+
];
|
|
95124
|
+
var operatorKeyActionSchema = external_exports.enum(OPERATOR_KEY_ACTIONS);
|
|
95125
|
+
var OPERATOR_KEY_REST_PATHS = {
|
|
95126
|
+
request: "/api/ops/keys",
|
|
95127
|
+
status: "/api/ops/keys/status",
|
|
95128
|
+
use: "/api/ops/keys/use"
|
|
95129
|
+
};
|
|
95130
|
+
var id3 = external_exports.string().trim().min(1).max(200);
|
|
95131
|
+
var reason = external_exports.string().trim().min(3).max(500);
|
|
95132
|
+
var sha256Hex = external_exports.string().regex(/^[0-9a-f]{64}$/);
|
|
95133
|
+
var argsDefinition = external_exports.record(
|
|
95134
|
+
external_exports.string().max(64),
|
|
95135
|
+
external_exports.union([external_exports.string().max(200), external_exports.number(), external_exports.boolean(), external_exports.null()])
|
|
95136
|
+
);
|
|
95137
|
+
var operatorKeyStatusSchema = external_exports.enum([
|
|
95138
|
+
"pending",
|
|
95139
|
+
"approved",
|
|
95140
|
+
"denied",
|
|
95141
|
+
"expired",
|
|
95142
|
+
"revoked",
|
|
95143
|
+
"ended"
|
|
95144
|
+
]);
|
|
95145
|
+
var requestInputDefinition2 = external_exports.object({
|
|
95146
|
+
/** Free text here: a name the catalogue lacks gets its own refusal, recorded. */
|
|
95147
|
+
action: external_exports.string().trim().min(1).max(80),
|
|
95148
|
+
target: id3,
|
|
95149
|
+
args: argsDefinition.default({}),
|
|
95150
|
+
reason,
|
|
95151
|
+
/** sha256 of the secret the CLI made and keeps; the secret itself never comes here. */
|
|
95152
|
+
secretHash: sha256Hex
|
|
95153
|
+
});
|
|
95154
|
+
var keyDefinition = external_exports.object({
|
|
95155
|
+
id: external_exports.string(),
|
|
95156
|
+
action: operatorKeyActionSchema,
|
|
95157
|
+
target: external_exports.string(),
|
|
95158
|
+
args: argsDefinition,
|
|
95159
|
+
reason: external_exports.string(),
|
|
95160
|
+
status: operatorKeyStatusSchema,
|
|
95161
|
+
/** The API key that asked; only that key can use this one. */
|
|
95162
|
+
askerKeyId: external_exports.string(),
|
|
95163
|
+
/** The person who made that API key. */
|
|
95164
|
+
askerUserId: external_exports.string(),
|
|
95165
|
+
asker: external_exports.enum(["person", "agent"]),
|
|
95166
|
+
/** The workspace of the API key that asked, where the card lands. */
|
|
95167
|
+
askerWorkspaceId: external_exports.string(),
|
|
95168
|
+
requestedAt: external_exports.iso.datetime(),
|
|
95169
|
+
pendingUntil: external_exports.iso.datetime(),
|
|
95170
|
+
decidedBy: external_exports.string().nullable(),
|
|
95171
|
+
decidedAt: external_exports.iso.datetime().nullable(),
|
|
95172
|
+
/** The passkey that approved; null unless approved. */
|
|
95173
|
+
credentialId: external_exports.string().nullable(),
|
|
95174
|
+
denyReason: external_exports.string().nullable(),
|
|
95175
|
+
/** The 15 minutes end then; null unless approved. */
|
|
95176
|
+
endsAt: external_exports.iso.datetime().nullable(),
|
|
95177
|
+
/** When a write key was spent; a read key stays null. */
|
|
95178
|
+
spentAt: external_exports.iso.datetime().nullable()
|
|
95179
|
+
});
|
|
95180
|
+
var operatorKeySchema = keyDefinition;
|
|
95181
|
+
var statusInputDefinition = external_exports.object({ keyId: id3 });
|
|
95182
|
+
var operatorKeyIdSchema = statusInputDefinition;
|
|
95183
|
+
var useInputDefinition = external_exports.object({ keyId: id3, secret: external_exports.string().min(32).max(128) });
|
|
95184
|
+
var useAnswerDefinition = external_exports.object({
|
|
95185
|
+
keyId: external_exports.string(),
|
|
95186
|
+
action: operatorKeyActionSchema,
|
|
95187
|
+
target: external_exports.string(),
|
|
95188
|
+
endsAt: external_exports.iso.datetime(),
|
|
95189
|
+
result: external_exports.unknown()
|
|
95190
|
+
});
|
|
95191
|
+
var approveDefinition2 = external_exports.object({ keyId: id3, assertion: vaultPasskeyAssertionSchema });
|
|
95192
|
+
var operatorKeyApproveInputSchema = approveDefinition2;
|
|
95193
|
+
var denyDefinition2 = external_exports.object({ keyId: id3, reason });
|
|
95194
|
+
var operatorKeyDenyInputSchema = denyDefinition2;
|
|
95195
|
+
var OPERATOR_KEY_COPY = {
|
|
95196
|
+
operator_key_unknown_action: `Choose one of: ${OPERATOR_KEY_ACTIONS.join(", ")}`,
|
|
95197
|
+
operator_key_action_forbidden: "This operation can never run under an operator key",
|
|
95198
|
+
operator_key_needs_manage: "This action needs an owner holding ops:manage",
|
|
95199
|
+
operator_key_bad_target: "This target is not the kind this action works on",
|
|
95200
|
+
operator_key_bad_args: "This action does not take those arguments",
|
|
95201
|
+
operator_key_too_many_waiting: `At most ${OPERATOR_KEY.maxWaiting} keys can wait at once`,
|
|
95202
|
+
operator_key_not_found: "There is no such operator key",
|
|
95203
|
+
operator_key_not_pending: "This key was already answered or has expired",
|
|
95204
|
+
operator_key_not_live: "This key is not approved, or its time is over",
|
|
95205
|
+
operator_key_proof_refused: "The operator passkey did not confirm this approval",
|
|
95206
|
+
operator_key_refused: "This key does not work here"
|
|
95207
|
+
};
|
|
95208
|
+
|
|
95209
|
+
// ../../modules/ops/contract/src/host-load.ts
|
|
95210
|
+
var sampleDefinition = external_exports.object({
|
|
95211
|
+
/** The machine's hostname. */
|
|
95212
|
+
host: external_exports.string(),
|
|
95213
|
+
sampledAt: external_exports.iso.datetime(),
|
|
95214
|
+
load1: external_exports.number(),
|
|
95215
|
+
load5: external_exports.number(),
|
|
95216
|
+
load15: external_exports.number(),
|
|
95217
|
+
cpus: external_exports.number().int(),
|
|
95218
|
+
/** Busy share of CPU time since the previous sample; null for the first after a start. */
|
|
95219
|
+
cpuPercent: external_exports.number().nullable(),
|
|
95220
|
+
memoryTotalMb: external_exports.number(),
|
|
95221
|
+
memoryAvailableMb: external_exports.number(),
|
|
95222
|
+
swapTotalMb: external_exports.number(),
|
|
95223
|
+
swapFreeMb: external_exports.number(),
|
|
95224
|
+
diskTotalGb: external_exports.number(),
|
|
95225
|
+
diskFreeGb: external_exports.number(),
|
|
95226
|
+
/** The agent computer pool then; null where this host runs no pool. */
|
|
95227
|
+
computers: capacityNumbersSchema.nullable()
|
|
95228
|
+
});
|
|
95229
|
+
var hostLoadSampleSchema = sampleDefinition;
|
|
95230
|
+
var pointDefinition = external_exports.object({
|
|
95231
|
+
at: external_exports.iso.datetime(),
|
|
95232
|
+
/** The highest 1 minute load average in the step. */
|
|
95233
|
+
load1: external_exports.number(),
|
|
95234
|
+
/** The highest CPU percent in the step, null when none was measured. */
|
|
95235
|
+
cpuPercent: external_exports.number().nullable(),
|
|
95236
|
+
/** The lowest available memory in the step. */
|
|
95237
|
+
memoryAvailableMb: external_exports.number(),
|
|
95238
|
+
/** The most computers awake in the step, null without a pool. */
|
|
95239
|
+
awakeComputers: external_exports.number().int().nullable(),
|
|
95240
|
+
/** The most vCPU reserved by awake computers in the step, null without a pool. */
|
|
95241
|
+
awakeCpus: external_exports.number().nullable()
|
|
95242
|
+
});
|
|
95243
|
+
var hostLoadPointSchema = pointDefinition;
|
|
95244
|
+
var viewDefinition = external_exports.object({
|
|
95245
|
+
/** The newest sample, null before the worker took one. */
|
|
95246
|
+
now: hostLoadSampleSchema.nullable(),
|
|
95247
|
+
/** The last day, oldest first, one point per step that has samples. */
|
|
95248
|
+
history: external_exports.array(hostLoadPointSchema)
|
|
95249
|
+
});
|
|
95250
|
+
var hostLoadViewSchema = viewDefinition;
|
|
95251
|
+
|
|
95252
|
+
// ../../modules/ops/contract/src/ops.trpc.ts
|
|
95253
|
+
var opsTrpc = defineTrpcContract("ops").query("me").withInput(external_exports.object({})).withOutput(opsOperatorSchema).query("workspaces").withInput(opsSearchInputSchema).withOutput(external_exports.array(opsWorkspaceRowSchema)).query("workspace").withInput(external_exports.object({ workspaceId: external_exports.string().min(1) })).withOutput(opsWorkspaceDetailSchema).query("users").withInput(opsSearchInputSchema).withOutput(external_exports.array(opsUserRowSchema)).mutation("setPlan").withInput(opsSetPlanInputSchema).withOutput(opsWorkspaceDetailSchema).mutation("setComplimentaryComputer").withInput(opsSetComputerInputSchema).withOutput(opsWorkspaceDetailSchema).mutation("grantCredits").withInput(opsGrantCreditsInputSchema).withOutput(opsWorkspaceDetailSchema).mutation("setFlag").withInput(opsSetFlagInputSchema).withOutput(opsWorkspaceDetailSchema).query("parked").withInput(external_exports.object({})).withOutput(opsParkedSchema).mutation("parkedAct").withInput(opsParkedActInputSchema).withOutput(external_exports.object({ changed: external_exports.number().int() })).mutation("impersonate").withInput(opsImpersonateInputSchema).withOutput(impersonationSchema).query("operators").withInput(external_exports.object({})).withOutput(external_exports.array(opsOperatorGrantSchema)).query("audit").withInput(external_exports.object({ limit: external_exports.number().int().min(1).max(200).default(100) })).withOutput(external_exports.array(opsAuditRowSchema)).query("vaultLockdown").withInput(external_exports.object({})).withOutput(vaultLockdownSchema).mutation("vaultBreakerChallenge").withInput(external_exports.object({})).withOutput(vaultBreakerChallengeSchema).mutation("proposeOperatorPasskey").withInput(opsProposeOperatorPasskeyInputSchema).withOutput(vaultOperatorProposalSchema).mutation("operatorPasskeyChallenge").withInput(vaultOperatorChallengeInputSchema).withOutput(vaultOperatorChallengeSchema).mutation("commitOperatorRecord").withInput(opsCommitOperatorRecordInputSchema).withOutput(external_exports.object({ seq: external_exports.number().int() })).mutation("resetVaultBreaker").withInput(opsResetVaultBreakerInputSchema).withOutput(external_exports.object({ breaker: external_exports.literal("closed") })).mutation("setVaultOverride").withInput(opsSetVaultOverrideInputSchema).withOutput(vaultLockdownOverrideSchema).mutation("endVaultOverride").withInput(opsEndVaultOverrideInputSchema).withOutput(external_exports.object({ ended: external_exports.boolean() })).query("breakGlassRequests").withInput(external_exports.object({})).withOutput(external_exports.array(breakGlassRequestSchema)).mutation("requestBreakGlass").withInput(breakGlassRequestInputSchema).withOutput(breakGlassRequestSchema).mutation("breakGlassChallenge").withInput(breakGlassRequestIdSchema).withOutput(vaultReauthChallengeSchema).mutation("approveBreakGlass").withInput(breakGlassApproveInputSchema).withOutput(breakGlassRequestSchema).mutation("denyBreakGlass").withInput(breakGlassDenyInputSchema).withOutput(breakGlassRequestSchema).mutation("readBreakGlass").withInput(breakGlassReadInputSchema).withOutput(breakGlassPageSchema).query("operatorKeys").withInput(external_exports.object({})).withOutput(external_exports.array(operatorKeySchema)).mutation("operatorKeyChallenge").withInput(operatorKeyIdSchema).withOutput(vaultOperatorKeyChallengeSchema).mutation("approveOperatorKey").withInput(operatorKeyApproveInputSchema).withOutput(operatorKeySchema).mutation("denyOperatorKey").withInput(operatorKeyDenyInputSchema).withOutput(operatorKeySchema).mutation("revokeOperatorKey").withInput(operatorKeyDenyInputSchema).withOutput(operatorKeySchema).query("hostLoad").withInput(external_exports.object({})).withOutput(hostLoadViewSchema).build();
|
|
95254
|
+
|
|
95255
|
+
// ../../modules/ops/contract/src/ops.config.ts
|
|
95256
|
+
var opsConfig = Config.define((c) => ({
|
|
95257
|
+
/** The progress board's alerts folder; unset, the parked jobs card is only logged. */
|
|
95258
|
+
opsAlertDir: c.env("OPS_ALERT_DIR", external_exports.string().min(1).optional())
|
|
95259
|
+
}));
|
|
95260
|
+
|
|
95261
|
+
// src/services/operator-key-commands.service.ts
|
|
95262
|
+
var OPERATOR_KEY_USAGE = `Temporary operator keys (ask, an operator approves with a passkey, 15 minutes):
|
|
95263
|
+
laze ops request <action> <target> --reason "<why>" [--arg name=value] [--wait]
|
|
95264
|
+
actions: ${OPERATOR_KEY_ACTIONS.join(", ")}
|
|
95265
|
+
laze ops status <key> waiting, approved or ended
|
|
95266
|
+
laze ops use <key> run the approved action and print the answer`;
|
|
95267
|
+
var POLL_MS3 = 5e3;
|
|
95268
|
+
var keyFile = ({ context, keyId }) => join27(dirname23(context.environment.configPath), "operator-keys", keyId.replaceAll("/", "_"));
|
|
95269
|
+
async function saveSecret({
|
|
95270
|
+
context,
|
|
95271
|
+
keyId,
|
|
95272
|
+
secret
|
|
95273
|
+
}) {
|
|
95274
|
+
const path = keyFile({ context, keyId });
|
|
95275
|
+
await mkdir23(dirname23(path), { recursive: true, mode: 448 });
|
|
95276
|
+
await writeFile23(path, secret, { mode: 384 });
|
|
95277
|
+
}
|
|
95278
|
+
function typedArg(text3) {
|
|
95279
|
+
if (["true", "false", "null"].includes(text3)) return JSON.parse(text3);
|
|
95280
|
+
return text3 !== "" && Number.isFinite(Number(text3)) ? Number(text3) : text3;
|
|
95281
|
+
}
|
|
95282
|
+
function argsOf({ args }) {
|
|
95283
|
+
const pairs = (args.lists.arg ?? []).map((pair2) => {
|
|
95284
|
+
const at = pair2.indexOf("=");
|
|
95285
|
+
if (at < 1) throw new CliUsageError(`--arg takes name=value.
|
|
95286
|
+
${OPERATOR_KEY_USAGE}`);
|
|
95287
|
+
const text3 = pair2.slice(at + 1);
|
|
95288
|
+
return [pair2.slice(0, at), typedArg(text3)];
|
|
95289
|
+
});
|
|
95290
|
+
return Object.fromEntries(pairs);
|
|
95291
|
+
}
|
|
95292
|
+
var statusLine2 = (key) => {
|
|
95293
|
+
if (key.status === "approved") return `Approved until ${key.endsAt}. Run: laze ops use ${key.id}`;
|
|
95294
|
+
if (key.status === "pending") return `Waiting for an operator's passkey at /ops/keys.`;
|
|
95295
|
+
return `${key.status[0]?.toUpperCase()}${key.status.slice(1)}.`;
|
|
95296
|
+
};
|
|
95297
|
+
async function waitForAnswer({
|
|
95298
|
+
context,
|
|
95299
|
+
client,
|
|
95300
|
+
key
|
|
95301
|
+
}) {
|
|
95302
|
+
const giveUpAt = context.nowMs() + OPERATOR_KEY.pendingMinutes * 6e4;
|
|
95303
|
+
let current3 = key;
|
|
95304
|
+
while (current3.status === "pending" && context.nowMs() < giveUpAt) {
|
|
95305
|
+
await context.sleep(POLL_MS3);
|
|
95306
|
+
current3 = await client.post(OPERATOR_KEY_REST_PATHS.status, { keyId: key.id });
|
|
95307
|
+
}
|
|
95308
|
+
return current3;
|
|
95309
|
+
}
|
|
95310
|
+
async function requestKey({ context, args }) {
|
|
95311
|
+
const [, , action, target] = args.words;
|
|
95312
|
+
const reason2 = flagText({ args, name: "reason" });
|
|
95313
|
+
if (!action || !target || !reason2.trim()) throw new CliUsageError(OPERATOR_KEY_USAGE);
|
|
95314
|
+
const { client } = await signedIn({ context, args });
|
|
95315
|
+
const secret = randomBytes3(32).toString("hex");
|
|
95316
|
+
const key = await client.post(OPERATOR_KEY_REST_PATHS.request, {
|
|
95317
|
+
action,
|
|
95318
|
+
target,
|
|
95319
|
+
args: argsOf({ args }),
|
|
95320
|
+
reason: reason2,
|
|
95321
|
+
secretHash: createHash5("sha256").update(secret).digest("hex")
|
|
95322
|
+
});
|
|
95323
|
+
await saveSecret({ context, keyId: key.id, secret });
|
|
95324
|
+
const answered = args.flags.wait ? await waitForAnswer({ context, client, key }) : key;
|
|
95325
|
+
if (args.flags.json) return context.out(`${JSON.stringify(answered, null, 2)}
|
|
95326
|
+
`);
|
|
95327
|
+
context.out(`Operator key ${key.id}: ${statusLine2(answered)}
|
|
95328
|
+
`);
|
|
95329
|
+
}
|
|
95330
|
+
async function keyStatus({ context, args }) {
|
|
95331
|
+
const [, , keyId] = args.words;
|
|
95332
|
+
if (!keyId) throw new CliUsageError(OPERATOR_KEY_USAGE);
|
|
95333
|
+
const { client } = await signedIn({ context, args });
|
|
95334
|
+
const key = await client.post(OPERATOR_KEY_REST_PATHS.status, { keyId });
|
|
95335
|
+
if (args.flags.json) return context.out(`${JSON.stringify(key, null, 2)}
|
|
95336
|
+
`);
|
|
95337
|
+
context.out(`Operator key ${key.id}: ${statusLine2(key)}
|
|
95338
|
+
`);
|
|
95339
|
+
}
|
|
95340
|
+
async function forgetIfOver({
|
|
95341
|
+
context,
|
|
95342
|
+
client,
|
|
95343
|
+
keyId
|
|
95344
|
+
}) {
|
|
95345
|
+
const key = await client.post(OPERATOR_KEY_REST_PATHS.status, { keyId });
|
|
95346
|
+
const windowOver = key.endsAt !== null && Temporal3.Instant.from(key.endsAt).epochMilliseconds <= context.nowMs();
|
|
95347
|
+
if (key.status !== "pending" && (key.status !== "approved" || windowOver || key.spentAt)) {
|
|
95348
|
+
await rm14(keyFile({ context, keyId }), { force: true });
|
|
95349
|
+
}
|
|
95350
|
+
}
|
|
95351
|
+
async function useKey({ context, args }) {
|
|
95352
|
+
const [, , keyId] = args.words;
|
|
95353
|
+
if (!keyId) throw new CliUsageError(OPERATOR_KEY_USAGE);
|
|
95354
|
+
const { client } = await signedIn({ context, args });
|
|
95355
|
+
const path = keyFile({ context, keyId });
|
|
95356
|
+
const secret = await readFile38(path, "utf8").catch(() => null);
|
|
95357
|
+
if (secret === null) {
|
|
95358
|
+
throw new CliUsageError(`No operator key ${keyId} is kept on this machine.`);
|
|
95359
|
+
}
|
|
95360
|
+
try {
|
|
95361
|
+
const answer6 = await client.post(OPERATOR_KEY_REST_PATHS.use, {
|
|
95362
|
+
keyId,
|
|
95363
|
+
secret
|
|
95364
|
+
});
|
|
95365
|
+
context.out(`${JSON.stringify(answer6.result, null, 2)}
|
|
95366
|
+
`);
|
|
95367
|
+
await forgetIfOver({ context, client, keyId });
|
|
95368
|
+
} catch (error63) {
|
|
95369
|
+
if (error63 instanceof LazeApiError && error63.code === "operator_key_refused") {
|
|
95370
|
+
await forgetIfOver({ context, client, keyId });
|
|
95371
|
+
}
|
|
95372
|
+
throw error63;
|
|
95373
|
+
}
|
|
95374
|
+
}
|
|
95375
|
+
function operatorKey({ context, args }) {
|
|
95376
|
+
const [, action] = args.words;
|
|
95377
|
+
if (action === "request") return requestKey({ context, args });
|
|
95378
|
+
if (action === "status") return keyStatus({ context, args });
|
|
95379
|
+
return useKey({ context, args });
|
|
95380
|
+
}
|
|
95381
|
+
|
|
93520
95382
|
// src/services/ops-commands.service.ts
|
|
93521
95383
|
var OPS_USAGE = `Usage (operators, with LAZE_OPS_TOKEN set):
|
|
93522
95384
|
laze ops suspend <workspace> --reason "<why>" stop and hold the workspace's computer and agents
|
|
93523
|
-
laze ops release <workspace> --reason "<why>" lift a suspension or a Free plan hold
|
|
95385
|
+
laze ops release <workspace> --reason "<why>" lift a suspension or a Free plan hold
|
|
95386
|
+
${OPERATOR_KEY_USAGE}`;
|
|
93524
95387
|
async function ops({ context, args }) {
|
|
93525
95388
|
const [, action, workspaceId] = args.words;
|
|
93526
|
-
|
|
95389
|
+
if (action === "request" || action === "status" || action === "use") {
|
|
95390
|
+
return operatorKey({ context, args });
|
|
95391
|
+
}
|
|
95392
|
+
const reason2 = flagText({ args, name: "reason" });
|
|
93527
95393
|
let path;
|
|
93528
95394
|
if (action === "suspend") path = COMPUTE_OPS_REST_PATHS.suspend;
|
|
93529
95395
|
if (action === "release") path = COMPUTE_OPS_REST_PATHS.release;
|
|
93530
|
-
if (!path || !workspaceId || !
|
|
95396
|
+
if (!path || !workspaceId || !reason2.trim()) throw new CliUsageError(OPS_USAGE);
|
|
93531
95397
|
const token2 = context.environment.opsToken;
|
|
93532
95398
|
if (!token2) throw new CliUsageError(`LAZE_OPS_TOKEN is not set.
|
|
93533
95399
|
${OPS_USAGE}`);
|
|
@@ -93537,7 +95403,7 @@ ${OPS_USAGE}`);
|
|
|
93537
95403
|
}).withHeaders({ [COMPUTE_OPS_TOKEN_HEADER]: token2 });
|
|
93538
95404
|
const answer6 = await client.post(path, {
|
|
93539
95405
|
targetWorkspaceId: workspaceId,
|
|
93540
|
-
reason
|
|
95406
|
+
reason: reason2
|
|
93541
95407
|
});
|
|
93542
95408
|
if (args.flags.json) return context.out(`${JSON.stringify(answer6, null, 2)}
|
|
93543
95409
|
`);
|
|
@@ -93547,8 +95413,8 @@ ${OPS_USAGE}`);
|
|
|
93547
95413
|
}
|
|
93548
95414
|
|
|
93549
95415
|
// src/services/release-watch.service.ts
|
|
93550
|
-
import { mkdir as
|
|
93551
|
-
import { dirname as
|
|
95416
|
+
import { mkdir as mkdir24, readFile as readFile39, realpath, writeFile as writeFile24 } from "node:fs/promises";
|
|
95417
|
+
import { dirname as dirname24, join as join28 } from "node:path";
|
|
93552
95418
|
|
|
93553
95419
|
// src/rules/cli-update.rules.ts
|
|
93554
95420
|
var CLI_PACKAGE = "@lazehq/cli";
|
|
@@ -93694,16 +95560,16 @@ async function startedUpdate({
|
|
|
93694
95560
|
if (context.environment.inherited.LAZE_AUTO_UPDATE === "0") return null;
|
|
93695
95561
|
const plan2 = updatePlanOf({ script: await scriptOf(context) });
|
|
93696
95562
|
if (plan2.kind !== "install") return null;
|
|
93697
|
-
const folder =
|
|
93698
|
-
const stamp =
|
|
93699
|
-
const last = await
|
|
95563
|
+
const folder = dirname24(context.environment.configPath);
|
|
95564
|
+
const stamp = join28(folder, "auto-update.json");
|
|
95565
|
+
const last = await readFile39(stamp, "utf8").then((text3) => JSON.parse(text3)).catch(() => null);
|
|
93700
95566
|
const now = context.nowMs();
|
|
93701
95567
|
if (last?.server === server && now - last.atMs < RETRY_AFTER_MS) return null;
|
|
93702
|
-
await
|
|
93703
|
-
await
|
|
95568
|
+
await mkdir24(folder, { recursive: true, mode: 448 });
|
|
95569
|
+
await writeFile24(stamp, JSON.stringify({ server, atMs: now }), { mode: 384 });
|
|
93704
95570
|
context.processes.spawnDetached({
|
|
93705
95571
|
argv: [...context.program, "update"],
|
|
93706
|
-
logPath:
|
|
95572
|
+
logPath: join28(folder, "auto-update.log")
|
|
93707
95573
|
});
|
|
93708
95574
|
return { manager: plan2.manager };
|
|
93709
95575
|
}
|
|
@@ -93740,7 +95606,7 @@ function watchingRelease({
|
|
|
93740
95606
|
}
|
|
93741
95607
|
|
|
93742
95608
|
// src/services/rush-guard.service.ts
|
|
93743
|
-
import { readFile as
|
|
95609
|
+
import { readFile as readFile40, rm as rm15 } from "node:fs/promises";
|
|
93744
95610
|
var WATCH_MS3 = 2e3;
|
|
93745
95611
|
var RETRY_MS2 = 3e4;
|
|
93746
95612
|
async function guardRound(guard) {
|
|
@@ -93774,22 +95640,22 @@ function sessionIdOf({ session }) {
|
|
|
93774
95640
|
}
|
|
93775
95641
|
async function rushWakeHook({ context, args }) {
|
|
93776
95642
|
const claudePid = Number(flagText({ args, name: "claude-pid" }));
|
|
93777
|
-
const
|
|
95643
|
+
const id4 = flagText({ args, name: "rush-id" });
|
|
93778
95644
|
const program = flagText({ args, name: "rush-program" }) || "rush";
|
|
93779
|
-
if (!claudePid || !
|
|
95645
|
+
if (!claudePid || !id4) return 1;
|
|
93780
95646
|
if (!await claimRushGuard({ context, claudePid })) return 0;
|
|
93781
95647
|
const path = guardPathOf({ context, claudePid });
|
|
93782
95648
|
try {
|
|
93783
95649
|
while (context.processes.alive(claudePid)) await context.sleep(WATCH_MS3);
|
|
93784
95650
|
const { client, name: name3 } = await signedIn({ context, args });
|
|
93785
95651
|
const noted = statePathOf({ context, kind: "sessions", profile: String(claudePid) });
|
|
93786
|
-
const note = await
|
|
95652
|
+
const note = await readFile40(noted, "utf8").then(
|
|
93787
95653
|
(text3) => JSON.parse(text3),
|
|
93788
95654
|
() => void 0
|
|
93789
95655
|
);
|
|
93790
95656
|
const { launch = {}, ...session } = note ?? {};
|
|
93791
95657
|
const lock = statePathOf({ context, kind: "waiters", profile: name3 });
|
|
93792
|
-
const rush = { id:
|
|
95658
|
+
const rush = { id: id4, program };
|
|
93793
95659
|
const known = note ? session : void 0;
|
|
93794
95660
|
const guard = { context, client, name: name3, lock, claudePid, session: known, rush, launch };
|
|
93795
95661
|
const deadline = context.nowMs() + WAIT_HOOK_TIMEOUT_SECONDS * 1e3;
|
|
@@ -93812,23 +95678,27 @@ async function rushWakeHook({ context, args }) {
|
|
|
93812
95678
|
return 0;
|
|
93813
95679
|
} finally {
|
|
93814
95680
|
if ((await holderOf({ path: lock }))?.pid === context.processes.pid)
|
|
93815
|
-
await
|
|
95681
|
+
await rm15(lock, { force: true });
|
|
93816
95682
|
}
|
|
93817
95683
|
} finally {
|
|
93818
|
-
await
|
|
95684
|
+
await rm15(path, { force: true });
|
|
93819
95685
|
}
|
|
93820
95686
|
}
|
|
93821
95687
|
|
|
93822
95688
|
// src/services/schedule-commands.service.ts
|
|
93823
95689
|
var USAGE16 = `Usage:
|
|
93824
95690
|
laze schedule add <name> --prompt <text> (--cron "<m h dom mon dow>" | --rrule "<RRULE>" | --at <local time>)
|
|
93825
|
-
[--tz <IANA zone>] [--channel <channelId>] [--agent <agentId>]
|
|
95691
|
+
[--tz <IANA zone>] [--channel <channelId>] [--agent <agentId>] [--check <script>]
|
|
93826
95692
|
laze schedule list
|
|
93827
95693
|
laze schedule update <scheduleId> [--name <name>] [--prompt <text>] [--cron|--rrule|--at <when>]
|
|
93828
|
-
[--tz <IANA zone>] [--channel <channelId>|none] [--agent <agentId>]
|
|
95694
|
+
[--tz <IANA zone>] [--channel <channelId>|none] [--agent <agentId>] [--check <script>|none]
|
|
93829
95695
|
laze schedule pause|resume|rm|runs <scheduleId>
|
|
93830
95696
|
laze schedule run <scheduleId> (one extra run now; the next fire stays)
|
|
93831
|
-
A repeating schedule runs at most every 30 minutes; a cron or RRULE that runs more often is refused
|
|
95697
|
+
A repeating schedule runs at most every 30 minutes; a cron or RRULE that runs more often is refused.
|
|
95698
|
+
--check names an executable script in your work folder. It runs at each firing, without a model:
|
|
95699
|
+
if it prints something the agent wakes with that output added to the prompt; if it prints nothing
|
|
95700
|
+
nothing happens and nothing is spent; a non-zero exit or 30 s timeout is a failed check, shown
|
|
95701
|
+
under Needs attention. Keep what it last saw in your own file. Run now skips the check.`;
|
|
93832
95702
|
function timingOf(args) {
|
|
93833
95703
|
const cron = flagText({ args, name: "cron" });
|
|
93834
95704
|
const rrule = flagText({ args, name: "rrule" });
|
|
@@ -93843,8 +95713,11 @@ ${USAGE16}`);
|
|
|
93843
95713
|
}
|
|
93844
95714
|
function printSchedule({ context, schedule: schedule2 }) {
|
|
93845
95715
|
const next = schedule2.nextFireAt ? `next ${schedule2.nextFireAt}` : "no next fire";
|
|
95716
|
+
const stats = schedule2.checkStats;
|
|
95717
|
+
const counts = stats ? ` (7 days: ${stats.checked} checks, ${stats.woke} woke, ${stats.failed} failed)` : "";
|
|
95718
|
+
const check3 = schedule2.checkScript ? ` check ${schedule2.checkScript}${counts}` : "";
|
|
93846
95719
|
context.out(
|
|
93847
|
-
`${schedule2.id} ${schedule2.status} ${schedule2.name} ${schedule2.source} (${schedule2.timezone}) ${next}
|
|
95720
|
+
`${schedule2.id} ${schedule2.status} ${schedule2.name} ${schedule2.source} (${schedule2.timezone}) ${next}${check3}
|
|
93848
95721
|
`
|
|
93849
95722
|
);
|
|
93850
95723
|
}
|
|
@@ -93856,13 +95729,15 @@ async function scheduleAdd({ context, args }) {
|
|
|
93856
95729
|
const { client } = await signedIn({ context, args });
|
|
93857
95730
|
const channelId = flagText({ args, name: "channel" });
|
|
93858
95731
|
const agentId = flagText({ args, name: "agent" });
|
|
95732
|
+
const checkScript = flagText({ args, name: "check" });
|
|
93859
95733
|
const schedule2 = await client.post("/api/schedules", {
|
|
93860
95734
|
name: name3,
|
|
93861
95735
|
prompt,
|
|
93862
95736
|
timing,
|
|
93863
95737
|
timezone: flagText({ args, name: "tz", fallback: "UTC" }),
|
|
93864
95738
|
channelId: channelId || null,
|
|
93865
|
-
...agentId ? { agentId } : {}
|
|
95739
|
+
...agentId ? { agentId } : {},
|
|
95740
|
+
...checkScript ? { checkScript } : {}
|
|
93866
95741
|
});
|
|
93867
95742
|
if (args.flags.json) return context.out(`${JSON.stringify(schedule2, null, 2)}
|
|
93868
95743
|
`);
|
|
@@ -93883,6 +95758,8 @@ function changesOf2(args) {
|
|
|
93883
95758
|
}
|
|
93884
95759
|
const channel = flagText({ args, name: "channel" });
|
|
93885
95760
|
if (channel) changes2.channelId = channel === "none" ? null : channel;
|
|
95761
|
+
const check3 = flagText({ args, name: "check" });
|
|
95762
|
+
if (check3) changes2.checkScript = check3 === "none" ? null : check3;
|
|
93886
95763
|
return changes2;
|
|
93887
95764
|
}
|
|
93888
95765
|
async function scheduleUpdate({ context, args }) {
|
|
@@ -93926,8 +95803,9 @@ async function scheduleRuns({ context, args }) {
|
|
|
93926
95803
|
`);
|
|
93927
95804
|
for (const run4 of runs) {
|
|
93928
95805
|
const missed = run4.missed > 0 ? ` (caught up ${run4.missed} missed)` : "";
|
|
93929
|
-
const
|
|
93930
|
-
|
|
95806
|
+
const reason2 = run4.reason ? ` ${run4.reason}` : "";
|
|
95807
|
+
const exit = typeof run4.checkExitCode === "number" ? ` (exit ${run4.checkExitCode})` : "";
|
|
95808
|
+
context.out(`${run4.scheduledFor} ${run4.status}${reason2}${exit}${missed}
|
|
93931
95809
|
`);
|
|
93932
95810
|
}
|
|
93933
95811
|
}
|
|
@@ -93959,8 +95837,8 @@ async function schedule({ context, args }) {
|
|
|
93959
95837
|
}
|
|
93960
95838
|
|
|
93961
95839
|
// src/services/skill-commands.service.ts
|
|
93962
|
-
import { readdir as readdir8, readFile as
|
|
93963
|
-
import { join as
|
|
95840
|
+
import { readdir as readdir8, readFile as readFile41 } from "node:fs/promises";
|
|
95841
|
+
import { join as join29, relative as relative6, resolve as resolve19 } from "node:path";
|
|
93964
95842
|
var USAGE17 = `Usage:
|
|
93965
95843
|
laze skill list [--agent <agentId>]
|
|
93966
95844
|
laze skill install <catalogue-id> [--as <name>] [--agent <agentId>]
|
|
@@ -93981,8 +95859,8 @@ async function folderFiles({ root }) {
|
|
|
93981
95859
|
const files2 = [];
|
|
93982
95860
|
for (const entry of entries) {
|
|
93983
95861
|
if (!entry.isFile()) continue;
|
|
93984
|
-
const full =
|
|
93985
|
-
files2.push({ path: relative6(root, full), content: await
|
|
95862
|
+
const full = join29(entry.parentPath, entry.name);
|
|
95863
|
+
files2.push({ path: relative6(root, full), content: await readFile41(full, "utf8") });
|
|
93986
95864
|
}
|
|
93987
95865
|
return files2.toSorted((a, b) => a.path.localeCompare(b.path));
|
|
93988
95866
|
}
|
|
@@ -94080,7 +95958,7 @@ async function skillUpdate({ context, args }) {
|
|
|
94080
95958
|
if (!name3 || !newName && description === void 0 && !skillMdFile) {
|
|
94081
95959
|
throw new CliUsageError(USAGE17);
|
|
94082
95960
|
}
|
|
94083
|
-
const skillMd = skillMdFile ? await
|
|
95961
|
+
const skillMd = skillMdFile ? await readFile41(resolve19(context.cwd, skillMdFile), "utf8") : void 0;
|
|
94084
95962
|
const { client } = await signedIn({ context, args });
|
|
94085
95963
|
const updated = await client.post("/api/skills/update", {
|
|
94086
95964
|
name: name3,
|
|
@@ -94126,7 +96004,7 @@ async function skill({ context, args }) {
|
|
|
94126
96004
|
}
|
|
94127
96005
|
|
|
94128
96006
|
// src/services/slack-commands.service.ts
|
|
94129
|
-
import { readFile as
|
|
96007
|
+
import { readFile as readFile42 } from "node:fs/promises";
|
|
94130
96008
|
import { resolve as resolve20 } from "node:path";
|
|
94131
96009
|
var SLACK_USAGE = `Usage (a person's key; Slack stays the source, the bot joins no channel by itself):
|
|
94132
96010
|
laze slack overview connected Slack workspaces, mirrors, your link
|
|
@@ -94174,7 +96052,7 @@ async function secretLines({ context, args }) {
|
|
|
94174
96052
|
throw new CliUsageError("A secret never goes in a flag: pipe it on stdin or use --from-file.");
|
|
94175
96053
|
}
|
|
94176
96054
|
const file3 = flagText({ args, name: "from-file" });
|
|
94177
|
-
const text3 = file3 ? await
|
|
96055
|
+
const text3 = file3 ? await readFile42(resolve20(context.cwd, file3), "utf8") : await context.readStdin();
|
|
94178
96056
|
return text3.split("\n").map((line) => line.trim()).filter(Boolean);
|
|
94179
96057
|
}
|
|
94180
96058
|
async function secretsOf2({
|
|
@@ -94478,7 +96356,7 @@ async function slack({
|
|
|
94478
96356
|
}
|
|
94479
96357
|
|
|
94480
96358
|
// src/services/sso-commands.service.ts
|
|
94481
|
-
import { readFile as
|
|
96359
|
+
import { readFile as readFile43 } from "node:fs/promises";
|
|
94482
96360
|
var SSO_USAGE = `Usage:
|
|
94483
96361
|
laze sso domains claimed domains and how each signs in (admins)
|
|
94484
96362
|
laze sso claim <domain> the TXT record that proves the domain
|
|
@@ -94565,7 +96443,7 @@ function refuseSecretFlags({ args }) {
|
|
|
94565
96443
|
}
|
|
94566
96444
|
async function clientSecretOf({ context, args }) {
|
|
94567
96445
|
const file3 = flagText({ args, name: "from-file" });
|
|
94568
|
-
const text3 = file3 ? await
|
|
96446
|
+
const text3 = file3 ? await readFile43(file3, "utf8") : await context.readStdin();
|
|
94569
96447
|
const secret = text3.trim();
|
|
94570
96448
|
if (!secret) throw new CliUsageError("No client secret: pipe it on stdin or use --from-file.");
|
|
94571
96449
|
return secret;
|
|
@@ -94721,7 +96599,7 @@ async function scim({ context, args }) {
|
|
|
94721
96599
|
}
|
|
94722
96600
|
|
|
94723
96601
|
// src/rules/status-format.rules.ts
|
|
94724
|
-
function
|
|
96602
|
+
function statusLine3({ presence: presence2 }) {
|
|
94725
96603
|
const state = presence2.presence === "away" && presence2.awayByHand ? "away (set by hand)" : presence2.presence;
|
|
94726
96604
|
const { status: status11 } = presence2;
|
|
94727
96605
|
if (!status11) return `You are ${state}, with no status.
|
|
@@ -94746,7 +96624,7 @@ function answer5({
|
|
|
94746
96624
|
}) {
|
|
94747
96625
|
if (args.flags.json) return context.out(`${JSON.stringify(presence2, null, 2)}
|
|
94748
96626
|
`);
|
|
94749
|
-
context.out(
|
|
96627
|
+
context.out(statusLine3({ presence: presence2 }));
|
|
94750
96628
|
}
|
|
94751
96629
|
async function statusSet({ context, args }) {
|
|
94752
96630
|
const [, , emoji4, ...words] = args.words;
|
|
@@ -94897,8 +96775,8 @@ async function update2({
|
|
|
94897
96775
|
}
|
|
94898
96776
|
|
|
94899
96777
|
// src/services/vault-env-commands.service.ts
|
|
94900
|
-
import { readFile as
|
|
94901
|
-
import { dirname as
|
|
96778
|
+
import { readFile as readFile44, stat as stat10 } from "node:fs/promises";
|
|
96779
|
+
import { dirname as dirname25, join as join30, resolve as resolve21 } from "node:path";
|
|
94902
96780
|
|
|
94903
96781
|
// src/rules/vault-manifest.rules.ts
|
|
94904
96782
|
var VARIABLE = /^[A-Za-z_][A-Za-z0-9_]*$/;
|
|
@@ -94986,7 +96864,7 @@ function credentialProcessJson(fields) {
|
|
|
94986
96864
|
}
|
|
94987
96865
|
|
|
94988
96866
|
// src/services/vault-batch.service.ts
|
|
94989
|
-
import { rm as
|
|
96867
|
+
import { rm as rm16 } from "node:fs/promises";
|
|
94990
96868
|
async function batchOf({ response }) {
|
|
94991
96869
|
const text3 = await response.text();
|
|
94992
96870
|
if (!response.ok) {
|
|
@@ -95108,7 +96986,7 @@ async function releaseBatch({
|
|
|
95108
96986
|
context,
|
|
95109
96987
|
args,
|
|
95110
96988
|
refs,
|
|
95111
|
-
reason,
|
|
96989
|
+
reason: reason2,
|
|
95112
96990
|
command
|
|
95113
96991
|
}) {
|
|
95114
96992
|
const deadline = deadlineOf({ args, nowMs: context.nowMs() });
|
|
@@ -95117,7 +96995,7 @@ async function releaseBatch({
|
|
|
95117
96995
|
let answer6;
|
|
95118
96996
|
let settled2;
|
|
95119
96997
|
try {
|
|
95120
|
-
answer6 = await door.ask({ refs, reason, command, recipient: run4.publicKey });
|
|
96998
|
+
answer6 = await door.ask({ refs, reason: reason2, command, recipient: run4.publicKey });
|
|
95121
96999
|
const missing = answer6.entries.filter((entry) => !entry.connection);
|
|
95122
97000
|
if (missing.length > 0) {
|
|
95123
97001
|
context.err(
|
|
@@ -95168,7 +97046,7 @@ async function valuesOf({
|
|
|
95168
97046
|
}) {
|
|
95169
97047
|
const refused = refusalOf({ context, settled: settled2 });
|
|
95170
97048
|
if (refused !== 0) {
|
|
95171
|
-
await
|
|
97049
|
+
await rm16(keyPath, { force: true });
|
|
95172
97050
|
return { exitCode: refused };
|
|
95173
97051
|
}
|
|
95174
97052
|
const opened = /* @__PURE__ */ new Map();
|
|
@@ -95180,7 +97058,7 @@ async function valuesOf({
|
|
|
95180
97058
|
if (release2.message) context.err(`${release2.message}
|
|
95181
97059
|
`);
|
|
95182
97060
|
}
|
|
95183
|
-
if (!keep2) await
|
|
97061
|
+
if (!keep2) await rm16(keyPath, { force: true });
|
|
95184
97062
|
const released = /* @__PURE__ */ new Map();
|
|
95185
97063
|
for (const entry of entries) {
|
|
95186
97064
|
const fields = opened.get(keyOf(entry));
|
|
@@ -95224,9 +97102,9 @@ function reasonOf({ context, args }) {
|
|
|
95224
97102
|
}
|
|
95225
97103
|
function refusedReason({
|
|
95226
97104
|
context,
|
|
95227
|
-
reason
|
|
97105
|
+
reason: reason2
|
|
95228
97106
|
}) {
|
|
95229
|
-
const problem = checkVaultReason(
|
|
97107
|
+
const problem = checkVaultReason(reason2);
|
|
95230
97108
|
if (problem === "ok") return null;
|
|
95231
97109
|
context.err(`laze vault: the reason is refused (${problem}). ${VAULT_REASON_GUIDANCE}
|
|
95232
97110
|
`);
|
|
@@ -95246,9 +97124,9 @@ async function manifestPathOf({
|
|
|
95246
97124
|
if (named) return resolve21(context.cwd, named);
|
|
95247
97125
|
const environment = flagText({ args, name: "env" });
|
|
95248
97126
|
const file3 = environment ? `.env.${environment}.vault` : ".env.vault";
|
|
95249
|
-
for (let dir = resolve21(context.cwd); ; dir =
|
|
95250
|
-
if (await isFile(
|
|
95251
|
-
if (
|
|
97127
|
+
for (let dir = resolve21(context.cwd); ; dir = dirname25(dir)) {
|
|
97128
|
+
if (await isFile(join30(dir, file3))) return join30(dir, file3);
|
|
97129
|
+
if (dirname25(dir) === dir) break;
|
|
95252
97130
|
}
|
|
95253
97131
|
throw new CliUsageError(`laze vault: no ${file3} here or in a parent folder
|
|
95254
97132
|
${ENV_USAGE}`);
|
|
@@ -95258,7 +97136,7 @@ async function manifestOf({
|
|
|
95258
97136
|
args
|
|
95259
97137
|
}) {
|
|
95260
97138
|
const file3 = await manifestPathOf({ context, args });
|
|
95261
|
-
const text3 = await
|
|
97139
|
+
const text3 = await readFile44(file3, "utf8").catch(() => {
|
|
95262
97140
|
throw new CliUsageError(`laze vault: cannot read ${file3}`);
|
|
95263
97141
|
});
|
|
95264
97142
|
return { file: file3, lines: parseManifest({ text: text3, file: file3 }) };
|
|
@@ -95298,12 +97176,12 @@ async function releasedKeys({
|
|
|
95298
97176
|
context,
|
|
95299
97177
|
args,
|
|
95300
97178
|
refs,
|
|
95301
|
-
reason,
|
|
97179
|
+
reason: reason2,
|
|
95302
97180
|
command
|
|
95303
97181
|
}) {
|
|
95304
97182
|
const byConnection = /* @__PURE__ */ new Map();
|
|
95305
97183
|
if (refs.length === 0) return { released: /* @__PURE__ */ new Map(), byConnection };
|
|
95306
|
-
const outcome = await releaseBatch({ context, args, refs, reason, command: [...command] });
|
|
97184
|
+
const outcome = await releaseBatch({ context, args, refs, reason: reason2, command: [...command] });
|
|
95307
97185
|
if ("exitCode" in outcome) return outcome;
|
|
95308
97186
|
for (const entry of outcome.entries) {
|
|
95309
97187
|
const fields = outcome.released.get(entry.ref)?.fields;
|
|
@@ -95330,18 +97208,18 @@ async function vaultEnv2({
|
|
|
95330
97208
|
);
|
|
95331
97209
|
}
|
|
95332
97210
|
if (!shell && args.rest.length === 0) throw new CliUsageError(ENV_USAGE);
|
|
95333
|
-
const
|
|
95334
|
-
if (!
|
|
97211
|
+
const reason2 = reasonOf({ context, args });
|
|
97212
|
+
if (!reason2)
|
|
95335
97213
|
throw new CliUsageError(`Say why with --reason "<one plain sentence>"
|
|
95336
97214
|
${ENV_USAGE}`);
|
|
95337
|
-
const badReason = refusedReason({ context, reason });
|
|
97215
|
+
const badReason = refusedReason({ context, reason: reason2 });
|
|
95338
97216
|
if (badReason !== null) return badReason;
|
|
95339
97217
|
const refs = refsOf(lines2);
|
|
95340
97218
|
const outcome = await releasedKeys({
|
|
95341
97219
|
context,
|
|
95342
97220
|
args,
|
|
95343
97221
|
refs,
|
|
95344
|
-
reason,
|
|
97222
|
+
reason: reason2,
|
|
95345
97223
|
command: shell ? wrappedCommandOf(args) : args.rest
|
|
95346
97224
|
});
|
|
95347
97225
|
if ("exitCode" in outcome) return outcome.exitCode;
|
|
@@ -95368,17 +97246,17 @@ async function vaultAws({
|
|
|
95368
97246
|
const args = withWaitSeconds(given);
|
|
95369
97247
|
const connection = args.words[2];
|
|
95370
97248
|
if (!connection || args.flags.help) throw new CliUsageError(AWS_USAGE);
|
|
95371
|
-
const
|
|
95372
|
-
if (!
|
|
97249
|
+
const reason2 = reasonOf({ context, args });
|
|
97250
|
+
if (!reason2) {
|
|
95373
97251
|
throw new CliUsageError(
|
|
95374
97252
|
`Say why with --reason "<one plain sentence>" or KV_REASON
|
|
95375
97253
|
${AWS_USAGE}`
|
|
95376
97254
|
);
|
|
95377
97255
|
}
|
|
95378
|
-
const badReason = refusedReason({ context, reason });
|
|
97256
|
+
const badReason = refusedReason({ context, reason: reason2 });
|
|
95379
97257
|
if (badReason !== null) return badReason;
|
|
95380
97258
|
const command = args.rest.length > 0 ? args.rest : ["credential_process"];
|
|
95381
|
-
const outcome = await releaseBatch({ context, args, refs: [connection], reason, command });
|
|
97259
|
+
const outcome = await releaseBatch({ context, args, refs: [connection], reason: reason2, command });
|
|
95382
97260
|
if ("exitCode" in outcome) return outcome.exitCode;
|
|
95383
97261
|
const fields = outcome.released.get(connection)?.fields ?? {};
|
|
95384
97262
|
if (!fields.AWS_SESSION_TOKEN) {
|
|
@@ -95402,12 +97280,12 @@ In openclaw.json: secrets.providers.laze = { "source": "exec", "command": "laze"
|
|
|
95402
97280
|
"args": ["--profile", "<agent profile>", "vault", "exec-provider"], "jsonOnly": true }`;
|
|
95403
97281
|
function execProviderIds({ request: request2 }) {
|
|
95404
97282
|
const ids = request2?.ids;
|
|
95405
|
-
return Array.isArray(ids) ? ids.filter((
|
|
97283
|
+
return Array.isArray(ids) ? ids.filter((id4) => typeof id4 === "string") : [];
|
|
95406
97284
|
}
|
|
95407
|
-
function splitExecId({ id:
|
|
95408
|
-
const at =
|
|
95409
|
-
if (at === -1) return { connection:
|
|
95410
|
-
return { connection:
|
|
97285
|
+
function splitExecId({ id: id4 }) {
|
|
97286
|
+
const at = id4.indexOf("#");
|
|
97287
|
+
if (at === -1) return { connection: id4 };
|
|
97288
|
+
return { connection: id4.slice(0, at), field: id4.slice(at + 1) };
|
|
95411
97289
|
}
|
|
95412
97290
|
function valueOf({
|
|
95413
97291
|
fields,
|
|
@@ -95442,29 +97320,29 @@ ${EXEC_PROVIDER_USAGE}`);
|
|
|
95442
97320
|
ids.length === 0 ? [] : (await resolveBatch({
|
|
95443
97321
|
context,
|
|
95444
97322
|
args,
|
|
95445
|
-
refs: [...new Set(ids.map((
|
|
97323
|
+
refs: [...new Set(ids.map((id4) => splitExecId({ id: id4 }).connection))]
|
|
95446
97324
|
})).filter((entry) => entry.connection).map((entry) => entry.ref)
|
|
95447
97325
|
);
|
|
95448
|
-
for (const
|
|
95449
|
-
const { connection, field } = splitExecId({ id:
|
|
97326
|
+
for (const id4 of ids) {
|
|
97327
|
+
const { connection, field } = splitExecId({ id: id4 });
|
|
95450
97328
|
if (!known.has(connection)) {
|
|
95451
|
-
errors[
|
|
97329
|
+
errors[id4] = { code: "NOT_FOUND" };
|
|
95452
97330
|
continue;
|
|
95453
97331
|
}
|
|
95454
97332
|
const outcome = await releaseBatch({
|
|
95455
97333
|
context,
|
|
95456
97334
|
args: noWait,
|
|
95457
97335
|
refs: [connection],
|
|
95458
|
-
reason: `OpenClaw resolves its ${
|
|
95459
|
-
command: ["openclaw", "secrets", "resolve",
|
|
97336
|
+
reason: `OpenClaw resolves its ${id4} secret reference`,
|
|
97337
|
+
command: ["openclaw", "secrets", "resolve", id4]
|
|
95460
97338
|
}).catch(() => ({ exitCode: -1 }));
|
|
95461
97339
|
if ("exitCode" in outcome) {
|
|
95462
|
-
errors[
|
|
97340
|
+
errors[id4] = { code: codeOfExit({ exitCode: outcome.exitCode }) };
|
|
95463
97341
|
continue;
|
|
95464
97342
|
}
|
|
95465
97343
|
const value = valueOf({ fields: outcome.released.get(connection)?.fields ?? {}, field });
|
|
95466
|
-
if (typeof value === "string") values[
|
|
95467
|
-
else errors[
|
|
97344
|
+
if (typeof value === "string") values[id4] = value;
|
|
97345
|
+
else errors[id4] = value;
|
|
95468
97346
|
}
|
|
95469
97347
|
const answer6 = {
|
|
95470
97348
|
protocolVersion: 1,
|
|
@@ -95573,7 +97451,7 @@ async function vaultScrub({ context, args }) {
|
|
|
95573
97451
|
}
|
|
95574
97452
|
|
|
95575
97453
|
// src/services/whatsapp-business-commands.service.ts
|
|
95576
|
-
import { readFile as
|
|
97454
|
+
import { readFile as readFile45 } from "node:fs/promises";
|
|
95577
97455
|
import { resolve as resolve22 } from "node:path";
|
|
95578
97456
|
|
|
95579
97457
|
// ../../modules/whatsapp-business/contract/src/whatsapp-business.prices.ts
|
|
@@ -95714,7 +97592,7 @@ var whatsappBusinessSendStateSchema = external_exports.enum([
|
|
|
95714
97592
|
"denied",
|
|
95715
97593
|
"expired"
|
|
95716
97594
|
]);
|
|
95717
|
-
var
|
|
97595
|
+
var messageDefinition3 = external_exports.object({
|
|
95718
97596
|
id: external_exports.string(),
|
|
95719
97597
|
at: external_exports.iso.datetime(),
|
|
95720
97598
|
direction: external_exports.enum(["in", "out"]),
|
|
@@ -95729,9 +97607,9 @@ var readInputDefinition2 = external_exports.object({
|
|
|
95729
97607
|
contact: contactRefSchema,
|
|
95730
97608
|
limit: limitSchema2.optional()
|
|
95731
97609
|
});
|
|
95732
|
-
var
|
|
97610
|
+
var readDefinition2 = external_exports.object({
|
|
95733
97611
|
conversation: conversationDefinition,
|
|
95734
|
-
messages: external_exports.array(
|
|
97612
|
+
messages: external_exports.array(messageDefinition3)
|
|
95735
97613
|
});
|
|
95736
97614
|
var sendInputDefinition2 = external_exports.object({
|
|
95737
97615
|
workspaceId: workspaceIdSchema26,
|
|
@@ -95993,7 +97871,7 @@ async function secretsOf3({ context, args }) {
|
|
|
95993
97871
|
const fromConnection = flagText({ args, name: "from-vault" });
|
|
95994
97872
|
if (fromConnection) return { fromConnection };
|
|
95995
97873
|
const file3 = flagText({ args, name: "from-file" });
|
|
95996
|
-
const text3 = file3 ? await
|
|
97874
|
+
const text3 = file3 ? await readFile45(resolve22(context.cwd, file3), "utf8") : await context.readStdin();
|
|
95997
97875
|
const lines2 = text3.split("\n").map((line) => line.trim()).filter(Boolean);
|
|
95998
97876
|
if (lines2.length !== 2) {
|
|
95999
97877
|
throw new CliUsageError(
|
|
@@ -96194,7 +98072,7 @@ async function whatsappBusiness({
|
|
|
96194
98072
|
}
|
|
96195
98073
|
|
|
96196
98074
|
// src/services/whatsapp-pairing-commands.service.ts
|
|
96197
|
-
import { writeFile as
|
|
98075
|
+
import { writeFile as writeFile25 } from "node:fs/promises";
|
|
96198
98076
|
import { resolve as resolve23 } from "node:path";
|
|
96199
98077
|
var WHATSAPP_PAIRING_USAGE = [
|
|
96200
98078
|
" laze whatsapp pair <machine> [--qr <file.svg>] link WhatsApp on your machine; scan the code (owner)",
|
|
@@ -96215,7 +98093,7 @@ function svgOf(dataUrl) {
|
|
|
96215
98093
|
}
|
|
96216
98094
|
async function report2({ context, args, pairing: pairing2 }) {
|
|
96217
98095
|
const qrFile = pairing2.qrSvg ? resolve23(context.cwd, flagText({ args, name: "qr", fallback: "whatsapp-qr.svg" })) : null;
|
|
96218
|
-
if (qrFile && pairing2.qrSvg) await
|
|
98096
|
+
if (qrFile && pairing2.qrSvg) await writeFile25(qrFile, svgOf(pairing2.qrSvg), "utf8");
|
|
96219
98097
|
if (args.flags.json) return context.out(`${JSON.stringify({ ...pairing2, qrFile }, null, 2)}
|
|
96220
98098
|
`);
|
|
96221
98099
|
context.out(`${pairing2.pairingId} ${pairing2.state}
|
|
@@ -96701,7 +98579,11 @@ var HELP = `laze: work in a Laze workspace from your terminal or your agent.
|
|
|
96701
98579
|
laze feed done|put-back|unsnooze|pin|unpin <id>, snooze <id> --until <time> move or pin a card
|
|
96702
98580
|
an agent whose owner turned on Manage my feed runs these on its owner's whole feed
|
|
96703
98581
|
laze feed channel <channelId> the feed cards a channel shows
|
|
98582
|
+
laze feed labels the workspace's labels, to reuse before adding one
|
|
98583
|
+
laze feed rank [<id> <priority>|--set <id>=<priority>...] order your own feed for you alone
|
|
98584
|
+
an agent with Manage my feed lists its owner's cards by title and ranks many in one call
|
|
96704
98585
|
laze schedule add <name> --prompt <p> --cron "0 8 * * 1-5" --tz <zone> work on a timer
|
|
98586
|
+
laze schedule add|update ... --check <script> a script decides each firing, without a model
|
|
96705
98587
|
laze schedule list|update|pause|resume|rm|runs your agent's schedules and their runs
|
|
96706
98588
|
laze memory get|set|append|history <file>, search, pull SOUL.md, AGENTS.md, a channel's MEMORY.md
|
|
96707
98589
|
laze wiki list|get|put|search|history|mv|rm the workspace wiki
|
|
@@ -96801,6 +98683,8 @@ var HELP = `laze: work in a Laze workspace from your terminal or your agent.
|
|
|
96801
98683
|
laze ip [status|on <country>|off|countries|domains [add|remove|reset]|list] your dedicated IP for sites that block Laze
|
|
96802
98684
|
laze ip offer --site <domain> when a site blocks the shared address: the offer to pass on, price included
|
|
96803
98685
|
laze ops suspend|release <workspace> --reason "<why>" Laze operators only, with LAZE_OPS_TOKEN
|
|
98686
|
+
laze ops request <action> <target> --reason "<why>" [--wait] | status <key> | use <key>
|
|
98687
|
+
a 15 minute operator key for one action; an operator approves it with a passkey
|
|
96804
98688
|
laze machine exec <machine> [--timeout <s>] -- <command> run a command on a person's own machine
|
|
96805
98689
|
When someone wants work done on their own machine, run it there; if it is offline, say so and go on where you run
|
|
96806
98690
|
laze machine exec <machine> --vault <connection> --reason "<why>" -- <command> the same, with a vault connection
|
|
@@ -97106,21 +98990,26 @@ function exitCodeOf({ context, error: error63 }) {
|
|
|
97106
98990
|
`);
|
|
97107
98991
|
else if (error63 instanceof LazeApiError) context.err(`laze: ${error63.message} (${error63.code})
|
|
97108
98992
|
`);
|
|
97109
|
-
else
|
|
98993
|
+
else {
|
|
98994
|
+
const unreachable = unreachableReasonOf(error63);
|
|
98995
|
+
if (unreachable === void 0) throw error63;
|
|
98996
|
+
context.err(`laze: could not reach Laze: ${unreachable}
|
|
98997
|
+
`);
|
|
98998
|
+
}
|
|
97110
98999
|
return 1;
|
|
97111
99000
|
}
|
|
97112
99001
|
|
|
97113
99002
|
// src/services/machine-key.service.ts
|
|
97114
99003
|
import { execFile as execFile2 } from "node:child_process";
|
|
97115
99004
|
import {
|
|
97116
|
-
createHash as
|
|
99005
|
+
createHash as createHash6,
|
|
97117
99006
|
createPrivateKey,
|
|
97118
99007
|
generateKeyPairSync,
|
|
97119
|
-
randomBytes as
|
|
99008
|
+
randomBytes as randomBytes4,
|
|
97120
99009
|
sign
|
|
97121
99010
|
} from "node:crypto";
|
|
97122
|
-
import { chmod as chmod4, link, mkdir as
|
|
97123
|
-
import { dirname as
|
|
99011
|
+
import { chmod as chmod4, link, mkdir as mkdir25, readFile as readFile46, rm as rm17, writeFile as writeFile26 } from "node:fs/promises";
|
|
99012
|
+
import { dirname as dirname26, join as join31 } from "node:path";
|
|
97124
99013
|
var KEYCHAIN_SERVICE = "laze-cli-machine-key";
|
|
97125
99014
|
var runProgram = ({ program, args, stdin: stdin2, timeoutMs }) => new Promise((resolve24, reject) => {
|
|
97126
99015
|
const child = execFile2(
|
|
@@ -97160,15 +99049,15 @@ var MachineKeyStore = class _MachineKeyStore {
|
|
|
97160
99049
|
});
|
|
97161
99050
|
}
|
|
97162
99051
|
get metaPath() {
|
|
97163
|
-
return
|
|
99052
|
+
return join31(dirname26(this.options.configPath), "machine-key.json");
|
|
97164
99053
|
}
|
|
97165
99054
|
/** Named by the key, so two CLIs making a key at once never overwrite each other's. */
|
|
97166
99055
|
pemPathOf(jwk) {
|
|
97167
|
-
return
|
|
99056
|
+
return join31(dirname26(this.options.configPath), `machine-key-${shortOf(jwk)}.pem`);
|
|
97168
99057
|
}
|
|
97169
99058
|
/** The Keychain item's account: one per config file and key. */
|
|
97170
99059
|
accountOf(jwk) {
|
|
97171
|
-
const config2 =
|
|
99060
|
+
const config2 = createHash6("sha256").update(this.options.configPath).digest("hex");
|
|
97172
99061
|
return `${config2.slice(0, 32)}-${shortOf(jwk)}`;
|
|
97173
99062
|
}
|
|
97174
99063
|
/** The key if this machine made one; null otherwise. Read once per process. */
|
|
@@ -97192,7 +99081,7 @@ var MachineKeyStore = class _MachineKeyStore {
|
|
|
97192
99081
|
async read() {
|
|
97193
99082
|
let meta3;
|
|
97194
99083
|
try {
|
|
97195
|
-
meta3 = machineKeyRegistrationSchema.parse(JSON.parse(await
|
|
99084
|
+
meta3 = machineKeyRegistrationSchema.parse(JSON.parse(await readFile46(this.metaPath, "utf8")));
|
|
97196
99085
|
} catch {
|
|
97197
99086
|
return null;
|
|
97198
99087
|
}
|
|
@@ -97207,7 +99096,7 @@ var MachineKeyStore = class _MachineKeyStore {
|
|
|
97207
99096
|
"-w"
|
|
97208
99097
|
],
|
|
97209
99098
|
timeoutMs: 1e4
|
|
97210
|
-
}) : await
|
|
99099
|
+
}) : await readFile46(this.pemPathOf(meta3.jwk), "utf8");
|
|
97211
99100
|
return keyOf2({ meta: meta3, privateKey: createPrivateKey(pemOf(pem)) });
|
|
97212
99101
|
}
|
|
97213
99102
|
async make() {
|
|
@@ -97231,7 +99120,7 @@ var MachineKeyStore = class _MachineKeyStore {
|
|
|
97231
99120
|
return kept;
|
|
97232
99121
|
}
|
|
97233
99122
|
async drop({ tier, jwk }) {
|
|
97234
|
-
if (tier === "file") return
|
|
99123
|
+
if (tier === "file") return rm17(this.pemPathOf(jwk), { force: true });
|
|
97235
99124
|
await this.options.run({
|
|
97236
99125
|
program: "security",
|
|
97237
99126
|
args: ["delete-generic-password", "-s", KEYCHAIN_SERVICE, "-a", this.accountOf(jwk)],
|
|
@@ -97278,7 +99167,7 @@ function keyOf2({ meta: meta3, privateKey }) {
|
|
|
97278
99167
|
}
|
|
97279
99168
|
var shortOf = (jwk) => thumbprintOf({ jwk }).slice(0, 12);
|
|
97280
99169
|
async function writeOnce({ path, text: text3 }) {
|
|
97281
|
-
const temporary = `${path}.${process.pid}.${
|
|
99170
|
+
const temporary = `${path}.${process.pid}.${randomBytes4(6).toString("hex")}.tmp`;
|
|
97282
99171
|
await writePrivate({ path: temporary, text: text3 });
|
|
97283
99172
|
try {
|
|
97284
99173
|
await link(temporary, path);
|
|
@@ -97287,12 +99176,12 @@ async function writeOnce({ path, text: text3 }) {
|
|
|
97287
99176
|
if (error63.code === "EEXIST") return false;
|
|
97288
99177
|
throw error63;
|
|
97289
99178
|
} finally {
|
|
97290
|
-
await
|
|
99179
|
+
await rm17(temporary, { force: true });
|
|
97291
99180
|
}
|
|
97292
99181
|
}
|
|
97293
99182
|
async function writePrivate({ path, text: text3 }) {
|
|
97294
|
-
await
|
|
97295
|
-
await
|
|
99183
|
+
await mkdir25(dirname26(path), { recursive: true, mode: 448 });
|
|
99184
|
+
await writeFile26(path, text3, { mode: 384 });
|
|
97296
99185
|
await chmod4(path, 384);
|
|
97297
99186
|
}
|
|
97298
99187
|
|
|
@@ -97349,8 +99238,8 @@ function machineProofFetch({
|
|
|
97349
99238
|
// src/services/processes.service.ts
|
|
97350
99239
|
import { execFile as execFile3, spawn as spawn4 } from "node:child_process";
|
|
97351
99240
|
import { mkdirSync, openSync } from "node:fs";
|
|
97352
|
-
import { readFile as
|
|
97353
|
-
import { dirname as
|
|
99241
|
+
import { readFile as readFile47, readlink } from "node:fs/promises";
|
|
99242
|
+
import { dirname as dirname27 } from "node:path";
|
|
97354
99243
|
import { promisify as promisify2 } from "node:util";
|
|
97355
99244
|
var run3 = promisify2(execFile3);
|
|
97356
99245
|
function alive(pid) {
|
|
@@ -97362,15 +99251,15 @@ function alive(pid) {
|
|
|
97362
99251
|
return error63.code === "EPERM";
|
|
97363
99252
|
}
|
|
97364
99253
|
}
|
|
97365
|
-
async function
|
|
97366
|
-
const raw = await
|
|
99254
|
+
async function argsOf2(pid) {
|
|
99255
|
+
const raw = await readFile47(`/proc/${pid}/cmdline`, "utf8").catch(() => void 0);
|
|
97367
99256
|
if (raw) return raw.split("\0").filter(Boolean);
|
|
97368
99257
|
const listed = await run3("ps", ["-o", "args=", "-p", String(pid)]).catch(() => void 0);
|
|
97369
99258
|
const line = listed?.stdout.trim();
|
|
97370
99259
|
return line ? line.split(/\s+/) : void 0;
|
|
97371
99260
|
}
|
|
97372
99261
|
async function parentOf(pid) {
|
|
97373
|
-
const stat11 = await
|
|
99262
|
+
const stat11 = await readFile47(`/proc/${pid}/stat`, "utf8").catch(() => void 0);
|
|
97374
99263
|
const fromStat = stat11 ? Number(stat11.slice(stat11.lastIndexOf(")") + 2).split(" ")[1]) : NaN;
|
|
97375
99264
|
if (fromStat > 0) return fromStat;
|
|
97376
99265
|
const listed = await run3("ps", ["-o", "ppid=", "-p", String(pid)]).catch(() => void 0);
|
|
@@ -97387,7 +99276,7 @@ async function cwdOf(pid) {
|
|
|
97387
99276
|
return line ? line.slice(1) : void 0;
|
|
97388
99277
|
}
|
|
97389
99278
|
function spawnDetached({ argv, logPath }) {
|
|
97390
|
-
mkdirSync(
|
|
99279
|
+
mkdirSync(dirname27(logPath), { recursive: true, mode: 448 });
|
|
97391
99280
|
const log = openSync(logPath, "a", 384);
|
|
97392
99281
|
const [program = "", ...rest] = argv;
|
|
97393
99282
|
const child = spawn4(program, rest, { detached: true, stdio: ["ignore", log, log] });
|
|
@@ -97404,7 +99293,7 @@ function stop2(pid) {
|
|
|
97404
99293
|
return true;
|
|
97405
99294
|
}
|
|
97406
99295
|
function nodeProcesses() {
|
|
97407
|
-
return { pid: process.pid, alive, argsOf, parentOf, cwdOf, spawnDetached, stop: stop2 };
|
|
99296
|
+
return { pid: process.pid, alive, argsOf: argsOf2, parentOf, cwdOf, spawnDetached, stop: stop2 };
|
|
97408
99297
|
}
|
|
97409
99298
|
|
|
97410
99299
|
// src/services/proxied-fetch.service.ts
|