@dexto/agent-management 1.6.1 → 1.6.2
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/agent-creation.cjs +2 -1
- package/dist/agent-creation.d.ts.map +1 -1
- package/dist/agent-creation.js +2 -1
- package/dist/index.cjs +3 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/models/custom-models.cjs +4 -3
- package/dist/models/custom-models.d.ts +26 -5
- package/dist/models/custom-models.d.ts.map +1 -1
- package/dist/models/custom-models.js +4 -3
- package/dist/preferences/loader.cjs +2 -2
- package/dist/preferences/loader.d.ts +3 -3
- package/dist/preferences/loader.d.ts.map +1 -1
- package/dist/preferences/loader.js +2 -2
- package/dist/preferences/schemas.cjs +42 -11
- package/dist/preferences/schemas.d.ts +60 -12
- package/dist/preferences/schemas.d.ts.map +1 -1
- package/dist/preferences/schemas.js +43 -7
- package/dist/tool-factories/agent-spawner/runtime.cjs +48 -1
- package/dist/tool-factories/agent-spawner/runtime.d.ts +3 -1
- package/dist/tool-factories/agent-spawner/runtime.d.ts.map +1 -1
- package/dist/tool-factories/agent-spawner/runtime.js +54 -2
- package/dist/tool-factories/agent-spawner/schemas.cjs +12 -0
- package/dist/tool-factories/agent-spawner/schemas.d.ts +9 -0
- package/dist/tool-factories/agent-spawner/schemas.d.ts.map +1 -1
- package/dist/tool-factories/agent-spawner/schemas.js +10 -0
- package/dist/tool-factories/creator-tools/factory.cjs +434 -0
- package/dist/tool-factories/creator-tools/factory.d.ts +4 -0
- package/dist/tool-factories/creator-tools/factory.d.ts.map +1 -0
- package/dist/tool-factories/creator-tools/factory.js +407 -0
- package/dist/tool-factories/creator-tools/index.cjs +33 -0
- package/dist/tool-factories/creator-tools/index.d.ts +3 -0
- package/dist/tool-factories/creator-tools/index.d.ts.map +1 -0
- package/dist/tool-factories/creator-tools/index.js +10 -0
- package/dist/tool-factories/creator-tools/schemas.cjs +41 -0
- package/dist/tool-factories/creator-tools/schemas.d.ts +15 -0
- package/dist/tool-factories/creator-tools/schemas.d.ts.map +1 -0
- package/dist/tool-factories/creator-tools/schemas.js +16 -0
- package/package.json +5 -5
|
@@ -41,12 +41,58 @@ var import_types = require("../../registry/types.js");
|
|
|
41
41
|
var import_path = require("../../utils/path.js");
|
|
42
42
|
var path = __toESM(require("path"), 1);
|
|
43
43
|
var import_llm_resolution = require("./llm-resolution.js");
|
|
44
|
+
const REASONING_VARIANT_FALLBACK_ORDER = [
|
|
45
|
+
"disabled",
|
|
46
|
+
"none",
|
|
47
|
+
"minimal",
|
|
48
|
+
"low",
|
|
49
|
+
"enabled",
|
|
50
|
+
"medium",
|
|
51
|
+
"high",
|
|
52
|
+
"max",
|
|
53
|
+
"xhigh"
|
|
54
|
+
];
|
|
44
55
|
class AgentSpawnerRuntime {
|
|
45
56
|
runtime;
|
|
46
57
|
parentId;
|
|
47
58
|
parentAgent;
|
|
48
59
|
config;
|
|
49
60
|
logger;
|
|
61
|
+
selectLowestReasoningVariant(provider, model, preferredVariant) {
|
|
62
|
+
const profile = (0, import_core.getReasoningProfile)(provider, model);
|
|
63
|
+
if (!profile.capable || profile.supportedVariants.length === 0) {
|
|
64
|
+
return void 0;
|
|
65
|
+
}
|
|
66
|
+
if ((0, import_core.supportsReasoningVariant)(profile, preferredVariant)) {
|
|
67
|
+
return preferredVariant;
|
|
68
|
+
}
|
|
69
|
+
for (const variant of REASONING_VARIANT_FALLBACK_ORDER) {
|
|
70
|
+
if ((0, import_core.supportsReasoningVariant)(profile, variant)) {
|
|
71
|
+
return variant;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
return profile.defaultVariant ?? profile.supportedVariants[0];
|
|
75
|
+
}
|
|
76
|
+
applySubAgentLlmPolicy(llm) {
|
|
77
|
+
const maxIterationsCap = this.config.subAgentMaxIterations;
|
|
78
|
+
const preferredReasoningVariant = this.config.subAgentReasoningVariant;
|
|
79
|
+
const reasoningVariant = this.selectLowestReasoningVariant(
|
|
80
|
+
llm.provider,
|
|
81
|
+
llm.model,
|
|
82
|
+
preferredReasoningVariant
|
|
83
|
+
);
|
|
84
|
+
const existingMaxIterations = llm.maxIterations;
|
|
85
|
+
const cappedMaxIterations = typeof existingMaxIterations === "number" ? Math.min(existingMaxIterations, maxIterationsCap) : maxIterationsCap;
|
|
86
|
+
const adjusted = {
|
|
87
|
+
...llm,
|
|
88
|
+
maxIterations: cappedMaxIterations,
|
|
89
|
+
...reasoningVariant !== void 0 ? { reasoning: { variant: reasoningVariant } } : { reasoning: void 0 }
|
|
90
|
+
};
|
|
91
|
+
this.logger.debug(
|
|
92
|
+
`[AgentSpawnerRuntime] Applied sub-agent LLM policy: maxIterations=${adjusted.maxIterations}, preferredReasoning=${preferredReasoningVariant}, selectedReasoning=${reasoningVariant ?? "none"}`
|
|
93
|
+
);
|
|
94
|
+
return adjusted;
|
|
95
|
+
}
|
|
50
96
|
resolveBundledAgentConfig(agentId) {
|
|
51
97
|
const baseDir = "agents";
|
|
52
98
|
const normalizedPath = path.relative(baseDir, path.join(baseDir, agentId));
|
|
@@ -597,6 +643,7 @@ class AgentSpawnerRuntime {
|
|
|
597
643
|
this.logger.debug(`Sub-agent LLM resolution: ${resolution.reason}`);
|
|
598
644
|
llmConfig = resolution.llm;
|
|
599
645
|
}
|
|
646
|
+
llmConfig = this.applySubAgentLlmPolicy(llmConfig);
|
|
600
647
|
return {
|
|
601
648
|
...loadedConfig,
|
|
602
649
|
llm: llmConfig,
|
|
@@ -613,7 +660,7 @@ class AgentSpawnerRuntime {
|
|
|
613
660
|
);
|
|
614
661
|
}
|
|
615
662
|
const config = {
|
|
616
|
-
llm: { ...currentParentLLM },
|
|
663
|
+
llm: this.applySubAgentLlmPolicy({ ...currentParentLLM }),
|
|
617
664
|
// Default system prompt for sub-agents
|
|
618
665
|
systemPrompt: "You are a helpful sub-agent. Complete the task given to you efficiently and concisely.",
|
|
619
666
|
permissions: {
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
*/
|
|
13
13
|
import type { DextoAgent, Logger, TaskForker } from '@dexto/core';
|
|
14
14
|
import type { AgentRegistryEntry } from '../../registry/types.js';
|
|
15
|
-
import type
|
|
15
|
+
import { type AgentSpawnerConfig } from './schemas.js';
|
|
16
16
|
import type { SpawnAgentOutput } from './types.js';
|
|
17
17
|
export declare class AgentSpawnerRuntime implements TaskForker {
|
|
18
18
|
private runtime;
|
|
@@ -20,6 +20,8 @@ export declare class AgentSpawnerRuntime implements TaskForker {
|
|
|
20
20
|
private parentAgent;
|
|
21
21
|
private config;
|
|
22
22
|
private logger;
|
|
23
|
+
private selectLowestReasoningVariant;
|
|
24
|
+
private applySubAgentLlmPolicy;
|
|
23
25
|
private resolveBundledAgentConfig;
|
|
24
26
|
private createFallbackRegistryEntry;
|
|
25
27
|
constructor(parentAgent: DextoAgent, config: AgentSpawnerConfig, logger: Logger);
|
|
@@ -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;
|
|
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;AAWlE,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;AAenD,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;IAEvB,OAAO,CAAC,4BAA4B;IAuBpC,OAAO,CAAC,sBAAsB;IA8B9B,OAAO,CAAC,yBAAyB;IAyBjC,OAAO,CAAC,2BAA2B;gBAYvB,WAAW,EAAE,UAAU,EAAE,MAAM,EAAE,kBAAkB,EAAE,MAAM,EAAE,MAAM;IAuB/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;IAmKjC;;;OAGG;IACH,kBAAkB,IAAI,kBAAkB,EAAE;IA6B1C;;OAEG;IACG,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;CAIjC"}
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import { randomUUID } from "crypto";
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
DextoRuntimeError,
|
|
4
|
+
ErrorType,
|
|
5
|
+
getReasoningProfile,
|
|
6
|
+
supportsReasoningVariant
|
|
7
|
+
} from "@dexto/core";
|
|
3
8
|
import { AgentRuntime } from "../../runtime/AgentRuntime.js";
|
|
4
9
|
import { createDelegatingApprovalHandler } from "../../runtime/approval-delegation.js";
|
|
5
10
|
import { loadAgentConfig } from "../../config/loader.js";
|
|
@@ -8,12 +13,58 @@ import { deriveDisplayName } from "../../registry/types.js";
|
|
|
8
13
|
import { getDextoPath, resolveBundledScript } from "../../utils/path.js";
|
|
9
14
|
import * as path from "path";
|
|
10
15
|
import { resolveSubAgentLLM } from "./llm-resolution.js";
|
|
16
|
+
const REASONING_VARIANT_FALLBACK_ORDER = [
|
|
17
|
+
"disabled",
|
|
18
|
+
"none",
|
|
19
|
+
"minimal",
|
|
20
|
+
"low",
|
|
21
|
+
"enabled",
|
|
22
|
+
"medium",
|
|
23
|
+
"high",
|
|
24
|
+
"max",
|
|
25
|
+
"xhigh"
|
|
26
|
+
];
|
|
11
27
|
class AgentSpawnerRuntime {
|
|
12
28
|
runtime;
|
|
13
29
|
parentId;
|
|
14
30
|
parentAgent;
|
|
15
31
|
config;
|
|
16
32
|
logger;
|
|
33
|
+
selectLowestReasoningVariant(provider, model, preferredVariant) {
|
|
34
|
+
const profile = getReasoningProfile(provider, model);
|
|
35
|
+
if (!profile.capable || profile.supportedVariants.length === 0) {
|
|
36
|
+
return void 0;
|
|
37
|
+
}
|
|
38
|
+
if (supportsReasoningVariant(profile, preferredVariant)) {
|
|
39
|
+
return preferredVariant;
|
|
40
|
+
}
|
|
41
|
+
for (const variant of REASONING_VARIANT_FALLBACK_ORDER) {
|
|
42
|
+
if (supportsReasoningVariant(profile, variant)) {
|
|
43
|
+
return variant;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
return profile.defaultVariant ?? profile.supportedVariants[0];
|
|
47
|
+
}
|
|
48
|
+
applySubAgentLlmPolicy(llm) {
|
|
49
|
+
const maxIterationsCap = this.config.subAgentMaxIterations;
|
|
50
|
+
const preferredReasoningVariant = this.config.subAgentReasoningVariant;
|
|
51
|
+
const reasoningVariant = this.selectLowestReasoningVariant(
|
|
52
|
+
llm.provider,
|
|
53
|
+
llm.model,
|
|
54
|
+
preferredReasoningVariant
|
|
55
|
+
);
|
|
56
|
+
const existingMaxIterations = llm.maxIterations;
|
|
57
|
+
const cappedMaxIterations = typeof existingMaxIterations === "number" ? Math.min(existingMaxIterations, maxIterationsCap) : maxIterationsCap;
|
|
58
|
+
const adjusted = {
|
|
59
|
+
...llm,
|
|
60
|
+
maxIterations: cappedMaxIterations,
|
|
61
|
+
...reasoningVariant !== void 0 ? { reasoning: { variant: reasoningVariant } } : { reasoning: void 0 }
|
|
62
|
+
};
|
|
63
|
+
this.logger.debug(
|
|
64
|
+
`[AgentSpawnerRuntime] Applied sub-agent LLM policy: maxIterations=${adjusted.maxIterations}, preferredReasoning=${preferredReasoningVariant}, selectedReasoning=${reasoningVariant ?? "none"}`
|
|
65
|
+
);
|
|
66
|
+
return adjusted;
|
|
67
|
+
}
|
|
17
68
|
resolveBundledAgentConfig(agentId) {
|
|
18
69
|
const baseDir = "agents";
|
|
19
70
|
const normalizedPath = path.relative(baseDir, path.join(baseDir, agentId));
|
|
@@ -564,6 +615,7 @@ class AgentSpawnerRuntime {
|
|
|
564
615
|
this.logger.debug(`Sub-agent LLM resolution: ${resolution.reason}`);
|
|
565
616
|
llmConfig = resolution.llm;
|
|
566
617
|
}
|
|
618
|
+
llmConfig = this.applySubAgentLlmPolicy(llmConfig);
|
|
567
619
|
return {
|
|
568
620
|
...loadedConfig,
|
|
569
621
|
llm: llmConfig,
|
|
@@ -580,7 +632,7 @@ class AgentSpawnerRuntime {
|
|
|
580
632
|
);
|
|
581
633
|
}
|
|
582
634
|
const config = {
|
|
583
|
-
llm: { ...currentParentLLM },
|
|
635
|
+
llm: this.applySubAgentLlmPolicy({ ...currentParentLLM }),
|
|
584
636
|
// Default system prompt for sub-agents
|
|
585
637
|
systemPrompt: "You are a helpful sub-agent. Complete the task given to you efficiently and concisely.",
|
|
586
638
|
permissions: {
|
|
@@ -19,10 +19,14 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
19
19
|
var schemas_exports = {};
|
|
20
20
|
__export(schemas_exports, {
|
|
21
21
|
AgentSpawnerConfigSchema: () => AgentSpawnerConfigSchema,
|
|
22
|
+
DEFAULT_SUB_AGENT_MAX_ITERATIONS: () => DEFAULT_SUB_AGENT_MAX_ITERATIONS,
|
|
23
|
+
DEFAULT_SUB_AGENT_REASONING_VARIANT: () => DEFAULT_SUB_AGENT_REASONING_VARIANT,
|
|
22
24
|
SpawnAgentInputSchema: () => SpawnAgentInputSchema
|
|
23
25
|
});
|
|
24
26
|
module.exports = __toCommonJS(schemas_exports);
|
|
25
27
|
var import_zod = require("zod");
|
|
28
|
+
const DEFAULT_SUB_AGENT_MAX_ITERATIONS = 100;
|
|
29
|
+
const DEFAULT_SUB_AGENT_REASONING_VARIANT = "disabled";
|
|
26
30
|
const AgentSpawnerConfigSchema = import_zod.z.object({
|
|
27
31
|
/** Type discriminator for the factory */
|
|
28
32
|
type: import_zod.z.literal("agent-spawner"),
|
|
@@ -30,6 +34,12 @@ const AgentSpawnerConfigSchema = import_zod.z.object({
|
|
|
30
34
|
maxConcurrentAgents: import_zod.z.number().int().positive().default(5).describe("Maximum concurrent sub-agents"),
|
|
31
35
|
/** Default timeout for task execution in milliseconds (default: 3600000 = 1 hour) */
|
|
32
36
|
defaultTimeout: import_zod.z.number().int().nonnegative().default(36e5).describe("Default task timeout in milliseconds (0 = no timeout)"),
|
|
37
|
+
subAgentMaxIterations: import_zod.z.number().int().positive().default(DEFAULT_SUB_AGENT_MAX_ITERATIONS).describe(
|
|
38
|
+
"Max outer-loop tool-call iterations for spawned sub-agents. Acts as a safety cap to prevent runaway exploration."
|
|
39
|
+
),
|
|
40
|
+
subAgentReasoningVariant: import_zod.z.string().trim().min(1).default(DEFAULT_SUB_AGENT_REASONING_VARIANT).describe(
|
|
41
|
+
"Preferred reasoning variant for spawned sub-agents. Default is 'disabled'. If unsupported by the resolved model, Dexto falls back to the lowest available variant."
|
|
42
|
+
),
|
|
33
43
|
/** Whether spawning is enabled (default: true) */
|
|
34
44
|
allowSpawning: import_zod.z.boolean().default(true).describe("Whether agent spawning is enabled"),
|
|
35
45
|
/**
|
|
@@ -69,5 +79,7 @@ const SpawnAgentInputSchema = import_zod.z.object({
|
|
|
69
79
|
// Annotate the CommonJS export names for ESM import in node:
|
|
70
80
|
0 && (module.exports = {
|
|
71
81
|
AgentSpawnerConfigSchema,
|
|
82
|
+
DEFAULT_SUB_AGENT_MAX_ITERATIONS,
|
|
83
|
+
DEFAULT_SUB_AGENT_REASONING_VARIANT,
|
|
72
84
|
SpawnAgentInputSchema
|
|
73
85
|
});
|
|
@@ -3,7 +3,10 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Zod schemas for the agent spawner tools factory configuration and inputs.
|
|
5
5
|
*/
|
|
6
|
+
import type { ReasoningVariant } from '@dexto/core';
|
|
6
7
|
import { z } from 'zod';
|
|
8
|
+
export declare const DEFAULT_SUB_AGENT_MAX_ITERATIONS = 100;
|
|
9
|
+
export declare const DEFAULT_SUB_AGENT_REASONING_VARIANT: ReasoningVariant;
|
|
7
10
|
/**
|
|
8
11
|
* Configuration schema for the agent spawner tools factory.
|
|
9
12
|
*/
|
|
@@ -14,6 +17,8 @@ export declare const AgentSpawnerConfigSchema: z.ZodObject<{
|
|
|
14
17
|
maxConcurrentAgents: z.ZodDefault<z.ZodNumber>;
|
|
15
18
|
/** Default timeout for task execution in milliseconds (default: 3600000 = 1 hour) */
|
|
16
19
|
defaultTimeout: z.ZodDefault<z.ZodNumber>;
|
|
20
|
+
subAgentMaxIterations: z.ZodDefault<z.ZodNumber>;
|
|
21
|
+
subAgentReasoningVariant: z.ZodDefault<z.ZodString>;
|
|
17
22
|
/** Whether spawning is enabled (default: true) */
|
|
18
23
|
allowSpawning: z.ZodDefault<z.ZodBoolean>;
|
|
19
24
|
/**
|
|
@@ -45,6 +50,8 @@ export declare const AgentSpawnerConfigSchema: z.ZodObject<{
|
|
|
45
50
|
type: "agent-spawner";
|
|
46
51
|
maxConcurrentAgents: number;
|
|
47
52
|
defaultTimeout: number;
|
|
53
|
+
subAgentMaxIterations: number;
|
|
54
|
+
subAgentReasoningVariant: string;
|
|
48
55
|
allowSpawning: boolean;
|
|
49
56
|
allowedAgents?: string[] | undefined;
|
|
50
57
|
autoApproveAgents?: string[] | undefined;
|
|
@@ -52,6 +59,8 @@ export declare const AgentSpawnerConfigSchema: z.ZodObject<{
|
|
|
52
59
|
type: "agent-spawner";
|
|
53
60
|
maxConcurrentAgents?: number | undefined;
|
|
54
61
|
defaultTimeout?: number | undefined;
|
|
62
|
+
subAgentMaxIterations?: number | undefined;
|
|
63
|
+
subAgentReasoningVariant?: string | undefined;
|
|
55
64
|
allowSpawning?: boolean | undefined;
|
|
56
65
|
allowedAgents?: string[] | undefined;
|
|
57
66
|
autoApproveAgents?: string[] | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../../src/tool-factories/agent-spawner/schemas.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB;;GAEG;AACH,eAAO,MAAM,wBAAwB;IAE7B,yCAAyC;;IAGzC,uEAAuE;;IAQvE,qFAAqF
|
|
1
|
+
{"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../../src/tool-factories/agent-spawner/schemas.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AACpD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB,eAAO,MAAM,gCAAgC,MAAM,CAAC;AACpD,eAAO,MAAM,mCAAmC,EAAE,gBAA6B,CAAC;AAEhF;;GAEG;AACH,eAAO,MAAM,wBAAwB;IAE7B,yCAAyC;;IAGzC,uEAAuE;;IAQvE,qFAAqF;;;;IA4BrF,kDAAkD;;IAGlD;;;;;;;;;;OAUG;;IAMH;;;;;;;;;;;OAWG;;;;;;;;;;;;;;;;;;;;EAOuD,CAAC;AAEnE,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAM3E;;;;;GAKG;AACH,eAAO,MAAM,qBAAqB;IAE1B,gDAAgD;;IAGhD,8CAA8C;;IAM9C,qFAAqF;;;;;;;;;;EAGhF,CAAC;AAEd,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,qBAAqB,CAAC,CAAC"}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
+
const DEFAULT_SUB_AGENT_MAX_ITERATIONS = 100;
|
|
3
|
+
const DEFAULT_SUB_AGENT_REASONING_VARIANT = "disabled";
|
|
2
4
|
const AgentSpawnerConfigSchema = z.object({
|
|
3
5
|
/** Type discriminator for the factory */
|
|
4
6
|
type: z.literal("agent-spawner"),
|
|
@@ -6,6 +8,12 @@ const AgentSpawnerConfigSchema = z.object({
|
|
|
6
8
|
maxConcurrentAgents: z.number().int().positive().default(5).describe("Maximum concurrent sub-agents"),
|
|
7
9
|
/** Default timeout for task execution in milliseconds (default: 3600000 = 1 hour) */
|
|
8
10
|
defaultTimeout: z.number().int().nonnegative().default(36e5).describe("Default task timeout in milliseconds (0 = no timeout)"),
|
|
11
|
+
subAgentMaxIterations: z.number().int().positive().default(DEFAULT_SUB_AGENT_MAX_ITERATIONS).describe(
|
|
12
|
+
"Max outer-loop tool-call iterations for spawned sub-agents. Acts as a safety cap to prevent runaway exploration."
|
|
13
|
+
),
|
|
14
|
+
subAgentReasoningVariant: z.string().trim().min(1).default(DEFAULT_SUB_AGENT_REASONING_VARIANT).describe(
|
|
15
|
+
"Preferred reasoning variant for spawned sub-agents. Default is 'disabled'. If unsupported by the resolved model, Dexto falls back to the lowest available variant."
|
|
16
|
+
),
|
|
9
17
|
/** Whether spawning is enabled (default: true) */
|
|
10
18
|
allowSpawning: z.boolean().default(true).describe("Whether agent spawning is enabled"),
|
|
11
19
|
/**
|
|
@@ -44,5 +52,7 @@ const SpawnAgentInputSchema = z.object({
|
|
|
44
52
|
}).strict();
|
|
45
53
|
export {
|
|
46
54
|
AgentSpawnerConfigSchema,
|
|
55
|
+
DEFAULT_SUB_AGENT_MAX_ITERATIONS,
|
|
56
|
+
DEFAULT_SUB_AGENT_REASONING_VARIANT,
|
|
47
57
|
SpawnAgentInputSchema
|
|
48
58
|
};
|