@lazehq/cli 0.1.75 → 0.1.77
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 +778 -269
- package/package.json +1 -1
package/dist/laze.mjs
CHANGED
|
@@ -1014,13 +1014,13 @@ var require_buffer_util = __commonJS({
|
|
|
1014
1014
|
"use strict";
|
|
1015
1015
|
var { EMPTY_BUFFER } = require_constants();
|
|
1016
1016
|
var FastBuffer = Buffer[Symbol.species];
|
|
1017
|
-
function concat2(
|
|
1018
|
-
if (
|
|
1019
|
-
if (
|
|
1017
|
+
function concat2(list12, totalLength) {
|
|
1018
|
+
if (list12.length === 0) return EMPTY_BUFFER;
|
|
1019
|
+
if (list12.length === 1) return list12[0];
|
|
1020
1020
|
const target = Buffer.allocUnsafe(totalLength);
|
|
1021
1021
|
let offset = 0;
|
|
1022
|
-
for (let i = 0; i <
|
|
1023
|
-
const buf =
|
|
1022
|
+
for (let i = 0; i < list12.length; i++) {
|
|
1023
|
+
const buf = list12[i];
|
|
1024
1024
|
target.set(buf, offset);
|
|
1025
1025
|
offset += buf.length;
|
|
1026
1026
|
}
|
|
@@ -2806,14 +2806,14 @@ var require_sender = __commonJS({
|
|
|
2806
2806
|
* @param {Function} [cb] Callback
|
|
2807
2807
|
* @private
|
|
2808
2808
|
*/
|
|
2809
|
-
sendFrame(
|
|
2810
|
-
if (
|
|
2809
|
+
sendFrame(list12, cb) {
|
|
2810
|
+
if (list12.length === 2) {
|
|
2811
2811
|
this._socket.cork();
|
|
2812
|
-
this._socket.write(
|
|
2813
|
-
this._socket.write(
|
|
2812
|
+
this._socket.write(list12[0]);
|
|
2813
|
+
this._socket.write(list12[1], cb);
|
|
2814
2814
|
this._socket.uncork();
|
|
2815
2815
|
} else {
|
|
2816
|
-
this._socket.write(
|
|
2816
|
+
this._socket.write(list12[0], cb);
|
|
2817
2817
|
}
|
|
2818
2818
|
}
|
|
2819
2819
|
};
|
|
@@ -10179,8 +10179,8 @@ var require_util2 = __commonJS({
|
|
|
10179
10179
|
}
|
|
10180
10180
|
return values;
|
|
10181
10181
|
}
|
|
10182
|
-
function getDecodeSplit(name3,
|
|
10183
|
-
const value =
|
|
10182
|
+
function getDecodeSplit(name3, list12) {
|
|
10183
|
+
const value = list12.get(name3, true);
|
|
10184
10184
|
if (value === null) {
|
|
10185
10185
|
return null;
|
|
10186
10186
|
}
|
|
@@ -15344,7 +15344,7 @@ var require_socks5_client = __commonJS({
|
|
|
15344
15344
|
USERNAME_PASSWORD: 2,
|
|
15345
15345
|
NO_ACCEPTABLE: 255
|
|
15346
15346
|
};
|
|
15347
|
-
var
|
|
15347
|
+
var COMMANDS5 = {
|
|
15348
15348
|
CONNECT: 1,
|
|
15349
15349
|
BIND: 2,
|
|
15350
15350
|
UDP_ASSOCIATE: 3
|
|
@@ -15546,7 +15546,7 @@ var require_socks5_client = __commonJS({
|
|
|
15546
15546
|
}
|
|
15547
15547
|
debug("connecting to", address, port);
|
|
15548
15548
|
this.state = STATES.CONNECTING;
|
|
15549
|
-
const request2 = this.buildConnectRequest(
|
|
15549
|
+
const request2 = this.buildConnectRequest(COMMANDS5.CONNECT, address, port);
|
|
15550
15550
|
this.socket.write(request2);
|
|
15551
15551
|
}
|
|
15552
15552
|
/**
|
|
@@ -15651,7 +15651,7 @@ var require_socks5_client = __commonJS({
|
|
|
15651
15651
|
module.exports = {
|
|
15652
15652
|
Socks5Client,
|
|
15653
15653
|
AUTH_METHODS,
|
|
15654
|
-
COMMANDS:
|
|
15654
|
+
COMMANDS: COMMANDS5,
|
|
15655
15655
|
ADDRESS_TYPES,
|
|
15656
15656
|
REPLY_CODES,
|
|
15657
15657
|
STATES
|
|
@@ -24792,9 +24792,9 @@ var require_headers = __commonJS({
|
|
|
24792
24792
|
// https://fetch.spec.whatwg.org/#dom-headers-getsetcookie
|
|
24793
24793
|
getSetCookie() {
|
|
24794
24794
|
webidl.brandCheck(this, _Headers);
|
|
24795
|
-
const
|
|
24796
|
-
if (
|
|
24797
|
-
return [...
|
|
24795
|
+
const list12 = this.#headersList.cookies;
|
|
24796
|
+
if (list12) {
|
|
24797
|
+
return [...list12];
|
|
24798
24798
|
}
|
|
24799
24799
|
return [];
|
|
24800
24800
|
}
|
|
@@ -24818,8 +24818,8 @@ var require_headers = __commonJS({
|
|
|
24818
24818
|
* @param {Headers} target
|
|
24819
24819
|
* @param {HeadersList} list
|
|
24820
24820
|
*/
|
|
24821
|
-
static setHeadersList(target,
|
|
24822
|
-
target.#headersList =
|
|
24821
|
+
static setHeadersList(target, list12) {
|
|
24822
|
+
target.#headersList = list12;
|
|
24823
24823
|
}
|
|
24824
24824
|
};
|
|
24825
24825
|
var { getHeadersGuard, setHeadersGuard, getHeadersList, setHeadersList } = Headers2;
|
|
@@ -25779,13 +25779,13 @@ var require_request2 = __commonJS({
|
|
|
25779
25779
|
if (this.signal.aborted) {
|
|
25780
25780
|
ac.abort(this.signal.reason);
|
|
25781
25781
|
} else {
|
|
25782
|
-
let
|
|
25783
|
-
if (
|
|
25784
|
-
|
|
25785
|
-
dependentControllerMap.set(this.signal,
|
|
25782
|
+
let list12 = dependentControllerMap.get(this.signal);
|
|
25783
|
+
if (list12 === void 0) {
|
|
25784
|
+
list12 = /* @__PURE__ */ new Set();
|
|
25785
|
+
dependentControllerMap.set(this.signal, list12);
|
|
25786
25786
|
}
|
|
25787
25787
|
const acRef = new WeakRef(ac);
|
|
25788
|
-
|
|
25788
|
+
list12.add(acRef);
|
|
25789
25789
|
util.addAbortListener(
|
|
25790
25790
|
ac.signal,
|
|
25791
25791
|
buildAbort(acRef)
|
|
@@ -36927,7 +36927,7 @@ function flagText({
|
|
|
36927
36927
|
}
|
|
36928
36928
|
|
|
36929
36929
|
// src/rules/cli-version.rules.ts
|
|
36930
|
-
var STAMPED = "0.1.
|
|
36930
|
+
var STAMPED = "0.1.77";
|
|
36931
36931
|
function cliVersionOf({ stamped = STAMPED } = {}) {
|
|
36932
36932
|
return stamped.startsWith("__") ? "dev" : stamped;
|
|
36933
36933
|
}
|
|
@@ -53107,8 +53107,8 @@ var contributors = {
|
|
|
53107
53107
|
function aggregateChecks(schema) {
|
|
53108
53108
|
const agg = {};
|
|
53109
53109
|
const def = schema._zod.def;
|
|
53110
|
-
const
|
|
53111
|
-
for (const ch of
|
|
53110
|
+
const list12 = schema._zod.traits.has("$ZodCheck") ? [schema, ...def.checks ?? []] : def.checks ?? [];
|
|
53111
|
+
for (const ch of list12)
|
|
53112
53112
|
contributors[ch._zod.def.check]?.(agg, ch._zod.def);
|
|
53113
53113
|
const bag = schema._zod.bag;
|
|
53114
53114
|
if (bag.minimum !== void 0)
|
|
@@ -58518,7 +58518,7 @@ var registry3 = {
|
|
|
58518
58518
|
},
|
|
58519
58519
|
langy_github_not_connected: {
|
|
58520
58520
|
tips: [
|
|
58521
|
-
"Install the Laze GitHub App (Settings \u2192
|
|
58521
|
+
"Install the Laze GitHub App (Settings \u2192 Connectors) to let the agent open pull requests"
|
|
58522
58522
|
]
|
|
58523
58523
|
},
|
|
58524
58524
|
langy_api_credential_missing: {
|
|
@@ -58549,7 +58549,7 @@ var registry3 = {
|
|
|
58549
58549
|
},
|
|
58550
58550
|
langy_github_repo_not_accessible: {
|
|
58551
58551
|
tips: [
|
|
58552
|
-
"Grant the Laze GitHub App access to that repository (Settings \u2192
|
|
58552
|
+
"Grant the Laze GitHub App access to that repository (Settings \u2192 Connectors \u2192 Configure), then retry"
|
|
58553
58553
|
]
|
|
58554
58554
|
},
|
|
58555
58555
|
langy_worker_spawn_failed: {
|
|
@@ -58873,9 +58873,11 @@ function moduleApi(name3) {
|
|
|
58873
58873
|
var MIRRORED_KEY_SEGMENT = "mirrored";
|
|
58874
58874
|
function mirroredQueryKey({
|
|
58875
58875
|
path,
|
|
58876
|
-
workspaceId
|
|
58876
|
+
workspaceId,
|
|
58877
|
+
scope: scope2
|
|
58877
58878
|
}) {
|
|
58878
|
-
|
|
58879
|
+
const key = [path.split("."), workspaceId, MIRRORED_KEY_SEGMENT];
|
|
58880
|
+
return scope2 === void 0 ? key : [...key, scope2];
|
|
58879
58881
|
}
|
|
58880
58882
|
function contractBuilder(namespace, members3) {
|
|
58881
58883
|
const member = (name3, kind2, read4 = {}) => ({
|
|
@@ -58920,7 +58922,7 @@ function assertMirrorDeclared({
|
|
|
58920
58922
|
if (mirrored.path !== path) {
|
|
58921
58923
|
throw new Error(`tRPC read "${path}" declares the mirror of "${mirrored.path}"`);
|
|
58922
58924
|
}
|
|
58923
|
-
if (Object.keys(mirrored.staleOn).length === 0) {
|
|
58925
|
+
if ("staleOn" in mirrored && Object.keys(mirrored.staleOn).length === 0) {
|
|
58924
58926
|
throw new Error(`Mirrored read "${path}" declares no realtime event that makes it stale`);
|
|
58925
58927
|
}
|
|
58926
58928
|
}
|
|
@@ -58954,6 +58956,15 @@ function defineSurfaces(contract, procedures, operations = {}) {
|
|
|
58954
58956
|
return { namespace: contract.namespace, procedures, operations };
|
|
58955
58957
|
}
|
|
58956
58958
|
|
|
58959
|
+
// ../../packages/module/src/contract/middleware-context.ts
|
|
58960
|
+
function defineMiddlewareContext(name3, schema, options) {
|
|
58961
|
+
return Object.freeze({ name: name3, schema, ...options });
|
|
58962
|
+
}
|
|
58963
|
+
|
|
58964
|
+
// ../../packages/module/src/contract/caller-client.ts
|
|
58965
|
+
var callerClientSchema = external_exports.enum(["web", "desktop", "iphone"]);
|
|
58966
|
+
var callerClientContext = defineMiddlewareContext("callerClient", callerClientSchema);
|
|
58967
|
+
|
|
58957
58968
|
// ../../packages/module/src/contract/ui-tokens.ts
|
|
58958
58969
|
var UiTokenIdentity = class {
|
|
58959
58970
|
constructor(kind2, owner, name3) {
|
|
@@ -59048,11 +59059,17 @@ var createApiKeyInputSchemaDefinition = external_exports.object({
|
|
|
59048
59059
|
permissions: external_exports.array(authzPermissionSchema).min(1)
|
|
59049
59060
|
});
|
|
59050
59061
|
var createApiKeyInputSchema = createApiKeyInputSchemaDefinition;
|
|
59062
|
+
var PERSONAL_API_KEY_KINDS = ["agent_request", "login", "program"];
|
|
59051
59063
|
var personalApiKeySchemaDefinition = external_exports.object({
|
|
59052
59064
|
id: external_exports.string().min(1),
|
|
59053
59065
|
name: external_exports.string(),
|
|
59054
59066
|
/** The device a `laze login` asked from, as the CLI named itself; null for other keys. */
|
|
59055
59067
|
clientName: external_exports.string().nullable(),
|
|
59068
|
+
kind: external_exports.enum(PERSONAL_API_KEY_KINDS),
|
|
59069
|
+
/** The plain name to show. */
|
|
59070
|
+
label: external_exports.string(),
|
|
59071
|
+
/** The agent a request key belongs to; null when none is tied to it. */
|
|
59072
|
+
agentId: external_exports.string().nullable(),
|
|
59056
59073
|
/** ISO 8601 */
|
|
59057
59074
|
createdAt: external_exports.iso.datetime(),
|
|
59058
59075
|
lastUsedAt: external_exports.iso.datetime().nullable(),
|
|
@@ -59267,8 +59284,8 @@ var { publicOriginAliases } = Config.define((c) => ({
|
|
|
59267
59284
|
external_exports.string().optional().transform((value) => originsOf({ list: value ?? "" }))
|
|
59268
59285
|
)
|
|
59269
59286
|
}));
|
|
59270
|
-
function originsOf({ list:
|
|
59271
|
-
const origins =
|
|
59287
|
+
function originsOf({ list: list12 }) {
|
|
59288
|
+
const origins = list12.split(",").map((entry) => entry.trim()).filter((entry) => URL.canParse(entry)).map((entry) => new URL(entry)).filter((url2) => url2.protocol === "https:" || url2.protocol === "http:").map((url2) => url2.origin);
|
|
59272
59289
|
return [...new Set(origins)];
|
|
59273
59290
|
}
|
|
59274
59291
|
var { appsDomain } = Config.define((c) => ({
|
|
@@ -59709,6 +59726,12 @@ var vaultReasonSchema = external_exports.string().transform((reason) => reason.t
|
|
|
59709
59726
|
// ../../modules/vault/contract/src/vault-reauth.ts
|
|
59710
59727
|
var VAULT_REAUTH = { proofSeconds: 300, failuresAllowed: 5, windowMinutes: 15 };
|
|
59711
59728
|
var vaultReauthMethodSchema = external_exports.enum(["password", "passkey", "secure_enclave"]);
|
|
59729
|
+
var beginVaultReauthInputSchemaDefinition = external_exports.object({
|
|
59730
|
+
workspaceId: external_exports.string().min(1),
|
|
59731
|
+
/** The CLI key this proof approves: signed into the challenge, and it can do nothing else. */
|
|
59732
|
+
apiKeyId: external_exports.string().min(1).optional()
|
|
59733
|
+
});
|
|
59734
|
+
var beginVaultReauthInputSchema = beginVaultReauthInputSchemaDefinition;
|
|
59712
59735
|
var vaultReauthChallengeSchemaDefinition = external_exports.object({
|
|
59713
59736
|
challenge: external_exports.string(),
|
|
59714
59737
|
methods: external_exports.object({
|
|
@@ -60068,6 +60091,8 @@ var openVaultTurnInputSchemaDefinition = external_exports.object({
|
|
|
60068
60091
|
requesterSeesChannel: external_exports.boolean().default(true),
|
|
60069
60092
|
/** The thread the agent answers in, so its approval cards show there; null for the channel. */
|
|
60070
60093
|
threadRootId: external_exports.string().min(1).nullable().default(null),
|
|
60094
|
+
/** The message the turn answers: the turn's reads end when a turn that took it ends. */
|
|
60095
|
+
messageId: external_exports.string().min(1).nullable().default(null),
|
|
60071
60096
|
/** Where the agent runs: a Laze sandbox, or a machine that reaches Laze over the network. */
|
|
60072
60097
|
origin: external_exports.enum(["sandbox", "network"]).default("sandbox"),
|
|
60073
60098
|
/** The requester's messages in this conversation, oldest first: the judge's permission. */
|
|
@@ -60433,7 +60458,7 @@ var vaultTrpc = defineTrpcContract("vault").mutation("createConnection").withInp
|
|
|
60433
60458
|
reason: external_exports.string().trim().min(1).max(200),
|
|
60434
60459
|
reauthToken: external_exports.string().min(1).max(200).optional()
|
|
60435
60460
|
})
|
|
60436
|
-
).withOutput(external_exports.object({ fields: external_exports.record(external_exports.string(), external_exports.string()) })).mutation("beginReauth").withInput(
|
|
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(
|
|
60437
60462
|
external_exports.object({
|
|
60438
60463
|
...workspaceInput.shape,
|
|
60439
60464
|
deviceId: external_exports.string().min(1),
|
|
@@ -61199,7 +61224,10 @@ var vaultWatchReportSchemaDefinition = external_exports.object({
|
|
|
61199
61224
|
accepted: external_exports.boolean(),
|
|
61200
61225
|
refused: external_exports.string().max(2e3).optional()
|
|
61201
61226
|
}).nullish().transform((value) => value ?? null),
|
|
61202
|
-
failures: lines
|
|
61227
|
+
failures: lines,
|
|
61228
|
+
operatorChainLength: external_exports.number().int().min(0).optional(),
|
|
61229
|
+
operatorChainHead: external_exports.string().max(128).optional(),
|
|
61230
|
+
operatorChainProblem: external_exports.string().max(2e3).optional()
|
|
61203
61231
|
});
|
|
61204
61232
|
var vaultWatchReportReceiptSchemaDefinition = external_exports.object({
|
|
61205
61233
|
stored: external_exports.boolean(),
|
|
@@ -61222,10 +61250,55 @@ var vaultWatchOverrideSchemaDefinition = external_exports.object({
|
|
|
61222
61250
|
nonce: external_exports.string().regex(/^[A-Za-z0-9_-]{16,128}$/, "16 to 128 base64url characters"),
|
|
61223
61251
|
assertion: vaultPasskeyAssertionSchemaDefinition
|
|
61224
61252
|
});
|
|
61253
|
+
var vaultOperatorSignerSchema = external_exports.object({ rpId: external_exports.string().min(1), credentialId: b64url2 });
|
|
61225
61254
|
var vaultBreakerChallengeSchemaDefinition = external_exports.object({
|
|
61226
61255
|
challenge: b64url2,
|
|
61227
61256
|
rpId: external_exports.string().min(1),
|
|
61228
|
-
credentialId: b64url2
|
|
61257
|
+
credentialId: b64url2,
|
|
61258
|
+
/** Every trusted passkey; the page signs with the one for its own host. */
|
|
61259
|
+
passkeys: external_exports.array(vaultOperatorSignerSchema).default([])
|
|
61260
|
+
});
|
|
61261
|
+
var vaultOperatorPasskeySchemaDefinition = external_exports.object({
|
|
61262
|
+
credentialId: b64url2,
|
|
61263
|
+
rpId: external_exports.string().min(1),
|
|
61264
|
+
fingerprint: external_exports.string(),
|
|
61265
|
+
/** A signed name; the fingerprint stays what identifies the passkey. */
|
|
61266
|
+
label: external_exports.string().optional(),
|
|
61267
|
+
/** The passkey in deploy/vaultd.env that the rotation chain starts from. */
|
|
61268
|
+
pinned: external_exports.boolean(),
|
|
61269
|
+
/** Signed once by the passkey itself; only a tested passkey approves or may be left alone. */
|
|
61270
|
+
tested: external_exports.boolean(),
|
|
61271
|
+
addedAt: external_exports.string().optional(),
|
|
61272
|
+
/** Before this an added passkey approves nothing (the 24 hour hold). */
|
|
61273
|
+
approvesFrom: external_exports.string().optional()
|
|
61274
|
+
});
|
|
61275
|
+
var vaultOperatorProposalSchemaDefinition = external_exports.object({
|
|
61276
|
+
credentialId: b64url2,
|
|
61277
|
+
rpId: external_exports.string().min(1),
|
|
61278
|
+
fingerprint: external_exports.string()
|
|
61279
|
+
});
|
|
61280
|
+
var vaultOperatorProposeSchemaDefinition = external_exports.object({
|
|
61281
|
+
publicKey: external_exports.string().min(1).max(512),
|
|
61282
|
+
credentialId: b64url2,
|
|
61283
|
+
rpId: external_exports.string().min(1).max(253),
|
|
61284
|
+
origin: external_exports.url().max(300)
|
|
61285
|
+
});
|
|
61286
|
+
var VAULT_OPERATOR_ACTIONS = ["add", "prove", "remove", "label"];
|
|
61287
|
+
var VAULT_OPERATOR_LABEL_MAX = 40;
|
|
61288
|
+
var vaultOperatorChallengeInputSchemaDefinition = external_exports.object({
|
|
61289
|
+
action: external_exports.enum(VAULT_OPERATOR_ACTIONS),
|
|
61290
|
+
/** The passkey a prove, remove or label is about; an add takes the waiting proposal. */
|
|
61291
|
+
credentialId: b64url2.optional(),
|
|
61292
|
+
/** The name a label record signs. */
|
|
61293
|
+
label: external_exports.string().min(1).max(VAULT_OPERATOR_LABEL_MAX).optional()
|
|
61294
|
+
});
|
|
61295
|
+
var vaultOperatorChallengeSchemaDefinition = external_exports.object({
|
|
61296
|
+
challenge: b64url2,
|
|
61297
|
+
/** The passkeys vaultd would accept this record from. */
|
|
61298
|
+
passkeys: external_exports.array(vaultOperatorSignerSchema)
|
|
61299
|
+
});
|
|
61300
|
+
var vaultOperatorChainSchemaDefinition = external_exports.object({
|
|
61301
|
+
records: external_exports.array(external_exports.record(external_exports.string(), external_exports.unknown()))
|
|
61229
61302
|
});
|
|
61230
61303
|
var vaultdStateSchemaDefinition = external_exports.union([
|
|
61231
61304
|
external_exports.object({
|
|
@@ -61235,9 +61308,15 @@ var vaultdStateSchemaDefinition = external_exports.union([
|
|
|
61235
61308
|
currentKeyId: external_exports.string(),
|
|
61236
61309
|
readableKeyIds: external_exports.array(external_exports.string()),
|
|
61237
61310
|
breaker: external_exports.enum(["closed", "open"]),
|
|
61311
|
+
/** Locks content opens (ADR-185); one operator passkey reset closes it with `breaker`. */
|
|
61312
|
+
contentBreaker: external_exports.enum(["closed", "open"]),
|
|
61313
|
+
/** Locks only mirrors' `sweep` opens; closed by the same reset. */
|
|
61314
|
+
sweepBreaker: external_exports.enum(["closed", "open"]),
|
|
61238
61315
|
dryRun: external_exports.boolean(),
|
|
61239
61316
|
/** The pinned operator passkey's credential id; empty when none is pinned. */
|
|
61240
|
-
operatorCredentialId: external_exports.string()
|
|
61317
|
+
operatorCredentialId: external_exports.string(),
|
|
61318
|
+
operators: external_exports.array(vaultOperatorPasskeySchemaDefinition).default([]),
|
|
61319
|
+
operatorProposal: vaultOperatorProposalSchemaDefinition.nullable().default(null)
|
|
61241
61320
|
}),
|
|
61242
61321
|
external_exports.object({ holder: external_exports.literal("vaultd"), reachable: external_exports.literal(false), problem: external_exports.string() }),
|
|
61243
61322
|
/** Development and tests: the key lives in this process, which has no breaker. */
|
|
@@ -62566,6 +62645,16 @@ var newMemberSchemaDefinition = external_exports.object({
|
|
|
62566
62645
|
ownerUserId: idSchema4.optional(),
|
|
62567
62646
|
agentKind: external_exports.enum(["personal", "team"]).optional()
|
|
62568
62647
|
});
|
|
62648
|
+
var channelGroupInputSchemaDefinition = external_exports.object({
|
|
62649
|
+
workspaceId: external_exports.string().min(1),
|
|
62650
|
+
channelId: external_exports.string().min(1),
|
|
62651
|
+
groupId: external_exports.string().min(1)
|
|
62652
|
+
});
|
|
62653
|
+
var channelGroupInputSchema = channelGroupInputSchemaDefinition;
|
|
62654
|
+
var channelGroupsSchemaDefinition = external_exports.array(
|
|
62655
|
+
external_exports.object({ id: external_exports.string(), name: external_exports.string(), memberIds: external_exports.array(external_exports.string()) })
|
|
62656
|
+
);
|
|
62657
|
+
var channelGroupsSchema = channelGroupsSchemaDefinition;
|
|
62569
62658
|
var addMembersInputSchemaDefinition = external_exports.object({
|
|
62570
62659
|
workspaceId: workspaceIdSchema,
|
|
62571
62660
|
channelId: idSchema4,
|
|
@@ -63102,6 +63191,42 @@ var threadsMirror = {
|
|
|
63102
63191
|
},
|
|
63103
63192
|
storable: threadsPageForDisk
|
|
63104
63193
|
};
|
|
63194
|
+
var OVERVIEW_PATH = "chat.overview";
|
|
63195
|
+
var overviewCopyKey = (workspaceId) => mirroredQueryKey({ path: OVERVIEW_PATH, workspaceId });
|
|
63196
|
+
function overviewForDisk(overview3) {
|
|
63197
|
+
const conversations2 = overview3.conversations.map(
|
|
63198
|
+
(conversation) => VAULT_NAMED_TEXT.test(conversation.preview) ? { ...conversation, preview: "" } : conversation
|
|
63199
|
+
);
|
|
63200
|
+
return { ...overview3, conversations: conversations2 };
|
|
63201
|
+
}
|
|
63202
|
+
var overviewMirror = {
|
|
63203
|
+
path: OVERVIEW_PATH,
|
|
63204
|
+
staleOn: {
|
|
63205
|
+
message_posted: ({ workspaceId }) => overviewCopyKey(workspaceId),
|
|
63206
|
+
message_changed: ({ workspaceId }) => overviewCopyKey(workspaceId),
|
|
63207
|
+
conversation_changed: ({ workspaceId }) => overviewCopyKey(workspaceId),
|
|
63208
|
+
read_marker_moved: ({ workspaceId }) => overviewCopyKey(workspaceId),
|
|
63209
|
+
agent_removed: ({ workspaceId }) => overviewCopyKey(workspaceId)
|
|
63210
|
+
},
|
|
63211
|
+
storable: overviewForDisk
|
|
63212
|
+
};
|
|
63213
|
+
var HISTORY_PATH = "chat.history";
|
|
63214
|
+
var historyCopyKey = ({
|
|
63215
|
+
workspaceId,
|
|
63216
|
+
channelId
|
|
63217
|
+
}) => mirroredQueryKey({ path: HISTORY_PATH, workspaceId, scope: channelId });
|
|
63218
|
+
function historyForDisk(page) {
|
|
63219
|
+
const storable = (message2) => message2.card === null && message2.undecryptable !== true && !VAULT_NAMED_TEXT.test(JSON.stringify(message2));
|
|
63220
|
+
return { ...page, messages: page.messages.filter(storable) };
|
|
63221
|
+
}
|
|
63222
|
+
var dropsHistoryCopy = ({ message: message2 }) => message2.deletedAt !== null || message2.scrubbed === true;
|
|
63223
|
+
var historyMirror = {
|
|
63224
|
+
path: HISTORY_PATH,
|
|
63225
|
+
staleOn: {
|
|
63226
|
+
message_changed: (event) => dropsHistoryCopy(event) ? historyCopyKey({ workspaceId: event.workspaceId, channelId: event.channelId }) : null
|
|
63227
|
+
},
|
|
63228
|
+
storable: historyForDisk
|
|
63229
|
+
};
|
|
63105
63230
|
var THREADS_PAGE_MAX = 50;
|
|
63106
63231
|
var threadsInputSchemaDefinition = external_exports.object({
|
|
63107
63232
|
workspaceId: workspaceIdSchema,
|
|
@@ -63393,9 +63518,9 @@ var joinedChannelSchemaDefinition = external_exports.object({
|
|
|
63393
63518
|
kind: external_exports.enum(["public", "private"])
|
|
63394
63519
|
});
|
|
63395
63520
|
var ChatApi = moduleApi()("chat");
|
|
63396
|
-
var chatConversationsTrpc = defineTrpcContract("chat").query("overview").withInput(workspaceInputSchema).withOutput(chatOverviewSchema).query("unreadSummary").withInput(external_exports.object({})).withOutput(external_exports.array(workspaceUnreadSchema)).query("browse").withInput(workspaceInputSchema).withOutput(external_exports.array(browsableChannelSchema)).mutation("createChannel").withInput(createChannelInputSchema).withOutput(conversationSchema).mutation("join").withInput(channelInputSchema).withOutput(conversationSchema).mutation("leave").withInput(channelInputSchema).withOutput(external_exports.object({ left: external_exports.literal(true) })).mutation("updateChannel").withInput(updateChannelInputSchema).withOutput(conversationSchema).mutation("setDefaultAgent").withInput(setDefaultAgentInputSchema).withOutput(conversationSchema).query("logChannelHint").withInput(channelInputSchema).withOutput(logChannelHintSchema).mutation("dismissLogChannelHint").withInput(channelInputSchema).withOutput(external_exports.object({ dismissed: external_exports.literal(true) })).query("externalNotice").withInput(channelInputSchema).withOutput(externalNoticeSchema).mutation("dismissExternalNotice").withInput(dismissExternalNoticeInputSchema).withOutput(externalNoticeSchema).mutation("archiveChannel").withInput(channelInputSchema).withOutput(conversationSchema).mutation("unarchiveChannel").withInput(channelInputSchema).withOutput(conversationSchema).mutation("addMembers").withInput(addMembersInputSchema).withOutput(conversationSchema).mutation("removeMember").withInput(removeMemberInputSchema).withOutput(conversationSchema).mutation("openDirect").withInput(openDirectInputSchema).withOutput(conversationSchema).query("conversation").withInput(channelInputSchema).withOutput(conversationSchema).build();
|
|
63521
|
+
var chatConversationsTrpc = defineTrpcContract("chat").query("overview", { mirrored: overviewMirror }).withInput(workspaceInputSchema).withOutput(chatOverviewSchema).query("unreadSummary").withInput(external_exports.object({})).withOutput(external_exports.array(workspaceUnreadSchema)).query("browse").withInput(workspaceInputSchema).withOutput(external_exports.array(browsableChannelSchema)).mutation("createChannel").withInput(createChannelInputSchema).withOutput(conversationSchema).mutation("join").withInput(channelInputSchema).withOutput(conversationSchema).mutation("leave").withInput(channelInputSchema).withOutput(external_exports.object({ left: external_exports.literal(true) })).mutation("updateChannel").withInput(updateChannelInputSchema).withOutput(conversationSchema).mutation("setDefaultAgent").withInput(setDefaultAgentInputSchema).withOutput(conversationSchema).query("logChannelHint").withInput(channelInputSchema).withOutput(logChannelHintSchema).mutation("dismissLogChannelHint").withInput(channelInputSchema).withOutput(external_exports.object({ dismissed: external_exports.literal(true) })).query("externalNotice").withInput(channelInputSchema).withOutput(externalNoticeSchema).mutation("dismissExternalNotice").withInput(dismissExternalNoticeInputSchema).withOutput(externalNoticeSchema).mutation("archiveChannel").withInput(channelInputSchema).withOutput(conversationSchema).mutation("unarchiveChannel").withInput(channelInputSchema).withOutput(conversationSchema).mutation("addMembers").withInput(addMembersInputSchema).withOutput(conversationSchema).query("channelGroups").withInput(channelInputSchema).withOutput(channelGroupsSchema).mutation("addChannelGroup").withInput(channelGroupInputSchema).withOutput(channelGroupsSchema).mutation("removeChannelGroup").withInput(channelGroupInputSchema).withOutput(channelGroupsSchema).mutation("removeMember").withInput(removeMemberInputSchema).withOutput(conversationSchema).mutation("openDirect").withInput(openDirectInputSchema).withOutput(conversationSchema).query("conversation").withInput(channelInputSchema).withOutput(conversationSchema).build();
|
|
63397
63522
|
var chatChannelRolesTrpc = defineTrpcContract("chat").mutation("setChannelRole").withInput(setChannelRoleInputSchema).withOutput(conversationSchema).mutation("extendChannel").withInput(extendChannelInputSchema).withOutput(conversationSchema).build();
|
|
63398
|
-
var chatMessagesTrpc = defineTrpcContract("chat").query("history").withInput(historyInputSchema).withOutput(historyPageSchema).query("thread").withInput(messageInputSchema).withOutput(threadSchema).query("message").withInput(messageInputSchema).withOutput(messageSchema).mutation("post").withInput(postMessageInputSchema).withOutput(messageSchema).mutation("forward").withInput(forwardMessageInputSchema).withOutput(messageSchema).mutation("addMentioned").withInput(addMentionedInputSchema).withOutput(messageSchema).mutation("edit").withInput(editMessageInputSchema).withOutput(messageSchema).mutation("delete").withInput(messageInputSchema).withOutput(messageSchema).mutation("remove").withInput(messageInputSchema).withOutput(messageSchema).mutation("react").withInput(reactInputSchema).withOutput(messageSchema).mutation("signalTyping").withInput(signalTypingInputSchema).withOutput(external_exports.object({ sent: external_exports.literal(true) })).mutation("markRead").withInput(markReadInputSchema).withOutput(external_exports.object({ lastReadSeq: external_exports.number().int().nonnegative() })).mutation("markUnread").withInput(markUnreadInputSchema).withOutput(external_exports.object({ lastReadSeq: external_exports.number().int().nonnegative() })).query("search").withInput(searchInputSchema).withOutput(searchResultSchema).build();
|
|
63523
|
+
var chatMessagesTrpc = defineTrpcContract("chat").query("history", { mirrored: historyMirror }).withInput(historyInputSchema).withOutput(historyPageSchema).query("thread").withInput(messageInputSchema).withOutput(threadSchema).query("message").withInput(messageInputSchema).withOutput(messageSchema).mutation("post").withInput(postMessageInputSchema).withOutput(messageSchema).mutation("forward").withInput(forwardMessageInputSchema).withOutput(messageSchema).mutation("addMentioned").withInput(addMentionedInputSchema).withOutput(messageSchema).mutation("edit").withInput(editMessageInputSchema).withOutput(messageSchema).mutation("delete").withInput(messageInputSchema).withOutput(messageSchema).mutation("remove").withInput(messageInputSchema).withOutput(messageSchema).mutation("react").withInput(reactInputSchema).withOutput(messageSchema).mutation("signalTyping").withInput(signalTypingInputSchema).withOutput(external_exports.object({ sent: external_exports.literal(true) })).mutation("markRead").withInput(markReadInputSchema).withOutput(external_exports.object({ lastReadSeq: external_exports.number().int().nonnegative() })).mutation("markUnread").withInput(markUnreadInputSchema).withOutput(external_exports.object({ lastReadSeq: external_exports.number().int().nonnegative() })).query("search").withInput(searchInputSchema).withOutput(searchResultSchema).build();
|
|
63399
63524
|
var chatFilesTrpc = defineTrpcContract("chat").mutation("startUpload").withInput(startUploadInputSchema).withOutput(uploadTicketSchema).mutation("completeUpload").withInput(completeUploadInputSchema).withOutput(attachmentSchema).mutation("abortUpload").withInput(fileInputSchema).withOutput(external_exports.object({ aborted: external_exports.literal(true) })).query("fileLink").withInput(fileLinkInputSchema).withOutput(fileLinkSchema).query("channelFiles").withInput(channelFilesInputSchema).withOutput(channelFilesSchema).mutation("renameAttachment").withInput(renameAttachmentInputSchema).withOutput(attachmentSchema).mutation("hideUnfurl").withInput(hideUnfurlInputSchema).withOutput(messageSchema).query("unfurlImage").withInput(unfurlImageInputSchema).withOutput(fileLinkSchema).query("searchGifs").withInput(searchGifsInputSchema).withOutput(gifResultsSchema).build();
|
|
63400
63525
|
var chatFollowingTrpc = defineTrpcContract("chat").mutation("setNotify").withInput(setNotifyInputSchema).withOutput(conversationSummarySchema).mutation("hideConversation").withInput(channelInputSchema).withOutput(external_exports.object({ hidden: external_exports.literal(true) })).mutation("followThread").withInput(followThreadInputSchema).withOutput(threadFollowSchema).query("threadFollow").withInput(messageInputSchema).withOutput(threadFollowSchema).query("threads", { mirrored: threadsMirror }).withInput(threadsInputSchema).withOutput(threadsPageSchema).query("threadsUnread").withInput(workspaceInputSchema).withOutput(threadsUnreadSchema).query("notificationCount").withInput(workspaceInputSchema).withOutput(external_exports.object({ count: external_exports.number().int().nonnegative() })).mutation("markThreadRead").withInput(messageInputSchema).withOutput(external_exports.object({ read: external_exports.literal(true) })).mutation("pin").withInput(pinMessageInputSchema).withOutput(messageSchema).query("pins").withInput(channelInputSchema).withOutput(pinsPageSchema).query("saved").withInput(savedInputSchema).withOutput(savedPageSchema).query("savedMarks").withInput(workspaceInputSchema).withOutput(savedMarksSchema).mutation("saveMessage").withInput(saveMessageInputSchema).withOutput(savedStatusSchema).mutation("markSavedDone").withInput(markSavedDoneInputSchema).withOutput(savedStatusSchema).mutation("setReminder").withInput(setReminderInputSchema).withOutput(savedStatusSchema).query("activity").withInput(activityInputSchema).withOutput(activityPageSchema).mutation("markActivityRead").withInput(markActivityReadInputSchema).withOutput(external_exports.object({ read: external_exports.literal(true) })).build();
|
|
63401
63526
|
var chatSessionTrpc = defineTrpcContract("chat").mutation("realtimeToken").withInput(workspaceInputSchema).withOutput(realtimeTokenSchema).query("drafts").withInput(workspaceInputSchema).withOutput(draftListSchema).mutation("saveDraft").withInput(saveDraftInputSchema).withOutput(draftSavedSchema).mutation("deleteDraft").withInput(deleteDraftInputSchema).withOutput(draftSavedSchema).query("sent").withInput(listSentInputSchema).withOutput(sentPageSchema).query("sidebarLayout").withInput(workspaceInputSchema).withOutput(sidebarLayoutSchema).mutation("editSidebar").withInput(editSidebarInputSchema).withOutput(sidebarLayoutSchema).query("readerPreferences").withInput(workspaceInputSchema).withOutput(readerPreferencesSchema).mutation("setReaderPreferences").withInput(setReaderPreferencesInputSchema).withOutput(readerPreferencesSchema).mutation("star").withInput(starInputSchema).withOutput(starStatusSchema).query("starred").withInput(workspaceInputSchema).withOutput(starredListSchema).mutation("scrubSecrets").withInput(scrubChatInputSchema).withOutput(chatScrubReportSchema).mutation("restoreScrubbed").withInput(messageInputSchema).withOutput(messageSchema).build();
|
|
@@ -64392,7 +64517,8 @@ var externalImageQuerySchemaDefinition = external_exports.object({
|
|
|
64392
64517
|
var idSchema5 = external_exports.string().min(1).max(80);
|
|
64393
64518
|
var agentGranteeSchemaDefinition = external_exports.discriminatedUnion("kind", [
|
|
64394
64519
|
external_exports.object({ kind: external_exports.literal("person"), userId: idSchema5 }),
|
|
64395
|
-
external_exports.object({ kind: external_exports.literal("channel"), channelId: idSchema5 })
|
|
64520
|
+
external_exports.object({ kind: external_exports.literal("channel"), channelId: idSchema5 }),
|
|
64521
|
+
external_exports.object({ kind: external_exports.literal("group"), groupId: idSchema5 })
|
|
64396
64522
|
]);
|
|
64397
64523
|
var agentGranteeSchema = agentGranteeSchemaDefinition;
|
|
64398
64524
|
var shareAgentInputSchemaDefinition = external_exports.object({
|
|
@@ -64411,6 +64537,8 @@ var agentAccessSchemaDefinition = external_exports.object({
|
|
|
64411
64537
|
channels: external_exports.array(
|
|
64412
64538
|
external_exports.object({ id: idSchema5, name: external_exports.string(), kind: external_exports.enum(["public", "private"]) })
|
|
64413
64539
|
),
|
|
64540
|
+
/** The groups it is shared with, whose people may talk to it for as long as they are in them. */
|
|
64541
|
+
groups: external_exports.array(external_exports.object({ id: idSchema5, name: external_exports.string(), memberIds: external_exports.array(external_exports.string()) })).optional(),
|
|
64414
64542
|
/** Whether the reader may share it and take shares back. */
|
|
64415
64543
|
mayShare: external_exports.boolean()
|
|
64416
64544
|
});
|
|
@@ -64652,6 +64780,12 @@ var lazeAgentEventSchemaDefinition = external_exports.discriminatedUnion("type",
|
|
|
64652
64780
|
external_exports.object({ type: external_exports.literal("idle_stopping"), idleMs: external_exports.number().int().nonnegative() }),
|
|
64653
64781
|
/** A running turn has said nothing, with no tool running, for `silentMs`. */
|
|
64654
64782
|
external_exports.object({ type: external_exports.literal("stalled"), silentMs: external_exports.number().int().nonnegative() }),
|
|
64783
|
+
/** A beat while a turn or its background work runs; it names the running turn, if any. */
|
|
64784
|
+
external_exports.object({
|
|
64785
|
+
type: external_exports.literal("turn_alive"),
|
|
64786
|
+
turnId: external_exports.string().min(1).optional(),
|
|
64787
|
+
messageIds: external_exports.array(external_exports.string().min(1)).optional()
|
|
64788
|
+
}),
|
|
64655
64789
|
/** A supervisor process came up with empty queues: Laze sends it what is still unanswered. */
|
|
64656
64790
|
external_exports.object({ type: external_exports.literal("supervisor_started"), bootId: external_exports.string().min(1) }),
|
|
64657
64791
|
/** A message the computer took no turn for: the laze CLI the agent answers with is gone. */
|
|
@@ -64884,7 +65018,11 @@ var computerMemoryStopSchemaDefinition = external_exports.object({
|
|
|
64884
65018
|
memoryMb: external_exports.number().nonnegative(),
|
|
64885
65019
|
at: external_exports.iso.datetime(),
|
|
64886
65020
|
/** The computer's size when it stopped; absent on a stop from an older supervisor. */
|
|
64887
|
-
capMemoryMb: external_exports.number().positive().optional()
|
|
65021
|
+
capMemoryMb: external_exports.number().positive().optional(),
|
|
65022
|
+
/** Memory in use, what the agents held and what the browser held at the stop, in MB. */
|
|
65023
|
+
usedMb: external_exports.number().nonnegative().optional(),
|
|
65024
|
+
agentsMb: external_exports.number().nonnegative().optional(),
|
|
65025
|
+
browserMb: external_exports.number().nonnegative().optional()
|
|
64888
65026
|
});
|
|
64889
65027
|
var computerDiskEventSchemaDefinition = external_exports.object({
|
|
64890
65028
|
kind: external_exports.enum(["warning", "stop"]),
|
|
@@ -64907,6 +65045,8 @@ var computerUseSchemaDefinition = external_exports.object({
|
|
|
64907
65045
|
cap: computerCapSchemaDefinition,
|
|
64908
65046
|
cpuBusy: external_exports.number().nonnegative(),
|
|
64909
65047
|
memoryUsedMb: external_exports.number().nonnegative(),
|
|
65048
|
+
/** The computer's browser with its helpers; absent from an older daemon. */
|
|
65049
|
+
browserMemoryMb: external_exports.number().nonnegative().optional(),
|
|
64910
65050
|
/** Null until the disk was measured once. */
|
|
64911
65051
|
diskUsedGb: external_exports.number().nonnegative().nullable(),
|
|
64912
65052
|
diskMeasuredAt: external_exports.iso.datetime().nullable(),
|
|
@@ -65210,8 +65350,13 @@ var computerNoticeSchemaDefinition = external_exports.discriminatedUnion("type",
|
|
|
65210
65350
|
type: external_exports.literal("memory_stop"),
|
|
65211
65351
|
/** "stopped: your agent computer is out of memory (3.9 of 4 GB)". */
|
|
65212
65352
|
text: external_exports.string().min(1).max(500),
|
|
65213
|
-
/**
|
|
65214
|
-
|
|
65353
|
+
/** What held the memory at the stop, in MB; `agentsMb` counts the stopped command. */
|
|
65354
|
+
share: external_exports.object({
|
|
65355
|
+
commandMb: external_exports.number().nonnegative(),
|
|
65356
|
+
agentsMb: external_exports.number().nonnegative(),
|
|
65357
|
+
browserMb: external_exports.number().nonnegative(),
|
|
65358
|
+
usedMb: external_exports.number().nonnegative()
|
|
65359
|
+
}).optional()
|
|
65215
65360
|
}),
|
|
65216
65361
|
external_exports.object({
|
|
65217
65362
|
type: external_exports.literal("disk_warning"),
|
|
@@ -65259,6 +65404,8 @@ var agentRuntimeConfig = Config.define((c) => ({
|
|
|
65259
65404
|
lazeApiUrl: c.env("AGENT_RUNTIME_LAZE_API_URL", external_exports.url().default("http://127.0.0.1:6600")),
|
|
65260
65405
|
/** The Laze API as the egress proxy container reaches it, for vault releases. */
|
|
65261
65406
|
vaultUrl: c.env("AGENT_RUNTIME_VAULT_URL", external_exports.url().default("http://host.docker.internal:6600")),
|
|
65407
|
+
/** Exact targets the proxy keeps on this host, `laze.so:443=host.docker.internal:6443,...`. */
|
|
65408
|
+
egressHostRoutes: c.env("AGENT_RUNTIME_EGRESS_HOST_ROUTES", external_exports.string().optional()),
|
|
65262
65409
|
/** Prefixes this deployment's docker names: "laze" on prod, one per worktree in dev. */
|
|
65263
65410
|
dockerPrefix: c.env(
|
|
65264
65411
|
"AGENT_RUNTIME_DOCKER_PREFIX",
|
|
@@ -65571,6 +65718,20 @@ var agentPresenceSchemaDefinition = external_exports.object({
|
|
|
65571
65718
|
presence: external_exports.enum(["active", "away", "offline"])
|
|
65572
65719
|
});
|
|
65573
65720
|
var agentPresenceSchema = agentPresenceSchemaDefinition;
|
|
65721
|
+
var agentReconnectSchemaDefinition = external_exports.discriminatedUnion("connected", [
|
|
65722
|
+
external_exports.object({ connected: external_exports.literal(false) }),
|
|
65723
|
+
external_exports.object({
|
|
65724
|
+
connected: external_exports.literal(true),
|
|
65725
|
+
harness: external_exports.string(),
|
|
65726
|
+
/** The reader owns it, so the line tells them what to do. */
|
|
65727
|
+
mine: external_exports.boolean(),
|
|
65728
|
+
/** The owner's name for anyone else; null once they left the workspace. */
|
|
65729
|
+
ownerName: external_exports.string().nullable(),
|
|
65730
|
+
/** The session's folder and machine, for its owner alone; null when unknown. */
|
|
65731
|
+
where: external_exports.string().nullable()
|
|
65732
|
+
})
|
|
65733
|
+
]);
|
|
65734
|
+
var agentReconnectSchema = agentReconnectSchemaDefinition;
|
|
65574
65735
|
|
|
65575
65736
|
// ../../modules/agent/contract/src/agent-run-config.ts
|
|
65576
65737
|
var harnessModelsSchemaDefinition = external_exports.object({
|
|
@@ -65781,7 +65942,9 @@ var answerAttentionInputSchemaDefinition = external_exports.object({
|
|
|
65781
65942
|
decision: external_exports.enum(["allow", "always", "deny", "answer", "dismiss"]),
|
|
65782
65943
|
/** For a question: by question id, the picked labels, or one typed answer. */
|
|
65783
65944
|
answers: external_exports.record(external_exports.string(), external_exports.array(external_exports.string().max(4e3)).max(20)).default({}),
|
|
65784
|
-
resolutionNote: resolutionNoteSchema2
|
|
65945
|
+
resolutionNote: resolutionNoteSchema2,
|
|
65946
|
+
/** Where the person answered a vault card from; a browser leaves it out. */
|
|
65947
|
+
via: external_exports.enum(["channel", "ios"]).optional()
|
|
65785
65948
|
});
|
|
65786
65949
|
var answerAttentionInputSchema = answerAttentionInputSchemaDefinition;
|
|
65787
65950
|
var askAgentApprovalInputSchemaDefinition = external_exports.object({
|
|
@@ -66170,6 +66333,16 @@ var startedCardConnectSchemaDefinition = external_exports.discriminatedUnion("ou
|
|
|
66170
66333
|
external_exports.object({ outcome: external_exports.literal("expired"), connectorsPath: external_exports.string() })
|
|
66171
66334
|
]);
|
|
66172
66335
|
var startedCardConnectSchema = startedCardConnectSchemaDefinition;
|
|
66336
|
+
var prepareCardInstallInputSchemaDefinition = external_exports.object({
|
|
66337
|
+
workspaceId: external_exports.string().min(1),
|
|
66338
|
+
cardId: external_exports.string().min(1).max(64)
|
|
66339
|
+
});
|
|
66340
|
+
var prepareCardInstallInputSchema = prepareCardInstallInputSchemaDefinition;
|
|
66341
|
+
var preparedCardInstallSchemaDefinition = external_exports.discriminatedUnion("outcome", [
|
|
66342
|
+
external_exports.object({ outcome: external_exports.literal("ready"), authorizeUrl: external_exports.url(), expiresAt: external_exports.iso.datetime() }),
|
|
66343
|
+
external_exports.object({ outcome: external_exports.literal("press") })
|
|
66344
|
+
]);
|
|
66345
|
+
var preparedCardInstallSchema = preparedCardInstallSchemaDefinition;
|
|
66173
66346
|
var connectCardSettledPayloadSchemaDefinition = external_exports.object({
|
|
66174
66347
|
workspaceId: external_exports.string().min(1),
|
|
66175
66348
|
cardId: external_exports.string().min(1),
|
|
@@ -66386,7 +66559,8 @@ var CONNECTOR_PROVIDERS = [
|
|
|
66386
66559
|
authorizeUrl: "https://github.com/login/oauth/authorize",
|
|
66387
66560
|
scopeParam: "scope",
|
|
66388
66561
|
scopeSeparator: " ",
|
|
66389
|
-
|
|
66562
|
+
/** The Laze GitHub App's sign-in: its permissions decide, GitHub ignores scopes. */
|
|
66563
|
+
scopes: [],
|
|
66390
66564
|
authorizeParams: { allow_signup: "false" },
|
|
66391
66565
|
client: {
|
|
66392
66566
|
tokenUrl: "https://github.com/login/oauth/access_token",
|
|
@@ -66547,7 +66721,7 @@ var connectorTrpc = defineTrpcContract("connector").query("listProviders").withI
|
|
|
66547
66721
|
search: external_exports.string().trim().max(100).optional(),
|
|
66548
66722
|
cursor: external_exports.string().max(300).optional()
|
|
66549
66723
|
})
|
|
66550
|
-
).withOutput(mcpRegistryPageSchema).query("getGithubApp").withInput(workspaceInput2).withOutput(githubAppViewSchema).mutation("startGithubInstall").withInput(startGithubInstallInputSchema).withOutput(startedGithubInstallSchema).mutation("startCardConnect").withInput(startCardConnectInputSchema).withOutput(startedCardConnectSchema).build();
|
|
66724
|
+
).withOutput(mcpRegistryPageSchema).query("getGithubApp").withInput(workspaceInput2).withOutput(githubAppViewSchema).mutation("startGithubInstall").withInput(startGithubInstallInputSchema).withOutput(startedGithubInstallSchema).mutation("startCardConnect").withInput(startCardConnectInputSchema).withOutput(startedCardConnectSchema).mutation("prepareCardInstall").withInput(prepareCardInstallInputSchema).withOutput(preparedCardInstallSchema).build();
|
|
66551
66725
|
var connectorUi = uiTokens("connector");
|
|
66552
66726
|
var ConnectorNavSlot = connectorUi.component("nav");
|
|
66553
66727
|
var ConnectorOpenclawConnectSlot = connectorUi.component("openclawConnect");
|
|
@@ -67373,7 +67547,17 @@ var loginPoolSchemaDefinition = external_exports.object({
|
|
|
67373
67547
|
myRole: loginPoolRoleSchema.nullable(),
|
|
67374
67548
|
createdByUserId: idSchema12,
|
|
67375
67549
|
createdAt: external_exports.iso.datetime(),
|
|
67376
|
-
members: external_exports.array(
|
|
67550
|
+
members: external_exports.array(
|
|
67551
|
+
external_exports.object({
|
|
67552
|
+
userId: idSchema12,
|
|
67553
|
+
name: external_exports.string(),
|
|
67554
|
+
role: loginPoolRoleSchema,
|
|
67555
|
+
/** Only a group brought them in. */
|
|
67556
|
+
viaGroup: external_exports.boolean().optional()
|
|
67557
|
+
})
|
|
67558
|
+
),
|
|
67559
|
+
/** The groups whose people are members for as long as they are in them. */
|
|
67560
|
+
groups: external_exports.array(external_exports.object({ id: idSchema12, name: external_exports.string() })).optional(),
|
|
67377
67561
|
agents: external_exports.array(external_exports.object({ id: idSchema12, name: external_exports.string(), harness: external_exports.string() })),
|
|
67378
67562
|
/** What its agents on Default run per harness; a harness left out has none set. */
|
|
67379
67563
|
defaultModels: external_exports.array(external_exports.object({ harness: harnessSchema2, model: external_exports.string(), name: external_exports.string() })).default([]),
|
|
@@ -67446,6 +67630,15 @@ var setPoolMemberInputSchemaDefinition = external_exports.object({
|
|
|
67446
67630
|
role: loginPoolRoleSchema
|
|
67447
67631
|
});
|
|
67448
67632
|
var setPoolMemberInputSchema = setPoolMemberInputSchemaDefinition;
|
|
67633
|
+
var poolGroupInputSchemaDefinition = external_exports.object({
|
|
67634
|
+
workspaceId: workspaceIdSchema9,
|
|
67635
|
+
poolId: external_exports.string().min(1).max(200),
|
|
67636
|
+
groupId: external_exports.string().min(1).max(80)
|
|
67637
|
+
});
|
|
67638
|
+
var poolGroupInputSchema = poolGroupInputSchemaDefinition;
|
|
67639
|
+
var poolGroupAsCallerInputSchema = poolGroupInputSchemaDefinition.omit({
|
|
67640
|
+
workspaceId: true
|
|
67641
|
+
});
|
|
67449
67642
|
var removePoolMemberInputSchemaDefinition = external_exports.object({
|
|
67450
67643
|
workspaceId: workspaceIdSchema9,
|
|
67451
67644
|
poolId: external_exports.string().min(1).max(200),
|
|
@@ -67694,7 +67887,11 @@ var transcriptPartSchemaDefinition = external_exports.object({
|
|
|
67694
67887
|
function migrationUploadCommandOf({ migrationId }) {
|
|
67695
67888
|
return `laze agent migrate upload ${migrationId}`;
|
|
67696
67889
|
}
|
|
67697
|
-
var
|
|
67890
|
+
var migratedAgentsInputSchemaDefinition = external_exports.object({ workspaceId: workspaceIdSchema10 });
|
|
67891
|
+
var migratedAgentsInputSchema = migratedAgentsInputSchemaDefinition;
|
|
67892
|
+
var migratedAgentsSchemaDefinition = external_exports.object({ agentIds: external_exports.array(idSchema13) });
|
|
67893
|
+
var migratedAgentsSchema = migratedAgentsSchemaDefinition;
|
|
67894
|
+
var agentMigrationTrpc = defineTrpcContract("agents").mutation("migrate").withInput(migrateAgentInputSchema).withOutput(agentMigrationSchema).query("migration").withInput(agentMigrationInputSchema).withOutput(nullableMigrationSchema).query("migratedAgents").withInput(migratedAgentsInputSchema).withOutput(migratedAgentsSchema).mutation("cancelMigration").withInput(agentMigrationInputSchema).withOutput(agentMigrationSchema).build();
|
|
67698
67895
|
|
|
67699
67896
|
// ../../modules/agent/contract/src/agent-monitors.ts
|
|
67700
67897
|
var MONITOR_PROMPT_MAX = 4e3;
|
|
@@ -68469,7 +68666,17 @@ var codexLoginRefreshInputSchemaDefinition = external_exports.object({
|
|
|
68469
68666
|
authJson: external_exports.string().min(2).max(CODEX_LOGIN_MAX_LENGTH)
|
|
68470
68667
|
});
|
|
68471
68668
|
var AgentApi = moduleApi()("agent");
|
|
68472
|
-
var
|
|
68669
|
+
var AGENTS_LIST_PATH = "agents.list";
|
|
68670
|
+
function agentsForDisk(copy2) {
|
|
68671
|
+
const storable = (agent3) => !VAULT_NAMED_TEXT.test(JSON.stringify(agent3));
|
|
68672
|
+
return { ...copy2, agents: copy2.agents.filter(storable) };
|
|
68673
|
+
}
|
|
68674
|
+
var agentsCopy = {
|
|
68675
|
+
path: AGENTS_LIST_PATH,
|
|
68676
|
+
paintOnly: true,
|
|
68677
|
+
storable: agentsForDisk
|
|
68678
|
+
};
|
|
68679
|
+
var agentCoreTrpc = defineTrpcContract("agents").query("list", { mirrored: agentsCopy }).withInput(external_exports.object({ workspaceId: workspaceIdSchema14 })).withOutput(external_exports.array(agentListEntrySchema)).mutation("create").withInput(createAgentInputSchema).withOutput(agentSchema).mutation("update").withInput(updateAgentInputSchema).withOutput(agentSchema).mutation("remove").withInput(external_exports.object({ workspaceId: workspaceIdSchema14, agentId: idSchema17 })).withOutput(external_exports.object({ removed: external_exports.literal(true) })).mutation("transfer").withInput(transferAgentInputSchema).withOutput(agentSchema).mutation("resetSession").withInput(resetAgentSessionInputSchema).withOutput(agentSchema).query("faces").withInput(external_exports.object({ workspaceId: workspaceIdSchema14 })).withOutput(external_exports.array(agentFaceSchema)).query("presence").withInput(external_exports.object({ workspaceId: workspaceIdSchema14 })).withOutput(external_exports.array(agentPresenceSchema)).mutation("uploadAvatar").withInput(uploadAgentAvatarInputSchema).withOutput(uploadedAgentAvatarSchema).query("access").withInput(external_exports.object({ workspaceId: workspaceIdSchema14, agentId: idSchema17 })).withOutput(agentAccessSchema).query("loginActivity").withInput(external_exports.object({ workspaceId: workspaceIdSchema14, agentId: idSchema17 })).withOutput(loginActivitySchema).mutation("raiseBudget").withInput(raiseBudgetInputSchema).withOutput(external_exports.object({ limitUsd: external_exports.number() })).query("permissionPrompts").withInput(external_exports.object({ workspaceId: workspaceIdSchema14, agentId: idSchema17 })).withOutput(external_exports.array(agentPermissionPromptSchema)).mutation("share").withInput(shareAgentInputSchema).withOutput(agentAccessSchema).mutation("unshare").withInput(shareAgentInputSchema).withOutput(agentAccessSchema).query("harnessLogins").withInput(external_exports.object({ workspaceId: workspaceIdSchema14 })).withOutput(harnessLoginsSchema).mutation("saveHarnessLogin").withInput(saveHarnessLoginInputSchema).withOutput(harnessLoginsSchema).mutation("removeHarnessLogin").withInput(removeHarnessLoginInputSchema).withOutput(harnessLoginsSchema).query("listHarnessLogins").withInput(external_exports.object({ workspaceId: workspaceIdSchema14 })).withOutput(harnessLoginListSchema).mutation("addHarnessLogin").withInput(addHarnessLoginInputSchema).withOutput(harnessLoginListSchema).mutation("renameHarnessLogin").withInput(renameHarnessLoginInputSchema).withOutput(harnessLoginListSchema).mutation("deleteHarnessLogin").withInput(deleteHarnessLoginInputSchema).withOutput(harnessLoginListSchema).mutation("checkLoginUsage").withInput(checkLoginUsageInputSchema).withOutput(loginUsageCheckSchema).query("loginPools").withInput(external_exports.object({ workspaceId: workspaceIdSchema14 })).withOutput(loginPoolsSchema).mutation("createLoginPool").withInput(createLoginPoolInputSchema).withOutput(loginPoolsSchema).mutation("renameLoginPool").withInput(renameLoginPoolInputSchema).withOutput(loginPoolsSchema).mutation("deleteLoginPool").withInput(loginPoolRefInputSchema).withOutput(loginPoolsSchema).mutation("addPoolLogin").withInput(addPoolLoginInputSchema).withOutput(loginPoolsSchema).mutation("removePoolLogin").withInput(removePoolLoginInputSchema).withOutput(loginPoolsSchema).mutation("setPoolMember").withInput(setPoolMemberInputSchema).withOutput(loginPoolsSchema).mutation("removePoolMember").withInput(removePoolMemberInputSchema).withOutput(loginPoolsSchema).mutation("setAgentPool").withInput(setAgentPoolInputSchema).withOutput(agentSchema).mutation("openDirect").withInput(external_exports.object({ workspaceId: workspaceIdSchema14, agentId: idSchema17 })).withOutput(external_exports.object({ channelId: idSchema17 })).mutation("startConversation").withInput(startConversationInputSchema).withOutput(startedConversationSchema).query("conversations").withInput(listConversationsInputSchema).withOutput(external_exports.array(conversationSummarySchema2)).mutation("joinConversation").withInput(conversationInputSchema).withOutput(conversationSummarySchema2).mutation("renameConversation").withInput(renameConversationInputSchema).withOutput(conversationSummarySchema2).mutation("leaveConversation").withInput(conversationInputSchema).withOutput(external_exports.object({ left: external_exports.literal(true) })).mutation("deleteConversation").withInput(conversationInputSchema).withOutput(external_exports.object({ deleted: external_exports.literal(true) })).mutation("mintLink").withInput(mintLinkInputSchema).withOutput(mintedLinkSchema).query("linkRedemption").withInput(linkRedemptionInputSchema).withOutput(linkRedemptionSchema).query("oauthRequest").withInput(oauthRequestInputSchema).withOutput(oauthRequestViewSchema).mutation("oauthApprove").withInput(approveOAuthInputSchema).withOutput(oauthRedirectSchema).mutation("oauthDeny").withInput(oauthRequestInputSchema).withOutput(oauthRedirectSchema).mutation("disconnect").withInput(external_exports.object({ workspaceId: workspaceIdSchema14, agentId: idSchema17 })).withOutput(external_exports.object({ disconnected: external_exports.literal(true) })).mutation("setGithub").withInput(setAgentGithubInputSchema).withOutput(agentSchema).query("githubWatches").withInput(external_exports.object({ workspaceId: workspaceIdSchema14, agentId: idSchema17 })).withOutput(external_exports.array(agentGithubWatchSchema)).mutation("watchGithub").withInput(watchGithubInputSchema).withOutput(agentGithubWatchSchema).mutation("unwatchGithub").withInput(unwatchGithubInputSchema).withOutput(external_exports.object({ removed: external_exports.literal(true) })).build();
|
|
68473
68680
|
var agentTurnTrpc = defineTrpcContract("agents").mutation("answerAttention").withInput(answerAttentionInputSchema).withOutput(external_exports.object({ answered: external_exports.literal(true) })).mutation("stopTurn").withInput(stopAgentTurnInputSchema).withOutput(external_exports.object({ stopped: external_exports.literal(true) })).query("mayStopTurn").withInput(stopAgentTurnInputSchema).withOutput(external_exports.object({ allowed: external_exports.boolean() })).mutation("retryTurn").withInput(retryAgentTurnInputSchema).withOutput(external_exports.object({ retried: external_exports.literal(true) })).query("retryState").withInput(retryAgentTurnInputSchema).withOutput(agentRetryStateSchema).query("liveSteps").withInput(liveStepsInputSchema).withOutput(liveStepsSchema).query("workingNow").withInput(agentWorkingInputSchema).withOutput(agentWorkingSchema).mutation("compactSession").withInput(compactAgentSessionInputSchema).withOutput(external_exports.object({ requested: external_exports.literal(true) })).mutation("catchUp").withInput(startCatchUpInputSchema).withOutput(catchUpRunSchema).mutation("catchUpAsk").withInput(askCatchUpInputSchema).withOutput(catchUpRunSchema).query("catchUpRun").withInput(catchUpRunInputSchema).withOutput(catchUpRunSchema).mutation("catchUpStop").withInput(catchUpRunInputSchema).withOutput(catchUpRunSchema).mutation("restartComputer").withInput(restartAgentComputerInputSchema).withOutput(external_exports.object({ restarted: external_exports.boolean() })).build();
|
|
68474
68681
|
var agentChannelSettingsTrpc = defineTrpcContract("agents").query("monitors").withInput(external_exports.object({ workspaceId: workspaceIdSchema14, agentId: idSchema17 })).withOutput(external_exports.array(agentMonitorSchema)).query("channelLevel").withInput(external_exports.object({ workspaceId: workspaceIdSchema14, agentId: idSchema17, channelId: idSchema17 })).withOutput(channelLevelSchema).mutation("setChannelLevel").withInput(setChannelLevelInputSchema).withOutput(channelLevelSchema).mutation("unmuteChannel").withInput(unmuteAgentChannelInputSchema).withOutput(channelLevelSchema).mutation("cancelHeld").withInput(cancelHeldInputSchema).withOutput(cancelHeldResultSchema).mutation("useLazeModelsUntilReset").withInput(useLazeModelsUntilResetInputSchema).withOutput(lazeModelsUntilResetSchema).build();
|
|
68475
68682
|
var agentJoinTrpc = defineTrpcContract("agents").query("joinRequest").withInput(joinRequestInputSchema).withOutput(joinRequestViewSchema).mutation("approveJoinRequest").withInput(approveJoinRequestInputSchema).withOutput(joinRequestViewSchema).mutation("denyJoinRequest").withInput(joinRequestInputSchema).withOutput(joinRequestViewSchema).build();
|
|
@@ -68481,9 +68688,13 @@ var agentLangwatchTrpc = defineTrpcContract("agents").query("langwatchTracing").
|
|
|
68481
68688
|
var agentPoolModelTrpc = defineTrpcContract("agents").mutation("setLoginPoolModel").withInput(setLoginPoolModelInputSchema).withOutput(loginPoolsSchema).build();
|
|
68482
68689
|
var agentRunsOnTrpc = defineTrpcContract("agents").mutation("setRunsOn").withInput(setRunsOnInputSchema).withOutput(agentSchema).build();
|
|
68483
68690
|
var agentWelcomeTrpc = defineTrpcContract("agents").mutation("pressWelcome").withInput(pressWelcomeInputSchema).withOutput(pressedWelcomeSchema).build();
|
|
68691
|
+
var agentPoolGroupTrpc = defineTrpcContract("agents").mutation("addPoolGroup").withInput(poolGroupInputSchema).withOutput(loginPoolsSchema).mutation("removePoolGroup").withInput(poolGroupInputSchema).withOutput(loginPoolsSchema).build();
|
|
68692
|
+
var agentReconnectTrpc = defineTrpcContract("agents").query("reconnect").withInput(external_exports.object({ workspaceId: workspaceIdSchema14, agentId: idSchema17 })).withOutput(agentReconnectSchema).build();
|
|
68484
68693
|
var agentTrpc = joinTrpcContracts(
|
|
68485
68694
|
"agents",
|
|
68486
68695
|
agentCoreTrpc,
|
|
68696
|
+
agentPoolGroupTrpc,
|
|
68697
|
+
agentReconnectTrpc,
|
|
68487
68698
|
agentTurnTrpc,
|
|
68488
68699
|
agentChannelSettingsTrpc,
|
|
68489
68700
|
agentJoinTrpc,
|
|
@@ -68505,6 +68716,7 @@ var AgentLoginCardSlot = agentUi.component("loginCard");
|
|
|
68505
68716
|
var AgentBudgetCardSlot = agentUi.component("budgetCard");
|
|
68506
68717
|
var AgentWelcomeCardSlot = agentUi.component("welcomeCard");
|
|
68507
68718
|
var AgentStopTurnSlot = agentUi.component("stopTurn");
|
|
68719
|
+
var AgentOfflineLineSlot = agentUi.component("offlineLine");
|
|
68508
68720
|
var AgentLiveStepsSlot = agentUi.component("liveSteps");
|
|
68509
68721
|
var AgentCatchUpSlot = agentUi.component("catchUp");
|
|
68510
68722
|
var AgentSessionHooksToken = agentUi.hooks("session");
|
|
@@ -68514,6 +68726,7 @@ var AgentThingsToDoSlot = agentUi.component("thingsToDo");
|
|
|
68514
68726
|
var AgentCreateDialogSlot = agentUi.component("createDialog");
|
|
68515
68727
|
var AgentRunsOnPickerSlot = agentUi.component("runsOnPicker");
|
|
68516
68728
|
var AgentEditDialogSlot = agentUi.component("editDialog");
|
|
68729
|
+
var AgentNameSlot = agentUi.component("name");
|
|
68517
68730
|
var AgentFaceSlot = agentUi.component("face");
|
|
68518
68731
|
var AgentAccessSlot = agentUi.component("access");
|
|
68519
68732
|
var AgentConnectDialogSlot = agentUi.component("connectDialog");
|
|
@@ -68961,6 +69174,13 @@ var setChannelDefaultAgentAsCallerInputSchemaDefinition = external_exports.objec
|
|
|
68961
69174
|
/** One of the channel's member agents, by name or id; null clears it. */
|
|
68962
69175
|
agent: external_exports.string().trim().min(1).max(200).nullable()
|
|
68963
69176
|
});
|
|
69177
|
+
var channelGroupAsCallerInputSchemaDefinition = external_exports.object({
|
|
69178
|
+
channel: channelRefSchema3,
|
|
69179
|
+
group: external_exports.string().min(1).max(41)
|
|
69180
|
+
});
|
|
69181
|
+
var callerChannelGroupsSchemaDefinition = external_exports.object({
|
|
69182
|
+
groups: external_exports.array(external_exports.object({ id: external_exports.string(), name: external_exports.string(), memberCount: external_exports.number() }))
|
|
69183
|
+
});
|
|
68964
69184
|
var addChannelMembersAsCallerInputSchemaDefinition = external_exports.object({
|
|
68965
69185
|
channel: channelRefSchema3,
|
|
68966
69186
|
members: external_exports.array(memberRefSchema2).min(1).max(100)
|
|
@@ -69081,6 +69301,26 @@ var changeRoleAsCallerInputSchemaDefinition = external_exports.object({
|
|
|
69081
69301
|
member: memberRefSchema3,
|
|
69082
69302
|
role: roleSchema
|
|
69083
69303
|
});
|
|
69304
|
+
var groupRefSchema = external_exports.string().trim().min(1).max(80);
|
|
69305
|
+
var callerGroupSchemaDefinition = external_exports.object({
|
|
69306
|
+
id: external_exports.string().min(1),
|
|
69307
|
+
name: external_exports.string(),
|
|
69308
|
+
memberIds: external_exports.array(external_exports.string())
|
|
69309
|
+
});
|
|
69310
|
+
var createGroupAsCallerInputSchemaDefinition = external_exports.object({
|
|
69311
|
+
name: external_exports.string().trim().min(1).max(80),
|
|
69312
|
+
members: external_exports.array(memberRefSchema3).max(200).default([])
|
|
69313
|
+
});
|
|
69314
|
+
var renameGroupAsCallerInputSchemaDefinition = external_exports.object({
|
|
69315
|
+
group: groupRefSchema,
|
|
69316
|
+
name: external_exports.string().trim().min(1).max(80)
|
|
69317
|
+
});
|
|
69318
|
+
var groupAsCallerInputSchemaDefinition = external_exports.object({ group: groupRefSchema });
|
|
69319
|
+
var changeGroupMembersAsCallerInputSchemaDefinition = external_exports.object({
|
|
69320
|
+
group: groupRefSchema,
|
|
69321
|
+
add: external_exports.array(memberRefSchema3).max(200).default([]),
|
|
69322
|
+
remove: external_exports.array(memberRefSchema3).max(200).default([])
|
|
69323
|
+
});
|
|
69084
69324
|
var removeWorkspaceMemberAsCallerInputSchemaDefinition = external_exports.object({ member: memberRefSchema3 });
|
|
69085
69325
|
var decideRequestAsCallerInputSchemaDefinition = external_exports.object({
|
|
69086
69326
|
requestId: external_exports.string().trim().min(1).max(80),
|
|
@@ -69523,7 +69763,7 @@ function serverUrlOf({ context, args }) {
|
|
|
69523
69763
|
}
|
|
69524
69764
|
|
|
69525
69765
|
// src/services/agent-access-commands.service.ts
|
|
69526
|
-
var SHARE_USAGE = "Usage: laze agent share|unshare <agent> --person <userId> | --channel <channelId>";
|
|
69766
|
+
var SHARE_USAGE = "Usage: laze agent share|unshare <agent> --person <userId> | --group <groupId> | --channel <channelId>";
|
|
69527
69767
|
function agentWord({ args, usage }) {
|
|
69528
69768
|
const agent3 = args.words[2];
|
|
69529
69769
|
if (!agent3) throw new CliUsageError(usage);
|
|
@@ -69534,9 +69774,11 @@ function printAccess({ context, args, access }) {
|
|
|
69534
69774
|
`);
|
|
69535
69775
|
const people2 = access.people.map((person) => person.userId).join(", ") || "no one";
|
|
69536
69776
|
const channels3 = access.channels.map((channel) => `#${channel.name}`).join(", ") || "none";
|
|
69777
|
+
const groups2 = (access.groups ?? []).map((group) => `@${group.name}`).join(", ") || "none";
|
|
69537
69778
|
context.out(
|
|
69538
69779
|
`${access.kind} agent, owned by ${access.ownerUserId}
|
|
69539
69780
|
People: ${people2}
|
|
69781
|
+
Groups: ${groups2}
|
|
69540
69782
|
Channels: ${channels3}
|
|
69541
69783
|
`
|
|
69542
69784
|
);
|
|
@@ -69569,12 +69811,22 @@ async function agentPermissionPrompts({ context, args }) {
|
|
|
69569
69811
|
for (const prompt of prompts) context.out(`${promptLine(prompt)}
|
|
69570
69812
|
`);
|
|
69571
69813
|
}
|
|
69814
|
+
function granteeOf({
|
|
69815
|
+
person,
|
|
69816
|
+
group,
|
|
69817
|
+
channel
|
|
69818
|
+
}) {
|
|
69819
|
+
if (person) return { kind: "person", userId: person };
|
|
69820
|
+
if (group) return { kind: "group", groupId: group };
|
|
69821
|
+
return { kind: "channel", channelId: channel };
|
|
69822
|
+
}
|
|
69572
69823
|
async function shareAgent({ context, args }) {
|
|
69573
69824
|
const agent3 = agentWord({ args, usage: SHARE_USAGE });
|
|
69574
69825
|
const person = flagText({ args, name: "person" });
|
|
69826
|
+
const group = flagText({ args, name: "group" });
|
|
69575
69827
|
const channel = flagText({ args, name: "channel" });
|
|
69576
|
-
if (
|
|
69577
|
-
const grantee =
|
|
69828
|
+
if ([person, group, channel].filter(Boolean).length !== 1) throw new CliUsageError(SHARE_USAGE);
|
|
69829
|
+
const grantee = granteeOf({ person, group, channel });
|
|
69578
69830
|
const path = args.words[1] === "unshare" ? "/api/agents/unshare" : "/api/agents/share";
|
|
69579
69831
|
const { client } = await signedIn({ context, args });
|
|
69580
69832
|
printAccess({ context, args, access: await client.post(path, { agent: agent3, grantee }) });
|
|
@@ -71847,11 +72099,11 @@ function entryOf(scheduled2) {
|
|
|
71847
72099
|
return `${head}
|
|
71848
72100
|
${indented(scheduled2.body)}`;
|
|
71849
72101
|
}
|
|
71850
|
-
function formatScheduled({ list:
|
|
71851
|
-
if (
|
|
72102
|
+
function formatScheduled({ list: list12 }) {
|
|
72103
|
+
if (list12.items.length === 0) {
|
|
71852
72104
|
return "Nothing scheduled. Add --at <time> to laze post or laze reply to send one later.\n";
|
|
71853
72105
|
}
|
|
71854
|
-
return `${
|
|
72106
|
+
return `${list12.items.map(entryOf).join("\n\n")}
|
|
71855
72107
|
`;
|
|
71856
72108
|
}
|
|
71857
72109
|
|
|
@@ -71902,13 +72154,13 @@ async function scheduled({ context, args }) {
|
|
|
71902
72154
|
if (action !== void 0) throw new CliUsageError(USAGE);
|
|
71903
72155
|
const { client } = await signedIn({ context, args });
|
|
71904
72156
|
const channel = flagText({ args, name: "channel" });
|
|
71905
|
-
const
|
|
72157
|
+
const list12 = await client.post(
|
|
71906
72158
|
"/api/agents/me/scheduled/list",
|
|
71907
72159
|
channel ? { channel } : {}
|
|
71908
72160
|
);
|
|
71909
|
-
if (args.flags.json) return context.out(`${JSON.stringify(
|
|
72161
|
+
if (args.flags.json) return context.out(`${JSON.stringify(list12, null, 2)}
|
|
71910
72162
|
`);
|
|
71911
|
-
context.out(formatScheduled({ list:
|
|
72163
|
+
context.out(formatScheduled({ list: list12 }));
|
|
71912
72164
|
}
|
|
71913
72165
|
async function newTextOf({
|
|
71914
72166
|
context,
|
|
@@ -75067,10 +75319,10 @@ card is, say what changed.
|
|
|
75067
75319
|
Asked for an app (a tracker, a CRM, a dashboard, a page that explains something), read the full
|
|
75068
75320
|
guide first: https://laze.so/docs/agents/apps.md. The short version:
|
|
75069
75321
|
|
|
75070
|
-
- Create it where it was asked for
|
|
75071
|
-
|
|
75072
|
-
|
|
75073
|
-
-
|
|
75322
|
+
- Create it where it was asked for: \`laze app create "<Name>" --channel <channel>\`. It starts
|
|
75323
|
+
empty: build it from scratch and design it for its subject. Be visual and creative (a diagram,
|
|
75324
|
+
a map, a timeline, something to explore), not stat tiles and bullet lists.
|
|
75325
|
+
- The slides template is only for a new deck. Sent files that already are a page or a deck (an
|
|
75074
75326
|
HTML export, a zip with index.html, a static site): unpack them as they are into a new app
|
|
75075
75327
|
with no template (\`laze app create "<Name>" --channel <channel>\`), index.html at the top of
|
|
75076
75328
|
its folder, then \`laze app push -m "<what it is>"\`. "Move them here" or "put this here" with
|
|
@@ -75085,6 +75337,9 @@ guide first: https://laze.so/docs/agents/apps.md. The short version:
|
|
|
75085
75337
|
- Every \`laze app push -m "<what changed>"\` is live at once. There are no drafts, branches or
|
|
75086
75338
|
pull requests. \`laze app versions\` and \`laze app revert <version> -m <why>\` go back.
|
|
75087
75339
|
- Data lives in collections (\`laze.app.json\`, \`Laze.records()\`), never baked into the page.
|
|
75340
|
+
Show it with \`Laze.watch(collection, options, render)\`: it re-renders when the records change,
|
|
75341
|
+
so what you write reaches a person's open page and they keep their place. After a change that
|
|
75342
|
+
wrote no records, run \`laze app refresh\`.
|
|
75088
75343
|
- Use the Laze kit's classes and colour tokens; never hex colours or a copied kit. One job per
|
|
75089
75344
|
screen; tables, cards, stat tiles, charts and numbered steps over paragraphs; real data; an
|
|
75090
75345
|
empty state; it must read well in dark mode and 390 px wide.
|
|
@@ -75902,11 +76157,11 @@ function usageOf2({
|
|
|
75902
76157
|
}
|
|
75903
76158
|
var INVALID2 = "signed out: its provider refused this token, sign in again with a new one";
|
|
75904
76159
|
var EXPIRES_SOON = " expires within hours: run claude setup-token for a token that lasts a year";
|
|
75905
|
-
function formatLogins({ list:
|
|
75906
|
-
if (
|
|
76160
|
+
function formatLogins({ list: list12, nowMs }) {
|
|
76161
|
+
if (list12.logins.length === 0) {
|
|
75907
76162
|
return "No logins yet. Add one with: laze agent logins add --harness claude-code --name <name> < token-file\n";
|
|
75908
76163
|
}
|
|
75909
|
-
const lines2 =
|
|
76164
|
+
const lines2 = list12.logins.map((login2) => {
|
|
75910
76165
|
const state = login2.agentsOnIt > 0 ? `in use by ${login2.agentsOnIt} ${login2.agentsOnIt === 1 ? "agent" : "agents"}` : "ready";
|
|
75911
76166
|
const usage = usageOf2({ ...login2, nowMs });
|
|
75912
76167
|
let shown2 = usage.startsWith("out of usage") ? usage : `${state}, ${usage}`;
|
|
@@ -76279,6 +76534,8 @@ var PATHS = {
|
|
|
76279
76534
|
removePoolLogin: "/api/agents/pools/logins/remove",
|
|
76280
76535
|
setPoolMember: "/api/agents/pools/members",
|
|
76281
76536
|
removePoolMember: "/api/agents/pools/members/remove",
|
|
76537
|
+
addPoolGroup: "/api/agents/pools/groups",
|
|
76538
|
+
removePoolGroup: "/api/agents/pools/groups/remove",
|
|
76282
76539
|
setAgentPool: "/api/agents/pool",
|
|
76283
76540
|
setRunsOn: "/api/agents/runs-on",
|
|
76284
76541
|
setPoolModel: "/api/agents/pools/model",
|
|
@@ -76405,8 +76662,8 @@ function poolNamed({ pools, wanted }) {
|
|
|
76405
76662
|
async function loginsOf(client) {
|
|
76406
76663
|
return (await client.get(PATHS.logins)).logins;
|
|
76407
76664
|
}
|
|
76408
|
-
function printLogins({ context, args },
|
|
76409
|
-
if (args.flags.json) return context.out(`${JSON.stringify(
|
|
76665
|
+
function printLogins({ context, args }, list12, line) {
|
|
76666
|
+
if (args.flags.json) return context.out(`${JSON.stringify(list12, null, 2)}
|
|
76410
76667
|
`);
|
|
76411
76668
|
context.out(line);
|
|
76412
76669
|
}
|
|
@@ -76438,12 +76695,12 @@ var LOGIN_ACTIONS = {
|
|
|
76438
76695
|
}
|
|
76439
76696
|
return step.context.out(`${formatUsageCheck({ check: check3 })}${formatOnePool({ pool, nowMs })}`);
|
|
76440
76697
|
}
|
|
76441
|
-
const
|
|
76698
|
+
const list12 = await step.client.get(PATHS.logins);
|
|
76442
76699
|
if (step.args.flags.json) {
|
|
76443
|
-
return step.context.out(`${JSON.stringify({ ...check3, ...
|
|
76700
|
+
return step.context.out(`${JSON.stringify({ ...check3, ...list12 }, null, 2)}
|
|
76444
76701
|
`);
|
|
76445
76702
|
}
|
|
76446
|
-
step.context.out(`${formatUsageCheck({ check: check3 })}${formatLogins({ list:
|
|
76703
|
+
step.context.out(`${formatUsageCheck({ check: check3 })}${formatLogins({ list: list12, nowMs })}`);
|
|
76447
76704
|
}
|
|
76448
76705
|
},
|
|
76449
76706
|
history: {
|
|
@@ -76460,18 +76717,18 @@ var LOGIN_ACTIONS = {
|
|
|
76460
76717
|
list: {
|
|
76461
76718
|
words: 0,
|
|
76462
76719
|
run: async (step) => {
|
|
76463
|
-
const
|
|
76464
|
-
printLogins(step,
|
|
76720
|
+
const list12 = await step.client.get(PATHS.logins);
|
|
76721
|
+
printLogins(step, list12, formatLogins({ list: list12, nowMs: step.context.nowMs() }));
|
|
76465
76722
|
}
|
|
76466
76723
|
},
|
|
76467
76724
|
add: {
|
|
76468
76725
|
words: 0,
|
|
76469
76726
|
run: async (step) => {
|
|
76470
76727
|
const input2 = await loginValueOf({ ...step, usage: LOGIN_ADD_USAGE });
|
|
76471
|
-
const
|
|
76728
|
+
const list12 = await step.client.post(PATHS.logins, input2);
|
|
76472
76729
|
printLogins(
|
|
76473
76730
|
step,
|
|
76474
|
-
|
|
76731
|
+
list12,
|
|
76475
76732
|
`Added ${input2.name}. Its token is in your keychain and is never shown again.
|
|
76476
76733
|
`
|
|
76477
76734
|
);
|
|
@@ -76485,11 +76742,11 @@ var LOGIN_ACTIONS = {
|
|
|
76485
76742
|
throw new CliUsageError(LOGIN_SIGN_IN_USAGE);
|
|
76486
76743
|
}
|
|
76487
76744
|
const secret = await secretOnStdin({ context: step.context });
|
|
76488
|
-
const
|
|
76745
|
+
const list12 = await step.client.post(PATHS.replaceLogin, {
|
|
76489
76746
|
loginId: login2.id,
|
|
76490
76747
|
secret
|
|
76491
76748
|
});
|
|
76492
|
-
printLogins(step,
|
|
76749
|
+
printLogins(step, list12, `Signed in again on ${login2.name}. Its agents run on it again.
|
|
76493
76750
|
`);
|
|
76494
76751
|
}
|
|
76495
76752
|
},
|
|
@@ -76498,11 +76755,11 @@ var LOGIN_ACTIONS = {
|
|
|
76498
76755
|
run: async (step) => {
|
|
76499
76756
|
const login2 = loginNamed({ logins: await loginsOf(step.client), wanted: step.first });
|
|
76500
76757
|
const name3 = step.second.trim();
|
|
76501
|
-
const
|
|
76758
|
+
const list12 = await step.client.post(PATHS.renameLogin, {
|
|
76502
76759
|
loginId: login2.id,
|
|
76503
76760
|
name: name3
|
|
76504
76761
|
});
|
|
76505
|
-
printLogins(step,
|
|
76762
|
+
printLogins(step, list12, `Renamed ${login2.name} to ${name3}.
|
|
76506
76763
|
`);
|
|
76507
76764
|
}
|
|
76508
76765
|
},
|
|
@@ -76510,12 +76767,12 @@ var LOGIN_ACTIONS = {
|
|
|
76510
76767
|
words: 1,
|
|
76511
76768
|
run: async (step) => {
|
|
76512
76769
|
const login2 = loginNamed({ logins: await loginsOf(step.client), wanted: step.first });
|
|
76513
|
-
const
|
|
76770
|
+
const list12 = await step.client.post(PATHS.deleteLogin, {
|
|
76514
76771
|
loginId: login2.id
|
|
76515
76772
|
});
|
|
76516
76773
|
printLogins(
|
|
76517
76774
|
step,
|
|
76518
|
-
|
|
76775
|
+
list12,
|
|
76519
76776
|
`Removed ${login2.name}. Agents on it move to another login from their next turn.
|
|
76520
76777
|
`
|
|
76521
76778
|
);
|
|
@@ -76601,6 +76858,26 @@ var POOL_ACTIONS = {
|
|
|
76601
76858
|
printPools(step, pools, `${step.second} is now a ${role2} of ${step.first}.`);
|
|
76602
76859
|
}
|
|
76603
76860
|
},
|
|
76861
|
+
"grant-group": {
|
|
76862
|
+
words: 2,
|
|
76863
|
+
run: async (step) => {
|
|
76864
|
+
const pools = await step.client.post(PATHS.addPoolGroup, {
|
|
76865
|
+
poolId: step.first,
|
|
76866
|
+
groupId: step.second
|
|
76867
|
+
});
|
|
76868
|
+
printPools(step, pools, `Everyone in ${step.second} is now a member of ${step.first}.`);
|
|
76869
|
+
}
|
|
76870
|
+
},
|
|
76871
|
+
"revoke-group": {
|
|
76872
|
+
words: 2,
|
|
76873
|
+
run: async (step) => {
|
|
76874
|
+
const pools = await step.client.post(PATHS.removePoolGroup, {
|
|
76875
|
+
poolId: step.first,
|
|
76876
|
+
groupId: step.second
|
|
76877
|
+
});
|
|
76878
|
+
printPools(step, pools, `Took ${step.second} out of ${step.first}.`);
|
|
76879
|
+
}
|
|
76880
|
+
},
|
|
76604
76881
|
"set-model": {
|
|
76605
76882
|
words: 2,
|
|
76606
76883
|
run: async (step) => {
|
|
@@ -77117,6 +77394,16 @@ async function mintedRequestProfile({
|
|
|
77117
77394
|
await context.store.keepProfile({ name: requestProfileNameOf({ profile: name3 }), profile });
|
|
77118
77395
|
return profile;
|
|
77119
77396
|
}
|
|
77397
|
+
function askingAgentOf({
|
|
77398
|
+
config: config2,
|
|
77399
|
+
asked,
|
|
77400
|
+
bound
|
|
77401
|
+
}) {
|
|
77402
|
+
const agents = Object.entries(config2.profiles).filter(([, one]) => one.kind === "agent");
|
|
77403
|
+
const wanted = asked ?? bound;
|
|
77404
|
+
const named = agents.filter(([name3]) => name3 === wanted);
|
|
77405
|
+
return named.length > 0 || asked ? named : agents;
|
|
77406
|
+
}
|
|
77120
77407
|
async function requestProfileOf({
|
|
77121
77408
|
context,
|
|
77122
77409
|
args
|
|
@@ -77126,21 +77413,32 @@ async function requestProfileOf({
|
|
|
77126
77413
|
const asked = flagText({ args, name: "from" });
|
|
77127
77414
|
const bound = boundProfileOf({ bindings: config2.bindings, cwd: context.cwd });
|
|
77128
77415
|
const wanted = asked ? requestProfileNameOf({ profile: asked }) : bound && requestProfileNameOf({ profile: bound });
|
|
77129
|
-
const found = requests2.find(([name3]) => name3 === wanted || name3 === asked) ?? (requests2.length === 1 ? requests2[0] : void 0);
|
|
77130
|
-
if (found) return found[1];
|
|
77131
|
-
const
|
|
77132
|
-
|
|
77133
|
-
|
|
77134
|
-
|
|
77135
|
-
|
|
77416
|
+
const found = requests2.find(([name3]) => name3 === wanted || name3 === asked) ?? (requests2.length === 1 && !asked ? requests2[0] : void 0);
|
|
77417
|
+
if (found) return { name: found[0], profile: found[1] };
|
|
77418
|
+
const agents = askingAgentOf({ config: config2, asked, bound });
|
|
77419
|
+
const [only, other] = agents;
|
|
77420
|
+
if (only && !other) {
|
|
77421
|
+
const profile = await mintedRequestProfile({ context, name: only[0], agent: only[1] });
|
|
77422
|
+
return { name: requestProfileNameOf({ profile: only[0] }), profile };
|
|
77423
|
+
}
|
|
77424
|
+
if (agents.length === 0) {
|
|
77136
77425
|
throw new CliUsageError(
|
|
77137
|
-
"No
|
|
77426
|
+
"No agent on this machine to ask with: run `laze agent link` from a session first."
|
|
77138
77427
|
);
|
|
77139
77428
|
}
|
|
77140
77429
|
throw new CliUsageError(
|
|
77141
|
-
`Several agents
|
|
77430
|
+
`Several agents are linked here; pass --from <profile>: ${agents.map(([name3]) => name3).join(", ")}`
|
|
77142
77431
|
);
|
|
77143
77432
|
}
|
|
77433
|
+
async function renewedRequestProfile({
|
|
77434
|
+
context,
|
|
77435
|
+
name: name3
|
|
77436
|
+
}) {
|
|
77437
|
+
const agentName = name3.replace(/-request$/, "");
|
|
77438
|
+
const agent3 = (await context.store.read()).profiles[agentName];
|
|
77439
|
+
if (agent3?.kind !== "agent") return null;
|
|
77440
|
+
return mintedRequestProfile({ context, name: agentName, agent: agent3 });
|
|
77441
|
+
}
|
|
77144
77442
|
function waitSecondsOf2({ args }) {
|
|
77145
77443
|
const raw = flagText({ args, name: "timeout" });
|
|
77146
77444
|
const seconds = raw ? Number(raw) : DEFAULT_WAIT_SECONDS;
|
|
@@ -77173,21 +77471,26 @@ async function answerOf2({
|
|
|
77173
77471
|
}
|
|
77174
77472
|
}
|
|
77175
77473
|
async function requestAgent({ context, args }) {
|
|
77176
|
-
const
|
|
77474
|
+
const saved3 = await requestProfileOf({ context, args });
|
|
77177
77475
|
const session = await currentSessionOf({ context, args });
|
|
77178
|
-
const asking = LazeClient.create({
|
|
77179
|
-
baseUrl: request2.url,
|
|
77180
|
-
token: request2.token,
|
|
77181
|
-
fetcher: context.fetcher
|
|
77182
|
-
});
|
|
77183
77476
|
const name3 = flagText({ args, name: "name" });
|
|
77184
77477
|
const harness = session?.harness ?? context.environment.harness;
|
|
77185
|
-
const
|
|
77478
|
+
const ask = (token2) => LazeClient.create({
|
|
77479
|
+
baseUrl: saved3.profile.url,
|
|
77480
|
+
token: token2,
|
|
77481
|
+
fetcher: context.fetcher
|
|
77482
|
+
}).post("/api/agents/requests", {
|
|
77186
77483
|
harness,
|
|
77187
77484
|
folder: session?.folder ?? "",
|
|
77188
77485
|
host: session?.host ?? "",
|
|
77189
77486
|
...name3 ? { name: name3 } : {}
|
|
77190
77487
|
});
|
|
77488
|
+
const started = await ask(saved3.profile.token).catch(async (error63) => {
|
|
77489
|
+
if (!(error63 instanceof LazeApiError) || error63.status !== 401) throw error63;
|
|
77490
|
+
const renewed = await renewedRequestProfile({ context, name: saved3.name });
|
|
77491
|
+
if (!renewed) throw error63;
|
|
77492
|
+
return ask(renewed.token);
|
|
77493
|
+
});
|
|
77191
77494
|
context.out(
|
|
77192
77495
|
[
|
|
77193
77496
|
`Asked for a new Laze agent with this session: code ${started.code}.`,
|
|
@@ -77197,7 +77500,7 @@ async function requestAgent({ context, args }) {
|
|
|
77197
77500
|
);
|
|
77198
77501
|
const answer6 = await answerOf2({
|
|
77199
77502
|
context,
|
|
77200
|
-
client: LazeClient.create({ baseUrl:
|
|
77503
|
+
client: LazeClient.create({ baseUrl: saved3.profile.url, fetcher: context.fetcher }),
|
|
77201
77504
|
started,
|
|
77202
77505
|
waitSeconds: waitSecondsOf2({ args })
|
|
77203
77506
|
});
|
|
@@ -77210,14 +77513,14 @@ async function requestAgent({ context, args }) {
|
|
|
77210
77513
|
const profile = await settleLinked({
|
|
77211
77514
|
context,
|
|
77212
77515
|
args,
|
|
77213
|
-
url:
|
|
77516
|
+
url: saved3.profile.url,
|
|
77214
77517
|
harness,
|
|
77215
77518
|
pid: void 0,
|
|
77216
77519
|
linked
|
|
77217
77520
|
});
|
|
77218
77521
|
if (!session) return;
|
|
77219
77522
|
const own2 = LazeClient.create({
|
|
77220
|
-
baseUrl:
|
|
77523
|
+
baseUrl: saved3.profile.url,
|
|
77221
77524
|
token: linked.apiKey,
|
|
77222
77525
|
fetcher: context.fetcher
|
|
77223
77526
|
});
|
|
@@ -77432,6 +77735,15 @@ var appSchemaDefinition = external_exports.object({
|
|
|
77432
77735
|
updatedAt: external_exports.iso.datetime()
|
|
77433
77736
|
});
|
|
77434
77737
|
var appSchema = appSchemaDefinition;
|
|
77738
|
+
var appPublishStateSchemaDefinition = appSchemaDefinition.pick({
|
|
77739
|
+
id: true,
|
|
77740
|
+
workspaceId: true,
|
|
77741
|
+
name: true,
|
|
77742
|
+
channelId: true,
|
|
77743
|
+
publishedUrl: true,
|
|
77744
|
+
publishedVersion: true,
|
|
77745
|
+
pendingPublish: true
|
|
77746
|
+
});
|
|
77435
77747
|
var versionChangesSchemaDefinition = external_exports.object({
|
|
77436
77748
|
added: external_exports.number().int().nonnegative(),
|
|
77437
77749
|
modified: external_exports.number().int().nonnegative(),
|
|
@@ -77923,12 +78235,12 @@ var AppApi = moduleApi()("app");
|
|
|
77923
78235
|
|
|
77924
78236
|
// ../../modules/app/contract/src/app.access.ts
|
|
77925
78237
|
var appGrantSubjectSchemaDefinition = external_exports.object({
|
|
77926
|
-
type: external_exports.enum(["user", "agent", "channel"]),
|
|
78238
|
+
type: external_exports.enum(["user", "agent", "channel", "group"]),
|
|
77927
78239
|
id: external_exports.string().min(1)
|
|
77928
78240
|
});
|
|
77929
78241
|
var appGrantSchemaDefinition = external_exports.object({
|
|
77930
78242
|
subject: appGrantSubjectSchemaDefinition,
|
|
77931
|
-
/** The person's, agent's or
|
|
78243
|
+
/** The person's, agent's, channel's or group's name; null when it can no longer be read. */
|
|
77932
78244
|
name: external_exports.string().nullable(),
|
|
77933
78245
|
role: appRoleSchema,
|
|
77934
78246
|
grantedBy: appActorSchema,
|
|
@@ -77951,9 +78263,19 @@ var appAccessRequestSchemaDefinition = external_exports.object({
|
|
|
77951
78263
|
var appAccessRequestSchema = appAccessRequestSchemaDefinition;
|
|
77952
78264
|
var appMemberSourceSchemaDefinition = external_exports.object({
|
|
77953
78265
|
/** `agent-owner` is no longer sent; older clients still read it. */
|
|
77954
|
-
kind: external_exports.enum([
|
|
78266
|
+
kind: external_exports.enum([
|
|
78267
|
+
"owner",
|
|
78268
|
+
"creator",
|
|
78269
|
+
"admin",
|
|
78270
|
+
"direct",
|
|
78271
|
+
"channel",
|
|
78272
|
+
"group",
|
|
78273
|
+
"workspace",
|
|
78274
|
+
"agent-owner"
|
|
78275
|
+
]),
|
|
77955
78276
|
/** The channel, for `channel`: a pin there, a share with it, or the app's own channel. */
|
|
77956
78277
|
channelId: external_exports.string().nullable(),
|
|
78278
|
+
/** The channel's name, or `@name` of the group for `group`. */
|
|
77957
78279
|
channelName: external_exports.string().nullable(),
|
|
77958
78280
|
/** Unused since agents stopped holding apps through their owner; always null. */
|
|
77959
78281
|
ownerName: external_exports.string().nullable()
|
|
@@ -78704,7 +79026,16 @@ var writeAppFilesByKeyInputSchemaDefinition = external_exports.object(writeAppFi
|
|
|
78704
79026
|
var appTemplatesByKeyQuerySchemaDefinition = external_exports.object({});
|
|
78705
79027
|
|
|
78706
79028
|
// ../../modules/app/contract/src/app.trpc.ts
|
|
78707
|
-
var
|
|
79029
|
+
var APP_LIST_PATH = "app.list";
|
|
79030
|
+
function appsForDisk(apps) {
|
|
79031
|
+
return apps.filter((app2) => !VAULT_NAMED_TEXT.test(JSON.stringify(app2))).map((app2) => ({ ...app2, pendingPublish: null, publishLease: null }));
|
|
79032
|
+
}
|
|
79033
|
+
var appsCopy = {
|
|
79034
|
+
path: APP_LIST_PATH,
|
|
79035
|
+
paintOnly: true,
|
|
79036
|
+
storable: appsForDisk
|
|
79037
|
+
};
|
|
79038
|
+
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();
|
|
78708
79039
|
var appConnectionsTrpc = defineTrpcContract("app").query("connections").withInput(appRefSchema).withOutput(appConnectionsSchema).mutation("allowConnection").withInput(appConnectionRefSchema).withOutput(appConnectionsSchema).mutation("revokeConnection").withInput(appConnectionRefSchema).withOutput(appConnectionsSchema).build();
|
|
78709
79040
|
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();
|
|
78710
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();
|
|
@@ -78803,7 +79134,7 @@ var appCliCommands = [
|
|
|
78803
79134
|
command: "laze app create",
|
|
78804
79135
|
operation: "createApp",
|
|
78805
79136
|
arguments: ["<name>", "--template <template>", "--dir <dir>", "--channel <c>"],
|
|
78806
|
-
summary: "Create an app in a folder linked to it. --template starts
|
|
79137
|
+
summary: "Create an app in a folder linked to it. With no --template it starts empty, to build from scratch. --template slides starts a deck (laze app templates lists the templates): its files are the first live version and land in the folder to change"
|
|
78807
79138
|
},
|
|
78808
79139
|
{
|
|
78809
79140
|
command: "laze app templates",
|
|
@@ -79125,6 +79456,12 @@ var appCliCommands = [
|
|
|
79125
79456
|
arguments: ["--records <json|@file>"],
|
|
79126
79457
|
summary: "Load starter records (default: the manifest's seed) into collections that hold none yet; nothing is emptied"
|
|
79127
79458
|
},
|
|
79459
|
+
{
|
|
79460
|
+
command: "laze app refresh",
|
|
79461
|
+
operation: "refreshApp",
|
|
79462
|
+
arguments: [],
|
|
79463
|
+
summary: "Show open pages of the app its latest state, for a change that wrote no records; record writes and pushes need no refresh"
|
|
79464
|
+
},
|
|
79128
79465
|
{
|
|
79129
79466
|
command: "laze app records list",
|
|
79130
79467
|
operation: "listRecords",
|
|
@@ -80171,7 +80508,7 @@ var appWrite = async ({ context, args }) => {
|
|
|
80171
80508
|
);
|
|
80172
80509
|
}
|
|
80173
80510
|
const folder = folderOf({ context, word: void 0 });
|
|
80174
|
-
const
|
|
80511
|
+
const remove8 = (flagText({ args, name: "remove" }) ?? "").split(",").map((path) => path.trim()).filter(Boolean);
|
|
80175
80512
|
const files2 = await Promise.all(
|
|
80176
80513
|
words.slice(2).map(async (word3) => {
|
|
80177
80514
|
const path = resolve8(context.cwd, word3);
|
|
@@ -80182,7 +80519,7 @@ var appWrite = async ({ context, args }) => {
|
|
|
80182
80519
|
return file3;
|
|
80183
80520
|
})
|
|
80184
80521
|
);
|
|
80185
|
-
if (files2.length +
|
|
80522
|
+
if (files2.length + remove8.length === 0) {
|
|
80186
80523
|
throw new CliUsageError("laze app write needs a file to write or --remove <path,...>");
|
|
80187
80524
|
}
|
|
80188
80525
|
const client = await appClient({ context, args });
|
|
@@ -80190,14 +80527,14 @@ var appWrite = async ({ context, args }) => {
|
|
|
80190
80527
|
const { publish, ...version2 } = await client.post("/api/apps/files/write", {
|
|
80191
80528
|
appId,
|
|
80192
80529
|
files: files2,
|
|
80193
|
-
remove:
|
|
80530
|
+
remove: remove8,
|
|
80194
80531
|
message: message2
|
|
80195
80532
|
});
|
|
80196
80533
|
print5({
|
|
80197
80534
|
context,
|
|
80198
80535
|
args,
|
|
80199
80536
|
value: { version: version2, app: publish.app, publish },
|
|
80200
|
-
text: `Wrote ${version2.version.slice(0, 7)} "${version2.message}" (${files2.length} written, ${
|
|
80537
|
+
text: `Wrote ${version2.version.slice(0, 7)} "${version2.message}" (${files2.length} written, ${remove8.length} removed)
|
|
80201
80538
|
` + publishLine(publish)
|
|
80202
80539
|
});
|
|
80203
80540
|
};
|
|
@@ -80554,6 +80891,17 @@ var appSeed = async ({ context, args }) => {
|
|
|
80554
80891
|
const seeded = await client.post("/api/apps/seed", { appId, records });
|
|
80555
80892
|
print5({ context, args, value: seeded, text: seedLine(seeded) });
|
|
80556
80893
|
};
|
|
80894
|
+
var appRefresh = async ({ context, args }) => {
|
|
80895
|
+
const client = await appClient({ context, args });
|
|
80896
|
+
const appId = await appIdOf({ client, args, folder: folderOf({ context, word: void 0 }) });
|
|
80897
|
+
const asked = await client.post("/api/apps/refresh", { appId });
|
|
80898
|
+
print5({
|
|
80899
|
+
context,
|
|
80900
|
+
args,
|
|
80901
|
+
value: asked,
|
|
80902
|
+
text: "Open pages of the app are showing its latest state.\n"
|
|
80903
|
+
});
|
|
80904
|
+
};
|
|
80557
80905
|
function recordPageText({ records }) {
|
|
80558
80906
|
if (records.totalItems === 0) return "No records yet.\n";
|
|
80559
80907
|
const lines2 = records.items.map((record4) => JSON.stringify(record4)).join("\n");
|
|
@@ -80698,11 +81046,14 @@ function roleOf(word3) {
|
|
|
80698
81046
|
if (!role2) throw new CliUsageError("The role is viewer, editor or builder");
|
|
80699
81047
|
return role2;
|
|
80700
81048
|
}
|
|
81049
|
+
function isSubjectType(type) {
|
|
81050
|
+
return type === "user" || type === "agent" || type === "channel" || type === "group";
|
|
81051
|
+
}
|
|
80701
81052
|
function subjectOf(word3) {
|
|
80702
81053
|
const [type, ...rest] = (word3 ?? "").split(":");
|
|
80703
81054
|
const id2 = rest.join(":");
|
|
80704
|
-
if (type
|
|
80705
|
-
throw new CliUsageError("Name who with user:<id>, agent:<id> or
|
|
81055
|
+
if (!isSubjectType(type) || !id2) {
|
|
81056
|
+
throw new CliUsageError("Name who with user:<id>, agent:<id>, channel:<id> or group:<id>");
|
|
80706
81057
|
}
|
|
80707
81058
|
return { type, id: id2 };
|
|
80708
81059
|
}
|
|
@@ -80823,6 +81174,8 @@ function sourceText(source) {
|
|
|
80823
81174
|
return "Workspace admin";
|
|
80824
81175
|
case "direct":
|
|
80825
81176
|
return "Shared directly";
|
|
81177
|
+
case "group":
|
|
81178
|
+
return `Through ${source.channelName}`;
|
|
80826
81179
|
case "channel":
|
|
80827
81180
|
return `via #${source.channelName ?? source.channelId}`;
|
|
80828
81181
|
case "workspace":
|
|
@@ -80982,6 +81335,7 @@ var APP_COMMANDS = {
|
|
|
80982
81335
|
views: appViews,
|
|
80983
81336
|
card: appCard,
|
|
80984
81337
|
seed: appSeed,
|
|
81338
|
+
refresh: appRefresh,
|
|
80985
81339
|
records: appRecords,
|
|
80986
81340
|
export: appExport,
|
|
80987
81341
|
import: appImport,
|
|
@@ -81223,11 +81577,11 @@ async function workspaces({ context, args }) {
|
|
|
81223
81577
|
}
|
|
81224
81578
|
async function changes({ context, args }) {
|
|
81225
81579
|
const { client } = await signedIn({ context, args });
|
|
81226
|
-
const
|
|
81227
|
-
if (args.flags.json) return context.out(`${JSON.stringify(
|
|
81580
|
+
const list12 = await client.get("/api/agents/me/changes");
|
|
81581
|
+
if (args.flags.json) return context.out(`${JSON.stringify(list12, null, 2)}
|
|
81228
81582
|
`);
|
|
81229
|
-
if (
|
|
81230
|
-
for (const change2 of
|
|
81583
|
+
if (list12.length === 0) return context.out("No recent changes.\n");
|
|
81584
|
+
for (const change2 of list12) {
|
|
81231
81585
|
const lifted = change2.codes.length > 0 ? ` (lifts ${change2.codes.join(", ")})` : "";
|
|
81232
81586
|
context.out(`${change2.date}${lifted}: ${change2.text}
|
|
81233
81587
|
`);
|
|
@@ -81317,10 +81671,10 @@ async function show({ context, args }) {
|
|
|
81317
81671
|
}
|
|
81318
81672
|
async function invoices({ context, args }) {
|
|
81319
81673
|
const { client } = await signedIn({ context, args });
|
|
81320
|
-
const
|
|
81321
|
-
if (args.flags.json) return printJson(context,
|
|
81322
|
-
if (
|
|
81323
|
-
for (const invoice of
|
|
81674
|
+
const list12 = await client.get("/api/billing-account/invoices");
|
|
81675
|
+
if (args.flags.json) return printJson(context, list12);
|
|
81676
|
+
if (list12.length === 0) return context.out("No invoices yet.\n");
|
|
81677
|
+
for (const invoice of list12) {
|
|
81324
81678
|
const link2 = invoice.hostedUrl ? ` ${invoice.hostedUrl}` : "";
|
|
81325
81679
|
const tax = invoice.tax ? ` (tax ${money(invoice.tax, invoice.currency)})` : "";
|
|
81326
81680
|
context.out(
|
|
@@ -83256,6 +83610,47 @@ async function channelAdd({ context, args }) {
|
|
|
83256
83610
|
line: (detail) => membersChangedLine({ detail, members: members3, change: "added" })
|
|
83257
83611
|
});
|
|
83258
83612
|
}
|
|
83613
|
+
async function channelGroups({ context, args }) {
|
|
83614
|
+
const [, , channel] = args.words;
|
|
83615
|
+
if (!channel) throw new CliUsageError("Usage: laze channel groups <channel>");
|
|
83616
|
+
const { client } = await signedIn({ context, args });
|
|
83617
|
+
const reply2 = await client.post("/api/agents/me/channels/groups", {
|
|
83618
|
+
channel
|
|
83619
|
+
});
|
|
83620
|
+
if (args.flags.json) return context.out(`${JSON.stringify(reply2, null, 2)}
|
|
83621
|
+
`);
|
|
83622
|
+
if (reply2.groups.length === 0) return context.out("No groups in this channel.\n");
|
|
83623
|
+
for (const group of reply2.groups) context.out(`@${group.name} ${group.memberCount}
|
|
83624
|
+
`);
|
|
83625
|
+
}
|
|
83626
|
+
function groupChange({
|
|
83627
|
+
verb,
|
|
83628
|
+
line
|
|
83629
|
+
}) {
|
|
83630
|
+
return async ({ context, args }) => {
|
|
83631
|
+
const [, , channel, group] = args.words;
|
|
83632
|
+
if (!channel || !group) {
|
|
83633
|
+
throw new CliUsageError(`Usage: laze channel ${verb} <channel> <group>`);
|
|
83634
|
+
}
|
|
83635
|
+
const { client } = await signedIn({ context, args });
|
|
83636
|
+
const reply2 = await client.post(`/api/agents/me/channels/${verb}`, {
|
|
83637
|
+
channel,
|
|
83638
|
+
group
|
|
83639
|
+
});
|
|
83640
|
+
if (args.flags.json) return context.out(`${JSON.stringify(reply2, null, 2)}
|
|
83641
|
+
`);
|
|
83642
|
+
context.out(`${line(group.replace(/^@/, ""))}
|
|
83643
|
+
`);
|
|
83644
|
+
};
|
|
83645
|
+
}
|
|
83646
|
+
var channelAddGroup = groupChange({
|
|
83647
|
+
verb: "add-group",
|
|
83648
|
+
line: (group) => `Added @${group}. Its people follow it in and out.`
|
|
83649
|
+
});
|
|
83650
|
+
var channelRemoveGroup = groupChange({
|
|
83651
|
+
verb: "remove-group",
|
|
83652
|
+
line: (group) => `Took @${group} out, with the people it brought.`
|
|
83653
|
+
});
|
|
83259
83654
|
async function channelRemove({ context, args }) {
|
|
83260
83655
|
const [, , channel, member] = args.words;
|
|
83261
83656
|
if (!channel || !member) throw new CliUsageError("Usage: laze channel remove <channel> <member>");
|
|
@@ -84727,7 +85122,12 @@ var computerStatusDefinition = external_exports.object({
|
|
|
84727
85122
|
/** `none`: no agent ever ran in it. */
|
|
84728
85123
|
state: external_exports.enum(["running", "asleep", "none"]),
|
|
84729
85124
|
cpu: external_exports.object({ busy: external_exports.number().nonnegative(), vcpu: external_exports.number().positive() }),
|
|
84730
|
-
memory: external_exports.object({
|
|
85125
|
+
memory: external_exports.object({
|
|
85126
|
+
usedGb: external_exports.number().nonnegative(),
|
|
85127
|
+
totalGb: external_exports.number().positive(),
|
|
85128
|
+
/** The part of `usedGb` the computer's browser holds; absent when not known. */
|
|
85129
|
+
browserGb: external_exports.number().nonnegative().optional()
|
|
85130
|
+
}),
|
|
84731
85131
|
disk: external_exports.object({
|
|
84732
85132
|
/** Null until the disk was measured once. */
|
|
84733
85133
|
usedGb: external_exports.number().nonnegative().nullable(),
|
|
@@ -85214,6 +85614,8 @@ var machineHealthDefinition = external_exports.object({
|
|
|
85214
85614
|
/** Each tool found on the PATH with the first line of its `--version`. */
|
|
85215
85615
|
tools: external_exports.record(external_exports.string().max(40), external_exports.string().max(200)).optional(),
|
|
85216
85616
|
daemonVersion: external_exports.string().max(80).optional(),
|
|
85617
|
+
/** Whether vmd signed the connector's stream key; absent on a build that does not say. */
|
|
85618
|
+
screenKeySigned: external_exports.boolean().optional().catch(void 0),
|
|
85217
85619
|
/** Whether the Laze browser can run there; a bad report reads as absent, not as no facts. */
|
|
85218
85620
|
browser: machineBrowserDefinition.optional().catch(void 0),
|
|
85219
85621
|
/** Whether WhatsApp is linked there; absent on a connector without it, or a bad report. */
|
|
@@ -85906,9 +86308,13 @@ function diskLine(status11) {
|
|
|
85906
86308
|
}
|
|
85907
86309
|
function servicesLine(status11) {
|
|
85908
86310
|
const agentsGb = status11.agents.reduce((sum, agent3) => sum + agent3.memoryGb, 0);
|
|
85909
|
-
const
|
|
86311
|
+
const browserGb = status11.memory.browserGb ?? 0;
|
|
86312
|
+
const systemGb = Math.max(0, status11.memory.usedGb - agentsGb - browserGb);
|
|
85910
86313
|
if (status11.memory.usedGb <= 0) return [];
|
|
85911
|
-
return [
|
|
86314
|
+
return [
|
|
86315
|
+
...browserGb > 0 ? [` Browser memory ${gb(browserGb)}`] : [],
|
|
86316
|
+
` Computer system memory ${gb(systemGb)}`
|
|
86317
|
+
];
|
|
85912
86318
|
}
|
|
85913
86319
|
function printStatus({ context }, status11) {
|
|
85914
86320
|
const current3 = status11.sizes.find((size) => size.current);
|
|
@@ -87867,10 +88273,10 @@ function actionOf(args) {
|
|
|
87867
88273
|
return action;
|
|
87868
88274
|
}
|
|
87869
88275
|
async function listEmoji({ context, args, client }) {
|
|
87870
|
-
const
|
|
87871
|
-
if (args.flags.json) return printed({ context, value:
|
|
87872
|
-
if (
|
|
87873
|
-
for (const each of
|
|
88276
|
+
const list12 = await client.get(EMOJI_KEY_PATHS.list);
|
|
88277
|
+
if (args.flags.json) return printed({ context, value: list12 });
|
|
88278
|
+
if (list12.emoji.length === 0) return context.out("This workspace has no custom emoji yet.\n");
|
|
88279
|
+
for (const each of list12.emoji) context.out(shown(each));
|
|
87874
88280
|
}
|
|
87875
88281
|
async function addEmoji({ context, args, client }) {
|
|
87876
88282
|
const file3 = wordAt4(args, 3);
|
|
@@ -88232,7 +88638,7 @@ async function mine2({ context, args }) {
|
|
|
88232
88638
|
context,
|
|
88233
88639
|
args,
|
|
88234
88640
|
answer: answer6,
|
|
88235
|
-
text: (
|
|
88641
|
+
text: (list12) => list12.map((it) => `${it.name} ${it.id} ${ROLE_NAMES2[it.role]}
|
|
88236
88642
|
`).join("") || "No workspaces.\n"
|
|
88237
88643
|
});
|
|
88238
88644
|
}
|
|
@@ -89290,6 +89696,8 @@ var feedItemSchemaDefinition = external_exports.object({
|
|
|
89290
89696
|
doneLabel: external_exports.string().nullable(),
|
|
89291
89697
|
showAt: external_exports.iso.datetime().nullable(),
|
|
89292
89698
|
approval: feedApprovalSchema.nullable(),
|
|
89699
|
+
/** A new vault device waits for her: a decision answered from Passkeys, with no buttons here. */
|
|
89700
|
+
deviceApproval: external_exports.object({ deviceId: external_exports.string() }).optional(),
|
|
89293
89701
|
group: external_exports.string().nullable(),
|
|
89294
89702
|
labels: external_exports.array(external_exports.string()),
|
|
89295
89703
|
loop: external_exports.string().nullable(),
|
|
@@ -89423,6 +89831,8 @@ var editFeedItemInputSchema = editFeedItemInputSchemaDefinition;
|
|
|
89423
89831
|
var answerFeedApprovalInputSchemaDefinition = external_exports.object({
|
|
89424
89832
|
...itemRef.shape,
|
|
89425
89833
|
answer: external_exports.enum(["approve_once", "approve_for_agent", "deny"]),
|
|
89834
|
+
/** Where the person answered, as the card's handled line words it; the web leaves it out. */
|
|
89835
|
+
via: external_exports.enum(["feed", "ios"]).optional(),
|
|
89426
89836
|
durationSeconds: external_exports.number().int().positive().optional(),
|
|
89427
89837
|
/** Why, or a steer for the agent: one line, at most 500 characters once cleaned. */
|
|
89428
89838
|
resolutionNote: external_exports.string().max(4e3).default("")
|
|
@@ -90592,6 +91002,94 @@ async function setAgentGithub({
|
|
|
90592
91002
|
);
|
|
90593
91003
|
}
|
|
90594
91004
|
|
|
91005
|
+
// src/services/group-commands.service.ts
|
|
91006
|
+
var USAGE11 = "Usage: laze groups [list | create <name> [--person <member>].. | rename <group> <name> | delete <group> | add <group> --person <member>.. | remove <group> --person <member>..]";
|
|
91007
|
+
function printGroup({ context, args, group }) {
|
|
91008
|
+
if (args.flags.json) return context.out(`${JSON.stringify(group, null, 2)}
|
|
91009
|
+
`);
|
|
91010
|
+
context.out(`@${group.name} ${group.id} ${group.memberIds.join(", ") || "no one"}
|
|
91011
|
+
`);
|
|
91012
|
+
}
|
|
91013
|
+
function peopleOf({ args }) {
|
|
91014
|
+
const people2 = args.lists.person ?? [];
|
|
91015
|
+
const one = flagText({ args, name: "person" });
|
|
91016
|
+
if (people2.length > 0) return people2;
|
|
91017
|
+
return one ? [one] : [];
|
|
91018
|
+
}
|
|
91019
|
+
function wordAt6({ args, at }) {
|
|
91020
|
+
const word3 = args.words[at];
|
|
91021
|
+
if (!word3) throw new CliUsageError(USAGE11);
|
|
91022
|
+
return word3;
|
|
91023
|
+
}
|
|
91024
|
+
async function list7({ context, args }) {
|
|
91025
|
+
const { client } = await signedIn({ context, args });
|
|
91026
|
+
const groups2 = await client.post("/api/agents/me/workspace/groups", {});
|
|
91027
|
+
if (args.flags.json) return context.out(`${JSON.stringify(groups2, null, 2)}
|
|
91028
|
+
`);
|
|
91029
|
+
if (groups2.length === 0) return context.out("No groups yet.\n");
|
|
91030
|
+
for (const group of groups2) printGroup({ context, args, group });
|
|
91031
|
+
}
|
|
91032
|
+
async function create2({ context, args }) {
|
|
91033
|
+
const name3 = wordAt6({ args, at: 2 });
|
|
91034
|
+
const { client } = await signedIn({ context, args });
|
|
91035
|
+
const group = await client.post("/api/agents/me/workspace/groups/create", {
|
|
91036
|
+
name: name3,
|
|
91037
|
+
members: peopleOf({ args })
|
|
91038
|
+
});
|
|
91039
|
+
printGroup({ context, args, group });
|
|
91040
|
+
}
|
|
91041
|
+
async function rename6({ context, args }) {
|
|
91042
|
+
const group = wordAt6({ args, at: 2 });
|
|
91043
|
+
const name3 = wordAt6({ args, at: 3 });
|
|
91044
|
+
const { client } = await signedIn({ context, args });
|
|
91045
|
+
printGroup({
|
|
91046
|
+
context,
|
|
91047
|
+
args,
|
|
91048
|
+
group: await client.post("/api/agents/me/workspace/groups/rename", {
|
|
91049
|
+
group,
|
|
91050
|
+
name: name3
|
|
91051
|
+
})
|
|
91052
|
+
});
|
|
91053
|
+
}
|
|
91054
|
+
async function remove5({ context, args }) {
|
|
91055
|
+
const group = wordAt6({ args, at: 2 });
|
|
91056
|
+
const { client } = await signedIn({ context, args });
|
|
91057
|
+
const gone = await client.post("/api/agents/me/workspace/groups/delete", { group });
|
|
91058
|
+
context.out(`Deleted @${gone.name}. What it shared is taken back.
|
|
91059
|
+
`);
|
|
91060
|
+
}
|
|
91061
|
+
function changing3(key) {
|
|
91062
|
+
return async ({ context, args }) => {
|
|
91063
|
+
const group = wordAt6({ args, at: 2 });
|
|
91064
|
+
const people2 = peopleOf({ args });
|
|
91065
|
+
if (people2.length === 0) throw new CliUsageError(USAGE11);
|
|
91066
|
+
const { client } = await signedIn({ context, args });
|
|
91067
|
+
printGroup({
|
|
91068
|
+
context,
|
|
91069
|
+
args,
|
|
91070
|
+
group: await client.post("/api/agents/me/workspace/groups/members", {
|
|
91071
|
+
group,
|
|
91072
|
+
[key]: people2
|
|
91073
|
+
})
|
|
91074
|
+
});
|
|
91075
|
+
};
|
|
91076
|
+
}
|
|
91077
|
+
var COMMANDS = {
|
|
91078
|
+
list: list7,
|
|
91079
|
+
create: create2,
|
|
91080
|
+
rename: rename6,
|
|
91081
|
+
delete: remove5,
|
|
91082
|
+
add: changing3("add"),
|
|
91083
|
+
remove: changing3("remove")
|
|
91084
|
+
};
|
|
91085
|
+
async function groups({ context, args }) {
|
|
91086
|
+
const sub = args.words[1];
|
|
91087
|
+
if (!sub) return list7({ context, args });
|
|
91088
|
+
const command = COMMANDS[sub];
|
|
91089
|
+
if (!command) throw new CliUsageError(USAGE11);
|
|
91090
|
+
return command({ context, args });
|
|
91091
|
+
}
|
|
91092
|
+
|
|
90595
91093
|
// src/rules/history-format.rules.ts
|
|
90596
91094
|
function timeOf2(iso3) {
|
|
90597
91095
|
return `${iso3.slice(0, 10)} ${iso3.slice(11, 16)} UTC`;
|
|
@@ -90940,7 +91438,7 @@ async function offer({ context, args }) {
|
|
|
90940
91438
|
context.out(`${answer6.message}
|
|
90941
91439
|
`);
|
|
90942
91440
|
}
|
|
90943
|
-
async function
|
|
91441
|
+
async function list8({ context, args }) {
|
|
90944
91442
|
const client = await computeClient({ context, args });
|
|
90945
91443
|
const answer6 = await client.get(DEDICATED_IP_REST_PATHS.all);
|
|
90946
91444
|
if (args.flags.json) return printJson7(context, answer6);
|
|
@@ -90960,7 +91458,7 @@ var IP_COMMANDS = {
|
|
|
90960
91458
|
countries,
|
|
90961
91459
|
domains: domains2,
|
|
90962
91460
|
offer,
|
|
90963
|
-
list:
|
|
91461
|
+
list: list8
|
|
90964
91462
|
};
|
|
90965
91463
|
async function ip({ context, args }) {
|
|
90966
91464
|
const name3 = args.words[1] ?? "status";
|
|
@@ -90970,7 +91468,7 @@ async function ip({ context, args }) {
|
|
|
90970
91468
|
}
|
|
90971
91469
|
|
|
90972
91470
|
// src/services/join-commands.service.ts
|
|
90973
|
-
import { mkdir as mkdir21, readFile as readFile35, rename as
|
|
91471
|
+
import { mkdir as mkdir21, readFile as readFile35, rename as rename7, rm as rm12, writeFile as writeFile21 } from "node:fs/promises";
|
|
90974
91472
|
import { dirname as dirname21, join as join25 } from "node:path";
|
|
90975
91473
|
var DEFAULT_WAIT_SECONDS2 = 100;
|
|
90976
91474
|
var JOIN_USAGE = "Usage: laze join [--workspace <name|id|invite link>] [--for <email>] [--name <name>] [--note <text>] [--timeout <seconds>] [--project <folder>]";
|
|
@@ -90995,7 +91493,7 @@ async function keepPending({ context, pending: pending2 }) {
|
|
|
90995
91493
|
await mkdir21(dirname21(path), { recursive: true, mode: 448 });
|
|
90996
91494
|
const temporary = `${path}.${process.pid}.tmp`;
|
|
90997
91495
|
await writeFile21(temporary, JSON.stringify(pending2), { mode: 384 });
|
|
90998
|
-
await
|
|
91496
|
+
await rename7(temporary, path);
|
|
90999
91497
|
}
|
|
91000
91498
|
async function dropPending({ context }) {
|
|
91001
91499
|
await rm12(pendingPathOf({ context }), { force: true });
|
|
@@ -91265,7 +91763,7 @@ async function mine3({ context, args }) {
|
|
|
91265
91763
|
);
|
|
91266
91764
|
}
|
|
91267
91765
|
}
|
|
91268
|
-
async function
|
|
91766
|
+
async function list9({ context, args }) {
|
|
91269
91767
|
const { client } = await signedIn({ context, args });
|
|
91270
91768
|
const keys2 = await client.get("/api/api-keys");
|
|
91271
91769
|
if (args.flags.json) return printJson8(context, keys2);
|
|
@@ -91298,7 +91796,7 @@ async function keepInVault({
|
|
|
91298
91796
|
throw error63;
|
|
91299
91797
|
}
|
|
91300
91798
|
}
|
|
91301
|
-
async function
|
|
91799
|
+
async function create3({ context, args }) {
|
|
91302
91800
|
const name3 = args.words[2];
|
|
91303
91801
|
const permissions = args.lists.permission ?? [];
|
|
91304
91802
|
if (!name3 || permissions.length === 0) throw new CliUsageError(KEYS_USAGE);
|
|
@@ -91332,7 +91830,7 @@ async function revoke2({ context, args }) {
|
|
|
91332
91830
|
context.out(`Revoked ${apiKeyId}.
|
|
91333
91831
|
`);
|
|
91334
91832
|
}
|
|
91335
|
-
var KEY_COMMANDS = { mine: mine3, list:
|
|
91833
|
+
var KEY_COMMANDS = { mine: mine3, list: list9, create: create3, revoke: revoke2 };
|
|
91336
91834
|
async function keys({ context, args }) {
|
|
91337
91835
|
const name3 = args.words[1] ?? "mine";
|
|
91338
91836
|
const command = Object.hasOwn(KEY_COMMANDS, name3) ? KEY_COMMANDS[name3] : void 0;
|
|
@@ -91467,7 +91965,7 @@ async function test({ context, args }) {
|
|
|
91467
91965
|
`);
|
|
91468
91966
|
return 1;
|
|
91469
91967
|
}
|
|
91470
|
-
async function
|
|
91968
|
+
async function remove6({ context, args }) {
|
|
91471
91969
|
const { client } = await signedIn({ context, args });
|
|
91472
91970
|
const integration = await client.post(LANGWATCH_REST_PATHS.remove, {});
|
|
91473
91971
|
if (args.flags.json) return printJson9(context, integration);
|
|
@@ -91512,7 +92010,7 @@ var LANGWATCH_COMMANDS = {
|
|
|
91512
92010
|
off: turnOff2,
|
|
91513
92011
|
level,
|
|
91514
92012
|
test,
|
|
91515
|
-
remove:
|
|
92013
|
+
remove: remove6,
|
|
91516
92014
|
agent
|
|
91517
92015
|
};
|
|
91518
92016
|
async function langwatch({ context, args }) {
|
|
@@ -91530,7 +92028,7 @@ var MACHINE_ACCESS_USAGE = [
|
|
|
91530
92028
|
" laze machine grant|revoke <machine> --member <userId> | --agent <agentId> share it or stop (owner)",
|
|
91531
92029
|
" laze machine budget <machine> <usd> [--period day|week|month] its spend cap (owner)"
|
|
91532
92030
|
].join("\n");
|
|
91533
|
-
function
|
|
92031
|
+
function wordAt7({ args, at }) {
|
|
91534
92032
|
const value = args.words[at];
|
|
91535
92033
|
if (!value) throw new CliUsageError(`Usage:
|
|
91536
92034
|
${MACHINE_ACCESS_USAGE}`);
|
|
@@ -91559,23 +92057,23 @@ async function status8({ context, args }) {
|
|
|
91559
92057
|
}
|
|
91560
92058
|
async function get({ context, args }) {
|
|
91561
92059
|
const client = await computeClient({ context, args });
|
|
91562
|
-
const machine2 =
|
|
92060
|
+
const machine2 = wordAt7({ args, at: 2 });
|
|
91563
92061
|
printMachine({
|
|
91564
92062
|
context,
|
|
91565
92063
|
args,
|
|
91566
92064
|
machine: await client.post(COMPUTE_REST_PATHS.get, { machine: machine2 })
|
|
91567
92065
|
});
|
|
91568
92066
|
}
|
|
91569
|
-
async function
|
|
91570
|
-
const machine2 =
|
|
91571
|
-
const name3 =
|
|
92067
|
+
async function rename8({ context, args }) {
|
|
92068
|
+
const machine2 = wordAt7({ args, at: 2 });
|
|
92069
|
+
const name3 = wordAt7({ args, at: 3 });
|
|
91572
92070
|
const client = await computeClient({ context, args });
|
|
91573
92071
|
const renamed = await client.post(COMPUTE_REST_PATHS.rename, { machine: machine2, name: name3 });
|
|
91574
92072
|
if (args.flags.json) return printMachine({ context, args, machine: renamed });
|
|
91575
92073
|
context.out(`${machine2} is now ${renamed.name}.
|
|
91576
92074
|
`);
|
|
91577
92075
|
}
|
|
91578
|
-
function
|
|
92076
|
+
function granteeOf2({ args }) {
|
|
91579
92077
|
const member = flagText({ args, name: "member" });
|
|
91580
92078
|
const agent3 = flagText({ args, name: "agent" });
|
|
91581
92079
|
if (!member === !agent3) throw new CliUsageError(`Usage:
|
|
@@ -91583,8 +92081,8 @@ ${MACHINE_ACCESS_USAGE}`);
|
|
|
91583
92081
|
return member ? { kind: "member", id: member } : { kind: "agent", id: agent3 };
|
|
91584
92082
|
}
|
|
91585
92083
|
async function share2({ context, args }) {
|
|
91586
|
-
const machine2 =
|
|
91587
|
-
const grantee =
|
|
92084
|
+
const machine2 = wordAt7({ args, at: 2 });
|
|
92085
|
+
const grantee = granteeOf2({ args });
|
|
91588
92086
|
const revoking = args.words[1] === "revoke";
|
|
91589
92087
|
const path = revoking ? COMPUTE_REST_PATHS.revokeGrant : COMPUTE_REST_PATHS.grant;
|
|
91590
92088
|
const client = await computeClient({ context, args });
|
|
@@ -91595,8 +92093,8 @@ async function share2({ context, args }) {
|
|
|
91595
92093
|
`);
|
|
91596
92094
|
}
|
|
91597
92095
|
async function budget({ context, args }) {
|
|
91598
|
-
const machine2 =
|
|
91599
|
-
const budgetUsd = Number(
|
|
92096
|
+
const machine2 = wordAt7({ args, at: 2 });
|
|
92097
|
+
const budgetUsd = Number(wordAt7({ args, at: 3 }));
|
|
91600
92098
|
const named = flagText({ args, name: "period" });
|
|
91601
92099
|
const periods = MACHINE_BUDGET_PERIODS;
|
|
91602
92100
|
if (!(budgetUsd >= 0) || named && !periods.includes(named)) {
|
|
@@ -91612,13 +92110,13 @@ ${MACHINE_ACCESS_USAGE}`);
|
|
|
91612
92110
|
});
|
|
91613
92111
|
printMachine({ context, args, machine: changed });
|
|
91614
92112
|
}
|
|
91615
|
-
var
|
|
92113
|
+
var COMMANDS2 = { status: status8, get, rename: rename8, grant: share2, revoke: share2, budget };
|
|
91616
92114
|
function machineAccessCommand(name3) {
|
|
91617
|
-
return name3 && Object.hasOwn(
|
|
92115
|
+
return name3 && Object.hasOwn(COMMANDS2, name3) ? COMMANDS2[name3] : void 0;
|
|
91618
92116
|
}
|
|
91619
92117
|
|
|
91620
92118
|
// src/services/machine-commands.service.ts
|
|
91621
|
-
var
|
|
92119
|
+
var USAGE12 = [
|
|
91622
92120
|
"Usage: laze machine connect <name> the command to run on your own machine (people)",
|
|
91623
92121
|
" laze machine connect <name> --again a new command for a machine you connected; the old code stops working",
|
|
91624
92122
|
" laze machine connect <name> --ssh <user>@<host>[:port] a machine that cannot run the connector, over SSH (people)",
|
|
@@ -91664,7 +92162,7 @@ function listLine(machine2) {
|
|
|
91664
92162
|
var EXEC_ENV_MAX = 32;
|
|
91665
92163
|
function machineArg2({ args }) {
|
|
91666
92164
|
const machine2 = args.words[2];
|
|
91667
|
-
if (!machine2) throw new CliUsageError(
|
|
92165
|
+
if (!machine2) throw new CliUsageError(USAGE12);
|
|
91668
92166
|
return machine2;
|
|
91669
92167
|
}
|
|
91670
92168
|
async function connect4({ context, args }) {
|
|
@@ -91690,7 +92188,7 @@ async function connectSsh({
|
|
|
91690
92188
|
}) {
|
|
91691
92189
|
const ssh = flagText({ args, name: "ssh" });
|
|
91692
92190
|
if (!ssh) throw new CliUsageError(`--ssh takes <user>@<host>[:port]
|
|
91693
|
-
${
|
|
92191
|
+
${USAGE12}`);
|
|
91694
92192
|
const client = await computeClient({ context, args });
|
|
91695
92193
|
const made = await client.post(COMPUTE_REST_PATHS.connectSsh, {
|
|
91696
92194
|
name: name3,
|
|
@@ -91732,7 +92230,7 @@ Check it on the machine (ssh-keygen -lf /etc/ssh/ssh_host_ed25519_key.pub, or th
|
|
|
91732
92230
|
context.out(`${machine2.name} is pinned to host key ${hostKey}; commands run there again.
|
|
91733
92231
|
`);
|
|
91734
92232
|
}
|
|
91735
|
-
async function
|
|
92233
|
+
async function list10({ context, args }) {
|
|
91736
92234
|
const client = await computeClient({ context, args });
|
|
91737
92235
|
const machines = await client.get(COMPUTE_REST_PATHS.machines);
|
|
91738
92236
|
if (args.flags.json) return context.out(`${JSON.stringify(machines, null, 2)}
|
|
@@ -91766,11 +92264,11 @@ async function exec({
|
|
|
91766
92264
|
}) {
|
|
91767
92265
|
const machine2 = machineArg2({ args });
|
|
91768
92266
|
const command = commandText({ rest: args.rest });
|
|
91769
|
-
if (!command.trim()) throw new CliUsageError(
|
|
92267
|
+
if (!command.trim()) throw new CliUsageError(USAGE12);
|
|
91770
92268
|
const timeout = flagText({ args, name: "timeout" });
|
|
91771
92269
|
if (timeout && !(Number(timeout) >= 1))
|
|
91772
92270
|
throw new CliUsageError(`--timeout takes a number of seconds
|
|
91773
|
-
${
|
|
92271
|
+
${USAGE12}`);
|
|
91774
92272
|
const released = await vaultEnv({ context, args });
|
|
91775
92273
|
if ("exitCode" in released) return released.exitCode;
|
|
91776
92274
|
const client = await computeClient({ context, args });
|
|
@@ -91798,11 +92296,11 @@ async function vaultEnv({
|
|
|
91798
92296
|
const connections = args.lists.vault ?? [];
|
|
91799
92297
|
if (args.flags.vault === true)
|
|
91800
92298
|
throw new CliUsageError(`--vault takes a connection name
|
|
91801
|
-
${
|
|
92299
|
+
${USAGE12}`);
|
|
91802
92300
|
if (connections.length === 0) return {};
|
|
91803
92301
|
const reason = flagText({ args, name: "reason" });
|
|
91804
92302
|
if (!reason) throw new CliUsageError(`Say why with --reason "<one plain sentence>"
|
|
91805
|
-
${
|
|
92303
|
+
${USAGE12}`);
|
|
91806
92304
|
const env = {};
|
|
91807
92305
|
for (const connection of new Set(connections)) {
|
|
91808
92306
|
const released = await vaultRelease({ context, args, connection, reason, command: args.rest });
|
|
@@ -91822,11 +92320,11 @@ ${USAGE11}`);
|
|
|
91822
92320
|
async function host({ context, args }) {
|
|
91823
92321
|
const machineName = args.words[2];
|
|
91824
92322
|
const agent3 = args.words[3];
|
|
91825
|
-
if (!machineName || !agent3) throw new CliUsageError(
|
|
92323
|
+
if (!machineName || !agent3) throw new CliUsageError(USAGE12);
|
|
91826
92324
|
const whenOffline = flagText({ args, name: "when-offline", fallback: "wait" });
|
|
91827
92325
|
if (whenOffline !== "wait" && whenOffline !== "computer" && whenOffline !== "sandbox")
|
|
91828
92326
|
throw new CliUsageError(`--when-offline takes wait or computer
|
|
91829
|
-
${
|
|
92327
|
+
${USAGE12}`);
|
|
91830
92328
|
const client = await computeClient({ context, args });
|
|
91831
92329
|
const machine2 = await client.post(COMPUTE_REST_PATHS.host, {
|
|
91832
92330
|
machine: machineName,
|
|
@@ -91843,7 +92341,7 @@ ${USAGE11}`);
|
|
|
91843
92341
|
}
|
|
91844
92342
|
async function unhost({ context, args }) {
|
|
91845
92343
|
const agent3 = args.words[2];
|
|
91846
|
-
if (!agent3) throw new CliUsageError(
|
|
92344
|
+
if (!agent3) throw new CliUsageError(USAGE12);
|
|
91847
92345
|
const client = await computeClient({ context, args });
|
|
91848
92346
|
const done = await client.post(COMPUTE_REST_PATHS.unhost, { agent: agent3 });
|
|
91849
92347
|
if (args.flags.json) return context.out(`${JSON.stringify(done, null, 2)}
|
|
@@ -91851,7 +92349,7 @@ async function unhost({ context, args }) {
|
|
|
91851
92349
|
context.out(`${agent3} runs on your agent computer again.
|
|
91852
92350
|
`);
|
|
91853
92351
|
}
|
|
91854
|
-
async function
|
|
92352
|
+
async function remove7({ context, args }) {
|
|
91855
92353
|
const client = await computeClient({ context, args });
|
|
91856
92354
|
const machine2 = await client.post(COMPUTE_REST_PATHS.remove, {
|
|
91857
92355
|
machine: machineArg2({ args })
|
|
@@ -91871,16 +92369,16 @@ async function remove6({ context, args }) {
|
|
|
91871
92369
|
async function machine({ context, args }) {
|
|
91872
92370
|
const command = args.words[1];
|
|
91873
92371
|
if (command === "connect") return connect4({ context, args });
|
|
91874
|
-
if (command === "list" || command === "ls") return
|
|
92372
|
+
if (command === "list" || command === "ls") return list10({ context, args });
|
|
91875
92373
|
if (command === "health") return health({ context, args });
|
|
91876
92374
|
if (command === "exec") return exec({ context, args });
|
|
91877
|
-
if (command === "remove") return
|
|
92375
|
+
if (command === "remove") return remove7({ context, args });
|
|
91878
92376
|
if (command === "trust-host-key") return trustHostKey({ context, args });
|
|
91879
92377
|
if (command === "host") return host({ context, args });
|
|
91880
92378
|
if (command === "unhost") return unhost({ context, args });
|
|
91881
92379
|
const access = machineAccessCommand(command);
|
|
91882
92380
|
if (access) return access({ context, args });
|
|
91883
|
-
throw new CliUsageError(
|
|
92381
|
+
throw new CliUsageError(USAGE12);
|
|
91884
92382
|
}
|
|
91885
92383
|
|
|
91886
92384
|
// src/services/mcp-server.service.ts
|
|
@@ -92170,7 +92668,7 @@ async function writeMount({
|
|
|
92170
92668
|
}
|
|
92171
92669
|
|
|
92172
92670
|
// src/services/memory-commands.service.ts
|
|
92173
|
-
var
|
|
92671
|
+
var USAGE13 = `Usage:
|
|
92174
92672
|
laze memory get SOUL.md|AGENTS.md|MEMORY.md [--channel <channel>]
|
|
92175
92673
|
laze memory set <file> <text|@file|-> [--channel <channel>] [--base <version>]
|
|
92176
92674
|
laze memory append MEMORY.md <text|@file|-> [--channel <channel>]
|
|
@@ -92197,7 +92695,7 @@ var PROVENANCES = ["said", "decided", "verified", "inferred", "observed"];
|
|
|
92197
92695
|
var FILES = /* @__PURE__ */ new Set(["SOUL.md", "AGENTS.md", "MEMORY.md"]);
|
|
92198
92696
|
function fileRef({ context, args }) {
|
|
92199
92697
|
const file3 = args.words[2] ?? "";
|
|
92200
|
-
if (!FILES.has(file3)) throw new CliUsageError(
|
|
92698
|
+
if (!FILES.has(file3)) throw new CliUsageError(USAGE13);
|
|
92201
92699
|
const channel = turnChannel({ context, args });
|
|
92202
92700
|
return { file: file3, ...channel ? { channel } : {} };
|
|
92203
92701
|
}
|
|
@@ -92236,7 +92734,7 @@ async function memoryHistory({ context, args }) {
|
|
|
92236
92734
|
async function memorySet({ context, args }) {
|
|
92237
92735
|
const ref = fileRef({ context, args });
|
|
92238
92736
|
const value = args.words.slice(3).join(" ");
|
|
92239
|
-
if (!value) throw new CliUsageError(
|
|
92737
|
+
if (!value) throw new CliUsageError(USAGE13);
|
|
92240
92738
|
const content = await textArgument({ context, value });
|
|
92241
92739
|
const base = args.flags.base;
|
|
92242
92740
|
const { client } = await turnClient({ context, args });
|
|
@@ -92252,7 +92750,7 @@ async function memorySet({ context, args }) {
|
|
|
92252
92750
|
async function memoryAppend({ context, args }) {
|
|
92253
92751
|
const ref = fileRef({ context, args });
|
|
92254
92752
|
const value = args.words.slice(3).join(" ");
|
|
92255
|
-
if (!value) throw new CliUsageError(
|
|
92753
|
+
if (!value) throw new CliUsageError(USAGE13);
|
|
92256
92754
|
const text3 = await textArgument({ context, value });
|
|
92257
92755
|
const { client } = await turnClient({ context, args });
|
|
92258
92756
|
const saved3 = await client.post("/api/memory/append", { ...ref, text: text3 });
|
|
@@ -92262,7 +92760,7 @@ async function memoryAppend({ context, args }) {
|
|
|
92262
92760
|
}
|
|
92263
92761
|
async function memorySearch({ context, args }) {
|
|
92264
92762
|
const query = args.words.slice(2).join(" ").trim();
|
|
92265
|
-
if (!query) throw new CliUsageError(
|
|
92763
|
+
if (!query) throw new CliUsageError(USAGE13);
|
|
92266
92764
|
const { client } = await turnClient({ context, args });
|
|
92267
92765
|
const hits = await client.post("/api/memory/search", { query });
|
|
92268
92766
|
if (args.flags.json) return context.out(`${JSON.stringify(hits, null, 2)}
|
|
@@ -92306,7 +92804,7 @@ function logTarget({
|
|
|
92306
92804
|
turn
|
|
92307
92805
|
}) {
|
|
92308
92806
|
const layer = flagText({ args, name: "layer", fallback: "person" });
|
|
92309
|
-
if (layer !== "person" && layer !== "agent") throw new CliUsageError(
|
|
92807
|
+
if (layer !== "person" && layer !== "agent") throw new CliUsageError(USAGE13);
|
|
92310
92808
|
const channel = turn ? flagText({ args, name: "channel" }) : turnChannel({ context, args });
|
|
92311
92809
|
const messages = (context.environment.inherited.LAZE_TURN_MESSAGES ?? "").split(",").map((id2) => id2.trim()).filter(Boolean);
|
|
92312
92810
|
const message2 = flagText({ args, name: "message" }) || messages.at(-1) || "";
|
|
@@ -92332,7 +92830,7 @@ async function taggedLine({
|
|
|
92332
92830
|
const [tag] = given;
|
|
92333
92831
|
const value = args.flags[tag];
|
|
92334
92832
|
const raw = typeof value === "string" ? value : args.words.slice(from).join(" ");
|
|
92335
|
-
if (!raw.trim()) throw new CliUsageError(
|
|
92833
|
+
if (!raw.trim()) throw new CliUsageError(USAGE13);
|
|
92336
92834
|
const text3 = await textArgument({ context, value: raw });
|
|
92337
92835
|
return { tag, text: text3, pins: [...args.lists.pin ?? []] };
|
|
92338
92836
|
}
|
|
@@ -92365,12 +92863,12 @@ async function logCall({
|
|
|
92365
92863
|
}
|
|
92366
92864
|
function entryId(args) {
|
|
92367
92865
|
const id2 = Number((args.words[2] ?? "").replace(/^#/, ""));
|
|
92368
|
-
if (!Number.isInteger(id2) || id2 < 0) throw new CliUsageError(
|
|
92866
|
+
if (!Number.isInteger(id2) || id2 < 0) throw new CliUsageError(USAGE13);
|
|
92369
92867
|
return id2;
|
|
92370
92868
|
}
|
|
92371
92869
|
function blockArg(args) {
|
|
92372
92870
|
const block2 = (args.words[2] ?? "").replace(/^#/, "");
|
|
92373
|
-
if (!block2) throw new CliUsageError(
|
|
92871
|
+
if (!block2) throw new CliUsageError(USAGE13);
|
|
92374
92872
|
return block2;
|
|
92375
92873
|
}
|
|
92376
92874
|
async function memoryNote({ context, args }) {
|
|
@@ -92388,7 +92886,7 @@ async function memoryRemove({ context, args }) {
|
|
|
92388
92886
|
async function memoryNap({ context, args }) {
|
|
92389
92887
|
const block2 = (args.words[2] ?? "").replace(/^#/, "");
|
|
92390
92888
|
const text3 = args.words.slice(3).join(" ");
|
|
92391
|
-
if (block2 && !text3) throw new CliUsageError(
|
|
92889
|
+
if (block2 && !text3) throw new CliUsageError(USAGE13);
|
|
92392
92890
|
const line = text3 ? await textArgument({ context, value: text3 }) : "";
|
|
92393
92891
|
await logCall({ context, args, path: "nap", body: block2 ? { block: block2, text: line } : {} });
|
|
92394
92892
|
}
|
|
@@ -92400,7 +92898,7 @@ async function memoryForget({ context, args }) {
|
|
|
92400
92898
|
}
|
|
92401
92899
|
async function memoryRecall({ context, args }) {
|
|
92402
92900
|
const query = args.words.slice(2).join(" ").trim();
|
|
92403
|
-
if (!query) throw new CliUsageError(
|
|
92901
|
+
if (!query) throw new CliUsageError(USAGE13);
|
|
92404
92902
|
await logCall({ context, args, path: "recall", body: { query } });
|
|
92405
92903
|
}
|
|
92406
92904
|
async function memoryWake({ context, args }) {
|
|
@@ -92446,7 +92944,7 @@ async function memoryImport({ context, args }) {
|
|
|
92446
92944
|
const siesta = flagText({ args, name: "siesta" });
|
|
92447
92945
|
if (siesta) return siestaImport({ context, args, dir: siesta });
|
|
92448
92946
|
const dir = flagText({ args, name: "optmem" });
|
|
92449
|
-
if (!dir) throw new CliUsageError(
|
|
92947
|
+
if (!dir) throw new CliUsageError(USAGE13);
|
|
92450
92948
|
const root = resolve17(context.cwd, dir);
|
|
92451
92949
|
const log = await readFile37(join26(root, "LOG.txt"));
|
|
92452
92950
|
const sizes2 = (await readdir7(join26(root, "TREE")).catch(() => [])).filter(
|
|
@@ -92488,13 +92986,13 @@ var MEMORY_COMMANDS = {
|
|
|
92488
92986
|
async function memory({ context, args }) {
|
|
92489
92987
|
const name3 = args.words[1] ?? "";
|
|
92490
92988
|
const command = Object.hasOwn(MEMORY_COMMANDS, name3) ? MEMORY_COMMANDS[name3] : void 0;
|
|
92491
|
-
if (!command) throw new CliUsageError(
|
|
92989
|
+
if (!command) throw new CliUsageError(USAGE13);
|
|
92492
92990
|
await command({ context, args });
|
|
92493
92991
|
}
|
|
92494
92992
|
|
|
92495
92993
|
// src/services/models-commands.service.ts
|
|
92496
92994
|
var WINDOWS = ["day", "week", "month"];
|
|
92497
|
-
var
|
|
92995
|
+
var USAGE14 = `Usage:
|
|
92498
92996
|
laze models policy whether Laze models are on, the default budget and the cap
|
|
92499
92997
|
laze models set-policy [on|off] [--default-level small|frontier|none] [--default-day <usd|none>] [--cap-day <usd|none>] ... (admins)
|
|
92500
92998
|
--default-level sets what agents on Default run (none: Laze Frontier, Laze's default)
|
|
@@ -92515,7 +93013,7 @@ function levelFrom({ args }) {
|
|
|
92515
93013
|
const level2 = wireLevelOf({ text: text3 });
|
|
92516
93014
|
if (level2) return level2;
|
|
92517
93015
|
throw new CliUsageError(`--default-level takes small, frontier or none.
|
|
92518
|
-
${
|
|
93016
|
+
${USAGE14}`);
|
|
92519
93017
|
}
|
|
92520
93018
|
var usd = (value) => `${Number(value.toFixed(2))} USD`;
|
|
92521
93019
|
var limitsLine = (limits) => WINDOWS.map(
|
|
@@ -92534,7 +93032,7 @@ function limitsFrom({
|
|
|
92534
93032
|
const value = text3 === "none" ? null : Number(text3);
|
|
92535
93033
|
if (value !== null && (!Number.isFinite(value) || value < 0))
|
|
92536
93034
|
throw new CliUsageError(`--${prefix}${window2} takes an amount in USD or none.
|
|
92537
|
-
${
|
|
93035
|
+
${USAGE14}`);
|
|
92538
93036
|
next[window2] = value;
|
|
92539
93037
|
changed = true;
|
|
92540
93038
|
}
|
|
@@ -92561,14 +93059,14 @@ async function showPolicy({ context, args }) {
|
|
|
92561
93059
|
}
|
|
92562
93060
|
async function setPolicy({ context, args }) {
|
|
92563
93061
|
const state = args.words[2];
|
|
92564
|
-
if (state !== void 0 && state !== "on" && state !== "off") throw new CliUsageError(
|
|
93062
|
+
if (state !== void 0 && state !== "on" && state !== "off") throw new CliUsageError(USAGE14);
|
|
92565
93063
|
const { client } = await signedIn({ context, args });
|
|
92566
93064
|
const current3 = await client.get("/api/models/policy");
|
|
92567
93065
|
const defaultBudget = limitsFrom({ args, prefix: "default-", current: current3.defaultBudget });
|
|
92568
93066
|
const cap = limitsFrom({ args, prefix: "cap-", current: current3.cap });
|
|
92569
93067
|
const defaultLevel = levelFrom({ args });
|
|
92570
93068
|
if (!state && !defaultBudget && !cap && defaultLevel === void 0)
|
|
92571
|
-
throw new CliUsageError(
|
|
93069
|
+
throw new CliUsageError(USAGE14);
|
|
92572
93070
|
const updated = await client.post("/api/models/policy", {
|
|
92573
93071
|
...state ? { lazeModels: state === "on" } : {},
|
|
92574
93072
|
...defaultLevel !== void 0 ? { defaultLevel } : {},
|
|
@@ -92610,11 +93108,11 @@ async function agentNamed({ client, name: name3 }) {
|
|
|
92610
93108
|
}
|
|
92611
93109
|
async function setBudget({ context, args }) {
|
|
92612
93110
|
const name3 = args.words[2];
|
|
92613
|
-
if (!name3) throw new CliUsageError(
|
|
93111
|
+
if (!name3) throw new CliUsageError(USAGE14);
|
|
92614
93112
|
const { client } = await signedIn({ context, args });
|
|
92615
93113
|
const agent3 = await agentNamed({ client, name: name3 });
|
|
92616
93114
|
const next = limitsFrom({ args, prefix: "", current: agent3.budget });
|
|
92617
|
-
if (!next) throw new CliUsageError(
|
|
93115
|
+
if (!next) throw new CliUsageError(USAGE14);
|
|
92618
93116
|
const updated = await client.post("/api/models/agents/budget", {
|
|
92619
93117
|
agentId: agent3.agentId,
|
|
92620
93118
|
budget: next
|
|
@@ -92647,7 +93145,7 @@ var MODEL_COMMANDS = {
|
|
|
92647
93145
|
async function models({ context, args }) {
|
|
92648
93146
|
const name3 = args.words[1] ?? "policy";
|
|
92649
93147
|
const command = Object.hasOwn(MODEL_COMMANDS, name3) ? MODEL_COMMANDS[name3] : void 0;
|
|
92650
|
-
if (!command) throw new CliUsageError(
|
|
93148
|
+
if (!command) throw new CliUsageError(USAGE14);
|
|
92651
93149
|
await command({ context, args });
|
|
92652
93150
|
}
|
|
92653
93151
|
|
|
@@ -92725,7 +93223,7 @@ var monitorResume = stateRun("/api/agents/monitors/resume", "resume");
|
|
|
92725
93223
|
var monitorRemove = stateRun("/api/agents/monitors/remove", "rm");
|
|
92726
93224
|
|
|
92727
93225
|
// src/services/notification-commands.service.ts
|
|
92728
|
-
var
|
|
93226
|
+
var USAGE15 = `Usage:
|
|
92729
93227
|
laze notifications [show] your notification settings (people)
|
|
92730
93228
|
laze notifications set [--channels all|mentions|nothing] [--keywords a,b] [--dnd on|off]
|
|
92731
93229
|
[--dnd-from 22:00] [--dnd-to 08:00] [--tz <IANA zone>] [--push on|off] [--email on|off]
|
|
@@ -92754,14 +93252,14 @@ function switchOf({ args, name: name3 }) {
|
|
|
92754
93252
|
if (!text3) return void 0;
|
|
92755
93253
|
if (text3 !== "on" && text3 !== "off")
|
|
92756
93254
|
throw new CliUsageError(`--${name3} takes on or off.
|
|
92757
|
-
${
|
|
93255
|
+
${USAGE15}`);
|
|
92758
93256
|
return text3 === "on";
|
|
92759
93257
|
}
|
|
92760
93258
|
function changesOf(args) {
|
|
92761
93259
|
const channels3 = flagText({ args, name: "channels" });
|
|
92762
93260
|
if (channels3 && !["all", "mentions", "nothing"].includes(channels3))
|
|
92763
93261
|
throw new CliUsageError(`--channels takes all, mentions or nothing.
|
|
92764
|
-
${
|
|
93262
|
+
${USAGE15}`);
|
|
92765
93263
|
const keywords = typeof args.flags.keywords === "string" ? args.flags.keywords : void 0;
|
|
92766
93264
|
const emailAfter = flagText({ args, name: "email-after" });
|
|
92767
93265
|
const changes2 = {
|
|
@@ -92783,7 +93281,7 @@ async function showSettings({ context, args }) {
|
|
|
92783
93281
|
}
|
|
92784
93282
|
async function setSettings({ context, args }) {
|
|
92785
93283
|
const changes2 = changesOf(args);
|
|
92786
|
-
if (Object.keys(changes2).length === 0) throw new CliUsageError(
|
|
93284
|
+
if (Object.keys(changes2).length === 0) throw new CliUsageError(USAGE15);
|
|
92787
93285
|
const { client } = await signedIn({ context, args });
|
|
92788
93286
|
print8({
|
|
92789
93287
|
context,
|
|
@@ -92794,7 +93292,7 @@ async function setSettings({ context, args }) {
|
|
|
92794
93292
|
async function snoozeFor({ context, args }) {
|
|
92795
93293
|
const word3 = args.words[2];
|
|
92796
93294
|
const minutes = word3 === "off" ? 0 : Number(word3);
|
|
92797
|
-
if (!word3 || !Number.isInteger(minutes) || minutes < 0) throw new CliUsageError(
|
|
93295
|
+
if (!word3 || !Number.isInteger(minutes) || minutes < 0) throw new CliUsageError(USAGE15);
|
|
92798
93296
|
const { client } = await signedIn({ context, args });
|
|
92799
93297
|
print8({
|
|
92800
93298
|
context,
|
|
@@ -92812,7 +93310,7 @@ var NOTIFICATION_COMMANDS = {
|
|
|
92812
93310
|
async function notifications({ context, args }) {
|
|
92813
93311
|
const name3 = args.words[1] ?? "show";
|
|
92814
93312
|
const command = Object.hasOwn(NOTIFICATION_COMMANDS, name3) ? NOTIFICATION_COMMANDS[name3] : void 0;
|
|
92815
|
-
if (!command) throw new CliUsageError(
|
|
93313
|
+
if (!command) throw new CliUsageError(USAGE15);
|
|
92816
93314
|
await command({ context, args });
|
|
92817
93315
|
}
|
|
92818
93316
|
|
|
@@ -92833,13 +93331,13 @@ var OPENCLAW_USAGE = `Usage (a person's key; a gateway belongs to the person who
|
|
|
92833
93331
|
as its profile for that folder here, never printed; its previous key stops working
|
|
92834
93332
|
laze openclaw feed <connectionId> on|off temporary Workboard migration bridge, off by default
|
|
92835
93333
|
laze openclaw disconnect <connectionId> remove it, its Laze agents and its credentials`;
|
|
92836
|
-
function
|
|
93334
|
+
function wordAt8(args, index) {
|
|
92837
93335
|
const word3 = args.words[index];
|
|
92838
93336
|
if (!word3) throw new CliUsageError(OPENCLAW_USAGE);
|
|
92839
93337
|
return word3;
|
|
92840
93338
|
}
|
|
92841
93339
|
function switchAt(args, index) {
|
|
92842
|
-
const word3 =
|
|
93340
|
+
const word3 = wordAt8(args, index);
|
|
92843
93341
|
if (word3 !== "on" && word3 !== "off") throw new CliUsageError(OPENCLAW_USAGE);
|
|
92844
93342
|
return word3 === "on";
|
|
92845
93343
|
}
|
|
@@ -92882,7 +93380,7 @@ function answer4({
|
|
|
92882
93380
|
`);
|
|
92883
93381
|
printConnection3({ context, connection });
|
|
92884
93382
|
}
|
|
92885
|
-
var
|
|
93383
|
+
var list11 = async ({ context, args, client }) => {
|
|
92886
93384
|
const overview3 = await client.get(OPENCLAW_KEY_PATHS.overview);
|
|
92887
93385
|
if (args.flags.json) return context.out(`${JSON.stringify(overview3, null, 2)}
|
|
92888
93386
|
`);
|
|
@@ -92938,7 +93436,7 @@ ${service}
|
|
|
92938
93436
|
var connect5 = async (input2) => {
|
|
92939
93437
|
if (input2.args.flags.local === true) return connectLocal(input2);
|
|
92940
93438
|
const { context, args, client } = input2;
|
|
92941
|
-
const gatewayUrl2 =
|
|
93439
|
+
const gatewayUrl2 = wordAt8(args, 2);
|
|
92942
93440
|
const label3 = flagText({ args, name: "label" });
|
|
92943
93441
|
const connection = await client.post(OPENCLAW_KEY_PATHS.connect, {
|
|
92944
93442
|
gatewayUrl: gatewayUrl2,
|
|
@@ -92951,8 +93449,8 @@ var agent2 = async (input2) => {
|
|
|
92951
93449
|
const { context, args, client } = input2;
|
|
92952
93450
|
const enabled = switchAt(args, 4);
|
|
92953
93451
|
const connection = await client.post(OPENCLAW_KEY_PATHS.setAgent, {
|
|
92954
|
-
connectionId:
|
|
92955
|
-
openclawAgentId:
|
|
93452
|
+
connectionId: wordAt8(args, 2),
|
|
93453
|
+
openclawAgentId: wordAt8(args, 3),
|
|
92956
93454
|
enabled
|
|
92957
93455
|
});
|
|
92958
93456
|
answer4({ context, args, connection });
|
|
@@ -92963,8 +93461,8 @@ function profileNameOf(agentName) {
|
|
|
92963
93461
|
}
|
|
92964
93462
|
var agentKey = async ({ context, args, client, url: url2 }) => {
|
|
92965
93463
|
const key = await client.post(OPENCLAW_KEY_PATHS.agentKey, {
|
|
92966
|
-
connectionId:
|
|
92967
|
-
openclawAgentId:
|
|
93464
|
+
connectionId: wordAt8(args, 2),
|
|
93465
|
+
openclawAgentId: wordAt8(args, 3)
|
|
92968
93466
|
});
|
|
92969
93467
|
const login2 = flagText({ args, name: "login" });
|
|
92970
93468
|
if (login2) {
|
|
@@ -92989,19 +93487,19 @@ In the agent's own folder on its machine run:
|
|
|
92989
93487
|
};
|
|
92990
93488
|
var feed2 = async ({ context, args, client }) => {
|
|
92991
93489
|
const connection = await client.post(OPENCLAW_KEY_PATHS.setFeed, {
|
|
92992
|
-
connectionId:
|
|
93490
|
+
connectionId: wordAt8(args, 2),
|
|
92993
93491
|
enabled: switchAt(args, 3)
|
|
92994
93492
|
});
|
|
92995
93493
|
answer4({ context, args, connection });
|
|
92996
93494
|
};
|
|
92997
93495
|
var disconnect3 = async ({ context, args, client }) => {
|
|
92998
|
-
const connectionId =
|
|
93496
|
+
const connectionId = wordAt8(args, 2);
|
|
92999
93497
|
await client.post(OPENCLAW_KEY_PATHS.disconnect, { connectionId });
|
|
93000
93498
|
context.out(`Disconnected ${connectionId}.
|
|
93001
93499
|
`);
|
|
93002
93500
|
};
|
|
93003
93501
|
var RUNS5 = {
|
|
93004
|
-
list:
|
|
93502
|
+
list: list11,
|
|
93005
93503
|
connect: connect5,
|
|
93006
93504
|
agent: agent2,
|
|
93007
93505
|
"agent-key": agentKey,
|
|
@@ -93322,7 +93820,7 @@ async function rushWakeHook({ context, args }) {
|
|
|
93322
93820
|
}
|
|
93323
93821
|
|
|
93324
93822
|
// src/services/schedule-commands.service.ts
|
|
93325
|
-
var
|
|
93823
|
+
var USAGE16 = `Usage:
|
|
93326
93824
|
laze schedule add <name> --prompt <text> (--cron "<m h dom mon dow>" | --rrule "<RRULE>" | --at <local time>)
|
|
93327
93825
|
[--tz <IANA zone>] [--channel <channelId>] [--agent <agentId>]
|
|
93328
93826
|
laze schedule list
|
|
@@ -93338,7 +93836,7 @@ function timingOf(args) {
|
|
|
93338
93836
|
const given = [cron, rrule, at].filter(Boolean);
|
|
93339
93837
|
if (given.length !== 1)
|
|
93340
93838
|
throw new CliUsageError(`Give exactly one of --cron, --rrule or --at.
|
|
93341
|
-
${
|
|
93839
|
+
${USAGE16}`);
|
|
93342
93840
|
if (cron) return { kind: "cron", cron };
|
|
93343
93841
|
if (rrule) return { kind: "rrule", rrule };
|
|
93344
93842
|
return { kind: "once", at };
|
|
@@ -93353,7 +93851,7 @@ function printSchedule({ context, schedule: schedule2 }) {
|
|
|
93353
93851
|
async function scheduleAdd({ context, args }) {
|
|
93354
93852
|
const name3 = args.words.slice(2).join(" ").trim();
|
|
93355
93853
|
const prompt = flagText({ args, name: "prompt" });
|
|
93356
|
-
if (!name3 || !prompt) throw new CliUsageError(
|
|
93854
|
+
if (!name3 || !prompt) throw new CliUsageError(USAGE16);
|
|
93357
93855
|
const timing = timingOf(args);
|
|
93358
93856
|
const { client } = await signedIn({ context, args });
|
|
93359
93857
|
const channelId = flagText({ args, name: "channel" });
|
|
@@ -93390,7 +93888,7 @@ function changesOf2(args) {
|
|
|
93390
93888
|
async function scheduleUpdate({ context, args }) {
|
|
93391
93889
|
const scheduleId = args.words[2];
|
|
93392
93890
|
const changes2 = changesOf2(args);
|
|
93393
|
-
if (!scheduleId || Object.keys(changes2).length === 0) throw new CliUsageError(
|
|
93891
|
+
if (!scheduleId || Object.keys(changes2).length === 0) throw new CliUsageError(USAGE16);
|
|
93394
93892
|
const { client } = await signedIn({ context, args });
|
|
93395
93893
|
const schedule2 = await client.post("/api/schedules/update", { scheduleId, ...changes2 });
|
|
93396
93894
|
if (args.flags.json) return context.out(`${JSON.stringify(schedule2, null, 2)}
|
|
@@ -93407,7 +93905,7 @@ async function scheduleList({ context, args }) {
|
|
|
93407
93905
|
function byId(path) {
|
|
93408
93906
|
return async ({ context, args }) => {
|
|
93409
93907
|
const scheduleId = args.words[2];
|
|
93410
|
-
if (!scheduleId) throw new CliUsageError(
|
|
93908
|
+
if (!scheduleId) throw new CliUsageError(USAGE16);
|
|
93411
93909
|
const { client } = await signedIn({ context, args });
|
|
93412
93910
|
const answer6 = await client.post(`/api/schedules/${path}`, {
|
|
93413
93911
|
scheduleId
|
|
@@ -93421,7 +93919,7 @@ function byId(path) {
|
|
|
93421
93919
|
}
|
|
93422
93920
|
async function scheduleRuns({ context, args }) {
|
|
93423
93921
|
const scheduleId = args.words[2];
|
|
93424
|
-
if (!scheduleId) throw new CliUsageError(
|
|
93922
|
+
if (!scheduleId) throw new CliUsageError(USAGE16);
|
|
93425
93923
|
const { client } = await signedIn({ context, args });
|
|
93426
93924
|
const runs = await client.post("/api/schedules/runs", { scheduleId });
|
|
93427
93925
|
if (args.flags.json) return context.out(`${JSON.stringify(runs, null, 2)}
|
|
@@ -93435,7 +93933,7 @@ async function scheduleRuns({ context, args }) {
|
|
|
93435
93933
|
}
|
|
93436
93934
|
async function scheduleRun({ context, args }) {
|
|
93437
93935
|
const scheduleId = args.words[2];
|
|
93438
|
-
if (!scheduleId) throw new CliUsageError(
|
|
93936
|
+
if (!scheduleId) throw new CliUsageError(USAGE16);
|
|
93439
93937
|
const { client } = await signedIn({ context, args });
|
|
93440
93938
|
const run4 = await client.post("/api/schedules/run", { scheduleId });
|
|
93441
93939
|
if (args.flags.json) return context.out(`${JSON.stringify(run4, null, 2)}
|
|
@@ -93456,14 +93954,14 @@ var SCHEDULE_COMMANDS = {
|
|
|
93456
93954
|
async function schedule({ context, args }) {
|
|
93457
93955
|
const name3 = args.words[1] ?? "";
|
|
93458
93956
|
const command = Object.hasOwn(SCHEDULE_COMMANDS, name3) ? SCHEDULE_COMMANDS[name3] : void 0;
|
|
93459
|
-
if (!command) throw new CliUsageError(
|
|
93957
|
+
if (!command) throw new CliUsageError(USAGE16);
|
|
93460
93958
|
await command({ context, args });
|
|
93461
93959
|
}
|
|
93462
93960
|
|
|
93463
93961
|
// src/services/skill-commands.service.ts
|
|
93464
93962
|
import { readdir as readdir8, readFile as readFile40 } from "node:fs/promises";
|
|
93465
93963
|
import { join as join28, relative as relative6, resolve as resolve19 } from "node:path";
|
|
93466
|
-
var
|
|
93964
|
+
var USAGE17 = `Usage:
|
|
93467
93965
|
laze skill list [--agent <agentId>]
|
|
93468
93966
|
laze skill install <catalogue-id> [--as <name>] [--agent <agentId>]
|
|
93469
93967
|
laze skill install --from <folder> [--as <name>] [--agent <agentId>] a folder with a SKILL.md
|
|
@@ -93512,7 +94010,7 @@ async function skillList({ context, args }) {
|
|
|
93512
94010
|
async function skillInstall({ context, args }) {
|
|
93513
94011
|
const catalogueId = args.words[2];
|
|
93514
94012
|
const from = flagText({ args, name: "from" });
|
|
93515
|
-
if (!catalogueId === !from) throw new CliUsageError(
|
|
94013
|
+
if (!catalogueId === !from) throw new CliUsageError(USAGE17);
|
|
93516
94014
|
const name3 = flagText({ args, name: "as" });
|
|
93517
94015
|
const agent3 = flagText({ args, name: "agent" });
|
|
93518
94016
|
const files2 = from ? await folderFiles({ root: resolve19(context.cwd, from) }) : void 0;
|
|
@@ -93530,7 +94028,7 @@ async function skillInstall({ context, args }) {
|
|
|
93530
94028
|
}
|
|
93531
94029
|
async function skillShow({ context, args }) {
|
|
93532
94030
|
const name3 = args.words[2];
|
|
93533
|
-
if (!name3) throw new CliUsageError(
|
|
94031
|
+
if (!name3) throw new CliUsageError(USAGE17);
|
|
93534
94032
|
const agent3 = flagText({ args, name: "agent" });
|
|
93535
94033
|
const { client } = await signedIn({ context, args });
|
|
93536
94034
|
const skill2 = await client.post("/api/skills/show", {
|
|
@@ -93563,7 +94061,7 @@ function agentFlag(args) {
|
|
|
93563
94061
|
}
|
|
93564
94062
|
async function skillRemove({ context, args }) {
|
|
93565
94063
|
const name3 = args.words[2];
|
|
93566
|
-
if (!name3) throw new CliUsageError(
|
|
94064
|
+
if (!name3) throw new CliUsageError(USAGE17);
|
|
93567
94065
|
const { client } = await signedIn({ context, args });
|
|
93568
94066
|
const removed = await client.post("/api/skills/remove", {
|
|
93569
94067
|
name: name3,
|
|
@@ -93580,7 +94078,7 @@ async function skillUpdate({ context, args }) {
|
|
|
93580
94078
|
const description = typeof args.flags.description === "string" ? args.flags.description : void 0;
|
|
93581
94079
|
const skillMdFile = flagText({ args, name: "skill-md" });
|
|
93582
94080
|
if (!name3 || !newName && description === void 0 && !skillMdFile) {
|
|
93583
|
-
throw new CliUsageError(
|
|
94081
|
+
throw new CliUsageError(USAGE17);
|
|
93584
94082
|
}
|
|
93585
94083
|
const skillMd = skillMdFile ? await readFile40(resolve19(context.cwd, skillMdFile), "utf8") : void 0;
|
|
93586
94084
|
const { client } = await signedIn({ context, args });
|
|
@@ -93599,7 +94097,7 @@ async function skillUpdate({ context, args }) {
|
|
|
93599
94097
|
function pinning({ unpin }) {
|
|
93600
94098
|
return async ({ context, args }) => {
|
|
93601
94099
|
const name3 = args.words[2];
|
|
93602
|
-
if (!name3) throw new CliUsageError(
|
|
94100
|
+
if (!name3) throw new CliUsageError(USAGE17);
|
|
93603
94101
|
const { client } = await signedIn({ context, args });
|
|
93604
94102
|
const path = unpin ? "/api/skills/unpin" : "/api/skills/pin";
|
|
93605
94103
|
const skill2 = await client.post(path, { name: name3, ...agentFlag(args) });
|
|
@@ -93623,7 +94121,7 @@ var SKILL_COMMANDS = {
|
|
|
93623
94121
|
async function skill({ context, args }) {
|
|
93624
94122
|
const name3 = args.words[1] ?? "";
|
|
93625
94123
|
const command = Object.hasOwn(SKILL_COMMANDS, name3) ? SKILL_COMMANDS[name3] : void 0;
|
|
93626
|
-
if (!command) throw new CliUsageError(
|
|
94124
|
+
if (!command) throw new CliUsageError(USAGE17);
|
|
93627
94125
|
await command({ context, args });
|
|
93628
94126
|
}
|
|
93629
94127
|
|
|
@@ -93666,7 +94164,7 @@ function json5({ context, args, data }) {
|
|
|
93666
94164
|
`);
|
|
93667
94165
|
return true;
|
|
93668
94166
|
}
|
|
93669
|
-
function
|
|
94167
|
+
function wordAt9(args, index) {
|
|
93670
94168
|
const word3 = args.words[index];
|
|
93671
94169
|
if (!word3) throw new CliUsageError(SLACK_USAGE);
|
|
93672
94170
|
return word3;
|
|
@@ -93738,7 +94236,7 @@ var linkPrompts = async ({ context, args, client }) => {
|
|
|
93738
94236
|
};
|
|
93739
94237
|
var dismissLinkPrompt = async ({ context, args, client }) => {
|
|
93740
94238
|
const answer6 = await client.post(SLACK_KEY_PATHS.dismissLinkPrompt, {
|
|
93741
|
-
kind:
|
|
94239
|
+
kind: wordAt9(args, 2)
|
|
93742
94240
|
});
|
|
93743
94241
|
if (json5({ context, args, data: answer6 })) return;
|
|
93744
94242
|
printPrompts({ context, answer: answer6 });
|
|
@@ -93768,7 +94266,7 @@ var profiles = async ({ context, args, client }) => {
|
|
|
93768
94266
|
};
|
|
93769
94267
|
var bookmarks = async ({ context, args, client }) => {
|
|
93770
94268
|
const answer6 = await client.post(SLACK_KEY_PATHS.bookmarks, {
|
|
93771
|
-
channelId:
|
|
94269
|
+
channelId: wordAt9(args, 2)
|
|
93772
94270
|
});
|
|
93773
94271
|
if (json5({ context, args, data: answer6 })) return;
|
|
93774
94272
|
if (answer6.bookmarks.length === 0) return context.out("No bookmarks.\n");
|
|
@@ -93777,8 +94275,8 @@ var bookmarks = async ({ context, args, client }) => {
|
|
|
93777
94275
|
};
|
|
93778
94276
|
var dm = async ({ context, args, client }) => {
|
|
93779
94277
|
const opened = await client.post(SLACK_KEY_PATHS.direct, {
|
|
93780
|
-
teamId:
|
|
93781
|
-
slackUserId:
|
|
94278
|
+
teamId: wordAt9(args, 2),
|
|
94279
|
+
slackUserId: wordAt9(args, 3)
|
|
93782
94280
|
});
|
|
93783
94281
|
if (json5({ context, args, data: opened })) return;
|
|
93784
94282
|
context.out(`${opened.channelId}
|
|
@@ -93815,7 +94313,7 @@ var credentials = async ({ context, args, client }) => {
|
|
|
93815
94313
|
const clientId = flagText({ args, name: "client-id" });
|
|
93816
94314
|
if (!appId || !clientId) throw new CliUsageError(SLACK_USAGE);
|
|
93817
94315
|
const secrets = await secretsOf2({ context, args, fields: ["clientSecret", "signingSecret"] });
|
|
93818
|
-
const body = { appKey:
|
|
94316
|
+
const body = { appKey: wordAt9(args, 2), appId, clientId, ...secrets };
|
|
93819
94317
|
await authorizeRun2(
|
|
93820
94318
|
SLACK_KEY_PATHS.credentials,
|
|
93821
94319
|
"Open this link to install the app",
|
|
@@ -93823,7 +94321,7 @@ var credentials = async ({ context, args, client }) => {
|
|
|
93823
94321
|
)({ context, args, client });
|
|
93824
94322
|
};
|
|
93825
94323
|
var updateApp = async ({ context, args, client }) => {
|
|
93826
|
-
const teamId =
|
|
94324
|
+
const teamId = wordAt9(args, 2);
|
|
93827
94325
|
const secrets = await secretsOf2({ context, args, fields: ["configToken"] });
|
|
93828
94326
|
const answer6 = await client.post(SLACK_KEY_PATHS.updateApp, {
|
|
93829
94327
|
teamId,
|
|
@@ -93835,7 +94333,7 @@ var updateApp = async ({ context, args, client }) => {
|
|
|
93835
94333
|
};
|
|
93836
94334
|
var channels2 = async ({ context, args, client }) => {
|
|
93837
94335
|
const rows = await client.post(SLACK_KEY_PATHS.channels, {
|
|
93838
|
-
teamId:
|
|
94336
|
+
teamId: wordAt9(args, 2)
|
|
93839
94337
|
});
|
|
93840
94338
|
if (json5({ context, args, data: rows })) return;
|
|
93841
94339
|
for (const row of rows) {
|
|
@@ -93845,9 +94343,9 @@ var channels2 = async ({ context, args, client }) => {
|
|
|
93845
94343
|
}
|
|
93846
94344
|
};
|
|
93847
94345
|
function mirrorBody(args) {
|
|
93848
|
-
const state =
|
|
94346
|
+
const state = wordAt9(args, 4);
|
|
93849
94347
|
if (state !== "on" && state !== "off") throw new CliUsageError(SLACK_USAGE);
|
|
93850
|
-
return { teamId:
|
|
94348
|
+
return { teamId: wordAt9(args, 2), slackChannelId: wordAt9(args, 3), mirrored: state === "on" };
|
|
93851
94349
|
}
|
|
93852
94350
|
function numberFlag3(args, name3) {
|
|
93853
94351
|
const text3 = flagText({ args, name: name3 });
|
|
@@ -93861,14 +94359,14 @@ function updateBody2(args) {
|
|
|
93861
94359
|
const cacheDays = numberFlag3(args, "cache-days");
|
|
93862
94360
|
const readBudgetPages = numberFlag3(args, "read-budget");
|
|
93863
94361
|
return {
|
|
93864
|
-
teamId:
|
|
94362
|
+
teamId: wordAt9(args, 2),
|
|
93865
94363
|
...label3 && { label: label3 === "none" ? null : label3 },
|
|
93866
94364
|
...cacheDays !== void 0 && { cacheDays },
|
|
93867
94365
|
...readBudgetPages !== void 0 && { readBudgetPages }
|
|
93868
94366
|
};
|
|
93869
94367
|
}
|
|
93870
94368
|
var disconnect4 = async ({ context, args, client }) => {
|
|
93871
|
-
const teamId =
|
|
94369
|
+
const teamId = wordAt9(args, 2);
|
|
93872
94370
|
const answer6 = await client.post(SLACK_KEY_PATHS.disconnect, { teamId });
|
|
93873
94371
|
if (json5({ context, args, data: answer6 })) return;
|
|
93874
94372
|
context.out(`Disconnected ${teamId}.
|
|
@@ -93887,8 +94385,8 @@ var moves = async ({ context, args, client }) => {
|
|
|
93887
94385
|
};
|
|
93888
94386
|
var movePreview = async ({ context, args, client }) => {
|
|
93889
94387
|
const preview = await client.post(SLACK_KEY_PATHS.movePreview, {
|
|
93890
|
-
teamId:
|
|
93891
|
-
slackChannelId:
|
|
94388
|
+
teamId: wordAt9(args, 2),
|
|
94389
|
+
slackChannelId: wordAt9(args, 3)
|
|
93892
94390
|
});
|
|
93893
94391
|
if (json5({ context, args, data: preview })) return;
|
|
93894
94392
|
context.out(`#${preview.slackName} -> #${preview.name} ${preview.linkedMembers} members move
|
|
@@ -93909,7 +94407,7 @@ function moveBody(args) {
|
|
|
93909
94407
|
const farewell = flagText({ args, name: "farewell" });
|
|
93910
94408
|
const invite4 = args.lists.invite ?? [];
|
|
93911
94409
|
return {
|
|
93912
|
-
teamId:
|
|
94410
|
+
teamId: wordAt9(args, 2),
|
|
93913
94411
|
channels: ids.map((slackChannelId) => ({
|
|
93914
94412
|
slackChannelId,
|
|
93915
94413
|
...name3 && { name: name3 },
|
|
@@ -93929,12 +94427,12 @@ var move2 = async ({ context, args, client }) => {
|
|
|
93929
94427
|
};
|
|
93930
94428
|
var cancelMove = async ({ context, args, client }) => {
|
|
93931
94429
|
const moved = await client.post(SLACK_KEY_PATHS.cancelMove, {
|
|
93932
|
-
moveId:
|
|
94430
|
+
moveId: wordAt9(args, 2)
|
|
93933
94431
|
});
|
|
93934
94432
|
if (json5({ context, args, data: moved })) return;
|
|
93935
94433
|
printMove({ context, move: moved });
|
|
93936
94434
|
};
|
|
93937
|
-
var teamOf = (args) => ({ teamId:
|
|
94435
|
+
var teamOf = (args) => ({ teamId: wordAt9(args, 2) });
|
|
93938
94436
|
var RUNS6 = {
|
|
93939
94437
|
overview: overview2,
|
|
93940
94438
|
"link-prompts": linkPrompts,
|
|
@@ -93956,7 +94454,7 @@ var RUNS6 = {
|
|
|
93956
94454
|
"install-app": authorizeRun2(
|
|
93957
94455
|
SLACK_KEY_PATHS.installApp,
|
|
93958
94456
|
"Open this link to install the app",
|
|
93959
|
-
(args) => ({ appKey:
|
|
94457
|
+
(args) => ({ appKey: wordAt9(args, 2) })
|
|
93960
94458
|
),
|
|
93961
94459
|
"update-app": updateApp,
|
|
93962
94460
|
channels: channels2,
|
|
@@ -94234,11 +94732,11 @@ function statusLine2({ presence: presence2 }) {
|
|
|
94234
94732
|
}
|
|
94235
94733
|
|
|
94236
94734
|
// src/services/status-commands.service.ts
|
|
94237
|
-
var
|
|
94735
|
+
var USAGE18 = "Usage: laze status set <emoji> [text] [--for 30m|1h|4h|today|week|never] [--tz <zone>], laze status clear|away|active";
|
|
94238
94736
|
function clearAfterOf({ args }) {
|
|
94239
94737
|
const wanted = flagText({ args, name: "for", fallback: "never" });
|
|
94240
94738
|
const known = STATUS_CLEAR_AFTER.find((candidate) => candidate === wanted);
|
|
94241
|
-
if (!known) throw new CliUsageError(
|
|
94739
|
+
if (!known) throw new CliUsageError(USAGE18);
|
|
94242
94740
|
return known;
|
|
94243
94741
|
}
|
|
94244
94742
|
function answer5({
|
|
@@ -94252,7 +94750,7 @@ function answer5({
|
|
|
94252
94750
|
}
|
|
94253
94751
|
async function statusSet({ context, args }) {
|
|
94254
94752
|
const [, , emoji4, ...words] = args.words;
|
|
94255
|
-
if (!emoji4) throw new CliUsageError(
|
|
94753
|
+
if (!emoji4) throw new CliUsageError(USAGE18);
|
|
94256
94754
|
const clearAfter = clearAfterOf({ args });
|
|
94257
94755
|
const timeZone = flagText({ args, name: "tz" }) || Intl.DateTimeFormat().resolvedOptions().timeZone;
|
|
94258
94756
|
const { client } = await signedIn({ context, args });
|
|
@@ -94276,7 +94774,7 @@ async function statusAway({ context, args }) {
|
|
|
94276
94774
|
answer5({ context, args, presence: presence2 });
|
|
94277
94775
|
}
|
|
94278
94776
|
async function statusUsage() {
|
|
94279
|
-
throw new CliUsageError(
|
|
94777
|
+
throw new CliUsageError(USAGE18);
|
|
94280
94778
|
}
|
|
94281
94779
|
|
|
94282
94780
|
// src/services/update-commands.service.ts
|
|
@@ -95402,7 +95900,7 @@ function json6({ context, args, data }) {
|
|
|
95402
95900
|
`);
|
|
95403
95901
|
return true;
|
|
95404
95902
|
}
|
|
95405
|
-
function
|
|
95903
|
+
function wordAt10(args, index) {
|
|
95406
95904
|
const word3 = args.words[index];
|
|
95407
95905
|
if (!word3) throw new CliUsageError(WHATSAPP_BUSINESS_USAGE);
|
|
95408
95906
|
return word3;
|
|
@@ -95530,7 +96028,7 @@ var conversations = async ({ context, args, client }) => {
|
|
|
95530
96028
|
};
|
|
95531
96029
|
var read2 = async ({ context, args, client }) => {
|
|
95532
96030
|
const answer6 = await client.post(WHATSAPP_BUSINESS_REST_PATHS.read, {
|
|
95533
|
-
contact:
|
|
96031
|
+
contact: wordAt10(args, 2),
|
|
95534
96032
|
...limitOf4(args)
|
|
95535
96033
|
});
|
|
95536
96034
|
if (json6({ context, args, data: answer6 })) return;
|
|
@@ -95551,7 +96049,7 @@ var send3 = async ({ context, args, client }) => {
|
|
|
95551
96049
|
const text3 = args.words.slice(3).join(" ") || args.rest.join(" ");
|
|
95552
96050
|
if (!text3) throw new CliUsageError(WHATSAPP_BUSINESS_USAGE);
|
|
95553
96051
|
const asked = await client.post(WHATSAPP_BUSINESS_REST_PATHS.send, {
|
|
95554
|
-
to:
|
|
96052
|
+
to: wordAt10(args, 2),
|
|
95555
96053
|
text: text3
|
|
95556
96054
|
});
|
|
95557
96055
|
if (!whatsappBusinessSendSettled(asked) && !args.flags.json) context.err(`${asked.outcome}
|
|
@@ -95561,8 +96059,8 @@ var send3 = async ({ context, args, client }) => {
|
|
|
95561
96059
|
var sendTemplate = async ({ context, args, client }) => {
|
|
95562
96060
|
const language = flagText({ args, name: "language" });
|
|
95563
96061
|
const asked = await client.post(WHATSAPP_BUSINESS_REST_PATHS.sendTemplate, {
|
|
95564
|
-
to:
|
|
95565
|
-
template:
|
|
96062
|
+
to: wordAt10(args, 2),
|
|
96063
|
+
template: wordAt10(args, 3),
|
|
95566
96064
|
...language ? { language } : {},
|
|
95567
96065
|
params: flagValues(args, "param"),
|
|
95568
96066
|
confirm: args.flags.yes === true
|
|
@@ -95580,7 +96078,7 @@ Run it again with --yes to send it.
|
|
|
95580
96078
|
};
|
|
95581
96079
|
var sendStatus = async ({ context, args, client }) => {
|
|
95582
96080
|
const answer6 = await client.post(WHATSAPP_BUSINESS_REST_PATHS.sendStatus, {
|
|
95583
|
-
sendId:
|
|
96081
|
+
sendId: wordAt10(args, 2)
|
|
95584
96082
|
});
|
|
95585
96083
|
return printSend({ context, args, send: answer6 });
|
|
95586
96084
|
};
|
|
@@ -95704,7 +96202,7 @@ var WHATSAPP_PAIRING_USAGE = [
|
|
|
95704
96202
|
" laze whatsapp cancel <pairing-id> stop the linking",
|
|
95705
96203
|
" laze whatsapp unpair <machine> unlink WhatsApp from the machine (owner)"
|
|
95706
96204
|
].join("\n");
|
|
95707
|
-
function
|
|
96205
|
+
function wordAt11({ args, at }) {
|
|
95708
96206
|
const value = args.words[at];
|
|
95709
96207
|
if (!value) throw new CliUsageError(`Usage:
|
|
95710
96208
|
${WHATSAPP_PAIRING_USAGE}`);
|
|
@@ -95734,13 +96232,13 @@ async function report2({ context, args, pairing: pairing2 }) {
|
|
|
95734
96232
|
`);
|
|
95735
96233
|
}
|
|
95736
96234
|
async function pair({ context, args }) {
|
|
95737
|
-
const machine2 =
|
|
96235
|
+
const machine2 = wordAt11({ args, at: 2 });
|
|
95738
96236
|
const client = await computeClient({ context, args });
|
|
95739
96237
|
const pairing2 = await client.post(COMPUTE_WHATSAPP_REST_PATHS.pair, { machine: machine2 });
|
|
95740
96238
|
await report2({ context, args, pairing: pairing2 });
|
|
95741
96239
|
}
|
|
95742
96240
|
async function pairing({ context, args }) {
|
|
95743
|
-
const pairingId =
|
|
96241
|
+
const pairingId = wordAt11({ args, at: 2 });
|
|
95744
96242
|
const client = await computeClient({ context, args });
|
|
95745
96243
|
const answer6 = await client.post(COMPUTE_WHATSAPP_REST_PATHS.pairing, {
|
|
95746
96244
|
pairingId
|
|
@@ -95748,7 +96246,7 @@ async function pairing({ context, args }) {
|
|
|
95748
96246
|
await report2({ context, args, pairing: answer6 });
|
|
95749
96247
|
}
|
|
95750
96248
|
async function cancel3({ context, args }) {
|
|
95751
|
-
const pairingId =
|
|
96249
|
+
const pairingId = wordAt11({ args, at: 2 });
|
|
95752
96250
|
const client = await computeClient({ context, args });
|
|
95753
96251
|
const answer6 = await client.post(COMPUTE_WHATSAPP_REST_PATHS.cancelPairing, {
|
|
95754
96252
|
pairingId
|
|
@@ -95759,7 +96257,7 @@ async function cancel3({ context, args }) {
|
|
|
95759
96257
|
`);
|
|
95760
96258
|
}
|
|
95761
96259
|
async function unpair({ context, args }) {
|
|
95762
|
-
const machine2 =
|
|
96260
|
+
const machine2 = wordAt11({ args, at: 2 });
|
|
95763
96261
|
const client = await computeClient({ context, args });
|
|
95764
96262
|
const answer6 = await client.post(COMPUTE_WHATSAPP_REST_PATHS.unpair, { machine: machine2 });
|
|
95765
96263
|
if (args.flags.json) return context.out(`${JSON.stringify(answer6, null, 2)}
|
|
@@ -95767,9 +96265,9 @@ async function unpair({ context, args }) {
|
|
|
95767
96265
|
context.out(`WhatsApp is unlinked from ${answer6.name}.
|
|
95768
96266
|
`);
|
|
95769
96267
|
}
|
|
95770
|
-
var
|
|
96268
|
+
var COMMANDS3 = { pair, pairing, cancel: cancel3, unpair };
|
|
95771
96269
|
function whatsappPairingCommand(name3) {
|
|
95772
|
-
return name3 && Object.hasOwn(
|
|
96270
|
+
return name3 && Object.hasOwn(COMMANDS3, name3) ? COMMANDS3[name3] : void 0;
|
|
95773
96271
|
}
|
|
95774
96272
|
|
|
95775
96273
|
// src/services/whatsapp-commands.service.ts
|
|
@@ -95782,7 +96280,7 @@ var PATHS3 = {
|
|
|
95782
96280
|
var STATUS_WAIT_SECONDS2 = 50;
|
|
95783
96281
|
var STATUS_CALLS2 = 2;
|
|
95784
96282
|
var SETTLED = /* @__PURE__ */ new Set(["sent", "denied", "expired", "failed"]);
|
|
95785
|
-
var
|
|
96283
|
+
var USAGE19 = [
|
|
95786
96284
|
"Usage: laze whatsapp chats <machine> [--limit <n>] the chats on the machine, newest first",
|
|
95787
96285
|
" laze whatsapp read <machine> <chat> [--limit <n>] a chat's last messages, oldest first",
|
|
95788
96286
|
' laze whatsapp send <machine> <chat> "<text>" send as the owner; an agent waits for their approval',
|
|
@@ -95792,14 +96290,14 @@ var USAGE18 = [
|
|
|
95792
96290
|
].join("\n");
|
|
95793
96291
|
function word2({ args, at }) {
|
|
95794
96292
|
const value = args.words[at];
|
|
95795
|
-
if (!value) throw new CliUsageError(
|
|
96293
|
+
if (!value) throw new CliUsageError(USAGE19);
|
|
95796
96294
|
return value;
|
|
95797
96295
|
}
|
|
95798
96296
|
function limitOf5({ args }) {
|
|
95799
96297
|
const text3 = flagText({ args, name: "limit" });
|
|
95800
96298
|
if (!text3) return {};
|
|
95801
96299
|
const limit = Number(text3);
|
|
95802
|
-
if (!Number.isInteger(limit) || limit < 1) throw new CliUsageError(
|
|
96300
|
+
if (!Number.isInteger(limit) || limit < 1) throw new CliUsageError(USAGE19);
|
|
95803
96301
|
return { limit };
|
|
95804
96302
|
}
|
|
95805
96303
|
async function chats({ context, args }) {
|
|
@@ -95861,7 +96359,7 @@ Still waiting. Run \`laze whatsapp status ${send5.id}\` later to see the answer.
|
|
|
95861
96359
|
}
|
|
95862
96360
|
async function send4({ context, args }) {
|
|
95863
96361
|
const text3 = args.words.slice(4).join(" ") || args.rest.join(" ");
|
|
95864
|
-
if (!text3) throw new CliUsageError(
|
|
96362
|
+
if (!text3) throw new CliUsageError(USAGE19);
|
|
95865
96363
|
const client = await computeClient({ context, args });
|
|
95866
96364
|
const asked = await client.post(PATHS3.send, {
|
|
95867
96365
|
machine: word2({ args, at: 2 }),
|
|
@@ -95891,11 +96389,11 @@ async function whatsapp({
|
|
|
95891
96389
|
if (command === "status") return status10({ context, args });
|
|
95892
96390
|
const linking = whatsappPairingCommand(command);
|
|
95893
96391
|
if (linking) return linking({ context, args });
|
|
95894
|
-
throw new CliUsageError(
|
|
96392
|
+
throw new CliUsageError(USAGE19);
|
|
95895
96393
|
}
|
|
95896
96394
|
|
|
95897
96395
|
// src/services/wiki-commands.service.ts
|
|
95898
|
-
var
|
|
96396
|
+
var USAGE20 = `Usage:
|
|
95899
96397
|
laze wiki list
|
|
95900
96398
|
laze wiki get <path>
|
|
95901
96399
|
laze wiki put <path> <markdown|@file|-> [--title <title>] [--channel <channel>] [--base <version>]
|
|
@@ -95915,7 +96413,7 @@ async function wikiList({ context, args }) {
|
|
|
95915
96413
|
}
|
|
95916
96414
|
async function wikiGet({ context, args }) {
|
|
95917
96415
|
const path = args.words[2];
|
|
95918
|
-
if (!path) throw new CliUsageError(
|
|
96416
|
+
if (!path) throw new CliUsageError(USAGE20);
|
|
95919
96417
|
const { client } = await signedIn({ context, args });
|
|
95920
96418
|
const page = await client.post("/api/wiki/get", { path });
|
|
95921
96419
|
if (args.flags.json) return context.out(`${JSON.stringify(page, null, 2)}
|
|
@@ -95932,7 +96430,7 @@ Linked from: ${page.backlinks.map((link2) => link2.path).join(", ")}
|
|
|
95932
96430
|
async function wikiPut({ context, args }) {
|
|
95933
96431
|
const path = args.words[2];
|
|
95934
96432
|
const value = args.words.slice(3).join(" ");
|
|
95935
|
-
if (!path || !value) throw new CliUsageError(
|
|
96433
|
+
if (!path || !value) throw new CliUsageError(USAGE20);
|
|
95936
96434
|
const body = await textArgument({ context, value });
|
|
95937
96435
|
const title = flagText({ args, name: "title" });
|
|
95938
96436
|
const channel = flagText({ args, name: "channel" });
|
|
@@ -95952,7 +96450,7 @@ async function wikiPut({ context, args }) {
|
|
|
95952
96450
|
}
|
|
95953
96451
|
async function wikiSearch({ context, args }) {
|
|
95954
96452
|
const query = args.words.slice(2).join(" ").trim();
|
|
95955
|
-
if (!query) throw new CliUsageError(
|
|
96453
|
+
if (!query) throw new CliUsageError(USAGE20);
|
|
95956
96454
|
const { client } = await signedIn({ context, args });
|
|
95957
96455
|
const hits = await client.post("/api/wiki/search", { query });
|
|
95958
96456
|
if (args.flags.json) return context.out(`${JSON.stringify(hits, null, 2)}
|
|
@@ -95962,7 +96460,7 @@ async function wikiSearch({ context, args }) {
|
|
|
95962
96460
|
}
|
|
95963
96461
|
async function wikiHistory({ context, args }) {
|
|
95964
96462
|
const path = args.words[2];
|
|
95965
|
-
if (!path) throw new CliUsageError(
|
|
96463
|
+
if (!path) throw new CliUsageError(USAGE20);
|
|
95966
96464
|
const { client } = await signedIn({ context, args });
|
|
95967
96465
|
const revisions = await client.post("/api/wiki/history", { path });
|
|
95968
96466
|
if (args.flags.json) return context.out(`${JSON.stringify(revisions, null, 2)}
|
|
@@ -95976,7 +96474,7 @@ async function wikiHistory({ context, args }) {
|
|
|
95976
96474
|
}
|
|
95977
96475
|
async function wikiMove({ context, args }) {
|
|
95978
96476
|
const [, , path, to] = args.words;
|
|
95979
|
-
if (!path || !to) throw new CliUsageError(
|
|
96477
|
+
if (!path || !to) throw new CliUsageError(USAGE20);
|
|
95980
96478
|
const { client } = await signedIn({ context, args });
|
|
95981
96479
|
const page = await client.post("/api/wiki/move", { path, to });
|
|
95982
96480
|
if (args.flags.json) return context.out(`${JSON.stringify(page, null, 2)}
|
|
@@ -95986,7 +96484,7 @@ async function wikiMove({ context, args }) {
|
|
|
95986
96484
|
}
|
|
95987
96485
|
async function wikiRemove({ context, args }) {
|
|
95988
96486
|
const path = args.words[2];
|
|
95989
|
-
if (!path) throw new CliUsageError(
|
|
96487
|
+
if (!path) throw new CliUsageError(USAGE20);
|
|
95990
96488
|
const { client } = await signedIn({ context, args });
|
|
95991
96489
|
const removed = await client.post("/api/wiki/remove", { path });
|
|
95992
96490
|
if (args.flags.json) return context.out(`${JSON.stringify(removed)}
|
|
@@ -96006,7 +96504,7 @@ var WIKI_COMMANDS = {
|
|
|
96006
96504
|
async function wiki({ context, args }) {
|
|
96007
96505
|
const name3 = args.words[1] ?? "";
|
|
96008
96506
|
const command = Object.hasOwn(WIKI_COMMANDS, name3) ? WIKI_COMMANDS[name3] : void 0;
|
|
96009
|
-
if (!command) throw new CliUsageError(
|
|
96507
|
+
if (!command) throw new CliUsageError(USAGE20);
|
|
96010
96508
|
await command({ context, args });
|
|
96011
96509
|
}
|
|
96012
96510
|
|
|
@@ -96126,6 +96624,10 @@ var HELP = `laze: work in a Laze workspace from your terminal or your agent.
|
|
|
96126
96624
|
laze members role <member> owner|admin|member|guest change a member's role (admins)
|
|
96127
96625
|
laze members remove <member> take someone out of the workspace (admins)
|
|
96128
96626
|
laze members requests | approve <id> | deny <id> access requests waiting for an admin
|
|
96627
|
+
laze groups [list] the workspace's groups and who is in each
|
|
96628
|
+
laze groups create <name> [--person <member>].. a group of people (admins)
|
|
96629
|
+
laze groups rename <group> <name> | delete <group> rename one, or delete it and take back what it shared (admins)
|
|
96630
|
+
laze groups add|remove <group> --person <member>.. change who is in it (admins)
|
|
96129
96631
|
laze channels list the conversations you are in, with your setting
|
|
96130
96632
|
laze channel set <channel> everything|mentions what of a channel reaches your agent
|
|
96131
96633
|
laze channel mute <channel> --reason "<why>" [--for 30m|2h|1d] stop hearing a noisy channel unless named (agents)
|
|
@@ -96144,6 +96646,9 @@ var HELP = `laze: work in a Laze workspace from your terminal or your agent.
|
|
|
96144
96646
|
laze channel default <channel> <agent>|--clear the agent that answers unnamed messages (channel admins)
|
|
96145
96647
|
laze channel archive|unarchive <channel> freeze a channel or bring it back (channel admins)
|
|
96146
96648
|
laze channel add <channel> <member>... add people or agents to a channel (people)
|
|
96649
|
+
laze channel add-group <channel> <group> add a group; its people follow it in and out (people)
|
|
96650
|
+
laze channel remove-group <channel> <group> take a group out, with the people it brought (people)
|
|
96651
|
+
laze channel groups <channel> list the groups in a channel
|
|
96147
96652
|
laze channel remove <channel> <member> take a member out of a channel (channel admins)
|
|
96148
96653
|
laze channel notify <channel> default|all|mentions|nothing|mute|unmute [--until <time>] your notifications
|
|
96149
96654
|
laze channel hide <channel> out of your sidebar until a new message lands there
|
|
@@ -96201,7 +96706,7 @@ var HELP = `laze: work in a Laze workspace from your terminal or your agent.
|
|
|
96201
96706
|
laze memory get|set|append|history <file>, search, pull SOUL.md, AGENTS.md, a channel's MEMORY.md
|
|
96202
96707
|
laze wiki list|get|put|search|history|mv|rm the workspace wiki
|
|
96203
96708
|
laze skill list|install|show|pull|rm|update|pin|unpin your agent's skills and the catalogue
|
|
96204
|
-
laze app create <name>
|
|
96709
|
+
laze app create <name> ... build an app from scratch (--template slides for a deck), push, revert
|
|
96205
96710
|
laze app every laze app command, with its flags
|
|
96206
96711
|
laze agents list | laze agents status <name> the workspace's agents and their context
|
|
96207
96712
|
laze agents show <name> [--json] an agent's profile: kind, how it runs, intelligence
|
|
@@ -96231,7 +96736,7 @@ var HELP = `laze: work in a Laze workspace from your terminal or your agent.
|
|
|
96231
96736
|
laze agent runs-on <agent> laze|claude|codex [--pool <pool>] moves it to Laze credits, Claude Code or Codex
|
|
96232
96737
|
laze agent access|dm|disconnect <agent> who can talk to it, your conversation with it, revoke its key
|
|
96233
96738
|
laze agent permission-prompts <agent> each permission prompt its harness raised and rush's answer
|
|
96234
|
-
laze agent share|unshare <agent> --person <userId> | --channel <channelId> share it (its owner)
|
|
96739
|
+
laze agent share|unshare <agent> --person <userId> | --group <groupId> | --channel <channelId> share it (its owner)
|
|
96235
96740
|
laze agent stop <agent> --channel <channelId> stop its running turn there
|
|
96236
96741
|
laze agent retry <agent> --channel <id> --message <id> Try again on its failed turn on that message
|
|
96237
96742
|
laze agent invite [--name <name>] [--channel <id>] a one-time link that connects a new agent;
|
|
@@ -96343,7 +96848,7 @@ Every command takes --profile <name> and --json where it prints data.
|
|
|
96343
96848
|
async function conversationUsage({ context }) {
|
|
96344
96849
|
context.out(CONVERSATION_USAGE);
|
|
96345
96850
|
}
|
|
96346
|
-
var
|
|
96851
|
+
var COMMANDS4 = {
|
|
96347
96852
|
login,
|
|
96348
96853
|
join: joinAsAgent,
|
|
96349
96854
|
logout,
|
|
@@ -96352,6 +96857,7 @@ var COMMANDS3 = {
|
|
|
96352
96857
|
workspaces,
|
|
96353
96858
|
workspace,
|
|
96354
96859
|
members: members2,
|
|
96860
|
+
groups,
|
|
96355
96861
|
invite: invite3,
|
|
96356
96862
|
update: update2,
|
|
96357
96863
|
"channels list": listChannels,
|
|
@@ -96378,6 +96884,9 @@ var COMMANDS3 = {
|
|
|
96378
96884
|
"channel archive": channelArchive,
|
|
96379
96885
|
"channel unarchive": channelUnarchive,
|
|
96380
96886
|
"channel add": channelAdd,
|
|
96887
|
+
"channel add-group": channelAddGroup,
|
|
96888
|
+
"channel remove-group": channelRemoveGroup,
|
|
96889
|
+
"channel groups": channelGroups,
|
|
96381
96890
|
"channel remove": channelRemove,
|
|
96382
96891
|
"channel notify": channelNotify,
|
|
96383
96892
|
"channel hide": channelHide,
|
|
@@ -96529,7 +97038,7 @@ var COMMANDS3 = {
|
|
|
96529
97038
|
};
|
|
96530
97039
|
function commandOf(args) {
|
|
96531
97040
|
const [first = "", second = ""] = args.words;
|
|
96532
|
-
return
|
|
97041
|
+
return COMMANDS4[`${first} ${second}`] ?? COMMANDS4[first];
|
|
96533
97042
|
}
|
|
96534
97043
|
async function runCli({
|
|
96535
97044
|
argv,
|