claude-flow-novice 2.10.6 → 2.10.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/.claude/commands/cfn/CFN_LOOP_TASK_MODE.md +94 -0
- package/.claude/commands/cfn/cfn-loop.md +4 -3
- package/.claude/hooks/cfn-invoke-security-validation.sh +70 -0
- package/.claude/skills/cfn-hybrid-routing/spawn-worker.sh +43 -43
- package/claude-assets/agents/cfn-dev-team/dev-ops/docker-specialist.md +692 -0
- package/claude-assets/agents/cfn-dev-team/dev-ops/monitoring-specialist.md +739 -0
- package/claude-assets/agents/cfn-dev-team/developers/api-gateway-specialist.md +905 -0
- package/claude-assets/agents/cfn-dev-team/testers/api-testing-specialist.md +707 -0
- package/claude-assets/agents/cfn-dev-team/testers/chaos-engineering-specialist.md +901 -0
- package/claude-assets/agents/cfn-dev-team/utility/memory-leak-specialist.md +757 -0
- package/claude-assets/agents/cfn-dev-team/utility/z-ai-specialist.md +630 -0
- package/claude-assets/agents/docker-team/csuite/c-suite-template.md +529 -0
- package/claude-assets/agents/docker-team/infrastructure/team-coordinator-template.md +467 -0
- package/claude-assets/commands/cfn/CFN_LOOP_TASK_MODE.md +94 -0
- package/claude-assets/commands/cfn/cfn-loop.md +4 -3
- package/claude-assets/hooks/cfn-invoke-security-validation.sh +70 -0
- package/claude-assets/skills/cfn-hybrid-routing/spawn-worker.sh +43 -43
- package/claude-assets/skills/team-provider-routing/execute-agent.sh +76 -0
- package/claude-assets/skills/team-provider-routing/spawn-worker.sh +91 -0
- package/dist/agents/agent-loader.js +0 -315
- package/dist/agents/agent-loader.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,44 +1,44 @@
|
|
|
1
|
-
#!/usr/bin/env bash
|
|
2
|
-
set -euo pipefail
|
|
3
|
-
|
|
4
|
-
# Hybrid Routing Worker Spawner
|
|
5
|
-
# Dynamically configures and launches routing workers
|
|
6
|
-
|
|
7
|
-
CONFIG_PATH="$(dirname "$0")/config.json"
|
|
8
|
-
|
|
9
|
-
# Load configuration
|
|
10
|
-
SKILL_NAME=$(jq -r '.skill_name' "$CONFIG_PATH")
|
|
11
|
-
PRIMARY_CHANNEL=$(jq -r '.routing_strategies.primary.type' "$CONFIG_PATH")
|
|
12
|
-
SECONDARY_CHANNEL=$(jq -r '.routing_strategies.secondary.type' "$CONFIG_PATH")
|
|
13
|
-
|
|
14
|
-
# Worker spawning function
|
|
15
|
-
spawn_routing_worker() {
|
|
16
|
-
local channel_type="$1"
|
|
17
|
-
local worker_id="$2"
|
|
18
|
-
|
|
19
|
-
case "$channel_type" in
|
|
20
|
-
"redis-pubsub")
|
|
21
|
-
./.claude/skills/cfn-redis-coordination/spawn-agent.sh \
|
|
22
|
-
--skill-id "$SKILL_NAME" \
|
|
23
|
-
--agent-id "routing-worker-$worker_id" \
|
|
24
|
-
--strategy "$channel_type"
|
|
25
|
-
;;
|
|
26
|
-
"websocket")
|
|
27
|
-
./.claude/skills/cfn-agent-spawning/spawn-agent.sh \
|
|
28
|
-
--skill-id "$SKILL_NAME" \
|
|
29
|
-
--agent-id "routing-worker-$worker_id" \
|
|
30
|
-
--strategy "$channel_type"
|
|
31
|
-
;;
|
|
32
|
-
*)
|
|
33
|
-
echo "Unsupported channel type: $channel_type"
|
|
34
|
-
exit 1
|
|
35
|
-
;;
|
|
36
|
-
esac
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
# Spawn primary and secondary workers
|
|
40
|
-
spawn_routing_worker "$PRIMARY_CHANNEL" "primary"
|
|
41
|
-
spawn_routing_worker "$SECONDARY_CHANNEL" "secondary"
|
|
42
|
-
|
|
43
|
-
# Final status report
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
set -euo pipefail
|
|
3
|
+
|
|
4
|
+
# Hybrid Routing Worker Spawner
|
|
5
|
+
# Dynamically configures and launches routing workers
|
|
6
|
+
|
|
7
|
+
CONFIG_PATH="$(dirname "$0")/config.json"
|
|
8
|
+
|
|
9
|
+
# Load configuration
|
|
10
|
+
SKILL_NAME=$(jq -r '.skill_name' "$CONFIG_PATH")
|
|
11
|
+
PRIMARY_CHANNEL=$(jq -r '.routing_strategies.primary.type' "$CONFIG_PATH")
|
|
12
|
+
SECONDARY_CHANNEL=$(jq -r '.routing_strategies.secondary.type' "$CONFIG_PATH")
|
|
13
|
+
|
|
14
|
+
# Worker spawning function
|
|
15
|
+
spawn_routing_worker() {
|
|
16
|
+
local channel_type="$1"
|
|
17
|
+
local worker_id="$2"
|
|
18
|
+
|
|
19
|
+
case "$channel_type" in
|
|
20
|
+
"redis-pubsub")
|
|
21
|
+
./.claude/skills/cfn-redis-coordination/spawn-agent.sh \
|
|
22
|
+
--skill-id "$SKILL_NAME" \
|
|
23
|
+
--agent-id "routing-worker-$worker_id" \
|
|
24
|
+
--strategy "$channel_type"
|
|
25
|
+
;;
|
|
26
|
+
"websocket")
|
|
27
|
+
./.claude/skills/cfn-agent-spawning/spawn-agent.sh \
|
|
28
|
+
--skill-id "$SKILL_NAME" \
|
|
29
|
+
--agent-id "routing-worker-$worker_id" \
|
|
30
|
+
--strategy "$channel_type"
|
|
31
|
+
;;
|
|
32
|
+
*)
|
|
33
|
+
echo "Unsupported channel type: $channel_type"
|
|
34
|
+
exit 1
|
|
35
|
+
;;
|
|
36
|
+
esac
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
# Spawn primary and secondary workers
|
|
40
|
+
spawn_routing_worker "$PRIMARY_CHANNEL" "primary"
|
|
41
|
+
spawn_routing_worker "$SECONDARY_CHANNEL" "secondary"
|
|
42
|
+
|
|
43
|
+
# Final status report
|
|
44
44
|
echo "Hybrid Routing Workers Spawned Successfully"
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
set -euo pipefail
|
|
3
|
+
|
|
4
|
+
# Load team providers configuration
|
|
5
|
+
PROVIDERS_CONFIG="/mnt/c/Users/masha/Documents/claude-flow-novice/planning/team-providers.json"
|
|
6
|
+
|
|
7
|
+
# Function to validate provider configurations
|
|
8
|
+
validate_provider_config() {
|
|
9
|
+
local team="$1"
|
|
10
|
+
local role="$2" # coordinator or workers
|
|
11
|
+
|
|
12
|
+
# Validate JSON configuration
|
|
13
|
+
if ! jq -e ".teams.${team}.${role}" "$PROVIDERS_CONFIG" &>/dev/null; then
|
|
14
|
+
echo "Error: Invalid configuration for team=${team}, role=${role}"
|
|
15
|
+
return 1
|
|
16
|
+
fi
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
# Function to determine agent routing
|
|
20
|
+
route_agent() {
|
|
21
|
+
local team="$1"
|
|
22
|
+
local agent_type="$2" # coordinator or worker
|
|
23
|
+
local complexity="${3:-simple}"
|
|
24
|
+
|
|
25
|
+
# Validate configuration
|
|
26
|
+
if ! validate_provider_config "$team" "$agent_type"; then
|
|
27
|
+
echo "Provider configuration validation failed"
|
|
28
|
+
return 1
|
|
29
|
+
fi
|
|
30
|
+
|
|
31
|
+
# Select provider based on configuration
|
|
32
|
+
local provider=$(jq -r ".teams.${team}.${agent_type}.provider" "$PROVIDERS_CONFIG")
|
|
33
|
+
local model=$(jq -r ".teams.${team}.${agent_type}.model" "$PROVIDERS_CONFIG")
|
|
34
|
+
|
|
35
|
+
# Routing logic
|
|
36
|
+
case "$provider" in
|
|
37
|
+
anthropic)
|
|
38
|
+
echo "Routing ${agent_type} for ${team} to Claude (${model})"
|
|
39
|
+
# Claude routing logic: Use ${model} for agent routing
|
|
40
|
+
;;
|
|
41
|
+
zai)
|
|
42
|
+
echo "Routing ${agent_type} for ${team} to Z.ai (${model})"
|
|
43
|
+
# Z.ai routing logic
|
|
44
|
+
;;
|
|
45
|
+
*)
|
|
46
|
+
echo "Unsupported provider: ${provider}"
|
|
47
|
+
return 1
|
|
48
|
+
;;
|
|
49
|
+
esac
|
|
50
|
+
|
|
51
|
+
# Enhanced logging and context injection
|
|
52
|
+
echo "Agent Routing Details:"
|
|
53
|
+
echo " Team: ${team}"
|
|
54
|
+
echo " Type: ${agent_type}"
|
|
55
|
+
echo " Provider: ${provider}"
|
|
56
|
+
echo " Model: ${model}"
|
|
57
|
+
echo " Complexity: ${complexity}"
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
# Main execution
|
|
61
|
+
main() {
|
|
62
|
+
if [[ $# -lt 2 ]]; then
|
|
63
|
+
echo "Usage: $0 <team> <agent_type> [complexity]"
|
|
64
|
+
exit 1
|
|
65
|
+
fi
|
|
66
|
+
|
|
67
|
+
local team="$1"
|
|
68
|
+
local agent_type="$2"
|
|
69
|
+
local complexity="${3:-simple}"
|
|
70
|
+
|
|
71
|
+
# Call routing function
|
|
72
|
+
route_agent "$team" "$agent_type" "$complexity"
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
# Execute main function
|
|
76
|
+
main "$@"
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
set -eu
|
|
3
|
+
|
|
4
|
+
# Load team providers configuration
|
|
5
|
+
PROVIDERS_CONFIG="/mnt/c/Users/masha/Documents/claude-flow-novice/planning/team-providers.json"
|
|
6
|
+
|
|
7
|
+
# Function to validate provider configuration
|
|
8
|
+
validate_provider_config() {
|
|
9
|
+
local team="$1"
|
|
10
|
+
local role="$2" # coordinator or workers
|
|
11
|
+
|
|
12
|
+
# Use jq to validate JSON structure and extract provider details
|
|
13
|
+
if ! jq -e ".teams.${team}.${role}" "$PROVIDERS_CONFIG" &>/dev/null; then
|
|
14
|
+
echo "Error: Invalid or missing provider configuration for team=${team}, role=${role}"
|
|
15
|
+
exit 1
|
|
16
|
+
fi
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
# Function to select appropriate model based on complexity
|
|
20
|
+
select_model() {
|
|
21
|
+
local team="$1"
|
|
22
|
+
local complexity="$2" # simple or complex
|
|
23
|
+
|
|
24
|
+
# Retrieve model based on complexity and team configuration
|
|
25
|
+
local model=$(jq -r ".teams.${team}.workers.models.${complexity}" "$PROVIDERS_CONFIG")
|
|
26
|
+
echo "$model"
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
# Main worker spawning logic
|
|
30
|
+
spawn_worker() {
|
|
31
|
+
local team="$1"
|
|
32
|
+
local complexity="${2:-simple}"
|
|
33
|
+
local provider_mode="${3:-auto}"
|
|
34
|
+
|
|
35
|
+
# Validate input parameters
|
|
36
|
+
validate_provider_config "$team" "workers"
|
|
37
|
+
|
|
38
|
+
# Retrieve provider details
|
|
39
|
+
local provider=$(jq -r ".teams.${team}.workers.provider" "$PROVIDERS_CONFIG")
|
|
40
|
+
local api_key_env=$(jq -r ".teams.${team}.workers.apiKeyEnv" "$PROVIDERS_CONFIG")
|
|
41
|
+
|
|
42
|
+
# Select model dynamically
|
|
43
|
+
local model=$(select_model "$team" "$complexity")
|
|
44
|
+
|
|
45
|
+
# Provider routing logic
|
|
46
|
+
case "$provider_mode" in
|
|
47
|
+
auto)
|
|
48
|
+
# Use provider routing rules
|
|
49
|
+
case "$provider" in
|
|
50
|
+
zai)
|
|
51
|
+
echo "Spawning Z.ai worker for team ${team} (Model: ${model})"
|
|
52
|
+
# Add Z.ai specific worker spawning logic here
|
|
53
|
+
;;
|
|
54
|
+
anthropic)
|
|
55
|
+
echo "Spawning Anthropic worker for team ${team} (Model: ${model})"
|
|
56
|
+
# Add Anthropic specific worker spawning logic here
|
|
57
|
+
;;
|
|
58
|
+
*)
|
|
59
|
+
echo "Unsupported provider: ${provider}"
|
|
60
|
+
exit 1
|
|
61
|
+
;;
|
|
62
|
+
esac
|
|
63
|
+
;;
|
|
64
|
+
zai)
|
|
65
|
+
echo "Force spawning Z.ai worker for team ${team} (Model: ${model})"
|
|
66
|
+
# Add Z.ai specific worker spawning logic here
|
|
67
|
+
;;
|
|
68
|
+
anthropic)
|
|
69
|
+
echo "Force spawning Anthropic worker for team ${team} (Model: ${model})"
|
|
70
|
+
# Add Anthropic specific worker spawning logic here
|
|
71
|
+
;;
|
|
72
|
+
*)
|
|
73
|
+
echo "Invalid provider mode: ${provider_mode}"
|
|
74
|
+
exit 1
|
|
75
|
+
;;
|
|
76
|
+
esac
|
|
77
|
+
|
|
78
|
+
# Export API key for use in spawning
|
|
79
|
+
export "${api_key_env}"
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
# Allow script to be used as a function or executed directly
|
|
83
|
+
if [[ "${BASH_SOURCE[0]}" == "${0}" ]]; then
|
|
84
|
+
# Script is being run directly
|
|
85
|
+
if [[ $# -lt 1 ]]; then
|
|
86
|
+
echo "Usage: $0 <team> [complexity] [provider_mode]"
|
|
87
|
+
exit 1
|
|
88
|
+
fi
|
|
89
|
+
|
|
90
|
+
spawn_worker "$@"
|
|
91
|
+
fi
|
|
@@ -191,319 +191,4 @@ export const isValidAgentType = (name)=>agentLoader.isValidAgentType(name);
|
|
|
191
191
|
export const getAgentsByCategory = (category)=>agentLoader.getAgentsByCategory(category);
|
|
192
192
|
export const refreshAgents = ()=>agentLoader.refresh();
|
|
193
193
|
|
|
194
|
-
//# sourceMappingURL=agent-loader.js.map.isArray(input)) return input.map(String);
|
|
195
|
-
if (typeof input === 'string') {
|
|
196
|
-
return input.split(/[,\s]+/).map(function(t) {
|
|
197
|
-
return t.trim();
|
|
198
|
-
}).filter(function(t) {
|
|
199
|
-
return t.length > 0;
|
|
200
|
-
});
|
|
201
|
-
}
|
|
202
|
-
return [];
|
|
203
|
-
};
|
|
204
|
-
// Safely handle tools and capabilities.tools
|
|
205
|
-
var toolsFromFrontmatter = frontmatter.tools ? extractTools(frontmatter.tools) : [];
|
|
206
|
-
var toolsFromCapabilities = frontmatter.capabilities && typeof frontmatter.capabilities === 'object' ? extractTools(Object(frontmatter.capabilities).tools) : [];
|
|
207
|
-
return __spreadArray(__spreadArray([], toolsFromFrontmatter, true), toolsFromCapabilities, true);
|
|
208
|
-
};
|
|
209
|
-
AgentLoader.prototype.loadAgents = function() {
|
|
210
|
-
return __awaiter(this, void 0, void 0, function() {
|
|
211
|
-
var agentsDir, agentFiles, categoryMap, _i, agentFiles_1, filePath, agent, relativePath, pathParts, category;
|
|
212
|
-
return __generator(this, function(_a) {
|
|
213
|
-
switch(_a.label){
|
|
214
|
-
case 0:
|
|
215
|
-
agentsDir = this.getAgentsDirectory();
|
|
216
|
-
if (!(0, node_fs_1.existsSync)(agentsDir)) {
|
|
217
|
-
console.warn("Agents directory not found: ".concat(agentsDir));
|
|
218
|
-
return [
|
|
219
|
-
2 /*return*/
|
|
220
|
-
];
|
|
221
|
-
}
|
|
222
|
-
return [
|
|
223
|
-
4 /*yield*/ ,
|
|
224
|
-
new Promise(function(resolve, reject) {
|
|
225
|
-
(0, glob_1.glob)('**/*.md', {
|
|
226
|
-
cwd: agentsDir,
|
|
227
|
-
ignore: [
|
|
228
|
-
'**/README.md',
|
|
229
|
-
'**/MIGRATION_SUMMARY.md'
|
|
230
|
-
],
|
|
231
|
-
absolute: true
|
|
232
|
-
}, function(err, matches) {
|
|
233
|
-
if (err) reject(err);
|
|
234
|
-
else resolve(matches);
|
|
235
|
-
});
|
|
236
|
-
})
|
|
237
|
-
];
|
|
238
|
-
case 1:
|
|
239
|
-
agentFiles = _a.sent();
|
|
240
|
-
this.agentCache.clear();
|
|
241
|
-
this.categoriesCache = [];
|
|
242
|
-
categoryMap = new Map();
|
|
243
|
-
for(_i = 0, agentFiles_1 = agentFiles; _i < agentFiles_1.length; _i++){
|
|
244
|
-
filePath = agentFiles_1[_i];
|
|
245
|
-
agent = this.parseAgentFile(filePath);
|
|
246
|
-
if (agent) {
|
|
247
|
-
this.agentCache.set(agent.name, agent);
|
|
248
|
-
relativePath = filePath.replace(agentsDir, '');
|
|
249
|
-
pathParts = relativePath.split('/');
|
|
250
|
-
category = pathParts[1] || 'uncategorized';
|
|
251
|
-
if (!categoryMap.has(category)) {
|
|
252
|
-
categoryMap.set(category, []);
|
|
253
|
-
}
|
|
254
|
-
categoryMap.get(category).push(agent);
|
|
255
|
-
}
|
|
256
|
-
}
|
|
257
|
-
this.categoriesCache = Array.from(categoryMap.entries()).map(function(_a) {
|
|
258
|
-
var name = _a[0], agents = _a[1];
|
|
259
|
-
return {
|
|
260
|
-
name: name,
|
|
261
|
-
agents: agents.sort(function(a, b) {
|
|
262
|
-
return a.name.localeCompare(b.name);
|
|
263
|
-
})
|
|
264
|
-
};
|
|
265
|
-
});
|
|
266
|
-
this.lastLoadTime = Date.now();
|
|
267
|
-
return [
|
|
268
|
-
2 /*return*/
|
|
269
|
-
];
|
|
270
|
-
}
|
|
271
|
-
});
|
|
272
|
-
});
|
|
273
|
-
};
|
|
274
|
-
// Rest of the methods remain similar to the original implementation
|
|
275
|
-
AgentLoader.prototype.needsRefresh = function() {
|
|
276
|
-
return Date.now() - this.lastLoadTime > this.CACHE_EXPIRY;
|
|
277
|
-
};
|
|
278
|
-
AgentLoader.prototype.ensureLoaded = function() {
|
|
279
|
-
return __awaiter(this, void 0, void 0, function() {
|
|
280
|
-
return __generator(this, function(_a) {
|
|
281
|
-
switch(_a.label){
|
|
282
|
-
case 0:
|
|
283
|
-
if (!(this.agentCache.size === 0 || this.needsRefresh())) return [
|
|
284
|
-
3 /*break*/ ,
|
|
285
|
-
2
|
|
286
|
-
];
|
|
287
|
-
return [
|
|
288
|
-
4 /*yield*/ ,
|
|
289
|
-
this.loadAgents()
|
|
290
|
-
];
|
|
291
|
-
case 1:
|
|
292
|
-
_a.sent();
|
|
293
|
-
_a.label = 2;
|
|
294
|
-
case 2:
|
|
295
|
-
return [
|
|
296
|
-
2 /*return*/
|
|
297
|
-
];
|
|
298
|
-
}
|
|
299
|
-
});
|
|
300
|
-
});
|
|
301
|
-
};
|
|
302
|
-
AgentLoader.prototype.getAvailableAgentTypes = function() {
|
|
303
|
-
return __awaiter(this, void 0, void 0, function() {
|
|
304
|
-
var currentTypes, legacyTypes;
|
|
305
|
-
return __generator(this, function(_a) {
|
|
306
|
-
switch(_a.label){
|
|
307
|
-
case 0:
|
|
308
|
-
return [
|
|
309
|
-
4 /*yield*/ ,
|
|
310
|
-
this.ensureLoaded()
|
|
311
|
-
];
|
|
312
|
-
case 1:
|
|
313
|
-
_a.sent();
|
|
314
|
-
currentTypes = Array.from(this.agentCache.keys());
|
|
315
|
-
legacyTypes = Object.keys(LEGACY_AGENT_MAPPING);
|
|
316
|
-
return [
|
|
317
|
-
2 /*return*/ ,
|
|
318
|
-
Array.from(new Set(__spreadArray(__spreadArray([], currentTypes, true), legacyTypes, true))).sort()
|
|
319
|
-
];
|
|
320
|
-
}
|
|
321
|
-
});
|
|
322
|
-
});
|
|
323
|
-
};
|
|
324
|
-
AgentLoader.prototype.getAgent = function(name) {
|
|
325
|
-
return __awaiter(this, void 0, void 0, function() {
|
|
326
|
-
return __generator(this, function(_a) {
|
|
327
|
-
switch(_a.label){
|
|
328
|
-
case 0:
|
|
329
|
-
return [
|
|
330
|
-
4 /*yield*/ ,
|
|
331
|
-
this.ensureLoaded()
|
|
332
|
-
];
|
|
333
|
-
case 1:
|
|
334
|
-
_a.sent();
|
|
335
|
-
return [
|
|
336
|
-
2 /*return*/ ,
|
|
337
|
-
this.agentCache.get(name) || this.agentCache.get(resolveLegacyAgentType(name)) || null
|
|
338
|
-
];
|
|
339
|
-
}
|
|
340
|
-
});
|
|
341
|
-
});
|
|
342
|
-
};
|
|
343
|
-
AgentLoader.prototype.getAllAgents = function() {
|
|
344
|
-
return __awaiter(this, void 0, void 0, function() {
|
|
345
|
-
return __generator(this, function(_a) {
|
|
346
|
-
switch(_a.label){
|
|
347
|
-
case 0:
|
|
348
|
-
return [
|
|
349
|
-
4 /*yield*/ ,
|
|
350
|
-
this.ensureLoaded()
|
|
351
|
-
];
|
|
352
|
-
case 1:
|
|
353
|
-
_a.sent();
|
|
354
|
-
return [
|
|
355
|
-
2 /*return*/ ,
|
|
356
|
-
Array.from(this.agentCache.values()).sort(function(a, b) {
|
|
357
|
-
return a.name.localeCompare(b.name);
|
|
358
|
-
})
|
|
359
|
-
];
|
|
360
|
-
}
|
|
361
|
-
});
|
|
362
|
-
});
|
|
363
|
-
};
|
|
364
|
-
AgentLoader.prototype.getAgentCategories = function() {
|
|
365
|
-
return __awaiter(this, void 0, void 0, function() {
|
|
366
|
-
return __generator(this, function(_a) {
|
|
367
|
-
switch(_a.label){
|
|
368
|
-
case 0:
|
|
369
|
-
return [
|
|
370
|
-
4 /*yield*/ ,
|
|
371
|
-
this.ensureLoaded()
|
|
372
|
-
];
|
|
373
|
-
case 1:
|
|
374
|
-
_a.sent();
|
|
375
|
-
return [
|
|
376
|
-
2 /*return*/ ,
|
|
377
|
-
this.categoriesCache
|
|
378
|
-
];
|
|
379
|
-
}
|
|
380
|
-
});
|
|
381
|
-
});
|
|
382
|
-
};
|
|
383
|
-
AgentLoader.prototype.searchAgents = function(query) {
|
|
384
|
-
return __awaiter(this, void 0, void 0, function() {
|
|
385
|
-
var lowerQuery;
|
|
386
|
-
return __generator(this, function(_a) {
|
|
387
|
-
switch(_a.label){
|
|
388
|
-
case 0:
|
|
389
|
-
return [
|
|
390
|
-
4 /*yield*/ ,
|
|
391
|
-
this.ensureLoaded()
|
|
392
|
-
];
|
|
393
|
-
case 1:
|
|
394
|
-
_a.sent();
|
|
395
|
-
lowerQuery = query.toLowerCase();
|
|
396
|
-
return [
|
|
397
|
-
2 /*return*/ ,
|
|
398
|
-
Array.from(this.agentCache.values()).filter(function(agent) {
|
|
399
|
-
var _a;
|
|
400
|
-
return agent.name.toLowerCase().includes(lowerQuery) || agent.description.toLowerCase().includes(lowerQuery) || ((_a = agent.capabilities) === null || _a === void 0 ? void 0 : _a.some(function(cap) {
|
|
401
|
-
return cap.toLowerCase().includes(lowerQuery);
|
|
402
|
-
}));
|
|
403
|
-
})
|
|
404
|
-
];
|
|
405
|
-
}
|
|
406
|
-
});
|
|
407
|
-
});
|
|
408
|
-
};
|
|
409
|
-
AgentLoader.prototype.isValidAgentType = function(name) {
|
|
410
|
-
return __awaiter(this, void 0, void 0, function() {
|
|
411
|
-
return __generator(this, function(_a) {
|
|
412
|
-
switch(_a.label){
|
|
413
|
-
case 0:
|
|
414
|
-
return [
|
|
415
|
-
4 /*yield*/ ,
|
|
416
|
-
this.ensureLoaded()
|
|
417
|
-
];
|
|
418
|
-
case 1:
|
|
419
|
-
_a.sent();
|
|
420
|
-
return [
|
|
421
|
-
2 /*return*/ ,
|
|
422
|
-
this.agentCache.has(name) || this.agentCache.has(resolveLegacyAgentType(name))
|
|
423
|
-
];
|
|
424
|
-
}
|
|
425
|
-
});
|
|
426
|
-
});
|
|
427
|
-
};
|
|
428
|
-
AgentLoader.prototype.getAgentsByCategory = function(category) {
|
|
429
|
-
return __awaiter(this, void 0, void 0, function() {
|
|
430
|
-
var categories, found;
|
|
431
|
-
return __generator(this, function(_a) {
|
|
432
|
-
switch(_a.label){
|
|
433
|
-
case 0:
|
|
434
|
-
return [
|
|
435
|
-
4 /*yield*/ ,
|
|
436
|
-
this.getAgentCategories()
|
|
437
|
-
];
|
|
438
|
-
case 1:
|
|
439
|
-
categories = _a.sent();
|
|
440
|
-
found = categories.find(function(cat) {
|
|
441
|
-
return cat.name === category;
|
|
442
|
-
});
|
|
443
|
-
return [
|
|
444
|
-
2 /*return*/ ,
|
|
445
|
-
(found === null || found === void 0 ? void 0 : found.agents) || []
|
|
446
|
-
];
|
|
447
|
-
}
|
|
448
|
-
});
|
|
449
|
-
});
|
|
450
|
-
};
|
|
451
|
-
AgentLoader.prototype.refresh = function() {
|
|
452
|
-
return __awaiter(this, void 0, void 0, function() {
|
|
453
|
-
return __generator(this, function(_a) {
|
|
454
|
-
switch(_a.label){
|
|
455
|
-
case 0:
|
|
456
|
-
this.lastLoadTime = 0;
|
|
457
|
-
return [
|
|
458
|
-
4 /*yield*/ ,
|
|
459
|
-
this.loadAgents()
|
|
460
|
-
];
|
|
461
|
-
case 1:
|
|
462
|
-
_a.sent();
|
|
463
|
-
return [
|
|
464
|
-
2 /*return*/
|
|
465
|
-
];
|
|
466
|
-
}
|
|
467
|
-
});
|
|
468
|
-
});
|
|
469
|
-
};
|
|
470
|
-
return AgentLoader;
|
|
471
|
-
}();
|
|
472
|
-
exports.AgentLoader = AgentLoader;
|
|
473
|
-
// Singleton instance
|
|
474
|
-
exports.agentLoader = new AgentLoader();
|
|
475
|
-
// Convenience exports for use in other modules
|
|
476
|
-
var getAvailableAgentTypes = function() {
|
|
477
|
-
return exports.agentLoader.getAvailableAgentTypes();
|
|
478
|
-
};
|
|
479
|
-
exports.getAvailableAgentTypes = getAvailableAgentTypes;
|
|
480
|
-
var getAgent = function(name) {
|
|
481
|
-
return exports.agentLoader.getAgent(name);
|
|
482
|
-
};
|
|
483
|
-
exports.getAgent = getAgent;
|
|
484
|
-
var getAllAgents = function() {
|
|
485
|
-
return exports.agentLoader.getAllAgents();
|
|
486
|
-
};
|
|
487
|
-
exports.getAllAgents = getAllAgents;
|
|
488
|
-
var getAgentCategories = function() {
|
|
489
|
-
return exports.agentLoader.getAgentCategories();
|
|
490
|
-
};
|
|
491
|
-
exports.getAgentCategories = getAgentCategories;
|
|
492
|
-
var searchAgents = function(query) {
|
|
493
|
-
return exports.agentLoader.searchAgents(query);
|
|
494
|
-
};
|
|
495
|
-
exports.searchAgents = searchAgents;
|
|
496
|
-
var isValidAgentType = function(name) {
|
|
497
|
-
return exports.agentLoader.isValidAgentType(name);
|
|
498
|
-
};
|
|
499
|
-
exports.isValidAgentType = isValidAgentType;
|
|
500
|
-
var getAgentsByCategory = function(category) {
|
|
501
|
-
return exports.agentLoader.getAgentsByCategory(category);
|
|
502
|
-
};
|
|
503
|
-
exports.getAgentsByCategory = getAgentsByCategory;
|
|
504
|
-
var refreshAgents = function() {
|
|
505
|
-
return exports.agentLoader.refresh();
|
|
506
|
-
};
|
|
507
|
-
exports.refreshAgents = refreshAgents;
|
|
508
|
-
|
|
509
194
|
//# sourceMappingURL=agent-loader.js.map
|