@lazehq/cli 0.1.97 → 0.1.98
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 +22 -11
- package/package.json +1 -1
package/dist/laze.mjs
CHANGED
|
@@ -3244,7 +3244,7 @@ var require_websocket = __commonJS({
|
|
|
3244
3244
|
var http = __require("http");
|
|
3245
3245
|
var net = __require("net");
|
|
3246
3246
|
var tls = __require("tls");
|
|
3247
|
-
var { randomBytes:
|
|
3247
|
+
var { randomBytes: randomBytes7, createHash: createHash9 } = __require("crypto");
|
|
3248
3248
|
var { Duplex, Readable: Readable2 } = __require("stream");
|
|
3249
3249
|
var { URL: URL3 } = __require("url");
|
|
3250
3250
|
var PerMessageDeflate2 = require_permessage_deflate();
|
|
@@ -3782,7 +3782,7 @@ var require_websocket = __commonJS({
|
|
|
3782
3782
|
}
|
|
3783
3783
|
}
|
|
3784
3784
|
const defaultPort = isSecure ? 443 : 80;
|
|
3785
|
-
const key =
|
|
3785
|
+
const key = randomBytes7(16).toString("base64");
|
|
3786
3786
|
const request2 = isSecure ? https.request : http.request;
|
|
3787
3787
|
const protocolSet = /* @__PURE__ */ new Set();
|
|
3788
3788
|
let perMessageDeflate;
|
|
@@ -36960,7 +36960,7 @@ function shadowedLinkLineOf({ shadow }) {
|
|
|
36960
36960
|
}
|
|
36961
36961
|
|
|
36962
36962
|
// src/rules/cli-version.rules.ts
|
|
36963
|
-
var STAMPED = "0.1.
|
|
36963
|
+
var STAMPED = "0.1.98";
|
|
36964
36964
|
function cliVersionOf({ stamped = STAMPED } = {}) {
|
|
36965
36965
|
return stamped.startsWith("__") ? "dev" : stamped;
|
|
36966
36966
|
}
|
|
@@ -63416,7 +63416,9 @@ var createChannelInputSchemaDefinition = external_exports.object({
|
|
|
63416
63416
|
/** An agent creator's name, kept on its membership so notices name it. */
|
|
63417
63417
|
creatorName: external_exports.string().trim().min(1).max(80).optional(),
|
|
63418
63418
|
/** Sent by older clients and ignored: new channels never end on their own. */
|
|
63419
|
-
endsAt: external_exports.iso.datetime().optional()
|
|
63419
|
+
endsAt: external_exports.iso.datetime().optional(),
|
|
63420
|
+
/** The same key on every try of one create: a repeat answers the channel the first one made. */
|
|
63421
|
+
clientKey: external_exports.string().regex(/^[A-Za-z0-9_-]{8,64}$/).optional()
|
|
63420
63422
|
});
|
|
63421
63423
|
var createChannelInputSchema = createChannelInputSchemaDefinition;
|
|
63422
63424
|
var CHANNEL_TOPIC_MAX = 250;
|
|
@@ -63514,7 +63516,9 @@ var openChatInputSchemaDefinition = external_exports.object({
|
|
|
63514
63516
|
id: idSchema4,
|
|
63515
63517
|
name: external_exports.string().min(1).max(80),
|
|
63516
63518
|
runsOutside: external_exports.boolean().optional()
|
|
63517
|
-
})
|
|
63519
|
+
}),
|
|
63520
|
+
/** The first message's client key: the conversation already started with it is answered again. */
|
|
63521
|
+
startKey: external_exports.string().regex(/^[A-Za-z0-9_-]{8,64}$/).optional()
|
|
63518
63522
|
});
|
|
63519
63523
|
var renameChatInputSchemaDefinition = external_exports.object({
|
|
63520
63524
|
workspaceId: workspaceIdSchema,
|
|
@@ -70325,7 +70329,9 @@ var createChannelAsCallerInputSchemaDefinition = external_exports.object({
|
|
|
70325
70329
|
visibility: external_exports.enum(["public", "private"]).default("public"),
|
|
70326
70330
|
topic: external_exports.string().trim().max(250).default(""),
|
|
70327
70331
|
/** Sent by older CLIs and ignored: new channels never end on their own. */
|
|
70328
|
-
temporary: external_exports.enum(CALLER_CHANNEL_DURATIONS).optional()
|
|
70332
|
+
temporary: external_exports.enum(CALLER_CHANNEL_DURATIONS).optional(),
|
|
70333
|
+
/** One key per `laze channel create`: a retry answers the channel the first try made. */
|
|
70334
|
+
clientKey: external_exports.string().regex(/^[A-Za-z0-9_-]{8,64}$/).optional()
|
|
70329
70335
|
});
|
|
70330
70336
|
var extendChannelAsCallerInputSchemaDefinition = external_exports.object({
|
|
70331
70337
|
channel: channelRefSchema,
|
|
@@ -85002,6 +85008,9 @@ async function browser({
|
|
|
85002
85008
|
throw new CliUsageError(BROWSER_USAGE);
|
|
85003
85009
|
}
|
|
85004
85010
|
|
|
85011
|
+
// src/services/channel-admin-commands.service.ts
|
|
85012
|
+
import { randomBytes as randomBytes4 } from "node:crypto";
|
|
85013
|
+
|
|
85005
85014
|
// src/rules/channel-format.rules.ts
|
|
85006
85015
|
function channelLabelOf(detail) {
|
|
85007
85016
|
return detail.kind === "public" || detail.kind === "private" ? `#${detail.name}` : "(direct)";
|
|
@@ -85224,6 +85233,7 @@ async function channelCreate({
|
|
|
85224
85233
|
const name3 = args.words[2];
|
|
85225
85234
|
if (!name3) throw new CliUsageError(CREATE_USAGE2);
|
|
85226
85235
|
const { client, profile } = await signedIn({ context, args });
|
|
85236
|
+
const clientKey = `ck_${randomBytes4(12).toString("hex")}`;
|
|
85227
85237
|
return changing({
|
|
85228
85238
|
context,
|
|
85229
85239
|
profile,
|
|
@@ -85231,7 +85241,8 @@ async function channelCreate({
|
|
|
85231
85241
|
const detail = await client.post("/api/agents/me/channels/create", {
|
|
85232
85242
|
name: name3.replace(/^#/, ""),
|
|
85233
85243
|
visibility: args.flags.private ? "private" : "public",
|
|
85234
|
-
topic: flagText({ args, name: "topic" })
|
|
85244
|
+
topic: flagText({ args, name: "topic" }),
|
|
85245
|
+
clientKey
|
|
85235
85246
|
});
|
|
85236
85247
|
if (args.flags.json) return context.out(`${JSON.stringify(detail, null, 2)}
|
|
85237
85248
|
`);
|
|
@@ -96269,7 +96280,7 @@ async function openclaw({
|
|
|
96269
96280
|
}
|
|
96270
96281
|
|
|
96271
96282
|
// src/services/operator-key-commands.service.ts
|
|
96272
|
-
import { createHash as createHash7, randomBytes as
|
|
96283
|
+
import { createHash as createHash7, randomBytes as randomBytes5 } from "node:crypto";
|
|
96273
96284
|
import { mkdir as mkdir11, readFile as readFile31, rm as rm18, writeFile as writeFile9 } from "node:fs/promises";
|
|
96274
96285
|
import { dirname as dirname22, join as join31 } from "node:path";
|
|
96275
96286
|
|
|
@@ -97701,7 +97712,7 @@ async function requestKey({ context, args }) {
|
|
|
97701
97712
|
const reason2 = flagText({ args, name: "reason" });
|
|
97702
97713
|
if (!action || !target || !reason2.trim()) throw new CliUsageError(OPERATOR_KEY_USAGE);
|
|
97703
97714
|
const { client } = await signedIn({ context, args });
|
|
97704
|
-
const secret =
|
|
97715
|
+
const secret = randomBytes5(32).toString("hex");
|
|
97705
97716
|
const key = await client.post(OPERATOR_KEY_REST_PATHS.request, {
|
|
97706
97717
|
action,
|
|
97707
97718
|
target,
|
|
@@ -101329,7 +101340,7 @@ import {
|
|
|
101329
101340
|
createHash as createHash8,
|
|
101330
101341
|
createPrivateKey,
|
|
101331
101342
|
generateKeyPairSync,
|
|
101332
|
-
randomBytes as
|
|
101343
|
+
randomBytes as randomBytes6,
|
|
101333
101344
|
sign
|
|
101334
101345
|
} from "node:crypto";
|
|
101335
101346
|
import { chmod, link, mkdir as mkdir12, readFile as readFile37, rm as rm21, writeFile as writeFile11 } from "node:fs/promises";
|
|
@@ -101491,7 +101502,7 @@ function keyOf2({ meta: meta3, privateKey }) {
|
|
|
101491
101502
|
}
|
|
101492
101503
|
var shortOf = (jwk) => thumbprintOf({ jwk }).slice(0, 12);
|
|
101493
101504
|
async function writeOnce({ path, text: text3 }) {
|
|
101494
|
-
const temporary = `${path}.${process.pid}.${
|
|
101505
|
+
const temporary = `${path}.${process.pid}.${randomBytes6(6).toString("hex")}.tmp`;
|
|
101495
101506
|
await writePrivate({ path: temporary, text: text3 });
|
|
101496
101507
|
try {
|
|
101497
101508
|
await link(temporary, path);
|
package/package.json
CHANGED