@dexto/agent-management 1.6.19 → 1.6.21

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.
@@ -72,7 +72,17 @@ const AgentFactory = {
72
72
  * Install a custom agent from local path
73
73
  */
74
74
  async installCustomAgent(agentId, sourcePath, metadata, options) {
75
- return (0, import_installation.installCustomAgent)(agentId, sourcePath, metadata, options);
75
+ if (options?.agentsDir) {
76
+ throw new Error(
77
+ "Custom agentsDir overrides are not supported by AgentFactory.installCustomAgent"
78
+ );
79
+ }
80
+ return (0, import_registry.getAgentRegistry)().installCustomAgentFromPath(agentId, sourcePath, {
81
+ name: metadata.name,
82
+ description: metadata.description,
83
+ author: metadata.author || "Custom",
84
+ tags: metadata.tags ?? []
85
+ });
76
86
  },
77
87
  /**
78
88
  * Uninstall an agent
@@ -80,7 +90,7 @@ const AgentFactory = {
80
90
  * @param _force - Deprecated: force parameter is kept for backward compatibility but has no effect
81
91
  */
82
92
  async uninstallAgent(agentId, _force) {
83
- return (0, import_installation.uninstallAgent)(agentId);
93
+ return (0, import_registry.getAgentRegistry)().uninstallAgent(agentId, _force);
84
94
  },
85
95
  /**
86
96
  * Create an agent from an inline configuration object
@@ -1 +1 @@
1
- {"version":3,"file":"AgentFactory.d.ts","sourceRoot":"","sources":["../src/AgentFactory.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAGH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,KAAK,EAAE,UAAU,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AAIrE,OAAO,EAIH,KAAK,cAAc,EACtB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAGvD;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAC9B,6CAA6C;IAC7C,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,6C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IAC7C,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,6CAA6C;IAC7C,8BAA8B,CAAC,EAAE,MAAM,CAAC;CAC3C;AAED;;GAEG;AACH,MAAM,WAAW,kBAAkB;IAC/B,8FAA8F;IAC9F,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,qEAAqE;IACrE,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,4EAA4E;IAC5E,gBAAgB,CAAC,EAAE,IAAI,CAAC,qBAAqB,EAAE,cAAc,CAAC,GAAG,SAAS,CAAC;CAC9E;AAED;;;GAGG;AACH,eAAO,MAAM,YAAY;IACrB;;;OAGG;yBACwB,iBAAiB;;;;;;;;;;;;;;;;;;IAyC5C;;OAEG;0BACyB,MAAM,YAAY,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC;IAI9E;;OAEG;gCAEU,MAAM,cACH,MAAM,YACR,IAAI,CAAC,aAAa,EAAE,MAAM,GAAG,aAAa,GAAG,QAAQ,GAAG,MAAM,CAAC,YAC/D,cAAc,GACzB,OAAO,CAAC,MAAM,CAAC;IAelB;;;;OAIG;4BAC2B,MAAM,WAAW,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC;IAItE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA8BG;wBACuB,WAAW,YAAY,kBAAkB,GAAG,OAAO,CAAC,UAAU,CAAC;CAoB5F,CAAC"}
@@ -1,12 +1,8 @@
1
1
  import { promises as fs } from "fs";
2
2
  import { getDextoGlobalPath } from "./utils/path.js";
3
3
  import { deriveDisplayName } from "./registry/types.js";
4
- import { loadBundledRegistryAgents } from "./registry/registry.js";
5
- import {
6
- installBundledAgent,
7
- installCustomAgent,
8
- uninstallAgent
9
- } from "./installation.js";
4
+ import { getAgentRegistry, loadBundledRegistryAgents } from "./registry/registry.js";
5
+ import { installBundledAgent } from "./installation.js";
10
6
  import { createDextoAgentFromConfig } from "./agent-creation.js";
11
7
  const AgentFactory = {
12
8
  /**
@@ -53,7 +49,17 @@ const AgentFactory = {
53
49
  * Install a custom agent from local path
54
50
  */
55
51
  async installCustomAgent(agentId, sourcePath, metadata, options) {
56
- return installCustomAgent(agentId, sourcePath, metadata, options);
52
+ if (options?.agentsDir) {
53
+ throw new Error(
54
+ "Custom agentsDir overrides are not supported by AgentFactory.installCustomAgent"
55
+ );
56
+ }
57
+ return getAgentRegistry().installCustomAgentFromPath(agentId, sourcePath, {
58
+ name: metadata.name,
59
+ description: metadata.description,
60
+ author: metadata.author || "Custom",
61
+ tags: metadata.tags ?? []
62
+ });
57
63
  },
58
64
  /**
59
65
  * Uninstall an agent
@@ -61,7 +67,7 @@ const AgentFactory = {
61
67
  * @param _force - Deprecated: force parameter is kept for backward compatibility but has no effect
62
68
  */
63
69
  async uninstallAgent(agentId, _force) {
64
- return uninstallAgent(agentId);
70
+ return getAgentRegistry().uninstallAgent(agentId, _force);
65
71
  },
66
72
  /**
67
73
  * Create an agent from an inline configuration object
@@ -240,7 +240,7 @@ function createInitialPreferences(options) {
240
240
  llm: llmConfig,
241
241
  defaults: {
242
242
  defaultAgent: options.defaultAgent || "coding-agent",
243
- defaultMode: options.defaultMode || "web"
243
+ defaultMode: options.defaultMode || "cli"
244
244
  },
245
245
  setup: {
246
246
  completed: options.setupCompleted ?? true,
@@ -200,7 +200,7 @@ function createInitialPreferences(options) {
200
200
  llm: llmConfig,
201
201
  defaults: {
202
202
  defaultAgent: options.defaultAgent || "coding-agent",
203
- defaultMode: options.defaultMode || "web"
203
+ defaultMode: options.defaultMode || "cli"
204
204
  },
205
205
  setup: {
206
206
  completed: options.setupCompleted ?? true,
package/dist/resolver.cjs CHANGED
@@ -187,27 +187,33 @@ async function resolveDefaultAgentForDextoProject(autoInstall = true) {
187
187
  }
188
188
  }
189
189
  import_core.logger.debug(`No project-local coding-agent found in ${projectRoot}`);
190
- if (!(0, import_loader.globalPreferencesExist)()) {
191
- throw import_config.ConfigError.noProjectDefault(projectRoot);
192
- }
193
- const preferences = await (0, import_loader.loadGlobalPreferences)();
194
- if (!preferences.setup.completed) {
195
- throw import_config.ConfigError.setupIncomplete();
190
+ if ((0, import_loader.globalPreferencesExist)()) {
191
+ try {
192
+ const preferences = await (0, import_loader.loadGlobalPreferences)();
193
+ if (preferences.setup.completed && preferences.defaults.defaultAgent) {
194
+ const preferredAgentName = preferences.defaults.defaultAgent;
195
+ return await resolveAgentByName(preferredAgentName, autoInstall);
196
+ }
197
+ } catch (error) {
198
+ import_core.logger.debug(`Could not load global preferences for project fallback: ${error}`);
199
+ }
196
200
  }
197
- const preferredAgentName = preferences.defaults.defaultAgent;
198
- return await resolveAgentByName(preferredAgentName, autoInstall);
201
+ return await resolveAgentByName("coding-agent", autoInstall);
199
202
  }
200
203
  async function resolveDefaultAgentForGlobalCLI(autoInstall = true) {
201
204
  import_core.logger.debug("Resolving default agent for global CLI context");
202
- if (!(0, import_loader.globalPreferencesExist)()) {
203
- throw import_config.ConfigError.noGlobalPreferences();
204
- }
205
- const preferences = await (0, import_loader.loadGlobalPreferences)();
206
- if (!preferences.setup.completed) {
207
- throw import_config.ConfigError.setupIncomplete();
205
+ if ((0, import_loader.globalPreferencesExist)()) {
206
+ try {
207
+ const preferences = await (0, import_loader.loadGlobalPreferences)();
208
+ if (preferences.setup.completed && preferences.defaults.defaultAgent) {
209
+ const preferredAgentName = preferences.defaults.defaultAgent;
210
+ return await resolveAgentByName(preferredAgentName, autoInstall);
211
+ }
212
+ } catch (error) {
213
+ import_core.logger.debug(`Could not load global preferences for CLI fallback: ${error}`);
214
+ }
208
215
  }
209
- const preferredAgentName = preferences.defaults.defaultAgent;
210
- return await resolveAgentByName(preferredAgentName, autoInstall);
216
+ return await resolveAgentByName("coding-agent", autoInstall);
211
217
  }
212
218
  async function updateDefaultAgentPreference(agentName) {
213
219
  const agentsDir = (0, import_path2.getDextoGlobalPath)("agents");
@@ -1 +1 @@
1
- {"version":3,"file":"resolver.d.ts","sourceRoot":"","sources":["../src/resolver.ts"],"names":[],"mappings":"AAwCA;;;;;;;GAOG;AACH,wBAAsB,gBAAgB,CAClC,UAAU,CAAC,EAAE,MAAM,EACnB,WAAW,GAAE,OAAc,GAC5B,OAAO,CAAC,MAAM,CAAC,CAuBjB;AAuND;;;;GAIG;AACH,wBAAsB,4BAA4B,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CA+BnF"}
1
+ {"version":3,"file":"resolver.d.ts","sourceRoot":"","sources":["../src/resolver.ts"],"names":[],"mappings":"AAwCA;;;;;;;GAOG;AACH,wBAAsB,gBAAgB,CAClC,UAAU,CAAC,EAAE,MAAM,EACnB,WAAW,GAAE,OAAc,GAC5B,OAAO,CAAC,MAAM,CAAC,CAuBjB;AA0ND;;;;GAIG;AACH,wBAAsB,4BAA4B,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CA+BnF"}
package/dist/resolver.js CHANGED
@@ -160,27 +160,33 @@ async function resolveDefaultAgentForDextoProject(autoInstall = true) {
160
160
  }
161
161
  }
162
162
  logger.debug(`No project-local coding-agent found in ${projectRoot}`);
163
- if (!globalPreferencesExist()) {
164
- throw ConfigError.noProjectDefault(projectRoot);
165
- }
166
- const preferences = await loadGlobalPreferences();
167
- if (!preferences.setup.completed) {
168
- throw ConfigError.setupIncomplete();
163
+ if (globalPreferencesExist()) {
164
+ try {
165
+ const preferences = await loadGlobalPreferences();
166
+ if (preferences.setup.completed && preferences.defaults.defaultAgent) {
167
+ const preferredAgentName = preferences.defaults.defaultAgent;
168
+ return await resolveAgentByName(preferredAgentName, autoInstall);
169
+ }
170
+ } catch (error) {
171
+ logger.debug(`Could not load global preferences for project fallback: ${error}`);
172
+ }
169
173
  }
170
- const preferredAgentName = preferences.defaults.defaultAgent;
171
- return await resolveAgentByName(preferredAgentName, autoInstall);
174
+ return await resolveAgentByName("coding-agent", autoInstall);
172
175
  }
173
176
  async function resolveDefaultAgentForGlobalCLI(autoInstall = true) {
174
177
  logger.debug("Resolving default agent for global CLI context");
175
- if (!globalPreferencesExist()) {
176
- throw ConfigError.noGlobalPreferences();
177
- }
178
- const preferences = await loadGlobalPreferences();
179
- if (!preferences.setup.completed) {
180
- throw ConfigError.setupIncomplete();
178
+ if (globalPreferencesExist()) {
179
+ try {
180
+ const preferences = await loadGlobalPreferences();
181
+ if (preferences.setup.completed && preferences.defaults.defaultAgent) {
182
+ const preferredAgentName = preferences.defaults.defaultAgent;
183
+ return await resolveAgentByName(preferredAgentName, autoInstall);
184
+ }
185
+ } catch (error) {
186
+ logger.debug(`Could not load global preferences for CLI fallback: ${error}`);
187
+ }
181
188
  }
182
- const preferredAgentName = preferences.defaults.defaultAgent;
183
- return await resolveAgentByName(preferredAgentName, autoInstall);
189
+ return await resolveAgentByName("coding-agent", autoInstall);
184
190
  }
185
191
  async function updateDefaultAgentPreference(agentName) {
186
192
  const agentsDir = getDextoGlobalPath("agents");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dexto/agent-management",
3
- "version": "1.6.19",
3
+ "version": "1.6.21",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -8,6 +8,7 @@
8
8
  "types": "./dist/index.d.ts",
9
9
  "exports": {
10
10
  ".": {
11
+ "types": "./dist/index.d.ts",
11
12
  "import": "./dist/index.js",
12
13
  "require": "./dist/index.cjs"
13
14
  },
@@ -16,10 +17,10 @@
16
17
  "dependencies": {
17
18
  "yaml": "^2.8.3",
18
19
  "zod": "^3.25.0",
19
- "@dexto/agent-config": "1.6.19",
20
- "@dexto/core": "1.6.19",
21
- "@dexto/orchestration": "1.6.19",
22
- "@dexto/tools-builtins": "1.6.19"
20
+ "@dexto/agent-config": "1.6.21",
21
+ "@dexto/core": "1.6.21",
22
+ "@dexto/orchestration": "1.6.21",
23
+ "@dexto/tools-builtins": "1.6.21"
23
24
  },
24
25
  "devDependencies": {
25
26
  "@types/node": "^22.13.5"