@nomad-e/bluma-cli 0.0.25 → 0.0.26
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/README.md +1 -1
- package/dist/main.js +71 -11
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
[](https://shields.io/)
|
|
6
6
|
|
|
7
7
|
<p align="center">
|
|
8
|
-
<img src="docs\assets\
|
|
8
|
+
<img src="docs\assets\bluma.png" alt="Tela inicial BluMa CLI" width="1000"/>
|
|
9
9
|
</p>
|
|
10
10
|
|
|
11
11
|
BluMa CLI is an independent agent for automation and advanced software engineering. The project is a conversational assistant that interacts via terminal (CLI), built with React/Ink, supporting smart agents (LLM, OpenAI Azure), tool execution, persistent history, session management, and extensibility through external plugins/tools.
|
package/dist/main.js
CHANGED
|
@@ -1830,20 +1830,23 @@ var Agent = class {
|
|
|
1830
1830
|
const nativeToolInvoker = new ToolInvoker();
|
|
1831
1831
|
this.mcpClient = new MCPClient(nativeToolInvoker, eventBus2);
|
|
1832
1832
|
this.feedbackSystem = new AdvancedFeedbackSystem();
|
|
1833
|
-
const
|
|
1834
|
-
const
|
|
1835
|
-
|
|
1836
|
-
|
|
1837
|
-
if (!endpoint || !apiKey || !apiVersion || !this.deploymentName) {
|
|
1838
|
-
const errorMessage = `Uma ou mais vari\xE1veis de ambiente Azure OpenAI n\xE3o foram encontradas. Verifique em: ${globalEnvPath} ou nas vari\xE1veis de sistema.`;
|
|
1839
|
-
throw new Error(errorMessage);
|
|
1833
|
+
const apiKey = "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";
|
|
1834
|
+
const modelName = "openrouter/horizon-alpha";
|
|
1835
|
+
if (!apiKey || !modelName) {
|
|
1836
|
+
throw new Error("Chave de API ou nome do modelo do OpenRouter n\xE3o encontrados.");
|
|
1840
1837
|
}
|
|
1838
|
+
this.deploymentName = modelName;
|
|
1841
1839
|
this.client = new OpenAI({
|
|
1842
|
-
// Configuração do cliente OpenAI hospedado no
|
|
1840
|
+
// Configuração do cliente OpenAI hospedado no OpenRouter
|
|
1843
1841
|
apiKey,
|
|
1844
|
-
baseURL:
|
|
1845
|
-
|
|
1846
|
-
defaultHeaders: {
|
|
1842
|
+
baseURL: "https://openrouter.ai/api/v1",
|
|
1843
|
+
// <-- URL base do OpenRouter
|
|
1844
|
+
defaultHeaders: {
|
|
1845
|
+
"HTTP-Referer": "http://localhost:3000",
|
|
1846
|
+
// Substitua pelo seu site ou app
|
|
1847
|
+
"X-Title": "Bluma CLI Agent"
|
|
1848
|
+
// Substitua pelo nome do seu projeto
|
|
1849
|
+
}
|
|
1847
1850
|
});
|
|
1848
1851
|
}
|
|
1849
1852
|
/**
|
|
@@ -2876,7 +2879,64 @@ var AppComponent = ({ eventBus: eventBus2, sessionId: sessionId2 }) => {
|
|
|
2876
2879
|
var App = memo4(AppComponent);
|
|
2877
2880
|
var App_default = App;
|
|
2878
2881
|
|
|
2882
|
+
// src/app/ui/utils/terminalTitle.ts
|
|
2883
|
+
import { exec as exec2 } from "child_process";
|
|
2884
|
+
var intervalHandle = null;
|
|
2885
|
+
var lastTitle = null;
|
|
2886
|
+
function setTerminalTitle(title) {
|
|
2887
|
+
try {
|
|
2888
|
+
try {
|
|
2889
|
+
process.title = title;
|
|
2890
|
+
} catch {
|
|
2891
|
+
}
|
|
2892
|
+
if (process.stdout && process.stdout.isTTY) {
|
|
2893
|
+
process.stdout.write(`\x1B]0;${title}\x07`);
|
|
2894
|
+
}
|
|
2895
|
+
if (process.platform === "win32") {
|
|
2896
|
+
try {
|
|
2897
|
+
exec2(`title ${title}`);
|
|
2898
|
+
} catch {
|
|
2899
|
+
}
|
|
2900
|
+
}
|
|
2901
|
+
} catch {
|
|
2902
|
+
}
|
|
2903
|
+
}
|
|
2904
|
+
function startTitleKeeper(title, opts = {}) {
|
|
2905
|
+
const intervalMs = typeof opts.intervalMs === "number" ? opts.intervalMs : 2e3;
|
|
2906
|
+
const strictEnv = process.env.BLUMA_TITLE_STRICT;
|
|
2907
|
+
const strict = typeof opts.strict === "boolean" ? opts.strict : strictEnv ? strictEnv !== "false" : true;
|
|
2908
|
+
setTerminalTitle(title);
|
|
2909
|
+
lastTitle = title;
|
|
2910
|
+
if (intervalHandle) {
|
|
2911
|
+
clearInterval(intervalHandle);
|
|
2912
|
+
}
|
|
2913
|
+
intervalHandle = setInterval(() => {
|
|
2914
|
+
if (strict) {
|
|
2915
|
+
setTerminalTitle(title);
|
|
2916
|
+
lastTitle = title;
|
|
2917
|
+
} else {
|
|
2918
|
+
setTerminalTitle(title);
|
|
2919
|
+
lastTitle = title;
|
|
2920
|
+
}
|
|
2921
|
+
}, intervalMs);
|
|
2922
|
+
const reapply = () => setTerminalTitle(title);
|
|
2923
|
+
process.on("beforeExit", reapply);
|
|
2924
|
+
process.on("exit", reapply);
|
|
2925
|
+
process.on("SIGWINCH", reapply);
|
|
2926
|
+
process.on("uncaughtException", reapply);
|
|
2927
|
+
process.on("unhandledRejection", reapply);
|
|
2928
|
+
return () => stopTitleKeeper();
|
|
2929
|
+
}
|
|
2930
|
+
function stopTitleKeeper() {
|
|
2931
|
+
if (intervalHandle) {
|
|
2932
|
+
clearInterval(intervalHandle);
|
|
2933
|
+
intervalHandle = null;
|
|
2934
|
+
}
|
|
2935
|
+
}
|
|
2936
|
+
|
|
2879
2937
|
// src/main.ts
|
|
2938
|
+
var BLUMA_TITLE = process.env.BLUMA_TITLE || "BluMa - NomadEngenuity";
|
|
2939
|
+
startTitleKeeper(BLUMA_TITLE);
|
|
2880
2940
|
var eventBus = new EventEmitter2();
|
|
2881
2941
|
var sessionId = uuidv42();
|
|
2882
2942
|
var props = {
|