snow-flow 8.41.23 → 8.42.0
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.md +9 -6
- package/dist/api/health-api.d.ts +1 -1
- package/dist/api/health-api.d.ts.map +1 -1
- package/dist/api/simple-health-api.d.ts +1 -1
- package/dist/api/simple-health-api.d.ts.map +1 -1
- package/dist/mcp/servicenow-automation-mcp.js +8 -8
- package/dist/mcp/servicenow-automation-mcp.js.map +1 -1
- package/dist/mcp/servicenow-mcp-server.js +4 -4
- package/dist/mcp/servicenow-mcp-server.js.map +1 -1
- package/dist/mcp/servicenow-mcp-unified/tools/automation/index.d.ts +1 -2
- package/dist/mcp/servicenow-mcp-unified/tools/automation/index.d.ts.map +1 -1
- package/dist/mcp/servicenow-mcp-unified/tools/automation/index.js +6 -8
- package/dist/mcp/servicenow-mcp-unified/tools/automation/index.js.map +1 -1
- package/dist/mcp/servicenow-mcp-unified/tools/automation/snow_confirm_script_execution.d.ts +1 -1
- package/dist/mcp/servicenow-mcp-unified/tools/automation/snow_confirm_script_execution.js +2 -2
- package/dist/mcp/servicenow-mcp-unified/tools/automation/snow_confirm_script_execution.js.map +1 -1
- package/dist/mcp/servicenow-mcp-unified/tools/automation/snow_schedule_script_job.d.ts +26 -0
- package/dist/mcp/servicenow-mcp-unified/tools/automation/snow_schedule_script_job.d.ts.map +1 -0
- package/dist/mcp/servicenow-mcp-unified/tools/automation/{snow_execute_script.js → snow_schedule_script_job.js} +19 -13
- package/dist/mcp/servicenow-mcp-unified/tools/automation/snow_schedule_script_job.js.map +1 -0
- package/dist/mcp/servicenow-mcp-unified/tools/automation/snow_trace_execution.d.ts +12 -4
- package/dist/mcp/servicenow-mcp-unified/tools/automation/snow_trace_execution.d.ts.map +1 -1
- package/dist/mcp/servicenow-mcp-unified/tools/automation/snow_trace_execution.js +69 -67
- package/dist/mcp/servicenow-mcp-unified/tools/automation/snow_trace_execution.js.map +1 -1
- package/dist/mcp/servicenow-mcp-unified/tools/development/snow_analyze_artifact.d.ts.map +1 -1
- package/dist/mcp/servicenow-mcp-unified/tools/development/snow_analyze_artifact.js +2 -1
- package/dist/mcp/servicenow-mcp-unified/tools/development/snow_analyze_artifact.js.map +1 -1
- package/dist/mcp/servicenow-mcp-unified/tools/development/snow_analyze_requirements.d.ts.map +1 -1
- package/dist/mcp/servicenow-mcp-unified/tools/development/snow_analyze_requirements.js +2 -1
- package/dist/mcp/servicenow-mcp-unified/tools/development/snow_analyze_requirements.js.map +1 -1
- package/dist/mcp/servicenow-mcp-unified/tools/development/snow_edit_artifact.d.ts.map +1 -1
- package/dist/mcp/servicenow-mcp-unified/tools/development/snow_edit_artifact.js +2 -1
- package/dist/mcp/servicenow-mcp-unified/tools/development/snow_edit_artifact.js.map +1 -1
- package/dist/mcp/servicenow-mcp-unified/tools/development/snow_edit_by_sysid.d.ts.map +1 -1
- package/dist/mcp/servicenow-mcp-unified/tools/development/snow_edit_by_sysid.js +5 -2
- package/dist/mcp/servicenow-mcp-unified/tools/development/snow_edit_by_sysid.js.map +1 -1
- package/dist/mcp/servicenow-mcp-unified/tools/development/snow_find_artifact.d.ts.map +1 -1
- package/dist/mcp/servicenow-mcp-unified/tools/development/snow_find_artifact.js +2 -1
- package/dist/mcp/servicenow-mcp-unified/tools/development/snow_find_artifact.js.map +1 -1
- package/dist/mcp/servicenow-mcp-unified/tools/development/snow_get_by_sysid.d.ts.map +1 -1
- package/dist/mcp/servicenow-mcp-unified/tools/development/snow_get_by_sysid.js +2 -1
- package/dist/mcp/servicenow-mcp-unified/tools/development/snow_get_by_sysid.js.map +1 -1
- package/dist/mcp/servicenow-mcp-unified/tools/development/snow_memory_search.d.ts.map +1 -1
- package/dist/mcp/servicenow-mcp-unified/tools/development/snow_memory_search.js +2 -1
- package/dist/mcp/servicenow-mcp-unified/tools/development/snow_memory_search.js.map +1 -1
- package/dist/mcp/servicenow-mcp-unified/tools/development/snow_orchestrate_development.d.ts.map +1 -1
- package/dist/mcp/servicenow-mcp-unified/tools/development/snow_orchestrate_development.js +2 -1
- package/dist/mcp/servicenow-mcp-unified/tools/development/snow_orchestrate_development.js.map +1 -1
- package/dist/mcp/servicenow-mcp-unified/tools/development/snow_sync_data_consistency.d.ts.map +1 -1
- package/dist/mcp/servicenow-mcp-unified/tools/development/snow_sync_data_consistency.js +2 -1
- package/dist/mcp/servicenow-mcp-unified/tools/development/snow_sync_data_consistency.js.map +1 -1
- package/dist/mcp/servicenow-mcp-unified/tools/development/snow_validate_live_connection.d.ts.map +1 -1
- package/dist/mcp/servicenow-mcp-unified/tools/development/snow_validate_live_connection.js +2 -1
- package/dist/mcp/servicenow-mcp-unified/tools/development/snow_validate_live_connection.js.map +1 -1
- package/dist/mcp/servicenow-mcp-unified/tools/integration/index.d.ts +1 -0
- package/dist/mcp/servicenow-mcp-unified/tools/integration/index.d.ts.map +1 -1
- package/dist/mcp/servicenow-mcp-unified/tools/integration/index.js +4 -1
- package/dist/mcp/servicenow-mcp-unified/tools/integration/index.js.map +1 -1
- package/dist/mcp/servicenow-mcp-unified/tools/integration/snow_rest_message_manage.d.ts +26 -0
- package/dist/mcp/servicenow-mcp-unified/tools/integration/snow_rest_message_manage.d.ts.map +1 -0
- package/dist/mcp/servicenow-mcp-unified/tools/integration/snow_rest_message_manage.js +1280 -0
- package/dist/mcp/servicenow-mcp-unified/tools/integration/snow_rest_message_manage.js.map +1 -0
- package/dist/mcp/servicenow-mcp-unified/tools/scheduled-jobs/index.d.ts +1 -1
- package/dist/mcp/servicenow-mcp-unified/tools/scheduled-jobs/index.js +4 -4
- package/dist/mcp/servicenow-mcp-unified/tools/scheduled-jobs/snow_trigger_scheduled_job.d.ts +19 -0
- package/dist/mcp/servicenow-mcp-unified/tools/scheduled-jobs/snow_trigger_scheduled_job.d.ts.map +1 -0
- package/dist/mcp/servicenow-mcp-unified/tools/scheduled-jobs/snow_trigger_scheduled_job.js +142 -0
- package/dist/mcp/servicenow-mcp-unified/tools/scheduled-jobs/snow_trigger_scheduled_job.js.map +1 -0
- package/dist/mcp/servicenow-mcp-unified/tools/workflow/index.d.ts +1 -1
- package/dist/mcp/servicenow-mcp-unified/tools/workflow/index.d.ts.map +1 -1
- package/dist/mcp/servicenow-mcp-unified/tools/workflow/index.js +4 -4
- package/dist/mcp/servicenow-mcp-unified/tools/workflow/index.js.map +1 -1
- package/dist/mcp/servicenow-mcp-unified/tools/workflow/snow_start_workflow.d.ts +15 -0
- package/dist/mcp/servicenow-mcp-unified/tools/workflow/snow_start_workflow.d.ts.map +1 -0
- package/dist/mcp/servicenow-mcp-unified/tools/workflow/snow_start_workflow.js +136 -0
- package/dist/mcp/servicenow-mcp-unified/tools/workflow/snow_start_workflow.js.map +1 -0
- package/dist/templates/agents-md-template.d.ts +1 -1
- package/dist/templates/agents-md-template.d.ts.map +1 -1
- package/dist/templates/agents-md-template.js +5 -5
- package/dist/templates/claude-md-template.d.ts +1 -1
- package/dist/templates/claude-md-template.d.ts.map +1 -1
- package/dist/templates/claude-md-template.js +11 -9
- package/dist/templates/claude-md-template.js.map +1 -1
- package/dist/utils/auto-update-snow-code.d.ts +7 -0
- package/dist/utils/auto-update-snow-code.d.ts.map +1 -1
- package/dist/utils/auto-update-snow-code.js +62 -13
- package/dist/utils/auto-update-snow-code.js.map +1 -1
- package/package.json +1 -1
- package/.snow-code/opencode.json +0 -49
- package/dist/cli/enterprise-docs-generator.d.ts +0 -14
- package/dist/cli/enterprise-docs-generator.d.ts.map +0 -1
- package/dist/cli/enterprise-docs-generator.js +0 -875
- package/dist/cli/enterprise-docs-generator.js.map +0 -1
- package/dist/config/snowcode-config.d.ts +0 -76
- package/dist/config/snowcode-config.d.ts.map +0 -1
- package/dist/config/snowcode-config.js +0 -225
- package/dist/config/snowcode-config.js.map +0 -1
- package/dist/mcp/servicenow-mcp-unified/tools/automation/snow_execute_script.d.ts +0 -20
- package/dist/mcp/servicenow-mcp-unified/tools/automation/snow_execute_script.d.ts.map +0 -1
- package/dist/mcp/servicenow-mcp-unified/tools/automation/snow_execute_script.js.map +0 -1
- package/dist/mcp/servicenow-mcp-unified/tools/automation/snow_test_rest_connection.d.ts +0 -11
- package/dist/mcp/servicenow-mcp-unified/tools/automation/snow_test_rest_connection.d.ts.map +0 -1
- package/dist/mcp/servicenow-mcp-unified/tools/automation/snow_test_rest_connection.js +0 -142
- package/dist/mcp/servicenow-mcp-unified/tools/automation/snow_test_rest_connection.js.map +0 -1
- package/dist/mcp/servicenow-mcp-unified/tools/flow-designer/index.d.ts +0 -8
- package/dist/mcp/servicenow-mcp-unified/tools/flow-designer/index.d.ts.map +0 -1
- package/dist/mcp/servicenow-mcp-unified/tools/flow-designer/index.js +0 -24
- package/dist/mcp/servicenow-mcp-unified/tools/flow-designer/index.js.map +0 -1
- package/dist/mcp/servicenow-mcp-unified/tools/flow-designer/snow_execute_flow.d.ts +0 -8
- package/dist/mcp/servicenow-mcp-unified/tools/flow-designer/snow_execute_flow.d.ts.map +0 -1
- package/dist/mcp/servicenow-mcp-unified/tools/flow-designer/snow_execute_flow.js +0 -44
- package/dist/mcp/servicenow-mcp-unified/tools/flow-designer/snow_execute_flow.js.map +0 -1
- package/dist/mcp/servicenow-mcp-unified/tools/flow-designer/snow_flow_connectivity_test.d.ts +0 -8
- package/dist/mcp/servicenow-mcp-unified/tools/flow-designer/snow_flow_connectivity_test.d.ts.map +0 -1
- package/dist/mcp/servicenow-mcp-unified/tools/flow-designer/snow_flow_connectivity_test.js +0 -67
- package/dist/mcp/servicenow-mcp-unified/tools/flow-designer/snow_flow_connectivity_test.js.map +0 -1
- package/dist/mcp/servicenow-mcp-unified/tools/flow-designer/snow_flow_discover.d.ts +0 -15
- package/dist/mcp/servicenow-mcp-unified/tools/flow-designer/snow_flow_discover.d.ts.map +0 -1
- package/dist/mcp/servicenow-mcp-unified/tools/flow-designer/snow_flow_discover.js +0 -273
- package/dist/mcp/servicenow-mcp-unified/tools/flow-designer/snow_flow_discover.js.map +0 -1
- package/dist/mcp/servicenow-mcp-unified/tools/flow-designer/snow_flow_query.d.ts +0 -14
- package/dist/mcp/servicenow-mcp-unified/tools/flow-designer/snow_flow_query.d.ts.map +0 -1
- package/dist/mcp/servicenow-mcp-unified/tools/flow-designer/snow_flow_query.js +0 -205
- package/dist/mcp/servicenow-mcp-unified/tools/flow-designer/snow_flow_query.js.map +0 -1
- package/dist/mcp/servicenow-mcp-unified/tools/flow-designer/snow_import_flow_from_xml.d.ts +0 -8
- package/dist/mcp/servicenow-mcp-unified/tools/flow-designer/snow_import_flow_from_xml.d.ts.map +0 -1
- package/dist/mcp/servicenow-mcp-unified/tools/flow-designer/snow_import_flow_from_xml.js +0 -68
- package/dist/mcp/servicenow-mcp-unified/tools/flow-designer/snow_import_flow_from_xml.js.map +0 -1
- package/dist/mcp/servicenow-mcp-unified/tools/flow-designer/snow_manage_flow.d.ts +0 -143
- package/dist/mcp/servicenow-mcp-unified/tools/flow-designer/snow_manage_flow.d.ts.map +0 -1
- package/dist/mcp/servicenow-mcp-unified/tools/flow-designer/snow_manage_flow.js +0 -2293
- package/dist/mcp/servicenow-mcp-unified/tools/flow-designer/snow_manage_flow.js.map +0 -1
- package/dist/mcp/servicenow-mcp-unified/tools/rest-api/snow_create_rest_method.d.ts +0 -9
- package/dist/mcp/servicenow-mcp-unified/tools/rest-api/snow_create_rest_method.d.ts.map +0 -1
- package/dist/mcp/servicenow-mcp-unified/tools/rest-api/snow_create_rest_method.js +0 -57
- package/dist/mcp/servicenow-mcp-unified/tools/rest-api/snow_create_rest_method.js.map +0 -1
- package/dist/mcp/servicenow-mcp-unified/tools/rest-api/snow_test_rest_message.d.ts +0 -9
- package/dist/mcp/servicenow-mcp-unified/tools/rest-api/snow_test_rest_message.d.ts.map +0 -1
- package/dist/mcp/servicenow-mcp-unified/tools/rest-api/snow_test_rest_message.js +0 -58
- package/dist/mcp/servicenow-mcp-unified/tools/rest-api/snow_test_rest_message.js.map +0 -1
- package/dist/mcp/servicenow-mcp-unified/tools/scheduled-jobs/snow_execute_scheduled_job.d.ts +0 -9
- package/dist/mcp/servicenow-mcp-unified/tools/scheduled-jobs/snow_execute_scheduled_job.d.ts.map +0 -1
- package/dist/mcp/servicenow-mcp-unified/tools/scheduled-jobs/snow_execute_scheduled_job.js +0 -59
- package/dist/mcp/servicenow-mcp-unified/tools/scheduled-jobs/snow_execute_scheduled_job.js.map +0 -1
- package/dist/mcp/servicenow-mcp-unified/tools/workflow/snow_execute_workflow.d.ts +0 -9
- package/dist/mcp/servicenow-mcp-unified/tools/workflow/snow_execute_workflow.d.ts.map +0 -1
- package/dist/mcp/servicenow-mcp-unified/tools/workflow/snow_execute_workflow.js +0 -55
- package/dist/mcp/servicenow-mcp-unified/tools/workflow/snow_execute_workflow.js.map +0 -1
- package/dist/sdk/claude-agent-sdk-integration.d.ts +0 -103
- package/dist/sdk/claude-agent-sdk-integration.d.ts.map +0 -1
- package/dist/sdk/claude-agent-sdk-integration.js +0 -414
- package/dist/sdk/claude-agent-sdk-integration.js.map +0 -1
|
@@ -1,414 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* Claude Agent SDK Integration Layer
|
|
4
|
-
* Bridges Snow-Flow architecture with @anthropic-ai/claude-agent-sdk@0.1.1
|
|
5
|
-
*
|
|
6
|
-
* Purpose:
|
|
7
|
-
* - Replace custom RealAgentSpawner with SDK's native agent spawning
|
|
8
|
-
* - Integrate SDK's query() with our Memory System
|
|
9
|
-
* - Provide hooks for agent coordination
|
|
10
|
-
* - Simplify agent execution while keeping our intelligence
|
|
11
|
-
*/
|
|
12
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
-
exports.ClaudeAgentSDKIntegration = void 0;
|
|
14
|
-
const claude_agent_sdk_1 = require("@anthropic-ai/claude-agent-sdk");
|
|
15
|
-
const logger_js_1 = require("../utils/logger.js");
|
|
16
|
-
const events_1 = require("events");
|
|
17
|
-
/**
|
|
18
|
-
* Snow-Flow SDK Integration
|
|
19
|
-
* Replaces 2800+ lines of custom agent code with SDK-native approach
|
|
20
|
-
*/
|
|
21
|
-
class ClaudeAgentSDKIntegration extends events_1.EventEmitter {
|
|
22
|
-
constructor(memory) {
|
|
23
|
-
super();
|
|
24
|
-
this.activeQueries = new Map();
|
|
25
|
-
this.memory = memory;
|
|
26
|
-
this.logger = new logger_js_1.Logger('ClaudeAgentSDK');
|
|
27
|
-
}
|
|
28
|
-
/**
|
|
29
|
-
* Spawn agent using Claude Agent SDK (replaces RealAgentSpawner)
|
|
30
|
-
*
|
|
31
|
-
* Before: 701 lines in RealAgentSpawner
|
|
32
|
-
* After: Single query() call with proper instructions
|
|
33
|
-
*/
|
|
34
|
-
async spawnAgent(config) {
|
|
35
|
-
const agentId = this.generateAgentId(config.type);
|
|
36
|
-
const startTime = Date.now();
|
|
37
|
-
this.logger.info(`🚀 Spawning ${config.type} agent via Claude Agent SDK`);
|
|
38
|
-
this.emit('agent:spawning', { agentId, type: config.type });
|
|
39
|
-
try {
|
|
40
|
-
// Build agent instructions with Snow-Flow context
|
|
41
|
-
const instructions = this.buildAgentInstructions(config);
|
|
42
|
-
// Configure SDK options with MCP servers and hooks
|
|
43
|
-
const options = {
|
|
44
|
-
mcpServers: this.buildMCPServerConfig(),
|
|
45
|
-
hooks: this.buildHooks(agentId, config.type),
|
|
46
|
-
maxTurns: config.maxTurns || 10,
|
|
47
|
-
model: this.mapModelName(config.model),
|
|
48
|
-
permissionMode: 'bypassPermissions', // For automated agents
|
|
49
|
-
cwd: process.cwd()
|
|
50
|
-
};
|
|
51
|
-
// Execute agent via SDK query()
|
|
52
|
-
const agentQuery = (0, claude_agent_sdk_1.query)({
|
|
53
|
-
prompt: instructions,
|
|
54
|
-
options
|
|
55
|
-
});
|
|
56
|
-
// Store active query for monitoring/control
|
|
57
|
-
this.activeQueries.set(agentId, agentQuery);
|
|
58
|
-
// Process agent execution
|
|
59
|
-
const result = await this.processAgentExecution(agentId, config.type, agentQuery, startTime);
|
|
60
|
-
this.emit('agent:completed', result);
|
|
61
|
-
return result;
|
|
62
|
-
}
|
|
63
|
-
catch (error) {
|
|
64
|
-
this.logger.error(`❌ Agent ${agentId} failed:`, error);
|
|
65
|
-
this.emit('agent:failed', { agentId, type: config.type, error });
|
|
66
|
-
return {
|
|
67
|
-
success: false,
|
|
68
|
-
agentId,
|
|
69
|
-
agentType: config.type,
|
|
70
|
-
artifacts: [],
|
|
71
|
-
output: '',
|
|
72
|
-
tokensUsed: { input: 0, output: 0, total: 0 },
|
|
73
|
-
duration: Date.now() - startTime,
|
|
74
|
-
error: error
|
|
75
|
-
};
|
|
76
|
-
}
|
|
77
|
-
finally {
|
|
78
|
-
this.activeQueries.delete(agentId);
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
/**
|
|
82
|
-
* Spawn multiple agents in parallel
|
|
83
|
-
* Leverages our ParallelAgentEngine intelligence + SDK execution
|
|
84
|
-
*/
|
|
85
|
-
async spawnParallelAgents(configs) {
|
|
86
|
-
this.logger.info(`🚀 Spawning ${configs.length} agents in parallel`);
|
|
87
|
-
const spawnPromises = configs.map(config => this.spawnAgent(config));
|
|
88
|
-
const results = await Promise.allSettled(spawnPromises);
|
|
89
|
-
return results.map((result, index) => {
|
|
90
|
-
if (result.status === 'fulfilled') {
|
|
91
|
-
return result.value;
|
|
92
|
-
}
|
|
93
|
-
else {
|
|
94
|
-
const config = configs[index];
|
|
95
|
-
return {
|
|
96
|
-
success: false,
|
|
97
|
-
agentId: this.generateAgentId(config.type),
|
|
98
|
-
agentType: config.type,
|
|
99
|
-
artifacts: [],
|
|
100
|
-
output: '',
|
|
101
|
-
tokensUsed: { input: 0, output: 0, total: 0 },
|
|
102
|
-
duration: 0,
|
|
103
|
-
error: result.reason
|
|
104
|
-
};
|
|
105
|
-
}
|
|
106
|
-
});
|
|
107
|
-
}
|
|
108
|
-
/**
|
|
109
|
-
* Build agent instructions with Snow-Flow intelligence
|
|
110
|
-
* Maps agent types to clear, actionable instructions
|
|
111
|
-
*/
|
|
112
|
-
buildAgentInstructions(config) {
|
|
113
|
-
const baseInstructions = `You are a ${config.type} agent in the Snow-Flow intelligent orchestration system.
|
|
114
|
-
|
|
115
|
-
**Agent ID:** ${this.generateAgentId(config.type)}
|
|
116
|
-
**Objective:** ${config.objective}
|
|
117
|
-
**Available MCP Tools:** All 448 ServiceNow unified tools are available
|
|
118
|
-
|
|
119
|
-
## 🎯 Mission
|
|
120
|
-
|
|
121
|
-
${this.getTypeSpecificInstructions(config.type)}
|
|
122
|
-
|
|
123
|
-
## 📋 Execution Requirements
|
|
124
|
-
|
|
125
|
-
1. **Use REAL Snow-Flow MCP tools:**
|
|
126
|
-
- All tools are prefixed with 'snow_' (e.g., snow_create_workspace, snow_create_uib_page)
|
|
127
|
-
- Execute tools with proper parameters
|
|
128
|
-
- Capture sys_ids from responses
|
|
129
|
-
|
|
130
|
-
2. **Store results in Memory:**
|
|
131
|
-
- Use mcp__claude-flow__memory_usage for coordination
|
|
132
|
-
- Store all created artifacts: \`memory_usage({ action: 'store', key: 'agent_work_${this.generateAgentId(config.type)}', value: JSON.stringify({ sys_ids: [...] }) })\`
|
|
133
|
-
- Share findings with other agents through Memory
|
|
134
|
-
|
|
135
|
-
3. **Verify your work:**
|
|
136
|
-
- After creating artifacts, verify they exist in ServiceNow
|
|
137
|
-
- Use snow_query_table to confirm records exist
|
|
138
|
-
- Report only verified work
|
|
139
|
-
|
|
140
|
-
4. **Track Update Set:**
|
|
141
|
-
- Ensure active Update Set: snow_ensure_active_update_set
|
|
142
|
-
- All changes should be tracked
|
|
143
|
-
|
|
144
|
-
## ⚠️ Critical Rules
|
|
145
|
-
|
|
146
|
-
- ❌ NO simulation or fake responses
|
|
147
|
-
- ❌ NO placeholder sys_ids
|
|
148
|
-
- ✅ ONLY report verified ServiceNow artifacts
|
|
149
|
-
- ✅ USE Memory for agent coordination
|
|
150
|
-
- ✅ VERIFY all work via snow_query_table
|
|
151
|
-
|
|
152
|
-
## 🚀 Begin Execution
|
|
153
|
-
|
|
154
|
-
${config.context ? `\n**Context:**\n${JSON.stringify(config.context, null, 2)}\n` : ''}
|
|
155
|
-
|
|
156
|
-
Execute your mission now. Use TodoWrite to break down tasks if needed.`;
|
|
157
|
-
return baseInstructions;
|
|
158
|
-
}
|
|
159
|
-
/**
|
|
160
|
-
* Type-specific instructions for different agent types
|
|
161
|
-
*/
|
|
162
|
-
getTypeSpecificInstructions(type) {
|
|
163
|
-
const instructions = {
|
|
164
|
-
'workspace-specialist': `Create and configure ServiceNow workspaces using:
|
|
165
|
-
- snow_create_complete_workspace for full UX Framework workspaces
|
|
166
|
-
- snow_create_configurable_agent_workspace for Agent Workspaces
|
|
167
|
-
- snow_discover_all_workspaces to check existing workspaces
|
|
168
|
-
- snow_validate_workspace_configuration to ensure proper setup`,
|
|
169
|
-
'ui-builder-expert': `Build UI Builder pages and components using:
|
|
170
|
-
- snow_create_uib_page for new pages
|
|
171
|
-
- snow_add_uib_page_element to add components
|
|
172
|
-
- snow_create_uib_component for custom components
|
|
173
|
-
- snow_create_uib_data_broker for data integration
|
|
174
|
-
- Ensure proper routing and data flow`,
|
|
175
|
-
'widget-creator': `Create Service Portal widgets using:
|
|
176
|
-
- snow_create_sp_widget for new widgets
|
|
177
|
-
- Ensure HTML/Client/Server script coherence
|
|
178
|
-
- Use snow_pull_artifact for debugging large widgets
|
|
179
|
-
- Validate with snow_validate_artifact_coherence`,
|
|
180
|
-
'script-writer': `Write and deploy scripts using:
|
|
181
|
-
- snow_create_script_include for reusable code
|
|
182
|
-
- snow_create_business_rule for automation
|
|
183
|
-
- snow_create_client_script for client-side logic
|
|
184
|
-
- Ensure ES5 compatibility (NO modern JavaScript!)
|
|
185
|
-
- Test with snow_execute_script_with_output`,
|
|
186
|
-
'integration-specialist': `Build integrations using:
|
|
187
|
-
- snow_create_rest_message for REST APIs
|
|
188
|
-
- snow_test_rest_connection for validation
|
|
189
|
-
- snow_create_transform_map for data transformation
|
|
190
|
-
- Handle authentication and error cases`,
|
|
191
|
-
'tester': `Test and validate implementations using:
|
|
192
|
-
- snow_execute_script_with_output for functionality tests
|
|
193
|
-
- snow_get_logs for error checking
|
|
194
|
-
- snow_validate_artifact_coherence for widget testing
|
|
195
|
-
- Create comprehensive test scenarios`,
|
|
196
|
-
'security-specialist': `Ensure security and compliance using:
|
|
197
|
-
- snow_create_acl for access control
|
|
198
|
-
- snow_scan_vulnerabilities for security checks
|
|
199
|
-
- Review permissions and authentication
|
|
200
|
-
- Validate data access patterns`,
|
|
201
|
-
'deployment-specialist': `Deploy and validate artifacts using:
|
|
202
|
-
- snow_create_artifact for widget/artifact deployment
|
|
203
|
-
- snow_ensure_active_update_set for change tracking
|
|
204
|
-
- snow_validate_deployment for verification
|
|
205
|
-
- Handle rollback if needed`,
|
|
206
|
-
'researcher': `Research and analyze ServiceNow environments using:
|
|
207
|
-
- snow_comprehensive_search for artifact discovery
|
|
208
|
-
- snow_discover_* tools for exploring configurations
|
|
209
|
-
- snow_query_table for data analysis
|
|
210
|
-
- Document findings in Memory`,
|
|
211
|
-
'app-architect': `Design application architecture using:
|
|
212
|
-
- Analyze requirements and design data models
|
|
213
|
-
- Plan UI/UX structure
|
|
214
|
-
- Define integration points
|
|
215
|
-
- Document architecture in Memory for other agents`,
|
|
216
|
-
'page-designer': `Design and create portal pages using:
|
|
217
|
-
- snow_create_sp_page for Service Portal pages
|
|
218
|
-
- Configure layout (containers, rows, columns)
|
|
219
|
-
- Place widgets with proper sizing
|
|
220
|
-
- Set permissions and navigation`
|
|
221
|
-
};
|
|
222
|
-
return instructions[type] || `Execute your specialized task: ${type}`;
|
|
223
|
-
}
|
|
224
|
-
/**
|
|
225
|
-
* Build MCP server configuration for SDK
|
|
226
|
-
* Connects to our 448-tool unified server
|
|
227
|
-
*/
|
|
228
|
-
buildMCPServerConfig() {
|
|
229
|
-
return {
|
|
230
|
-
'servicenow-unified': {
|
|
231
|
-
type: 'stdio',
|
|
232
|
-
command: 'node',
|
|
233
|
-
args: [
|
|
234
|
-
'dist/mcp/servicenow-mcp-unified/index.js'
|
|
235
|
-
],
|
|
236
|
-
env: process.env
|
|
237
|
-
},
|
|
238
|
-
'claude-flow': {
|
|
239
|
-
type: 'stdio',
|
|
240
|
-
command: 'npx',
|
|
241
|
-
args: ['claude-flow@alpha', 'mcp', 'start'],
|
|
242
|
-
env: process.env
|
|
243
|
-
}
|
|
244
|
-
};
|
|
245
|
-
}
|
|
246
|
-
/**
|
|
247
|
-
* Build hooks for agent coordination
|
|
248
|
-
* Integrates with our Memory System and progress tracking
|
|
249
|
-
*/
|
|
250
|
-
buildHooks(agentId, agentType) {
|
|
251
|
-
return {
|
|
252
|
-
PostToolUse: [{
|
|
253
|
-
hooks: [async (input, toolUseId, { signal }) => {
|
|
254
|
-
// Type guard for PostToolUseHookInput
|
|
255
|
-
if (input.hook_event_name !== 'PostToolUse') {
|
|
256
|
-
return { continue: true };
|
|
257
|
-
}
|
|
258
|
-
// Store tool execution in Memory for coordination
|
|
259
|
-
if (input.tool_name.startsWith('snow_')) {
|
|
260
|
-
await this.memory.store(`agent_tool_${agentId}_${toolUseId}`, {
|
|
261
|
-
agentId,
|
|
262
|
-
agentType,
|
|
263
|
-
toolName: input.tool_name,
|
|
264
|
-
toolInput: input.tool_input,
|
|
265
|
-
toolResponse: input.tool_response,
|
|
266
|
-
timestamp: new Date().toISOString()
|
|
267
|
-
});
|
|
268
|
-
this.emit('agent:tool-used', {
|
|
269
|
-
agentId,
|
|
270
|
-
agentType,
|
|
271
|
-
toolName: input.tool_name
|
|
272
|
-
});
|
|
273
|
-
}
|
|
274
|
-
return { continue: true };
|
|
275
|
-
}]
|
|
276
|
-
}],
|
|
277
|
-
SessionEnd: [{
|
|
278
|
-
hooks: [async (input, toolUseId, { signal }) => {
|
|
279
|
-
// Type guard for SessionEndHookInput
|
|
280
|
-
if (input.hook_event_name !== 'SessionEnd') {
|
|
281
|
-
return { continue: true };
|
|
282
|
-
}
|
|
283
|
-
// Store final session results
|
|
284
|
-
await this.memory.store(`agent_session_${agentId}`, {
|
|
285
|
-
agentId,
|
|
286
|
-
agentType,
|
|
287
|
-
reason: input.reason,
|
|
288
|
-
timestamp: new Date().toISOString()
|
|
289
|
-
});
|
|
290
|
-
this.logger.info(`✅ Agent ${agentId} session ended: ${input.reason}`);
|
|
291
|
-
return { continue: true };
|
|
292
|
-
}]
|
|
293
|
-
}]
|
|
294
|
-
};
|
|
295
|
-
}
|
|
296
|
-
/**
|
|
297
|
-
* Process agent execution stream
|
|
298
|
-
* Extracts artifacts, tokens, and output
|
|
299
|
-
*/
|
|
300
|
-
async processAgentExecution(agentId, agentType, agentQuery, startTime) {
|
|
301
|
-
const artifacts = [];
|
|
302
|
-
let output = '';
|
|
303
|
-
let tokensUsed = { input: 0, output: 0, total: 0 };
|
|
304
|
-
try {
|
|
305
|
-
// Stream agent messages
|
|
306
|
-
for await (const message of agentQuery) {
|
|
307
|
-
this.emit('agent:message', { agentId, message });
|
|
308
|
-
// Extract results from completion
|
|
309
|
-
if (message.type === 'result' && message.subtype === 'success') {
|
|
310
|
-
output = message.result;
|
|
311
|
-
tokensUsed = {
|
|
312
|
-
input: message.usage.input_tokens,
|
|
313
|
-
output: message.usage.output_tokens,
|
|
314
|
-
total: message.usage.input_tokens + message.usage.output_tokens
|
|
315
|
-
};
|
|
316
|
-
}
|
|
317
|
-
// Extract artifacts from tool responses
|
|
318
|
-
if (message.type === 'assistant') {
|
|
319
|
-
const content = message.message.content;
|
|
320
|
-
for (const block of content) {
|
|
321
|
-
if (block.type === 'tool_use') {
|
|
322
|
-
// Look for sys_ids in tool results
|
|
323
|
-
const sysIdMatch = JSON.stringify(block).match(/[a-f0-9]{32}/g);
|
|
324
|
-
if (sysIdMatch) {
|
|
325
|
-
artifacts.push(...sysIdMatch);
|
|
326
|
-
}
|
|
327
|
-
}
|
|
328
|
-
}
|
|
329
|
-
}
|
|
330
|
-
}
|
|
331
|
-
// Store final results in Memory
|
|
332
|
-
await this.memory.store(`agent_result_${agentId}`, {
|
|
333
|
-
agentId,
|
|
334
|
-
agentType,
|
|
335
|
-
success: true,
|
|
336
|
-
artifacts: [...new Set(artifacts)], // Remove duplicates
|
|
337
|
-
output,
|
|
338
|
-
tokensUsed,
|
|
339
|
-
duration: Date.now() - startTime
|
|
340
|
-
});
|
|
341
|
-
return {
|
|
342
|
-
success: true,
|
|
343
|
-
agentId,
|
|
344
|
-
agentType,
|
|
345
|
-
artifacts: [...new Set(artifacts)],
|
|
346
|
-
output,
|
|
347
|
-
tokensUsed,
|
|
348
|
-
duration: Date.now() - startTime
|
|
349
|
-
};
|
|
350
|
-
}
|
|
351
|
-
catch (error) {
|
|
352
|
-
throw error;
|
|
353
|
-
}
|
|
354
|
-
}
|
|
355
|
-
/**
|
|
356
|
-
* Control running agent (interrupt, change model, etc.)
|
|
357
|
-
*/
|
|
358
|
-
async controlAgent(agentId, action) {
|
|
359
|
-
const query = this.activeQueries.get(agentId);
|
|
360
|
-
if (!query) {
|
|
361
|
-
throw new Error(`Agent ${agentId} not found or already completed`);
|
|
362
|
-
}
|
|
363
|
-
if (action === 'interrupt') {
|
|
364
|
-
await query.interrupt();
|
|
365
|
-
this.logger.info(`⏸️ Agent ${agentId} interrupted`);
|
|
366
|
-
}
|
|
367
|
-
}
|
|
368
|
-
/**
|
|
369
|
-
* Get agent status
|
|
370
|
-
*/
|
|
371
|
-
getAgentStatus(agentId) {
|
|
372
|
-
if (this.activeQueries.has(agentId)) {
|
|
373
|
-
return 'active';
|
|
374
|
-
}
|
|
375
|
-
// Check Memory for completed agents
|
|
376
|
-
const result = this.memory.get(`agent_result_${agentId}`);
|
|
377
|
-
return result ? 'completed' : 'not-found';
|
|
378
|
-
}
|
|
379
|
-
/**
|
|
380
|
-
* Utility methods
|
|
381
|
-
*/
|
|
382
|
-
generateAgentId(type) {
|
|
383
|
-
return `sdk_${type}_${Date.now()}_${Math.random().toString(36).substr(2, 9)}`;
|
|
384
|
-
}
|
|
385
|
-
mapModelName(model) {
|
|
386
|
-
if (!model)
|
|
387
|
-
return undefined;
|
|
388
|
-
const modelMap = {
|
|
389
|
-
'sonnet': 'claude-3-5-sonnet-20241022',
|
|
390
|
-
'opus': 'claude-3-opus-20240229',
|
|
391
|
-
'haiku': 'claude-3-5-haiku-20241022'
|
|
392
|
-
};
|
|
393
|
-
return modelMap[model];
|
|
394
|
-
}
|
|
395
|
-
/**
|
|
396
|
-
* Cleanup
|
|
397
|
-
*/
|
|
398
|
-
async shutdown() {
|
|
399
|
-
// Interrupt all active agents
|
|
400
|
-
for (const [agentId, query] of this.activeQueries.entries()) {
|
|
401
|
-
try {
|
|
402
|
-
await query.interrupt();
|
|
403
|
-
this.logger.info(`⏹️ Interrupted agent ${agentId}`);
|
|
404
|
-
}
|
|
405
|
-
catch (error) {
|
|
406
|
-
this.logger.error(`Failed to interrupt agent ${agentId}:`, error);
|
|
407
|
-
}
|
|
408
|
-
}
|
|
409
|
-
this.activeQueries.clear();
|
|
410
|
-
this.removeAllListeners();
|
|
411
|
-
}
|
|
412
|
-
}
|
|
413
|
-
exports.ClaudeAgentSDKIntegration = ClaudeAgentSDKIntegration;
|
|
414
|
-
//# sourceMappingURL=claude-agent-sdk-integration.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"claude-agent-sdk-integration.js","sourceRoot":"","sources":["../../src/sdk/claude-agent-sdk-integration.ts"],"names":[],"mappings":";AAAA;;;;;;;;;GASG;;;AAEH,qEAAwH;AAExH,kDAA4C;AAC5C,mCAAsC;AA2CtC;;;GAGG;AACH,MAAa,yBAA0B,SAAQ,qBAAY;IAKzD,YAAY,MAAoB;QAC9B,KAAK,EAAE,CAAC;QAHF,kBAAa,GAAuB,IAAI,GAAG,EAAE,CAAC;QAIpD,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,MAAM,GAAG,IAAI,kBAAM,CAAC,gBAAgB,CAAC,CAAC;IAC7C,CAAC;IAED;;;;;OAKG;IACH,KAAK,CAAC,UAAU,CAAC,MAA2B;QAC1C,M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