@lazehq/cli 0.1.39 → 0.1.41
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 +62 -37
- package/package.json +1 -1
package/dist/laze.mjs
CHANGED
|
@@ -35708,7 +35708,7 @@ function flagText({
|
|
|
35708
35708
|
}
|
|
35709
35709
|
|
|
35710
35710
|
// src/rules/cli-version.rules.ts
|
|
35711
|
-
var STAMPED = "0.1.
|
|
35711
|
+
var STAMPED = "0.1.41";
|
|
35712
35712
|
function cliVersionOf({ stamped = STAMPED } = {}) {
|
|
35713
35713
|
return stamped.startsWith("__") ? "dev" : stamped;
|
|
35714
35714
|
}
|
|
@@ -62744,7 +62744,9 @@ var computerNoticeSchemaDefinition = external_exports.discriminatedUnion("type",
|
|
|
62744
62744
|
external_exports.object({
|
|
62745
62745
|
type: external_exports.literal("memory_stop"),
|
|
62746
62746
|
/** "stopped: your agent computer is out of memory (3.9 of 4 GB)". */
|
|
62747
|
-
text: external_exports.string().min(1).max(500)
|
|
62747
|
+
text: external_exports.string().min(1).max(500),
|
|
62748
|
+
/** False when the computer's own services held most of the memory: no bigger size to offer. */
|
|
62749
|
+
agentLoad: external_exports.boolean().optional()
|
|
62748
62750
|
}),
|
|
62749
62751
|
external_exports.object({
|
|
62750
62752
|
type: external_exports.literal("disk_warning"),
|
|
@@ -64102,22 +64104,6 @@ var liveStepsSchemaDefinition = external_exports.object({
|
|
|
64102
64104
|
visible: external_exports.boolean()
|
|
64103
64105
|
});
|
|
64104
64106
|
var liveStepsSchema = liveStepsSchemaDefinition;
|
|
64105
|
-
var replyStepsInputSchemaDefinition = external_exports.object({
|
|
64106
|
-
workspaceId: external_exports.string().min(1),
|
|
64107
|
-
channelId: external_exports.string().min(1),
|
|
64108
|
-
messageIds: external_exports.array(external_exports.string().min(1)).max(200)
|
|
64109
|
-
});
|
|
64110
|
-
var replyStepsInputSchema = replyStepsInputSchemaDefinition;
|
|
64111
|
-
var replyStepsSchemaDefinition = external_exports.array(
|
|
64112
|
-
external_exports.object({
|
|
64113
|
-
messageId: external_exports.string().min(1),
|
|
64114
|
-
agentId: external_exports.string().min(1),
|
|
64115
|
-
turnKey: external_exports.string().min(1),
|
|
64116
|
-
state: liveTurnStateSchema,
|
|
64117
|
-
tools: external_exports.number().int().nonnegative()
|
|
64118
|
-
})
|
|
64119
|
-
);
|
|
64120
|
-
var replyStepsSchema = replyStepsSchemaDefinition;
|
|
64121
64107
|
|
|
64122
64108
|
// ../../modules/agent/contract/src/agent-login-trouble.ts
|
|
64123
64109
|
var loginCardActionInputSchemaDefinition = external_exports.object({
|
|
@@ -65188,7 +65174,7 @@ var codexLoginRefreshInputSchemaDefinition = external_exports.object({
|
|
|
65188
65174
|
});
|
|
65189
65175
|
var AgentApi = moduleApi()("agent");
|
|
65190
65176
|
var agentCoreTrpc = defineTrpcContract("agents").query("list").withInput(external_exports.object({ workspaceId: workspaceIdSchema10 })).withOutput(external_exports.array(agentListEntrySchema)).mutation("create").withInput(createAgentInputSchema).withOutput(agentSchema).mutation("update").withInput(updateAgentInputSchema).withOutput(agentSchema).mutation("remove").withInput(external_exports.object({ workspaceId: workspaceIdSchema10, agentId: idSchema14 })).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: workspaceIdSchema10 })).withOutput(external_exports.array(agentFaceSchema)).query("presence").withInput(external_exports.object({ workspaceId: workspaceIdSchema10 })).withOutput(external_exports.array(agentPresenceSchema)).mutation("uploadAvatar").withInput(uploadAgentAvatarInputSchema).withOutput(uploadedAgentAvatarSchema).query("access").withInput(external_exports.object({ workspaceId: workspaceIdSchema10, agentId: idSchema14 })).withOutput(agentAccessSchema).query("loginActivity").withInput(external_exports.object({ workspaceId: workspaceIdSchema10, agentId: idSchema14 })).withOutput(loginActivitySchema).mutation("raiseBudget").withInput(raiseBudgetInputSchema).withOutput(external_exports.object({ limitUsd: external_exports.number() })).query("permissionPrompts").withInput(external_exports.object({ workspaceId: workspaceIdSchema10, agentId: idSchema14 })).withOutput(external_exports.array(agentPermissionPromptSchema)).mutation("share").withInput(shareAgentInputSchema).withOutput(agentAccessSchema).mutation("unshare").withInput(shareAgentInputSchema).withOutput(agentAccessSchema).query("harnessLogins").withInput(external_exports.object({ workspaceId: workspaceIdSchema10 })).withOutput(harnessLoginsSchema).mutation("saveHarnessLogin").withInput(saveHarnessLoginInputSchema).withOutput(harnessLoginsSchema).mutation("removeHarnessLogin").withInput(removeHarnessLoginInputSchema).withOutput(harnessLoginsSchema).query("listHarnessLogins").withInput(external_exports.object({ workspaceId: workspaceIdSchema10 })).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: workspaceIdSchema10 })).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: workspaceIdSchema10, agentId: idSchema14 })).withOutput(external_exports.object({ channelId: idSchema14 })).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: workspaceIdSchema10, agentId: idSchema14 })).withOutput(external_exports.object({ disconnected: external_exports.literal(true) })).mutation("setGithub").withInput(setAgentGithubInputSchema).withOutput(agentSchema).query("githubWatches").withInput(external_exports.object({ workspaceId: workspaceIdSchema10, agentId: idSchema14 })).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();
|
|
65191
|
-
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() })).query("liveSteps").withInput(liveStepsInputSchema).withOutput(liveStepsSchema).query("workingNow").withInput(agentWorkingInputSchema).withOutput(agentWorkingSchema).
|
|
65177
|
+
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() })).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("restartComputer").withInput(restartAgentComputerInputSchema).withOutput(external_exports.object({ restarted: external_exports.boolean() })).build();
|
|
65192
65178
|
var agentChannelSettingsTrpc = defineTrpcContract("agents").query("monitors").withInput(external_exports.object({ workspaceId: workspaceIdSchema10, agentId: idSchema14 })).withOutput(external_exports.array(agentMonitorSchema)).query("channelLevel").withInput(external_exports.object({ workspaceId: workspaceIdSchema10, agentId: idSchema14, channelId: idSchema14 })).withOutput(channelLevelSchema).mutation("setChannelLevel").withInput(setChannelLevelInputSchema).withOutput(channelLevelSchema).mutation("unmuteChannel").withInput(unmuteAgentChannelInputSchema).withOutput(channelLevelSchema).mutation("cancelHeld").withInput(cancelHeldInputSchema).withOutput(cancelHeldResultSchema).build();
|
|
65193
65179
|
var agentJoinTrpc = defineTrpcContract("agents").query("joinRequest").withInput(joinRequestInputSchema).withOutput(joinRequestViewSchema).mutation("approveJoinRequest").withInput(approveJoinRequestInputSchema).withOutput(joinRequestViewSchema).mutation("denyJoinRequest").withInput(joinRequestInputSchema).withOutput(joinRequestViewSchema).build();
|
|
65194
65180
|
var agentLoginTroubleTrpc = defineTrpcContract("agents").mutation("replaceHarnessLogin").withInput(replaceHarnessLoginInputSchema).withOutput(harnessLoginListSchema).mutation("startHarnessSignIn").withInput(startHarnessSignInInputSchema).withOutput(harnessSignInSchema).mutation("pollHarnessSignIn").withInput(pollHarnessSignInInputSchema).withOutput(harnessSignInPollSchema).mutation("waitForLogins").withInput(loginCardActionInputSchema).withOutput(external_exports.object({ waiting: external_exports.boolean() })).mutation("useAnotherLogin").withInput(loginCardActionInputSchema).withOutput(external_exports.object({ loginName: external_exports.string() })).build();
|
|
@@ -67490,6 +67476,7 @@ async function claudeProjectOf({
|
|
|
67490
67476
|
import { mkdir as mkdir2, readFile as readFile2, rename as rename2, writeFile as writeFile2 } from "node:fs/promises";
|
|
67491
67477
|
import { dirname as dirname2, join as join2 } from "node:path";
|
|
67492
67478
|
var PUSH_GRACE_MS = 3 * 6e4;
|
|
67479
|
+
var IN_FLIGHT_MS = 35e3;
|
|
67493
67480
|
function fileNameOf({ profile }) {
|
|
67494
67481
|
return profile.replace(/[^a-zA-Z0-9_-]/g, "_");
|
|
67495
67482
|
}
|
|
@@ -67548,7 +67535,8 @@ async function dueFromSpool({
|
|
|
67548
67535
|
context,
|
|
67549
67536
|
profile,
|
|
67550
67537
|
seen,
|
|
67551
|
-
pushedToo
|
|
67538
|
+
pushedToo,
|
|
67539
|
+
settledOnly = false
|
|
67552
67540
|
}) {
|
|
67553
67541
|
const path = statePathOf({ context, kind: "spool", profile });
|
|
67554
67542
|
const entries = await readSpool({ path });
|
|
@@ -67563,7 +67551,8 @@ async function dueFromSpool({
|
|
|
67563
67551
|
messageIds: shown.map((entry) => entry.message.messageId)
|
|
67564
67552
|
});
|
|
67565
67553
|
const late = context.nowMs() - PUSH_GRACE_MS;
|
|
67566
|
-
|
|
67554
|
+
const settled2 = context.nowMs() - IN_FLIGHT_MS;
|
|
67555
|
+
return entries.filter((entry) => !shown.includes(entry)).filter((entry) => !settledOnly || entry.takenAt <= settled2).filter((entry) => entry.pushedAt === void 0 || pushedToo && entry.pushedAt <= late).map((entry) => entry.message);
|
|
67567
67556
|
}
|
|
67568
67557
|
|
|
67569
67558
|
// src/services/harness-session.service.ts
|
|
@@ -69706,7 +69695,7 @@ async function stopInstalled({
|
|
|
69706
69695
|
installed
|
|
69707
69696
|
}) {
|
|
69708
69697
|
if (installed.manager === "systemd") {
|
|
69709
|
-
await
|
|
69698
|
+
await quietly({ context, script: `systemctl --user stop '${installed.name}.service'` });
|
|
69710
69699
|
} else if (installed.manager === "launchd") {
|
|
69711
69700
|
await quietly({ context, script: `launchctl bootout gui/$(id -u)/${installed.name}` });
|
|
69712
69701
|
} else if (installed.pid) {
|
|
@@ -69731,6 +69720,8 @@ async function installConnectService({ context }) {
|
|
|
69731
69720
|
async function ensureConnectService({ context }) {
|
|
69732
69721
|
const running = await runStateOf({ context });
|
|
69733
69722
|
if (running && context.processes.alive(running.pid)) return false;
|
|
69723
|
+
const installed = await readJson({ path: installedPathOf({ context }) });
|
|
69724
|
+
if (installed && installed.manager !== "detached") return false;
|
|
69734
69725
|
await installConnectService({ context });
|
|
69735
69726
|
return true;
|
|
69736
69727
|
}
|
|
@@ -69934,7 +69925,13 @@ async function takeRound2({
|
|
|
69934
69925
|
async function roundOf({ context, client, name: name3, lock, claudePid, session, seen }) {
|
|
69935
69926
|
if ((await holderOf({ path: lock }))?.pid !== context.processes.pid) return void 0;
|
|
69936
69927
|
if (claudePid && !context.processes.alive(claudePid)) return void 0;
|
|
69937
|
-
const due = await dueFromSpool({
|
|
69928
|
+
const due = await dueFromSpool({
|
|
69929
|
+
context,
|
|
69930
|
+
profile: name3,
|
|
69931
|
+
seen,
|
|
69932
|
+
pushedToo: true,
|
|
69933
|
+
settledOnly: true
|
|
69934
|
+
});
|
|
69938
69935
|
if (due.length > 0) return due;
|
|
69939
69936
|
if (await channelLive({ context, profile: name3 })) {
|
|
69940
69937
|
await context.sleep(CHANNEL_CHECK_MS);
|
|
@@ -71213,7 +71210,8 @@ async function handOver({ context, args }) {
|
|
|
71213
71210
|
context,
|
|
71214
71211
|
profile: agent2,
|
|
71215
71212
|
seen: () => input2.transcript_path ? readFile14(input2.transcript_path, "utf8") : Promise.resolve(""),
|
|
71216
|
-
pushedToo: false
|
|
71213
|
+
pushedToo: false,
|
|
71214
|
+
settledOnly: true
|
|
71217
71215
|
});
|
|
71218
71216
|
const claim3 = forSession({ client, session });
|
|
71219
71217
|
let fresh;
|
|
@@ -77881,7 +77879,13 @@ async function deliverOnce({
|
|
|
77881
77879
|
}
|
|
77882
77880
|
const named = { ...args, flags: { ...args.flags, profile } };
|
|
77883
77881
|
const { client } = await signedIn({ context, args: named });
|
|
77884
|
-
const due = await dueFromSpool({
|
|
77882
|
+
const due = await dueFromSpool({
|
|
77883
|
+
context,
|
|
77884
|
+
profile,
|
|
77885
|
+
seen: async () => "",
|
|
77886
|
+
pushedToo: true,
|
|
77887
|
+
settledOnly: true
|
|
77888
|
+
});
|
|
77885
77889
|
const taken = due.length > 0 ? [] : await takeRound2({ context, client, claudePid, session });
|
|
77886
77890
|
const messages = [...due, ...taken];
|
|
77887
77891
|
if (messages.length === 0) {
|
|
@@ -79509,6 +79513,12 @@ function diskLine(status9) {
|
|
|
79509
79513
|
const over = DISK_STATE_TEXT[disk.state];
|
|
79510
79514
|
return `Disk: ${gb(disk.usedGb)} of ${gb(disk.totalGb)}${measured}${over}`;
|
|
79511
79515
|
}
|
|
79516
|
+
function servicesLine(status9) {
|
|
79517
|
+
const agentsGb = status9.agents.reduce((sum, agent2) => sum + agent2.memoryGb, 0);
|
|
79518
|
+
const servicesGb = Math.max(0, status9.memory.usedGb - agentsGb);
|
|
79519
|
+
if (status9.memory.usedGb <= 0) return [];
|
|
79520
|
+
return [` Computer services (browser, desktop, system) memory ${gb(servicesGb)}`];
|
|
79521
|
+
}
|
|
79512
79522
|
function printStatus({ context }, status9) {
|
|
79513
79523
|
const current2 = status9.sizes.find((size) => size.current);
|
|
79514
79524
|
const included = status9.sizes.find((size) => size.included);
|
|
@@ -79522,6 +79532,7 @@ function printStatus({ context }, status9) {
|
|
|
79522
79532
|
...status9.agents.map(
|
|
79523
79533
|
(agent2) => ` ${agent2.name} ${agent2.state} CPU ${Number(agent2.cpuBusy.toFixed(1))} memory ${gb(agent2.memoryGb)}`
|
|
79524
79534
|
),
|
|
79535
|
+
...servicesLine(status9),
|
|
79525
79536
|
...status9.memoryStops.length > 0 ? ["Memory stops:"] : [],
|
|
79526
79537
|
...status9.memoryStops.map(
|
|
79527
79538
|
(stop3) => ` ${utc(stop3.at)} ${stop3.agentName} ${stop3.command} ${gb(stop3.memoryGb)}`
|
|
@@ -84405,9 +84416,24 @@ async function startedUpdate({
|
|
|
84405
84416
|
});
|
|
84406
84417
|
return { manager: plan2.manager };
|
|
84407
84418
|
}
|
|
84419
|
+
async function noteRelease({
|
|
84420
|
+
context,
|
|
84421
|
+
mine: mine4,
|
|
84422
|
+
server,
|
|
84423
|
+
sandbox,
|
|
84424
|
+
quiet
|
|
84425
|
+
}) {
|
|
84426
|
+
const warning = releaseWarningOf({ mine: mine4, server, sandbox });
|
|
84427
|
+
if (!warning) return false;
|
|
84428
|
+
const older = !sandbox && releaseSkewOf({ mine: mine4, server }) === "older";
|
|
84429
|
+
const started = older ? await startedUpdate({ context, server }) : null;
|
|
84430
|
+
if (!quiet) context.err(started ? selfUpdateLineOf({ mine: mine4, server, ...started }) : warning);
|
|
84431
|
+
return true;
|
|
84432
|
+
}
|
|
84408
84433
|
function watchingRelease({
|
|
84409
84434
|
context,
|
|
84410
|
-
mine: mine4 = cliVersionOf()
|
|
84435
|
+
mine: mine4 = cliVersionOf(),
|
|
84436
|
+
quiet = false
|
|
84411
84437
|
}) {
|
|
84412
84438
|
const sandbox = context.program.at(-1) === SANDBOX_CLI_PATH;
|
|
84413
84439
|
let warned = false;
|
|
@@ -84416,15 +84442,7 @@ function watchingRelease({
|
|
|
84416
84442
|
fetcher: async (input2, init) => {
|
|
84417
84443
|
const response = await context.fetcher(input2, init);
|
|
84418
84444
|
const server = response.headers.get(CLI_RELEASE_HEADER);
|
|
84419
|
-
if (!warned && server) {
|
|
84420
|
-
const warning = releaseWarningOf({ mine: mine4, server, sandbox });
|
|
84421
|
-
if (warning) {
|
|
84422
|
-
warned = true;
|
|
84423
|
-
const older = !sandbox && releaseSkewOf({ mine: mine4, server }) === "older";
|
|
84424
|
-
const started = older ? await startedUpdate({ context, server }) : null;
|
|
84425
|
-
context.err(started ? selfUpdateLineOf({ mine: mine4, server, ...started }) : warning);
|
|
84426
|
-
}
|
|
84427
|
-
}
|
|
84445
|
+
if (!warned && server) warned = await noteRelease({ context, mine: mine4, server, sandbox, quiet });
|
|
84428
84446
|
return response;
|
|
84429
84447
|
}
|
|
84430
84448
|
};
|
|
@@ -84443,7 +84461,13 @@ async function guardRound(guard) {
|
|
|
84443
84461
|
if (!await takeLock({ context, path: lock, claudePid, ...sessionIdOf({ session }) }))
|
|
84444
84462
|
return true;
|
|
84445
84463
|
}
|
|
84446
|
-
const due = await dueFromSpool({
|
|
84464
|
+
const due = await dueFromSpool({
|
|
84465
|
+
context,
|
|
84466
|
+
profile: name3,
|
|
84467
|
+
seen: async () => "",
|
|
84468
|
+
pushedToo: true,
|
|
84469
|
+
settledOnly: true
|
|
84470
|
+
});
|
|
84447
84471
|
const messages = due.length > 0 ? due : await takeRound2({ context, client, claudePid: 0, session });
|
|
84448
84472
|
if (messages.length === 0) return false;
|
|
84449
84473
|
await keepTaken({ context, profile: name3, messages });
|
|
@@ -87512,7 +87536,8 @@ async function runCli({
|
|
|
87512
87536
|
return command || args.flags.help ? 0 : 2;
|
|
87513
87537
|
}
|
|
87514
87538
|
try {
|
|
87515
|
-
|
|
87539
|
+
const quiet = args.words[0] === "hook";
|
|
87540
|
+
return await command({ context: watchingRelease({ context, quiet }), args }) ?? 0;
|
|
87516
87541
|
} catch (error62) {
|
|
87517
87542
|
if (error62 instanceof CliUsageError) context.err(`${error62.message}
|
|
87518
87543
|
`);
|
package/package.json
CHANGED