@lazehq/cli 0.1.61 → 0.1.62
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 +164 -83
- package/package.json +1 -1
package/dist/laze.mjs
CHANGED
|
@@ -6721,14 +6721,14 @@ var require_connect = __commonJS({
|
|
|
6721
6721
|
const sessionCache = new SessionCache(maxCachedSessions == null ? 100 : maxCachedSessions);
|
|
6722
6722
|
timeout = timeout == null ? 1e4 : timeout;
|
|
6723
6723
|
allowH2 = allowH2 != null ? allowH2 : true;
|
|
6724
|
-
return function connect7({ hostname:
|
|
6724
|
+
return function connect7({ hostname: hostname7, host: host2, protocol, port, servername, localAddress, httpSocket }, callback) {
|
|
6725
6725
|
let socket;
|
|
6726
6726
|
if (protocol === "https:") {
|
|
6727
6727
|
if (!tls) {
|
|
6728
6728
|
tls = __require("node:tls");
|
|
6729
6729
|
}
|
|
6730
6730
|
servername = servername || options.servername || util.getServerName(host2) || null;
|
|
6731
|
-
const sessionKey = servername ||
|
|
6731
|
+
const sessionKey = servername || hostname7;
|
|
6732
6732
|
assert2(sessionKey);
|
|
6733
6733
|
const session = customSession || sessionCache.get(sessionKey) || null;
|
|
6734
6734
|
port = port || 443;
|
|
@@ -6743,7 +6743,7 @@ var require_connect = __commonJS({
|
|
|
6743
6743
|
socket: httpSocket,
|
|
6744
6744
|
// upgrade socket connection
|
|
6745
6745
|
port,
|
|
6746
|
-
host:
|
|
6746
|
+
host: hostname7
|
|
6747
6747
|
});
|
|
6748
6748
|
socket.on("session", function(session2) {
|
|
6749
6749
|
sessionCache.set(sessionKey, session2);
|
|
@@ -6757,16 +6757,16 @@ var require_connect = __commonJS({
|
|
|
6757
6757
|
...options,
|
|
6758
6758
|
localAddress,
|
|
6759
6759
|
port,
|
|
6760
|
-
host:
|
|
6760
|
+
host: hostname7
|
|
6761
6761
|
};
|
|
6762
|
-
const family = net.isIP(
|
|
6763
|
-
if (family !== 0 && servername && servername !==
|
|
6762
|
+
const family = net.isIP(hostname7);
|
|
6763
|
+
if (family !== 0 && servername && servername !== hostname7) {
|
|
6764
6764
|
connectOptions.host = servername;
|
|
6765
6765
|
connectOptions.lookup = (_hostname, lookupOptions, cb) => {
|
|
6766
6766
|
if (lookupOptions.all) {
|
|
6767
|
-
cb(null, [{ address:
|
|
6767
|
+
cb(null, [{ address: hostname7, family }]);
|
|
6768
6768
|
} else {
|
|
6769
|
-
cb(null,
|
|
6769
|
+
cb(null, hostname7, family);
|
|
6770
6770
|
}
|
|
6771
6771
|
};
|
|
6772
6772
|
}
|
|
@@ -6779,7 +6779,7 @@ var require_connect = __commonJS({
|
|
|
6779
6779
|
const keepAliveInitialDelay = options.keepAliveInitialDelay === void 0 ? 6e4 : options.keepAliveInitialDelay;
|
|
6780
6780
|
socket.setKeepAlive(true, keepAliveInitialDelay);
|
|
6781
6781
|
}
|
|
6782
|
-
const clearConnectTimeout = util.setupConnectTimeout(new WeakRef(socket), { timeout, hostname:
|
|
6782
|
+
const clearConnectTimeout = util.setupConnectTimeout(new WeakRef(socket), { timeout, hostname: hostname7, port });
|
|
6783
6783
|
socket.setNoDelay(true).once(protocol === "https:" ? "secureConnect" : "connect", function() {
|
|
6784
6784
|
queueMicrotask(clearConnectTimeout);
|
|
6785
6785
|
if (callback) {
|
|
@@ -6792,7 +6792,7 @@ var require_connect = __commonJS({
|
|
|
6792
6792
|
if (callback) {
|
|
6793
6793
|
const cb = callback;
|
|
6794
6794
|
callback = null;
|
|
6795
|
-
cb(maybeNormalizeConnectError(err, this, { timeout, hostname:
|
|
6795
|
+
cb(maybeNormalizeConnectError(err, this, { timeout, hostname: hostname7, port }));
|
|
6796
6796
|
}
|
|
6797
6797
|
});
|
|
6798
6798
|
return socket;
|
|
@@ -13344,20 +13344,20 @@ var require_client = __commonJS({
|
|
|
13344
13344
|
function connect7(client) {
|
|
13345
13345
|
assert2(!client[kConnecting]);
|
|
13346
13346
|
assert2(!client[kHTTPContext]);
|
|
13347
|
-
let { host: host2, hostname:
|
|
13348
|
-
if (
|
|
13349
|
-
const idx =
|
|
13347
|
+
let { host: host2, hostname: hostname7, protocol, port } = client[kUrl];
|
|
13348
|
+
if (hostname7[0] === "[") {
|
|
13349
|
+
const idx = hostname7.indexOf("]");
|
|
13350
13350
|
assert2(idx !== -1);
|
|
13351
|
-
const ip2 =
|
|
13351
|
+
const ip2 = hostname7.substring(1, idx);
|
|
13352
13352
|
assert2(net.isIPv6(ip2));
|
|
13353
|
-
|
|
13353
|
+
hostname7 = ip2;
|
|
13354
13354
|
}
|
|
13355
13355
|
client[kConnecting] = true;
|
|
13356
13356
|
if (channels3.beforeConnect.hasSubscribers) {
|
|
13357
13357
|
channels3.beforeConnect.publish({
|
|
13358
13358
|
connectParams: {
|
|
13359
13359
|
host: host2,
|
|
13360
|
-
hostname:
|
|
13360
|
+
hostname: hostname7,
|
|
13361
13361
|
protocol,
|
|
13362
13362
|
port,
|
|
13363
13363
|
version: client[kHTTPContext]?.version,
|
|
@@ -13370,14 +13370,14 @@ var require_client = __commonJS({
|
|
|
13370
13370
|
try {
|
|
13371
13371
|
client[kConnector]({
|
|
13372
13372
|
host: host2,
|
|
13373
|
-
hostname:
|
|
13373
|
+
hostname: hostname7,
|
|
13374
13374
|
protocol,
|
|
13375
13375
|
port,
|
|
13376
13376
|
servername: client[kServerName],
|
|
13377
13377
|
localAddress: client[kLocalAddress]
|
|
13378
13378
|
}, (err, socket) => {
|
|
13379
13379
|
if (err) {
|
|
13380
|
-
handleConnectError(client, err, { host: host2, hostname:
|
|
13380
|
+
handleConnectError(client, err, { host: host2, hostname: hostname7, protocol, port });
|
|
13381
13381
|
client[kResume]();
|
|
13382
13382
|
return;
|
|
13383
13383
|
}
|
|
@@ -13391,7 +13391,7 @@ var require_client = __commonJS({
|
|
|
13391
13391
|
client[kHTTPContext] = socket.alpnProtocol === "h2" ? connectH2(client, socket) : connectH1(client, socket);
|
|
13392
13392
|
} catch (err2) {
|
|
13393
13393
|
socket.destroy().on("error", noop2);
|
|
13394
|
-
handleConnectError(client, err2, { host: host2, hostname:
|
|
13394
|
+
handleConnectError(client, err2, { host: host2, hostname: hostname7, protocol, port });
|
|
13395
13395
|
client[kResume]();
|
|
13396
13396
|
return;
|
|
13397
13397
|
}
|
|
@@ -13404,7 +13404,7 @@ var require_client = __commonJS({
|
|
|
13404
13404
|
channels3.connected.publish({
|
|
13405
13405
|
connectParams: {
|
|
13406
13406
|
host: host2,
|
|
13407
|
-
hostname:
|
|
13407
|
+
hostname: hostname7,
|
|
13408
13408
|
protocol,
|
|
13409
13409
|
port,
|
|
13410
13410
|
version: client[kHTTPContext]?.version,
|
|
@@ -13419,11 +13419,11 @@ var require_client = __commonJS({
|
|
|
13419
13419
|
client[kResume]();
|
|
13420
13420
|
});
|
|
13421
13421
|
} catch (err) {
|
|
13422
|
-
handleConnectError(client, err, { host: host2, hostname:
|
|
13422
|
+
handleConnectError(client, err, { host: host2, hostname: hostname7, protocol, port });
|
|
13423
13423
|
client[kResume]();
|
|
13424
13424
|
}
|
|
13425
13425
|
}
|
|
13426
|
-
function handleConnectError(client, err, { host: host2, hostname:
|
|
13426
|
+
function handleConnectError(client, err, { host: host2, hostname: hostname7, protocol, port }) {
|
|
13427
13427
|
if (client.destroyed) {
|
|
13428
13428
|
return;
|
|
13429
13429
|
}
|
|
@@ -13432,7 +13432,7 @@ var require_client = __commonJS({
|
|
|
13432
13432
|
channels3.connectError.publish({
|
|
13433
13433
|
connectParams: {
|
|
13434
13434
|
host: host2,
|
|
13435
|
-
hostname:
|
|
13435
|
+
hostname: hostname7,
|
|
13436
13436
|
protocol,
|
|
13437
13437
|
port,
|
|
13438
13438
|
version: client[kHTTPContext]?.version,
|
|
@@ -15487,10 +15487,10 @@ var require_env_http_proxy_agent = __commonJS({
|
|
|
15487
15487
|
]);
|
|
15488
15488
|
}
|
|
15489
15489
|
#getProxyAgentForUrl(url2) {
|
|
15490
|
-
let { protocol, host:
|
|
15491
|
-
|
|
15490
|
+
let { protocol, host: hostname7, port } = url2;
|
|
15491
|
+
hostname7 = hostname7.replace(/:\d*$/, "").replace(/^\[(.+)\]$/, "$1").toLowerCase();
|
|
15492
15492
|
port = Number.parseInt(port, 10) || DEFAULT_PORTS[protocol] || 0;
|
|
15493
|
-
if (!this.#shouldProxy(
|
|
15493
|
+
if (!this.#shouldProxy(hostname7, port)) {
|
|
15494
15494
|
return this[kNoProxyAgent];
|
|
15495
15495
|
}
|
|
15496
15496
|
if (protocol === "https:") {
|
|
@@ -15498,7 +15498,7 @@ var require_env_http_proxy_agent = __commonJS({
|
|
|
15498
15498
|
}
|
|
15499
15499
|
return this[kHttpProxyAgent];
|
|
15500
15500
|
}
|
|
15501
|
-
#shouldProxy(
|
|
15501
|
+
#shouldProxy(hostname7, port) {
|
|
15502
15502
|
if (this.#noProxyChanged) {
|
|
15503
15503
|
this.#parseNoProxy();
|
|
15504
15504
|
}
|
|
@@ -15513,10 +15513,10 @@ var require_env_http_proxy_agent = __commonJS({
|
|
|
15513
15513
|
if (entry.port && entry.port !== port) {
|
|
15514
15514
|
continue;
|
|
15515
15515
|
}
|
|
15516
|
-
if (
|
|
15516
|
+
if (hostname7 === entry.hostname) {
|
|
15517
15517
|
return false;
|
|
15518
15518
|
}
|
|
15519
|
-
if (
|
|
15519
|
+
if (hostname7.slice(-(entry.hostname.length + 1)) === `.${entry.hostname}`) {
|
|
15520
15520
|
return false;
|
|
15521
15521
|
}
|
|
15522
15522
|
}
|
|
@@ -15531,21 +15531,21 @@ var require_env_http_proxy_agent = __commonJS({
|
|
|
15531
15531
|
if (!entry) {
|
|
15532
15532
|
continue;
|
|
15533
15533
|
}
|
|
15534
|
-
let
|
|
15534
|
+
let hostname7, port;
|
|
15535
15535
|
const ipv6WithPort = entry.match(/^\[(.+)\]:(\d+)$/);
|
|
15536
15536
|
if (ipv6WithPort) {
|
|
15537
|
-
|
|
15537
|
+
hostname7 = ipv6WithPort[1];
|
|
15538
15538
|
port = Number.parseInt(ipv6WithPort[2], 10);
|
|
15539
15539
|
} else {
|
|
15540
15540
|
const unbracketed = entry.replace(/^\[(.+)\]$/, "$1");
|
|
15541
15541
|
const colonCount = (unbracketed.match(/:/g) || []).length;
|
|
15542
15542
|
const parsed = colonCount === 1 && unbracketed.match(/^(.+):(\d+)$/);
|
|
15543
|
-
|
|
15543
|
+
hostname7 = parsed ? parsed[1] : unbracketed;
|
|
15544
15544
|
port = parsed ? Number.parseInt(parsed[2], 10) : 0;
|
|
15545
15545
|
}
|
|
15546
15546
|
noProxyEntries.push({
|
|
15547
15547
|
// strip leading dot or asterisk with dot
|
|
15548
|
-
hostname:
|
|
15548
|
+
hostname: hostname7.replace(/^\*?\./, "").toLowerCase(),
|
|
15549
15549
|
port
|
|
15550
15550
|
});
|
|
15551
15551
|
}
|
|
@@ -20012,14 +20012,14 @@ var require_dns = __commonJS({
|
|
|
20012
20012
|
get size() {
|
|
20013
20013
|
return this.#records.size;
|
|
20014
20014
|
}
|
|
20015
|
-
get(
|
|
20016
|
-
return this.#records.get(
|
|
20015
|
+
get(hostname7) {
|
|
20016
|
+
return this.#records.get(hostname7) ?? null;
|
|
20017
20017
|
}
|
|
20018
|
-
set(
|
|
20019
|
-
this.#records.set(
|
|
20018
|
+
set(hostname7, records) {
|
|
20019
|
+
this.#records.set(hostname7, records);
|
|
20020
20020
|
}
|
|
20021
|
-
delete(
|
|
20022
|
-
this.#records.delete(
|
|
20021
|
+
delete(hostname7) {
|
|
20022
|
+
this.#records.delete(hostname7);
|
|
20023
20023
|
}
|
|
20024
20024
|
// Delegate to storage decide can we do more lookups or not
|
|
20025
20025
|
full() {
|
|
@@ -35883,7 +35883,7 @@ function flagText({
|
|
|
35883
35883
|
}
|
|
35884
35884
|
|
|
35885
35885
|
// src/rules/cli-version.rules.ts
|
|
35886
|
-
var STAMPED = "0.1.
|
|
35886
|
+
var STAMPED = "0.1.62";
|
|
35887
35887
|
function cliVersionOf({ stamped = STAMPED } = {}) {
|
|
35888
35888
|
return stamped.startsWith("__") ? "dev" : stamped;
|
|
35889
35889
|
}
|
|
@@ -38717,9 +38717,9 @@ var asciiTabOrNewline = /[\t\n\r]/g;
|
|
|
38717
38717
|
function stripTabAndNewline(value) {
|
|
38718
38718
|
return value.replace(asciiTabOrNewline, "");
|
|
38719
38719
|
}
|
|
38720
|
-
function urlHostnameOk(url2,
|
|
38721
|
-
|
|
38722
|
-
return
|
|
38720
|
+
function urlHostnameOk(url2, hostname7) {
|
|
38721
|
+
hostname7.lastIndex = 0;
|
|
38722
|
+
return hostname7.test(url2.hostname);
|
|
38723
38723
|
}
|
|
38724
38724
|
function urlProtocolOk(url2, protocol) {
|
|
38725
38725
|
protocol.lastIndex = 0;
|
|
@@ -61676,7 +61676,9 @@ var openVaultTurnInputSchemaDefinition = external_exports.object({
|
|
|
61676
61676
|
kind: vaultAgentKindSchema,
|
|
61677
61677
|
ownerUserId: external_exports.string().min(1),
|
|
61678
61678
|
/** The login pool the agent draws its harness login from; only that pool's logins reach. */
|
|
61679
|
-
loginPoolId: external_exports.string().min(1).nullable().default(null)
|
|
61679
|
+
loginPoolId: external_exports.string().min(1).nullable().default(null),
|
|
61680
|
+
/** A session outside Laze, which has no agent record: how its cards name it. */
|
|
61681
|
+
label: external_exports.string().max(300).nullish()
|
|
61680
61682
|
}),
|
|
61681
61683
|
requesterUserId: external_exports.string().min(1),
|
|
61682
61684
|
requesterGroupIds: external_exports.array(external_exports.string().min(1)).default([]),
|
|
@@ -61822,7 +61824,9 @@ var vaultApprovalRequestSchemaDefinition = external_exports.object({
|
|
|
61822
61824
|
/** The longest lease Allow for this agent offers; null offers only once and deny. */
|
|
61823
61825
|
maxLeaseSeconds: external_exports.number().int().positive().nullable().default(null),
|
|
61824
61826
|
/** Allow covers the rest of the agent's turn ("Allow for this task"), not one command. */
|
|
61825
|
-
coversTask: external_exports.boolean().optional()
|
|
61827
|
+
coversTask: external_exports.boolean().optional(),
|
|
61828
|
+
/** Who asks when it is a session outside Laze, not an agent: "Claude Code session on pat-mac". */
|
|
61829
|
+
agentLabel: external_exports.string().nullable().optional()
|
|
61826
61830
|
});
|
|
61827
61831
|
var vaultApprovalRequestSchema = vaultApprovalRequestSchemaDefinition;
|
|
61828
61832
|
var answerVaultApprovalInputSchemaDefinition = external_exports.object({
|
|
@@ -62051,12 +62055,12 @@ var vaultTrpc = defineTrpcContract("vault").mutation("createConnection").withInp
|
|
|
62051
62055
|
// ../../modules/vault/contract/src/vault.config.ts
|
|
62052
62056
|
var positiveInt = external_exports.coerce.number().int().positive();
|
|
62053
62057
|
var vaultConfig = Config.define((c) => ({
|
|
62054
|
-
approvalTimeoutMinutes: c.env("VAULT_APPROVAL_TIMEOUT_MINUTES", positiveInt.default(
|
|
62058
|
+
approvalTimeoutMinutes: c.env("VAULT_APPROVAL_TIMEOUT_MINUTES", positiveInt.default(1440)),
|
|
62055
62059
|
/** How long an approve-once answer waits for the same ask to come back for it. */
|
|
62056
62060
|
approveOnceWindowMinutes: c.env("VAULT_APPROVE_ONCE_WINDOW_MINUTES", positiveInt.default(10)),
|
|
62057
62061
|
/** The lease cap when an admin set none on the connection. */
|
|
62058
62062
|
defaultMaxLeaseHours: c.env("VAULT_DEFAULT_MAX_LEASE_HOURS", positiveInt.default(48)),
|
|
62059
|
-
turnTtlMinutes: c.env("VAULT_TURN_TTL_MINUTES", positiveInt.default(
|
|
62063
|
+
turnTtlMinutes: c.env("VAULT_TURN_TTL_MINUTES", positiveInt.default(1440)),
|
|
62060
62064
|
/** The judge runs only when this is on and its key is set; off, Checked asks a person. */
|
|
62061
62065
|
judgeEnabled: c.env("VAULT_JUDGE_ENABLED", environmentBooleanSchema.default(false)),
|
|
62062
62066
|
judgeTimeoutMs: c.env("VAULT_JUDGE_TIMEOUT_MS", positiveInt.default(2e4)),
|
|
@@ -62165,7 +62169,9 @@ var vaultApprovalRequestedPayloadSchemaDefinition = external_exports.object({
|
|
|
62165
62169
|
/** Allow covers the rest of the agent's turn ("Allow for this task"), not one command. */
|
|
62166
62170
|
coversTask: external_exports.boolean().optional(),
|
|
62167
62171
|
/** What a task card's Allow covers when it is wider than one turn: "this session of ...". */
|
|
62168
|
-
taskScope: external_exports.string().nullable().optional()
|
|
62172
|
+
taskScope: external_exports.string().nullable().optional(),
|
|
62173
|
+
/** Who asks when it is a session outside Laze, not an agent: "Claude Code session on pat-mac". */
|
|
62174
|
+
agentLabel: external_exports.string().nullable().optional()
|
|
62169
62175
|
});
|
|
62170
62176
|
var vaultApprovalResolvedPayloadSchemaDefinition = external_exports.object({
|
|
62171
62177
|
workspaceId: external_exports.string().min(1),
|
|
@@ -62905,6 +62911,32 @@ var vaultAwsSessionSchemaDefinition = external_exports.object({
|
|
|
62905
62911
|
expiration: external_exports.iso.datetime({ offset: true })
|
|
62906
62912
|
});
|
|
62907
62913
|
|
|
62914
|
+
// ../../modules/vault/contract/src/vault-session.ts
|
|
62915
|
+
var vaultSessionSchemaDefinition = external_exports.object({
|
|
62916
|
+
/** `claude-code`, `codex`, `kanban`, `terminal` or `script`. */
|
|
62917
|
+
harness: external_exports.enum(["claude-code", "codex", "kanban", "terminal", "script"]),
|
|
62918
|
+
/** The harness's session id, the card id, or the terminal; one lease per id. */
|
|
62919
|
+
id: external_exports.string().trim().min(1).max(200),
|
|
62920
|
+
/** What the person calls it: `--as`, LAZE_SESSION_NAME, or the Kanban card. */
|
|
62921
|
+
name: external_exports.string().trim().max(120).default(""),
|
|
62922
|
+
host: external_exports.string().trim().max(200).default(""),
|
|
62923
|
+
/** The folder the session works in, `~/proj` under the home folder. */
|
|
62924
|
+
folder: external_exports.string().trim().max(500).default("")
|
|
62925
|
+
});
|
|
62926
|
+
var vaultSessionSchema = vaultSessionSchemaDefinition;
|
|
62927
|
+
var vaultSessionReleaseInputSchemaDefinition = external_exports.object({
|
|
62928
|
+
...vaultEgressReleaseInputSchema.omit({ agentId: true }).shape,
|
|
62929
|
+
session: vaultSessionSchema
|
|
62930
|
+
});
|
|
62931
|
+
var vaultSessionStatusInputSchemaDefinition = external_exports.object({
|
|
62932
|
+
requestId: external_exports.string().min(1).max(64),
|
|
62933
|
+
session: vaultSessionSchema
|
|
62934
|
+
});
|
|
62935
|
+
var vaultSessionBatchInputSchemaDefinition = external_exports.object({
|
|
62936
|
+
...vaultBatchReleaseInputSchema.omit({ agentId: true }).shape,
|
|
62937
|
+
session: vaultSessionSchema
|
|
62938
|
+
});
|
|
62939
|
+
|
|
62908
62940
|
// ../../modules/vault/contract/src/vault-placeholders.ts
|
|
62909
62941
|
var PLACEHOLDER = /\{\{\s*vault:[^}]*\}\}/;
|
|
62910
62942
|
function unusableFieldProblems({
|
|
@@ -78701,12 +78733,41 @@ function loginValuesOf({
|
|
|
78701
78733
|
// src/services/vault-commands.service.ts
|
|
78702
78734
|
import { createHash as createHash4 } from "node:crypto";
|
|
78703
78735
|
import { mkdir as mkdir17, readFile as readFile19, rm as rm9, writeFile as writeFile17 } from "node:fs/promises";
|
|
78704
|
-
import { tmpdir as tmpdir2 } from "node:os";
|
|
78736
|
+
import { hostname as hostname6, tmpdir as tmpdir2 } from "node:os";
|
|
78705
78737
|
import { dirname as dirname17, join as join21 } from "node:path";
|
|
78738
|
+
|
|
78739
|
+
// src/rules/vault-session.rules.ts
|
|
78740
|
+
function vaultSessionOf({
|
|
78741
|
+
harnessSession,
|
|
78742
|
+
inherited,
|
|
78743
|
+
cwd,
|
|
78744
|
+
host: host2,
|
|
78745
|
+
named,
|
|
78746
|
+
shellPid,
|
|
78747
|
+
terminal
|
|
78748
|
+
}) {
|
|
78749
|
+
const card2 = inherited.KANBAN_CARD_ID?.trim() ?? "";
|
|
78750
|
+
const name3 = (named || inherited.LAZE_SESSION_NAME || (card2 ? `card ${card2}` : "")).trim();
|
|
78751
|
+
const folder = displayFolderOf({
|
|
78752
|
+
folder: inherited.CLAUDE_PROJECT_DIR || cwd,
|
|
78753
|
+
home: inherited.HOME
|
|
78754
|
+
});
|
|
78755
|
+
const base = { name: name3.slice(0, 120), host: host2.slice(0, 200), folder: folder.slice(0, 500) };
|
|
78756
|
+
if (harnessSession && harnessSession.harness !== "other") {
|
|
78757
|
+
return { ...base, harness: harnessSession.harness, id: harnessSession.sessionId.slice(0, 200) };
|
|
78758
|
+
}
|
|
78759
|
+
if (card2) return { ...base, harness: "kanban", id: card2.slice(0, 200) };
|
|
78760
|
+
if (terminal && shellPid) return { ...base, harness: "terminal", id: `shell ${shellPid}` };
|
|
78761
|
+
return { ...base, harness: "script", id: folder.slice(0, 200) || "script" };
|
|
78762
|
+
}
|
|
78763
|
+
|
|
78764
|
+
// src/services/vault-commands.service.ts
|
|
78706
78765
|
var USAGE6 = `Usage: laze vault run <connection> --reason "<one plain sentence>" [--wait <s>] -- <command> [args...]
|
|
78707
78766
|
Runs the command with the connection's values in its environment, on a Laze agent's computer,
|
|
78708
|
-
on a machine it runs on,
|
|
78709
|
-
|
|
78767
|
+
on a machine it runs on, where a connected agent runs, or signed in as yourself, where it asks
|
|
78768
|
+
as the calling Claude Code, Codex, Kanban or terminal session.
|
|
78769
|
+
--channel <id> the conversation whose turn it runs in, when the agent answers in several
|
|
78770
|
+
--as <name> the session's name on the card when signed in as yourself (or LAZE_SESSION_NAME)`;
|
|
78710
78771
|
var POLL_MS = 3e3;
|
|
78711
78772
|
var RESTART_WAIT_MS = 12e4;
|
|
78712
78773
|
var RESTART_BACKOFF_MS = [1e3, 2e3, 4e3, 8e3, 1e4];
|
|
@@ -78861,7 +78922,7 @@ async function untilAnswered({
|
|
|
78861
78922
|
return "capped";
|
|
78862
78923
|
}
|
|
78863
78924
|
if (release2 === first) {
|
|
78864
|
-
context.err(`${release2.message}. Waiting for an answer (cards expire after
|
|
78925
|
+
context.err(`${release2.message}. Waiting for an answer (cards expire after 24 hours)...
|
|
78865
78926
|
`);
|
|
78866
78927
|
}
|
|
78867
78928
|
await context.sleep(POLL_MS);
|
|
@@ -78947,6 +79008,22 @@ function refusedRelease(error62) {
|
|
|
78947
79008
|
message: `laze vault: the release was refused: ${error62.message} (${error62.code})`
|
|
78948
79009
|
};
|
|
78949
79010
|
}
|
|
79011
|
+
var WHERE = "works only on a Laze agent's computer, on a machine it runs on, or signed in with `laze login` (as yourself or as a connected agent)";
|
|
79012
|
+
async function vaultSessionFor({
|
|
79013
|
+
context,
|
|
79014
|
+
args,
|
|
79015
|
+
harnessSession
|
|
79016
|
+
}) {
|
|
79017
|
+
return vaultSessionOf({
|
|
79018
|
+
harnessSession,
|
|
79019
|
+
inherited: context.environment.inherited,
|
|
79020
|
+
cwd: context.cwd,
|
|
79021
|
+
host: hostname6(),
|
|
79022
|
+
named: flagText({ args, name: "as" }),
|
|
79023
|
+
shellPid: await context.processes.parentOf(context.processes.pid),
|
|
79024
|
+
terminal: context.stdoutIsTerminal === true
|
|
79025
|
+
});
|
|
79026
|
+
}
|
|
78950
79027
|
async function keyRelease({
|
|
78951
79028
|
context,
|
|
78952
79029
|
args,
|
|
@@ -78955,27 +79032,27 @@ async function keyRelease({
|
|
|
78955
79032
|
command,
|
|
78956
79033
|
deadline
|
|
78957
79034
|
}) {
|
|
78958
|
-
const where = new CliUsageError(
|
|
78959
|
-
"laze vault run works only on a Laze agent's computer, on a machine it runs on, or signed in as a connected agent"
|
|
78960
|
-
);
|
|
78961
79035
|
const signed2 = await signedIn({ context, args }).catch(() => null);
|
|
78962
|
-
if (signed2?.profile.kind !== "agent")
|
|
79036
|
+
if (signed2?.profile.kind !== "agent" && signed2?.profile.kind !== "person") {
|
|
79037
|
+
throw new CliUsageError(`laze vault run ${WHERE}`);
|
|
79038
|
+
}
|
|
78963
79039
|
const { name: name3 } = signed2;
|
|
78964
|
-
const
|
|
78965
|
-
|
|
78966
|
-
session: await currentSessionOf({ context, args })
|
|
78967
|
-
});
|
|
78968
|
-
const channelId = flagText({ args, name: "channel" }) || null;
|
|
79040
|
+
const harnessSession = await currentSessionOf({ context, args });
|
|
79041
|
+
const client = forSession({ client: signed2.client, session: harnessSession });
|
|
78969
79042
|
const keyPath = runKeyPathOf({ turnFile: void 0, connection, profile: name3 });
|
|
78970
79043
|
const run4 = await runKeyAt({ path: keyPath });
|
|
78971
|
-
const
|
|
78972
|
-
|
|
78973
|
-
|
|
78974
|
-
|
|
78975
|
-
|
|
78976
|
-
|
|
78977
|
-
|
|
78978
|
-
|
|
79044
|
+
const body = { connection, reason, command, recipient: run4.publicKey };
|
|
79045
|
+
const door = signed2.profile.kind === "person" ? {
|
|
79046
|
+
ask: "/api/vault/session/release",
|
|
79047
|
+
status: "/api/vault/session/release-status",
|
|
79048
|
+
extra: { session: await vaultSessionFor({ context, args, harnessSession }) }
|
|
79049
|
+
} : {
|
|
79050
|
+
ask: "/api/agents/me/vault/release",
|
|
79051
|
+
status: "/api/agents/me/vault/release-status",
|
|
79052
|
+
extra: { channelId: flagText({ args, name: "channel" }) || null }
|
|
79053
|
+
};
|
|
79054
|
+
const first = await client.post(door.ask, { ...body, ...door.extra }).catch(refusedRelease);
|
|
79055
|
+
const next = (requestId) => client.post(door.status, { requestId, ...door.extra }).catch(refusedRelease);
|
|
78979
79056
|
const release2 = await untilAnswered({ context, first, next, deadline });
|
|
78980
79057
|
return settled({ context, release: release2, run: run4, keyPath });
|
|
78981
79058
|
}
|
|
@@ -90812,7 +90889,6 @@ function credentialProcessJson(fields) {
|
|
|
90812
90889
|
|
|
90813
90890
|
// src/services/vault-batch.service.ts
|
|
90814
90891
|
import { rm as rm14 } from "node:fs/promises";
|
|
90815
|
-
var WHERE = "laze vault env works only on a Laze agent's computer, on a machine it runs on, or signed in as a connected agent";
|
|
90816
90892
|
async function batchOf({ response }) {
|
|
90817
90893
|
const text2 = await response.text();
|
|
90818
90894
|
if (!response.ok) {
|
|
@@ -90857,21 +90933,26 @@ async function doorOf({
|
|
|
90857
90933
|
};
|
|
90858
90934
|
}
|
|
90859
90935
|
const signed2 = await signedIn({ context, args }).catch(() => null);
|
|
90860
|
-
if (signed2?.profile.kind !== "agent"
|
|
90936
|
+
if (signed2?.profile.kind !== "agent" && signed2?.profile.kind !== "person") {
|
|
90937
|
+
throw new CliUsageError(`laze vault env ${WHERE}`);
|
|
90938
|
+
}
|
|
90861
90939
|
const { name: name3 } = signed2;
|
|
90862
|
-
const
|
|
90863
|
-
|
|
90864
|
-
|
|
90865
|
-
|
|
90866
|
-
|
|
90940
|
+
const harnessSession = await currentSessionOf({ context, args });
|
|
90941
|
+
const client = forSession({ client: signed2.client, session: harnessSession });
|
|
90942
|
+
const door = signed2.profile.kind === "person" ? {
|
|
90943
|
+
ask: "/api/vault/session/release-batch",
|
|
90944
|
+
status: "/api/vault/session/release-status",
|
|
90945
|
+
extra: { session: await vaultSessionFor({ context, args, harnessSession }) }
|
|
90946
|
+
} : {
|
|
90947
|
+
ask: "/api/agents/me/vault/release-batch",
|
|
90948
|
+
status: "/api/agents/me/vault/release-status",
|
|
90949
|
+
extra: { channelId: flagText({ args, name: "channel" }) || null }
|
|
90950
|
+
};
|
|
90867
90951
|
return {
|
|
90868
90952
|
keyPath: runKeyPathOf({ turnFile: void 0, connection: keyName, profile: name3 }),
|
|
90869
90953
|
ask: async (body) => {
|
|
90870
90954
|
try {
|
|
90871
|
-
return await client.post(
|
|
90872
|
-
...body,
|
|
90873
|
-
channelId
|
|
90874
|
-
});
|
|
90955
|
+
return await client.post(door.ask, { ...body, ...door.extra });
|
|
90875
90956
|
} catch (error62) {
|
|
90876
90957
|
if (!(error62 instanceof LazeApiError)) throw error62;
|
|
90877
90958
|
throw new CliUsageError(
|
|
@@ -90879,7 +90960,7 @@ async function doorOf({
|
|
|
90879
90960
|
);
|
|
90880
90961
|
}
|
|
90881
90962
|
},
|
|
90882
|
-
status: (requestId) => client.post(
|
|
90963
|
+
status: (requestId) => client.post(door.status, { requestId, ...door.extra }).catch(refusedRelease)
|
|
90883
90964
|
};
|
|
90884
90965
|
}
|
|
90885
90966
|
async function resolveBatch({
|
|
@@ -90902,7 +90983,7 @@ async function untilAllAnswered({
|
|
|
90902
90983
|
if (waiting.size === 0) return answered;
|
|
90903
90984
|
const [first] = waiting.values();
|
|
90904
90985
|
context.err(
|
|
90905
|
-
`laze vault: ${[...waiting.keys()].join(", ")} wait for an answer (${first?.message ?? "a card"}); cards expire after
|
|
90986
|
+
`laze vault: ${[...waiting.keys()].join(", ")} wait for an answer (${first?.message ?? "a card"}); cards expire after 24 hours...
|
|
90906
90987
|
`
|
|
90907
90988
|
);
|
|
90908
90989
|
while (waiting.size > 0) {
|
|
@@ -92558,7 +92639,7 @@ var HELP = `laze: work in a Laze workspace from your terminal or your agent.
|
|
|
92558
92639
|
laze agent faces every agent's sloth seed or picture
|
|
92559
92640
|
laze adopt codex [--thread <id>] answer Laze messages in a Codex thread
|
|
92560
92641
|
laze adopt codex --status | --stop the background adopt that laze agent link started
|
|
92561
|
-
laze vault run <name> --reason "<why>" -- <cmd> run a command with a vault connection
|
|
92642
|
+
laze vault run <name> --reason "<why>" -- <cmd> run a command with a vault connection
|
|
92562
92643
|
laze vault env [<file>] --reason "<why>" -- <cmd> run a command with every key .env.vault names (agents)
|
|
92563
92644
|
laze vault env --names | --shell what .env.vault resolves to; export lines for a shell hook
|
|
92564
92645
|
laze vault aws <connection> [--reason "<why>"] AWS credential_process JSON from a short-lived STS session
|
package/package.json
CHANGED