@dexto/agent-management 1.5.0 → 1.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/config/config-enrichment.cjs +49 -0
- package/dist/config/config-enrichment.d.ts +2 -2
- package/dist/config/config-enrichment.d.ts.map +1 -1
- package/dist/config/config-enrichment.js +50 -2
- package/dist/config/discover-prompts.cjs +23 -0
- package/dist/config/discover-prompts.d.ts +13 -0
- package/dist/config/discover-prompts.d.ts.map +1 -1
- package/dist/config/discover-prompts.js +22 -0
- package/dist/models/custom-models.cjs +4 -1
- package/dist/models/custom-models.d.ts +5 -0
- package/dist/models/custom-models.d.ts.map +1 -1
- package/dist/models/custom-models.js +4 -1
- package/dist/preferences/loader.cjs +3 -0
- package/dist/preferences/loader.d.ts +2 -0
- package/dist/preferences/loader.d.ts.map +1 -1
- package/dist/preferences/loader.js +3 -0
- package/dist/preferences/schemas.cjs +4 -1
- package/dist/preferences/schemas.d.ts +12 -0
- package/dist/preferences/schemas.d.ts.map +1 -1
- package/dist/preferences/schemas.js +4 -1
- package/package.json +2 -2
|
@@ -29,6 +29,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
29
29
|
var config_enrichment_exports = {};
|
|
30
30
|
__export(config_enrichment_exports, {
|
|
31
31
|
deriveAgentId: () => deriveAgentId,
|
|
32
|
+
discoverAgentInstructionFile: () => import_discover_prompts2.discoverAgentInstructionFile,
|
|
32
33
|
discoverCommandPrompts: () => import_discover_prompts2.discoverCommandPrompts,
|
|
33
34
|
enrichAgentConfig: () => enrichAgentConfig
|
|
34
35
|
});
|
|
@@ -38,6 +39,10 @@ var path = __toESM(require("path"), 1);
|
|
|
38
39
|
var import_discover_prompts = require("./discover-prompts.js");
|
|
39
40
|
var import_discover_prompts2 = require("./discover-prompts.js");
|
|
40
41
|
function deriveAgentId(config, configPath) {
|
|
42
|
+
if (config.agentId) {
|
|
43
|
+
const sanitizedId = config.agentId.toLowerCase().replace(/[^a-z0-9-_]/g, "-").replace(/-+/g, "-").replace(/^-|-$/g, "");
|
|
44
|
+
return sanitizedId || "coding-agent";
|
|
45
|
+
}
|
|
41
46
|
if (config.agentCard?.name) {
|
|
42
47
|
const sanitizedName = config.agentCard.name.toLowerCase().replace(/[^a-z0-9-_]/g, "-").replace(/-+/g, "-").replace(/^-|-$/g, "");
|
|
43
48
|
if (sanitizedName) {
|
|
@@ -127,11 +132,55 @@ function enrichAgentConfig(config, configPath, options = {}) {
|
|
|
127
132
|
);
|
|
128
133
|
enriched.prompts = [...existingPrompts, ...filteredDiscovered];
|
|
129
134
|
}
|
|
135
|
+
const instructionFile = (0, import_discover_prompts.discoverAgentInstructionFile)();
|
|
136
|
+
if (instructionFile) {
|
|
137
|
+
const fileContributor = {
|
|
138
|
+
id: "discovered-instructions",
|
|
139
|
+
type: "file",
|
|
140
|
+
priority: 5,
|
|
141
|
+
enabled: true,
|
|
142
|
+
files: [instructionFile],
|
|
143
|
+
options: {
|
|
144
|
+
includeFilenames: true,
|
|
145
|
+
errorHandling: "skip",
|
|
146
|
+
maxFileSize: 1e5
|
|
147
|
+
}
|
|
148
|
+
};
|
|
149
|
+
if (!config.systemPrompt) {
|
|
150
|
+
enriched.systemPrompt = {
|
|
151
|
+
contributors: [fileContributor]
|
|
152
|
+
};
|
|
153
|
+
} else if (typeof config.systemPrompt === "string") {
|
|
154
|
+
enriched.systemPrompt = {
|
|
155
|
+
contributors: [
|
|
156
|
+
{
|
|
157
|
+
id: "inline",
|
|
158
|
+
type: "static",
|
|
159
|
+
content: config.systemPrompt,
|
|
160
|
+
priority: 0,
|
|
161
|
+
enabled: true
|
|
162
|
+
},
|
|
163
|
+
fileContributor
|
|
164
|
+
]
|
|
165
|
+
};
|
|
166
|
+
} else if ("contributors" in config.systemPrompt) {
|
|
167
|
+
const existingContributors = config.systemPrompt.contributors ?? [];
|
|
168
|
+
const hasDiscoveredInstructions = existingContributors.some(
|
|
169
|
+
(c) => c.id === "discovered-instructions"
|
|
170
|
+
);
|
|
171
|
+
if (!hasDiscoveredInstructions) {
|
|
172
|
+
enriched.systemPrompt = {
|
|
173
|
+
contributors: [...existingContributors, fileContributor]
|
|
174
|
+
};
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
}
|
|
130
178
|
return enriched;
|
|
131
179
|
}
|
|
132
180
|
// Annotate the CommonJS export names for ESM import in node:
|
|
133
181
|
0 && (module.exports = {
|
|
134
182
|
deriveAgentId,
|
|
183
|
+
discoverAgentInstructionFile,
|
|
135
184
|
discoverCommandPrompts,
|
|
136
185
|
enrichAgentConfig
|
|
137
186
|
});
|
|
@@ -12,10 +12,10 @@
|
|
|
12
12
|
* Core services now require explicit paths - this enrichment layer provides them.
|
|
13
13
|
*/
|
|
14
14
|
import type { AgentConfig } from '@dexto/core';
|
|
15
|
-
export { discoverCommandPrompts } from './discover-prompts.js';
|
|
15
|
+
export { discoverCommandPrompts, discoverAgentInstructionFile } from './discover-prompts.js';
|
|
16
16
|
/**
|
|
17
17
|
* Derives an agent ID from config or file path for per-agent isolation.
|
|
18
|
-
* Priority: agentCard.name > filename (without extension) > 'coding-agent'
|
|
18
|
+
* Priority: explicit agentId > agentCard.name > filename (without extension) > 'coding-agent'
|
|
19
19
|
*/
|
|
20
20
|
export declare function deriveAgentId(config: AgentConfig, configPath?: string): string;
|
|
21
21
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config-enrichment.d.ts","sourceRoot":"","sources":["../../src/config/config-enrichment.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAGH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAK/C,OAAO,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"config-enrichment.d.ts","sourceRoot":"","sources":["../../src/config/config-enrichment.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAGH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAK/C,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;CAClD;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,iBAAiB,CAC7B,MAAM,EAAE,WAAW,EACnB,UAAU,CAAC,EAAE,MAAM,EACnB,OAAO,GAAE,wBAAwB,GAAG,OAAY,GACjD,WAAW,CAoKb"}
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
import { getDextoPath } from "../utils/path.js";
|
|
2
2
|
import * as path from "path";
|
|
3
|
-
import { discoverCommandPrompts } from "./discover-prompts.js";
|
|
4
|
-
import { discoverCommandPrompts as discoverCommandPrompts2 } from "./discover-prompts.js";
|
|
3
|
+
import { discoverCommandPrompts, discoverAgentInstructionFile } from "./discover-prompts.js";
|
|
4
|
+
import { discoverCommandPrompts as discoverCommandPrompts2, discoverAgentInstructionFile as discoverAgentInstructionFile2 } from "./discover-prompts.js";
|
|
5
5
|
function deriveAgentId(config, configPath) {
|
|
6
|
+
if (config.agentId) {
|
|
7
|
+
const sanitizedId = config.agentId.toLowerCase().replace(/[^a-z0-9-_]/g, "-").replace(/-+/g, "-").replace(/^-|-$/g, "");
|
|
8
|
+
return sanitizedId || "coding-agent";
|
|
9
|
+
}
|
|
6
10
|
if (config.agentCard?.name) {
|
|
7
11
|
const sanitizedName = config.agentCard.name.toLowerCase().replace(/[^a-z0-9-_]/g, "-").replace(/-+/g, "-").replace(/^-|-$/g, "");
|
|
8
12
|
if (sanitizedName) {
|
|
@@ -92,10 +96,54 @@ function enrichAgentConfig(config, configPath, options = {}) {
|
|
|
92
96
|
);
|
|
93
97
|
enriched.prompts = [...existingPrompts, ...filteredDiscovered];
|
|
94
98
|
}
|
|
99
|
+
const instructionFile = discoverAgentInstructionFile();
|
|
100
|
+
if (instructionFile) {
|
|
101
|
+
const fileContributor = {
|
|
102
|
+
id: "discovered-instructions",
|
|
103
|
+
type: "file",
|
|
104
|
+
priority: 5,
|
|
105
|
+
enabled: true,
|
|
106
|
+
files: [instructionFile],
|
|
107
|
+
options: {
|
|
108
|
+
includeFilenames: true,
|
|
109
|
+
errorHandling: "skip",
|
|
110
|
+
maxFileSize: 1e5
|
|
111
|
+
}
|
|
112
|
+
};
|
|
113
|
+
if (!config.systemPrompt) {
|
|
114
|
+
enriched.systemPrompt = {
|
|
115
|
+
contributors: [fileContributor]
|
|
116
|
+
};
|
|
117
|
+
} else if (typeof config.systemPrompt === "string") {
|
|
118
|
+
enriched.systemPrompt = {
|
|
119
|
+
contributors: [
|
|
120
|
+
{
|
|
121
|
+
id: "inline",
|
|
122
|
+
type: "static",
|
|
123
|
+
content: config.systemPrompt,
|
|
124
|
+
priority: 0,
|
|
125
|
+
enabled: true
|
|
126
|
+
},
|
|
127
|
+
fileContributor
|
|
128
|
+
]
|
|
129
|
+
};
|
|
130
|
+
} else if ("contributors" in config.systemPrompt) {
|
|
131
|
+
const existingContributors = config.systemPrompt.contributors ?? [];
|
|
132
|
+
const hasDiscoveredInstructions = existingContributors.some(
|
|
133
|
+
(c) => c.id === "discovered-instructions"
|
|
134
|
+
);
|
|
135
|
+
if (!hasDiscoveredInstructions) {
|
|
136
|
+
enriched.systemPrompt = {
|
|
137
|
+
contributors: [...existingContributors, fileContributor]
|
|
138
|
+
};
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
}
|
|
95
142
|
return enriched;
|
|
96
143
|
}
|
|
97
144
|
export {
|
|
98
145
|
deriveAgentId,
|
|
146
|
+
discoverAgentInstructionFile2 as discoverAgentInstructionFile,
|
|
99
147
|
discoverCommandPrompts2 as discoverCommandPrompts,
|
|
100
148
|
enrichAgentConfig
|
|
101
149
|
};
|
|
@@ -28,6 +28,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
28
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
29
|
var discover_prompts_exports = {};
|
|
30
30
|
__export(discover_prompts_exports, {
|
|
31
|
+
discoverAgentInstructionFile: () => discoverAgentInstructionFile,
|
|
31
32
|
discoverCommandPrompts: () => discoverCommandPrompts
|
|
32
33
|
});
|
|
33
34
|
module.exports = __toCommonJS(discover_prompts_exports);
|
|
@@ -97,7 +98,29 @@ function scanCommandsDirectory(dir) {
|
|
|
97
98
|
}
|
|
98
99
|
return files;
|
|
99
100
|
}
|
|
101
|
+
const AGENT_INSTRUCTION_FILES = ["agents.md", "claude.md", "gemini.md"];
|
|
102
|
+
function discoverAgentInstructionFile() {
|
|
103
|
+
const cwd = process.cwd();
|
|
104
|
+
let dirEntries;
|
|
105
|
+
try {
|
|
106
|
+
dirEntries = (0, import_fs.readdirSync)(cwd);
|
|
107
|
+
} catch {
|
|
108
|
+
return null;
|
|
109
|
+
}
|
|
110
|
+
const lowercaseMap = /* @__PURE__ */ new Map();
|
|
111
|
+
for (const entry of dirEntries) {
|
|
112
|
+
lowercaseMap.set(entry.toLowerCase(), entry);
|
|
113
|
+
}
|
|
114
|
+
for (const filename of AGENT_INSTRUCTION_FILES) {
|
|
115
|
+
const actualFilename = lowercaseMap.get(filename);
|
|
116
|
+
if (actualFilename) {
|
|
117
|
+
return path.join(cwd, actualFilename);
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
return null;
|
|
121
|
+
}
|
|
100
122
|
// Annotate the CommonJS export names for ESM import in node:
|
|
101
123
|
0 && (module.exports = {
|
|
124
|
+
discoverAgentInstructionFile,
|
|
102
125
|
discoverCommandPrompts
|
|
103
126
|
});
|
|
@@ -25,4 +25,17 @@ export interface FilePromptEntry {
|
|
|
25
25
|
* @returns Array of file prompt entries for discovered .md files
|
|
26
26
|
*/
|
|
27
27
|
export declare function discoverCommandPrompts(): FilePromptEntry[];
|
|
28
|
+
/**
|
|
29
|
+
* Discovers agent instruction files from the current working directory.
|
|
30
|
+
*
|
|
31
|
+
* Looks for files in this order of priority (case-insensitive):
|
|
32
|
+
* 1. AGENTS.md (or agents.md, Agents.md, etc.)
|
|
33
|
+
* 2. CLAUDE.md (or claude.md, Claude.md, etc.)
|
|
34
|
+
* 3. GEMINI.md (or gemini.md, Gemini.md, etc.)
|
|
35
|
+
*
|
|
36
|
+
* Only the first found file is returned (we don't want multiple instruction files).
|
|
37
|
+
*
|
|
38
|
+
* @returns The absolute path to the first found instruction file, or null if none found
|
|
39
|
+
*/
|
|
40
|
+
export declare function discoverAgentInstructionFile(): string | null;
|
|
28
41
|
//# sourceMappingURL=discover-prompts.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"discover-prompts.d.ts","sourceRoot":"","sources":["../../src/config/discover-prompts.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAWH;;GAEG;AACH,MAAM,WAAW,eAAe;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,cAAc,CAAC,EAAE,OAAO,CAAC;CAC5B;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,sBAAsB,IAAI,eAAe,EAAE,CA8D1D"}
|
|
1
|
+
{"version":3,"file":"discover-prompts.d.ts","sourceRoot":"","sources":["../../src/config/discover-prompts.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAWH;;GAEG;AACH,MAAM,WAAW,eAAe;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,cAAc,CAAC,EAAE,OAAO,CAAC;CAC5B;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,sBAAsB,IAAI,eAAe,EAAE,CA8D1D;AAiCD;;;;;;;;;;;GAWG;AACH,wBAAgB,4BAA4B,IAAI,MAAM,GAAG,IAAI,CA0B5D"}
|
|
@@ -68,6 +68,28 @@ function scanCommandsDirectory(dir) {
|
|
|
68
68
|
}
|
|
69
69
|
return files;
|
|
70
70
|
}
|
|
71
|
+
const AGENT_INSTRUCTION_FILES = ["agents.md", "claude.md", "gemini.md"];
|
|
72
|
+
function discoverAgentInstructionFile() {
|
|
73
|
+
const cwd = process.cwd();
|
|
74
|
+
let dirEntries;
|
|
75
|
+
try {
|
|
76
|
+
dirEntries = readdirSync(cwd);
|
|
77
|
+
} catch {
|
|
78
|
+
return null;
|
|
79
|
+
}
|
|
80
|
+
const lowercaseMap = /* @__PURE__ */ new Map();
|
|
81
|
+
for (const entry of dirEntries) {
|
|
82
|
+
lowercaseMap.set(entry.toLowerCase(), entry);
|
|
83
|
+
}
|
|
84
|
+
for (const filename of AGENT_INSTRUCTION_FILES) {
|
|
85
|
+
const actualFilename = lowercaseMap.get(filename);
|
|
86
|
+
if (actualFilename) {
|
|
87
|
+
return path.join(cwd, actualFilename);
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
return null;
|
|
91
|
+
}
|
|
71
92
|
export {
|
|
93
|
+
discoverAgentInstructionFile,
|
|
72
94
|
discoverCommandPrompts
|
|
73
95
|
};
|
|
@@ -63,7 +63,10 @@ const CustomModelSchema = import_zod.z.object({
|
|
|
63
63
|
apiKey: import_zod.z.string().optional(),
|
|
64
64
|
// File path for local GGUF models. Required when provider is 'local'.
|
|
65
65
|
// Stores the absolute path to the .gguf file on disk.
|
|
66
|
-
filePath: import_zod.z.string().optional()
|
|
66
|
+
filePath: import_zod.z.string().optional(),
|
|
67
|
+
// OpenAI reasoning effort level for reasoning-capable models (o1, o3, codex, gpt-5.x).
|
|
68
|
+
// Controls how many reasoning tokens the model generates before producing a response.
|
|
69
|
+
reasoningEffort: import_zod.z.enum(["none", "minimal", "low", "medium", "high", "xhigh"]).optional()
|
|
67
70
|
}).superRefine((data, ctx) => {
|
|
68
71
|
if ((data.provider === "openai-compatible" || data.provider === "litellm") && !data.baseURL) {
|
|
69
72
|
ctx.addIssue({
|
|
@@ -33,11 +33,13 @@ export declare const CustomModelSchema: z.ZodEffects<z.ZodObject<{
|
|
|
33
33
|
maxOutputTokens: z.ZodOptional<z.ZodNumber>;
|
|
34
34
|
apiKey: z.ZodOptional<z.ZodString>;
|
|
35
35
|
filePath: z.ZodOptional<z.ZodString>;
|
|
36
|
+
reasoningEffort: z.ZodOptional<z.ZodEnum<["none", "minimal", "low", "medium", "high", "xhigh"]>>;
|
|
36
37
|
}, "strip", z.ZodTypeAny, {
|
|
37
38
|
name: string;
|
|
38
39
|
provider: "openai-compatible" | "openrouter" | "litellm" | "glama" | "vertex" | "bedrock" | "local" | "ollama";
|
|
39
40
|
apiKey?: string | undefined;
|
|
40
41
|
baseURL?: string | undefined;
|
|
42
|
+
reasoningEffort?: "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | undefined;
|
|
41
43
|
filePath?: string | undefined;
|
|
42
44
|
displayName?: string | undefined;
|
|
43
45
|
maxInputTokens?: number | undefined;
|
|
@@ -47,6 +49,7 @@ export declare const CustomModelSchema: z.ZodEffects<z.ZodObject<{
|
|
|
47
49
|
provider?: "openai-compatible" | "openrouter" | "litellm" | "glama" | "vertex" | "bedrock" | "local" | "ollama" | undefined;
|
|
48
50
|
apiKey?: string | undefined;
|
|
49
51
|
baseURL?: string | undefined;
|
|
52
|
+
reasoningEffort?: "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | undefined;
|
|
50
53
|
filePath?: string | undefined;
|
|
51
54
|
displayName?: string | undefined;
|
|
52
55
|
maxInputTokens?: number | undefined;
|
|
@@ -56,6 +59,7 @@ export declare const CustomModelSchema: z.ZodEffects<z.ZodObject<{
|
|
|
56
59
|
provider: "openai-compatible" | "openrouter" | "litellm" | "glama" | "vertex" | "bedrock" | "local" | "ollama";
|
|
57
60
|
apiKey?: string | undefined;
|
|
58
61
|
baseURL?: string | undefined;
|
|
62
|
+
reasoningEffort?: "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | undefined;
|
|
59
63
|
filePath?: string | undefined;
|
|
60
64
|
displayName?: string | undefined;
|
|
61
65
|
maxInputTokens?: number | undefined;
|
|
@@ -65,6 +69,7 @@ export declare const CustomModelSchema: z.ZodEffects<z.ZodObject<{
|
|
|
65
69
|
provider?: "openai-compatible" | "openrouter" | "litellm" | "glama" | "vertex" | "bedrock" | "local" | "ollama" | undefined;
|
|
66
70
|
apiKey?: string | undefined;
|
|
67
71
|
baseURL?: string | undefined;
|
|
72
|
+
reasoningEffort?: "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | undefined;
|
|
68
73
|
filePath?: string | undefined;
|
|
69
74
|
displayName?: string | undefined;
|
|
70
75
|
maxInputTokens?: number | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"custom-models.d.ts","sourceRoot":"","sources":["../../src/models/custom-models.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB,2CAA2C;AAC3C,eAAO,MAAM,sBAAsB,0GASzB,CAAC;AACX,MAAM,MAAM,mBAAmB,GAAG,CAAC,OAAO,sBAAsB,CAAC,CAAC,MAAM,CAAC,CAAC;AAE1E;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,iBAAiB
|
|
1
|
+
{"version":3,"file":"custom-models.d.ts","sourceRoot":"","sources":["../../src/models/custom-models.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB,2CAA2C;AAC3C,eAAO,MAAM,sBAAsB,0GASzB,CAAC;AACX,MAAM,MAAM,mBAAmB,GAAG,CAAC,OAAO,sBAAsB,CAAC,CAAC,MAAM,CAAC,CAAC;AAE1E;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA8CxB,CAAC;AAEP,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAO7D;;GAEG;AACH,wBAAgB,mBAAmB,IAAI,MAAM,CAE5C;AAED;;GAEG;AACH,wBAAsB,gBAAgB,IAAI,OAAO,CAAC,WAAW,EAAE,CAAC,CAmB/D;AAED;;GAEG;AACH,wBAAsB,eAAe,CAAC,KAAK,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CAgBvE;AAED;;GAEG;AACH,wBAAsB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAUtE;AAED;;GAEG;AACH,wBAAsB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,GAAG,IAAI,CAAC,CAG9E"}
|
|
@@ -24,7 +24,10 @@ const CustomModelSchema = z.object({
|
|
|
24
24
|
apiKey: z.string().optional(),
|
|
25
25
|
// File path for local GGUF models. Required when provider is 'local'.
|
|
26
26
|
// Stores the absolute path to the .gguf file on disk.
|
|
27
|
-
filePath: z.string().optional()
|
|
27
|
+
filePath: z.string().optional(),
|
|
28
|
+
// OpenAI reasoning effort level for reasoning-capable models (o1, o3, codex, gpt-5.x).
|
|
29
|
+
// Controls how many reasoning tokens the model generates before producing a response.
|
|
30
|
+
reasoningEffort: z.enum(["none", "minimal", "low", "medium", "high", "xhigh"]).optional()
|
|
28
31
|
}).superRefine((data, ctx) => {
|
|
29
32
|
if ((data.provider === "openai-compatible" || data.provider === "litellm") && !data.baseURL) {
|
|
30
33
|
ctx.addIssue({
|
|
@@ -105,6 +105,9 @@ function createInitialPreferences(providerOrOptions, model, apiKeyVar, defaultAg
|
|
|
105
105
|
if (opts.baseURL) {
|
|
106
106
|
llmConfig.baseURL = opts.baseURL;
|
|
107
107
|
}
|
|
108
|
+
if (opts.reasoningEffort) {
|
|
109
|
+
llmConfig.reasoningEffort = opts.reasoningEffort;
|
|
110
|
+
}
|
|
108
111
|
return {
|
|
109
112
|
llm: llmConfig,
|
|
110
113
|
defaults: {
|
|
@@ -34,6 +34,8 @@ export interface CreatePreferencesOptions {
|
|
|
34
34
|
defaultAgent?: string;
|
|
35
35
|
defaultMode?: 'cli' | 'web' | 'server' | 'discord' | 'telegram' | 'mcp';
|
|
36
36
|
baseURL?: string;
|
|
37
|
+
/** Reasoning effort for OpenAI reasoning models (o1, o3, codex, gpt-5.x) */
|
|
38
|
+
reasoningEffort?: 'none' | 'minimal' | 'low' | 'medium' | 'high' | 'xhigh';
|
|
37
39
|
setupCompleted?: boolean;
|
|
38
40
|
/** Whether API key setup was skipped and needs to be configured later */
|
|
39
41
|
apiKeyPending?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"loader.d.ts","sourceRoot":"","sources":["../../src/preferences/loader.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,EAA2B,KAAK,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAI/E;;;;;GAKG;AACH,wBAAsB,qBAAqB,IAAI,OAAO,CAAC,iBAAiB,CAAC,CA+BxE;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,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,yEAAyE;IACzE,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,yEAAyE;IACzE,cAAc,CAAC,EAAE,OAAO,CAAC;CAC5B;AAED;;;GAGG;AACH,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,wBAAwB,GAAG,iBAAiB,CAAC;AAE/F;;;GAGG;AACH,wBAAgB,wBAAwB,CACpC,QAAQ,EAAE,WAAW,EACrB,KAAK,EAAE,MAAM,EACb,SAAS,EAAE,MAAM,EACjB,YAAY,CAAC,EAAE,MAAM,GACtB,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"loader.d.ts","sourceRoot":"","sources":["../../src/preferences/loader.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,EAA2B,KAAK,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAI/E;;;;;GAKG;AACH,wBAAsB,qBAAqB,IAAI,OAAO,CAAC,iBAAiB,CAAC,CA+BxE;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;CAC5B;AAED;;;GAGG;AACH,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,wBAAwB,GAAG,iBAAiB,CAAC;AAE/F;;;GAGG;AACH,wBAAgB,wBAAwB,CACpC,QAAQ,EAAE,WAAW,EACrB,KAAK,EAAE,MAAM,EACb,SAAS,EAAE,MAAM,EACjB,YAAY,CAAC,EAAE,MAAM,GACtB,iBAAiB,CAAC;AAgErB;;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;CAC/C,CAAC;AAEF;;;;;;GAMG;AACH,wBAAsB,uBAAuB,CACzC,OAAO,EAAE,wBAAwB,GAClC,OAAO,CAAC,iBAAiB,CAAC,CA2B5B"}
|
|
@@ -77,6 +77,9 @@ function createInitialPreferences(providerOrOptions, model, apiKeyVar, defaultAg
|
|
|
77
77
|
if (opts.baseURL) {
|
|
78
78
|
llmConfig.baseURL = opts.baseURL;
|
|
79
79
|
}
|
|
80
|
+
if (opts.reasoningEffort) {
|
|
81
|
+
llmConfig.reasoningEffort = opts.reasoningEffort;
|
|
82
|
+
}
|
|
80
83
|
return {
|
|
81
84
|
llm: llmConfig,
|
|
82
85
|
defaults: {
|
|
@@ -39,7 +39,10 @@ const PreferenceLLMSchema = import_zod.z.object({
|
|
|
39
39
|
).optional().describe(
|
|
40
40
|
"Environment variable reference for API key (optional for local providers like Ollama)"
|
|
41
41
|
),
|
|
42
|
-
baseURL: import_zod.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)")
|
|
42
|
+
baseURL: import_zod.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)"),
|
|
43
|
+
reasoningEffort: import_zod.z.enum(["none", "minimal", "low", "medium", "high", "xhigh"]).optional().describe(
|
|
44
|
+
"Reasoning effort level for OpenAI reasoning models (o1, o3, codex, gpt-5.x). Auto-detected if not set."
|
|
45
|
+
)
|
|
43
46
|
}).strict().superRefine((data, ctx) => {
|
|
44
47
|
const skipModelValidation = (0, import_core.acceptsAnyModel)(data.provider) || (0, import_core.supportsCustomModels)(data.provider);
|
|
45
48
|
if (!skipModelValidation && !(0, import_core.isValidProviderModel)(data.provider, data.model)) {
|
|
@@ -4,26 +4,31 @@ 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
8
|
}, "strict", z.ZodTypeAny, {
|
|
8
9
|
provider: "openai" | "openai-compatible" | "anthropic" | "google" | "groq" | "xai" | "cohere" | "openrouter" | "litellm" | "glama" | "vertex" | "bedrock" | "local" | "ollama";
|
|
9
10
|
model: string;
|
|
10
11
|
apiKey?: string | undefined;
|
|
11
12
|
baseURL?: string | undefined;
|
|
13
|
+
reasoningEffort?: "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | undefined;
|
|
12
14
|
}, {
|
|
13
15
|
provider: "openai" | "openai-compatible" | "anthropic" | "google" | "groq" | "xai" | "cohere" | "openrouter" | "litellm" | "glama" | "vertex" | "bedrock" | "local" | "ollama";
|
|
14
16
|
model: string;
|
|
15
17
|
apiKey?: string | undefined;
|
|
16
18
|
baseURL?: string | undefined;
|
|
19
|
+
reasoningEffort?: "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | undefined;
|
|
17
20
|
}>, {
|
|
18
21
|
provider: "openai" | "openai-compatible" | "anthropic" | "google" | "groq" | "xai" | "cohere" | "openrouter" | "litellm" | "glama" | "vertex" | "bedrock" | "local" | "ollama";
|
|
19
22
|
model: string;
|
|
20
23
|
apiKey?: string | undefined;
|
|
21
24
|
baseURL?: string | undefined;
|
|
25
|
+
reasoningEffort?: "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | undefined;
|
|
22
26
|
}, {
|
|
23
27
|
provider: "openai" | "openai-compatible" | "anthropic" | "google" | "groq" | "xai" | "cohere" | "openrouter" | "litellm" | "glama" | "vertex" | "bedrock" | "local" | "ollama";
|
|
24
28
|
model: string;
|
|
25
29
|
apiKey?: string | undefined;
|
|
26
30
|
baseURL?: string | undefined;
|
|
31
|
+
reasoningEffort?: "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | undefined;
|
|
27
32
|
}>;
|
|
28
33
|
export declare const PreferenceDefaultsSchema: z.ZodObject<{
|
|
29
34
|
defaultAgent: z.ZodString;
|
|
@@ -54,26 +59,31 @@ export declare const GlobalPreferencesSchema: z.ZodObject<{
|
|
|
54
59
|
model: z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
|
|
55
60
|
apiKey: z.ZodOptional<z.ZodString>;
|
|
56
61
|
baseURL: z.ZodOptional<z.ZodString>;
|
|
62
|
+
reasoningEffort: z.ZodOptional<z.ZodEnum<["none", "minimal", "low", "medium", "high", "xhigh"]>>;
|
|
57
63
|
}, "strict", z.ZodTypeAny, {
|
|
58
64
|
provider: "openai" | "openai-compatible" | "anthropic" | "google" | "groq" | "xai" | "cohere" | "openrouter" | "litellm" | "glama" | "vertex" | "bedrock" | "local" | "ollama";
|
|
59
65
|
model: string;
|
|
60
66
|
apiKey?: string | undefined;
|
|
61
67
|
baseURL?: string | undefined;
|
|
68
|
+
reasoningEffort?: "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | undefined;
|
|
62
69
|
}, {
|
|
63
70
|
provider: "openai" | "openai-compatible" | "anthropic" | "google" | "groq" | "xai" | "cohere" | "openrouter" | "litellm" | "glama" | "vertex" | "bedrock" | "local" | "ollama";
|
|
64
71
|
model: string;
|
|
65
72
|
apiKey?: string | undefined;
|
|
66
73
|
baseURL?: string | undefined;
|
|
74
|
+
reasoningEffort?: "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | undefined;
|
|
67
75
|
}>, {
|
|
68
76
|
provider: "openai" | "openai-compatible" | "anthropic" | "google" | "groq" | "xai" | "cohere" | "openrouter" | "litellm" | "glama" | "vertex" | "bedrock" | "local" | "ollama";
|
|
69
77
|
model: string;
|
|
70
78
|
apiKey?: string | undefined;
|
|
71
79
|
baseURL?: string | undefined;
|
|
80
|
+
reasoningEffort?: "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | undefined;
|
|
72
81
|
}, {
|
|
73
82
|
provider: "openai" | "openai-compatible" | "anthropic" | "google" | "groq" | "xai" | "cohere" | "openrouter" | "litellm" | "glama" | "vertex" | "bedrock" | "local" | "ollama";
|
|
74
83
|
model: string;
|
|
75
84
|
apiKey?: string | undefined;
|
|
76
85
|
baseURL?: string | undefined;
|
|
86
|
+
reasoningEffort?: "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | undefined;
|
|
77
87
|
}>;
|
|
78
88
|
defaults: z.ZodObject<{
|
|
79
89
|
defaultAgent: z.ZodString;
|
|
@@ -104,6 +114,7 @@ export declare const GlobalPreferencesSchema: z.ZodObject<{
|
|
|
104
114
|
model: string;
|
|
105
115
|
apiKey?: string | undefined;
|
|
106
116
|
baseURL?: string | undefined;
|
|
117
|
+
reasoningEffort?: "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | undefined;
|
|
107
118
|
};
|
|
108
119
|
defaults: {
|
|
109
120
|
defaultAgent: string;
|
|
@@ -120,6 +131,7 @@ export declare const GlobalPreferencesSchema: z.ZodObject<{
|
|
|
120
131
|
model: string;
|
|
121
132
|
apiKey?: string | undefined;
|
|
122
133
|
baseURL?: string | undefined;
|
|
134
|
+
reasoningEffort?: "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | undefined;
|
|
123
135
|
};
|
|
124
136
|
defaults: {
|
|
125
137
|
defaultAgent: string;
|
|
@@ -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
|
|
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,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAUvB,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,iBAAiB,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,uBAAuB,CAAC,CAAC"}
|
|
@@ -19,7 +19,10 @@ const PreferenceLLMSchema = z.object({
|
|
|
19
19
|
).optional().describe(
|
|
20
20
|
"Environment variable reference for API key (optional for local providers like Ollama)"
|
|
21
21
|
),
|
|
22
|
-
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)")
|
|
22
|
+
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
|
+
)
|
|
23
26
|
}).strict().superRefine((data, ctx) => {
|
|
24
27
|
const skipModelValidation = acceptsAnyModel(data.provider) || supportsCustomModels(data.provider);
|
|
25
28
|
if (!skipModelValidation && !isValidProviderModel(data.provider, data.model)) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dexto/agent-management",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.2",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"dependencies": {
|
|
17
17
|
"yaml": "^2.7.1",
|
|
18
18
|
"zod": "^3.25.0",
|
|
19
|
-
"@dexto/core": "1.5.
|
|
19
|
+
"@dexto/core": "1.5.2"
|
|
20
20
|
},
|
|
21
21
|
"devDependencies": {
|
|
22
22
|
"@types/node": "^22.13.5"
|