@dexto/agent-management 1.6.0 → 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.
Files changed (69) hide show
  1. package/dist/agent-creation.cjs +2 -1
  2. package/dist/agent-creation.d.ts.map +1 -1
  3. package/dist/agent-creation.js +2 -1
  4. package/dist/config/config-enrichment.cjs +8 -3
  5. package/dist/config/config-enrichment.d.ts +6 -0
  6. package/dist/config/config-enrichment.d.ts.map +1 -1
  7. package/dist/config/config-enrichment.js +8 -3
  8. package/dist/index.cjs +3 -1
  9. package/dist/index.d.ts +1 -0
  10. package/dist/index.d.ts.map +1 -1
  11. package/dist/index.js +1 -0
  12. package/dist/models/custom-models.cjs +4 -3
  13. package/dist/models/custom-models.d.ts +26 -5
  14. package/dist/models/custom-models.d.ts.map +1 -1
  15. package/dist/models/custom-models.js +4 -3
  16. package/dist/preferences/loader.cjs +23 -8
  17. package/dist/preferences/loader.d.ts +7 -3
  18. package/dist/preferences/loader.d.ts.map +1 -1
  19. package/dist/preferences/loader.js +23 -8
  20. package/dist/preferences/schemas.cjs +47 -12
  21. package/dist/preferences/schemas.d.ts +92 -12
  22. package/dist/preferences/schemas.d.ts.map +1 -1
  23. package/dist/preferences/schemas.js +48 -8
  24. package/dist/registry/types.cjs +4 -0
  25. package/dist/registry/types.d.ts +8 -0
  26. package/dist/registry/types.d.ts.map +1 -1
  27. package/dist/registry/types.js +4 -0
  28. package/dist/runtime/AgentRuntime.cjs +23 -15
  29. package/dist/runtime/AgentRuntime.d.ts.map +1 -1
  30. package/dist/runtime/AgentRuntime.js +23 -15
  31. package/dist/runtime/approval-delegation.cjs +6 -3
  32. package/dist/runtime/approval-delegation.d.ts +2 -1
  33. package/dist/runtime/approval-delegation.d.ts.map +1 -1
  34. package/dist/runtime/approval-delegation.js +6 -3
  35. package/dist/runtime/schemas.cjs +1 -1
  36. package/dist/runtime/schemas.js +1 -1
  37. package/dist/runtime/types.d.ts +1 -1
  38. package/dist/runtime/types.d.ts.map +1 -1
  39. package/dist/tool-factories/agent-spawner/factory.cjs +63 -26
  40. package/dist/tool-factories/agent-spawner/factory.d.ts.map +1 -1
  41. package/dist/tool-factories/agent-spawner/factory.js +61 -24
  42. package/dist/tool-factories/agent-spawner/runtime.cjs +166 -15
  43. package/dist/tool-factories/agent-spawner/runtime.d.ts +8 -1
  44. package/dist/tool-factories/agent-spawner/runtime.d.ts.map +1 -1
  45. package/dist/tool-factories/agent-spawner/runtime.js +173 -17
  46. package/dist/tool-factories/agent-spawner/schemas.cjs +14 -2
  47. package/dist/tool-factories/agent-spawner/schemas.d.ts +10 -1
  48. package/dist/tool-factories/agent-spawner/schemas.d.ts.map +1 -1
  49. package/dist/tool-factories/agent-spawner/schemas.js +12 -2
  50. package/dist/tool-factories/agent-spawner/spawn-agent-tool.cjs +10 -1
  51. package/dist/tool-factories/agent-spawner/spawn-agent-tool.d.ts.map +1 -1
  52. package/dist/tool-factories/agent-spawner/spawn-agent-tool.js +10 -1
  53. package/dist/tool-factories/creator-tools/factory.cjs +434 -0
  54. package/dist/tool-factories/creator-tools/factory.d.ts +4 -0
  55. package/dist/tool-factories/creator-tools/factory.d.ts.map +1 -0
  56. package/dist/tool-factories/creator-tools/factory.js +407 -0
  57. package/dist/tool-factories/creator-tools/index.cjs +33 -0
  58. package/dist/tool-factories/creator-tools/index.d.ts +3 -0
  59. package/dist/tool-factories/creator-tools/index.d.ts.map +1 -0
  60. package/dist/tool-factories/creator-tools/index.js +10 -0
  61. package/dist/tool-factories/creator-tools/schemas.cjs +41 -0
  62. package/dist/tool-factories/creator-tools/schemas.d.ts +15 -0
  63. package/dist/tool-factories/creator-tools/schemas.d.ts.map +1 -0
  64. package/dist/tool-factories/creator-tools/schemas.js +16 -0
  65. package/dist/utils/path.cjs +10 -1
  66. package/dist/utils/path.d.ts +5 -2
  67. package/dist/utils/path.d.ts.map +1 -1
  68. package/dist/utils/path.js +10 -1
  69. package/package.json +6 -6
@@ -4,31 +4,52 @@ export declare const PreferenceLLMSchema: z.ZodEffects<z.ZodObject<{
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
- reasoningEffort: z.ZodOptional<z.ZodEnum<["none", "minimal", "low", "medium", "high", "xhigh"]>>;
7
+ reasoning: z.ZodOptional<z.ZodObject<{
8
+ variant: z.ZodString;
9
+ budgetTokens: z.ZodOptional<z.ZodNumber>;
10
+ }, "strict", z.ZodTypeAny, {
11
+ variant: string;
12
+ budgetTokens?: number | undefined;
13
+ }, {
14
+ variant: string;
15
+ budgetTokens?: number | undefined;
16
+ }>>;
8
17
  }, "strict", z.ZodTypeAny, {
9
18
  provider: "openai" | "openai-compatible" | "anthropic" | "google" | "groq" | "xai" | "cohere" | "minimax" | "glm" | "openrouter" | "litellm" | "glama" | "vertex" | "bedrock" | "local" | "ollama" | "dexto-nova";
10
19
  model: string;
11
20
  apiKey?: string | undefined;
12
21
  baseURL?: string | undefined;
13
- reasoningEffort?: "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | undefined;
22
+ reasoning?: {
23
+ variant: string;
24
+ budgetTokens?: number | undefined;
25
+ } | undefined;
14
26
  }, {
15
27
  provider: "openai" | "openai-compatible" | "anthropic" | "google" | "groq" | "xai" | "cohere" | "minimax" | "glm" | "openrouter" | "litellm" | "glama" | "vertex" | "bedrock" | "local" | "ollama" | "dexto-nova";
16
28
  model: string;
17
29
  apiKey?: string | undefined;
18
30
  baseURL?: string | undefined;
19
- reasoningEffort?: "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | undefined;
31
+ reasoning?: {
32
+ variant: string;
33
+ budgetTokens?: number | undefined;
34
+ } | undefined;
20
35
  }>, {
21
36
  provider: "openai" | "openai-compatible" | "anthropic" | "google" | "groq" | "xai" | "cohere" | "minimax" | "glm" | "openrouter" | "litellm" | "glama" | "vertex" | "bedrock" | "local" | "ollama" | "dexto-nova";
22
37
  model: string;
23
38
  apiKey?: string | undefined;
24
39
  baseURL?: string | undefined;
25
- reasoningEffort?: "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | undefined;
40
+ reasoning?: {
41
+ variant: string;
42
+ budgetTokens?: number | undefined;
43
+ } | undefined;
26
44
  }, {
27
45
  provider: "openai" | "openai-compatible" | "anthropic" | "google" | "groq" | "xai" | "cohere" | "minimax" | "glm" | "openrouter" | "litellm" | "glama" | "vertex" | "bedrock" | "local" | "ollama" | "dexto-nova";
28
46
  model: string;
29
47
  apiKey?: string | undefined;
30
48
  baseURL?: string | undefined;
31
- reasoningEffort?: "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | undefined;
49
+ reasoning?: {
50
+ variant: string;
51
+ budgetTokens?: number | undefined;
52
+ } | undefined;
32
53
  }>;
33
54
  export declare const PreferenceDefaultsSchema: z.ZodObject<{
34
55
  defaultAgent: z.ZodString;
@@ -55,16 +76,28 @@ export declare const PreferenceSetupSchema: z.ZodObject<{
55
76
  }>;
56
77
  export declare const PreferenceSoundsSchema: z.ZodObject<{
57
78
  enabled: z.ZodDefault<z.ZodBoolean>;
79
+ onStartup: z.ZodDefault<z.ZodBoolean>;
80
+ startupSoundFile: z.ZodOptional<z.ZodString>;
58
81
  onApprovalRequired: z.ZodDefault<z.ZodBoolean>;
82
+ approvalSoundFile: z.ZodOptional<z.ZodString>;
59
83
  onTaskComplete: z.ZodDefault<z.ZodBoolean>;
84
+ completeSoundFile: z.ZodOptional<z.ZodString>;
60
85
  }, "strict", z.ZodTypeAny, {
61
86
  enabled: boolean;
87
+ onStartup: boolean;
62
88
  onApprovalRequired: boolean;
63
89
  onTaskComplete: boolean;
90
+ startupSoundFile?: string | undefined;
91
+ approvalSoundFile?: string | undefined;
92
+ completeSoundFile?: string | undefined;
64
93
  }, {
65
94
  enabled?: boolean | undefined;
95
+ onStartup?: boolean | undefined;
96
+ startupSoundFile?: string | undefined;
66
97
  onApprovalRequired?: boolean | undefined;
98
+ approvalSoundFile?: string | undefined;
67
99
  onTaskComplete?: boolean | undefined;
100
+ completeSoundFile?: string | undefined;
68
101
  }>;
69
102
  export declare const AgentToolPreferencesSchema: z.ZodObject<{
70
103
  disabled: z.ZodDefault<z.ZodArray<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>, "many">>;
@@ -96,31 +129,52 @@ export declare const GlobalPreferencesSchema: z.ZodObject<{
96
129
  model: z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
97
130
  apiKey: z.ZodOptional<z.ZodString>;
98
131
  baseURL: z.ZodOptional<z.ZodString>;
99
- reasoningEffort: z.ZodOptional<z.ZodEnum<["none", "minimal", "low", "medium", "high", "xhigh"]>>;
132
+ reasoning: z.ZodOptional<z.ZodObject<{
133
+ variant: z.ZodString;
134
+ budgetTokens: z.ZodOptional<z.ZodNumber>;
135
+ }, "strict", z.ZodTypeAny, {
136
+ variant: string;
137
+ budgetTokens?: number | undefined;
138
+ }, {
139
+ variant: string;
140
+ budgetTokens?: number | undefined;
141
+ }>>;
100
142
  }, "strict", z.ZodTypeAny, {
101
143
  provider: "openai" | "openai-compatible" | "anthropic" | "google" | "groq" | "xai" | "cohere" | "minimax" | "glm" | "openrouter" | "litellm" | "glama" | "vertex" | "bedrock" | "local" | "ollama" | "dexto-nova";
102
144
  model: string;
103
145
  apiKey?: string | undefined;
104
146
  baseURL?: string | undefined;
105
- reasoningEffort?: "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | undefined;
147
+ reasoning?: {
148
+ variant: string;
149
+ budgetTokens?: number | undefined;
150
+ } | undefined;
106
151
  }, {
107
152
  provider: "openai" | "openai-compatible" | "anthropic" | "google" | "groq" | "xai" | "cohere" | "minimax" | "glm" | "openrouter" | "litellm" | "glama" | "vertex" | "bedrock" | "local" | "ollama" | "dexto-nova";
108
153
  model: string;
109
154
  apiKey?: string | undefined;
110
155
  baseURL?: string | undefined;
111
- reasoningEffort?: "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | undefined;
156
+ reasoning?: {
157
+ variant: string;
158
+ budgetTokens?: number | undefined;
159
+ } | undefined;
112
160
  }>, {
113
161
  provider: "openai" | "openai-compatible" | "anthropic" | "google" | "groq" | "xai" | "cohere" | "minimax" | "glm" | "openrouter" | "litellm" | "glama" | "vertex" | "bedrock" | "local" | "ollama" | "dexto-nova";
114
162
  model: string;
115
163
  apiKey?: string | undefined;
116
164
  baseURL?: string | undefined;
117
- reasoningEffort?: "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | undefined;
165
+ reasoning?: {
166
+ variant: string;
167
+ budgetTokens?: number | undefined;
168
+ } | undefined;
118
169
  }, {
119
170
  provider: "openai" | "openai-compatible" | "anthropic" | "google" | "groq" | "xai" | "cohere" | "minimax" | "glm" | "openrouter" | "litellm" | "glama" | "vertex" | "bedrock" | "local" | "ollama" | "dexto-nova";
120
171
  model: string;
121
172
  apiKey?: string | undefined;
122
173
  baseURL?: string | undefined;
123
- reasoningEffort?: "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | undefined;
174
+ reasoning?: {
175
+ variant: string;
176
+ budgetTokens?: number | undefined;
177
+ } | undefined;
124
178
  }>;
125
179
  defaults: z.ZodObject<{
126
180
  defaultAgent: z.ZodString;
@@ -147,16 +201,28 @@ export declare const GlobalPreferencesSchema: z.ZodObject<{
147
201
  }>>;
148
202
  sounds: z.ZodDefault<z.ZodObject<{
149
203
  enabled: z.ZodDefault<z.ZodBoolean>;
204
+ onStartup: z.ZodDefault<z.ZodBoolean>;
205
+ startupSoundFile: z.ZodOptional<z.ZodString>;
150
206
  onApprovalRequired: z.ZodDefault<z.ZodBoolean>;
207
+ approvalSoundFile: z.ZodOptional<z.ZodString>;
151
208
  onTaskComplete: z.ZodDefault<z.ZodBoolean>;
209
+ completeSoundFile: z.ZodOptional<z.ZodString>;
152
210
  }, "strict", z.ZodTypeAny, {
153
211
  enabled: boolean;
212
+ onStartup: boolean;
154
213
  onApprovalRequired: boolean;
155
214
  onTaskComplete: boolean;
215
+ startupSoundFile?: string | undefined;
216
+ approvalSoundFile?: string | undefined;
217
+ completeSoundFile?: string | undefined;
156
218
  }, {
157
219
  enabled?: boolean | undefined;
220
+ onStartup?: boolean | undefined;
221
+ startupSoundFile?: string | undefined;
158
222
  onApprovalRequired?: boolean | undefined;
223
+ approvalSoundFile?: string | undefined;
159
224
  onTaskComplete?: boolean | undefined;
225
+ completeSoundFile?: string | undefined;
160
226
  }>>;
161
227
  }, "strict", z.ZodTypeAny, {
162
228
  llm: {
@@ -164,7 +230,10 @@ export declare const GlobalPreferencesSchema: z.ZodObject<{
164
230
  model: string;
165
231
  apiKey?: string | undefined;
166
232
  baseURL?: string | undefined;
167
- reasoningEffort?: "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | undefined;
233
+ reasoning?: {
234
+ variant: string;
235
+ budgetTokens?: number | undefined;
236
+ } | undefined;
168
237
  };
169
238
  defaults: {
170
239
  defaultAgent: string;
@@ -177,8 +246,12 @@ export declare const GlobalPreferencesSchema: z.ZodObject<{
177
246
  };
178
247
  sounds: {
179
248
  enabled: boolean;
249
+ onStartup: boolean;
180
250
  onApprovalRequired: boolean;
181
251
  onTaskComplete: boolean;
252
+ startupSoundFile?: string | undefined;
253
+ approvalSoundFile?: string | undefined;
254
+ completeSoundFile?: string | undefined;
182
255
  };
183
256
  }, {
184
257
  llm: {
@@ -186,7 +259,10 @@ export declare const GlobalPreferencesSchema: z.ZodObject<{
186
259
  model: string;
187
260
  apiKey?: string | undefined;
188
261
  baseURL?: string | undefined;
189
- reasoningEffort?: "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | undefined;
262
+ reasoning?: {
263
+ variant: string;
264
+ budgetTokens?: number | undefined;
265
+ } | undefined;
190
266
  };
191
267
  defaults: {
192
268
  defaultAgent: string;
@@ -199,8 +275,12 @@ export declare const GlobalPreferencesSchema: z.ZodObject<{
199
275
  } | undefined;
200
276
  sounds?: {
201
277
  enabled?: boolean | undefined;
278
+ onStartup?: boolean | undefined;
279
+ startupSoundFile?: string | undefined;
202
280
  onApprovalRequired?: boolean | undefined;
281
+ approvalSoundFile?: string | undefined;
203
282
  onTaskComplete?: boolean | undefined;
283
+ completeSoundFile?: string | undefined;
204
284
  } | undefined;
205
285
  }>;
206
286
  export type PreferenceLLM = z.output<typeof PreferenceLLMSchema>;
@@ -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,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,O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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"}
@@ -4,12 +4,14 @@ import {
4
4
  getSupportedModels,
5
5
  acceptsAnyModel,
6
6
  supportsCustomModels,
7
- supportsBaseURL
7
+ supportsBaseURL,
8
+ getReasoningProfile,
9
+ supportsReasoningVariant,
10
+ LLM_PROVIDERS,
11
+ NonEmptyTrimmed,
12
+ ErrorType
8
13
  } from "@dexto/core";
9
- import { LLM_PROVIDERS } from "@dexto/core";
10
- import { NonEmptyTrimmed } from "@dexto/core";
11
14
  import { PreferenceErrorCode } from "./error-codes.js";
12
- import { ErrorType } from "@dexto/core";
13
15
  const PreferenceLLMSchema = z.object({
14
16
  provider: z.enum(LLM_PROVIDERS).describe("LLM provider (openai, anthropic, google, etc.)"),
15
17
  model: NonEmptyTrimmed.describe("Model name for the provider"),
@@ -20,9 +22,14 @@ const PreferenceLLMSchema = z.object({
20
22
  "Environment variable reference for API key (optional for local providers like Ollama)"
21
23
  ),
22
24
  baseURL: z.string().url("Must be a valid URL (e.g., http://localhost:11434/v1)").optional().describe("Custom base URL for providers that support it (openai-compatible, litellm)"),
23
- reasoningEffort: z.enum(["none", "minimal", "low", "medium", "high", "xhigh"]).optional().describe(
24
- "Reasoning effort level for OpenAI reasoning models (o1, o3, codex, gpt-5.x). Auto-detected if not set."
25
- )
25
+ reasoning: z.object({
26
+ variant: z.string().trim().min(1).describe(
27
+ "Reasoning variant. Use a model/provider-native variant from the active reasoning profile."
28
+ ),
29
+ budgetTokens: z.number().int().positive().optional().describe(
30
+ "Advanced escape hatch for budget-based providers (e.g., Anthropic/Gemini/Bedrock/OpenRouter)."
31
+ )
32
+ }).strict().optional().describe("Reasoning configuration (tuning only; display is controlled separately).")
26
33
  }).strict().superRefine((data, ctx) => {
27
34
  const skipModelValidation = acceptsAnyModel(data.provider) || supportsCustomModels(data.provider);
28
35
  if (!skipModelValidation && !isValidProviderModel(data.provider, data.model)) {
@@ -50,6 +57,35 @@ const PreferenceLLMSchema = z.object({
50
57
  }
51
58
  });
52
59
  }
60
+ if (data.reasoning) {
61
+ const profile = getReasoningProfile(data.provider, data.model);
62
+ const variant = data.reasoning.variant;
63
+ const budgetTokens = data.reasoning.budgetTokens;
64
+ if (!supportsReasoningVariant(profile, variant)) {
65
+ ctx.addIssue({
66
+ code: z.ZodIssueCode.custom,
67
+ path: ["reasoning", "variant"],
68
+ message: `Reasoning variant '${variant}' is not supported for provider '${data.provider}' model '${data.model}'. Supported: ${profile.variants.map((entry) => entry.id).join(", ")}`,
69
+ params: {
70
+ code: PreferenceErrorCode.INVALID_PREFERENCE_VALUE,
71
+ scope: "preference",
72
+ type: ErrorType.USER
73
+ }
74
+ });
75
+ }
76
+ if (typeof budgetTokens === "number" && !profile.supportsBudgetTokens) {
77
+ ctx.addIssue({
78
+ code: z.ZodIssueCode.custom,
79
+ path: ["reasoning", "budgetTokens"],
80
+ message: `Reasoning budgetTokens are not supported for provider '${data.provider}' model '${data.model}'. Remove reasoning.budgetTokens to use provider defaults.`,
81
+ params: {
82
+ code: PreferenceErrorCode.INVALID_PREFERENCE_VALUE,
83
+ scope: "preference",
84
+ type: ErrorType.USER
85
+ }
86
+ });
87
+ }
88
+ }
53
89
  });
54
90
  const PreferenceDefaultsSchema = z.object({
55
91
  defaultAgent: z.string().min(1).describe("Default agent name for global CLI usage (required)"),
@@ -62,10 +98,14 @@ const PreferenceSetupSchema = z.object({
62
98
  }).strict();
63
99
  const PreferenceSoundsSchema = z.object({
64
100
  enabled: z.boolean().default(true).describe("Enable sound notifications (default: true)"),
101
+ onStartup: z.boolean().default(false).describe("Play sound when the interactive CLI starts (default: false)"),
102
+ startupSoundFile: z.string().min(1).optional().describe("Startup sound file path relative to ~/.dexto/sounds (optional)"),
65
103
  onApprovalRequired: z.boolean().default(true).describe(
66
104
  "Play sound when tool approval is required (default: true when sounds enabled)"
67
105
  ),
68
- onTaskComplete: z.boolean().default(true).describe("Play sound when agent task completes (default: true when sounds enabled)")
106
+ approvalSoundFile: z.string().min(1).optional().describe("Approval sound file path relative to ~/.dexto/sounds (optional)"),
107
+ onTaskComplete: z.boolean().default(true).describe("Play sound when agent task completes (default: true when sounds enabled)"),
108
+ completeSoundFile: z.string().min(1).optional().describe("Completion sound file path relative to ~/.dexto/sounds (optional)")
69
109
  }).strict();
70
110
  const AgentToolPreferencesSchema = z.object({
71
111
  disabled: z.array(NonEmptyTrimmed).default([]).describe("Tool names disabled for this agent (default: none)")
@@ -36,6 +36,7 @@ const AgentRegistryEntrySchema = import_zod.z.object({
36
36
  tags: import_zod.z.array(import_zod.z.string()),
37
37
  source: import_zod.z.string(),
38
38
  main: import_zod.z.string().optional(),
39
+ enabled: import_zod.z.boolean().optional(),
39
40
  type: import_zod.z.enum(["builtin", "custom"]).default("builtin").describe("Agent type")
40
41
  }).strict();
41
42
  const RegistrySchema = import_zod.z.object({
@@ -52,6 +53,9 @@ function normalizeRegistryJson(raw) {
52
53
  for (const [agentId, value] of Object.entries(agents)) {
53
54
  if (!value || typeof value !== "object") continue;
54
55
  const entry = { ...value };
56
+ if (entry.enabled === false) {
57
+ continue;
58
+ }
55
59
  if (!entry.id || typeof entry.id !== "string" || entry.id.trim() !== agentId) {
56
60
  entry.id = agentId;
57
61
  }
@@ -11,6 +11,7 @@ export declare const AgentRegistryEntrySchema: z.ZodObject<{
11
11
  tags: z.ZodArray<z.ZodString, "many">;
12
12
  source: z.ZodString;
13
13
  main: z.ZodOptional<z.ZodString>;
14
+ enabled: z.ZodOptional<z.ZodBoolean>;
14
15
  type: z.ZodDefault<z.ZodEnum<["builtin", "custom"]>>;
15
16
  }, "strict", z.ZodTypeAny, {
16
17
  id: string;
@@ -21,6 +22,7 @@ export declare const AgentRegistryEntrySchema: z.ZodObject<{
21
22
  type: "custom" | "builtin";
22
23
  source: string;
23
24
  main?: string | undefined;
25
+ enabled?: boolean | undefined;
24
26
  }, {
25
27
  id: string;
26
28
  name: string;
@@ -30,6 +32,7 @@ export declare const AgentRegistryEntrySchema: z.ZodObject<{
30
32
  source: string;
31
33
  type?: "custom" | "builtin" | undefined;
32
34
  main?: string | undefined;
35
+ enabled?: boolean | undefined;
33
36
  }>;
34
37
  export type AgentRegistryEntry = z.output<typeof AgentRegistryEntrySchema>;
35
38
  /**
@@ -45,6 +48,7 @@ export declare const RegistrySchema: z.ZodObject<{
45
48
  tags: z.ZodArray<z.ZodString, "many">;
46
49
  source: z.ZodString;
47
50
  main: z.ZodOptional<z.ZodString>;
51
+ enabled: z.ZodOptional<z.ZodBoolean>;
48
52
  type: z.ZodDefault<z.ZodEnum<["builtin", "custom"]>>;
49
53
  }, "strict", z.ZodTypeAny, {
50
54
  id: string;
@@ -55,6 +59,7 @@ export declare const RegistrySchema: z.ZodObject<{
55
59
  type: "custom" | "builtin";
56
60
  source: string;
57
61
  main?: string | undefined;
62
+ enabled?: boolean | undefined;
58
63
  }, {
59
64
  id: string;
60
65
  name: string;
@@ -64,6 +69,7 @@ export declare const RegistrySchema: z.ZodObject<{
64
69
  source: string;
65
70
  type?: "custom" | "builtin" | undefined;
66
71
  main?: string | undefined;
72
+ enabled?: boolean | undefined;
67
73
  }>>;
68
74
  }, "strict", z.ZodTypeAny, {
69
75
  version: string;
@@ -76,6 +82,7 @@ export declare const RegistrySchema: z.ZodObject<{
76
82
  type: "custom" | "builtin";
77
83
  source: string;
78
84
  main?: string | undefined;
85
+ enabled?: boolean | undefined;
79
86
  }>;
80
87
  }, {
81
88
  version: string;
@@ -88,6 +95,7 @@ export declare const RegistrySchema: z.ZodObject<{
88
95
  source: string;
89
96
  type?: "custom" | "builtin" | undefined;
90
97
  main?: string | undefined;
98
+ enabled?: boolean | undefined;
91
99
  }>;
92
100
  }>;
93
101
  export type Registry = z.output<typeof RegistrySchema>;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/registry/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAMtD;AAED;;GAEG;AACH,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;EAWxB,CAAC;AAEd,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAE3E;;GAEG;AACH,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAKd,CAAC;AAEd,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,cAAc,CAAC,CAAC;AAEvD,KAAK,WAAW,GAAG;IACf,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,CAAC;CAC9C,CAAC;AAEF;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,OAAO,GAAG,WAAW,CAsC/D;AAED;;GAEG;AACH,MAAM,WAAW,aAAa;IAC1B;;OAEG;IACH,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC;IACnC;;OAEG;IACH,kBAAkB,IAAI,MAAM,CAAC,MAAM,EAAE,kBAAkB,CAAC,CAAC;IACzD;;;;OAIG;IACH,YAAY,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAC/C;;;;OAIG;IACH,cAAc,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC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AAM,CAAC,CAAC;IAC/C;;;;OAIG;IACH,cAAc,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAChE;;OAEG;IACH,kBAAkB,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;IACxC;;;;;OAKG;IACH,YAAY,CAAC,QAAQ,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;CAC1E"}
@@ -10,6 +10,7 @@ const AgentRegistryEntrySchema = z.object({
10
10
  tags: z.array(z.string()),
11
11
  source: z.string(),
12
12
  main: z.string().optional(),
13
+ enabled: z.boolean().optional(),
13
14
  type: z.enum(["builtin", "custom"]).default("builtin").describe("Agent type")
14
15
  }).strict();
15
16
  const RegistrySchema = z.object({
@@ -26,6 +27,9 @@ function normalizeRegistryJson(raw) {
26
27
  for (const [agentId, value] of Object.entries(agents)) {
27
28
  if (!value || typeof value !== "object") continue;
28
29
  const entry = { ...value };
30
+ if (entry.enabled === false) {
31
+ continue;
32
+ }
29
33
  if (!entry.id || typeof entry.id !== "string" || entry.id.trim() !== agentId) {
30
34
  entry.id = agentId;
31
35
  }
@@ -56,7 +56,11 @@ class AgentRuntime {
56
56
  try {
57
57
  const agent = await (0, import_agent_creation.createDextoAgentFromConfig)({
58
58
  config: config.agentConfig,
59
- enrichOptions: { isInteractiveCli: false, skipPluginDiscovery: true },
59
+ enrichOptions: {
60
+ isInteractiveCli: false,
61
+ skipPluginDiscovery: true,
62
+ forceStoragePaths: true
63
+ },
60
64
  agentIdOverride: agentId,
61
65
  agentContext: "subagent"
62
66
  });
@@ -110,22 +114,26 @@ class AgentRuntime {
110
114
  const taskTimeout = timeout ?? this.config.defaultTaskTimeout;
111
115
  this.pool.updateStatus(agentId, "running");
112
116
  try {
113
- let timeoutId;
114
- const timeoutPromise = new Promise((_, reject) => {
115
- timeoutId = setTimeout(() => {
116
- reject(import_errors.RuntimeError.taskTimeout(agentId, taskTimeout));
117
- }, taskTimeout);
118
- });
119
117
  const generatePromise = handle.agent.generate(task, handle.sessionId);
120
118
  let response;
121
- try {
122
- response = await Promise.race([
123
- generatePromise,
124
- timeoutPromise
125
- ]);
126
- } finally {
127
- if (timeoutId) {
128
- clearTimeout(timeoutId);
119
+ if (taskTimeout === 0) {
120
+ response = await generatePromise;
121
+ } else {
122
+ let timeoutId;
123
+ const timeoutPromise = new Promise((_, reject) => {
124
+ timeoutId = setTimeout(() => {
125
+ reject(import_errors.RuntimeError.taskTimeout(agentId, taskTimeout));
126
+ }, taskTimeout);
127
+ });
128
+ try {
129
+ response = await Promise.race([
130
+ generatePromise,
131
+ timeoutPromise
132
+ ]);
133
+ } finally {
134
+ if (timeoutId) {
135
+ clearTimeout(timeoutId);
136
+ }
129
137
  }
130
138
  }
131
139
  this.pool.updateStatus(agentId, "idle");
@@ -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;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,EA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OAAO,CAAC,MAAM,CAAS;gBAEX,OAAO,EAAE,mBAAmB;IAYxC;;;;;OAKG;IACG,UAAU,CAAC,MAAM,EAAE,WAAW,GAAG,OAAO,CAAC,WAAW,CAAC;IAwE3D;;;;;;;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"}
@@ -33,7 +33,11 @@ class AgentRuntime {
33
33
  try {
34
34
  const agent = await createDextoAgentFromConfig({
35
35
  config: config.agentConfig,
36
- enrichOptions: { isInteractiveCli: false, skipPluginDiscovery: true },
36
+ enrichOptions: {
37
+ isInteractiveCli: false,
38
+ skipPluginDiscovery: true,
39
+ forceStoragePaths: true
40
+ },
37
41
  agentIdOverride: agentId,
38
42
  agentContext: "subagent"
39
43
  });
@@ -87,22 +91,26 @@ class AgentRuntime {
87
91
  const taskTimeout = timeout ?? this.config.defaultTaskTimeout;
88
92
  this.pool.updateStatus(agentId, "running");
89
93
  try {
90
- let timeoutId;
91
- const timeoutPromise = new Promise((_, reject) => {
92
- timeoutId = setTimeout(() => {
93
- reject(RuntimeError.taskTimeout(agentId, taskTimeout));
94
- }, taskTimeout);
95
- });
96
94
  const generatePromise = handle.agent.generate(task, handle.sessionId);
97
95
  let response;
98
- try {
99
- response = await Promise.race([
100
- generatePromise,
101
- timeoutPromise
102
- ]);
103
- } finally {
104
- if (timeoutId) {
105
- clearTimeout(timeoutId);
96
+ if (taskTimeout === 0) {
97
+ response = await generatePromise;
98
+ } else {
99
+ let timeoutId;
100
+ const timeoutPromise = new Promise((_, reject) => {
101
+ timeoutId = setTimeout(() => {
102
+ reject(RuntimeError.taskTimeout(agentId, taskTimeout));
103
+ }, taskTimeout);
104
+ });
105
+ try {
106
+ response = await Promise.race([
107
+ generatePromise,
108
+ timeoutPromise
109
+ ]);
110
+ } finally {
111
+ if (timeoutId) {
112
+ clearTimeout(timeoutId);
113
+ }
106
114
  }
107
115
  }
108
116
  this.pool.updateStatus(agentId, "idle");
@@ -21,7 +21,7 @@ __export(approval_delegation_exports, {
21
21
  createDelegatingApprovalHandler: () => createDelegatingApprovalHandler
22
22
  });
23
23
  module.exports = __toCommonJS(approval_delegation_exports);
24
- function createDelegatingApprovalHandler(parentApprovalManager, subAgentId, logger) {
24
+ function createDelegatingApprovalHandler(parentApprovalManager, subAgentId, parentSessionId, logger) {
25
25
  const pendingApprovalIds = /* @__PURE__ */ new Set();
26
26
  const handler = Object.assign(
27
27
  async (request) => {
@@ -33,10 +33,13 @@ function createDelegatingApprovalHandler(parentApprovalManager, subAgentId, logg
33
33
  const delegatedDetails = {
34
34
  type: request.type,
35
35
  timeout: request.timeout,
36
- sessionId: request.sessionId,
36
+ // IMPORTANT: use the parent sessionId so the interactive CLI surfaces
37
+ // the approval in the correct active session.
38
+ sessionId: parentSessionId ?? request.sessionId,
37
39
  metadata: {
38
40
  ...request.metadata,
39
- delegatedFromAgent: subAgentId
41
+ delegatedFromAgent: subAgentId,
42
+ delegatedFromSessionId: request.sessionId
40
43
  }
41
44
  };
42
45
  const response = await parentApprovalManager.requestApproval(delegatedDetails);
@@ -21,10 +21,11 @@ import type { ApprovalHandler, ApprovalManager, Logger } from '@dexto/core';
21
21
  * const delegatingHandler = createDelegatingApprovalHandler(
22
22
  * parentAgent.services.approvalManager,
23
23
  * subAgentId,
24
+ * parentSessionId,
24
25
  * logger
25
26
  * );
26
27
  * subAgent.services.approvalManager.setHandler(delegatingHandler);
27
28
  * ```
28
29
  */
29
- export declare function createDelegatingApprovalHandler(parentApprovalManager: ApprovalManager, subAgentId: string, logger: Logger): ApprovalHandler;
30
+ export declare function createDelegatingApprovalHandler(parentApprovalManager: ApprovalManager, subAgentId: string, parentSessionId: string | undefined, logger: Logger): ApprovalHandler;
30
31
  //# 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,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"}
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;AAerB;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,+BAA+B,CAC3C,qBAAqB,EAAE,eAAe,EACtC,UAAU,EAAE,MAAM,EAClB,eAAe,EAAE,MAAM,GAAG,SAAS,EACnC,MAAM,EAAE,MAAM,GACf,eAAe,CAwFjB"}
@@ -1,4 +1,4 @@
1
- function createDelegatingApprovalHandler(parentApprovalManager, subAgentId, logger) {
1
+ function createDelegatingApprovalHandler(parentApprovalManager, subAgentId, parentSessionId, logger) {
2
2
  const pendingApprovalIds = /* @__PURE__ */ new Set();
3
3
  const handler = Object.assign(
4
4
  async (request) => {
@@ -10,10 +10,13 @@ function createDelegatingApprovalHandler(parentApprovalManager, subAgentId, logg
10
10
  const delegatedDetails = {
11
11
  type: request.type,
12
12
  timeout: request.timeout,
13
- sessionId: request.sessionId,
13
+ // IMPORTANT: use the parent sessionId so the interactive CLI surfaces
14
+ // the approval in the correct active session.
15
+ sessionId: parentSessionId ?? request.sessionId,
14
16
  metadata: {
15
17
  ...request.metadata,
16
- delegatedFromAgent: subAgentId
18
+ delegatedFromAgent: subAgentId,
19
+ delegatedFromSessionId: request.sessionId
17
20
  }
18
21
  };
19
22
  const response = await parentApprovalManager.requestApproval(delegatedDetails);
@@ -31,7 +31,7 @@ const DEFAULT_MAX_AGENTS = 20;
31
31
  const DEFAULT_TASK_TIMEOUT = 3e5;
32
32
  const AgentRuntimeConfigSchema = import_zod.z.object({
33
33
  maxAgents: import_zod.z.number().int().positive().default(DEFAULT_MAX_AGENTS).describe("Maximum total agents managed by this runtime"),
34
- defaultTaskTimeout: import_zod.z.number().int().positive().default(DEFAULT_TASK_TIMEOUT).describe("Default task timeout in milliseconds")
34
+ defaultTaskTimeout: import_zod.z.number().int().nonnegative().default(DEFAULT_TASK_TIMEOUT).describe("Default task timeout in milliseconds (0 = no timeout)")
35
35
  }).strict().describe("Configuration for the AgentRuntime");
36
36
  const SpawnConfigSchema = import_zod.z.object({
37
37
  agentConfig: import_zod.z.record(import_zod.z.unknown()).describe("Base agent configuration"),
@@ -3,7 +3,7 @@ const DEFAULT_MAX_AGENTS = 20;
3
3
  const DEFAULT_TASK_TIMEOUT = 3e5;
4
4
  const AgentRuntimeConfigSchema = z.object({
5
5
  maxAgents: z.number().int().positive().default(DEFAULT_MAX_AGENTS).describe("Maximum total agents managed by this runtime"),
6
- defaultTaskTimeout: z.number().int().positive().default(DEFAULT_TASK_TIMEOUT).describe("Default task timeout in milliseconds")
6
+ defaultTaskTimeout: z.number().int().nonnegative().default(DEFAULT_TASK_TIMEOUT).describe("Default task timeout in milliseconds (0 = no timeout)")
7
7
  }).strict().describe("Configuration for the AgentRuntime");
8
8
  const SpawnConfigSchema = z.object({
9
9
  agentConfig: z.record(z.unknown()).describe("Base agent configuration"),
@@ -78,7 +78,7 @@ export interface TaskResult {
78
78
  export interface AgentRuntimeConfig {
79
79
  /** Maximum total agents managed by this runtime (default: 20) */
80
80
  maxAgents?: number;
81
- /** Default task timeout in milliseconds (default: 300000 = 5 min) */
81
+ /** Default task timeout in milliseconds (default: 300000 = 5 min, 0 = no timeout) */
82
82
  defaultTaskTimeout?: number;
83
83
  }
84
84
  /**