@dexto/agent-management 1.10.1 → 1.10.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.
- package/dist/AgentFactory.d.ts +3 -3
- package/dist/AgentFactory.d.ts.map +1 -1
- package/dist/AgentManager.d.ts +1 -1
- package/dist/agent-creation.cjs +1 -1
- package/dist/agent-creation.d.ts +2 -2
- package/dist/agent-creation.d.ts.map +1 -1
- package/dist/agent-creation.js +2 -1
- package/dist/runtime/AgentRuntime.cjs +4 -1
- package/dist/runtime/AgentRuntime.d.ts +4 -0
- package/dist/runtime/AgentRuntime.d.ts.map +1 -1
- package/dist/runtime/AgentRuntime.js +4 -1
- package/dist/tool-factories/agent-spawner/llm-resolution.cjs +4 -3
- package/dist/tool-factories/agent-spawner/llm-resolution.d.ts +3 -0
- package/dist/tool-factories/agent-spawner/llm-resolution.d.ts.map +1 -1
- package/dist/tool-factories/agent-spawner/llm-resolution.js +9 -4
- package/dist/tool-factories/agent-spawner/runtime.cjs +4 -2
- package/dist/tool-factories/agent-spawner/runtime.d.ts.map +1 -1
- package/dist/tool-factories/agent-spawner/runtime.js +4 -2
- package/package.json +6 -6
package/dist/AgentFactory.d.ts
CHANGED
|
@@ -21,10 +21,10 @@
|
|
|
21
21
|
* and need discovery/selection capabilities.
|
|
22
22
|
*
|
|
23
23
|
* @see AgentManager for registry-based agent management
|
|
24
|
-
* @see https://
|
|
24
|
+
* @see https://cli.dexto.ai/api/sdk/agent-factory for full documentation
|
|
25
25
|
*/
|
|
26
26
|
import type { AgentConfig, DextoHostContext } from '@dexto/agent-config';
|
|
27
|
-
import type { DextoAgent,
|
|
27
|
+
import type { DextoAgent, DextoAgentOptions } from '@dexto/core';
|
|
28
28
|
import { type InstallOptions } from './installation.js';
|
|
29
29
|
import type { AgentMetadata } from './AgentManager.js';
|
|
30
30
|
/**
|
|
@@ -47,7 +47,7 @@ export interface CreateAgentOptions {
|
|
|
47
47
|
/** Optional host-owned resolution context for hosted runtimes */
|
|
48
48
|
hostContext?: DextoHostContext | undefined;
|
|
49
49
|
/** Explicit runtime overrides applied outside the validated agent config */
|
|
50
|
-
runtimeOverrides?: Pick<
|
|
50
|
+
runtimeOverrides?: Pick<DextoAgentOptions, 'usageScopeId' | 'llmRegistry'> | undefined;
|
|
51
51
|
}
|
|
52
52
|
/**
|
|
53
53
|
* Static API for agent management operations
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AgentFactory.d.ts","sourceRoot":"","sources":["../src/AgentFactory.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAGH,OAAO,KAAK,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACzE,OAAO,KAAK,EAAE,UAAU,EAAE,
|
|
1
|
+
{"version":3,"file":"AgentFactory.d.ts","sourceRoot":"","sources":["../src/AgentFactory.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAGH,OAAO,KAAK,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACzE,OAAO,KAAK,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAIjE,OAAO,EAAuB,KAAK,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAC7E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAGvD;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAC9B,6CAA6C;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,iEAAiE;IACjE,WAAW,CAAC,EAAE,gBAAgB,GAAG,SAAS,CAAC;IAC3C,4EAA4E;IAC5E,gBAAgB,CAAC,EAAE,IAAI,CAAC,iBAAiB,EAAE,cAAc,GAAG,aAAa,CAAC,GAAG,SAAS,CAAC;CAC1F;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;CAqB5F,CAAC"}
|
package/dist/AgentManager.d.ts
CHANGED
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
* programmatically without a registry file.
|
|
14
14
|
*
|
|
15
15
|
* @see AgentFactory.createAgent() for inline config creation
|
|
16
|
-
* @see https://
|
|
16
|
+
* @see https://cli.dexto.ai/api/sdk/agent-manager for full documentation
|
|
17
17
|
*/
|
|
18
18
|
import type { DextoAgent } from '@dexto/core';
|
|
19
19
|
import { z } from 'zod';
|
package/dist/agent-creation.cjs
CHANGED
|
@@ -79,7 +79,7 @@ async function createDextoAgentFromConfig(options) {
|
|
|
79
79
|
if (agentIdOverride !== void 0) {
|
|
80
80
|
enrichedConfig.agentId = agentIdOverride;
|
|
81
81
|
}
|
|
82
|
-
const validatedConfig = import_agent_config.AgentConfigSchema.parse(enrichedConfig);
|
|
82
|
+
const validatedConfig = runtimeOverrides?.llmRegistry ? (0, import_agent_config.createAgentConfigSchema)(runtimeOverrides.llmRegistry).parse(enrichedConfig) : import_agent_config.AgentConfigSchema.parse(enrichedConfig);
|
|
83
83
|
const resolvedHostContext = {
|
|
84
84
|
...hostContext ?? {},
|
|
85
85
|
...enrichOptions?.workspaceRoot ? { workspaceRoot: enrichOptions.workspaceRoot } : {}
|
package/dist/agent-creation.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { AgentConfig, DextoHostContext } from '@dexto/agent-config';
|
|
2
|
-
import { DextoAgent, type
|
|
2
|
+
import { DextoAgent, type DextoAgentOptions, type InitializeServicesOptions } from '@dexto/core';
|
|
3
3
|
import { type EnrichAgentConfigOptions } from './config/index.js';
|
|
4
4
|
type CreateDextoAgentFromConfigOptions = {
|
|
5
5
|
config: AgentConfig;
|
|
@@ -10,7 +10,7 @@ type CreateDextoAgentFromConfigOptions = {
|
|
|
10
10
|
agentContext?: 'subagent' | undefined;
|
|
11
11
|
hostContext?: DextoHostContext | undefined;
|
|
12
12
|
overrides?: InitializeServicesOptions | undefined;
|
|
13
|
-
runtimeOverrides?: Pick<
|
|
13
|
+
runtimeOverrides?: Pick<DextoAgentOptions, 'usageScopeId' | 'llmRegistry'> | undefined;
|
|
14
14
|
};
|
|
15
15
|
export declare function createDextoAgentFromConfig(options: CreateDextoAgentFromConfigOptions): Promise<DextoAgent>;
|
|
16
16
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent-creation.d.ts","sourceRoot":"","sources":["../src/agent-creation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,gBAAgB,EAAc,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"agent-creation.d.ts","sourceRoot":"","sources":["../src/agent-creation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,gBAAgB,EAAc,MAAM,qBAAqB,CAAC;AAUrF,OAAO,EACH,UAAU,EAEV,KAAK,iBAAiB,EACtB,KAAK,yBAAyB,EACjC,MAAM,aAAa,CAAC;AACrB,OAAO,EAAqB,KAAK,wBAAwB,EAAE,MAAM,mBAAmB,CAAC;AAGrF,KAAK,iCAAiC,GAAG;IACrC,MAAM,EAAE,WAAW,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAChC,aAAa,CAAC,EAAE,wBAAwB,GAAG,SAAS,CAAC;IACrD,eAAe,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACrC,iBAAiB,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACvC,YAAY,CAAC,EAAE,UAAU,GAAG,SAAS,CAAC;IACtC,WAAW,CAAC,EAAE,gBAAgB,GAAG,SAAS,CAAC;IAC3C,SAAS,CAAC,EAAE,yBAAyB,GAAG,SAAS,CAAC;IAClD,gBAAgB,CAAC,EAAE,IAAI,CAAC,iBAAiB,EAAE,cAAc,GAAG,aAAa,CAAC,GAAG,SAAS,CAAC;CAC1F,CAAC;AA0DF,wBAAsB,0BAA0B,CAC5C,OAAO,EAAE,iCAAiC,GAC3C,OAAO,CAAC,UAAU,CAAC,CAgDrB"}
|
package/dist/agent-creation.js
CHANGED
|
@@ -2,6 +2,7 @@ import {
|
|
|
2
2
|
AgentConfigSchema,
|
|
3
3
|
applyImageDefaults,
|
|
4
4
|
cleanNullValues,
|
|
5
|
+
createAgentConfigSchema,
|
|
5
6
|
loadImage,
|
|
6
7
|
resolveServicesFromConfig,
|
|
7
8
|
toDextoAgentOptions
|
|
@@ -66,7 +67,7 @@ async function createDextoAgentFromConfig(options) {
|
|
|
66
67
|
if (agentIdOverride !== void 0) {
|
|
67
68
|
enrichedConfig.agentId = agentIdOverride;
|
|
68
69
|
}
|
|
69
|
-
const validatedConfig = AgentConfigSchema.parse(enrichedConfig);
|
|
70
|
+
const validatedConfig = runtimeOverrides?.llmRegistry ? createAgentConfigSchema(runtimeOverrides.llmRegistry).parse(enrichedConfig) : AgentConfigSchema.parse(enrichedConfig);
|
|
70
71
|
const resolvedHostContext = {
|
|
71
72
|
...hostContext ?? {},
|
|
72
73
|
...enrichOptions?.workspaceRoot ? { workspaceRoot: enrichOptions.workspaceRoot } : {}
|
|
@@ -30,9 +30,11 @@ class AgentRuntime {
|
|
|
30
30
|
pool;
|
|
31
31
|
config;
|
|
32
32
|
logger;
|
|
33
|
+
llmRegistry;
|
|
33
34
|
constructor(options) {
|
|
34
35
|
this.config = import_schemas.AgentRuntimeConfigSchema.parse(options.config ?? {});
|
|
35
36
|
this.logger = options.logger;
|
|
37
|
+
this.llmRegistry = options.llmRegistry;
|
|
36
38
|
this.pool = new import_AgentPool.AgentPool(this.config, this.logger);
|
|
37
39
|
this.logger.debug("AgentRuntime initialized", {
|
|
38
40
|
maxAgents: this.config.maxAgents,
|
|
@@ -62,7 +64,8 @@ class AgentRuntime {
|
|
|
62
64
|
forceStoragePaths: true
|
|
63
65
|
},
|
|
64
66
|
agentIdOverride: agentId,
|
|
65
|
-
agentContext: "subagent"
|
|
67
|
+
agentContext: "subagent",
|
|
68
|
+
...this.llmRegistry ? { runtimeOverrides: { llmRegistry: this.llmRegistry } } : {}
|
|
66
69
|
});
|
|
67
70
|
const sessionId = `session-${(0, import_crypto.randomUUID)().slice(0, 8)}`;
|
|
68
71
|
const handle = {
|
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
* - Clean up agents when no longer needed
|
|
15
15
|
*/
|
|
16
16
|
import type { Logger } from '@dexto/core';
|
|
17
|
+
import type { ModelRegistry } from '@dexto/llm';
|
|
17
18
|
import type { AgentRuntimeConfig, SpawnConfig, AgentHandle, TaskResult, AgentFilter } from './types.js';
|
|
18
19
|
import { type ValidatedAgentRuntimeConfig } from './schemas.js';
|
|
19
20
|
/**
|
|
@@ -24,11 +25,14 @@ export interface AgentRuntimeOptions {
|
|
|
24
25
|
config?: AgentRuntimeConfig;
|
|
25
26
|
/** Logger instance */
|
|
26
27
|
logger: Logger;
|
|
28
|
+
/** Host-selected model registry inherited by spawned agents. */
|
|
29
|
+
llmRegistry?: ModelRegistry;
|
|
27
30
|
}
|
|
28
31
|
export declare class AgentRuntime {
|
|
29
32
|
private pool;
|
|
30
33
|
private config;
|
|
31
34
|
private logger;
|
|
35
|
+
private llmRegistry;
|
|
32
36
|
constructor(options: AgentRuntimeOptions);
|
|
33
37
|
/**
|
|
34
38
|
* Spawn a new agent
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AgentRuntime.d.ts","sourceRoot":"","sources":["../../src/runtime/AgentRuntime.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAGH,OAAO,KAAK,EAAE,MAAM,EAAoB,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"AgentRuntime.d.ts","sourceRoot":"","sources":["../../src/runtime/AgentRuntime.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAGH,OAAO,KAAK,EAAE,MAAM,EAAoB,MAAM,aAAa,CAAC;AAC5D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAGhD,OAAO,KAAK,EACR,kBAAkB,EAClB,WAAW,EACX,WAAW,EACX,UAAU,EACV,WAAW,EACd,MAAM,YAAY,CAAC;AACpB,OAAO,EAA4B,KAAK,2BAA2B,EAAE,MAAM,cAAc,CAAC;AAG1F;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAChC,4BAA4B;IAC5B,MAAM,CAAC,EAAE,kBAAkB,CAAC;IAC5B,sBAAsB;IACtB,MAAM,EAAE,MAAM,CAAC;IACf,gEAAgE;IAChE,WAAW,CAAC,EAAE,aAAa,CAAC;CAC/B;AAED,qBAAa,YAAY;IACrB,OAAO,CAAC,IAAI,CAAY;IACxB,OAAO,CAAC,MAAM,CAA8B;IAC5C,OAAO,CAAC,MAAM,CAAS;IACvB,OAAO,CAAC,WAAW,CAA4B;gBAEnC,OAAO,EAAE,mBAAmB;IAaxC;;;;;OAKG;IACG,UAAU,CAAC,MAAM,EAAE,WAAW,GAAG,OAAO,CAAC,WAAW,CAAC;IA2E3D;;;;;;;OAOG;IACG,WAAW,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC;IAgFvF;;OAEG;IACH,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,WAAW,GAAG,SAAS;IAIlD;;OAEG;IACH,UAAU,CAAC,MAAM,CAAC,EAAE,WAAW,GAAG,WAAW,EAAE;IAI/C;;OAEG;IACG,SAAS,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAsC/C;;OAEG;IACG,OAAO,CAAC,MAAM,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;IASlD;;OAEG;IACH,SAAS,IAAI,2BAA2B;IAIxC;;OAEG;IACH,QAAQ,IAAI;QAAE,WAAW,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;KAAE;CAaxE"}
|
|
@@ -7,9 +7,11 @@ class AgentRuntime {
|
|
|
7
7
|
pool;
|
|
8
8
|
config;
|
|
9
9
|
logger;
|
|
10
|
+
llmRegistry;
|
|
10
11
|
constructor(options) {
|
|
11
12
|
this.config = AgentRuntimeConfigSchema.parse(options.config ?? {});
|
|
12
13
|
this.logger = options.logger;
|
|
14
|
+
this.llmRegistry = options.llmRegistry;
|
|
13
15
|
this.pool = new AgentPool(this.config, this.logger);
|
|
14
16
|
this.logger.debug("AgentRuntime initialized", {
|
|
15
17
|
maxAgents: this.config.maxAgents,
|
|
@@ -39,7 +41,8 @@ class AgentRuntime {
|
|
|
39
41
|
forceStoragePaths: true
|
|
40
42
|
},
|
|
41
43
|
agentIdOverride: agentId,
|
|
42
|
-
agentContext: "subagent"
|
|
44
|
+
agentContext: "subagent",
|
|
45
|
+
...this.llmRegistry ? { runtimeOverrides: { llmRegistry: this.llmRegistry } } : {}
|
|
43
46
|
});
|
|
44
47
|
const sessionId = `session-${randomUUID().slice(0, 8)}`;
|
|
45
48
|
const handle = {
|
|
@@ -23,17 +23,18 @@ __export(llm_resolution_exports, {
|
|
|
23
23
|
module.exports = __toCommonJS(llm_resolution_exports);
|
|
24
24
|
var import_llm = require("@dexto/llm");
|
|
25
25
|
function resolveSubAgentLLM(options) {
|
|
26
|
-
const { subAgentLLM, parentLLM, subAgentId } = options;
|
|
26
|
+
const { subAgentLLM, parentLLM, registry = import_llm.DEFAULT_MODEL_REGISTRY, subAgentId } = options;
|
|
27
27
|
const agentLabel = subAgentId ? `'${subAgentId}'` : "sub-agent";
|
|
28
28
|
const subAgentProvider = subAgentLLM.provider;
|
|
29
29
|
const subAgentModel = subAgentLLM.model;
|
|
30
30
|
const parentProvider = parentLLM.provider;
|
|
31
|
-
if ((0, import_llm.hasAllRegistryModelsSupport)(parentProvider)) {
|
|
31
|
+
if ((0, import_llm.hasAllRegistryModelsSupport)(parentProvider, registry)) {
|
|
32
32
|
try {
|
|
33
33
|
const transformedModel = (0, import_llm.transformModelNameForProvider)(
|
|
34
34
|
subAgentModel,
|
|
35
35
|
subAgentProvider,
|
|
36
|
-
parentProvider
|
|
36
|
+
parentProvider,
|
|
37
|
+
registry
|
|
37
38
|
);
|
|
38
39
|
return {
|
|
39
40
|
llm: {
|
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
* 0. Check sub-agent's .local.yml for LLM override (highest priority)
|
|
15
15
|
*/
|
|
16
16
|
import type { LLMConfig } from '@dexto/core';
|
|
17
|
+
import { type ModelRegistry } from '@dexto/llm';
|
|
17
18
|
/**
|
|
18
19
|
* Result of resolving a sub-agent's LLM configuration
|
|
19
20
|
*/
|
|
@@ -30,6 +31,8 @@ export interface ResolveSubAgentLLMOptions {
|
|
|
30
31
|
subAgentLLM: LLMConfig;
|
|
31
32
|
/** The parent agent's LLM configuration (already has preferences applied) */
|
|
32
33
|
parentLLM: LLMConfig;
|
|
34
|
+
/** The registry selected by the host for the parent agent. */
|
|
35
|
+
registry?: ModelRegistry;
|
|
33
36
|
/** Sub-agent ID for logging purposes */
|
|
34
37
|
subAgentId?: string;
|
|
35
38
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"llm-resolution.d.ts","sourceRoot":"","sources":["../../../src/tool-factories/agent-spawner/llm-resolution.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"llm-resolution.d.ts","sourceRoot":"","sources":["../../../src/tool-factories/agent-spawner/llm-resolution.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EAIH,KAAK,aAAa,EACrB,MAAM,YAAY,CAAC;AAEpB;;GAEG;AACH,MAAM,WAAW,qBAAqB;IAClC,4CAA4C;IAC5C,GAAG,EAAE,SAAS,CAAC;IACf,wCAAwC;IACxC,UAAU,EACJ,mBAAmB,GACnB,eAAe,GACf,iBAAiB,CAAC;IACxB,+CAA+C;IAC/C,MAAM,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,yBAAyB;IACtC,gDAAgD;IAChD,WAAW,EAAE,SAAS,CAAC;IACvB,6EAA6E;IAC7E,SAAS,EAAE,SAAS,CAAC;IACrB,8DAA8D;IAC9D,QAAQ,CAAC,EAAE,aAAa,CAAC;IACzB,wCAAwC;IACxC,UAAU,CAAC,EAAE,MAAM,CAAC;CACvB;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,yBAAyB,GAAG,qBAAqB,CAoE5F"}
|
|
@@ -1,16 +1,21 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
DEFAULT_MODEL_REGISTRY,
|
|
3
|
+
hasAllRegistryModelsSupport,
|
|
4
|
+
transformModelNameForProvider
|
|
5
|
+
} from "@dexto/llm";
|
|
2
6
|
function resolveSubAgentLLM(options) {
|
|
3
|
-
const { subAgentLLM, parentLLM, subAgentId } = options;
|
|
7
|
+
const { subAgentLLM, parentLLM, registry = DEFAULT_MODEL_REGISTRY, subAgentId } = options;
|
|
4
8
|
const agentLabel = subAgentId ? `'${subAgentId}'` : "sub-agent";
|
|
5
9
|
const subAgentProvider = subAgentLLM.provider;
|
|
6
10
|
const subAgentModel = subAgentLLM.model;
|
|
7
11
|
const parentProvider = parentLLM.provider;
|
|
8
|
-
if (hasAllRegistryModelsSupport(parentProvider)) {
|
|
12
|
+
if (hasAllRegistryModelsSupport(parentProvider, registry)) {
|
|
9
13
|
try {
|
|
10
14
|
const transformedModel = transformModelNameForProvider(
|
|
11
15
|
subAgentModel,
|
|
12
16
|
subAgentProvider,
|
|
13
|
-
parentProvider
|
|
17
|
+
parentProvider,
|
|
18
|
+
registry
|
|
14
19
|
);
|
|
15
20
|
return {
|
|
16
21
|
llm: {
|
|
@@ -63,7 +63,7 @@ class AgentSpawnerRuntime {
|
|
|
63
63
|
logger;
|
|
64
64
|
workspaceRootHint;
|
|
65
65
|
selectLowestReasoningVariant(provider, model, preferredVariant) {
|
|
66
|
-
const profile = (0, import_llm.getReasoningProfile)(provider, model);
|
|
66
|
+
const profile = (0, import_llm.getReasoningProfile)(provider, model, this.parentAgent.llmRegistry);
|
|
67
67
|
if (!profile.capable || profile.supportedVariants.length === 0) {
|
|
68
68
|
return void 0;
|
|
69
69
|
}
|
|
@@ -280,7 +280,8 @@ class AgentSpawnerRuntime {
|
|
|
280
280
|
maxAgents: config.maxConcurrentAgents,
|
|
281
281
|
defaultTaskTimeout: config.defaultTimeout
|
|
282
282
|
},
|
|
283
|
-
logger
|
|
283
|
+
logger,
|
|
284
|
+
llmRegistry: parentAgent.llmRegistry
|
|
284
285
|
});
|
|
285
286
|
this.logger.debug(
|
|
286
287
|
`AgentSpawnerRuntime initialized for parent '${this.parentId}' (maxAgents: ${config.maxConcurrentAgents})`
|
|
@@ -789,6 +790,7 @@ class AgentSpawnerRuntime {
|
|
|
789
790
|
const resolution = (0, import_llm_resolution.resolveSubAgentLLM)({
|
|
790
791
|
subAgentLLM: loadedConfig.llm,
|
|
791
792
|
parentLLM: currentParentLLM,
|
|
793
|
+
registry: this.parentAgent.llmRegistry,
|
|
792
794
|
subAgentId: agentId
|
|
793
795
|
});
|
|
794
796
|
this.logger.debug(`Sub-agent LLM resolution: ${resolution.reason}`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../../../src/tool-factories/agent-spawner/runtime.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAIH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAOlE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAIlE,OAAO,EAAE,KAAK,kBAAkB,EAAE,MAAM,cAAc,CAAC;AACvD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAiBnD,qBAAa,mBAAoB,YAAW,UAAU;IAClD,OAAO,CAAC,OAAO,CAAe;IAC9B,OAAO,CAAC,QAAQ,CAAS;IACzB,OAAO,CAAC,WAAW,CAAa;IAChC,OAAO,CAAC,MAAM,CAAqB;IACnC,OAAO,CAAC,MAAM,CAAS;IACvB,OAAO,CAAC,iBAAiB,CAAqB;IAE9C,OAAO,CAAC,4BAA4B;IAuBpC,OAAO,CAAC,sBAAsB;IA8B9B,OAAO,CAAC,yBAAyB;IAyBjC,OAAO,CAAC,2BAA2B;IAYnC,OAAO,CAAC,wCAAwC;IAUhD,oBAAoB,CAAC,iBAAiB,CAAC,EAAE,MAAM,GAAG,IAAI;YAKxC,wBAAwB;YAgCxB,iCAAiC;YA8CjC,mCAAmC;gBAyFrC,WAAW,EAAE,UAAU,EAAE,MAAM,EAAE,kBAAkB,EAAE,MAAM,EAAE,MAAM;
|
|
1
|
+
{"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../../../src/tool-factories/agent-spawner/runtime.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAIH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAOlE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAIlE,OAAO,EAAE,KAAK,kBAAkB,EAAE,MAAM,cAAc,CAAC;AACvD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAiBnD,qBAAa,mBAAoB,YAAW,UAAU;IAClD,OAAO,CAAC,OAAO,CAAe;IAC9B,OAAO,CAAC,QAAQ,CAAS;IACzB,OAAO,CAAC,WAAW,CAAa;IAChC,OAAO,CAAC,MAAM,CAAqB;IACnC,OAAO,CAAC,MAAM,CAAS;IACvB,OAAO,CAAC,iBAAiB,CAAqB;IAE9C,OAAO,CAAC,4BAA4B;IAuBpC,OAAO,CAAC,sBAAsB;IA8B9B,OAAO,CAAC,yBAAyB;IAyBjC,OAAO,CAAC,2BAA2B;IAYnC,OAAO,CAAC,wCAAwC;IAUhD,oBAAoB,CAAC,iBAAiB,CAAC,EAAE,MAAM,GAAG,IAAI;YAKxC,wBAAwB;YAgCxB,iCAAiC;YA8CjC,mCAAmC;gBAyFrC,WAAW,EAAE,UAAU,EAAE,MAAM,EAAE,kBAAkB,EAAE,MAAM,EAAE,MAAM;IAwB/E;;OAEG;IACH,OAAO,CAAC,gBAAgB;IAIxB;;OAEG;IACH,OAAO,CAAC,QAAQ;IAIhB;;;;;;;;;;;;;;OAcG;IACG,eAAe,CAAC,KAAK,EAAE;QACzB,IAAI,EAAE,MAAM,CAAC;QACb,YAAY,EAAE,MAAM,CAAC;QACrB,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,WAAW,CAAC,EAAE,OAAO,CAAC;QACtB,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,SAAS,CAAC,EAAE,MAAM,CAAC;KACtB,GAAG,OAAO,CAAC,gBAAgB,CAAC;IA8C7B;;;;;;;;;;OAUG;IACG,IAAI,CAAC,OAAO,EAAE;QAChB,IAAI,EAAE,MAAM,CAAC;QACb,YAAY,EAAE,MAAM,CAAC;QACrB,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,WAAW,CAAC,EAAE,OAAO,CAAC;QACtB,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,SAAS,CAAC,EAAE,MAAM,CAAC;KACtB,GAAG,OAAO,CAAC;QAAE,OAAO,EAAE,OAAO,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IAIpE;;;;;OAKG;IACH,OAAO,CAAC,qBAAqB;IA+G7B;;OAEG;YACW,oBAAoB;IA2BlC,OAAO,CAAC,sBAAsB;IAuB9B;;OAEG;IACH,OAAO,CAAC,UAAU;IAsBlB;;OAEG;YACW,oBAAoB;IA4RlC;;;;;;;OAOG;YACW,mBAAmB;IA6KjC;;;OAGG;IACG,kBAAkB,IAAI,OAAO,CAAC,kBAAkB,EAAE,CAAC;IAqCzD;;OAEG;IACG,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;CAIjC"}
|
|
@@ -30,7 +30,7 @@ class AgentSpawnerRuntime {
|
|
|
30
30
|
logger;
|
|
31
31
|
workspaceRootHint;
|
|
32
32
|
selectLowestReasoningVariant(provider, model, preferredVariant) {
|
|
33
|
-
const profile = getReasoningProfile(provider, model);
|
|
33
|
+
const profile = getReasoningProfile(provider, model, this.parentAgent.llmRegistry);
|
|
34
34
|
if (!profile.capable || profile.supportedVariants.length === 0) {
|
|
35
35
|
return void 0;
|
|
36
36
|
}
|
|
@@ -247,7 +247,8 @@ class AgentSpawnerRuntime {
|
|
|
247
247
|
maxAgents: config.maxConcurrentAgents,
|
|
248
248
|
defaultTaskTimeout: config.defaultTimeout
|
|
249
249
|
},
|
|
250
|
-
logger
|
|
250
|
+
logger,
|
|
251
|
+
llmRegistry: parentAgent.llmRegistry
|
|
251
252
|
});
|
|
252
253
|
this.logger.debug(
|
|
253
254
|
`AgentSpawnerRuntime initialized for parent '${this.parentId}' (maxAgents: ${config.maxConcurrentAgents})`
|
|
@@ -756,6 +757,7 @@ class AgentSpawnerRuntime {
|
|
|
756
757
|
const resolution = resolveSubAgentLLM({
|
|
757
758
|
subAgentLLM: loadedConfig.llm,
|
|
758
759
|
parentLLM: currentParentLLM,
|
|
760
|
+
registry: this.parentAgent.llmRegistry,
|
|
759
761
|
subAgentId: agentId
|
|
760
762
|
});
|
|
761
763
|
this.logger.debug(`Sub-agent LLM resolution: ${resolution.reason}`);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dexto/agent-management",
|
|
3
|
-
"version": "1.10.
|
|
3
|
+
"version": "1.10.3",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -22,11 +22,11 @@
|
|
|
22
22
|
"dependencies": {
|
|
23
23
|
"yaml": "^2.8.3",
|
|
24
24
|
"zod": "^4.3.6",
|
|
25
|
-
"@dexto/agent-config": "1.10.
|
|
26
|
-
"@dexto/core": "1.10.
|
|
27
|
-
"@dexto/llm": "1.10.
|
|
28
|
-
"@dexto/orchestration": "1.10.
|
|
29
|
-
"@dexto/tools-builtins": "1.10.
|
|
25
|
+
"@dexto/agent-config": "1.10.3",
|
|
26
|
+
"@dexto/core": "1.10.3",
|
|
27
|
+
"@dexto/llm": "1.10.3",
|
|
28
|
+
"@dexto/orchestration": "1.10.3",
|
|
29
|
+
"@dexto/tools-builtins": "1.10.3"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
32
|
"@types/node": "^22.13.5"
|