@nomad-e/bluma-cli 0.0.15 → 0.0.16
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/main.js +50 -34
- package/package.json +1 -1
package/dist/main.js
CHANGED
|
@@ -2464,6 +2464,38 @@ var SlashCommands = ({ input, setHistory, agentRef }) => {
|
|
|
2464
2464
|
};
|
|
2465
2465
|
var SlashCommands_default = SlashCommands;
|
|
2466
2466
|
|
|
2467
|
+
// src/app/agent/utils/update_check.ts
|
|
2468
|
+
import updateNotifier from "update-notifier";
|
|
2469
|
+
import { readPackageUp } from "read-package-up";
|
|
2470
|
+
import { fileURLToPath as fileURLToPath3 } from "url";
|
|
2471
|
+
import path9 from "path";
|
|
2472
|
+
async function checkForUpdates() {
|
|
2473
|
+
try {
|
|
2474
|
+
if (process.env.BLUMA_FORCE_UPDATE_MSG) {
|
|
2475
|
+
return String(process.env.BLUMA_FORCE_UPDATE_MSG);
|
|
2476
|
+
}
|
|
2477
|
+
const __filename = fileURLToPath3(import.meta.url);
|
|
2478
|
+
const __dirname = path9.dirname(__filename);
|
|
2479
|
+
const result = await readPackageUp({ cwd: __dirname });
|
|
2480
|
+
const pkg = result?.packageJson;
|
|
2481
|
+
if (!pkg?.name || !pkg?.version) return null;
|
|
2482
|
+
const notifier = updateNotifier({
|
|
2483
|
+
pkg: { name: pkg.name, version: pkg.version },
|
|
2484
|
+
// check daily to avoid excessive network calls
|
|
2485
|
+
updateCheckInterval: 1e3 * 60 * 60 * 24,
|
|
2486
|
+
shouldNotifyInNpmScript: true
|
|
2487
|
+
});
|
|
2488
|
+
if (notifier.update && !process.env.CI) {
|
|
2489
|
+
return `Update available for ${pkg.name}! ${notifier.update.current} \u2192 ${notifier.update.latest}
|
|
2490
|
+
Run npm i -g ${pkg.name} to update.`;
|
|
2491
|
+
}
|
|
2492
|
+
return null;
|
|
2493
|
+
} catch (e) {
|
|
2494
|
+
console.warn("Update check failed:", e);
|
|
2495
|
+
return null;
|
|
2496
|
+
}
|
|
2497
|
+
}
|
|
2498
|
+
|
|
2467
2499
|
// src/app/ui/App.tsx
|
|
2468
2500
|
import { jsx as jsx13, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
2469
2501
|
var AppComponent = ({ eventBus: eventBus2, sessionId: sessionId2 }) => {
|
|
@@ -2485,6 +2517,7 @@ var AppComponent = ({ eventBus: eventBus2, sessionId: sessionId2 }) => {
|
|
|
2485
2517
|
);
|
|
2486
2518
|
const alwaysAcceptList = useRef([]);
|
|
2487
2519
|
const workdir = process.cwd();
|
|
2520
|
+
const updateCheckRan = useRef(false);
|
|
2488
2521
|
const handleInterrupt = useCallback(() => {
|
|
2489
2522
|
if (!isProcessing) return;
|
|
2490
2523
|
eventBus2.emit("user_interrupt");
|
|
@@ -2629,6 +2662,23 @@ var AppComponent = ({ eventBus: eventBus2, sessionId: sessionId2 }) => {
|
|
|
2629
2662
|
}
|
|
2630
2663
|
return newHistory;
|
|
2631
2664
|
});
|
|
2665
|
+
if (!updateCheckRan.current) {
|
|
2666
|
+
updateCheckRan.current = true;
|
|
2667
|
+
Promise.resolve().then(() => checkForUpdates()).then((msg) => {
|
|
2668
|
+
if (msg) {
|
|
2669
|
+
setHistory((prev) => [
|
|
2670
|
+
...prev,
|
|
2671
|
+
{
|
|
2672
|
+
id: prev.length,
|
|
2673
|
+
component: /* @__PURE__ */ jsxs11(Box13, { borderStyle: "round", borderColor: "yellow", paddingX: 1, marginBottom: 1, flexDirection: "column", children: [
|
|
2674
|
+
/* @__PURE__ */ jsx13(Text12, { color: "white", bold: true, children: "Update Available" }),
|
|
2675
|
+
/* @__PURE__ */ jsx13(Text12, { color: "gray", children: msg })
|
|
2676
|
+
] })
|
|
2677
|
+
}
|
|
2678
|
+
]);
|
|
2679
|
+
}
|
|
2680
|
+
}).catch(() => void 0);
|
|
2681
|
+
}
|
|
2632
2682
|
return;
|
|
2633
2683
|
}
|
|
2634
2684
|
if (parsed.type === "error") {
|
|
@@ -2764,41 +2814,7 @@ var AppComponent = ({ eventBus: eventBus2, sessionId: sessionId2 }) => {
|
|
|
2764
2814
|
var App = memo4(AppComponent);
|
|
2765
2815
|
var App_default = App;
|
|
2766
2816
|
|
|
2767
|
-
// src/app/agent/utils/update_check.ts
|
|
2768
|
-
import updateNotifier from "update-notifier";
|
|
2769
|
-
import { readPackageUp } from "read-package-up";
|
|
2770
|
-
import { fileURLToPath as fileURLToPath3 } from "url";
|
|
2771
|
-
import path9 from "path";
|
|
2772
|
-
async function checkForUpdates() {
|
|
2773
|
-
try {
|
|
2774
|
-
const __filename = fileURLToPath3(import.meta.url);
|
|
2775
|
-
const __dirname = path9.dirname(__filename);
|
|
2776
|
-
const result = await readPackageUp({ cwd: __dirname });
|
|
2777
|
-
const pkg = result?.packageJson;
|
|
2778
|
-
if (!pkg?.name || !pkg?.version) return null;
|
|
2779
|
-
const notifier = updateNotifier({
|
|
2780
|
-
pkg: { name: pkg.name, version: pkg.version },
|
|
2781
|
-
// check daily to avoid excessive network calls
|
|
2782
|
-
updateCheckInterval: 1e3 * 60 * 60 * 24,
|
|
2783
|
-
shouldNotifyInNpmScript: true
|
|
2784
|
-
});
|
|
2785
|
-
if (notifier.update && !process.env.CI) {
|
|
2786
|
-
return `Update available for ${pkg.name}! ${notifier.update.current} \u2192 ${notifier.update.latest}
|
|
2787
|
-
Run npm i -g ${pkg.name} to update.`;
|
|
2788
|
-
}
|
|
2789
|
-
return null;
|
|
2790
|
-
} catch (e) {
|
|
2791
|
-
console.warn("Update check failed:", e);
|
|
2792
|
-
return null;
|
|
2793
|
-
}
|
|
2794
|
-
}
|
|
2795
|
-
|
|
2796
2817
|
// src/main.ts
|
|
2797
|
-
void checkForUpdates().then((msg) => {
|
|
2798
|
-
if (msg) {
|
|
2799
|
-
console.log("" + msg);
|
|
2800
|
-
}
|
|
2801
|
-
}).catch(() => void 0);
|
|
2802
2818
|
var eventBus = new EventEmitter2();
|
|
2803
2819
|
var sessionId = uuidv42();
|
|
2804
2820
|
var props = {
|