open-agents-ai 0.184.14 → 0.184.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/index.js +65 -13
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -43062,8 +43062,9 @@ function defaultConfig() {
|
|
|
43062
43062
|
updatedAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
43063
43063
|
};
|
|
43064
43064
|
}
|
|
43065
|
-
async function discoverEndpoints(ollamaUrl) {
|
|
43065
|
+
async function discoverEndpoints(ollamaUrl, repoRoot) {
|
|
43066
43066
|
const endpoints = [];
|
|
43067
|
+
const seenUrls = /* @__PURE__ */ new Set();
|
|
43067
43068
|
try {
|
|
43068
43069
|
const resp = await fetch(`${ollamaUrl}/api/tags`, { signal: AbortSignal.timeout(5e3) });
|
|
43069
43070
|
if (resp.ok) {
|
|
@@ -43076,13 +43077,55 @@ async function discoverEndpoints(ollamaUrl) {
|
|
|
43076
43077
|
label: `Local Ollama (${new URL(ollamaUrl).host})`,
|
|
43077
43078
|
enabled: true
|
|
43078
43079
|
});
|
|
43080
|
+
seenUrls.add(ollamaUrl);
|
|
43081
|
+
}
|
|
43082
|
+
} catch {
|
|
43083
|
+
}
|
|
43084
|
+
if (repoRoot) {
|
|
43085
|
+
try {
|
|
43086
|
+
const { loadUsageHistory: loadUsageHistory2 } = await Promise.resolve().then(() => (init_oa_directory(), oa_directory_exports));
|
|
43087
|
+
const history = loadUsageHistory2("endpoint", repoRoot);
|
|
43088
|
+
for (const record of history) {
|
|
43089
|
+
const url = record.value;
|
|
43090
|
+
if (seenUrls.has(url))
|
|
43091
|
+
continue;
|
|
43092
|
+
seenUrls.add(url);
|
|
43093
|
+
const provider = record.meta?.provider || "Custom";
|
|
43094
|
+
const authHint = record.meta?.authKey;
|
|
43095
|
+
endpoints.push({
|
|
43096
|
+
kind: "custom",
|
|
43097
|
+
url,
|
|
43098
|
+
authHeader: authHint ? `Bearer ${authHint}` : void 0,
|
|
43099
|
+
models: [],
|
|
43100
|
+
label: `${provider} (${new URL(url).host})`,
|
|
43101
|
+
enabled: false
|
|
43102
|
+
// not enabled by default — user must opt-in
|
|
43103
|
+
});
|
|
43104
|
+
}
|
|
43105
|
+
} catch {
|
|
43106
|
+
}
|
|
43107
|
+
}
|
|
43108
|
+
try {
|
|
43109
|
+
const { loadGlobalSettings: loadGlobalSettings2 } = await Promise.resolve().then(() => (init_oa_directory(), oa_directory_exports));
|
|
43110
|
+
const settings = loadGlobalSettings2();
|
|
43111
|
+
const currentUrl = settings?.backendUrl;
|
|
43112
|
+
if (currentUrl && !seenUrls.has(currentUrl) && currentUrl !== "http://127.0.0.1:11434") {
|
|
43113
|
+
seenUrls.add(currentUrl);
|
|
43114
|
+
endpoints.push({
|
|
43115
|
+
kind: "custom",
|
|
43116
|
+
url: currentUrl,
|
|
43117
|
+
authHeader: settings?.apiKey ? `Bearer ${settings.apiKey}` : void 0,
|
|
43118
|
+
models: [],
|
|
43119
|
+
label: `Current endpoint (${new URL(currentUrl).host})`,
|
|
43120
|
+
enabled: false
|
|
43121
|
+
});
|
|
43079
43122
|
}
|
|
43080
43123
|
} catch {
|
|
43081
43124
|
}
|
|
43082
43125
|
return endpoints;
|
|
43083
43126
|
}
|
|
43084
|
-
async function stepEndpoints(config, ollamaUrl, rl, availableRows) {
|
|
43085
|
-
const discovered = await discoverEndpoints(ollamaUrl);
|
|
43127
|
+
async function stepEndpoints(config, ollamaUrl, rl, availableRows, repoRoot) {
|
|
43128
|
+
const discovered = await discoverEndpoints(ollamaUrl, repoRoot);
|
|
43086
43129
|
for (const disc of discovered) {
|
|
43087
43130
|
const existing = config.endpoints.find((e) => e.url === disc.url);
|
|
43088
43131
|
if (!existing) {
|
|
@@ -43147,7 +43190,7 @@ async function stepEndpoints(config, ollamaUrl, rl, availableRows) {
|
|
|
43147
43190
|
const anyEnabled = config.endpoints.some((e) => e.enabled);
|
|
43148
43191
|
if (!anyEnabled) {
|
|
43149
43192
|
renderWarning("Select at least one endpoint before continuing.");
|
|
43150
|
-
return stepEndpoints(config, ollamaUrl, rl, availableRows);
|
|
43193
|
+
return stepEndpoints(config, ollamaUrl, rl, availableRows, repoRoot);
|
|
43151
43194
|
}
|
|
43152
43195
|
return true;
|
|
43153
43196
|
}
|
|
@@ -43155,7 +43198,7 @@ async function stepEndpoints(config, ollamaUrl, rl, availableRows) {
|
|
|
43155
43198
|
const ep = config.endpoints.find((e) => e.url === result.key);
|
|
43156
43199
|
if (ep) {
|
|
43157
43200
|
ep.enabled = !ep.enabled;
|
|
43158
|
-
return stepEndpoints(config, ollamaUrl, rl, availableRows);
|
|
43201
|
+
return stepEndpoints(config, ollamaUrl, rl, availableRows, repoRoot);
|
|
43159
43202
|
}
|
|
43160
43203
|
}
|
|
43161
43204
|
if (result.key === "add_custom") {
|
|
@@ -43512,7 +43555,7 @@ async function showSponsorDashboard(config, projectDir, rl, availableRows) {
|
|
|
43512
43555
|
async function runSponsorWizard(ctx) {
|
|
43513
43556
|
let config = loadSponsorConfig(ctx.projectDir) || defaultConfig();
|
|
43514
43557
|
renderInfo("Starting sponsor onboarding wizard...\n");
|
|
43515
|
-
if (!await stepEndpoints(config, ctx.ollamaUrl, ctx.rl, ctx.availableRows)) {
|
|
43558
|
+
if (!await stepEndpoints(config, ctx.ollamaUrl, ctx.rl, ctx.availableRows, ctx.projectDir)) {
|
|
43516
43559
|
renderInfo("Sponsor wizard cancelled.");
|
|
43517
43560
|
return null;
|
|
43518
43561
|
}
|
|
@@ -64898,11 +64941,10 @@ ${result.content.slice(0, 2e3)}${result.content.length > 2e3 ? "\n[truncated]" :
|
|
|
64898
64941
|
return;
|
|
64899
64942
|
}
|
|
64900
64943
|
if (input.startsWith("/")) {
|
|
64901
|
-
const
|
|
64902
|
-
if (
|
|
64903
|
-
if (activeTask)
|
|
64944
|
+
const quitMatch = input.trim().replace(/^\//, "").toLowerCase();
|
|
64945
|
+
if (quitMatch === "quit" || quitMatch === "exit" || quitMatch === "q") {
|
|
64946
|
+
if (activeTask)
|
|
64904
64947
|
activeTask.runner.abort();
|
|
64905
|
-
}
|
|
64906
64948
|
taskManager.stopAll();
|
|
64907
64949
|
if (blessEngine?.isActive)
|
|
64908
64950
|
blessEngine.stop();
|
|
@@ -64911,10 +64953,20 @@ ${result.content.slice(0, 2e3)}${result.content.length > 2e3 ? "\n[truncated]" :
|
|
|
64911
64953
|
if (dmnRetriggerTimer)
|
|
64912
64954
|
clearTimeout(dmnRetriggerTimer);
|
|
64913
64955
|
dmnEngine = null;
|
|
64956
|
+
killAllFullSubAgents();
|
|
64914
64957
|
statusBar.deactivate();
|
|
64915
|
-
|
|
64916
|
-
|
|
64917
|
-
|
|
64958
|
+
process.stdout.write(`\x1B[?1002l\x1B[?1006l\x1B[r\x1B[?25h\x1B[2J\x1B[H${c2.dim("Goodbye!")}
|
|
64959
|
+
`);
|
|
64960
|
+
rl.close();
|
|
64961
|
+
process.exit(0);
|
|
64962
|
+
}
|
|
64963
|
+
const cmdResult = await writeContentAsync(() => handleSlashCommand(input, commandCtx));
|
|
64964
|
+
if (cmdResult === "exit") {
|
|
64965
|
+
if (activeTask)
|
|
64966
|
+
activeTask.runner.abort();
|
|
64967
|
+
taskManager.stopAll();
|
|
64968
|
+
statusBar.deactivate();
|
|
64969
|
+
process.stdout.write(`\x1B[?1002l\x1B[?1006l\x1B[r\x1B[?25h\x1B[2J\x1B[H${c2.dim("Goodbye!")}
|
|
64918
64970
|
`);
|
|
64919
64971
|
rl.close();
|
|
64920
64972
|
process.exit(0);
|
package/package.json
CHANGED