@defai.digital/agent-domain 13.0.3
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/LICENSE +214 -0
- package/dist/enhanced-executor.d.ts +170 -0
- package/dist/enhanced-executor.d.ts.map +1 -0
- package/dist/enhanced-executor.js +1072 -0
- package/dist/enhanced-executor.js.map +1 -0
- package/dist/executor.d.ts +120 -0
- package/dist/executor.d.ts.map +1 -0
- package/dist/executor.js +929 -0
- package/dist/executor.js.map +1 -0
- package/dist/index.d.ts +25 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +34 -0
- package/dist/index.js.map +1 -0
- package/dist/loader.d.ts +50 -0
- package/dist/loader.d.ts.map +1 -0
- package/dist/loader.js +160 -0
- package/dist/loader.js.map +1 -0
- package/dist/persistent-registry.d.ts +105 -0
- package/dist/persistent-registry.d.ts.map +1 -0
- package/dist/persistent-registry.js +183 -0
- package/dist/persistent-registry.js.map +1 -0
- package/dist/production-factories.d.ts +70 -0
- package/dist/production-factories.d.ts.map +1 -0
- package/dist/production-factories.js +434 -0
- package/dist/production-factories.js.map +1 -0
- package/dist/prompt-executor.d.ts +119 -0
- package/dist/prompt-executor.d.ts.map +1 -0
- package/dist/prompt-executor.js +211 -0
- package/dist/prompt-executor.js.map +1 -0
- package/dist/registry.d.ts +57 -0
- package/dist/registry.d.ts.map +1 -0
- package/dist/registry.js +123 -0
- package/dist/registry.js.map +1 -0
- package/dist/selection-service.d.ts +74 -0
- package/dist/selection-service.d.ts.map +1 -0
- package/dist/selection-service.js +322 -0
- package/dist/selection-service.js.map +1 -0
- package/dist/selector.d.ts +51 -0
- package/dist/selector.d.ts.map +1 -0
- package/dist/selector.js +249 -0
- package/dist/selector.js.map +1 -0
- package/dist/stub-checkpoint.d.ts +23 -0
- package/dist/stub-checkpoint.d.ts.map +1 -0
- package/dist/stub-checkpoint.js +137 -0
- package/dist/stub-checkpoint.js.map +1 -0
- package/dist/stub-delegation-tracker.d.ts +25 -0
- package/dist/stub-delegation-tracker.d.ts.map +1 -0
- package/dist/stub-delegation-tracker.js +118 -0
- package/dist/stub-delegation-tracker.js.map +1 -0
- package/dist/stub-parallel-executor.d.ts +19 -0
- package/dist/stub-parallel-executor.d.ts.map +1 -0
- package/dist/stub-parallel-executor.js +176 -0
- package/dist/stub-parallel-executor.js.map +1 -0
- package/dist/types.d.ts +614 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +15 -0
- package/dist/types.js.map +1 -0
- package/dist/workflow-templates.d.ts +117 -0
- package/dist/workflow-templates.d.ts.map +1 -0
- package/dist/workflow-templates.js +342 -0
- package/dist/workflow-templates.js.map +1 -0
- package/package.json +51 -0
- package/src/enhanced-executor.ts +1395 -0
- package/src/executor.ts +1153 -0
- package/src/index.ts +172 -0
- package/src/loader.ts +191 -0
- package/src/persistent-registry.ts +235 -0
- package/src/production-factories.ts +613 -0
- package/src/prompt-executor.ts +310 -0
- package/src/registry.ts +167 -0
- package/src/selection-service.ts +411 -0
- package/src/selector.ts +299 -0
- package/src/stub-checkpoint.ts +187 -0
- package/src/stub-delegation-tracker.ts +161 -0
- package/src/stub-parallel-executor.ts +224 -0
- package/src/types.ts +784 -0
- package/src/workflow-templates.ts +393 -0
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Prompt Executor Implementation
|
|
3
|
+
*
|
|
4
|
+
* Bridges the agent domain with LLM providers for real prompt execution.
|
|
5
|
+
* This file provides both a stub executor for testing and a factory
|
|
6
|
+
* for creating real executors with provider integration.
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* Stub prompt executor for testing and development
|
|
10
|
+
* Returns mock responses without calling real providers
|
|
11
|
+
*
|
|
12
|
+
* WARNING: This executor returns fake responses. For production use,
|
|
13
|
+
* inject a real PromptExecutor via config.promptExecutor.
|
|
14
|
+
*/
|
|
15
|
+
export class StubPromptExecutor {
|
|
16
|
+
defaultProvider;
|
|
17
|
+
hasWarnedOnce = false;
|
|
18
|
+
constructor(defaultProvider = 'claude') {
|
|
19
|
+
this.defaultProvider = defaultProvider;
|
|
20
|
+
}
|
|
21
|
+
async execute(request) {
|
|
22
|
+
// Warn once on first use (not on every call to avoid log spam)
|
|
23
|
+
if (!this.hasWarnedOnce) {
|
|
24
|
+
console.warn('[WARN] StubPromptExecutor: Using mock responses. ' +
|
|
25
|
+
'For production, inject a real PromptExecutor via config.promptExecutor.');
|
|
26
|
+
this.hasWarnedOnce = true;
|
|
27
|
+
}
|
|
28
|
+
const startTime = Date.now();
|
|
29
|
+
// Simulate some processing time
|
|
30
|
+
await new Promise((resolve) => setTimeout(resolve, 10));
|
|
31
|
+
return {
|
|
32
|
+
success: true,
|
|
33
|
+
content: `[Stub Response] This is a mock response for prompt: "${request.prompt.substring(0, 100)}..."`,
|
|
34
|
+
provider: request.provider ?? this.defaultProvider,
|
|
35
|
+
model: request.model ?? 'stub-model',
|
|
36
|
+
latencyMs: Date.now() - startTime,
|
|
37
|
+
usage: {
|
|
38
|
+
inputTokens: Math.ceil(request.prompt.length / 4),
|
|
39
|
+
outputTokens: 50,
|
|
40
|
+
totalTokens: Math.ceil(request.prompt.length / 4) + 50,
|
|
41
|
+
},
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
async isProviderAvailable(_providerId) {
|
|
45
|
+
return true;
|
|
46
|
+
}
|
|
47
|
+
async getAvailableProviders() {
|
|
48
|
+
return [this.defaultProvider];
|
|
49
|
+
}
|
|
50
|
+
getDefaultProvider() {
|
|
51
|
+
return this.defaultProvider;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Real prompt executor that uses the provider registry
|
|
56
|
+
*/
|
|
57
|
+
export class ProviderPromptExecutor {
|
|
58
|
+
registry;
|
|
59
|
+
config;
|
|
60
|
+
constructor(registry, config) {
|
|
61
|
+
this.registry = registry;
|
|
62
|
+
this.config = config;
|
|
63
|
+
}
|
|
64
|
+
async execute(request) {
|
|
65
|
+
const startTime = Date.now();
|
|
66
|
+
const providerId = request.provider ?? this.config.defaultProvider;
|
|
67
|
+
// Get the provider
|
|
68
|
+
const provider = this.registry.get(providerId);
|
|
69
|
+
if (provider === undefined) {
|
|
70
|
+
return {
|
|
71
|
+
success: false,
|
|
72
|
+
error: `Provider "${providerId}" not found`,
|
|
73
|
+
errorCode: 'PROVIDER_NOT_FOUND',
|
|
74
|
+
latencyMs: Date.now() - startTime,
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
// Check if provider is available
|
|
78
|
+
const isAvailable = await provider.isAvailable();
|
|
79
|
+
if (!isAvailable) {
|
|
80
|
+
return {
|
|
81
|
+
success: false,
|
|
82
|
+
error: `Provider "${providerId}" is not available (CLI not installed or not in PATH)`,
|
|
83
|
+
errorCode: 'PROVIDER_UNAVAILABLE',
|
|
84
|
+
provider: providerId,
|
|
85
|
+
latencyMs: Date.now() - startTime,
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
// Determine model to use
|
|
89
|
+
let model = request.model;
|
|
90
|
+
if (!model) {
|
|
91
|
+
// Use configured default for this provider, or provider's default model
|
|
92
|
+
model = this.config.defaultModels?.[providerId];
|
|
93
|
+
if (!model) {
|
|
94
|
+
const models = provider.getModels();
|
|
95
|
+
const defaultModel = models.find((m) => m.isDefault) ?? models[0];
|
|
96
|
+
model = defaultModel?.modelId;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
if (!model) {
|
|
100
|
+
return {
|
|
101
|
+
success: false,
|
|
102
|
+
error: `No model specified and no default model available for provider "${providerId}"`,
|
|
103
|
+
errorCode: 'NO_MODEL',
|
|
104
|
+
provider: providerId,
|
|
105
|
+
latencyMs: Date.now() - startTime,
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
try {
|
|
109
|
+
// Build completion request with only defined properties
|
|
110
|
+
const completionRequest = {
|
|
111
|
+
requestId: crypto.randomUUID(),
|
|
112
|
+
model,
|
|
113
|
+
messages: [{ role: 'user', content: request.prompt }],
|
|
114
|
+
};
|
|
115
|
+
if (request.systemPrompt !== undefined) {
|
|
116
|
+
completionRequest.systemPrompt = request.systemPrompt;
|
|
117
|
+
}
|
|
118
|
+
if (request.maxTokens !== undefined) {
|
|
119
|
+
completionRequest.maxTokens = request.maxTokens;
|
|
120
|
+
}
|
|
121
|
+
if (request.temperature !== undefined) {
|
|
122
|
+
completionRequest.temperature = request.temperature;
|
|
123
|
+
}
|
|
124
|
+
const timeout = request.timeout ?? this.config.defaultTimeout;
|
|
125
|
+
if (timeout !== undefined) {
|
|
126
|
+
completionRequest.timeout = timeout;
|
|
127
|
+
}
|
|
128
|
+
// Execute the completion
|
|
129
|
+
const response = await provider.complete(completionRequest);
|
|
130
|
+
if (response.success) {
|
|
131
|
+
return {
|
|
132
|
+
success: true,
|
|
133
|
+
content: response.content,
|
|
134
|
+
provider: providerId,
|
|
135
|
+
model: response.model ?? model,
|
|
136
|
+
latencyMs: response.latencyMs,
|
|
137
|
+
usage: response.usage,
|
|
138
|
+
};
|
|
139
|
+
}
|
|
140
|
+
else {
|
|
141
|
+
return {
|
|
142
|
+
success: false,
|
|
143
|
+
error: response.error?.message ?? 'Unknown error',
|
|
144
|
+
errorCode: response.error?.category ?? 'UNKNOWN',
|
|
145
|
+
provider: providerId,
|
|
146
|
+
model,
|
|
147
|
+
latencyMs: response.latencyMs,
|
|
148
|
+
};
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
catch (error) {
|
|
152
|
+
return {
|
|
153
|
+
success: false,
|
|
154
|
+
error: error instanceof Error ? error.message : 'Unknown error',
|
|
155
|
+
errorCode: 'EXECUTION_ERROR',
|
|
156
|
+
provider: providerId,
|
|
157
|
+
model,
|
|
158
|
+
latencyMs: Date.now() - startTime,
|
|
159
|
+
};
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
async isProviderAvailable(providerId) {
|
|
163
|
+
const provider = this.registry.get(providerId);
|
|
164
|
+
if (provider === undefined) {
|
|
165
|
+
return false;
|
|
166
|
+
}
|
|
167
|
+
return provider.isAvailable();
|
|
168
|
+
}
|
|
169
|
+
async getAvailableProviders() {
|
|
170
|
+
const providerIds = this.registry.getProviderIds();
|
|
171
|
+
const available = [];
|
|
172
|
+
for (const providerId of providerIds) {
|
|
173
|
+
const provider = this.registry.get(providerId);
|
|
174
|
+
if (provider !== undefined) {
|
|
175
|
+
const isAvailable = await provider.isAvailable();
|
|
176
|
+
if (isAvailable) {
|
|
177
|
+
available.push(providerId);
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
return available;
|
|
182
|
+
}
|
|
183
|
+
getDefaultProvider() {
|
|
184
|
+
return this.config.defaultProvider;
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
/**
|
|
188
|
+
* Creates a stub prompt executor for testing
|
|
189
|
+
*/
|
|
190
|
+
export function createStubPromptExecutor(defaultProvider = 'claude') {
|
|
191
|
+
return new StubPromptExecutor(defaultProvider);
|
|
192
|
+
}
|
|
193
|
+
/**
|
|
194
|
+
* Creates a real prompt executor using a provider registry
|
|
195
|
+
*
|
|
196
|
+
* @example
|
|
197
|
+
* ```typescript
|
|
198
|
+
* import { createProviderRegistry } from '@defai.digital/providers';
|
|
199
|
+
* import { createProviderPromptExecutor } from '@defai.digital/agent-domain';
|
|
200
|
+
*
|
|
201
|
+
* const registry = createProviderRegistry();
|
|
202
|
+
* const executor = createProviderPromptExecutor(registry, {
|
|
203
|
+
* defaultProvider: 'claude',
|
|
204
|
+
* defaultTimeout: 120000,
|
|
205
|
+
* });
|
|
206
|
+
* ```
|
|
207
|
+
*/
|
|
208
|
+
export function createProviderPromptExecutor(registry, config) {
|
|
209
|
+
return new ProviderPromptExecutor(registry, config);
|
|
210
|
+
}
|
|
211
|
+
//# sourceMappingURL=prompt-executor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prompt-executor.js","sourceRoot":"","sources":["../src/prompt-executor.ts"],"names":[],"mappings":"AAA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ration, lookup, and lifecycle.
|
|
5
|
+
*/
|
|
6
|
+
import { type AgentProfile } from '@defai.digital/contracts';
|
|
7
|
+
import type { AgentRegistry, AgentFilter } from './types.js';
|
|
8
|
+
/**
|
|
9
|
+
* In-memory agent registry implementation
|
|
10
|
+
*/
|
|
11
|
+
export declare class InMemoryAgentRegistry implements AgentRegistry {
|
|
12
|
+
private readonly agents;
|
|
13
|
+
/**
|
|
14
|
+
* Register a new agent profile
|
|
15
|
+
*/
|
|
16
|
+
register(profile: AgentProfile): Promise<void>;
|
|
17
|
+
/**
|
|
18
|
+
* Get an agent by ID
|
|
19
|
+
*/
|
|
20
|
+
get(agentId: string): Promise<AgentProfile | undefined>;
|
|
21
|
+
/**
|
|
22
|
+
* List all registered agents with optional filtering
|
|
23
|
+
*/
|
|
24
|
+
list(filter?: AgentFilter): Promise<AgentProfile[]>;
|
|
25
|
+
/**
|
|
26
|
+
* Update an agent profile
|
|
27
|
+
*/
|
|
28
|
+
update(agentId: string, updates: Partial<AgentProfile>): Promise<void>;
|
|
29
|
+
/**
|
|
30
|
+
* Remove an agent
|
|
31
|
+
*/
|
|
32
|
+
remove(agentId: string): Promise<void>;
|
|
33
|
+
/**
|
|
34
|
+
* Check if an agent exists
|
|
35
|
+
*/
|
|
36
|
+
exists(agentId: string): Promise<boolean>;
|
|
37
|
+
/**
|
|
38
|
+
* Clear all agents (useful for testing)
|
|
39
|
+
*/
|
|
40
|
+
clear(): void;
|
|
41
|
+
/**
|
|
42
|
+
* Get the count of registered agents
|
|
43
|
+
*/
|
|
44
|
+
get size(): number;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Agent registry error
|
|
48
|
+
*/
|
|
49
|
+
export declare class AgentRegistryError extends Error {
|
|
50
|
+
readonly code: string;
|
|
51
|
+
constructor(code: string, message: string);
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Creates a new in-memory agent registry
|
|
55
|
+
*/
|
|
56
|
+
export declare function createAgentRegistry(): AgentRegistry;
|
|
57
|
+
//# sourceMappingURL=registry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../src/registry.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EACL,KAAK,YAAY,EAGlB,MAAM,0BAA0B,CAAC;AAClC,OAAO,KAAK,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAE7D;;GAEG;AACH,qBAAa,qBAAsB,YAAW,aAAa;IACzD,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAmC;IAE1D;;OAEG;IACG,QAAQ,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC;IAuBpD;;OAEG;IACG,GAAG,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,GAAG,SAAS,CAAC;IAI7D;;OAEG;IACG,IAAI,CAAC,MAAM,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,YAAY,EAAE,CAAC;IAgCzD;;OAEG;IACG,MAAM,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,CAAC,YAAY,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;IAsB5E;;OAEG;IACG,MAAM,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAW5C;;OAEG;IACG,MAAM,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAI/C;;OAEG;IACH,KAAK,IAAI,IAAI;IAIb;;OAEG;IACH,IAAI,IAAI,IAAI,MAAM,CAEjB;CACF;AAED;;GAEG;AACH,qBAAa,kBAAmB,SAAQ,KAAK;aAEzB,IAAI,EAAE,MAAM;gBAAZ,IAAI,EAAE,MAAM,EAC5B,OAAO,EAAE,MAAM;CAKlB;AAED;;GAEG;AACH,wBAAgB,mBAAmB,IAAI,aAAa,CAEnD"}
|
package/dist/registry.js
ADDED
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Agent Registry Implementation
|
|
3
|
+
*
|
|
4
|
+
* Manages agent profile registration, lookup, and lifecycle.
|
|
5
|
+
*/
|
|
6
|
+
import { validateAgentProfile, AgentErrorCode, } from '@defai.digital/contracts';
|
|
7
|
+
/**
|
|
8
|
+
* In-memory agent registry implementation
|
|
9
|
+
*/
|
|
10
|
+
export class InMemoryAgentRegistry {
|
|
11
|
+
agents = new Map();
|
|
12
|
+
/**
|
|
13
|
+
* Register a new agent profile
|
|
14
|
+
*/
|
|
15
|
+
async register(profile) {
|
|
16
|
+
// Validate the profile
|
|
17
|
+
const validated = validateAgentProfile(profile);
|
|
18
|
+
// Check for duplicate
|
|
19
|
+
if (this.agents.has(validated.agentId)) {
|
|
20
|
+
throw new AgentRegistryError(AgentErrorCode.AGENT_VALIDATION_ERROR, `Agent with ID "${validated.agentId}" already exists`);
|
|
21
|
+
}
|
|
22
|
+
// Add timestamps
|
|
23
|
+
const now = new Date().toISOString();
|
|
24
|
+
const withTimestamps = {
|
|
25
|
+
...validated,
|
|
26
|
+
createdAt: now,
|
|
27
|
+
updatedAt: now,
|
|
28
|
+
};
|
|
29
|
+
this.agents.set(validated.agentId, withTimestamps);
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Get an agent by ID
|
|
33
|
+
*/
|
|
34
|
+
async get(agentId) {
|
|
35
|
+
return this.agents.get(agentId);
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* List all registered agents with optional filtering
|
|
39
|
+
*/
|
|
40
|
+
async list(filter) {
|
|
41
|
+
let agents = Array.from(this.agents.values());
|
|
42
|
+
if (filter !== undefined) {
|
|
43
|
+
if (filter.team !== undefined) {
|
|
44
|
+
agents = agents.filter((a) => a.team === filter.team);
|
|
45
|
+
}
|
|
46
|
+
if (filter.tags !== undefined && filter.tags.length > 0) {
|
|
47
|
+
agents = agents.filter((a) => a.tags !== undefined &&
|
|
48
|
+
filter.tags.some((tag) => a.tags.includes(tag)));
|
|
49
|
+
}
|
|
50
|
+
if (filter.enabled !== undefined) {
|
|
51
|
+
agents = agents.filter((a) => a.enabled === filter.enabled);
|
|
52
|
+
}
|
|
53
|
+
if (filter.capability !== undefined) {
|
|
54
|
+
agents = agents.filter((a) => a.capabilities !== undefined &&
|
|
55
|
+
a.capabilities.includes(filter.capability));
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
return agents;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Update an agent profile
|
|
62
|
+
*/
|
|
63
|
+
async update(agentId, updates) {
|
|
64
|
+
const existing = this.agents.get(agentId);
|
|
65
|
+
if (existing === undefined) {
|
|
66
|
+
throw new AgentRegistryError(AgentErrorCode.AGENT_NOT_FOUND, `Agent with ID "${agentId}" not found`);
|
|
67
|
+
}
|
|
68
|
+
// Merge and validate
|
|
69
|
+
const merged = {
|
|
70
|
+
...existing,
|
|
71
|
+
...updates,
|
|
72
|
+
agentId, // Cannot change ID
|
|
73
|
+
updatedAt: new Date().toISOString(),
|
|
74
|
+
};
|
|
75
|
+
const validated = validateAgentProfile(merged);
|
|
76
|
+
this.agents.set(agentId, validated);
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Remove an agent
|
|
80
|
+
*/
|
|
81
|
+
async remove(agentId) {
|
|
82
|
+
if (!this.agents.has(agentId)) {
|
|
83
|
+
throw new AgentRegistryError(AgentErrorCode.AGENT_NOT_FOUND, `Agent with ID "${agentId}" not found`);
|
|
84
|
+
}
|
|
85
|
+
this.agents.delete(agentId);
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Check if an agent exists
|
|
89
|
+
*/
|
|
90
|
+
async exists(agentId) {
|
|
91
|
+
return this.agents.has(agentId);
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Clear all agents (useful for testing)
|
|
95
|
+
*/
|
|
96
|
+
clear() {
|
|
97
|
+
this.agents.clear();
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Get the count of registered agents
|
|
101
|
+
*/
|
|
102
|
+
get size() {
|
|
103
|
+
return this.agents.size;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* Agent registry error
|
|
108
|
+
*/
|
|
109
|
+
export class AgentRegistryError extends Error {
|
|
110
|
+
code;
|
|
111
|
+
constructor(code, message) {
|
|
112
|
+
super(message);
|
|
113
|
+
this.code = code;
|
|
114
|
+
this.name = 'AgentRegistryError';
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* Creates a new in-memory agent registry
|
|
119
|
+
*/
|
|
120
|
+
export function createAgentRegistry() {
|
|
121
|
+
return new InMemoryAgentRegistry();
|
|
122
|
+
}
|
|
123
|
+
//# sourceMappingURL=registry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registry.js","sourceRoot":"","sources":["../src/registry.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAEL,oBAAoB,EACpB,cAAc,GACf,MAAM,0BAA0B,CAAC;AAGlC;;GAEG;AACH,MAAM,OAAO,qBAAqB;IACf,MAAM,GAAG,IAAI,GAAG,EAAwB,CAAC;IAE1D;;OAEG;IACH,KAAK,CAAC,QAAQ,CAAC,OAAqB;QAClC,uBAAuB;QACvB,MAAM,SAAS,GAAG,oBAAoB,CAAC,OAAO,CAAC,CAAC;QAEhD,sBAAsB;QACtB,IAAI,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,SAAS,CAAC,OAAO,CAAC,EAAE,CAAC;YACvC,MAAM,IAAI,kBAAkB,CAC1B,cAAc,CAAC,sBAAsB,EACrC,kBAAkB,SAAS,CAAC,OAAO,kBAAkB,CACtD,CAAC;QACJ,CAAC;QAED,iBAAiB;QACjB,MAAM,GAAG,GAAG,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;QACrC,MAAM,cAAc,GAAiB;YACnC,GAAG,SAAS;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,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;IAClC,CAAC;IAED;;OAEG;IACH,KAAK;QACH,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC;IACtB,CAAC;IAED;;OAEG;IACH,IAAI,IAAI;QACN,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC;IAC1B,CAAC;CACF;AAED;;GAEG;AACH,MAAM,OAAO,kBAAmB,SAAQ,KAAK;IAEzB;IADlB,YACkB,IAAY,EAC5B,OAAe;QAEf,KAAK,CAAC,OAAO,CAAC,CAAC;QAHC,SAAI,GAAJ,IAAI,CAAQ;QAI5B,IAAI,CAAC,IAAI,GAAG,oBAAoB,CAAC;IACnC,CAAC;CACF;AAED;;GAEG;AACH,MAAM,UAAU,mBAAmB;IACjC,OAAO,IAAI,qBAAqB,EAAE,CAAC;AACrC,CAAC"}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Agent Selection Service
|
|
3
|
+
*
|
|
4
|
+
* Domain service for agent recommendation and capability discovery.
|
|
5
|
+
* Implements contract-defined invariants for agent selection.
|
|
6
|
+
*
|
|
7
|
+
* Invariants:
|
|
8
|
+
* - INV-AGT-SEL-001: Selection is deterministic (same input = same output)
|
|
9
|
+
* - INV-AGT-SEL-002: Confidence scores must be between 0 and 1
|
|
10
|
+
* - INV-AGT-SEL-003: Results must be sorted by confidence descending
|
|
11
|
+
* - INV-AGT-SEL-004: Always returns at least one result (fallback to 'standard')
|
|
12
|
+
* - INV-AGT-SEL-005: exampleTasks boost confidence when matched
|
|
13
|
+
* - INV-AGT-SEL-006: notForTasks reduce confidence when matched
|
|
14
|
+
*/
|
|
15
|
+
import type { AgentRecommendRequest, AgentRecommendResult, AgentCapabilitiesRequest, AgentCapabilitiesResult } from '@defai.digital/contracts';
|
|
16
|
+
import type { AgentRegistry } from './types.js';
|
|
17
|
+
/**
|
|
18
|
+
* Selection service port interface
|
|
19
|
+
*/
|
|
20
|
+
export interface AgentSelectionServicePort {
|
|
21
|
+
/**
|
|
22
|
+
* Recommend the best agent for a task
|
|
23
|
+
*/
|
|
24
|
+
recommend(request: AgentRecommendRequest): Promise<AgentRecommendResult>;
|
|
25
|
+
/**
|
|
26
|
+
* Get all agent capabilities
|
|
27
|
+
*/
|
|
28
|
+
getCapabilities(request: AgentCapabilitiesRequest): Promise<AgentCapabilitiesResult>;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Agent Selection Service
|
|
32
|
+
*
|
|
33
|
+
* Implements deterministic agent selection based on task matching.
|
|
34
|
+
*/
|
|
35
|
+
export declare class AgentSelectionService implements AgentSelectionServicePort {
|
|
36
|
+
private readonly registry;
|
|
37
|
+
constructor(registry: AgentRegistry);
|
|
38
|
+
/**
|
|
39
|
+
* Recommend the best agent for a task
|
|
40
|
+
*
|
|
41
|
+
* Implements:
|
|
42
|
+
* - INV-AGT-SEL-001: Deterministic selection
|
|
43
|
+
* - INV-AGT-SEL-002: Confidence range [0,1]
|
|
44
|
+
* - INV-AGT-SEL-003: Sorted by confidence descending
|
|
45
|
+
* - INV-AGT-SEL-004: Fallback to 'standard'
|
|
46
|
+
*/
|
|
47
|
+
recommend(request: AgentRecommendRequest): Promise<AgentRecommendResult>;
|
|
48
|
+
/**
|
|
49
|
+
* Get all agent capabilities
|
|
50
|
+
*/
|
|
51
|
+
getCapabilities(request: AgentCapabilitiesRequest): Promise<AgentCapabilitiesResult>;
|
|
52
|
+
/**
|
|
53
|
+
* Score an agent for a task
|
|
54
|
+
*
|
|
55
|
+
* Implements:
|
|
56
|
+
* - INV-AGT-SEL-002: Confidence clamped to [0,1]
|
|
57
|
+
* - INV-AGT-SEL-005: exampleTasks boost
|
|
58
|
+
* - INV-AGT-SEL-006: notForTasks penalty
|
|
59
|
+
*/
|
|
60
|
+
private scoreAgent;
|
|
61
|
+
/**
|
|
62
|
+
* Normalize text for comparison
|
|
63
|
+
*/
|
|
64
|
+
private normalizeText;
|
|
65
|
+
/**
|
|
66
|
+
* Extract meaningful words from text
|
|
67
|
+
*/
|
|
68
|
+
private extractWords;
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Creates an agent selection service
|
|
72
|
+
*/
|
|
73
|
+
export declare function createAgentSelectionService(registry: AgentRegistry): AgentSelectionServicePort;
|
|
74
|
+
//# sourceMappingURL=selection-service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"selection-service.d.ts","sourceRoot":"","sources":["../src/selection-service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,EAEV,qBAAqB,EACrB,oBAAoB,EACpB,wBAAwB,EACxB,uBAAuB,EAExB,MAAM,0BAA0B,CAAC;AAClC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAuDhD;;GAEG;AACH,MAAM,WAAW,yBAAyB;IACxC;;OAEG;IACH,SAAS,CAAC,OAAO,EAAE,qBAAqB,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAAC;IAEzE;;OAEG;IACH,eAAe,CAAC,OAAO,EAAE,wBAAwB,GAAG,OAAO,CAAC,uBAAuB,CAAC,CAAC;CACtF;AAMD;;;;GAIG;AACH,qBAAa,qBAAsB,YAAW,yBAAyB;IACzD,OAAO,CAAC,QAAQ,CAAC,QAAQ;gBAAR,QAAQ,EAAE,aAAa;IAEpD;;;;;;;;OAQG;IACG,SAAS,CAAC,OAAO,EAAE,qBAAqB,GAAG,OAAO,CAAC,oBAAoB,CAAC;IAmD9E;;OAEG;IACG,eAAe,CAAC,OAAO,EAAE,wBAAwB,GAAG,OAAO,CAAC,uBAAuB,CAAC;IA6C1F;;;;;;;OAOG;IACH,OAAO,CAAC,UAAU;IA6JlB;;OAEG;IACH,OAAO,CAAC,aAAa;IAOrB;;OAEG;IACH,OAAO,CAAC,YAAY;CAMrB;AAMD;;GAEG;AACH,wBAAgB,2BAA2B,CACzC,QAAQ,EAAE,aAAa,GACtB,yBAAyB,CAE3B"}
|