open-agents-ai 0.13.2 → 0.13.3

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.
Files changed (2) hide show
  1. package/dist/index.js +42 -31
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -3999,12 +3999,15 @@ import { existsSync as existsSync8, readdirSync as readdirSync4, readFileSync as
3999
3999
  import { join as join11 } from "node:path";
4000
4000
  import { homedir as homedir3 } from "node:os";
4001
4001
  import { spawn as spawn3 } from "node:child_process";
4002
+ function globalToolsDir() {
4003
+ return join11(homedir3(), ".open-agents", "tools");
4004
+ }
4002
4005
  function projectToolsDir(repoRoot) {
4003
4006
  return join11(repoRoot, ".oa", "tools");
4004
4007
  }
4005
4008
  function loadCustomTools(repoRoot) {
4006
4009
  const definitions = /* @__PURE__ */ new Map();
4007
- for (const def of loadFromDirectory(GLOBAL_TOOLS_DIR)) {
4010
+ for (const def of loadFromDirectory(globalToolsDir())) {
4008
4011
  definitions.set(def.name, def);
4009
4012
  }
4010
4013
  const projectDir = projectToolsDir(repoRoot);
@@ -4018,14 +4021,14 @@ function buildCustomTools(repoRoot) {
4018
4021
  return definitions.map((def) => new CustomTool(def, repoRoot));
4019
4022
  }
4020
4023
  function saveCustomToolDefinition(definition, scope, repoRoot) {
4021
- const dir = scope === "project" && repoRoot ? projectToolsDir(repoRoot) : GLOBAL_TOOLS_DIR;
4024
+ const dir = scope === "project" && repoRoot ? projectToolsDir(repoRoot) : globalToolsDir();
4022
4025
  mkdirSync3(dir, { recursive: true });
4023
4026
  const filePath = join11(dir, `${definition.name}.json`);
4024
4027
  writeFileSync3(filePath, JSON.stringify(definition, null, 2), "utf-8");
4025
4028
  return filePath;
4026
4029
  }
4027
4030
  function deleteCustomToolDefinition(name, scope, repoRoot) {
4028
- const dir = scope === "project" && repoRoot ? projectToolsDir(repoRoot) : GLOBAL_TOOLS_DIR;
4031
+ const dir = scope === "project" && repoRoot ? projectToolsDir(repoRoot) : globalToolsDir();
4029
4032
  const filePath = join11(dir, `${name}.json`);
4030
4033
  if (existsSync8(filePath)) {
4031
4034
  const { unlinkSync: unlinkSync3 } = __require("node:fs");
@@ -4047,7 +4050,7 @@ function listCustomToolFiles(repoRoot) {
4047
4050
  });
4048
4051
  seen.add(def.name);
4049
4052
  }
4050
- for (const def of loadFromDirectory(GLOBAL_TOOLS_DIR)) {
4053
+ for (const def of loadFromDirectory(globalToolsDir())) {
4051
4054
  if (!seen.has(def.name)) {
4052
4055
  result.push({
4053
4056
  name: def.name,
@@ -4083,11 +4086,10 @@ function loadFromDirectory(dir) {
4083
4086
  }
4084
4087
  return definitions;
4085
4088
  }
4086
- var GLOBAL_TOOLS_DIR, CustomTool;
4089
+ var CustomTool;
4087
4090
  var init_custom_tool = __esm({
4088
4091
  "packages/execution/dist/tools/custom-tool.js"() {
4089
4092
  "use strict";
4090
- GLOBAL_TOOLS_DIR = join11(homedir3(), ".open-agents", "tools");
4091
4093
  CustomTool = class {
4092
4094
  name;
4093
4095
  description;
@@ -4493,23 +4495,32 @@ var init_tool_creator = __esm({
4493
4495
  import { existsSync as existsSync9, readdirSync as readdirSync5, readFileSync as readFileSync8 } from "node:fs";
4494
4496
  import { join as join12, basename as basename2 } from "node:path";
4495
4497
  import { homedir as homedir4 } from "node:os";
4498
+ function getAiwgPaths() {
4499
+ const dataDir = join12(homedir4(), ".local", "share", "ai-writing-guide");
4500
+ return {
4501
+ frameworksDir: join12(dataDir, "agentic", "code", "frameworks"),
4502
+ addonsDir: join12(dataDir, "addons"),
4503
+ pluginsDir: join12(dataDir, "plugins")
4504
+ };
4505
+ }
4496
4506
  function discoverSkills(repoRoot) {
4497
4507
  const skills = /* @__PURE__ */ new Map();
4498
- if (existsSync9(AIWG_FRAMEWORKS_DIR)) {
4499
- for (const framework of safeReaddir(AIWG_FRAMEWORKS_DIR)) {
4500
- const skillsDir = join12(AIWG_FRAMEWORKS_DIR, framework, "skills");
4508
+ const { frameworksDir, addonsDir, pluginsDir } = getAiwgPaths();
4509
+ if (existsSync9(frameworksDir)) {
4510
+ for (const framework of safeReaddir(frameworksDir)) {
4511
+ const skillsDir = join12(frameworksDir, framework, "skills");
4501
4512
  loadSkillsFromDir(skillsDir, `framework:${framework}`, skills);
4502
4513
  }
4503
4514
  }
4504
- if (existsSync9(AIWG_ADDONS_DIR)) {
4505
- for (const addon of safeReaddir(AIWG_ADDONS_DIR)) {
4506
- const skillsDir = join12(AIWG_ADDONS_DIR, addon, "skills");
4515
+ if (existsSync9(addonsDir)) {
4516
+ for (const addon of safeReaddir(addonsDir)) {
4517
+ const skillsDir = join12(addonsDir, addon, "skills");
4507
4518
  loadSkillsFromDir(skillsDir, `addon:${addon}`, skills);
4508
4519
  }
4509
4520
  }
4510
- if (existsSync9(AIWG_PLUGINS_DIR)) {
4511
- for (const plugin of safeReaddir(AIWG_PLUGINS_DIR)) {
4512
- const skillsDir = join12(AIWG_PLUGINS_DIR, plugin, "skills");
4521
+ if (existsSync9(pluginsDir)) {
4522
+ for (const plugin of safeReaddir(pluginsDir)) {
4523
+ const skillsDir = join12(pluginsDir, plugin, "skills");
4513
4524
  loadSkillsFromDir(skillsDir, `plugin:${plugin}`, skills);
4514
4525
  }
4515
4526
  }
@@ -4641,14 +4652,10 @@ function parseTriggers(filePath) {
4641
4652
  }
4642
4653
  return triggers;
4643
4654
  }
4644
- var AIWG_DATA_DIR, AIWG_FRAMEWORKS_DIR, AIWG_ADDONS_DIR, AIWG_PLUGINS_DIR, SkillListTool, SkillExecuteTool;
4655
+ var SkillListTool, SkillExecuteTool;
4645
4656
  var init_skill_tools = __esm({
4646
4657
  "packages/execution/dist/tools/skill-tools.js"() {
4647
4658
  "use strict";
4648
- AIWG_DATA_DIR = join12(homedir4(), ".local", "share", "ai-writing-guide");
4649
- AIWG_FRAMEWORKS_DIR = join12(AIWG_DATA_DIR, "agentic", "code", "frameworks");
4650
- AIWG_ADDONS_DIR = join12(AIWG_DATA_DIR, "addons");
4651
- AIWG_PLUGINS_DIR = join12(AIWG_DATA_DIR, "plugins");
4652
4659
  SkillListTool = class {
4653
4660
  name = "skill_list";
4654
4661
  description = "List all available AIWG skills with their descriptions and trigger patterns. Use this to discover skills that can help with the current task.";
@@ -11465,8 +11472,14 @@ import { join as join18 } from "node:path";
11465
11472
  import { homedir as homedir8, tmpdir as tmpdir2, platform as platform2 } from "node:os";
11466
11473
  import { execSync as execSync10, spawn as nodeSpawn } from "node:child_process";
11467
11474
  import { createRequire } from "node:module";
11475
+ function voiceDir() {
11476
+ return join18(homedir8(), ".open-agents", "voice");
11477
+ }
11478
+ function modelsDir() {
11479
+ return join18(voiceDir(), "models");
11480
+ }
11468
11481
  function modelDir(id) {
11469
- return join18(MODELS_DIR, id);
11482
+ return join18(modelsDir(), id);
11470
11483
  }
11471
11484
  function modelOnnxPath(id) {
11472
11485
  return join18(modelDir(id), "model.onnx");
@@ -11568,7 +11581,7 @@ function formatBytes2(bytes) {
11568
11581
  return `${(bytes / 1024).toFixed(0)}KB`;
11569
11582
  return `${(bytes / (1024 * 1024)).toFixed(1)}MB`;
11570
11583
  }
11571
- var VOICE_MODELS, VOICE_DIR, MODELS_DIR, VoiceEngine;
11584
+ var VOICE_MODELS, VoiceEngine;
11572
11585
  var init_voice = __esm({
11573
11586
  "packages/cli/dist/tui/voice.js"() {
11574
11587
  "use strict";
@@ -11587,8 +11600,6 @@ var init_voice = __esm({
11587
11600
  configUrl: "https://raw.githubusercontent.com/robit-man/combine_overwatch_onnx/main/overwatch.onnx.json"
11588
11601
  }
11589
11602
  };
11590
- VOICE_DIR = join18(homedir8(), ".open-agents", "voice");
11591
- MODELS_DIR = join18(VOICE_DIR, "models");
11592
11603
  VoiceEngine = class {
11593
11604
  enabled = false;
11594
11605
  modelId = "glados";
@@ -11899,8 +11910,8 @@ var init_voice = __esm({
11899
11910
  async ensureRuntime() {
11900
11911
  if (this.ort)
11901
11912
  return;
11902
- mkdirSync6(VOICE_DIR, { recursive: true });
11903
- const pkgPath = join18(VOICE_DIR, "package.json");
11913
+ mkdirSync6(voiceDir(), { recursive: true });
11914
+ const pkgPath = join18(voiceDir(), "package.json");
11904
11915
  const expectedDeps = {
11905
11916
  "onnxruntime-node": "^1.21.0",
11906
11917
  "phonemizer": "^1.2.1"
@@ -11922,20 +11933,20 @@ var init_voice = __esm({
11922
11933
  dependencies: expectedDeps
11923
11934
  }, null, 2));
11924
11935
  }
11925
- const voiceRequire = createRequire(join18(VOICE_DIR, "index.js"));
11936
+ const voiceRequire = createRequire(join18(voiceDir(), "index.js"));
11926
11937
  try {
11927
11938
  this.ort = voiceRequire("onnxruntime-node");
11928
11939
  } catch {
11929
11940
  renderInfo("Installing ONNX runtime for voice synthesis...");
11930
11941
  try {
11931
11942
  execSync10("npm install --no-audit --no-fund", {
11932
- cwd: VOICE_DIR,
11943
+ cwd: voiceDir(),
11933
11944
  stdio: "pipe",
11934
11945
  timeout: 12e4
11935
11946
  });
11936
11947
  this.ort = voiceRequire("onnxruntime-node");
11937
11948
  } catch (err) {
11938
- throw new Error(`Failed to install voice dependencies. Try manually: cd ${VOICE_DIR} && npm install
11949
+ throw new Error(`Failed to install voice dependencies. Try manually: cd ${voiceDir()} && npm install
11939
11950
  Error: ${err instanceof Error ? err.message : String(err)}`);
11940
11951
  }
11941
11952
  }
@@ -11946,14 +11957,14 @@ Error: ${err instanceof Error ? err.message : String(err)}`);
11946
11957
  renderInfo("Installing phonemizer for voice synthesis...");
11947
11958
  try {
11948
11959
  execSync10("npm install --no-audit --no-fund", {
11949
- cwd: VOICE_DIR,
11960
+ cwd: voiceDir(),
11950
11961
  stdio: "pipe",
11951
11962
  timeout: 12e4
11952
11963
  });
11953
11964
  const phonemizerMod = voiceRequire("phonemizer");
11954
11965
  this.phonemizeFn = phonemizerMod.phonemize ?? phonemizerMod.default?.phonemize ?? phonemizerMod;
11955
11966
  } catch (err) {
11956
- throw new Error(`Failed to install phonemizer. Try manually: cd ${VOICE_DIR} && npm install
11967
+ throw new Error(`Failed to install phonemizer. Try manually: cd ${voiceDir()} && npm install
11957
11968
  Error: ${err instanceof Error ? err.message : String(err)}`);
11958
11969
  }
11959
11970
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "open-agents-ai",
3
- "version": "0.13.2",
3
+ "version": "0.13.3",
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",