@dexto/agent-management 1.5.7 → 1.6.0
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.cjs +5 -9
- package/dist/AgentFactory.d.ts +6 -5
- package/dist/AgentFactory.d.ts.map +1 -1
- package/dist/AgentFactory.js +5 -9
- package/dist/AgentManager.cjs +2 -2
- package/dist/AgentManager.d.ts +1 -1
- package/dist/AgentManager.d.ts.map +1 -1
- package/dist/AgentManager.js +4 -4
- package/dist/agent-creation.cjs +95 -0
- package/dist/agent-creation.d.ts +15 -0
- package/dist/agent-creation.d.ts.map +1 -0
- package/dist/agent-creation.js +78 -0
- package/dist/config/config-enrichment.cjs +2 -12
- package/dist/config/config-enrichment.d.ts +1 -1
- package/dist/config/config-enrichment.d.ts.map +1 -1
- package/dist/config/config-enrichment.js +2 -12
- package/dist/config/config-manager.cjs +4 -4
- package/dist/config/config-manager.d.ts +1 -1
- package/dist/config/config-manager.d.ts.map +1 -1
- package/dist/config/config-manager.js +3 -1
- package/dist/config/loader.d.ts +3 -3
- package/dist/config/loader.d.ts.map +1 -1
- package/dist/images/image-store.cjs +256 -0
- package/dist/images/image-store.d.ts +70 -0
- package/dist/images/image-store.d.ts.map +1 -0
- package/dist/images/image-store.js +210 -0
- package/dist/index.cjs +43 -2
- package/dist/index.d.ts +5 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +43 -1
- package/dist/models/custom-models.cjs +1 -1
- package/dist/models/custom-models.d.ts +7 -7
- package/dist/models/custom-models.d.ts.map +1 -1
- package/dist/models/custom-models.js +1 -1
- package/dist/plugins/discover-plugins.cjs +15 -31
- package/dist/plugins/discover-plugins.d.ts.map +1 -1
- package/dist/plugins/discover-plugins.js +15 -31
- package/dist/plugins/discover-skills.cjs +4 -0
- package/dist/plugins/discover-skills.d.ts +6 -3
- package/dist/plugins/discover-skills.d.ts.map +1 -1
- package/dist/plugins/discover-skills.js +4 -0
- package/dist/plugins/index.cjs +0 -2
- package/dist/plugins/index.d.ts +5 -6
- package/dist/plugins/index.d.ts.map +1 -1
- package/dist/plugins/index.js +0 -2
- package/dist/plugins/list-plugins.cjs +3 -1
- package/dist/plugins/list-plugins.d.ts.map +1 -1
- package/dist/plugins/list-plugins.js +3 -1
- package/dist/plugins/load-plugin.cjs +0 -13
- package/dist/plugins/load-plugin.d.ts +3 -5
- package/dist/plugins/load-plugin.d.ts.map +1 -1
- package/dist/plugins/load-plugin.js +0 -13
- package/dist/plugins/schemas.cjs +1 -11
- package/dist/plugins/schemas.d.ts +14 -69
- package/dist/plugins/schemas.d.ts.map +1 -1
- package/dist/plugins/schemas.js +1 -10
- package/dist/plugins/types.d.ts +2 -20
- package/dist/plugins/types.d.ts.map +1 -1
- package/dist/plugins/validate-plugin.cjs +7 -37
- package/dist/plugins/validate-plugin.d.ts +6 -24
- package/dist/plugins/validate-plugin.d.ts.map +1 -1
- package/dist/plugins/validate-plugin.js +8 -38
- package/dist/preferences/errors.cjs +11 -0
- package/dist/preferences/errors.d.ts +1 -0
- package/dist/preferences/errors.d.ts.map +1 -1
- package/dist/preferences/errors.js +11 -0
- package/dist/preferences/loader.cjs +119 -6
- package/dist/preferences/loader.d.ts +21 -1
- package/dist/preferences/loader.d.ts.map +1 -1
- package/dist/preferences/loader.js +102 -1
- package/dist/preferences/schemas.cjs +12 -0
- package/dist/preferences/schemas.d.ts +38 -12
- package/dist/preferences/schemas.d.ts.map +1 -1
- package/dist/preferences/schemas.js +10 -0
- package/dist/registry/registry.d.ts +4 -44
- package/dist/registry/registry.d.ts.map +1 -1
- package/dist/runtime/AgentPool.d.ts +2 -2
- package/dist/runtime/AgentPool.d.ts.map +1 -1
- package/dist/runtime/AgentRuntime.cjs +20 -15
- package/dist/runtime/AgentRuntime.d.ts +2 -2
- package/dist/runtime/AgentRuntime.d.ts.map +1 -1
- package/dist/runtime/AgentRuntime.js +20 -15
- package/dist/runtime/approval-delegation.d.ts +2 -2
- package/dist/runtime/approval-delegation.d.ts.map +1 -1
- package/dist/runtime/schemas.d.ts +1 -1
- package/dist/runtime/types.d.ts +2 -1
- package/dist/runtime/types.d.ts.map +1 -1
- package/dist/{tool-provider → tool-factories/agent-spawner}/error-codes.d.ts +1 -1
- package/dist/tool-factories/agent-spawner/error-codes.d.ts.map +1 -0
- package/dist/{tool-provider → tool-factories/agent-spawner}/errors.d.ts +1 -1
- package/dist/tool-factories/agent-spawner/errors.d.ts.map +1 -0
- package/dist/tool-factories/agent-spawner/factory.cjs +290 -0
- package/dist/tool-factories/agent-spawner/factory.d.ts +4 -0
- package/dist/tool-factories/agent-spawner/factory.d.ts.map +1 -0
- package/dist/tool-factories/agent-spawner/factory.js +279 -0
- package/dist/{tool-provider → tool-factories/agent-spawner}/index.cjs +9 -9
- package/dist/{tool-provider → tool-factories/agent-spawner}/index.d.ts +3 -3
- package/dist/tool-factories/agent-spawner/index.d.ts.map +1 -0
- package/dist/{tool-provider → tool-factories/agent-spawner}/index.js +4 -4
- package/dist/{tool-provider → tool-factories/agent-spawner}/llm-resolution.cjs +1 -1
- package/dist/{tool-provider → tool-factories/agent-spawner}/llm-resolution.d.ts +4 -4
- package/dist/tool-factories/agent-spawner/llm-resolution.d.ts.map +1 -0
- package/dist/{tool-provider → tool-factories/agent-spawner}/llm-resolution.js +1 -1
- package/dist/{tool-provider/runtime-service.cjs → tool-factories/agent-spawner/runtime.cjs} +112 -73
- package/dist/{tool-provider/runtime-service.d.ts → tool-factories/agent-spawner/runtime.d.ts} +8 -6
- package/dist/tool-factories/agent-spawner/runtime.d.ts.map +1 -0
- package/dist/{tool-provider/runtime-service.js → tool-factories/agent-spawner/runtime.js} +98 -69
- package/dist/{tool-provider → tool-factories/agent-spawner}/schemas.cjs +2 -2
- package/dist/{tool-provider → tool-factories/agent-spawner}/schemas.d.ts +4 -4
- package/dist/tool-factories/agent-spawner/schemas.d.ts.map +1 -0
- package/dist/{tool-provider → tool-factories/agent-spawner}/schemas.js +2 -2
- package/dist/{tool-provider → tool-factories/agent-spawner}/spawn-agent-tool.cjs +8 -7
- package/dist/tool-factories/agent-spawner/spawn-agent-tool.d.ts +11 -0
- package/dist/tool-factories/agent-spawner/spawn-agent-tool.d.ts.map +1 -0
- package/dist/{tool-provider → tool-factories/agent-spawner}/spawn-agent-tool.js +8 -7
- package/dist/tool-factories/agent-spawner/types.d.ts.map +1 -0
- package/dist/utils/api-key-resolver.cjs +1 -1
- package/dist/utils/api-key-resolver.js +1 -1
- package/dist/utils/feature-flags.cjs +3 -1
- package/dist/utils/feature-flags.d.ts +2 -2
- package/dist/utils/feature-flags.d.ts.map +1 -1
- package/dist/utils/feature-flags.js +3 -1
- package/dist/writer.d.ts +2 -1
- package/dist/writer.d.ts.map +1 -1
- package/package.json +6 -3
- package/dist/tool-provider/error-codes.d.ts.map +0 -1
- package/dist/tool-provider/errors.d.ts.map +0 -1
- package/dist/tool-provider/index.d.ts.map +0 -1
- package/dist/tool-provider/llm-resolution.d.ts.map +0 -1
- package/dist/tool-provider/runtime-service.d.ts.map +0 -1
- package/dist/tool-provider/schemas.d.ts.map +0 -1
- package/dist/tool-provider/spawn-agent-tool.d.ts +0 -10
- package/dist/tool-provider/spawn-agent-tool.d.ts.map +0 -1
- package/dist/tool-provider/tool-provider.cjs +0 -46
- package/dist/tool-provider/tool-provider.d.ts +0 -24
- package/dist/tool-provider/tool-provider.d.ts.map +0 -1
- package/dist/tool-provider/tool-provider.js +0 -22
- package/dist/tool-provider/types.d.ts.map +0 -1
- /package/dist/{tool-provider → tool-factories/agent-spawner}/error-codes.cjs +0 -0
- /package/dist/{tool-provider → tool-factories/agent-spawner}/error-codes.js +0 -0
- /package/dist/{tool-provider → tool-factories/agent-spawner}/errors.cjs +0 -0
- /package/dist/{tool-provider → tool-factories/agent-spawner}/errors.js +0 -0
- /package/dist/{tool-provider → tool-factories/agent-spawner}/types.cjs +0 -0
- /package/dist/{tool-provider → tool-factories/agent-spawner}/types.d.ts +0 -0
- /package/dist/{tool-provider → tool-factories/agent-spawner}/types.js +0 -0
|
@@ -18,6 +18,8 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
19
|
var schemas_exports = {};
|
|
20
20
|
__export(schemas_exports, {
|
|
21
|
+
AgentPreferencesSchema: () => AgentPreferencesSchema,
|
|
22
|
+
AgentToolPreferencesSchema: () => AgentToolPreferencesSchema,
|
|
21
23
|
GlobalPreferencesSchema: () => GlobalPreferencesSchema,
|
|
22
24
|
PreferenceDefaultsSchema: () => PreferenceDefaultsSchema,
|
|
23
25
|
PreferenceLLMSchema: () => PreferenceLLMSchema,
|
|
@@ -88,6 +90,14 @@ const PreferenceSoundsSchema = import_zod.z.object({
|
|
|
88
90
|
),
|
|
89
91
|
onTaskComplete: import_zod.z.boolean().default(true).describe("Play sound when agent task completes (default: true when sounds enabled)")
|
|
90
92
|
}).strict();
|
|
93
|
+
const AgentToolPreferencesSchema = import_zod.z.object({
|
|
94
|
+
disabled: import_zod.z.array(import_core3.NonEmptyTrimmed).default([]).describe("Tool names disabled for this agent (default: none)")
|
|
95
|
+
}).strict();
|
|
96
|
+
const AgentPreferencesSchema = import_zod.z.object({
|
|
97
|
+
tools: AgentToolPreferencesSchema.default({ disabled: [] }).describe(
|
|
98
|
+
"Tool availability preferences"
|
|
99
|
+
)
|
|
100
|
+
}).strict();
|
|
91
101
|
const GlobalPreferencesSchema = import_zod.z.object({
|
|
92
102
|
llm: PreferenceLLMSchema.describe("LLM configuration preferences"),
|
|
93
103
|
defaults: PreferenceDefaultsSchema.describe("Default behavior preferences (required)"),
|
|
@@ -100,6 +110,8 @@ const GlobalPreferencesSchema = import_zod.z.object({
|
|
|
100
110
|
}).strict();
|
|
101
111
|
// Annotate the CommonJS export names for ESM import in node:
|
|
102
112
|
0 && (module.exports = {
|
|
113
|
+
AgentPreferencesSchema,
|
|
114
|
+
AgentToolPreferencesSchema,
|
|
103
115
|
GlobalPreferencesSchema,
|
|
104
116
|
PreferenceDefaultsSchema,
|
|
105
117
|
PreferenceLLMSchema,
|
|
@@ -1,30 +1,30 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
export declare const PreferenceLLMSchema: z.ZodEffects<z.ZodObject<{
|
|
3
|
-
provider: z.ZodEnum<["openai", "openai-compatible", "anthropic", "google", "groq", "xai", "cohere", "minimax", "glm", "openrouter", "litellm", "glama", "vertex", "bedrock", "local", "ollama", "dexto"]>;
|
|
3
|
+
provider: z.ZodEnum<["openai", "openai-compatible", "anthropic", "google", "groq", "xai", "cohere", "minimax", "glm", "openrouter", "litellm", "glama", "vertex", "bedrock", "local", "ollama", "dexto-nova"]>;
|
|
4
4
|
model: z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
|
|
5
5
|
apiKey: z.ZodOptional<z.ZodString>;
|
|
6
6
|
baseURL: z.ZodOptional<z.ZodString>;
|
|
7
7
|
reasoningEffort: z.ZodOptional<z.ZodEnum<["none", "minimal", "low", "medium", "high", "xhigh"]>>;
|
|
8
8
|
}, "strict", z.ZodTypeAny, {
|
|
9
|
-
provider: "
|
|
9
|
+
provider: "openai" | "openai-compatible" | "anthropic" | "google" | "groq" | "xai" | "cohere" | "minimax" | "glm" | "openrouter" | "litellm" | "glama" | "vertex" | "bedrock" | "local" | "ollama" | "dexto-nova";
|
|
10
10
|
model: string;
|
|
11
11
|
apiKey?: string | undefined;
|
|
12
12
|
baseURL?: string | undefined;
|
|
13
13
|
reasoningEffort?: "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | undefined;
|
|
14
14
|
}, {
|
|
15
|
-
provider: "
|
|
15
|
+
provider: "openai" | "openai-compatible" | "anthropic" | "google" | "groq" | "xai" | "cohere" | "minimax" | "glm" | "openrouter" | "litellm" | "glama" | "vertex" | "bedrock" | "local" | "ollama" | "dexto-nova";
|
|
16
16
|
model: string;
|
|
17
17
|
apiKey?: string | undefined;
|
|
18
18
|
baseURL?: string | undefined;
|
|
19
19
|
reasoningEffort?: "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | undefined;
|
|
20
20
|
}>, {
|
|
21
|
-
provider: "
|
|
21
|
+
provider: "openai" | "openai-compatible" | "anthropic" | "google" | "groq" | "xai" | "cohere" | "minimax" | "glm" | "openrouter" | "litellm" | "glama" | "vertex" | "bedrock" | "local" | "ollama" | "dexto-nova";
|
|
22
22
|
model: string;
|
|
23
23
|
apiKey?: string | undefined;
|
|
24
24
|
baseURL?: string | undefined;
|
|
25
25
|
reasoningEffort?: "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | undefined;
|
|
26
26
|
}, {
|
|
27
|
-
provider: "
|
|
27
|
+
provider: "openai" | "openai-compatible" | "anthropic" | "google" | "groq" | "xai" | "cohere" | "minimax" | "glm" | "openrouter" | "litellm" | "glama" | "vertex" | "bedrock" | "local" | "ollama" | "dexto-nova";
|
|
28
28
|
model: string;
|
|
29
29
|
apiKey?: string | undefined;
|
|
30
30
|
baseURL?: string | undefined;
|
|
@@ -66,33 +66,57 @@ export declare const PreferenceSoundsSchema: z.ZodObject<{
|
|
|
66
66
|
onApprovalRequired?: boolean | undefined;
|
|
67
67
|
onTaskComplete?: boolean | undefined;
|
|
68
68
|
}>;
|
|
69
|
+
export declare const AgentToolPreferencesSchema: z.ZodObject<{
|
|
70
|
+
disabled: z.ZodDefault<z.ZodArray<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>, "many">>;
|
|
71
|
+
}, "strict", z.ZodTypeAny, {
|
|
72
|
+
disabled: string[];
|
|
73
|
+
}, {
|
|
74
|
+
disabled?: string[] | undefined;
|
|
75
|
+
}>;
|
|
76
|
+
export declare const AgentPreferencesSchema: z.ZodObject<{
|
|
77
|
+
tools: z.ZodDefault<z.ZodObject<{
|
|
78
|
+
disabled: z.ZodDefault<z.ZodArray<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>, "many">>;
|
|
79
|
+
}, "strict", z.ZodTypeAny, {
|
|
80
|
+
disabled: string[];
|
|
81
|
+
}, {
|
|
82
|
+
disabled?: string[] | undefined;
|
|
83
|
+
}>>;
|
|
84
|
+
}, "strict", z.ZodTypeAny, {
|
|
85
|
+
tools: {
|
|
86
|
+
disabled: string[];
|
|
87
|
+
};
|
|
88
|
+
}, {
|
|
89
|
+
tools?: {
|
|
90
|
+
disabled?: string[] | undefined;
|
|
91
|
+
} | undefined;
|
|
92
|
+
}>;
|
|
69
93
|
export declare const GlobalPreferencesSchema: z.ZodObject<{
|
|
70
94
|
llm: z.ZodEffects<z.ZodObject<{
|
|
71
|
-
provider: z.ZodEnum<["openai", "openai-compatible", "anthropic", "google", "groq", "xai", "cohere", "minimax", "glm", "openrouter", "litellm", "glama", "vertex", "bedrock", "local", "ollama", "dexto"]>;
|
|
95
|
+
provider: z.ZodEnum<["openai", "openai-compatible", "anthropic", "google", "groq", "xai", "cohere", "minimax", "glm", "openrouter", "litellm", "glama", "vertex", "bedrock", "local", "ollama", "dexto-nova"]>;
|
|
72
96
|
model: z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
|
|
73
97
|
apiKey: z.ZodOptional<z.ZodString>;
|
|
74
98
|
baseURL: z.ZodOptional<z.ZodString>;
|
|
75
99
|
reasoningEffort: z.ZodOptional<z.ZodEnum<["none", "minimal", "low", "medium", "high", "xhigh"]>>;
|
|
76
100
|
}, "strict", z.ZodTypeAny, {
|
|
77
|
-
provider: "
|
|
101
|
+
provider: "openai" | "openai-compatible" | "anthropic" | "google" | "groq" | "xai" | "cohere" | "minimax" | "glm" | "openrouter" | "litellm" | "glama" | "vertex" | "bedrock" | "local" | "ollama" | "dexto-nova";
|
|
78
102
|
model: string;
|
|
79
103
|
apiKey?: string | undefined;
|
|
80
104
|
baseURL?: string | undefined;
|
|
81
105
|
reasoningEffort?: "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | undefined;
|
|
82
106
|
}, {
|
|
83
|
-
provider: "
|
|
107
|
+
provider: "openai" | "openai-compatible" | "anthropic" | "google" | "groq" | "xai" | "cohere" | "minimax" | "glm" | "openrouter" | "litellm" | "glama" | "vertex" | "bedrock" | "local" | "ollama" | "dexto-nova";
|
|
84
108
|
model: string;
|
|
85
109
|
apiKey?: string | undefined;
|
|
86
110
|
baseURL?: string | undefined;
|
|
87
111
|
reasoningEffort?: "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | undefined;
|
|
88
112
|
}>, {
|
|
89
|
-
provider: "
|
|
113
|
+
provider: "openai" | "openai-compatible" | "anthropic" | "google" | "groq" | "xai" | "cohere" | "minimax" | "glm" | "openrouter" | "litellm" | "glama" | "vertex" | "bedrock" | "local" | "ollama" | "dexto-nova";
|
|
90
114
|
model: string;
|
|
91
115
|
apiKey?: string | undefined;
|
|
92
116
|
baseURL?: string | undefined;
|
|
93
117
|
reasoningEffort?: "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | undefined;
|
|
94
118
|
}, {
|
|
95
|
-
provider: "
|
|
119
|
+
provider: "openai" | "openai-compatible" | "anthropic" | "google" | "groq" | "xai" | "cohere" | "minimax" | "glm" | "openrouter" | "litellm" | "glama" | "vertex" | "bedrock" | "local" | "ollama" | "dexto-nova";
|
|
96
120
|
model: string;
|
|
97
121
|
apiKey?: string | undefined;
|
|
98
122
|
baseURL?: string | undefined;
|
|
@@ -136,7 +160,7 @@ export declare const GlobalPreferencesSchema: z.ZodObject<{
|
|
|
136
160
|
}>>;
|
|
137
161
|
}, "strict", z.ZodTypeAny, {
|
|
138
162
|
llm: {
|
|
139
|
-
provider: "
|
|
163
|
+
provider: "openai" | "openai-compatible" | "anthropic" | "google" | "groq" | "xai" | "cohere" | "minimax" | "glm" | "openrouter" | "litellm" | "glama" | "vertex" | "bedrock" | "local" | "ollama" | "dexto-nova";
|
|
140
164
|
model: string;
|
|
141
165
|
apiKey?: string | undefined;
|
|
142
166
|
baseURL?: string | undefined;
|
|
@@ -158,7 +182,7 @@ export declare const GlobalPreferencesSchema: z.ZodObject<{
|
|
|
158
182
|
};
|
|
159
183
|
}, {
|
|
160
184
|
llm: {
|
|
161
|
-
provider: "
|
|
185
|
+
provider: "openai" | "openai-compatible" | "anthropic" | "google" | "groq" | "xai" | "cohere" | "minimax" | "glm" | "openrouter" | "litellm" | "glama" | "vertex" | "bedrock" | "local" | "ollama" | "dexto-nova";
|
|
162
186
|
model: string;
|
|
163
187
|
apiKey?: string | undefined;
|
|
164
188
|
baseURL?: string | undefined;
|
|
@@ -183,5 +207,7 @@ export type PreferenceLLM = z.output<typeof PreferenceLLMSchema>;
|
|
|
183
207
|
export type PreferenceDefaults = z.output<typeof PreferenceDefaultsSchema>;
|
|
184
208
|
export type PreferenceSetup = z.output<typeof PreferenceSetupSchema>;
|
|
185
209
|
export type PreferenceSounds = z.output<typeof PreferenceSoundsSchema>;
|
|
210
|
+
export type AgentToolPreferences = z.output<typeof AgentToolPreferencesSchema>;
|
|
211
|
+
export type AgentPreferences = z.output<typeof AgentPreferencesSchema>;
|
|
186
212
|
export type GlobalPreferences = z.output<typeof GlobalPreferencesSchema>;
|
|
187
213
|
//# sourceMappingURL=schemas.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../src/preferences/schemas.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAaxB,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAsE1B,CAAC;AAEP,eAAO,MAAM,wBAAwB;;;;;;;;;EAYxB,CAAC;AAEd,eAAO,MAAM,qBAAqB;;;;;;;;;;;;EAYrB,CAAC;AAEd,eAAO,MAAM,sBAAsB;;;;;;;;;;;;EActB,CAAC;AAEd,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAcvB,CAAC;AAGd,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,mBAAmB,CAAC,CAAC;AACjE,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAC3E,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,qBAAqB,CAAC,CAAC;AACrE,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,sBAAsB,CAAC,CAAC;AACvE,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,uBAAuB,CAAC,CAAC"}
|
|
1
|
+
{"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../src/preferences/schemas.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAaxB,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAsE1B,CAAC;AAEP,eAAO,MAAM,wBAAwB;;;;;;;;;EAYxB,CAAC;AAEd,eAAO,MAAM,qBAAqB;;;;;;;;;;;;EAYrB,CAAC;AAEd,eAAO,MAAM,sBAAsB;;;;;;;;;;;;EActB,CAAC;AAEd,eAAO,MAAM,0BAA0B;;;;;;EAO1B,CAAC;AAEd,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;EAMtB,CAAC;AAEd,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAcvB,CAAC;AAGd,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,mBAAmB,CAAC,CAAC;AACjE,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAC3E,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,qBAAqB,CAAC,CAAC;AACrE,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,sBAAsB,CAAC,CAAC;AACvE,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAC/E,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,sBAAsB,CAAC,CAAC;AACvE,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,uBAAuB,CAAC,CAAC"}
|
|
@@ -67,6 +67,14 @@ const PreferenceSoundsSchema = z.object({
|
|
|
67
67
|
),
|
|
68
68
|
onTaskComplete: z.boolean().default(true).describe("Play sound when agent task completes (default: true when sounds enabled)")
|
|
69
69
|
}).strict();
|
|
70
|
+
const AgentToolPreferencesSchema = z.object({
|
|
71
|
+
disabled: z.array(NonEmptyTrimmed).default([]).describe("Tool names disabled for this agent (default: none)")
|
|
72
|
+
}).strict();
|
|
73
|
+
const AgentPreferencesSchema = z.object({
|
|
74
|
+
tools: AgentToolPreferencesSchema.default({ disabled: [] }).describe(
|
|
75
|
+
"Tool availability preferences"
|
|
76
|
+
)
|
|
77
|
+
}).strict();
|
|
70
78
|
const GlobalPreferencesSchema = z.object({
|
|
71
79
|
llm: PreferenceLLMSchema.describe("LLM configuration preferences"),
|
|
72
80
|
defaults: PreferenceDefaultsSchema.describe("Default behavior preferences (required)"),
|
|
@@ -78,6 +86,8 @@ const GlobalPreferencesSchema = z.object({
|
|
|
78
86
|
)
|
|
79
87
|
}).strict();
|
|
80
88
|
export {
|
|
89
|
+
AgentPreferencesSchema,
|
|
90
|
+
AgentToolPreferencesSchema,
|
|
81
91
|
GlobalPreferencesSchema,
|
|
82
92
|
PreferenceDefaultsSchema,
|
|
83
93
|
PreferenceLLMSchema,
|
|
@@ -1,51 +1,11 @@
|
|
|
1
1
|
import { Registry, AgentRegistry, AgentRegistryEntry } from './types.js';
|
|
2
2
|
/**
|
|
3
3
|
* Local agent registry implementation
|
|
4
|
+
* Loads and merges the bundled registry (shipped with the CLI bundle) with the user's custom
|
|
5
|
+
* registry under `~/.dexto`.
|
|
4
6
|
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
* PROBLEM: Registry operations are CLI concerns but live in Core, causing:
|
|
8
|
-
* - Missing analytics for auto-install (when running `dexto`, registry installs agents but doesn't track)
|
|
9
|
-
* - Wrong separation of concerns (Core = execution engine, not discovery/setup)
|
|
10
|
-
* - Registry manages ~/.dexto/agents filesystem which is CLI-level setup
|
|
11
|
-
*
|
|
12
|
-
* THE RIGHT ARCHITECTURE:
|
|
13
|
-
*
|
|
14
|
-
* Move to CLI:
|
|
15
|
-
* 1. Agent Registry (packages/core/src/agent/registry/) → packages/cli/src/registry/
|
|
16
|
-
* - installAgent(), uninstallAgent(), resolveAgent(), listAgents()
|
|
17
|
-
* - Can directly call capture() for analytics
|
|
18
|
-
* - Manages ~/.dexto/agents installation directory
|
|
19
|
-
*
|
|
20
|
-
* 2. Global Preferences (packages/core/src/preferences/) → packages/cli/src/preferences/
|
|
21
|
-
* - User's default LLM, model, default agent
|
|
22
|
-
* - Used by `dexto setup` command
|
|
23
|
-
* - Manages ~/.dexto/preferences.json
|
|
24
|
-
*
|
|
25
|
-
* 3. Agent Resolution (packages/core/src/config/agent-resolver.ts) → packages/cli/src/agent-resolver.ts
|
|
26
|
-
* - Discovery logic: check registry, trigger installs, apply preferences
|
|
27
|
-
* - Returns resolved config PATH to core
|
|
28
|
-
*
|
|
29
|
-
* Core keeps:
|
|
30
|
-
* - config/loader.ts - Load YAML from path
|
|
31
|
-
* - config/schemas.ts - Zod validation
|
|
32
|
-
* - Agent execution (DextoAgent, LLM, tools, MCP)
|
|
33
|
-
*
|
|
34
|
-
* FLOW AFTER REFACTOR:
|
|
35
|
-
* CLI index.ts:
|
|
36
|
-
* → CLI: resolveAgentPath() (discovery logic)
|
|
37
|
-
* → CLI: registry.resolveAgent()
|
|
38
|
-
* → CLI: registry.installAgent() if needed
|
|
39
|
-
* → CLI: capture('dexto_install_agent', ...) ✓ Natural!
|
|
40
|
-
* → Core: new DextoAgent(configPath) (just loads & runs)
|
|
41
|
-
*
|
|
42
|
-
* BENEFITS:
|
|
43
|
-
* - Clear separation: CLI = setup/discovery, Core = execution
|
|
44
|
-
* - Analytics naturally colocated with operations
|
|
45
|
-
* - Core is portable (no CLI dependencies)
|
|
46
|
-
* - No circular deps (CLI → Core, correct direction)
|
|
47
|
-
*
|
|
48
|
-
* ESTIMATE: ~3-4 hours (mostly moving code + updating imports)
|
|
7
|
+
* Hosts (CLI, server, apps) use this to resolve an agent ID to a concrete YAML path, then
|
|
8
|
+
* load/validate that YAML and instantiate a `DextoAgent` from the resolved config.
|
|
49
9
|
*/
|
|
50
10
|
export declare class LocalAgentRegistry implements AgentRegistry {
|
|
51
11
|
private _registry;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../src/registry/registry.ts"],"names":[],"mappings":"AAKA,OAAO,EACH,QAAQ,EAER,aAAa,EACb,kBAAkB,EAErB,MAAM,YAAY,CAAC;AAapB
|
|
1
|
+
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../src/registry/registry.ts"],"names":[],"mappings":"AAKA,OAAO,EACH,QAAQ,EAER,aAAa,EACb,kBAAkB,EAErB,MAAM,YAAY,CAAC;AAapB;;;;;;;GAOG;AACH,qBAAa,kBAAmB,YAAW,aAAa;IACpD,OAAO,CAAC,SAAS,CAAyB;IAE1C;;OAEG;IACH,WAAW,IAAI,QAAQ;IAOvB;;;OAGG;IACH,OAAO,CAAC,YAAY;IAyCpB;;OAEG;IACH,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO;IAKlC;;OAEG;IACH,kBAAkB,IAAI,MAAM,CAAC,MAAM,EAAE,kBAAkB,CAAC;IAKxD;;;OAGG;IACH,OAAO,CAAC,qBAAqB;IAgC7B;;;OAGG;IACH,iBAAiB,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM;IA0C5D;;;OAGG;IACG,YAAY,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAgFpD;;;;;;OAMG;IACG,0BAA0B,CAC5B,OAAO,EAAE,MAAM,EACf,UAAU,EAAE,MAAM,EAClB,QAAQ,EAAE;QACN,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,WAAW,EAAE,MAAM,CAAC;QACpB,MAAM,EAAE,MAAM,CAAC;QACf,IAAI,EAAE,MAAM,EAAE,CAAC;QACf,IAAI,CAAC,EAAE,MAAM,CAAC;KACjB,GACF,OAAO,CAAC,MAAM,CAAC;IAqJlB;;;;;;OAMG;IACG,YAAY,CAAC,OAAO,EAAE,MAAM,EAAE,WAAW,GAAE,OAAc,GAAG,OAAO,CAAC,MAAM,CAAC;IAsCjF;;OAEG;IACG,kBAAkB,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;IAsB7C;;OAEG;YACW,sBAAsB;IAYpC;;;;;;OAMG;IACG,cAAc,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,GAAE,OAAe,GAAG,OAAO,CAAC,IAAI,CAAC;CA8C/E;AAED;;GAEG;AACH,wBAAgB,gBAAgB,IAAI,kBAAkB,CAKrD;AAED;;;GAGG;AACH,wBAAgB,yBAAyB,IAAI,MAAM,CAAC,MAAM,EAAE,kBAAkB,CAAC,CAY9E"}
|
|
@@ -4,14 +4,14 @@
|
|
|
4
4
|
* Tracks active agents, enforces resource limits, and provides
|
|
5
5
|
* lookup and lifecycle management capabilities.
|
|
6
6
|
*/
|
|
7
|
-
import type {
|
|
7
|
+
import type { Logger } from '@dexto/core';
|
|
8
8
|
import type { AgentHandle, AgentStatus, AgentFilter } from './types.js';
|
|
9
9
|
import { type ValidatedAgentRuntimeConfig } from './schemas.js';
|
|
10
10
|
export declare class AgentPool {
|
|
11
11
|
private agents;
|
|
12
12
|
private config;
|
|
13
13
|
private logger;
|
|
14
|
-
constructor(config: Partial<ValidatedAgentRuntimeConfig>, logger:
|
|
14
|
+
constructor(config: Partial<ValidatedAgentRuntimeConfig>, logger: Logger);
|
|
15
15
|
/**
|
|
16
16
|
* Add an agent handle to the pool
|
|
17
17
|
* @throws RuntimeError if agent with same ID already exists or limit exceeded
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AgentPool.d.ts","sourceRoot":"","sources":["../../src/runtime/AgentPool.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"AgentPool.d.ts","sourceRoot":"","sources":["../../src/runtime/AgentPool.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AACxE,OAAO,EAGH,KAAK,2BAA2B,EACnC,MAAM,cAAc,CAAC;AAGtB,qBAAa,SAAS;IAClB,OAAO,CAAC,MAAM,CAAuC;IACrD,OAAO,CAAC,MAAM,CAA8B;IAC5C,OAAO,CAAC,MAAM,CAAS;gBAEX,MAAM,EAAE,OAAO,CAAC,2BAA2B,CAAC,EAAE,MAAM,EAAE,MAAM;IAQxE;;;OAGG;IACH,GAAG,CAAC,MAAM,EAAE,WAAW,GAAG,IAAI;IAe9B;;;OAGG;IACH,MAAM,CAAC,OAAO,EAAE,MAAM,GAAG,WAAW,GAAG,SAAS;IAShD;;OAEG;IACH,GAAG,CAAC,OAAO,EAAE,MAAM,GAAG,WAAW,GAAG,SAAS;IAI7C;;OAEG;IACH,QAAQ,IAAI,OAAO;IAInB;;OAEG;IACH,IAAI,CAAC,MAAM,CAAC,EAAE,WAAW,GAAG,WAAW,EAAE;IAczC;;OAEG;IACH,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,WAAW,EAAE;IAIxC;;OAEG;IACH,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM;IAIpC;;;OAGG;IACH,YAAY,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI;IAmBxE;;OAEG;IACH,GAAG,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO;IAI7B;;OAEG;IACH,MAAM,IAAI,WAAW,EAAE;IAIvB;;OAEG;IACH,IAAI,IAAI,IAAI,MAAM,CAEjB;IAED;;OAEG;IACH,SAAS,IAAI,2BAA2B;IAIxC;;;OAGG;IACH,KAAK,IAAI,IAAI;IAQb;;OAEG;IACH,OAAO,CAAC,aAAa;CAqBxB"}
|
|
@@ -22,11 +22,10 @@ __export(AgentRuntime_exports, {
|
|
|
22
22
|
});
|
|
23
23
|
module.exports = __toCommonJS(AgentRuntime_exports);
|
|
24
24
|
var import_crypto = require("crypto");
|
|
25
|
-
var import_core = require("@dexto/core");
|
|
26
|
-
var import_config = require("../config/index.js");
|
|
27
25
|
var import_AgentPool = require("./AgentPool.js");
|
|
28
26
|
var import_errors = require("./errors.js");
|
|
29
27
|
var import_schemas = require("./schemas.js");
|
|
28
|
+
var import_agent_creation = require("../agent-creation.js");
|
|
30
29
|
class AgentRuntime {
|
|
31
30
|
pool;
|
|
32
31
|
config;
|
|
@@ -55,14 +54,12 @@ class AgentRuntime {
|
|
|
55
54
|
throw import_errors.RuntimeError.agentAlreadyExists(agentId);
|
|
56
55
|
}
|
|
57
56
|
try {
|
|
58
|
-
const
|
|
59
|
-
config.agentConfig,
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
);
|
|
64
|
-
enrichedConfig.agentId = agentId;
|
|
65
|
-
const agent = new import_core.DextoAgent(enrichedConfig);
|
|
57
|
+
const agent = await (0, import_agent_creation.createDextoAgentFromConfig)({
|
|
58
|
+
config: config.agentConfig,
|
|
59
|
+
enrichOptions: { isInteractiveCli: false, skipPluginDiscovery: true },
|
|
60
|
+
agentIdOverride: agentId,
|
|
61
|
+
agentContext: "subagent"
|
|
62
|
+
});
|
|
66
63
|
const sessionId = `session-${(0, import_crypto.randomUUID)().slice(0, 8)}`;
|
|
67
64
|
const handle = {
|
|
68
65
|
agentId,
|
|
@@ -113,16 +110,24 @@ class AgentRuntime {
|
|
|
113
110
|
const taskTimeout = timeout ?? this.config.defaultTaskTimeout;
|
|
114
111
|
this.pool.updateStatus(agentId, "running");
|
|
115
112
|
try {
|
|
113
|
+
let timeoutId;
|
|
116
114
|
const timeoutPromise = new Promise((_, reject) => {
|
|
117
|
-
setTimeout(() => {
|
|
115
|
+
timeoutId = setTimeout(() => {
|
|
118
116
|
reject(import_errors.RuntimeError.taskTimeout(agentId, taskTimeout));
|
|
119
117
|
}, taskTimeout);
|
|
120
118
|
});
|
|
121
119
|
const generatePromise = handle.agent.generate(task, handle.sessionId);
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
120
|
+
let response;
|
|
121
|
+
try {
|
|
122
|
+
response = await Promise.race([
|
|
123
|
+
generatePromise,
|
|
124
|
+
timeoutPromise
|
|
125
|
+
]);
|
|
126
|
+
} finally {
|
|
127
|
+
if (timeoutId) {
|
|
128
|
+
clearTimeout(timeoutId);
|
|
129
|
+
}
|
|
130
|
+
}
|
|
126
131
|
this.pool.updateStatus(agentId, "idle");
|
|
127
132
|
const result = {
|
|
128
133
|
success: true,
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
* - Track agent status and lifecycle
|
|
14
14
|
* - Clean up agents when no longer needed
|
|
15
15
|
*/
|
|
16
|
-
import {
|
|
16
|
+
import type { Logger } from '@dexto/core';
|
|
17
17
|
import type { AgentRuntimeConfig, SpawnConfig, AgentHandle, TaskResult, AgentFilter } from './types.js';
|
|
18
18
|
import { type ValidatedAgentRuntimeConfig } from './schemas.js';
|
|
19
19
|
/**
|
|
@@ -23,7 +23,7 @@ export interface AgentRuntimeOptions {
|
|
|
23
23
|
/** Runtime configuration */
|
|
24
24
|
config?: AgentRuntimeConfig;
|
|
25
25
|
/** Logger instance */
|
|
26
|
-
logger:
|
|
26
|
+
logger: Logger;
|
|
27
27
|
}
|
|
28
28
|
export declare class AgentRuntime {
|
|
29
29
|
private pool;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AgentRuntime.d.ts","sourceRoot":"","sources":["../../src/runtime/AgentRuntime.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAGH,OAAO,
|
|
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;AAG5D,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;CAClB;AAED,qBAAa,YAAY;IACrB,OAAO,CAAC,IAAI,CAAY;IACxB,OAAO,CAAC,MAAM,CAA8B;IAC5C,OAAO,CAAC,MAAM,CAAS;gBAEX,OAAO,EAAE,mBAAmB;IAYxC;;;;;OAKG;IACG,UAAU,CAAC,MAAM,EAAE,WAAW,GAAG,OAAO,CAAC,WAAW,CAAC;IAoE3D;;;;;;;OAOG;IACG,WAAW,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC;IA4EvF;;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"}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { randomUUID } from "crypto";
|
|
2
|
-
import { DextoAgent } from "@dexto/core";
|
|
3
|
-
import { enrichAgentConfig } from "../config/index.js";
|
|
4
2
|
import { AgentPool } from "./AgentPool.js";
|
|
5
3
|
import { RuntimeError } from "./errors.js";
|
|
6
4
|
import { AgentRuntimeConfigSchema } from "./schemas.js";
|
|
5
|
+
import { createDextoAgentFromConfig } from "../agent-creation.js";
|
|
7
6
|
class AgentRuntime {
|
|
8
7
|
pool;
|
|
9
8
|
config;
|
|
@@ -32,14 +31,12 @@ class AgentRuntime {
|
|
|
32
31
|
throw RuntimeError.agentAlreadyExists(agentId);
|
|
33
32
|
}
|
|
34
33
|
try {
|
|
35
|
-
const
|
|
36
|
-
config.agentConfig,
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
);
|
|
41
|
-
enrichedConfig.agentId = agentId;
|
|
42
|
-
const agent = new DextoAgent(enrichedConfig);
|
|
34
|
+
const agent = await createDextoAgentFromConfig({
|
|
35
|
+
config: config.agentConfig,
|
|
36
|
+
enrichOptions: { isInteractiveCli: false, skipPluginDiscovery: true },
|
|
37
|
+
agentIdOverride: agentId,
|
|
38
|
+
agentContext: "subagent"
|
|
39
|
+
});
|
|
43
40
|
const sessionId = `session-${randomUUID().slice(0, 8)}`;
|
|
44
41
|
const handle = {
|
|
45
42
|
agentId,
|
|
@@ -90,16 +87,24 @@ class AgentRuntime {
|
|
|
90
87
|
const taskTimeout = timeout ?? this.config.defaultTaskTimeout;
|
|
91
88
|
this.pool.updateStatus(agentId, "running");
|
|
92
89
|
try {
|
|
90
|
+
let timeoutId;
|
|
93
91
|
const timeoutPromise = new Promise((_, reject) => {
|
|
94
|
-
setTimeout(() => {
|
|
92
|
+
timeoutId = setTimeout(() => {
|
|
95
93
|
reject(RuntimeError.taskTimeout(agentId, taskTimeout));
|
|
96
94
|
}, taskTimeout);
|
|
97
95
|
});
|
|
98
96
|
const generatePromise = handle.agent.generate(task, handle.sessionId);
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
97
|
+
let response;
|
|
98
|
+
try {
|
|
99
|
+
response = await Promise.race([
|
|
100
|
+
generatePromise,
|
|
101
|
+
timeoutPromise
|
|
102
|
+
]);
|
|
103
|
+
} finally {
|
|
104
|
+
if (timeoutId) {
|
|
105
|
+
clearTimeout(timeoutId);
|
|
106
|
+
}
|
|
107
|
+
}
|
|
103
108
|
this.pool.updateStatus(agentId, "idle");
|
|
104
109
|
const result = {
|
|
105
110
|
success: true,
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Creates ApprovalHandler instances that delegate approval requests
|
|
5
5
|
* from sub-agents to the parent agent's approval system.
|
|
6
6
|
*/
|
|
7
|
-
import type { ApprovalHandler, ApprovalManager,
|
|
7
|
+
import type { ApprovalHandler, ApprovalManager, Logger } from '@dexto/core';
|
|
8
8
|
/**
|
|
9
9
|
* Creates an ApprovalHandler that delegates requests to a parent's ApprovalManager.
|
|
10
10
|
*
|
|
@@ -26,5 +26,5 @@ import type { ApprovalHandler, ApprovalManager, IDextoLogger } from '@dexto/core
|
|
|
26
26
|
* subAgent.services.approvalManager.setHandler(delegatingHandler);
|
|
27
27
|
* ```
|
|
28
28
|
*/
|
|
29
|
-
export declare function createDelegatingApprovalHandler(parentApprovalManager: ApprovalManager, subAgentId: string, logger:
|
|
29
|
+
export declare function createDelegatingApprovalHandler(parentApprovalManager: ApprovalManager, subAgentId: string, logger: Logger): ApprovalHandler;
|
|
30
30
|
//# sourceMappingURL=approval-delegation.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"approval-delegation.d.ts","sourceRoot":"","sources":["../../src/runtime/approval-delegation.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EACR,eAAe,EAIf,eAAe,EACf,
|
|
1
|
+
{"version":3,"file":"approval-delegation.d.ts","sourceRoot":"","sources":["../../src/runtime/approval-delegation.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EACR,eAAe,EAIf,eAAe,EACf,MAAM,EACT,MAAM,aAAa,CAAC;AAYrB;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,+BAA+B,CAC3C,qBAAqB,EAAE,eAAe,EACtC,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,MAAM,GACf,eAAe,CAqFjB"}
|
|
@@ -22,7 +22,7 @@ export declare const AgentRuntimeConfigSchema: z.ZodObject<{
|
|
|
22
22
|
export type ValidatedAgentRuntimeConfig = z.output<typeof AgentRuntimeConfigSchema>;
|
|
23
23
|
/**
|
|
24
24
|
* Schema for SpawnConfig
|
|
25
|
-
* Note: agentConfig is not validated here as it uses the
|
|
25
|
+
* Note: agentConfig is not validated here as it uses the agent-config AgentConfigSchema
|
|
26
26
|
*/
|
|
27
27
|
export declare const SpawnConfigSchema: z.ZodObject<{
|
|
28
28
|
agentConfig: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
package/dist/runtime/types.d.ts
CHANGED
|
@@ -4,7 +4,8 @@
|
|
|
4
4
|
* Type definitions for the general-purpose agent runtime system that manages
|
|
5
5
|
* the lifecycle of multiple agent instances.
|
|
6
6
|
*/
|
|
7
|
-
import type {
|
|
7
|
+
import type { AgentConfig } from '@dexto/agent-config';
|
|
8
|
+
import type { DextoAgent } from '@dexto/core';
|
|
8
9
|
/**
|
|
9
10
|
* Configuration for spawning an agent
|
|
10
11
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/runtime/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/runtime/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAE9C;;GAEG;AACH,MAAM,WAAW,WAAW;IACxB,0DAA0D;IAC1D,WAAW,EAAE,WAAW,CAAC;IAEzB,8EAA8E;IAC9E,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB,gEAAgE;IAChE,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB,6EAA6E;IAC7E,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf,8DAA8D;IAC9D,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAEnC;;;OAGG;IACH,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,UAAU,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAC/D;AAED;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG,UAAU,GAAG,MAAM,GAAG,SAAS,GAAG,UAAU,GAAG,SAAS,GAAG,OAAO,CAAC;AAE7F;;GAEG;AACH,MAAM,WAAW,WAAW;IACxB,uCAAuC;IACvC,OAAO,EAAE,MAAM,CAAC;IAEhB,8BAA8B;IAC9B,KAAK,EAAE,UAAU,CAAC;IAElB,kCAAkC;IAClC,MAAM,EAAE,WAAW,CAAC;IAEpB,mEAAmE;IACnE,SAAS,EAAE,OAAO,CAAC;IAEnB,kCAAkC;IAClC,SAAS,EAAE,IAAI,CAAC;IAEhB,8CAA8C;IAC9C,SAAS,EAAE,MAAM,CAAC;IAElB,uEAAuE;IACvE,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf,wBAAwB;IACxB,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAEnC,kDAAkD;IAClD,KAAK,CAAC,EAAE,MAAM,CAAC;CAClB;AAED;;GAEG;AACH,MAAM,WAAW,UAAU;IACvB,8CAA8C;IAC9C,OAAO,EAAE,OAAO,CAAC;IAEjB,oCAAoC;IACpC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB,uCAAuC;IACvC,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf,6CAA6C;IAC7C,OAAO,EAAE,MAAM,CAAC;IAEhB,+BAA+B;IAC/B,UAAU,CAAC,EAAE;QACT,KAAK,EAAE,MAAM,CAAC;QACd,MAAM,EAAE,MAAM,CAAC;QACf,KAAK,EAAE,MAAM,CAAC;KACjB,CAAC;CACL;AAED;;GAEG;AACH,MAAM,WAAW,kBAAkB;IAC/B,iEAAiE;IACjE,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB,qEAAqE;IACrE,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC/B;AAED;;GAEG;AACH,MAAM,WAAW,WAAW;IACxB,sBAAsB;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf,uBAAuB;IACvB,MAAM,CAAC,EAAE,WAAW,GAAG,WAAW,EAAE,CAAC;IAErC,+BAA+B;IAC/B,SAAS,CAAC,EAAE,OAAO,CAAC;CACvB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"error-codes.d.ts","sourceRoot":"","sources":["../../../src/tool-factories/agent-spawner/error-codes.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,oBAAY,qBAAqB;IAE7B,iBAAiB,oCAAoC;IACrD,YAAY,+BAA+B;IAG3C,eAAe,kCAAkC;IAGjD,WAAW,8BAA8B;IAGzC,cAAc,iCAAiC;CAClD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../src/tool-factories/agent-spawner/errors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAyB,MAAM,aAAa,CAAC;AAGvE;;GAEG;AACH,qBAAa,iBAAiB;IAC1B,MAAM,CAAC,gBAAgB;IAWvB,MAAM,CAAC,WAAW,CAAC,KAAK,EAAE,MAAM;;;IAWhC,MAAM,CAAC,aAAa,CAAC,OAAO,EAAE,MAAM;;;IAWpC,MAAM,CAAC,UAAU,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM;;;;IAWhD,MAAM,CAAC,aAAa,CAAC,OAAO,EAAE,MAAM;CAUvC"}
|