usebeeline 0.0.56 → 0.0.57
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/usebeeline.mjs +42 -16
- package/package.json +1 -1
package/dist/usebeeline.mjs
CHANGED
|
@@ -291,6 +291,7 @@ __export(self_update_exports, {
|
|
|
291
291
|
beelineInstallLayout: () => beelineInstallLayout,
|
|
292
292
|
defaultBeelineInstallLayout: () => defaultBeelineInstallLayout,
|
|
293
293
|
describeIdentity: () => describeIdentity,
|
|
294
|
+
discoveredBeelineInstallLayout: () => discoveredBeelineInstallLayout,
|
|
294
295
|
hostPlatformKey: () => hostPlatformKey,
|
|
295
296
|
normalizeLegacyBundleShape: () => normalizeLegacyBundleShape,
|
|
296
297
|
readInstalledBundleIdentity: () => readInstalledBundleIdentity,
|
|
@@ -345,6 +346,15 @@ function defaultBeelineInstallLayout(env = process.env) {
|
|
|
345
346
|
const home = env.HOME?.trim() || homedir9();
|
|
346
347
|
return anchorLayout(resolve21(home, ".local", "lib", "beeline"));
|
|
347
348
|
}
|
|
349
|
+
function discoveredBeelineInstallLayout(env = process.env) {
|
|
350
|
+
const explicitAnchor = env.BEELINE_INSTALL_LIB_DIR?.trim();
|
|
351
|
+
if (explicitAnchor)
|
|
352
|
+
return anchorLayout(explicitAnchor);
|
|
353
|
+
const explicitBinDir = env.BEELINE_INSTALL_DIR?.trim();
|
|
354
|
+
if (explicitBinDir)
|
|
355
|
+
return anchorLayout(resolve21(dirname9(resolve21(explicitBinDir)), "lib", "beeline"));
|
|
356
|
+
return defaultBeelineInstallLayout(env);
|
|
357
|
+
}
|
|
348
358
|
function hostPlatformKey() {
|
|
349
359
|
const os = process.platform === "linux" ? "linux" : process.platform === "darwin" ? "darwin" : "";
|
|
350
360
|
const arch = process.arch === "x64" ? "x64" : process.arch === "arm64" ? "arm64" : "";
|
|
@@ -639,27 +649,38 @@ async function normalizeLegacyBundleShape(bundleDir) {
|
|
|
639
649
|
}
|
|
640
650
|
}
|
|
641
651
|
async function writeBinForwarders(layout, activeBundleRoot) {
|
|
642
|
-
|
|
652
|
+
const entries = [
|
|
653
|
+
...FORWARDER_TOOLS.map((tool) => [tool, tool]),
|
|
654
|
+
...Object.entries(FORWARDER_ALIASES).map(([alias, tool]) => [alias, tool])
|
|
655
|
+
];
|
|
656
|
+
for (const [name, tool] of entries) {
|
|
643
657
|
const target = join7(activeBundleRoot, "bin", tool);
|
|
644
658
|
try {
|
|
645
659
|
await access(target, fsConstants.X_OK);
|
|
646
660
|
} catch {
|
|
647
661
|
continue;
|
|
648
662
|
}
|
|
649
|
-
await replaceFile(join7(layout.binDir,
|
|
663
|
+
await replaceFile(join7(layout.binDir, name), forwarderScript(tool), 493);
|
|
650
664
|
}
|
|
651
665
|
}
|
|
652
666
|
async function repairInstallForwarders(layout, opts = {}) {
|
|
653
667
|
if (await pathKind(layout.libDir) !== "symlink")
|
|
654
668
|
return false;
|
|
655
|
-
const
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
669
|
+
const forwarderHealthy = async (name, tool) => {
|
|
670
|
+
let current;
|
|
671
|
+
try {
|
|
672
|
+
current = await readFile9(join7(layout.binDir, name), "utf8");
|
|
673
|
+
} catch {
|
|
674
|
+
current = void 0;
|
|
675
|
+
}
|
|
676
|
+
return current === forwarderScript(tool);
|
|
677
|
+
};
|
|
678
|
+
let healthy = await forwarderHealthy("beeline", "beeline");
|
|
679
|
+
for (const [alias, tool] of Object.entries(FORWARDER_ALIASES)) {
|
|
680
|
+
if (!await forwarderHealthy(alias, tool))
|
|
681
|
+
healthy = false;
|
|
661
682
|
}
|
|
662
|
-
if (
|
|
683
|
+
if (healthy)
|
|
663
684
|
return false;
|
|
664
685
|
await mkdir13(layout.binDir, { recursive: true });
|
|
665
686
|
await writeBinForwarders(layout, layout.libDir);
|
|
@@ -741,7 +762,7 @@ function describeIdentity(identity) {
|
|
|
741
762
|
parts.push(identity.commit.slice(0, 12));
|
|
742
763
|
return parts.join(" ") || "unknown";
|
|
743
764
|
}
|
|
744
|
-
var RELEASES_SEGMENT, BUNDLE_ENTRYPOINT, PI_MCP_ADAPTER_ENTRYPOINT, FORWARDER_TOOLS, LEGACY_FLAT_BUNDLE_FILES, DEFAULT_UPDATE_CONFIRM_WINDOW_MS, SelfUpdateManager;
|
|
765
|
+
var RELEASES_SEGMENT, BUNDLE_ENTRYPOINT, PI_MCP_ADAPTER_ENTRYPOINT, FORWARDER_TOOLS, FORWARDER_ALIASES, LEGACY_FLAT_BUNDLE_FILES, DEFAULT_UPDATE_CONFIRM_WINDOW_MS, SelfUpdateManager;
|
|
745
766
|
var init_self_update = __esm({
|
|
746
767
|
"apps/body/dist/self-update.js"() {
|
|
747
768
|
"use strict";
|
|
@@ -750,6 +771,9 @@ var init_self_update = __esm({
|
|
|
750
771
|
BUNDLE_ENTRYPOINT = "lib/beeline/beeline-cli.mjs";
|
|
751
772
|
PI_MCP_ADAPTER_ENTRYPOINT = "lib/beeline/pi-mcp-adapter.mjs";
|
|
752
773
|
FORWARDER_TOOLS = ["beeline", "buzz-agent", "buzz-dev-mcp", "beeline-readonly-mcp"];
|
|
774
|
+
FORWARDER_ALIASES = {
|
|
775
|
+
usebeeline: "beeline"
|
|
776
|
+
};
|
|
753
777
|
LEGACY_FLAT_BUNDLE_FILES = [
|
|
754
778
|
"beeline-cli.mjs",
|
|
755
779
|
"beeline-readonly-mcp.mjs",
|
|
@@ -21208,12 +21232,14 @@ default 30s) with the same busy gate; BEELINE_UPDATE_DISABLE=1 turns the
|
|
|
21208
21232
|
automatic path off. \`beeline update\` always works.
|
|
21209
21233
|
`);
|
|
21210
21234
|
}
|
|
21211
|
-
function requireLayout() {
|
|
21235
|
+
async function requireLayout() {
|
|
21212
21236
|
const layout = beelineInstallLayout(process.env);
|
|
21213
|
-
if (
|
|
21214
|
-
|
|
21215
|
-
|
|
21216
|
-
|
|
21237
|
+
if (layout)
|
|
21238
|
+
return layout;
|
|
21239
|
+
const discovered = discoveredBeelineInstallLayout(process.env);
|
|
21240
|
+
if (await readInstalledBundleIdentity(discovered) !== void 0)
|
|
21241
|
+
return discovered;
|
|
21242
|
+
throw new Error("this host has no Beeline install; run `npx usebeeline connect` first.");
|
|
21217
21243
|
}
|
|
21218
21244
|
async function runningDaemonConfigPaths() {
|
|
21219
21245
|
const cwd = process.cwd();
|
|
@@ -21261,7 +21287,7 @@ async function runUpdateCommand(args) {
|
|
|
21261
21287
|
updateUsage();
|
|
21262
21288
|
return;
|
|
21263
21289
|
}
|
|
21264
|
-
const layout = requireLayout();
|
|
21290
|
+
const layout = await requireLayout();
|
|
21265
21291
|
const manifestUrlFlag = args.indexOf("--manifest-url");
|
|
21266
21292
|
const manifestUrl = manifestUrlFlag >= 0 && args[manifestUrlFlag + 1] ? args[manifestUrlFlag + 1] : resolveManifestUrl(process.env);
|
|
21267
21293
|
const checkOnly = args.includes("--check");
|