@dexto/agent-management 1.6.0 → 1.6.1
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/config/config-enrichment.cjs +8 -3
- package/dist/config/config-enrichment.d.ts +6 -0
- package/dist/config/config-enrichment.d.ts.map +1 -1
- package/dist/config/config-enrichment.js +8 -3
- package/dist/preferences/loader.cjs +21 -6
- package/dist/preferences/loader.d.ts +4 -0
- package/dist/preferences/loader.d.ts.map +1 -1
- package/dist/preferences/loader.js +21 -6
- package/dist/preferences/schemas.cjs +5 -1
- package/dist/preferences/schemas.d.ts +32 -0
- package/dist/preferences/schemas.d.ts.map +1 -1
- package/dist/preferences/schemas.js +5 -1
- package/dist/registry/types.cjs +4 -0
- package/dist/registry/types.d.ts +8 -0
- package/dist/registry/types.d.ts.map +1 -1
- package/dist/registry/types.js +4 -0
- package/dist/runtime/AgentRuntime.cjs +23 -15
- package/dist/runtime/AgentRuntime.d.ts.map +1 -1
- package/dist/runtime/AgentRuntime.js +23 -15
- package/dist/runtime/approval-delegation.cjs +6 -3
- package/dist/runtime/approval-delegation.d.ts +2 -1
- package/dist/runtime/approval-delegation.d.ts.map +1 -1
- package/dist/runtime/approval-delegation.js +6 -3
- package/dist/runtime/schemas.cjs +1 -1
- package/dist/runtime/schemas.js +1 -1
- package/dist/runtime/types.d.ts +1 -1
- package/dist/runtime/types.d.ts.map +1 -1
- package/dist/tool-factories/agent-spawner/factory.cjs +63 -26
- package/dist/tool-factories/agent-spawner/factory.d.ts.map +1 -1
- package/dist/tool-factories/agent-spawner/factory.js +61 -24
- package/dist/tool-factories/agent-spawner/runtime.cjs +118 -14
- package/dist/tool-factories/agent-spawner/runtime.d.ts +5 -0
- package/dist/tool-factories/agent-spawner/runtime.d.ts.map +1 -1
- package/dist/tool-factories/agent-spawner/runtime.js +119 -15
- package/dist/tool-factories/agent-spawner/schemas.cjs +2 -2
- package/dist/tool-factories/agent-spawner/schemas.d.ts +1 -1
- package/dist/tool-factories/agent-spawner/schemas.d.ts.map +1 -1
- package/dist/tool-factories/agent-spawner/schemas.js +2 -2
- package/dist/tool-factories/agent-spawner/spawn-agent-tool.cjs +10 -1
- package/dist/tool-factories/agent-spawner/spawn-agent-tool.d.ts.map +1 -1
- package/dist/tool-factories/agent-spawner/spawn-agent-tool.js +10 -1
- package/dist/utils/path.cjs +10 -1
- package/dist/utils/path.d.ts +5 -2
- package/dist/utils/path.d.ts.map +1 -1
- package/dist/utils/path.js +10 -1
- package/package.json +6 -6
|
@@ -64,7 +64,8 @@ function enrichAgentConfig(config, configPath, options = {}) {
|
|
|
64
64
|
isInteractiveCli = false,
|
|
65
65
|
logLevel = "error",
|
|
66
66
|
skipPluginDiscovery = false,
|
|
67
|
-
bundledPlugins = []
|
|
67
|
+
bundledPlugins = [],
|
|
68
|
+
forceStoragePaths = false
|
|
68
69
|
} = opts;
|
|
69
70
|
const agentId = deriveAgentId(config, configPath);
|
|
70
71
|
const dbPath = (0, import_path.getDextoPath)("database", `${agentId}.db`);
|
|
@@ -94,15 +95,19 @@ function enrichAgentConfig(config, configPath, options = {}) {
|
|
|
94
95
|
...config.storage
|
|
95
96
|
};
|
|
96
97
|
if (config.storage.database?.type === "sqlite") {
|
|
98
|
+
const databasePath = typeof config.storage.database.path === "string" ? config.storage.database.path : void 0;
|
|
99
|
+
const shouldOverride = !databasePath || forceStoragePaths && !path.isAbsolute(databasePath);
|
|
97
100
|
enriched.storage.database = {
|
|
98
101
|
...config.storage.database,
|
|
99
|
-
path:
|
|
102
|
+
path: shouldOverride ? dbPath : databasePath
|
|
100
103
|
};
|
|
101
104
|
}
|
|
102
105
|
if (config.storage.blob?.type === "local") {
|
|
106
|
+
const blobStorePath = typeof config.storage.blob.storePath === "string" ? config.storage.blob.storePath : void 0;
|
|
107
|
+
const shouldOverride = !blobStorePath || forceStoragePaths && !path.isAbsolute(blobStorePath);
|
|
103
108
|
enriched.storage.blob = {
|
|
104
109
|
...config.storage.blob,
|
|
105
|
-
storePath:
|
|
110
|
+
storePath: shouldOverride ? blobPath : blobStorePath
|
|
106
111
|
};
|
|
107
112
|
}
|
|
108
113
|
}
|
|
@@ -35,6 +35,12 @@ export interface EnrichAgentConfigOptions {
|
|
|
35
35
|
* user/project plugins.
|
|
36
36
|
*/
|
|
37
37
|
bundledPlugins?: string[];
|
|
38
|
+
/**
|
|
39
|
+
* When true, normalize relative storage paths (database/blob) to per-agent
|
|
40
|
+
* locations.
|
|
41
|
+
* Useful when configs may be loaded from varying working directories.
|
|
42
|
+
*/
|
|
43
|
+
forceStoragePaths?: boolean;
|
|
38
44
|
}
|
|
39
45
|
/**
|
|
40
46
|
* Enriches agent configuration with per-agent file paths and discovered commands.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config-enrichment.d.ts","sourceRoot":"","sources":["../../src/config/config-enrichment.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAGH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAUvD,OAAO,EAAE,sBAAsB,EAAE,4BAA4B,EAAE,MAAM,uBAAuB,CAAC;AAE7F;;;GAGG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,WAAW,EAAE,UAAU,CAAC,EAAE,MAAM,GAAG,MAAM,CAoC9E;AAED;;GAEG;AACH,MAAM,WAAW,wBAAwB;IACrC,mGAAmG;IACnG,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,0FAA0F;IAC1F,QAAQ,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;IAC/C,uFAAuF;IACvF,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B;;;;OAIG;IACH,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"config-enrichment.d.ts","sourceRoot":"","sources":["../../src/config/config-enrichment.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAGH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAUvD,OAAO,EAAE,sBAAsB,EAAE,4BAA4B,EAAE,MAAM,uBAAuB,CAAC;AAE7F;;;GAGG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,WAAW,EAAE,UAAU,CAAC,EAAE,MAAM,GAAG,MAAM,CAoC9E;AAED;;GAEG;AACH,MAAM,WAAW,wBAAwB;IACrC,mGAAmG;IACnG,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,0FAA0F;IAC1F,QAAQ,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;IAC/C,uFAAuF;IACvF,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B;;;;OAIG;IACH,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;IAC1B;;;;OAIG;IACH,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC/B;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,iBAAiB,CAC7B,MAAM,EAAE,WAAW,EACnB,UAAU,CAAC,EAAE,MAAM,EACnB,OAAO,GAAE,wBAAwB,GAAG,OAAY,GACjD,WAAW,CAwPb"}
|
|
@@ -32,7 +32,8 @@ function enrichAgentConfig(config, configPath, options = {}) {
|
|
|
32
32
|
isInteractiveCli = false,
|
|
33
33
|
logLevel = "error",
|
|
34
34
|
skipPluginDiscovery = false,
|
|
35
|
-
bundledPlugins = []
|
|
35
|
+
bundledPlugins = [],
|
|
36
|
+
forceStoragePaths = false
|
|
36
37
|
} = opts;
|
|
37
38
|
const agentId = deriveAgentId(config, configPath);
|
|
38
39
|
const dbPath = getDextoPath("database", `${agentId}.db`);
|
|
@@ -62,15 +63,19 @@ function enrichAgentConfig(config, configPath, options = {}) {
|
|
|
62
63
|
...config.storage
|
|
63
64
|
};
|
|
64
65
|
if (config.storage.database?.type === "sqlite") {
|
|
66
|
+
const databasePath = typeof config.storage.database.path === "string" ? config.storage.database.path : void 0;
|
|
67
|
+
const shouldOverride = !databasePath || forceStoragePaths && !path.isAbsolute(databasePath);
|
|
65
68
|
enriched.storage.database = {
|
|
66
69
|
...config.storage.database,
|
|
67
|
-
path:
|
|
70
|
+
path: shouldOverride ? dbPath : databasePath
|
|
68
71
|
};
|
|
69
72
|
}
|
|
70
73
|
if (config.storage.blob?.type === "local") {
|
|
74
|
+
const blobStorePath = typeof config.storage.blob.storePath === "string" ? config.storage.blob.storePath : void 0;
|
|
75
|
+
const shouldOverride = !blobStorePath || forceStoragePaths && !path.isAbsolute(blobStorePath);
|
|
71
76
|
enriched.storage.blob = {
|
|
72
77
|
...config.storage.blob,
|
|
73
|
-
storePath:
|
|
78
|
+
storePath: shouldOverride ? blobPath : blobStorePath
|
|
74
79
|
};
|
|
75
80
|
}
|
|
76
81
|
}
|
|
@@ -79,11 +79,22 @@ const PREFERENCES_FILE_HEADER = `# Dexto Global Preferences
|
|
|
79
79
|
# Documentation: https://dexto.dev/docs/configuration/preferences
|
|
80
80
|
#
|
|
81
81
|
# Sound Notifications:
|
|
82
|
-
# Dexto plays sounds for approval requests and task completion.
|
|
83
|
-
#
|
|
84
|
-
#
|
|
85
|
-
#
|
|
86
|
-
#
|
|
82
|
+
# Dexto plays sounds for CLI startup, approval requests, and task completion.
|
|
83
|
+
# Configure which events play sounds:
|
|
84
|
+
# sounds.enabled: true|false
|
|
85
|
+
# sounds.onStartup: true|false
|
|
86
|
+
# sounds.onApprovalRequired: true|false
|
|
87
|
+
# sounds.onTaskComplete: true|false
|
|
88
|
+
#
|
|
89
|
+
# Select sound files (paths are relative to ~/.dexto/sounds):
|
|
90
|
+
# sounds.startupSoundFile: builtins/startup.wav
|
|
91
|
+
# sounds.approvalSoundFile: builtins/coin.wav
|
|
92
|
+
# sounds.completeSoundFile: builtins/success.wav
|
|
93
|
+
#
|
|
94
|
+
# Tip: Use the /sounds overlay to preview and pick sounds.
|
|
95
|
+
#
|
|
96
|
+
# To use custom sounds, copy files into ~/.dexto/sounds/ (subfolders ok) and set the *SoundFile
|
|
97
|
+
# keys to a relative path. Supported audio formats vary by OS (Windows reliably supports .wav).
|
|
87
98
|
|
|
88
99
|
`;
|
|
89
100
|
const AGENT_PREFERENCES_FILE_HEADER = `# Dexto Agent Preferences
|
|
@@ -238,8 +249,12 @@ function createInitialPreferences(options) {
|
|
|
238
249
|
},
|
|
239
250
|
sounds: {
|
|
240
251
|
enabled: options.sounds?.enabled ?? true,
|
|
252
|
+
onStartup: options.sounds?.onStartup ?? false,
|
|
253
|
+
...options.sounds?.startupSoundFile ? { startupSoundFile: options.sounds.startupSoundFile } : {},
|
|
241
254
|
onApprovalRequired: options.sounds?.onApprovalRequired ?? true,
|
|
242
|
-
|
|
255
|
+
...options.sounds?.approvalSoundFile ? { approvalSoundFile: options.sounds.approvalSoundFile } : {},
|
|
256
|
+
onTaskComplete: options.sounds?.onTaskComplete ?? true,
|
|
257
|
+
...options.sounds?.completeSoundFile ? { completeSoundFile: options.sounds.completeSoundFile } : {}
|
|
243
258
|
}
|
|
244
259
|
};
|
|
245
260
|
}
|
|
@@ -64,8 +64,12 @@ export interface CreatePreferencesOptions {
|
|
|
64
64
|
/** Sound notification preferences */
|
|
65
65
|
sounds?: {
|
|
66
66
|
enabled?: boolean;
|
|
67
|
+
onStartup?: boolean;
|
|
68
|
+
startupSoundFile?: string;
|
|
67
69
|
onApprovalRequired?: boolean;
|
|
70
|
+
approvalSoundFile?: string;
|
|
68
71
|
onTaskComplete?: boolean;
|
|
72
|
+
completeSoundFile?: string;
|
|
69
73
|
};
|
|
70
74
|
}
|
|
71
75
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"loader.d.ts","sourceRoot":"","sources":["../../src/preferences/loader.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,EAGH,KAAK,gBAAgB,EACrB,KAAK,iBAAiB,EACzB,MAAM,cAAc,CAAC;AAItB;;;;;GAKG;AACH,wBAAsB,qBAAqB,IAAI,OAAO,CAAC,iBAAiB,CAAC,CA+BxE;
|
|
1
|
+
{"version":3,"file":"loader.d.ts","sourceRoot":"","sources":["../../src/preferences/loader.ts"],"names":[],"mappings":"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"}
|
|
@@ -39,11 +39,22 @@ const PREFERENCES_FILE_HEADER = `# Dexto Global Preferences
|
|
|
39
39
|
# Documentation: https://dexto.dev/docs/configuration/preferences
|
|
40
40
|
#
|
|
41
41
|
# Sound Notifications:
|
|
42
|
-
# Dexto plays sounds for approval requests and task completion.
|
|
43
|
-
#
|
|
44
|
-
#
|
|
45
|
-
#
|
|
46
|
-
#
|
|
42
|
+
# Dexto plays sounds for CLI startup, approval requests, and task completion.
|
|
43
|
+
# Configure which events play sounds:
|
|
44
|
+
# sounds.enabled: true|false
|
|
45
|
+
# sounds.onStartup: true|false
|
|
46
|
+
# sounds.onApprovalRequired: true|false
|
|
47
|
+
# sounds.onTaskComplete: true|false
|
|
48
|
+
#
|
|
49
|
+
# Select sound files (paths are relative to ~/.dexto/sounds):
|
|
50
|
+
# sounds.startupSoundFile: builtins/startup.wav
|
|
51
|
+
# sounds.approvalSoundFile: builtins/coin.wav
|
|
52
|
+
# sounds.completeSoundFile: builtins/success.wav
|
|
53
|
+
#
|
|
54
|
+
# Tip: Use the /sounds overlay to preview and pick sounds.
|
|
55
|
+
#
|
|
56
|
+
# To use custom sounds, copy files into ~/.dexto/sounds/ (subfolders ok) and set the *SoundFile
|
|
57
|
+
# keys to a relative path. Supported audio formats vary by OS (Windows reliably supports .wav).
|
|
47
58
|
|
|
48
59
|
`;
|
|
49
60
|
const AGENT_PREFERENCES_FILE_HEADER = `# Dexto Agent Preferences
|
|
@@ -198,8 +209,12 @@ function createInitialPreferences(options) {
|
|
|
198
209
|
},
|
|
199
210
|
sounds: {
|
|
200
211
|
enabled: options.sounds?.enabled ?? true,
|
|
212
|
+
onStartup: options.sounds?.onStartup ?? false,
|
|
213
|
+
...options.sounds?.startupSoundFile ? { startupSoundFile: options.sounds.startupSoundFile } : {},
|
|
201
214
|
onApprovalRequired: options.sounds?.onApprovalRequired ?? true,
|
|
202
|
-
|
|
215
|
+
...options.sounds?.approvalSoundFile ? { approvalSoundFile: options.sounds.approvalSoundFile } : {},
|
|
216
|
+
onTaskComplete: options.sounds?.onTaskComplete ?? true,
|
|
217
|
+
...options.sounds?.completeSoundFile ? { completeSoundFile: options.sounds.completeSoundFile } : {}
|
|
203
218
|
}
|
|
204
219
|
};
|
|
205
220
|
}
|
|
@@ -85,10 +85,14 @@ const PreferenceSetupSchema = import_zod.z.object({
|
|
|
85
85
|
}).strict();
|
|
86
86
|
const PreferenceSoundsSchema = import_zod.z.object({
|
|
87
87
|
enabled: import_zod.z.boolean().default(true).describe("Enable sound notifications (default: true)"),
|
|
88
|
+
onStartup: import_zod.z.boolean().default(false).describe("Play sound when the interactive CLI starts (default: false)"),
|
|
89
|
+
startupSoundFile: import_zod.z.string().min(1).optional().describe("Startup sound file path relative to ~/.dexto/sounds (optional)"),
|
|
88
90
|
onApprovalRequired: import_zod.z.boolean().default(true).describe(
|
|
89
91
|
"Play sound when tool approval is required (default: true when sounds enabled)"
|
|
90
92
|
),
|
|
91
|
-
|
|
93
|
+
approvalSoundFile: import_zod.z.string().min(1).optional().describe("Approval sound file path relative to ~/.dexto/sounds (optional)"),
|
|
94
|
+
onTaskComplete: import_zod.z.boolean().default(true).describe("Play sound when agent task completes (default: true when sounds enabled)"),
|
|
95
|
+
completeSoundFile: import_zod.z.string().min(1).optional().describe("Completion sound file path relative to ~/.dexto/sounds (optional)")
|
|
92
96
|
}).strict();
|
|
93
97
|
const AgentToolPreferencesSchema = import_zod.z.object({
|
|
94
98
|
disabled: import_zod.z.array(import_core3.NonEmptyTrimmed).default([]).describe("Tool names disabled for this agent (default: none)")
|
|
@@ -55,16 +55,28 @@ export declare const PreferenceSetupSchema: z.ZodObject<{
|
|
|
55
55
|
}>;
|
|
56
56
|
export declare const PreferenceSoundsSchema: z.ZodObject<{
|
|
57
57
|
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
58
|
+
onStartup: z.ZodDefault<z.ZodBoolean>;
|
|
59
|
+
startupSoundFile: z.ZodOptional<z.ZodString>;
|
|
58
60
|
onApprovalRequired: z.ZodDefault<z.ZodBoolean>;
|
|
61
|
+
approvalSoundFile: z.ZodOptional<z.ZodString>;
|
|
59
62
|
onTaskComplete: z.ZodDefault<z.ZodBoolean>;
|
|
63
|
+
completeSoundFile: z.ZodOptional<z.ZodString>;
|
|
60
64
|
}, "strict", z.ZodTypeAny, {
|
|
61
65
|
enabled: boolean;
|
|
66
|
+
onStartup: boolean;
|
|
62
67
|
onApprovalRequired: boolean;
|
|
63
68
|
onTaskComplete: boolean;
|
|
69
|
+
startupSoundFile?: string | undefined;
|
|
70
|
+
approvalSoundFile?: string | undefined;
|
|
71
|
+
completeSoundFile?: string | undefined;
|
|
64
72
|
}, {
|
|
65
73
|
enabled?: boolean | undefined;
|
|
74
|
+
onStartup?: boolean | undefined;
|
|
75
|
+
startupSoundFile?: string | undefined;
|
|
66
76
|
onApprovalRequired?: boolean | undefined;
|
|
77
|
+
approvalSoundFile?: string | undefined;
|
|
67
78
|
onTaskComplete?: boolean | undefined;
|
|
79
|
+
completeSoundFile?: string | undefined;
|
|
68
80
|
}>;
|
|
69
81
|
export declare const AgentToolPreferencesSchema: z.ZodObject<{
|
|
70
82
|
disabled: z.ZodDefault<z.ZodArray<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>, "many">>;
|
|
@@ -147,16 +159,28 @@ export declare const GlobalPreferencesSchema: z.ZodObject<{
|
|
|
147
159
|
}>>;
|
|
148
160
|
sounds: z.ZodDefault<z.ZodObject<{
|
|
149
161
|
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
162
|
+
onStartup: z.ZodDefault<z.ZodBoolean>;
|
|
163
|
+
startupSoundFile: z.ZodOptional<z.ZodString>;
|
|
150
164
|
onApprovalRequired: z.ZodDefault<z.ZodBoolean>;
|
|
165
|
+
approvalSoundFile: z.ZodOptional<z.ZodString>;
|
|
151
166
|
onTaskComplete: z.ZodDefault<z.ZodBoolean>;
|
|
167
|
+
completeSoundFile: z.ZodOptional<z.ZodString>;
|
|
152
168
|
}, "strict", z.ZodTypeAny, {
|
|
153
169
|
enabled: boolean;
|
|
170
|
+
onStartup: boolean;
|
|
154
171
|
onApprovalRequired: boolean;
|
|
155
172
|
onTaskComplete: boolean;
|
|
173
|
+
startupSoundFile?: string | undefined;
|
|
174
|
+
approvalSoundFile?: string | undefined;
|
|
175
|
+
completeSoundFile?: string | undefined;
|
|
156
176
|
}, {
|
|
157
177
|
enabled?: boolean | undefined;
|
|
178
|
+
onStartup?: boolean | undefined;
|
|
179
|
+
startupSoundFile?: string | undefined;
|
|
158
180
|
onApprovalRequired?: boolean | undefined;
|
|
181
|
+
approvalSoundFile?: string | undefined;
|
|
159
182
|
onTaskComplete?: boolean | undefined;
|
|
183
|
+
completeSoundFile?: string | undefined;
|
|
160
184
|
}>>;
|
|
161
185
|
}, "strict", z.ZodTypeAny, {
|
|
162
186
|
llm: {
|
|
@@ -177,8 +201,12 @@ export declare const GlobalPreferencesSchema: z.ZodObject<{
|
|
|
177
201
|
};
|
|
178
202
|
sounds: {
|
|
179
203
|
enabled: boolean;
|
|
204
|
+
onStartup: boolean;
|
|
180
205
|
onApprovalRequired: boolean;
|
|
181
206
|
onTaskComplete: boolean;
|
|
207
|
+
startupSoundFile?: string | undefined;
|
|
208
|
+
approvalSoundFile?: string | undefined;
|
|
209
|
+
completeSoundFile?: string | undefined;
|
|
182
210
|
};
|
|
183
211
|
}, {
|
|
184
212
|
llm: {
|
|
@@ -199,8 +227,12 @@ export declare const GlobalPreferencesSchema: z.ZodObject<{
|
|
|
199
227
|
} | undefined;
|
|
200
228
|
sounds?: {
|
|
201
229
|
enabled?: boolean | undefined;
|
|
230
|
+
onStartup?: boolean | undefined;
|
|
231
|
+
startupSoundFile?: string | undefined;
|
|
202
232
|
onApprovalRequired?: boolean | undefined;
|
|
233
|
+
approvalSoundFile?: string | undefined;
|
|
203
234
|
onTaskComplete?: boolean | undefined;
|
|
235
|
+
completeSoundFile?: string | undefined;
|
|
204
236
|
} | undefined;
|
|
205
237
|
}>;
|
|
206
238
|
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
|
|
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;;;;;;;;;;;;;;;;;;;;;;;;EAiCtB,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"}
|
|
@@ -62,10 +62,14 @@ const PreferenceSetupSchema = z.object({
|
|
|
62
62
|
}).strict();
|
|
63
63
|
const PreferenceSoundsSchema = z.object({
|
|
64
64
|
enabled: z.boolean().default(true).describe("Enable sound notifications (default: true)"),
|
|
65
|
+
onStartup: z.boolean().default(false).describe("Play sound when the interactive CLI starts (default: false)"),
|
|
66
|
+
startupSoundFile: z.string().min(1).optional().describe("Startup sound file path relative to ~/.dexto/sounds (optional)"),
|
|
65
67
|
onApprovalRequired: z.boolean().default(true).describe(
|
|
66
68
|
"Play sound when tool approval is required (default: true when sounds enabled)"
|
|
67
69
|
),
|
|
68
|
-
|
|
70
|
+
approvalSoundFile: z.string().min(1).optional().describe("Approval sound file path relative to ~/.dexto/sounds (optional)"),
|
|
71
|
+
onTaskComplete: z.boolean().default(true).describe("Play sound when agent task completes (default: true when sounds enabled)"),
|
|
72
|
+
completeSoundFile: z.string().min(1).optional().describe("Completion sound file path relative to ~/.dexto/sounds (optional)")
|
|
69
73
|
}).strict();
|
|
70
74
|
const AgentToolPreferencesSchema = z.object({
|
|
71
75
|
disabled: z.array(NonEmptyTrimmed).default([]).describe("Tool names disabled for this agent (default: none)")
|
package/dist/registry/types.cjs
CHANGED
|
@@ -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
|
}
|
package/dist/registry/types.d.ts
CHANGED
|
@@ -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
|
|
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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAYxB,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,CA0C/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;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"}
|
package/dist/registry/types.js
CHANGED
|
@@ -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: {
|
|
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
|
-
|
|
122
|
-
response = await
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
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,EAAE,WAAW,GAAG,OAAO,CAAC,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"AgentRuntime.d.ts","sourceRoot":"","sources":["../../src/runtime/AgentRuntime.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAGH,OAAO,KAAK,EAAE,MAAM,EAAoB,MAAM,aAAa,CAAC;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;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: {
|
|
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
|
-
|
|
99
|
-
response = await
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
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
|
-
|
|
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;
|
|
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
|
-
|
|
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);
|
package/dist/runtime/schemas.cjs
CHANGED
|
@@ -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().
|
|
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"),
|
package/dist/runtime/schemas.js
CHANGED
|
@@ -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().
|
|
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"),
|