open-agents-ai 0.187.442 → 0.187.443

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 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, VllmClient;
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 VllmClient({
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: messages2,
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 args = JSON.parse(toolCall.arguments);
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);
@@ -544739,7 +544691,26 @@ async function stepEndpoints(config, ollamaUrl, rl, availableRows, repoRoot) {
544739
544691
  return true;
544740
544692
  }
544741
544693
  if (item.key === "add_custom") {
544742
- _helpers.render();
544694
+ _helpers.getInput("Enter custom endpoint URL:", "").then((url) => {
544695
+ if (url && url.trim()) {
544696
+ const trimmedUrl = url.trim();
544697
+ try {
544698
+ new URL(trimmedUrl);
544699
+ config.endpoints.push({
544700
+ kind: "custom",
544701
+ label: trimmedUrl.replace(/^https?:\/\//, "").split("/")[0] || "Custom",
544702
+ url: trimmedUrl,
544703
+ enabled: true,
544704
+ models: []
544705
+ });
544706
+ _helpers.done();
544707
+ } catch {
544708
+ _helpers.done();
544709
+ }
544710
+ } else {
544711
+ _helpers.done();
544712
+ }
544713
+ });
544743
544714
  return true;
544744
544715
  }
544745
544716
  return false;
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "open-agents-ai",
3
- "version": "0.187.442",
3
+ "version": "0.187.443",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "open-agents-ai",
9
- "version": "0.187.442",
9
+ "version": "0.187.443",
10
10
  "hasInstallScript": true,
11
11
  "license": "CC-BY-NC-4.0",
12
12
  "dependencies": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "open-agents-ai",
3
- "version": "0.187.442",
3
+ "version": "0.187.443",
4
4
  "description": "AI coding agent powered by open-source models (Ollama/vLLM) — interactive TUI with agentic tool-calling loop",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",