open-agents-ai 0.10.8 → 0.11.0
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/index.js +81 -7
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -7491,6 +7491,7 @@ async function handleSlashCommand(input, ctx) {
|
|
|
7491
7491
|
case "verbose":
|
|
7492
7492
|
case "v":
|
|
7493
7493
|
ctx.setVerbose(!ctx.config.verbose);
|
|
7494
|
+
ctx.saveSettings({ verbose: ctx.config.verbose });
|
|
7494
7495
|
renderInfo(`Verbose mode: ${ctx.config.verbose ? "on" : "off"}`);
|
|
7495
7496
|
return "handled";
|
|
7496
7497
|
case "config":
|
|
@@ -7526,9 +7527,12 @@ async function handleSlashCommand(input, ctx) {
|
|
|
7526
7527
|
case "voice": {
|
|
7527
7528
|
if (arg) {
|
|
7528
7529
|
const msg = await ctx.voiceSetModel(arg);
|
|
7530
|
+
ctx.saveSettings({ voice: true, voiceModel: arg });
|
|
7529
7531
|
renderInfo(msg);
|
|
7530
7532
|
} else {
|
|
7531
7533
|
const msg = await ctx.voiceToggle();
|
|
7534
|
+
const isOn = msg.toLowerCase().includes("enabled") || msg.toLowerCase().includes("on");
|
|
7535
|
+
ctx.saveSettings({ voice: isOn });
|
|
7532
7536
|
renderInfo(msg);
|
|
7533
7537
|
}
|
|
7534
7538
|
return "handled";
|
|
@@ -7626,6 +7630,7 @@ async function handleEndpoint(arg, ctx) {
|
|
|
7626
7630
|
if (apiKey) {
|
|
7627
7631
|
setConfigValue("apiKey", apiKey);
|
|
7628
7632
|
}
|
|
7633
|
+
ctx.saveSettings({ backendUrl: url, backendType, ...apiKey ? { apiKey } : {} });
|
|
7629
7634
|
process.stdout.write(`
|
|
7630
7635
|
${c2.green("\u2714")} Endpoint updated and saved:
|
|
7631
7636
|
`);
|
|
@@ -7707,6 +7712,7 @@ async function switchModel(query, ctx) {
|
|
|
7707
7712
|
}
|
|
7708
7713
|
const oldModel = ctx.config.model;
|
|
7709
7714
|
ctx.setModel(match.name);
|
|
7715
|
+
ctx.saveSettings({ model: match.name });
|
|
7710
7716
|
renderModelSwitch(oldModel, match.name);
|
|
7711
7717
|
} catch (err) {
|
|
7712
7718
|
renderError(`Failed to switch model: ${err instanceof Error ? err.message : String(err)}`);
|
|
@@ -8112,6 +8118,7 @@ var init_setup = __esm({
|
|
|
8112
8118
|
// packages/cli/dist/tui/oa-directory.js
|
|
8113
8119
|
import { existsSync as existsSync9, mkdirSync as mkdirSync4, readFileSync as readFileSync7, writeFileSync as writeFileSync4, readdirSync as readdirSync4, statSync as statSync5 } from "node:fs";
|
|
8114
8120
|
import { join as join14, relative as relative2, basename as basename2, extname as extname4 } from "node:path";
|
|
8121
|
+
import { homedir as homedir4 } from "node:os";
|
|
8115
8122
|
function initOaDirectory(repoRoot) {
|
|
8116
8123
|
const oaPath = join14(repoRoot, OA_DIR);
|
|
8117
8124
|
for (const sub of SUBDIRS) {
|
|
@@ -8122,6 +8129,45 @@ function initOaDirectory(repoRoot) {
|
|
|
8122
8129
|
function hasOaDirectory(repoRoot) {
|
|
8123
8130
|
return existsSync9(join14(repoRoot, OA_DIR, "index"));
|
|
8124
8131
|
}
|
|
8132
|
+
function loadProjectSettings(repoRoot) {
|
|
8133
|
+
const settingsPath = join14(repoRoot, OA_DIR, "settings.json");
|
|
8134
|
+
try {
|
|
8135
|
+
if (existsSync9(settingsPath)) {
|
|
8136
|
+
return JSON.parse(readFileSync7(settingsPath, "utf-8"));
|
|
8137
|
+
}
|
|
8138
|
+
} catch {
|
|
8139
|
+
}
|
|
8140
|
+
return {};
|
|
8141
|
+
}
|
|
8142
|
+
function saveProjectSettings(repoRoot, settings) {
|
|
8143
|
+
const oaPath = join14(repoRoot, OA_DIR);
|
|
8144
|
+
mkdirSync4(oaPath, { recursive: true });
|
|
8145
|
+
const existing = loadProjectSettings(repoRoot);
|
|
8146
|
+
const merged = { ...existing, ...settings };
|
|
8147
|
+
writeFileSync4(join14(oaPath, "settings.json"), JSON.stringify(merged, null, 2) + "\n", "utf-8");
|
|
8148
|
+
}
|
|
8149
|
+
function loadGlobalSettings() {
|
|
8150
|
+
const settingsPath = join14(homedir4(), ".open-agents", "settings.json");
|
|
8151
|
+
try {
|
|
8152
|
+
if (existsSync9(settingsPath)) {
|
|
8153
|
+
return JSON.parse(readFileSync7(settingsPath, "utf-8"));
|
|
8154
|
+
}
|
|
8155
|
+
} catch {
|
|
8156
|
+
}
|
|
8157
|
+
return {};
|
|
8158
|
+
}
|
|
8159
|
+
function saveGlobalSettings(settings) {
|
|
8160
|
+
const dir = join14(homedir4(), ".open-agents");
|
|
8161
|
+
mkdirSync4(dir, { recursive: true });
|
|
8162
|
+
const existing = loadGlobalSettings();
|
|
8163
|
+
const merged = { ...existing, ...settings };
|
|
8164
|
+
writeFileSync4(join14(dir, "settings.json"), JSON.stringify(merged, null, 2) + "\n", "utf-8");
|
|
8165
|
+
}
|
|
8166
|
+
function resolveSettings(repoRoot) {
|
|
8167
|
+
const global = loadGlobalSettings();
|
|
8168
|
+
const project = loadProjectSettings(repoRoot);
|
|
8169
|
+
return { ...global, ...project };
|
|
8170
|
+
}
|
|
8125
8171
|
function discoverContextFiles(repoRoot, maxContentLen = 8e3) {
|
|
8126
8172
|
const found = [];
|
|
8127
8173
|
const seen = /* @__PURE__ */ new Set();
|
|
@@ -8364,7 +8410,7 @@ var init_oa_directory = __esm({
|
|
|
8364
8410
|
"packages/cli/dist/tui/oa-directory.js"() {
|
|
8365
8411
|
"use strict";
|
|
8366
8412
|
OA_DIR = ".oa";
|
|
8367
|
-
SUBDIRS = ["memory", "index", "context", "history"];
|
|
8413
|
+
SUBDIRS = ["memory", "index", "context", "history", "notes", "embedded", "provenance"];
|
|
8368
8414
|
CONTEXT_FILES = [
|
|
8369
8415
|
"AGENTS.md",
|
|
8370
8416
|
"OA.md",
|
|
@@ -8401,7 +8447,7 @@ var init_oa_directory = __esm({
|
|
|
8401
8447
|
import { existsSync as existsSync10, readFileSync as readFileSync8, readdirSync as readdirSync5 } from "node:fs";
|
|
8402
8448
|
import { join as join15, basename as basename3 } from "node:path";
|
|
8403
8449
|
import { execSync as execSync9 } from "node:child_process";
|
|
8404
|
-
import { homedir as
|
|
8450
|
+
import { homedir as homedir5, platform, release } from "node:os";
|
|
8405
8451
|
function loadProjectFiles(repoRoot) {
|
|
8406
8452
|
const discovered = discoverContextFiles(repoRoot);
|
|
8407
8453
|
if (discovered.length === 0)
|
|
@@ -8473,7 +8519,7 @@ function loadMemoryContext(repoRoot) {
|
|
|
8473
8519
|
if (legacyEntries)
|
|
8474
8520
|
sections.push(legacyEntries);
|
|
8475
8521
|
}
|
|
8476
|
-
const globalMemDir = join15(
|
|
8522
|
+
const globalMemDir = join15(homedir5(), ".open-agents", "memory");
|
|
8477
8523
|
const globalEntries = loadMemoryDir(globalMemDir, "global");
|
|
8478
8524
|
if (globalEntries)
|
|
8479
8525
|
sections.push(globalEntries);
|
|
@@ -8852,7 +8898,7 @@ var init_carousel = __esm({
|
|
|
8852
8898
|
// packages/cli/dist/tui/voice.js
|
|
8853
8899
|
import { existsSync as existsSync11, mkdirSync as mkdirSync5, writeFileSync as writeFileSync5, readFileSync as readFileSync9, unlinkSync } from "node:fs";
|
|
8854
8900
|
import { join as join16 } from "node:path";
|
|
8855
|
-
import { homedir as
|
|
8901
|
+
import { homedir as homedir6, tmpdir as tmpdir2, platform as platform2 } from "node:os";
|
|
8856
8902
|
import { execSync as execSync10, spawn as nodeSpawn } from "node:child_process";
|
|
8857
8903
|
import { createRequire } from "node:module";
|
|
8858
8904
|
function modelDir(id) {
|
|
@@ -8971,7 +9017,7 @@ var init_voice = __esm({
|
|
|
8971
9017
|
configUrl: "https://raw.githubusercontent.com/robit-man/combine_overwatch_onnx/main/overwatch.onnx.json"
|
|
8972
9018
|
}
|
|
8973
9019
|
};
|
|
8974
|
-
VOICE_DIR = join16(
|
|
9020
|
+
VOICE_DIR = join16(homedir6(), ".open-agents", "voice");
|
|
8975
9021
|
MODELS_DIR = join16(VOICE_DIR, "models");
|
|
8976
9022
|
VoiceEngine = class {
|
|
8977
9023
|
enabled = false;
|
|
@@ -9620,6 +9666,19 @@ function startTask(task, config, repoRoot, voice) {
|
|
|
9620
9666
|
}
|
|
9621
9667
|
async function startInteractive(config, repoPath) {
|
|
9622
9668
|
const repoRoot = resolve11(repoPath ?? cwd());
|
|
9669
|
+
initOaDirectory(repoRoot);
|
|
9670
|
+
const savedSettings = resolveSettings(repoRoot);
|
|
9671
|
+
if (savedSettings.model)
|
|
9672
|
+
config = { ...config, model: savedSettings.model };
|
|
9673
|
+
if (savedSettings.backendUrl)
|
|
9674
|
+
config = { ...config, backendUrl: savedSettings.backendUrl };
|
|
9675
|
+
if (savedSettings.backendType && ["ollama", "vllm", "fake"].includes(savedSettings.backendType)) {
|
|
9676
|
+
config = { ...config, backendType: savedSettings.backendType };
|
|
9677
|
+
}
|
|
9678
|
+
if (savedSettings.apiKey)
|
|
9679
|
+
config = { ...config, apiKey: savedSettings.apiKey };
|
|
9680
|
+
if (savedSettings.verbose !== void 0)
|
|
9681
|
+
config = { ...config, verbose: savedSettings.verbose };
|
|
9623
9682
|
const needsSetup = isFirstRun() || !await isModelAvailable(config);
|
|
9624
9683
|
if (needsSetup && config.backendType === "ollama") {
|
|
9625
9684
|
const setupModel = await runSetupWizard(config);
|
|
@@ -9652,6 +9711,14 @@ async function startInteractive(config, repoPath) {
|
|
|
9652
9711
|
carouselLines
|
|
9653
9712
|
});
|
|
9654
9713
|
const voiceEngine = new VoiceEngine();
|
|
9714
|
+
if (savedSettings.voice) {
|
|
9715
|
+
voiceEngine.toggle().catch(() => {
|
|
9716
|
+
});
|
|
9717
|
+
if (savedSettings.voiceModel) {
|
|
9718
|
+
voiceEngine.setModel(savedSettings.voiceModel).catch(() => {
|
|
9719
|
+
});
|
|
9720
|
+
}
|
|
9721
|
+
}
|
|
9655
9722
|
let currentConfig = { ...config };
|
|
9656
9723
|
let activeTask = null;
|
|
9657
9724
|
let messageQueue = [];
|
|
@@ -9716,6 +9783,13 @@ async function startInteractive(config, repoPath) {
|
|
|
9716
9783
|
},
|
|
9717
9784
|
async voiceSetModel(id) {
|
|
9718
9785
|
return voiceEngine.setModel(id);
|
|
9786
|
+
},
|
|
9787
|
+
saveSettings(settings) {
|
|
9788
|
+
try {
|
|
9789
|
+
saveProjectSettings(repoRoot, settings);
|
|
9790
|
+
saveGlobalSettings(settings);
|
|
9791
|
+
} catch {
|
|
9792
|
+
}
|
|
9719
9793
|
}
|
|
9720
9794
|
};
|
|
9721
9795
|
showPrompt();
|
|
@@ -10323,7 +10397,7 @@ __export(config_exports, {
|
|
|
10323
10397
|
configCommand: () => configCommand
|
|
10324
10398
|
});
|
|
10325
10399
|
import { join as join19 } from "node:path";
|
|
10326
|
-
import { homedir as
|
|
10400
|
+
import { homedir as homedir7 } from "node:os";
|
|
10327
10401
|
async function configCommand(opts, config) {
|
|
10328
10402
|
if (opts.subCommand === "set") {
|
|
10329
10403
|
return handleSet(opts, config);
|
|
@@ -10345,7 +10419,7 @@ function handleShow(opts, config) {
|
|
|
10345
10419
|
printKeyValue("verbose", String(config.verbose), 2);
|
|
10346
10420
|
printKeyValue("dbPath", config.dbPath, 2);
|
|
10347
10421
|
printSection("Config File");
|
|
10348
|
-
printInfo(`~/.open-agents/config.json (${join19(
|
|
10422
|
+
printInfo(`~/.open-agents/config.json (${join19(homedir7(), ".open-agents", "config.json")})`);
|
|
10349
10423
|
printSection("Environment Variables");
|
|
10350
10424
|
printInfo("OPEN_AGENTS_BACKEND_URL \u2014 override backendUrl");
|
|
10351
10425
|
printInfo("OPEN_AGENTS_MODEL \u2014 override model");
|
package/package.json
CHANGED