@nomad-e/bluma-cli 0.0.21 → 0.0.22
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 +60 -34
- package/package.json +1 -1
package/dist/main.js
CHANGED
|
@@ -7,7 +7,7 @@ import { v4 as uuidv42 } from "uuid";
|
|
|
7
7
|
|
|
8
8
|
// src/app/ui/App.tsx
|
|
9
9
|
import { useState as useState4, useEffect as useEffect3, useRef, useCallback, memo as memo4 } from "react";
|
|
10
|
-
import { Box as
|
|
10
|
+
import { Box as Box14, Text as Text13, Static } from "ink";
|
|
11
11
|
|
|
12
12
|
// src/app/ui/layout.tsx
|
|
13
13
|
import { Box, Text } from "ink";
|
|
@@ -2528,8 +2528,37 @@ async function checkForUpdates() {
|
|
|
2528
2528
|
}
|
|
2529
2529
|
}
|
|
2530
2530
|
|
|
2531
|
-
// src/app/ui/
|
|
2531
|
+
// src/app/ui/components/UpdateNotice.tsx
|
|
2532
|
+
import { Box as Box13, Text as Text12 } from "ink";
|
|
2532
2533
|
import { jsx as jsx13, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
2534
|
+
function parseUpdateMessage(msg) {
|
|
2535
|
+
const lines = msg.split(/\r?\n/).map((l) => l.trim());
|
|
2536
|
+
const first = lines[0] || "";
|
|
2537
|
+
const hintLine = lines.slice(1).join(" ") || "";
|
|
2538
|
+
const nameMatch = first.match(/Update available for\s+([^!]+)!/i);
|
|
2539
|
+
const versionMatch = first.match(/!\s*([^\s]+)\s*→\s*([^\s]+)/);
|
|
2540
|
+
const name = nameMatch?.[1]?.trim();
|
|
2541
|
+
const current = versionMatch?.[1]?.trim();
|
|
2542
|
+
const latest = versionMatch?.[2]?.trim();
|
|
2543
|
+
return {
|
|
2544
|
+
name,
|
|
2545
|
+
current,
|
|
2546
|
+
latest,
|
|
2547
|
+
hint: hintLine || void 0
|
|
2548
|
+
};
|
|
2549
|
+
}
|
|
2550
|
+
var UpdateNotice = ({ message }) => {
|
|
2551
|
+
const { name, current, latest, hint } = parseUpdateMessage(message);
|
|
2552
|
+
return /* @__PURE__ */ jsxs11(Box13, { flexDirection: "column", marginBottom: 1, children: [
|
|
2553
|
+
/* @__PURE__ */ jsx13(Text12, { color: "yellow", bold: true, children: "Update Available" }),
|
|
2554
|
+
name && current && latest ? /* @__PURE__ */ jsx13(Text12, { color: "gray", children: `${name}: ${current} \u2192 ${latest}` }) : /* @__PURE__ */ jsx13(Text12, { color: "gray", children: message }),
|
|
2555
|
+
hint ? /* @__PURE__ */ jsx13(Text12, { color: "gray", children: hint }) : null
|
|
2556
|
+
] });
|
|
2557
|
+
};
|
|
2558
|
+
var UpdateNotice_default = UpdateNotice;
|
|
2559
|
+
|
|
2560
|
+
// src/app/ui/App.tsx
|
|
2561
|
+
import { jsx as jsx14, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
2533
2562
|
var AppComponent = ({ eventBus: eventBus2, sessionId: sessionId2 }) => {
|
|
2534
2563
|
const agentInstance = useRef(null);
|
|
2535
2564
|
const [history, setHistory] = useState4([]);
|
|
@@ -2558,7 +2587,7 @@ var AppComponent = ({ eventBus: eventBus2, sessionId: sessionId2 }) => {
|
|
|
2558
2587
|
...prev,
|
|
2559
2588
|
{
|
|
2560
2589
|
id: prev.length,
|
|
2561
|
-
component: /* @__PURE__ */
|
|
2590
|
+
component: /* @__PURE__ */ jsx14(Text13, { color: "yellow", children: "-- Task cancelled by dev. --" })
|
|
2562
2591
|
}
|
|
2563
2592
|
]);
|
|
2564
2593
|
}, [isProcessing, eventBus2]);
|
|
@@ -2575,11 +2604,11 @@ var AppComponent = ({ eventBus: eventBus2, sessionId: sessionId2 }) => {
|
|
|
2575
2604
|
...prev,
|
|
2576
2605
|
{
|
|
2577
2606
|
id: prev.length,
|
|
2578
|
-
component: /* @__PURE__ */
|
|
2607
|
+
component: /* @__PURE__ */ jsx14(Box14, { marginBottom: 1, children: /* @__PURE__ */ jsx14(Text13, { color: "white", dimColor: true, children: text }) })
|
|
2579
2608
|
},
|
|
2580
2609
|
{
|
|
2581
2610
|
id: prev.length + 1,
|
|
2582
|
-
component: /* @__PURE__ */
|
|
2611
|
+
component: /* @__PURE__ */ jsx14(SlashCommands_default, { input: text, setHistory, agentRef: agentInstance })
|
|
2583
2612
|
}
|
|
2584
2613
|
]);
|
|
2585
2614
|
setIsProcessing(false);
|
|
@@ -2593,8 +2622,8 @@ var AppComponent = ({ eventBus: eventBus2, sessionId: sessionId2 }) => {
|
|
|
2593
2622
|
id: prev.length,
|
|
2594
2623
|
component: (
|
|
2595
2624
|
// Uma única Box para o espaçamento
|
|
2596
|
-
/* @__PURE__ */
|
|
2597
|
-
/* @__PURE__ */
|
|
2625
|
+
/* @__PURE__ */ jsx14(Box14, { marginBottom: 1, children: /* @__PURE__ */ jsxs12(Text13, { color: "white", dimColor: true, children: [
|
|
2626
|
+
/* @__PURE__ */ jsxs12(Text13, { color: "white", children: [
|
|
2598
2627
|
">",
|
|
2599
2628
|
" "
|
|
2600
2629
|
] }),
|
|
@@ -2629,7 +2658,7 @@ var AppComponent = ({ eventBus: eventBus2, sessionId: sessionId2 }) => {
|
|
|
2629
2658
|
[]
|
|
2630
2659
|
);
|
|
2631
2660
|
useEffect3(() => {
|
|
2632
|
-
setHistory([{ id: 0, component: /* @__PURE__ */
|
|
2661
|
+
setHistory([{ id: 0, component: /* @__PURE__ */ jsx14(Header, {}) }]);
|
|
2633
2662
|
const initializeAgent = async () => {
|
|
2634
2663
|
try {
|
|
2635
2664
|
agentInstance.current = new Agent(sessionId2, eventBus2);
|
|
@@ -2681,7 +2710,7 @@ var AppComponent = ({ eventBus: eventBus2, sessionId: sessionId2 }) => {
|
|
|
2681
2710
|
if (prev.length < 2) {
|
|
2682
2711
|
newHistory.push({
|
|
2683
2712
|
id: 1,
|
|
2684
|
-
component: /* @__PURE__ */
|
|
2713
|
+
component: /* @__PURE__ */ jsx14(
|
|
2685
2714
|
SessionInfo,
|
|
2686
2715
|
{
|
|
2687
2716
|
sessionId: sessionId2,
|
|
@@ -2702,10 +2731,7 @@ var AppComponent = ({ eventBus: eventBus2, sessionId: sessionId2 }) => {
|
|
|
2702
2731
|
...prev,
|
|
2703
2732
|
{
|
|
2704
2733
|
id: prev.length,
|
|
2705
|
-
component: /* @__PURE__ */
|
|
2706
|
-
/* @__PURE__ */ jsx13(Text12, { color: "white", bold: true, children: "Update Available" }),
|
|
2707
|
-
/* @__PURE__ */ jsx13(Text12, { color: "gray", children: msg })
|
|
2708
|
-
] })
|
|
2734
|
+
component: /* @__PURE__ */ jsx14(UpdateNotice_default, { message: msg })
|
|
2709
2735
|
}
|
|
2710
2736
|
]);
|
|
2711
2737
|
}
|
|
@@ -2719,10 +2745,10 @@ var AppComponent = ({ eventBus: eventBus2, sessionId: sessionId2 }) => {
|
|
|
2719
2745
|
}
|
|
2720
2746
|
let newComponent = null;
|
|
2721
2747
|
if (parsed.type === "debug") {
|
|
2722
|
-
newComponent = /* @__PURE__ */
|
|
2748
|
+
newComponent = /* @__PURE__ */ jsx14(Text13, { color: "gray", children: parsed.message });
|
|
2723
2749
|
} else if (parsed.type === "protocol_violation") {
|
|
2724
|
-
newComponent = /* @__PURE__ */
|
|
2725
|
-
|
|
2750
|
+
newComponent = /* @__PURE__ */ jsxs12(
|
|
2751
|
+
Box14,
|
|
2726
2752
|
{
|
|
2727
2753
|
borderStyle: "round",
|
|
2728
2754
|
borderColor: "yellow",
|
|
@@ -2730,19 +2756,19 @@ var AppComponent = ({ eventBus: eventBus2, sessionId: sessionId2 }) => {
|
|
|
2730
2756
|
marginBottom: 1,
|
|
2731
2757
|
paddingX: 1,
|
|
2732
2758
|
children: [
|
|
2733
|
-
/* @__PURE__ */
|
|
2734
|
-
/* @__PURE__ */
|
|
2735
|
-
/* @__PURE__ */
|
|
2759
|
+
/* @__PURE__ */ jsx14(Text13, { color: "yellow", bold: true, children: "Protocol Violation" }),
|
|
2760
|
+
/* @__PURE__ */ jsx14(Text13, { color: "gray", children: parsed.content }),
|
|
2761
|
+
/* @__PURE__ */ jsx14(Text13, { color: "yellow", children: parsed.message })
|
|
2736
2762
|
]
|
|
2737
2763
|
}
|
|
2738
2764
|
);
|
|
2739
2765
|
} else if (parsed.type === "error") {
|
|
2740
|
-
newComponent = /* @__PURE__ */
|
|
2766
|
+
newComponent = /* @__PURE__ */ jsxs12(Text13, { color: "red", children: [
|
|
2741
2767
|
"\u274C ",
|
|
2742
2768
|
parsed.message
|
|
2743
2769
|
] });
|
|
2744
2770
|
} else if (parsed.type === "tool_call") {
|
|
2745
|
-
newComponent = /* @__PURE__ */
|
|
2771
|
+
newComponent = /* @__PURE__ */ jsx14(
|
|
2746
2772
|
ToolCallDisplay,
|
|
2747
2773
|
{
|
|
2748
2774
|
toolName: parsed.tool_name,
|
|
@@ -2751,7 +2777,7 @@ var AppComponent = ({ eventBus: eventBus2, sessionId: sessionId2 }) => {
|
|
|
2751
2777
|
}
|
|
2752
2778
|
);
|
|
2753
2779
|
} else if (parsed.type === "tool_result") {
|
|
2754
|
-
newComponent = /* @__PURE__ */
|
|
2780
|
+
newComponent = /* @__PURE__ */ jsx14(
|
|
2755
2781
|
ToolResultDisplay,
|
|
2756
2782
|
{
|
|
2757
2783
|
toolName: parsed.tool_name,
|
|
@@ -2759,15 +2785,15 @@ var AppComponent = ({ eventBus: eventBus2, sessionId: sessionId2 }) => {
|
|
|
2759
2785
|
}
|
|
2760
2786
|
);
|
|
2761
2787
|
} else if (parsed.type === "dev_overlay") {
|
|
2762
|
-
newComponent = /* @__PURE__ */
|
|
2763
|
-
/* @__PURE__ */
|
|
2788
|
+
newComponent = /* @__PURE__ */ jsx14(Box14, { marginBottom: 1, children: /* @__PURE__ */ jsxs12(Text13, { color: "gray", children: [
|
|
2789
|
+
/* @__PURE__ */ jsxs12(Text13, { color: "blue", children: [
|
|
2764
2790
|
">",
|
|
2765
2791
|
" "
|
|
2766
2792
|
] }),
|
|
2767
2793
|
parsed.payload
|
|
2768
2794
|
] }) });
|
|
2769
2795
|
} else if (parsed.type === "log") {
|
|
2770
|
-
newComponent = /* @__PURE__ */
|
|
2796
|
+
newComponent = /* @__PURE__ */ jsxs12(Text13, { color: "gray", children: [
|
|
2771
2797
|
"\u2139\uFE0F ",
|
|
2772
2798
|
parsed.message,
|
|
2773
2799
|
parsed.payload ? `: ${parsed.payload}` : ""
|
|
@@ -2797,12 +2823,12 @@ var AppComponent = ({ eventBus: eventBus2, sessionId: sessionId2 }) => {
|
|
|
2797
2823
|
}, [eventBus2, sessionId2, handleConfirmation]);
|
|
2798
2824
|
const renderInteractiveComponent = () => {
|
|
2799
2825
|
if (mcpStatus !== "connected") {
|
|
2800
|
-
return /* @__PURE__ */
|
|
2801
|
-
|
|
2826
|
+
return /* @__PURE__ */ jsx14(
|
|
2827
|
+
Box14,
|
|
2802
2828
|
{
|
|
2803
2829
|
borderStyle: "round",
|
|
2804
2830
|
borderColor: "black",
|
|
2805
|
-
children: /* @__PURE__ */
|
|
2831
|
+
children: /* @__PURE__ */ jsx14(
|
|
2806
2832
|
SessionInfoConnectingMCP_default,
|
|
2807
2833
|
{
|
|
2808
2834
|
sessionId: sessionId2,
|
|
@@ -2814,7 +2840,7 @@ var AppComponent = ({ eventBus: eventBus2, sessionId: sessionId2 }) => {
|
|
|
2814
2840
|
);
|
|
2815
2841
|
}
|
|
2816
2842
|
if (pendingConfirmation) {
|
|
2817
|
-
return /* @__PURE__ */
|
|
2843
|
+
return /* @__PURE__ */ jsx14(
|
|
2818
2844
|
ConfirmationPrompt,
|
|
2819
2845
|
{
|
|
2820
2846
|
toolCalls: pendingConfirmation,
|
|
@@ -2826,9 +2852,9 @@ var AppComponent = ({ eventBus: eventBus2, sessionId: sessionId2 }) => {
|
|
|
2826
2852
|
}
|
|
2827
2853
|
);
|
|
2828
2854
|
}
|
|
2829
|
-
return /* @__PURE__ */
|
|
2830
|
-
isProcessing && !pendingConfirmation && /* @__PURE__ */
|
|
2831
|
-
/* @__PURE__ */
|
|
2855
|
+
return /* @__PURE__ */ jsxs12(Box14, { flexDirection: "column", children: [
|
|
2856
|
+
isProcessing && !pendingConfirmation && /* @__PURE__ */ jsx14(WorkingTimer, {}),
|
|
2857
|
+
/* @__PURE__ */ jsx14(
|
|
2832
2858
|
InputPrompt,
|
|
2833
2859
|
{
|
|
2834
2860
|
onSubmit: handleSubmit,
|
|
@@ -2838,8 +2864,8 @@ var AppComponent = ({ eventBus: eventBus2, sessionId: sessionId2 }) => {
|
|
|
2838
2864
|
)
|
|
2839
2865
|
] });
|
|
2840
2866
|
};
|
|
2841
|
-
return /* @__PURE__ */
|
|
2842
|
-
/* @__PURE__ */
|
|
2867
|
+
return /* @__PURE__ */ jsxs12(Box14, { flexDirection: "column", children: [
|
|
2868
|
+
/* @__PURE__ */ jsx14(Static, { items: history, children: (item) => /* @__PURE__ */ jsx14(Box14, { children: item.component }, item.id) }),
|
|
2843
2869
|
renderInteractiveComponent()
|
|
2844
2870
|
] });
|
|
2845
2871
|
};
|