@dexto/agent-management 1.7.2 → 1.8.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/agent-creation.cjs +6 -2
- package/dist/agent-creation.d.ts.map +1 -1
- package/dist/agent-creation.js +6 -2
- package/dist/config/config-enrichment.cjs +1 -16
- package/dist/config/config-enrichment.d.ts.map +1 -1
- package/dist/config/config-enrichment.js +2 -21
- package/dist/index.cjs +4 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -0
- package/dist/models/model-picker-state.cjs +2 -2
- package/dist/models/model-picker-state.d.ts +1 -1
- package/dist/models/model-picker-state.d.ts.map +1 -1
- package/dist/models/model-picker-state.js +1 -1
- package/dist/plugins/discover-skills.d.ts +2 -3
- package/dist/plugins/discover-skills.d.ts.map +1 -1
- package/dist/plugins/index.cjs +6 -0
- package/dist/plugins/index.d.ts +4 -0
- package/dist/plugins/index.d.ts.map +1 -1
- package/dist/plugins/index.js +4 -0
- package/dist/plugins/local-skill-source.cjs +104 -0
- package/dist/plugins/local-skill-source.d.ts +20 -0
- package/dist/plugins/local-skill-source.d.ts.map +1 -0
- package/dist/plugins/local-skill-source.js +70 -0
- package/dist/plugins/local-skill-sources.cjs +74 -0
- package/dist/plugins/local-skill-sources.d.ts +7 -0
- package/dist/plugins/local-skill-sources.d.ts.map +1 -0
- package/dist/plugins/local-skill-sources.js +40 -0
- package/dist/plugins/types.d.ts +1 -1
- package/dist/preferences/loader.d.ts +1 -1
- package/dist/preferences/loader.d.ts.map +1 -1
- package/dist/preferences/schemas.cjs +8 -7
- package/dist/preferences/schemas.d.ts.map +1 -1
- package/dist/preferences/schemas.js +3 -5
- package/dist/tool-factories/agent-spawner/factory.cjs +2 -4
- package/dist/tool-factories/agent-spawner/factory.d.ts.map +1 -1
- package/dist/tool-factories/agent-spawner/factory.js +2 -4
- package/dist/tool-factories/agent-spawner/llm-resolution.cjs +3 -3
- package/dist/tool-factories/agent-spawner/llm-resolution.js +1 -1
- package/dist/tool-factories/agent-spawner/runtime.cjs +8 -12
- package/dist/tool-factories/agent-spawner/runtime.d.ts +3 -3
- package/dist/tool-factories/agent-spawner/runtime.d.ts.map +1 -1
- package/dist/tool-factories/agent-spawner/runtime.js +6 -15
- 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/creator-tools/factory.cjs +49 -146
- package/dist/tool-factories/creator-tools/factory.d.ts.map +1 -1
- package/dist/tool-factories/creator-tools/factory.js +50 -148
- package/dist/utils/api-key-resolver.d.ts +1 -1
- package/dist/utils/api-key-resolver.d.ts.map +1 -1
- package/dist/utils/api-key-store.cjs +2 -2
- package/dist/utils/api-key-store.d.ts +1 -1
- package/dist/utils/api-key-store.d.ts.map +1 -1
- package/dist/utils/api-key-store.js +1 -1
- package/dist/writer.d.ts +1 -1
- package/dist/writer.d.ts.map +1 -1
- package/package.json +6 -5
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
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
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var local_skill_sources_exports = {};
|
|
30
|
+
__export(local_skill_sources_exports, {
|
|
31
|
+
createLocalSkillSources: () => createLocalSkillSources
|
|
32
|
+
});
|
|
33
|
+
module.exports = __toCommonJS(local_skill_sources_exports);
|
|
34
|
+
var import_node_path = __toESM(require("node:path"), 1);
|
|
35
|
+
var import_discover_plugins = require("./discover-plugins.js");
|
|
36
|
+
var import_discover_skills = require("./discover-skills.js");
|
|
37
|
+
var import_load_plugin = require("./load-plugin.js");
|
|
38
|
+
var import_local_skill_source = require("./local-skill-source.js");
|
|
39
|
+
function createLocalSkillSources(options = {}) {
|
|
40
|
+
const roots = [];
|
|
41
|
+
const seen = /* @__PURE__ */ new Set();
|
|
42
|
+
const addRoot = (root) => {
|
|
43
|
+
const resolved = import_node_path.default.resolve(root.skillFile);
|
|
44
|
+
if (seen.has(resolved)) return;
|
|
45
|
+
seen.add(resolved);
|
|
46
|
+
roots.push({ ...root, skillFile: resolved });
|
|
47
|
+
};
|
|
48
|
+
for (const skill of (0, import_discover_skills.discoverStandaloneSkills)(options.workspaceRoot)) {
|
|
49
|
+
addRoot({
|
|
50
|
+
id: skill.name,
|
|
51
|
+
skillFile: skill.skillFile
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
for (const plugin of (0, import_discover_plugins.discoverClaudeCodePlugins)(
|
|
55
|
+
options.workspaceRoot,
|
|
56
|
+
options.bundledPlugins ?? []
|
|
57
|
+
)) {
|
|
58
|
+
const loaded = (0, import_load_plugin.loadClaudeCodePlugin)(plugin);
|
|
59
|
+
for (const command of loaded.commands) {
|
|
60
|
+
if (!command.isSkill) continue;
|
|
61
|
+
const id = import_node_path.default.basename(import_node_path.default.dirname(command.file));
|
|
62
|
+
addRoot({
|
|
63
|
+
id: `${command.namespace}:${id}`,
|
|
64
|
+
displayName: `${command.namespace}:${id}`,
|
|
65
|
+
skillFile: command.file
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
return roots.length > 0 ? [new import_local_skill_source.LocalSkillSource("local", roots)] : [];
|
|
70
|
+
}
|
|
71
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
72
|
+
0 && (module.exports = {
|
|
73
|
+
createLocalSkillSources
|
|
74
|
+
});
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { LocalSkillSource } from './local-skill-source.js';
|
|
2
|
+
export interface CreateLocalSkillSourcesOptions {
|
|
3
|
+
workspaceRoot?: string | undefined;
|
|
4
|
+
bundledPlugins?: string[] | undefined;
|
|
5
|
+
}
|
|
6
|
+
export declare function createLocalSkillSources(options?: CreateLocalSkillSourcesOptions): LocalSkillSource[];
|
|
7
|
+
//# sourceMappingURL=local-skill-sources.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"local-skill-sources.d.ts","sourceRoot":"","sources":["../../src/plugins/local-skill-sources.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,gBAAgB,EAAuB,MAAM,yBAAyB,CAAC;AAEhF,MAAM,WAAW,8BAA8B;IAC3C,aAAa,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACnC,cAAc,CAAC,EAAE,MAAM,EAAE,GAAG,SAAS,CAAC;CACzC;AAED,wBAAgB,uBAAuB,CACnC,OAAO,GAAE,8BAAmC,GAC7C,gBAAgB,EAAE,CAmCpB"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import path from "node:path";
|
|
2
|
+
import { discoverClaudeCodePlugins } from "./discover-plugins.js";
|
|
3
|
+
import { discoverStandaloneSkills } from "./discover-skills.js";
|
|
4
|
+
import { loadClaudeCodePlugin } from "./load-plugin.js";
|
|
5
|
+
import { LocalSkillSource } from "./local-skill-source.js";
|
|
6
|
+
function createLocalSkillSources(options = {}) {
|
|
7
|
+
const roots = [];
|
|
8
|
+
const seen = /* @__PURE__ */ new Set();
|
|
9
|
+
const addRoot = (root) => {
|
|
10
|
+
const resolved = path.resolve(root.skillFile);
|
|
11
|
+
if (seen.has(resolved)) return;
|
|
12
|
+
seen.add(resolved);
|
|
13
|
+
roots.push({ ...root, skillFile: resolved });
|
|
14
|
+
};
|
|
15
|
+
for (const skill of discoverStandaloneSkills(options.workspaceRoot)) {
|
|
16
|
+
addRoot({
|
|
17
|
+
id: skill.name,
|
|
18
|
+
skillFile: skill.skillFile
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
for (const plugin of discoverClaudeCodePlugins(
|
|
22
|
+
options.workspaceRoot,
|
|
23
|
+
options.bundledPlugins ?? []
|
|
24
|
+
)) {
|
|
25
|
+
const loaded = loadClaudeCodePlugin(plugin);
|
|
26
|
+
for (const command of loaded.commands) {
|
|
27
|
+
if (!command.isSkill) continue;
|
|
28
|
+
const id = path.basename(path.dirname(command.file));
|
|
29
|
+
addRoot({
|
|
30
|
+
id: `${command.namespace}:${id}`,
|
|
31
|
+
displayName: `${command.namespace}:${id}`,
|
|
32
|
+
skillFile: command.file
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
return roots.length > 0 ? [new LocalSkillSource("local", roots)] : [];
|
|
37
|
+
}
|
|
38
|
+
export {
|
|
39
|
+
createLocalSkillSources
|
|
40
|
+
};
|
package/dist/plugins/types.d.ts
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
* ├── .claude-plugin/
|
|
11
11
|
* │ └── plugin.json # {name, description, version, author?}
|
|
12
12
|
* ├── commands/*.md # Commands (→ prompts, user-invocable by default)
|
|
13
|
-
* ├── skills/* /SKILL.md # Skills (
|
|
13
|
+
* ├── skills/* /SKILL.md # Skills (metadata only; not loaded as prompts)
|
|
14
14
|
* ├── hooks/hooks.json # UNSUPPORTED - shell injection
|
|
15
15
|
* ├── .mcp.json # MCP servers to merge into config
|
|
16
16
|
* └── .lsp.json # UNSUPPORTED - language servers
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { LLMProvider, LLMReasoningConfig } from '@dexto/
|
|
1
|
+
import type { LLMProvider, LLMReasoningConfig } from '@dexto/llm';
|
|
2
2
|
import { type AgentPreferences, type GlobalPreferences } from './schemas.js';
|
|
3
3
|
/**
|
|
4
4
|
* Load global preferences from ~/.dexto/preferences.yml
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"loader.d.ts","sourceRoot":"","sources":["../../src/preferences/loader.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"loader.d.ts","sourceRoot":"","sources":["../../src/preferences/loader.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAClE,OAAO,EAGH,KAAK,gBAAgB,EACrB,KAAK,iBAAiB,EACzB,MAAM,cAAc,CAAC;AAItB;;;;;GAKG;AACH,wBAAsB,qBAAqB,IAAI,OAAO,CAAC,iBAAiB,CAAC,CA+BxE;AAsCD;;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;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AAE,OAAO,CAAC;QAC7B,iBAAiB,CAAC,EAAE,MAAM,CAAC;QAC3B,cAAc,CAAC,EAAE,OAAO,CAAC;QACzB,iBAAiB,CAAC,EAAE,MAAM,CAAC;KAC9B,CAAC;CACL;AAED;;;GAGG;AACH,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,wBAAwB,GAAG,iBAAiB,CAgD7F;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"}
|
|
@@ -28,10 +28,11 @@ __export(schemas_exports, {
|
|
|
28
28
|
});
|
|
29
29
|
module.exports = __toCommonJS(schemas_exports);
|
|
30
30
|
var import_zod = require("zod");
|
|
31
|
+
var import_llm = require("@dexto/llm");
|
|
31
32
|
var import_core = require("@dexto/core");
|
|
32
33
|
var import_error_codes = require("./error-codes.js");
|
|
33
34
|
const PreferenceLLMSchema = import_zod.z.object({
|
|
34
|
-
provider: import_zod.z.enum(
|
|
35
|
+
provider: import_zod.z.enum(import_llm.LLM_PROVIDERS).describe("LLM provider (openai, anthropic, google, etc.)"),
|
|
35
36
|
model: import_core.NonEmptyTrimmed.describe("Model name for the provider"),
|
|
36
37
|
apiKey: import_zod.z.string().regex(
|
|
37
38
|
/^\$[A-Z_][A-Z0-9_]*$/,
|
|
@@ -51,9 +52,9 @@ const PreferenceLLMSchema = import_zod.z.object({
|
|
|
51
52
|
)
|
|
52
53
|
}).strict().optional().describe("Reasoning configuration (tuning only; display is controlled separately).")
|
|
53
54
|
}).strict().superRefine((data, ctx) => {
|
|
54
|
-
const skipModelValidation = (0,
|
|
55
|
-
if (!skipModelValidation && !(0,
|
|
56
|
-
const supportedModels = (0,
|
|
55
|
+
const skipModelValidation = (0, import_llm.acceptsAnyModel)(data.provider) || (0, import_llm.supportsCustomModels)(data.provider);
|
|
56
|
+
if (!skipModelValidation && !(0, import_llm.isValidProviderModel)(data.provider, data.model)) {
|
|
57
|
+
const supportedModels = (0, import_llm.getSupportedModels)(data.provider);
|
|
57
58
|
ctx.addIssue({
|
|
58
59
|
code: import_zod.z.ZodIssueCode.custom,
|
|
59
60
|
path: ["model"],
|
|
@@ -65,7 +66,7 @@ const PreferenceLLMSchema = import_zod.z.object({
|
|
|
65
66
|
}
|
|
66
67
|
});
|
|
67
68
|
}
|
|
68
|
-
if (data.baseURL && !(0,
|
|
69
|
+
if (data.baseURL && !(0, import_llm.supportsBaseURL)(data.provider)) {
|
|
69
70
|
ctx.addIssue({
|
|
70
71
|
code: import_zod.z.ZodIssueCode.custom,
|
|
71
72
|
path: ["baseURL"],
|
|
@@ -78,10 +79,10 @@ const PreferenceLLMSchema = import_zod.z.object({
|
|
|
78
79
|
});
|
|
79
80
|
}
|
|
80
81
|
if (data.reasoning) {
|
|
81
|
-
const profile = (0,
|
|
82
|
+
const profile = (0, import_llm.getReasoningProfile)(data.provider, data.model);
|
|
82
83
|
const variant = data.reasoning.variant;
|
|
83
84
|
const budgetTokens = data.reasoning.budgetTokens;
|
|
84
|
-
if (!(0,
|
|
85
|
+
if (!(0, import_llm.supportsReasoningVariant)(profile, variant)) {
|
|
85
86
|
ctx.addIssue({
|
|
86
87
|
code: import_zod.z.ZodIssueCode.custom,
|
|
87
88
|
path: ["reasoning", "variant"],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../src/preferences/schemas.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
supportsBaseURL,
|
|
8
8
|
getReasoningProfile,
|
|
9
9
|
supportsReasoningVariant,
|
|
10
|
-
LLM_PROVIDERS
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
ErrorType
|
|
14
|
-
} from "@dexto/core";
|
|
10
|
+
LLM_PROVIDERS
|
|
11
|
+
} from "@dexto/llm";
|
|
12
|
+
import { NonEmptyTrimmed, OptionalURL, ErrorType } from "@dexto/core";
|
|
15
13
|
import { PreferenceErrorCode } from "./error-codes.js";
|
|
16
14
|
const PreferenceLLMSchema = z.object({
|
|
17
15
|
provider: z.enum(LLM_PROVIDERS).describe("LLM provider (openai, anthropic, google, etc.)"),
|
|
@@ -49,9 +49,7 @@ const agentSpawnerToolsFactory = {
|
|
|
49
49
|
const { toolServices, taskForker, logger } = options;
|
|
50
50
|
if (toolServices.taskForker !== taskForker) {
|
|
51
51
|
toolServices.taskForker = taskForker;
|
|
52
|
-
logger.debug(
|
|
53
|
-
"AgentSpawnerRuntime attached as taskForker for context:fork skill support"
|
|
54
|
-
);
|
|
52
|
+
logger.debug("AgentSpawnerRuntime attached as taskForker");
|
|
55
53
|
}
|
|
56
54
|
};
|
|
57
55
|
const updateWorkspaceRootHint = (runtime, context) => {
|
|
@@ -147,7 +145,7 @@ const agentSpawnerToolsFactory = {
|
|
|
147
145
|
];
|
|
148
146
|
agent.isSessionBusy(sessionId).then((isBusy) => {
|
|
149
147
|
if (isBusy) {
|
|
150
|
-
agent.
|
|
148
|
+
agent.steer(sessionId, {
|
|
151
149
|
content,
|
|
152
150
|
kind: "background"
|
|
153
151
|
}).catch(() => void 0);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"factory.d.ts","sourceRoot":"","sources":["../../../src/tool-factories/agent-spawner/factory.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAmBvD,OAAO,EAGH,KAAK,kBAAkB,EAE1B,MAAM,cAAc,CAAC;AAkCtB,eAAO,MAAM,wBAAwB,EAAE,WAAW,CAAC,kBAAkB,
|
|
1
|
+
{"version":3,"file":"factory.d.ts","sourceRoot":"","sources":["../../../src/tool-factories/agent-spawner/factory.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAmBvD,OAAO,EAGH,KAAK,kBAAkB,EAE1B,MAAM,cAAc,CAAC;AAkCtB,eAAO,MAAM,wBAAwB,EAAE,WAAW,CAAC,kBAAkB,CA+XpE,CAAC"}
|
|
@@ -39,9 +39,7 @@ const agentSpawnerToolsFactory = {
|
|
|
39
39
|
const { toolServices, taskForker, logger } = options;
|
|
40
40
|
if (toolServices.taskForker !== taskForker) {
|
|
41
41
|
toolServices.taskForker = taskForker;
|
|
42
|
-
logger.debug(
|
|
43
|
-
"AgentSpawnerRuntime attached as taskForker for context:fork skill support"
|
|
44
|
-
);
|
|
42
|
+
logger.debug("AgentSpawnerRuntime attached as taskForker");
|
|
45
43
|
}
|
|
46
44
|
};
|
|
47
45
|
const updateWorkspaceRootHint = (runtime, context) => {
|
|
@@ -137,7 +135,7 @@ const agentSpawnerToolsFactory = {
|
|
|
137
135
|
];
|
|
138
136
|
agent.isSessionBusy(sessionId).then((isBusy) => {
|
|
139
137
|
if (isBusy) {
|
|
140
|
-
agent.
|
|
138
|
+
agent.steer(sessionId, {
|
|
141
139
|
content,
|
|
142
140
|
kind: "background"
|
|
143
141
|
}).catch(() => void 0);
|
|
@@ -21,16 +21,16 @@ __export(llm_resolution_exports, {
|
|
|
21
21
|
resolveSubAgentLLM: () => resolveSubAgentLLM
|
|
22
22
|
});
|
|
23
23
|
module.exports = __toCommonJS(llm_resolution_exports);
|
|
24
|
-
var
|
|
24
|
+
var import_llm = require("@dexto/llm");
|
|
25
25
|
function resolveSubAgentLLM(options) {
|
|
26
26
|
const { subAgentLLM, parentLLM, subAgentId } = options;
|
|
27
27
|
const agentLabel = subAgentId ? `'${subAgentId}'` : "sub-agent";
|
|
28
28
|
const subAgentProvider = subAgentLLM.provider;
|
|
29
29
|
const subAgentModel = subAgentLLM.model;
|
|
30
30
|
const parentProvider = parentLLM.provider;
|
|
31
|
-
if ((0,
|
|
31
|
+
if ((0, import_llm.hasAllRegistryModelsSupport)(parentProvider)) {
|
|
32
32
|
try {
|
|
33
|
-
const transformedModel = (0,
|
|
33
|
+
const transformedModel = (0, import_llm.transformModelNameForProvider)(
|
|
34
34
|
subAgentModel,
|
|
35
35
|
subAgentProvider,
|
|
36
36
|
parentProvider
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { hasAllRegistryModelsSupport, transformModelNameForProvider } from "@dexto/
|
|
1
|
+
import { hasAllRegistryModelsSupport, transformModelNameForProvider } from "@dexto/llm";
|
|
2
2
|
function resolveSubAgentLLM(options) {
|
|
3
3
|
const { subAgentLLM, parentLLM, subAgentId } = options;
|
|
4
4
|
const agentLabel = subAgentId ? `'${subAgentId}'` : "sub-agent";
|
|
@@ -33,6 +33,7 @@ __export(runtime_exports, {
|
|
|
33
33
|
module.exports = __toCommonJS(runtime_exports);
|
|
34
34
|
var import_crypto = require("crypto");
|
|
35
35
|
var import_core = require("@dexto/core");
|
|
36
|
+
var import_llm = require("@dexto/llm");
|
|
36
37
|
var import_AgentRuntime = require("../../runtime/AgentRuntime.js");
|
|
37
38
|
var import_approval_delegation = require("../../runtime/approval-delegation.js");
|
|
38
39
|
var import_loader = require("../../config/loader.js");
|
|
@@ -62,15 +63,15 @@ class AgentSpawnerRuntime {
|
|
|
62
63
|
logger;
|
|
63
64
|
workspaceRootHint;
|
|
64
65
|
selectLowestReasoningVariant(provider, model, preferredVariant) {
|
|
65
|
-
const profile = (0,
|
|
66
|
+
const profile = (0, import_llm.getReasoningProfile)(provider, model);
|
|
66
67
|
if (!profile.capable || profile.supportedVariants.length === 0) {
|
|
67
68
|
return void 0;
|
|
68
69
|
}
|
|
69
|
-
if ((0,
|
|
70
|
+
if ((0, import_llm.supportsReasoningVariant)(profile, preferredVariant)) {
|
|
70
71
|
return preferredVariant;
|
|
71
72
|
}
|
|
72
73
|
for (const variant of REASONING_VARIANT_FALLBACK_ORDER) {
|
|
73
|
-
if ((0,
|
|
74
|
+
if ((0, import_llm.supportsReasoningVariant)(profile, variant)) {
|
|
74
75
|
return variant;
|
|
75
76
|
}
|
|
76
77
|
}
|
|
@@ -307,7 +308,7 @@ class AgentSpawnerRuntime {
|
|
|
307
308
|
* @param input.task - Short task description (for logging/UI)
|
|
308
309
|
* @param input.instructions - Full prompt sent to sub-agent
|
|
309
310
|
* @param input.agentId - Optional agent ID from registry
|
|
310
|
-
* @param input.autoApprove - Optional override for auto-approve
|
|
311
|
+
* @param input.autoApprove - Optional override for auto-approve
|
|
311
312
|
* @param input.timeout - Optional task timeout in milliseconds
|
|
312
313
|
* @param input.toolCallId - Optional tool call ID for progress events
|
|
313
314
|
* @param input.sessionId - Optional session ID for progress events
|
|
@@ -346,12 +347,12 @@ class AgentSpawnerRuntime {
|
|
|
346
347
|
}
|
|
347
348
|
/**
|
|
348
349
|
* Fork execution to an isolated subagent.
|
|
349
|
-
* Implements TaskForker interface for
|
|
350
|
+
* Implements TaskForker interface for isolated subagent execution.
|
|
350
351
|
*
|
|
351
352
|
* @param options.task - Short description for UI/logs
|
|
352
353
|
* @param options.instructions - Full instructions for the subagent
|
|
353
354
|
* @param options.agentId - Optional agent ID from registry to use for execution
|
|
354
|
-
* @param options.autoApprove - Auto-approve tool calls
|
|
355
|
+
* @param options.autoApprove - Auto-approve tool calls
|
|
355
356
|
* @param options.toolCallId - Optional tool call ID for progress events
|
|
356
357
|
* @param options.sessionId - Optional session ID for progress events
|
|
357
358
|
*/
|
|
@@ -721,13 +722,8 @@ class AgentSpawnerRuntime {
|
|
|
721
722
|
...parentToolPolicies?.alwaysAllow ?? [],
|
|
722
723
|
...subAgentPolicies?.alwaysAllow ?? []
|
|
723
724
|
];
|
|
724
|
-
const alwaysDeny = [
|
|
725
|
-
...parentToolPolicies?.alwaysDeny ?? [],
|
|
726
|
-
...subAgentPolicies?.alwaysDeny ?? []
|
|
727
|
-
];
|
|
728
725
|
return {
|
|
729
|
-
alwaysAllow: Array.from(new Set(alwaysAllow))
|
|
730
|
-
alwaysDeny: Array.from(new Set(alwaysDeny))
|
|
726
|
+
alwaysAllow: Array.from(new Set(alwaysAllow))
|
|
731
727
|
};
|
|
732
728
|
};
|
|
733
729
|
const inheritedLoggerConfig = await (async () => {
|
|
@@ -49,7 +49,7 @@ export declare class AgentSpawnerRuntime implements TaskForker {
|
|
|
49
49
|
* @param input.task - Short task description (for logging/UI)
|
|
50
50
|
* @param input.instructions - Full prompt sent to sub-agent
|
|
51
51
|
* @param input.agentId - Optional agent ID from registry
|
|
52
|
-
* @param input.autoApprove - Optional override for auto-approve
|
|
52
|
+
* @param input.autoApprove - Optional override for auto-approve
|
|
53
53
|
* @param input.timeout - Optional task timeout in milliseconds
|
|
54
54
|
* @param input.toolCallId - Optional tool call ID for progress events
|
|
55
55
|
* @param input.sessionId - Optional session ID for progress events
|
|
@@ -65,12 +65,12 @@ export declare class AgentSpawnerRuntime implements TaskForker {
|
|
|
65
65
|
}): Promise<SpawnAgentOutput>;
|
|
66
66
|
/**
|
|
67
67
|
* Fork execution to an isolated subagent.
|
|
68
|
-
* Implements TaskForker interface for
|
|
68
|
+
* Implements TaskForker interface for isolated subagent execution.
|
|
69
69
|
*
|
|
70
70
|
* @param options.task - Short description for UI/logs
|
|
71
71
|
* @param options.instructions - Full instructions for the subagent
|
|
72
72
|
* @param options.agentId - Optional agent ID from registry to use for execution
|
|
73
|
-
* @param options.autoApprove - Auto-approve tool calls
|
|
73
|
+
* @param options.autoApprove - Auto-approve tool calls
|
|
74
74
|
* @param options.toolCallId - Optional tool call ID for progress events
|
|
75
75
|
* @param options.sessionId - Optional session ID for progress events
|
|
76
76
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../../../src/tool-factories/agent-spawner/runtime.ts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M,CAAC;QACrB,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,WAAW,CAAC,EAAE,OAAO,CAAC;QACtB,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,SAAS,CAAC,EAAE,MAAM,CAAC;KACtB,GAAG,OAAO,CAAC,gBAAgB,CAAC;IA8C7B;;;;;;;;;;OAUG;IACG,IAAI,CAAC,OAAO,EAAE;QAChB,IAAI,EAAE,MAAM,CAAC;QACb,YAAY,EAAE,MAAM,CAAC;QACrB,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,WAAW,CAAC,EAAE,OAAO,CAAC;QACtB,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,SAAS,CAAC,EAAE,MAAM,CAAC;KACtB,GAAG,OAAO,CAAC;QAAE,OAAO,EAAE,OAAO,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IAIpE;;;;;OAKG;IACH,OAAO,CAAC,qBAAqB;IA+G7B;;OAEG;YACW,oBAAoB;IA2BlC,OAAO,CAAC,sBAAsB;IAuB9B;;OAEG;IACH,OAAO,CAAC,UAAU;IAsBlB;;OAEG;YACW,oBAAoB;IA4RlC;;;;;;;OAOG;YACW,mBAAmB;IA4KjC;;;OAGG;IACG,kBAAkB,IAAI,OAAO,CAAC,kBAAkB,EAAE,CAAC;IAqCzD;;OAEG;IACG,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;CAIjC"}
|
|
@@ -1,10 +1,6 @@
|
|
|
1
1
|
import { randomUUID } from "crypto";
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
ErrorType,
|
|
5
|
-
getReasoningProfile,
|
|
6
|
-
supportsReasoningVariant
|
|
7
|
-
} from "@dexto/core";
|
|
2
|
+
import { DextoRuntimeError, ErrorType } from "@dexto/core";
|
|
3
|
+
import { getReasoningProfile, supportsReasoningVariant } from "@dexto/llm";
|
|
8
4
|
import { AgentRuntime } from "../../runtime/AgentRuntime.js";
|
|
9
5
|
import { createDelegatingApprovalHandler } from "../../runtime/approval-delegation.js";
|
|
10
6
|
import { loadAgentConfig } from "../../config/loader.js";
|
|
@@ -279,7 +275,7 @@ class AgentSpawnerRuntime {
|
|
|
279
275
|
* @param input.task - Short task description (for logging/UI)
|
|
280
276
|
* @param input.instructions - Full prompt sent to sub-agent
|
|
281
277
|
* @param input.agentId - Optional agent ID from registry
|
|
282
|
-
* @param input.autoApprove - Optional override for auto-approve
|
|
278
|
+
* @param input.autoApprove - Optional override for auto-approve
|
|
283
279
|
* @param input.timeout - Optional task timeout in milliseconds
|
|
284
280
|
* @param input.toolCallId - Optional tool call ID for progress events
|
|
285
281
|
* @param input.sessionId - Optional session ID for progress events
|
|
@@ -318,12 +314,12 @@ class AgentSpawnerRuntime {
|
|
|
318
314
|
}
|
|
319
315
|
/**
|
|
320
316
|
* Fork execution to an isolated subagent.
|
|
321
|
-
* Implements TaskForker interface for
|
|
317
|
+
* Implements TaskForker interface for isolated subagent execution.
|
|
322
318
|
*
|
|
323
319
|
* @param options.task - Short description for UI/logs
|
|
324
320
|
* @param options.instructions - Full instructions for the subagent
|
|
325
321
|
* @param options.agentId - Optional agent ID from registry to use for execution
|
|
326
|
-
* @param options.autoApprove - Auto-approve tool calls
|
|
322
|
+
* @param options.autoApprove - Auto-approve tool calls
|
|
327
323
|
* @param options.toolCallId - Optional tool call ID for progress events
|
|
328
324
|
* @param options.sessionId - Optional session ID for progress events
|
|
329
325
|
*/
|
|
@@ -693,13 +689,8 @@ class AgentSpawnerRuntime {
|
|
|
693
689
|
...parentToolPolicies?.alwaysAllow ?? [],
|
|
694
690
|
...subAgentPolicies?.alwaysAllow ?? []
|
|
695
691
|
];
|
|
696
|
-
const alwaysDeny = [
|
|
697
|
-
...parentToolPolicies?.alwaysDeny ?? [],
|
|
698
|
-
...subAgentPolicies?.alwaysDeny ?? []
|
|
699
|
-
];
|
|
700
692
|
return {
|
|
701
|
-
alwaysAllow: Array.from(new Set(alwaysAllow))
|
|
702
|
-
alwaysDeny: Array.from(new Set(alwaysDeny))
|
|
693
|
+
alwaysAllow: Array.from(new Set(alwaysAllow))
|
|
703
694
|
};
|
|
704
695
|
};
|
|
705
696
|
const inheritedLoggerConfig = await (async () => {
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Zod schemas for the agent spawner tools factory configuration and inputs.
|
|
5
5
|
*/
|
|
6
|
-
import type { ReasoningVariant } from '@dexto/
|
|
6
|
+
import type { ReasoningVariant } from '@dexto/llm';
|
|
7
7
|
import { z } from 'zod';
|
|
8
8
|
export declare const DEFAULT_SUB_AGENT_MAX_ITERATIONS = 100;
|
|
9
9
|
export declare const DEFAULT_SUB_AGENT_REASONING_VARIANT: ReasoningVariant;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../../src/tool-factories/agent-spawner/schemas.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../../src/tool-factories/agent-spawner/schemas.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AACnD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB,eAAO,MAAM,gCAAgC,MAAM,CAAC;AACpD,eAAO,MAAM,mCAAmC,EAAE,gBAA6B,CAAC;AAEhF;;GAEG;AACH,eAAO,MAAM,wBAAwB;;;;;;;;;kBAiF6B,CAAC;AAEnE,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAM3E;;;;;GAKG;AACH,eAAO,MAAM,qBAAqB;;;;kBAcrB,CAAC;AAEd,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,qBAAqB,CAAC,CAAC"}
|