@dexto/agent-management 1.5.6 → 1.5.8
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 +72 -21
- package/dist/config/config-enrichment.d.ts +10 -2
- package/dist/config/config-enrichment.d.ts.map +1 -1
- package/dist/config/config-enrichment.js +76 -21
- package/dist/config/discover-prompts.cjs +1 -1
- package/dist/config/discover-prompts.d.ts +11 -11
- package/dist/config/discover-prompts.d.ts.map +1 -1
- package/dist/config/discover-prompts.js +1 -1
- package/dist/config/loader.cjs +31 -13
- package/dist/config/loader.d.ts.map +1 -1
- package/dist/config/loader.js +31 -13
- package/dist/index.cjs +76 -0
- package/dist/index.d.ts +5 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +78 -0
- package/dist/models/custom-models.cjs +2 -1
- package/dist/models/custom-models.d.ts +7 -6
- package/dist/models/custom-models.d.ts.map +1 -1
- package/dist/models/custom-models.js +2 -1
- package/dist/plugins/discover-plugins.cjs +176 -0
- package/dist/plugins/discover-plugins.d.ts +39 -0
- package/dist/plugins/discover-plugins.d.ts.map +1 -0
- package/dist/plugins/discover-plugins.js +140 -0
- package/dist/plugins/discover-skills.cjs +93 -0
- package/dist/plugins/discover-skills.d.ts +49 -0
- package/dist/plugins/discover-skills.d.ts.map +1 -0
- package/dist/plugins/discover-skills.js +58 -0
- package/dist/plugins/error-codes.cjs +47 -0
- package/dist/plugins/error-codes.d.ts +24 -0
- package/dist/plugins/error-codes.d.ts.map +1 -0
- package/dist/plugins/error-codes.js +23 -0
- package/dist/plugins/errors.cjs +197 -0
- package/dist/plugins/errors.d.ts +68 -0
- package/dist/plugins/errors.d.ts.map +1 -0
- package/dist/plugins/errors.js +173 -0
- package/dist/plugins/index.cjs +144 -0
- package/dist/plugins/index.d.ts +23 -0
- package/dist/plugins/index.d.ts.map +1 -0
- package/dist/plugins/index.js +115 -0
- package/dist/plugins/install-plugin.cjs +211 -0
- package/dist/plugins/install-plugin.d.ts +47 -0
- package/dist/plugins/install-plugin.d.ts.map +1 -0
- package/dist/plugins/install-plugin.js +173 -0
- package/dist/plugins/list-plugins.cjs +134 -0
- package/dist/plugins/list-plugins.d.ts +26 -0
- package/dist/plugins/list-plugins.d.ts.map +1 -0
- package/dist/plugins/list-plugins.js +99 -0
- package/dist/plugins/load-plugin.cjs +197 -0
- package/dist/plugins/load-plugin.d.ts +20 -0
- package/dist/plugins/load-plugin.d.ts.map +1 -0
- package/dist/plugins/load-plugin.js +163 -0
- package/dist/plugins/marketplace/error-codes.cjs +45 -0
- package/dist/plugins/marketplace/error-codes.d.ts +21 -0
- package/dist/plugins/marketplace/error-codes.d.ts.map +1 -0
- package/dist/plugins/marketplace/error-codes.js +21 -0
- package/dist/plugins/marketplace/errors.cjs +188 -0
- package/dist/plugins/marketplace/errors.d.ts +64 -0
- package/dist/plugins/marketplace/errors.d.ts.map +1 -0
- package/dist/plugins/marketplace/errors.js +164 -0
- package/dist/plugins/marketplace/index.cjs +95 -0
- package/dist/plugins/marketplace/index.d.ts +14 -0
- package/dist/plugins/marketplace/index.d.ts.map +1 -0
- package/dist/plugins/marketplace/index.js +74 -0
- package/dist/plugins/marketplace/install-from-marketplace.cjs +152 -0
- package/dist/plugins/marketplace/install-from-marketplace.d.ts +25 -0
- package/dist/plugins/marketplace/install-from-marketplace.d.ts.map +1 -0
- package/dist/plugins/marketplace/install-from-marketplace.js +120 -0
- package/dist/plugins/marketplace/operations.cjs +374 -0
- package/dist/plugins/marketplace/operations.d.ts +43 -0
- package/dist/plugins/marketplace/operations.d.ts.map +1 -0
- package/dist/plugins/marketplace/operations.js +339 -0
- package/dist/plugins/marketplace/registry.cjs +166 -0
- package/dist/plugins/marketplace/registry.d.ts +72 -0
- package/dist/plugins/marketplace/registry.d.ts.map +1 -0
- package/dist/plugins/marketplace/registry.js +119 -0
- package/dist/plugins/marketplace/schemas.cjs +79 -0
- package/dist/plugins/marketplace/schemas.d.ts +260 -0
- package/dist/plugins/marketplace/schemas.d.ts.map +1 -0
- package/dist/plugins/marketplace/schemas.js +49 -0
- package/dist/plugins/marketplace/types.cjs +16 -0
- package/dist/plugins/marketplace/types.d.ts +156 -0
- package/dist/plugins/marketplace/types.d.ts.map +1 -0
- package/dist/plugins/marketplace/types.js +0 -0
- package/dist/plugins/schemas.cjs +74 -0
- package/dist/plugins/schemas.d.ts +262 -0
- package/dist/plugins/schemas.d.ts.map +1 -0
- package/dist/plugins/schemas.js +46 -0
- package/dist/plugins/types.cjs +16 -0
- package/dist/plugins/types.d.ts +186 -0
- package/dist/plugins/types.d.ts.map +1 -0
- package/dist/plugins/types.js +0 -0
- package/dist/plugins/uninstall-plugin.cjs +133 -0
- package/dist/plugins/uninstall-plugin.d.ts +24 -0
- package/dist/plugins/uninstall-plugin.d.ts.map +1 -0
- package/dist/plugins/uninstall-plugin.js +99 -0
- package/dist/plugins/validate-plugin.cjs +180 -0
- package/dist/plugins/validate-plugin.d.ts +53 -0
- package/dist/plugins/validate-plugin.d.ts.map +1 -0
- package/dist/plugins/validate-plugin.js +145 -0
- 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/runtime/AgentRuntime.cjs +1 -2
- package/dist/runtime/AgentRuntime.d.ts.map +1 -1
- package/dist/runtime/AgentRuntime.js +1 -2
- package/dist/tool-provider/llm-resolution.cjs +74 -0
- package/dist/tool-provider/llm-resolution.d.ts +51 -0
- package/dist/tool-provider/llm-resolution.d.ts.map +1 -0
- package/dist/tool-provider/llm-resolution.js +50 -0
- package/dist/tool-provider/runtime-service.cjs +246 -34
- package/dist/tool-provider/runtime-service.d.ts +34 -2
- package/dist/tool-provider/runtime-service.d.ts.map +1 -1
- package/dist/tool-provider/runtime-service.js +236 -34
- package/dist/tool-provider/tool-provider.cjs +154 -1
- package/dist/tool-provider/tool-provider.d.ts +7 -1
- package/dist/tool-provider/tool-provider.d.ts.map +1 -1
- package/dist/tool-provider/tool-provider.js +161 -1
- package/dist/tool-provider/types.d.ts +2 -0
- package/dist/tool-provider/types.d.ts.map +1 -1
- package/dist/utils/api-key-resolver.cjs +5 -2
- package/dist/utils/api-key-resolver.d.ts.map +1 -1
- package/dist/utils/api-key-resolver.js +5 -2
- package/dist/utils/dexto-auth.cjs +83 -0
- package/dist/utils/dexto-auth.d.ts +23 -0
- package/dist/utils/dexto-auth.d.ts.map +1 -0
- package/dist/utils/dexto-auth.js +57 -0
- package/dist/utils/feature-flags.cjs +32 -0
- package/dist/utils/feature-flags.d.ts +21 -0
- package/dist/utils/feature-flags.d.ts.map +1 -0
- package/dist/utils/feature-flags.js +8 -0
- package/package.json +3 -2
|
@@ -42,6 +42,17 @@ class PreferenceError {
|
|
|
42
42
|
}));
|
|
43
43
|
return new DextoValidationError(issues);
|
|
44
44
|
}
|
|
45
|
+
static invalidAgentId(agentId) {
|
|
46
|
+
return new DextoValidationError([
|
|
47
|
+
{
|
|
48
|
+
code: PreferenceErrorCode.INVALID_PREFERENCE_VALUE,
|
|
49
|
+
message: `agentId is invalid: ${agentId}`,
|
|
50
|
+
scope: "preference",
|
|
51
|
+
type: ErrorType.USER,
|
|
52
|
+
severity: "error"
|
|
53
|
+
}
|
|
54
|
+
]);
|
|
55
|
+
}
|
|
45
56
|
}
|
|
46
57
|
export {
|
|
47
58
|
PreferenceError,
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
2
3
|
var __defProp = Object.defineProperty;
|
|
3
4
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
5
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
5
7
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
8
|
var __export = (target, all) => {
|
|
7
9
|
for (var name in all)
|
|
@@ -15,28 +17,42 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
15
17
|
}
|
|
16
18
|
return to;
|
|
17
19
|
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
18
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
29
|
var loader_exports = {};
|
|
20
30
|
__export(loader_exports, {
|
|
31
|
+
agentPreferencesExist: () => agentPreferencesExist,
|
|
21
32
|
createInitialPreferences: () => createInitialPreferences,
|
|
33
|
+
getAgentPreferencesPath: () => getAgentPreferencesPath,
|
|
22
34
|
getGlobalPreferencesPath: () => getGlobalPreferencesPath,
|
|
23
35
|
globalPreferencesExist: () => globalPreferencesExist,
|
|
36
|
+
loadAgentPreferences: () => loadAgentPreferences,
|
|
24
37
|
loadGlobalPreferences: () => loadGlobalPreferences,
|
|
38
|
+
saveAgentPreferences: () => saveAgentPreferences,
|
|
25
39
|
saveGlobalPreferences: () => saveGlobalPreferences,
|
|
40
|
+
updateAgentPreferences: () => updateAgentPreferences,
|
|
26
41
|
updateGlobalPreferences: () => updateGlobalPreferences
|
|
27
42
|
});
|
|
28
43
|
module.exports = __toCommonJS(loader_exports);
|
|
29
44
|
var import_fs = require("fs");
|
|
30
45
|
var import_fs2 = require("fs");
|
|
31
46
|
var import_yaml = require("yaml");
|
|
32
|
-
var import_path = require("
|
|
47
|
+
var import_path = __toESM(require("path"), 1);
|
|
48
|
+
var import_path2 = require("../utils/path.js");
|
|
33
49
|
var import_core = require("@dexto/core");
|
|
34
50
|
var import_core2 = require("@dexto/core");
|
|
35
51
|
var import_schemas = require("./schemas.js");
|
|
36
52
|
var import_constants = require("./constants.js");
|
|
37
53
|
var import_errors = require("./errors.js");
|
|
38
54
|
async function loadGlobalPreferences() {
|
|
39
|
-
const preferencesPath = (0,
|
|
55
|
+
const preferencesPath = (0, import_path2.getDextoGlobalPath)(import_constants.PREFERENCES_FILE);
|
|
40
56
|
if (!(0, import_fs.existsSync)(preferencesPath)) {
|
|
41
57
|
throw import_errors.PreferenceError.fileNotFound(preferencesPath);
|
|
42
58
|
}
|
|
@@ -70,15 +86,107 @@ const PREFERENCES_FILE_HEADER = `# Dexto Global Preferences
|
|
|
70
86
|
# Set sounds.enabled: false to disable all sounds.
|
|
71
87
|
|
|
72
88
|
`;
|
|
89
|
+
const AGENT_PREFERENCES_FILE_HEADER = `# Dexto Agent Preferences
|
|
90
|
+
# Stored per-agent to customize runtime behavior without changing base config.
|
|
91
|
+
# Tool control:
|
|
92
|
+
# tools.disabled: list of tool names to exclude from LLM context.
|
|
93
|
+
|
|
94
|
+
`;
|
|
95
|
+
function getAgentPreferencesPath(agentId) {
|
|
96
|
+
if (!agentId || typeof agentId !== "string") {
|
|
97
|
+
throw import_errors.PreferenceError.invalidAgentId(String(agentId));
|
|
98
|
+
}
|
|
99
|
+
const trimmedId = agentId.trim();
|
|
100
|
+
if (!trimmedId) {
|
|
101
|
+
throw import_errors.PreferenceError.invalidAgentId(agentId);
|
|
102
|
+
}
|
|
103
|
+
const hasSeparators = trimmedId.includes("/") || trimmedId.includes("\\");
|
|
104
|
+
if (hasSeparators || trimmedId !== import_path.default.basename(trimmedId)) {
|
|
105
|
+
throw import_errors.PreferenceError.invalidAgentId(agentId);
|
|
106
|
+
}
|
|
107
|
+
const allowedPattern = /^[a-zA-Z0-9_-]+$/;
|
|
108
|
+
if (!allowedPattern.test(trimmedId)) {
|
|
109
|
+
throw import_errors.PreferenceError.invalidAgentId(agentId);
|
|
110
|
+
}
|
|
111
|
+
const filename = `${trimmedId}.preferences.yml`;
|
|
112
|
+
return (0, import_path2.getDextoGlobalPath)(import_path.default.join("agents", filename));
|
|
113
|
+
}
|
|
114
|
+
async function loadAgentPreferences(agentId) {
|
|
115
|
+
const preferencesPath = getAgentPreferencesPath(agentId);
|
|
116
|
+
if (!(0, import_fs.existsSync)(preferencesPath)) {
|
|
117
|
+
throw import_errors.PreferenceError.fileNotFound(preferencesPath);
|
|
118
|
+
}
|
|
119
|
+
try {
|
|
120
|
+
const fileContent = await import_fs2.promises.readFile(preferencesPath, "utf-8");
|
|
121
|
+
const rawPreferences = (0, import_yaml.parse)(fileContent);
|
|
122
|
+
const validation = import_schemas.AgentPreferencesSchema.safeParse(rawPreferences);
|
|
123
|
+
if (!validation.success) {
|
|
124
|
+
throw import_errors.PreferenceError.validationFailed(validation.error);
|
|
125
|
+
}
|
|
126
|
+
import_core.logger.debug(`Loaded agent preferences from: ${preferencesPath}`);
|
|
127
|
+
return validation.data;
|
|
128
|
+
} catch (error) {
|
|
129
|
+
if (error instanceof import_core2.DextoValidationError || error instanceof import_core2.DextoRuntimeError) {
|
|
130
|
+
throw error;
|
|
131
|
+
}
|
|
132
|
+
throw import_errors.PreferenceError.fileReadError(
|
|
133
|
+
preferencesPath,
|
|
134
|
+
error instanceof Error ? error.message : String(error)
|
|
135
|
+
);
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
async function saveAgentPreferences(agentId, preferences) {
|
|
139
|
+
const preferencesPath = getAgentPreferencesPath(agentId);
|
|
140
|
+
const validation = import_schemas.AgentPreferencesSchema.safeParse(preferences);
|
|
141
|
+
if (!validation.success) {
|
|
142
|
+
throw import_errors.PreferenceError.validationFailed(validation.error);
|
|
143
|
+
}
|
|
144
|
+
try {
|
|
145
|
+
import_core.logger.debug(`Saving agent preferences to: ${preferencesPath}`);
|
|
146
|
+
await import_fs2.promises.mkdir(import_path.default.dirname(preferencesPath), { recursive: true });
|
|
147
|
+
const yamlContent = (0, import_yaml.stringify)(preferences, {
|
|
148
|
+
indent: 2,
|
|
149
|
+
lineWidth: 100,
|
|
150
|
+
minContentWidth: 20
|
|
151
|
+
});
|
|
152
|
+
await import_fs2.promises.writeFile(preferencesPath, AGENT_PREFERENCES_FILE_HEADER + yamlContent, "utf-8");
|
|
153
|
+
import_core.logger.debug(
|
|
154
|
+
`\u2713 Saved agent preferences ${JSON.stringify(preferences)} to: ${preferencesPath}`
|
|
155
|
+
);
|
|
156
|
+
} catch (error) {
|
|
157
|
+
throw import_errors.PreferenceError.fileWriteError(
|
|
158
|
+
preferencesPath,
|
|
159
|
+
error instanceof Error ? error.message : String(error)
|
|
160
|
+
);
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
function agentPreferencesExist(agentId) {
|
|
164
|
+
const preferencesPath = getAgentPreferencesPath(agentId);
|
|
165
|
+
return (0, import_fs.existsSync)(preferencesPath);
|
|
166
|
+
}
|
|
167
|
+
async function updateAgentPreferences(agentId, updates) {
|
|
168
|
+
const existing = await loadAgentPreferences(agentId);
|
|
169
|
+
const merged = {
|
|
170
|
+
...existing,
|
|
171
|
+
...updates,
|
|
172
|
+
tools: updates.tools ? { ...existing.tools, ...updates.tools } : existing.tools
|
|
173
|
+
};
|
|
174
|
+
const validation = import_schemas.AgentPreferencesSchema.safeParse(merged);
|
|
175
|
+
if (!validation.success) {
|
|
176
|
+
throw import_errors.PreferenceError.validationFailed(validation.error);
|
|
177
|
+
}
|
|
178
|
+
await saveAgentPreferences(agentId, validation.data);
|
|
179
|
+
return validation.data;
|
|
180
|
+
}
|
|
73
181
|
async function saveGlobalPreferences(preferences) {
|
|
74
|
-
const preferencesPath = (0,
|
|
182
|
+
const preferencesPath = (0, import_path2.getDextoGlobalPath)(import_constants.PREFERENCES_FILE);
|
|
75
183
|
const validation = import_schemas.GlobalPreferencesSchema.safeParse(preferences);
|
|
76
184
|
if (!validation.success) {
|
|
77
185
|
throw import_errors.PreferenceError.validationFailed(validation.error);
|
|
78
186
|
}
|
|
79
187
|
try {
|
|
80
188
|
import_core.logger.debug(`Saving global preferences to: ${preferencesPath}`);
|
|
81
|
-
const dextoDir = (0,
|
|
189
|
+
const dextoDir = (0, import_path2.getDextoGlobalPath)("");
|
|
82
190
|
await import_fs2.promises.mkdir(dextoDir, { recursive: true });
|
|
83
191
|
const yamlContent = (0, import_yaml.stringify)(preferences, {
|
|
84
192
|
indent: 2,
|
|
@@ -97,11 +205,11 @@ async function saveGlobalPreferences(preferences) {
|
|
|
97
205
|
}
|
|
98
206
|
}
|
|
99
207
|
function globalPreferencesExist() {
|
|
100
|
-
const preferencesPath = (0,
|
|
208
|
+
const preferencesPath = (0, import_path2.getDextoGlobalPath)(import_constants.PREFERENCES_FILE);
|
|
101
209
|
return (0, import_fs.existsSync)(preferencesPath);
|
|
102
210
|
}
|
|
103
211
|
function getGlobalPreferencesPath() {
|
|
104
|
-
return (0,
|
|
212
|
+
return (0, import_path2.getDextoGlobalPath)(import_constants.PREFERENCES_FILE);
|
|
105
213
|
}
|
|
106
214
|
function createInitialPreferences(options) {
|
|
107
215
|
const llmConfig = {
|
|
@@ -156,10 +264,15 @@ async function updateGlobalPreferences(updates) {
|
|
|
156
264
|
}
|
|
157
265
|
// Annotate the CommonJS export names for ESM import in node:
|
|
158
266
|
0 && (module.exports = {
|
|
267
|
+
agentPreferencesExist,
|
|
159
268
|
createInitialPreferences,
|
|
269
|
+
getAgentPreferencesPath,
|
|
160
270
|
getGlobalPreferencesPath,
|
|
161
271
|
globalPreferencesExist,
|
|
272
|
+
loadAgentPreferences,
|
|
162
273
|
loadGlobalPreferences,
|
|
274
|
+
saveAgentPreferences,
|
|
163
275
|
saveGlobalPreferences,
|
|
276
|
+
updateAgentPreferences,
|
|
164
277
|
updateGlobalPreferences
|
|
165
278
|
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { LLMProvider } from '@dexto/core';
|
|
2
|
-
import { type GlobalPreferences } from './schemas.js';
|
|
2
|
+
import { type AgentPreferences, type GlobalPreferences } from './schemas.js';
|
|
3
3
|
/**
|
|
4
4
|
* Load global preferences from ~/.dexto/preferences.yml
|
|
5
5
|
* @returns Global preferences object
|
|
@@ -7,6 +7,26 @@ import { type GlobalPreferences } from './schemas.js';
|
|
|
7
7
|
* @throws DextoValidationError if preferences are invalid
|
|
8
8
|
*/
|
|
9
9
|
export declare function loadGlobalPreferences(): Promise<GlobalPreferences>;
|
|
10
|
+
/**
|
|
11
|
+
* Resolve the agent preferences file path for an agent ID.
|
|
12
|
+
*/
|
|
13
|
+
export declare function getAgentPreferencesPath(agentId: string): string;
|
|
14
|
+
/**
|
|
15
|
+
* Load agent preferences from ~/.dexto/agents/<agentId>.preferences.yml
|
|
16
|
+
*/
|
|
17
|
+
export declare function loadAgentPreferences(agentId: string): Promise<AgentPreferences>;
|
|
18
|
+
/**
|
|
19
|
+
* Save agent preferences to ~/.dexto/agents/<agentId>.preferences.yml
|
|
20
|
+
*/
|
|
21
|
+
export declare function saveAgentPreferences(agentId: string, preferences: AgentPreferences): Promise<void>;
|
|
22
|
+
/**
|
|
23
|
+
* Check if agent preferences exist (for first-time detection)
|
|
24
|
+
*/
|
|
25
|
+
export declare function agentPreferencesExist(agentId: string): boolean;
|
|
26
|
+
/**
|
|
27
|
+
* Update agent preferences with partial updates
|
|
28
|
+
*/
|
|
29
|
+
export declare function updateAgentPreferences(agentId: string, updates: Partial<AgentPreferences>): Promise<AgentPreferences>;
|
|
10
30
|
/**
|
|
11
31
|
* Save global preferences to ~/.dexto/preferences.yml
|
|
12
32
|
* @param preferences Validated preferences object
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"loader.d.ts","sourceRoot":"","sources":["../../src/preferences/loader.ts"],"names":[],"mappings":"
|
|
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;AA2BD;;GAEG;AACH,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAsB/D;AAED;;GAEG;AACH,wBAAsB,oBAAoB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,CAAC,CA4BrF;AAED;;GAEG;AACH,wBAAsB,oBAAoB,CACtC,OAAO,EAAE,MAAM,EACf,WAAW,EAAE,gBAAgB,GAC9B,OAAO,CAAC,IAAI,CAAC,CA8Bf;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAG9D;AAED;;GAEG;AACH,wBAAsB,sBAAsB,CACxC,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,OAAO,CAAC,gBAAgB,CAAC,GACnC,OAAO,CAAC,gBAAgB,CAAC,CAgB3B;AAED;;;;GAIG;AACH,wBAAsB,qBAAqB,CAAC,WAAW,EAAE,iBAAiB,GAAG,OAAO,CAAC,IAAI,CAAC,CAkCzF;AAED;;;GAGG;AACH,wBAAgB,sBAAsB,IAAI,OAAO,CAGhD;AAED;;;GAGG;AACH,wBAAgB,wBAAwB,IAAI,MAAM,CAEjD;AAED;;GAEG;AACH,MAAM,WAAW,wBAAwB;IACrC,QAAQ,EAAE,WAAW,CAAC;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,gFAAgF;IAChF,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,WAAW,CAAC,EAAE,KAAK,GAAG,KAAK,GAAG,QAAQ,GAAG,SAAS,GAAG,UAAU,GAAG,KAAK,CAAC;IACxE,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,4EAA4E;IAC5E,eAAe,CAAC,EAAE,MAAM,GAAG,SAAS,GAAG,KAAK,GAAG,QAAQ,GAAG,MAAM,GAAG,OAAO,CAAC;IAC3E,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,yEAAyE;IACzE,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,yEAAyE;IACzE,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,qCAAqC;IACrC,MAAM,CAAC,EAAE;QACL,OAAO,CAAC,EAAE,OAAO,CAAC;QAClB,kBAAkB,CAAC,EAAE,OAAO,CAAC;QAC7B,cAAc,CAAC,EAAE,OAAO,CAAC;KAC5B,CAAC;CACL;AAED;;;GAGG;AACH,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,wBAAwB,GAAG,iBAAiB,CAsC7F;AAED;;GAEG;AACH,MAAM,MAAM,wBAAwB,GAAG;IACnC,GAAG,CAAC,EAAE,iBAAiB,CAAC,KAAK,CAAC,CAAC;IAC/B,QAAQ,CAAC,EAAE,OAAO,CAAC,iBAAiB,CAAC,UAAU,CAAC,CAAC,CAAC;IAClD,KAAK,CAAC,EAAE,OAAO,CAAC,iBAAiB,CAAC,OAAO,CAAC,CAAC,CAAC;IAC5C,MAAM,CAAC,EAAE,OAAO,CAAC,iBAAiB,CAAC,QAAQ,CAAC,CAAC,CAAC;CACjD,CAAC;AAEF;;;;;;GAMG;AACH,wBAAsB,uBAAuB,CACzC,OAAO,EAAE,wBAAwB,GAClC,OAAO,CAAC,iBAAiB,CAAC,CA4B5B"}
|
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
import { existsSync } from "fs";
|
|
2
2
|
import { promises as fs } from "fs";
|
|
3
3
|
import { parse as parseYaml, stringify as stringifyYaml } from "yaml";
|
|
4
|
+
import path from "path";
|
|
4
5
|
import { getDextoGlobalPath } from "../utils/path.js";
|
|
5
6
|
import { logger } from "@dexto/core";
|
|
6
7
|
import { DextoValidationError, DextoRuntimeError } from "@dexto/core";
|
|
7
|
-
import {
|
|
8
|
+
import {
|
|
9
|
+
AgentPreferencesSchema,
|
|
10
|
+
GlobalPreferencesSchema
|
|
11
|
+
} from "./schemas.js";
|
|
8
12
|
import { PREFERENCES_FILE } from "./constants.js";
|
|
9
13
|
import { PreferenceError } from "./errors.js";
|
|
10
14
|
async function loadGlobalPreferences() {
|
|
@@ -42,6 +46,98 @@ const PREFERENCES_FILE_HEADER = `# Dexto Global Preferences
|
|
|
42
46
|
# Set sounds.enabled: false to disable all sounds.
|
|
43
47
|
|
|
44
48
|
`;
|
|
49
|
+
const AGENT_PREFERENCES_FILE_HEADER = `# Dexto Agent Preferences
|
|
50
|
+
# Stored per-agent to customize runtime behavior without changing base config.
|
|
51
|
+
# Tool control:
|
|
52
|
+
# tools.disabled: list of tool names to exclude from LLM context.
|
|
53
|
+
|
|
54
|
+
`;
|
|
55
|
+
function getAgentPreferencesPath(agentId) {
|
|
56
|
+
if (!agentId || typeof agentId !== "string") {
|
|
57
|
+
throw PreferenceError.invalidAgentId(String(agentId));
|
|
58
|
+
}
|
|
59
|
+
const trimmedId = agentId.trim();
|
|
60
|
+
if (!trimmedId) {
|
|
61
|
+
throw PreferenceError.invalidAgentId(agentId);
|
|
62
|
+
}
|
|
63
|
+
const hasSeparators = trimmedId.includes("/") || trimmedId.includes("\\");
|
|
64
|
+
if (hasSeparators || trimmedId !== path.basename(trimmedId)) {
|
|
65
|
+
throw PreferenceError.invalidAgentId(agentId);
|
|
66
|
+
}
|
|
67
|
+
const allowedPattern = /^[a-zA-Z0-9_-]+$/;
|
|
68
|
+
if (!allowedPattern.test(trimmedId)) {
|
|
69
|
+
throw PreferenceError.invalidAgentId(agentId);
|
|
70
|
+
}
|
|
71
|
+
const filename = `${trimmedId}.preferences.yml`;
|
|
72
|
+
return getDextoGlobalPath(path.join("agents", filename));
|
|
73
|
+
}
|
|
74
|
+
async function loadAgentPreferences(agentId) {
|
|
75
|
+
const preferencesPath = getAgentPreferencesPath(agentId);
|
|
76
|
+
if (!existsSync(preferencesPath)) {
|
|
77
|
+
throw PreferenceError.fileNotFound(preferencesPath);
|
|
78
|
+
}
|
|
79
|
+
try {
|
|
80
|
+
const fileContent = await fs.readFile(preferencesPath, "utf-8");
|
|
81
|
+
const rawPreferences = parseYaml(fileContent);
|
|
82
|
+
const validation = AgentPreferencesSchema.safeParse(rawPreferences);
|
|
83
|
+
if (!validation.success) {
|
|
84
|
+
throw PreferenceError.validationFailed(validation.error);
|
|
85
|
+
}
|
|
86
|
+
logger.debug(`Loaded agent preferences from: ${preferencesPath}`);
|
|
87
|
+
return validation.data;
|
|
88
|
+
} catch (error) {
|
|
89
|
+
if (error instanceof DextoValidationError || error instanceof DextoRuntimeError) {
|
|
90
|
+
throw error;
|
|
91
|
+
}
|
|
92
|
+
throw PreferenceError.fileReadError(
|
|
93
|
+
preferencesPath,
|
|
94
|
+
error instanceof Error ? error.message : String(error)
|
|
95
|
+
);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
async function saveAgentPreferences(agentId, preferences) {
|
|
99
|
+
const preferencesPath = getAgentPreferencesPath(agentId);
|
|
100
|
+
const validation = AgentPreferencesSchema.safeParse(preferences);
|
|
101
|
+
if (!validation.success) {
|
|
102
|
+
throw PreferenceError.validationFailed(validation.error);
|
|
103
|
+
}
|
|
104
|
+
try {
|
|
105
|
+
logger.debug(`Saving agent preferences to: ${preferencesPath}`);
|
|
106
|
+
await fs.mkdir(path.dirname(preferencesPath), { recursive: true });
|
|
107
|
+
const yamlContent = stringifyYaml(preferences, {
|
|
108
|
+
indent: 2,
|
|
109
|
+
lineWidth: 100,
|
|
110
|
+
minContentWidth: 20
|
|
111
|
+
});
|
|
112
|
+
await fs.writeFile(preferencesPath, AGENT_PREFERENCES_FILE_HEADER + yamlContent, "utf-8");
|
|
113
|
+
logger.debug(
|
|
114
|
+
`\u2713 Saved agent preferences ${JSON.stringify(preferences)} to: ${preferencesPath}`
|
|
115
|
+
);
|
|
116
|
+
} catch (error) {
|
|
117
|
+
throw PreferenceError.fileWriteError(
|
|
118
|
+
preferencesPath,
|
|
119
|
+
error instanceof Error ? error.message : String(error)
|
|
120
|
+
);
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
function agentPreferencesExist(agentId) {
|
|
124
|
+
const preferencesPath = getAgentPreferencesPath(agentId);
|
|
125
|
+
return existsSync(preferencesPath);
|
|
126
|
+
}
|
|
127
|
+
async function updateAgentPreferences(agentId, updates) {
|
|
128
|
+
const existing = await loadAgentPreferences(agentId);
|
|
129
|
+
const merged = {
|
|
130
|
+
...existing,
|
|
131
|
+
...updates,
|
|
132
|
+
tools: updates.tools ? { ...existing.tools, ...updates.tools } : existing.tools
|
|
133
|
+
};
|
|
134
|
+
const validation = AgentPreferencesSchema.safeParse(merged);
|
|
135
|
+
if (!validation.success) {
|
|
136
|
+
throw PreferenceError.validationFailed(validation.error);
|
|
137
|
+
}
|
|
138
|
+
await saveAgentPreferences(agentId, validation.data);
|
|
139
|
+
return validation.data;
|
|
140
|
+
}
|
|
45
141
|
async function saveGlobalPreferences(preferences) {
|
|
46
142
|
const preferencesPath = getDextoGlobalPath(PREFERENCES_FILE);
|
|
47
143
|
const validation = GlobalPreferencesSchema.safeParse(preferences);
|
|
@@ -127,10 +223,15 @@ async function updateGlobalPreferences(updates) {
|
|
|
127
223
|
return validation.data;
|
|
128
224
|
}
|
|
129
225
|
export {
|
|
226
|
+
agentPreferencesExist,
|
|
130
227
|
createInitialPreferences,
|
|
228
|
+
getAgentPreferencesPath,
|
|
131
229
|
getGlobalPreferencesPath,
|
|
132
230
|
globalPreferencesExist,
|
|
231
|
+
loadAgentPreferences,
|
|
133
232
|
loadGlobalPreferences,
|
|
233
|
+
saveAgentPreferences,
|
|
134
234
|
saveGlobalPreferences,
|
|
235
|
+
updateAgentPreferences,
|
|
135
236
|
updateGlobalPreferences
|
|
136
237
|
};
|
|
@@ -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", "openrouter", "litellm", "glama", "vertex", "bedrock", "local", "ollama"]>;
|
|
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: "openai" | "openai-compatible" | "anthropic" | "google" | "groq" | "xai" | "cohere" | "openrouter" | "litellm" | "glama" | "vertex" | "bedrock" | "local" | "ollama";
|
|
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: "openai" | "openai-compatible" | "anthropic" | "google" | "groq" | "xai" | "cohere" | "openrouter" | "litellm" | "glama" | "vertex" | "bedrock" | "local" | "ollama";
|
|
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: "openai" | "openai-compatible" | "anthropic" | "google" | "groq" | "xai" | "cohere" | "openrouter" | "litellm" | "glama" | "vertex" | "bedrock" | "local" | "ollama";
|
|
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: "openai" | "openai-compatible" | "anthropic" | "google" | "groq" | "xai" | "cohere" | "openrouter" | "litellm" | "glama" | "vertex" | "bedrock" | "local" | "ollama";
|
|
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", "openrouter", "litellm", "glama", "vertex", "bedrock", "local", "ollama"]>;
|
|
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: "openai" | "openai-compatible" | "anthropic" | "google" | "groq" | "xai" | "cohere" | "openrouter" | "litellm" | "glama" | "vertex" | "bedrock" | "local" | "ollama";
|
|
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: "openai" | "openai-compatible" | "anthropic" | "google" | "groq" | "xai" | "cohere" | "openrouter" | "litellm" | "glama" | "vertex" | "bedrock" | "local" | "ollama";
|
|
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: "openai" | "openai-compatible" | "anthropic" | "google" | "groq" | "xai" | "cohere" | "openrouter" | "litellm" | "glama" | "vertex" | "bedrock" | "local" | "ollama";
|
|
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: "openai" | "openai-compatible" | "anthropic" | "google" | "groq" | "xai" | "cohere" | "openrouter" | "litellm" | "glama" | "vertex" | "bedrock" | "local" | "ollama";
|
|
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: "openai" | "openai-compatible" | "anthropic" | "google" | "groq" | "xai" | "cohere" | "openrouter" | "litellm" | "glama" | "vertex" | "bedrock" | "local" | "ollama";
|
|
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: "openai" | "openai-compatible" | "anthropic" | "google" | "groq" | "xai" | "cohere" | "openrouter" | "litellm" | "glama" | "vertex" | "bedrock" | "local" | "ollama";
|
|
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,
|
|
@@ -59,8 +59,7 @@ class AgentRuntime {
|
|
|
59
59
|
config.agentConfig,
|
|
60
60
|
void 0,
|
|
61
61
|
// No config path
|
|
62
|
-
false
|
|
63
|
-
// Not interactive CLI
|
|
62
|
+
{ isInteractiveCli: false, skipPluginDiscovery: true }
|
|
64
63
|
);
|
|
65
64
|
enrichedConfig.agentId = agentId;
|
|
66
65
|
const agent = new import_core.DextoAgent(enrichedConfig);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AgentRuntime.d.ts","sourceRoot":"","sources":["../../src/runtime/AgentRuntime.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAGH,OAAO,EAAc,KAAK,YAAY,EAAyB,MAAM,aAAa,CAAC;AAInF,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;AAE1F;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAChC,4BAA4B;IAC5B,MAAM,CAAC,EAAE,kBAAkB,CAAC;IAC5B,sBAAsB;IACtB,MAAM,EAAE,YAAY,CAAC;CACxB;AAED,qBAAa,YAAY;IACrB,OAAO,CAAC,IAAI,CAAY;IACxB,OAAO,CAAC,MAAM,CAA8B;IAC5C,OAAO,CAAC,MAAM,CAAe;gBAEjB,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,EAAc,KAAK,YAAY,EAAyB,MAAM,aAAa,CAAC;AAInF,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;AAE1F;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAChC,4BAA4B;IAC5B,MAAM,CAAC,EAAE,kBAAkB,CAAC;IAC5B,sBAAsB;IACtB,MAAM,EAAE,YAAY,CAAC;CACxB;AAED,qBAAa,YAAY;IACrB,OAAO,CAAC,IAAI,CAAY;IACxB,OAAO,CAAC,MAAM,CAA8B;IAC5C,OAAO,CAAC,MAAM,CAAe;gBAEjB,OAAO,EAAE,mBAAmB;IAYxC;;;;;OAKG;IACG,UAAU,CAAC,MAAM,EAAE,WAAW,GAAG,OAAO,CAAC,WAAW,CAAC;IA2E3D;;;;;;;OAOG;IACG,WAAW,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC;IAoEvF;;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"}
|
|
@@ -36,8 +36,7 @@ class AgentRuntime {
|
|
|
36
36
|
config.agentConfig,
|
|
37
37
|
void 0,
|
|
38
38
|
// No config path
|
|
39
|
-
false
|
|
40
|
-
// Not interactive CLI
|
|
39
|
+
{ isInteractiveCli: false, skipPluginDiscovery: true }
|
|
41
40
|
);
|
|
42
41
|
enrichedConfig.agentId = agentId;
|
|
43
42
|
const agent = new DextoAgent(enrichedConfig);
|