open-agents-ai 0.187.442 → 0.187.444
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 +39 -55
- package/npm-shrinkwrap.json +2 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -549,7 +549,7 @@ function agentMessageToChatMessage(msg) {
|
|
|
549
549
|
function buildEmptyUsage() {
|
|
550
550
|
return { prompt_tokens: 0, completion_tokens: 0, total_tokens: 0 };
|
|
551
551
|
}
|
|
552
|
-
var VllmBackend
|
|
552
|
+
var VllmBackend;
|
|
553
553
|
var init_VllmBackend = __esm({
|
|
554
554
|
"packages/backend-vllm/dist/VllmBackend.js"() {
|
|
555
555
|
"use strict";
|
|
@@ -691,47 +691,6 @@ var init_VllmBackend = __esm({
|
|
|
691
691
|
}
|
|
692
692
|
}
|
|
693
693
|
};
|
|
694
|
-
VllmClient = class {
|
|
695
|
-
backend;
|
|
696
|
-
constructor(config) {
|
|
697
|
-
this.backend = new VllmBackend({
|
|
698
|
-
baseUrl: config.baseUrl,
|
|
699
|
-
model: config.model,
|
|
700
|
-
apiKey: config.apiKey,
|
|
701
|
-
timeoutMs: config.timeout
|
|
702
|
-
});
|
|
703
|
-
}
|
|
704
|
-
async complete(request) {
|
|
705
|
-
const agentMessages = request.messages.map((m2) => ({
|
|
706
|
-
id: globalThis.crypto.randomUUID(),
|
|
707
|
-
sessionId: globalThis.crypto.randomUUID(),
|
|
708
|
-
role: m2.role,
|
|
709
|
-
content: m2.content,
|
|
710
|
-
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
711
|
-
}));
|
|
712
|
-
const result = await this.backend.complete({
|
|
713
|
-
messages: agentMessages,
|
|
714
|
-
tools: request.tools,
|
|
715
|
-
maxTokens: request.maxTokens,
|
|
716
|
-
temperature: request.temperature
|
|
717
|
-
});
|
|
718
|
-
return {
|
|
719
|
-
id: globalThis.crypto.randomUUID(),
|
|
720
|
-
content: result.content ?? "",
|
|
721
|
-
toolCalls: result.toolCalls.length > 0 ? result.toolCalls.map((tc) => ({
|
|
722
|
-
id: tc.id,
|
|
723
|
-
name: tc.name,
|
|
724
|
-
arguments: JSON.stringify(tc.arguments)
|
|
725
|
-
})) : void 0,
|
|
726
|
-
usage: {
|
|
727
|
-
promptTokens: result.usage.prompt_tokens,
|
|
728
|
-
completionTokens: result.usage.completion_tokens,
|
|
729
|
-
totalTokens: result.usage.total_tokens
|
|
730
|
-
},
|
|
731
|
-
finishReason: result.truncated ? "length" : "stop"
|
|
732
|
-
};
|
|
733
|
-
}
|
|
734
|
-
};
|
|
735
694
|
}
|
|
736
695
|
});
|
|
737
696
|
|
|
@@ -509330,11 +509289,9 @@ var init_agent_loop = __esm({
|
|
|
509330
509289
|
handlers = [];
|
|
509331
509290
|
constructor(config) {
|
|
509332
509291
|
this.config = config;
|
|
509333
|
-
this.client = new
|
|
509292
|
+
this.client = new VllmBackend({
|
|
509334
509293
|
baseUrl: config.backendUrl,
|
|
509335
|
-
model: config.model
|
|
509336
|
-
maxTokens: config.maxTokens,
|
|
509337
|
-
temperature: config.temperature
|
|
509294
|
+
model: config.model
|
|
509338
509295
|
});
|
|
509339
509296
|
this.memory = new MessageHistory();
|
|
509340
509297
|
this.executor = new ToolExecutor({
|
|
@@ -509376,19 +509333,14 @@ var init_agent_loop = __esm({
|
|
|
509376
509333
|
results.push(userMsg);
|
|
509377
509334
|
for (let i2 = 0; i2 < this.config.maxIterations; i2++) {
|
|
509378
509335
|
this.setState("thinking");
|
|
509379
|
-
const messages2 = this.memory.getMessages().map((m2) => ({
|
|
509380
|
-
role: m2.role,
|
|
509381
|
-
content: m2.content
|
|
509382
|
-
}));
|
|
509383
509336
|
const response = await this.client.complete({
|
|
509384
|
-
messages:
|
|
509337
|
+
messages: this.memory.getMessages(),
|
|
509385
509338
|
tools: this.executor.getToolDefinitions()
|
|
509386
509339
|
});
|
|
509387
509340
|
if (response.toolCalls && response.toolCalls.length > 0) {
|
|
509388
509341
|
this.setState("executing_tool");
|
|
509389
509342
|
for (const toolCall of response.toolCalls) {
|
|
509390
|
-
const
|
|
509391
|
-
const result = await this.executor.execute(toolCall.name, args);
|
|
509343
|
+
const result = await this.executor.execute(toolCall.name, toolCall.arguments);
|
|
509392
509344
|
const toolMsg = {
|
|
509393
509345
|
id: crypto.randomUUID(),
|
|
509394
509346
|
sessionId: userMsg.sessionId,
|
|
@@ -509414,7 +509366,7 @@ var init_agent_loop = __esm({
|
|
|
509414
509366
|
id: crypto.randomUUID(),
|
|
509415
509367
|
sessionId: userMsg.sessionId,
|
|
509416
509368
|
role: "assistant",
|
|
509417
|
-
content: response.content,
|
|
509369
|
+
content: response.content ?? "",
|
|
509418
509370
|
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
509419
509371
|
};
|
|
509420
509372
|
this.memory.add(assistantMsg);
|
|
@@ -536758,6 +536710,19 @@ ${CONTENT_BG_SEQ}`);
|
|
|
536758
536710
|
const lineContent = `${prefix}${inputWrap.lines[i2]}`;
|
|
536759
536711
|
buf += `\x1B[${row};1H${PANEL_BG_SEQ}\x1B[2K${BOX_FG}${BOX_V}${RESET2}${PANEL_BG_SEQ}${lineContent}${PANEL_BG_SEQ}\x1B[K\x1B[${row};${w}H${BOX_FG}${BOX_V}${RESET2}`;
|
|
536760
536712
|
}
|
|
536713
|
+
if (this._suggestions.length > 0 && pos.suggestStartRow > 0) {
|
|
536714
|
+
for (let si = 0; si < this._suggestions.length; si++) {
|
|
536715
|
+
const row = pos.suggestStartRow + si;
|
|
536716
|
+
const cmd = this._suggestions[si];
|
|
536717
|
+
const isHl = si === this._suggestIndex;
|
|
536718
|
+
const bg = isHl ? `\x1B[48;5;235m` : PANEL_BG_SEQ;
|
|
536719
|
+
const fg2 = isHl ? `\x1B[1;38;5;${TEXT_PRIMARY}m` : `\x1B[38;5;${TEXT_PRIMARY}m`;
|
|
536720
|
+
const marker = isHl ? `\x1B[38;5;${TEXT_PRIMARY}m› ` : " ";
|
|
536721
|
+
buf += `\x1B[${row};1H${PANEL_BG_SEQ}\x1B[2K${BOX_FG}${BOX_V}${RESET2}${PANEL_BG_SEQ}`;
|
|
536722
|
+
buf += `${bg} ${marker}\x1B[38;5;${TEXT_DIM}m/${fg2}${cmd}`;
|
|
536723
|
+
buf += `${PANEL_BG_SEQ}\x1B[K\x1B[${row};${w}H${BOX_FG}${BOX_V}${RESET2}`;
|
|
536724
|
+
}
|
|
536725
|
+
}
|
|
536761
536726
|
const boxInnerS = w - 2;
|
|
536762
536727
|
buf += `\x1B[${pos.bufferRow};1H${PANEL_BG_SEQ}\x1B[2K${BOX_FG}${BOX_BL}${BOX_H.repeat(Math.max(0, boxInnerS))}${BOX_BR}${RESET2}`;
|
|
536763
536728
|
buf += `\x1B[${pos.metricsRow};1H${PANEL_BG_SEQ}\x1B[2K${this.buildMetricsLine()}${RESET2}`;
|
|
@@ -544739,7 +544704,26 @@ async function stepEndpoints(config, ollamaUrl, rl, availableRows, repoRoot) {
|
|
|
544739
544704
|
return true;
|
|
544740
544705
|
}
|
|
544741
544706
|
if (item.key === "add_custom") {
|
|
544742
|
-
_helpers.
|
|
544707
|
+
_helpers.getInput("Enter custom endpoint URL:", "").then((url) => {
|
|
544708
|
+
if (url && url.trim()) {
|
|
544709
|
+
const trimmedUrl = url.trim();
|
|
544710
|
+
try {
|
|
544711
|
+
new URL(trimmedUrl);
|
|
544712
|
+
config.endpoints.push({
|
|
544713
|
+
kind: "custom",
|
|
544714
|
+
label: trimmedUrl.replace(/^https?:\/\//, "").split("/")[0] || "Custom",
|
|
544715
|
+
url: trimmedUrl,
|
|
544716
|
+
enabled: true,
|
|
544717
|
+
models: []
|
|
544718
|
+
});
|
|
544719
|
+
_helpers.done();
|
|
544720
|
+
} catch {
|
|
544721
|
+
_helpers.done();
|
|
544722
|
+
}
|
|
544723
|
+
} else {
|
|
544724
|
+
_helpers.done();
|
|
544725
|
+
}
|
|
544726
|
+
});
|
|
544743
544727
|
return true;
|
|
544744
544728
|
}
|
|
544745
544729
|
return false;
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "open-agents-ai",
|
|
3
|
-
"version": "0.187.
|
|
3
|
+
"version": "0.187.444",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "open-agents-ai",
|
|
9
|
-
"version": "0.187.
|
|
9
|
+
"version": "0.187.444",
|
|
10
10
|
"hasInstallScript": true,
|
|
11
11
|
"license": "CC-BY-NC-4.0",
|
|
12
12
|
"dependencies": {
|
package/package.json
CHANGED