@lazehq/cli 0.1.27 → 0.1.28
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 +56 -12
- package/package.json +1 -1
package/dist/laze.mjs
CHANGED
|
@@ -35506,6 +35506,8 @@ function cliEnvironment({
|
|
|
35506
35506
|
} = {}) {
|
|
35507
35507
|
return {
|
|
35508
35508
|
configPath: env.LAZE_CLI_CONFIG || join(homedir(), ".laze", "config.json"),
|
|
35509
|
+
// Claude Code names a subagent's commands `claude-code_<version>_agent`.
|
|
35510
|
+
subagent: /^claude-code_.+_agent$/.test(env.AI_AGENT ?? ""),
|
|
35509
35511
|
profile: env.LAZE_PROFILE || void 0,
|
|
35510
35512
|
url: env.LAZE_URL || void 0,
|
|
35511
35513
|
opsToken: env.LAZE_OPS_TOKEN || void 0,
|
|
@@ -35705,7 +35707,7 @@ function flagText({
|
|
|
35705
35707
|
}
|
|
35706
35708
|
|
|
35707
35709
|
// src/rules/cli-version.rules.ts
|
|
35708
|
-
var STAMPED = "0.1.
|
|
35710
|
+
var STAMPED = "0.1.28";
|
|
35709
35711
|
function cliVersionOf({ stamped = STAMPED } = {}) {
|
|
35710
35712
|
return stamped.startsWith("__") ? "dev" : stamped;
|
|
35711
35713
|
}
|
|
@@ -66918,6 +66920,12 @@ async function liveElsewhere({
|
|
|
66918
66920
|
}
|
|
66919
66921
|
return false;
|
|
66920
66922
|
}
|
|
66923
|
+
function refuseInSubagent({ context, args }) {
|
|
66924
|
+
if (!context.environment.subagent || flagText({ args, name: "session" })) return;
|
|
66925
|
+
throw new CliUsageError(
|
|
66926
|
+
"This runs inside a Claude Code subagent, which shares its parent's session: it would take that session. Run it in the session itself, or pass --session <id>."
|
|
66927
|
+
);
|
|
66928
|
+
}
|
|
66921
66929
|
function notBoundText({
|
|
66922
66930
|
meta: meta3,
|
|
66923
66931
|
agent: agent2,
|
|
@@ -69432,6 +69440,7 @@ async function linkCodexSession({
|
|
|
69432
69440
|
|
|
69433
69441
|
// src/services/laze-plugin.service.ts
|
|
69434
69442
|
import { mkdir as mkdir11, readFile as readFile11, writeFile as writeFile11 } from "node:fs/promises";
|
|
69443
|
+
import { homedir as homedir3 } from "node:os";
|
|
69435
69444
|
import { dirname as dirname11, join as join13 } from "node:path";
|
|
69436
69445
|
|
|
69437
69446
|
// src/rules/laze-plugin.rules.ts
|
|
@@ -69572,15 +69581,7 @@ async function writeLazePlugin({ context }) {
|
|
|
69572
69581
|
}
|
|
69573
69582
|
return folder;
|
|
69574
69583
|
}
|
|
69575
|
-
async function
|
|
69576
|
-
const quiet = ">/dev/null 2>&1 </dev/null";
|
|
69577
|
-
const script = [
|
|
69578
|
-
`claude plugin marketplace add ${quote2(folder)} --scope user ${quiet}`,
|
|
69579
|
-
`claude plugin marketplace update ${LAZE_PLUGIN} ${quiet}`,
|
|
69580
|
-
// install is a no-op for a plugin Claude Code already has; update refreshes its cached copy.
|
|
69581
|
-
`{ claude plugin install ${LAZE_PLUGIN}@${LAZE_PLUGIN} --scope user ${quiet} || true; }`,
|
|
69582
|
-
`claude plugin update ${LAZE_PLUGIN}@${LAZE_PLUGIN} ${quiet}`
|
|
69583
|
-
].join("; ");
|
|
69584
|
+
async function claudeScript({ context, script }) {
|
|
69584
69585
|
const stop3 = new AbortController();
|
|
69585
69586
|
const command = ["sh", "-c", script];
|
|
69586
69587
|
const run4 = context.runCommand({ command, env: {}, signal: stop3.signal }).catch(() => 1);
|
|
@@ -69591,6 +69592,44 @@ async function registerWithClaude({ context, folder }) {
|
|
|
69591
69592
|
stop3.abort();
|
|
69592
69593
|
return code === 0;
|
|
69593
69594
|
}
|
|
69595
|
+
var QUIET = ">/dev/null 2>&1 </dev/null";
|
|
69596
|
+
async function registerWithClaude({ context, folder }) {
|
|
69597
|
+
const script = [
|
|
69598
|
+
`claude plugin marketplace add ${quote2(folder)} --scope user ${QUIET}`,
|
|
69599
|
+
`claude plugin marketplace update ${LAZE_PLUGIN} ${QUIET}`,
|
|
69600
|
+
// install is a no-op for a plugin Claude Code already has; update refreshes its cached copy.
|
|
69601
|
+
`{ claude plugin install ${LAZE_PLUGIN}@${LAZE_PLUGIN} --scope user ${QUIET} || true; }`,
|
|
69602
|
+
`claude plugin update ${LAZE_PLUGIN}@${LAZE_PLUGIN} ${QUIET}`
|
|
69603
|
+
].join("; ");
|
|
69604
|
+
return claudeScript({ context, script });
|
|
69605
|
+
}
|
|
69606
|
+
var RUN_FILES = ["hooks/hooks.json", "monitors/monitors.json"];
|
|
69607
|
+
async function cachedPluginOf({ context }) {
|
|
69608
|
+
const inherited = context.environment.inherited;
|
|
69609
|
+
const home = inherited.HOME || homedir3();
|
|
69610
|
+
const claude = inherited.CLAUDE_CONFIG_DIR || join13(home, ".claude");
|
|
69611
|
+
const listed = await readFile11(join13(claude, "plugins", "installed_plugins.json"), "utf8").then(
|
|
69612
|
+
(text2) => JSON.parse(text2),
|
|
69613
|
+
() => void 0
|
|
69614
|
+
);
|
|
69615
|
+
return listed?.plugins?.[`${LAZE_PLUGIN}@${LAZE_PLUGIN}`]?.[0]?.installPath;
|
|
69616
|
+
}
|
|
69617
|
+
async function refreshStaleCache({ context, folder }) {
|
|
69618
|
+
const cached2 = await cachedPluginOf({ context });
|
|
69619
|
+
if (!cached2) return true;
|
|
69620
|
+
const read3 = (path) => readFile11(path, "utf8").catch(() => "");
|
|
69621
|
+
for (const file3 of RUN_FILES) {
|
|
69622
|
+
const ours = await read3(join13(folder, LAZE_PLUGIN, file3));
|
|
69623
|
+
if (ours === await read3(join13(cached2, file3))) continue;
|
|
69624
|
+
const plugin2 = `${LAZE_PLUGIN}@${LAZE_PLUGIN}`;
|
|
69625
|
+
const script = [
|
|
69626
|
+
`claude plugin uninstall ${plugin2} --scope user ${QUIET}`,
|
|
69627
|
+
`claude plugin install ${plugin2} --scope user ${QUIET}`
|
|
69628
|
+
].join("; ");
|
|
69629
|
+
return claudeScript({ context, script });
|
|
69630
|
+
}
|
|
69631
|
+
return true;
|
|
69632
|
+
}
|
|
69594
69633
|
function registeredMarkOf({ context }) {
|
|
69595
69634
|
return join13(pluginFolderOf({ context }), "registered");
|
|
69596
69635
|
}
|
|
@@ -69602,7 +69641,7 @@ async function pluginRegistered({ context }) {
|
|
|
69602
69641
|
}
|
|
69603
69642
|
async function installLazePlugin({ context }) {
|
|
69604
69643
|
const folder = await writeLazePlugin({ context });
|
|
69605
|
-
const registered = await registerWithClaude({ context, folder });
|
|
69644
|
+
const registered = await registerWithClaude({ context, folder }) && await refreshStaleCache({ context, folder });
|
|
69606
69645
|
if (registered) await writeFile11(registeredMarkOf({ context }), cliVersionOf());
|
|
69607
69646
|
return { folder, registered };
|
|
69608
69647
|
}
|
|
@@ -69951,6 +69990,7 @@ function sandboxed({ context, error: error62 }) {
|
|
|
69951
69990
|
async function linkAgent({ context, args }) {
|
|
69952
69991
|
const token2 = flagText({ args, name: "token" });
|
|
69953
69992
|
if (!token2) throw new CliUsageError("Usage: laze agent link --token <token>");
|
|
69993
|
+
refuseInSubagent({ context, args });
|
|
69954
69994
|
const url2 = serverUrlOf({ context, args });
|
|
69955
69995
|
const { harness, pid } = await harnessOf2({ context, args });
|
|
69956
69996
|
const client = LazeClient.create({ baseUrl: url2, fetcher: context.fetcher });
|
|
@@ -70846,6 +70886,7 @@ async function bindAgentSession({
|
|
|
70846
70886
|
context,
|
|
70847
70887
|
args
|
|
70848
70888
|
}) {
|
|
70889
|
+
refuseInSubagent({ context, args });
|
|
70849
70890
|
const session = await currentSessionOf({ context, args });
|
|
70850
70891
|
if (!session) throw new CliUsageError(NO_SESSION);
|
|
70851
70892
|
const key = sessionKeyOf({ session });
|
|
@@ -72027,7 +72068,9 @@ var appPinSchemaDefinition = external_exports.object({
|
|
|
72027
72068
|
pinnedByName: external_exports.string().nullable(),
|
|
72028
72069
|
pinnedAt: external_exports.iso.datetime(),
|
|
72029
72070
|
/** Set for a browser tab, null for an app. */
|
|
72030
|
-
browser: browserPinSchemaDefinition.nullable()
|
|
72071
|
+
browser: browserPinSchemaDefinition.nullable(),
|
|
72072
|
+
/** Whether the reader may unpin it; a browser tab only its owner, their agents or an Admin. */
|
|
72073
|
+
canUnpin: external_exports.boolean().default(true)
|
|
72031
72074
|
});
|
|
72032
72075
|
var appPinViewSchemaDefinition = external_exports.object({
|
|
72033
72076
|
activeAppId: external_exports.string().nullable(),
|
|
@@ -72533,6 +72576,7 @@ var AppNavSlot = appUi.component("nav");
|
|
|
72533
72576
|
var AppPanelSlot = appUi.component("panel");
|
|
72534
72577
|
var AppCardSlot = appUi.component("card");
|
|
72535
72578
|
var AppPinStripSlot = appUi.component("pin-strip");
|
|
72579
|
+
var AppPinListSlot = appUi.component("pin-list");
|
|
72536
72580
|
|
|
72537
72581
|
// ../../modules/app/contract/src/app.config.ts
|
|
72538
72582
|
var appConfig = Config.define((c) => ({
|
package/package.json
CHANGED