@weavelogic/knowledge-graph-agent 0.3.0 → 0.4.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/README.md +290 -3
- package/dist/_virtual/index10.js +2 -2
- package/dist/_virtual/index6.js +2 -2
- package/dist/_virtual/index7.js +2 -2
- package/dist/_virtual/index8.js +2 -2
- package/dist/_virtual/index9.js +2 -2
- package/dist/audit/config.d.ts +150 -0
- package/dist/audit/config.d.ts.map +1 -0
- package/dist/audit/config.js +111 -0
- package/dist/audit/config.js.map +1 -0
- package/dist/audit/index.d.ts +38 -0
- package/dist/audit/index.d.ts.map +1 -0
- package/dist/audit/services/audit-chain.d.ts +276 -0
- package/dist/audit/services/audit-chain.d.ts.map +1 -0
- package/dist/audit/services/audit-chain.js +502 -0
- package/dist/audit/services/audit-chain.js.map +1 -0
- package/dist/audit/services/index.d.ts +11 -0
- package/dist/audit/services/index.d.ts.map +1 -0
- package/dist/audit/services/syndication.d.ts +334 -0
- package/dist/audit/services/syndication.d.ts.map +1 -0
- package/dist/audit/services/syndication.js +589 -0
- package/dist/audit/services/syndication.js.map +1 -0
- package/dist/audit/types.d.ts +453 -0
- package/dist/audit/types.d.ts.map +1 -0
- package/dist/cli/commands/audit.d.ts +21 -0
- package/dist/cli/commands/audit.d.ts.map +1 -0
- package/dist/cli/commands/audit.js +621 -0
- package/dist/cli/commands/audit.js.map +1 -0
- package/dist/cli/commands/vector.d.ts +14 -0
- package/dist/cli/commands/vector.d.ts.map +1 -0
- package/dist/cli/commands/vector.js +429 -0
- package/dist/cli/commands/vector.js.map +1 -0
- package/dist/cli/commands/workflow.d.ts +12 -0
- package/dist/cli/commands/workflow.d.ts.map +1 -0
- package/dist/cli/commands/workflow.js +471 -0
- package/dist/cli/commands/workflow.js.map +1 -0
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +26 -0
- package/dist/cli/index.js.map +1 -1
- package/dist/database/schemas/index.d.ts +85 -0
- package/dist/database/schemas/index.d.ts.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +9 -0
- package/dist/index.js.map +1 -1
- package/dist/mcp-server/tools/audit/checkpoint.d.ts +58 -0
- package/dist/mcp-server/tools/audit/checkpoint.d.ts.map +1 -0
- package/dist/mcp-server/tools/audit/checkpoint.js +73 -0
- package/dist/mcp-server/tools/audit/checkpoint.js.map +1 -0
- package/dist/mcp-server/tools/audit/index.d.ts +53 -0
- package/dist/mcp-server/tools/audit/index.d.ts.map +1 -0
- package/dist/mcp-server/tools/audit/index.js +12 -0
- package/dist/mcp-server/tools/audit/index.js.map +1 -0
- package/dist/mcp-server/tools/audit/query.d.ts +58 -0
- package/dist/mcp-server/tools/audit/query.d.ts.map +1 -0
- package/dist/mcp-server/tools/audit/query.js +125 -0
- package/dist/mcp-server/tools/audit/query.js.map +1 -0
- package/dist/mcp-server/tools/audit/sync.d.ts +58 -0
- package/dist/mcp-server/tools/audit/sync.d.ts.map +1 -0
- package/dist/mcp-server/tools/audit/sync.js +126 -0
- package/dist/mcp-server/tools/audit/sync.js.map +1 -0
- package/dist/mcp-server/tools/index.d.ts +3 -0
- package/dist/mcp-server/tools/index.d.ts.map +1 -1
- package/dist/mcp-server/tools/registry.js +90 -0
- package/dist/mcp-server/tools/registry.js.map +1 -1
- package/dist/mcp-server/tools/vector/index.d.ts +12 -0
- package/dist/mcp-server/tools/vector/index.d.ts.map +1 -0
- package/dist/mcp-server/tools/vector/index.js +12 -0
- package/dist/mcp-server/tools/vector/index.js.map +1 -0
- package/dist/mcp-server/tools/vector/search.d.ts +41 -0
- package/dist/mcp-server/tools/vector/search.d.ts.map +1 -0
- package/dist/mcp-server/tools/vector/search.js +224 -0
- package/dist/mcp-server/tools/vector/search.js.map +1 -0
- package/dist/mcp-server/tools/vector/trajectory.d.ts +39 -0
- package/dist/mcp-server/tools/vector/trajectory.d.ts.map +1 -0
- package/dist/mcp-server/tools/vector/trajectory.js +170 -0
- package/dist/mcp-server/tools/vector/trajectory.js.map +1 -0
- package/dist/mcp-server/tools/vector/upsert.d.ts +44 -0
- package/dist/mcp-server/tools/vector/upsert.d.ts.map +1 -0
- package/dist/mcp-server/tools/vector/upsert.js +175 -0
- package/dist/mcp-server/tools/vector/upsert.js.map +1 -0
- package/dist/mcp-server/tools/workflow/index.d.ts +29 -0
- package/dist/mcp-server/tools/workflow/index.d.ts.map +1 -0
- package/dist/mcp-server/tools/workflow/index.js +12 -0
- package/dist/mcp-server/tools/workflow/index.js.map +1 -0
- package/dist/mcp-server/tools/workflow/list.d.ts +41 -0
- package/dist/mcp-server/tools/workflow/list.d.ts.map +1 -0
- package/dist/mcp-server/tools/workflow/list.js +195 -0
- package/dist/mcp-server/tools/workflow/list.js.map +1 -0
- package/dist/mcp-server/tools/workflow/start.d.ts +40 -0
- package/dist/mcp-server/tools/workflow/start.d.ts.map +1 -0
- package/dist/mcp-server/tools/workflow/start.js +165 -0
- package/dist/mcp-server/tools/workflow/start.js.map +1 -0
- package/dist/mcp-server/tools/workflow/status.d.ts +38 -0
- package/dist/mcp-server/tools/workflow/status.d.ts.map +1 -0
- package/dist/mcp-server/tools/workflow/status.js +97 -0
- package/dist/mcp-server/tools/workflow/status.js.map +1 -0
- package/dist/node_modules/ajv/dist/compile/index.js +1 -1
- package/dist/node_modules/ajv/dist/vocabularies/applicator/index.js +1 -1
- package/dist/node_modules/ajv/dist/vocabularies/core/index.js +1 -1
- package/dist/node_modules/ajv/dist/vocabularies/format/index.js +1 -1
- package/dist/node_modules/ajv/dist/vocabularies/validation/index.js +1 -1
- package/dist/vector/config.d.ts +300 -0
- package/dist/vector/config.d.ts.map +1 -0
- package/dist/vector/config.js +124 -0
- package/dist/vector/config.js.map +1 -0
- package/dist/vector/index.d.ts +50 -0
- package/dist/vector/index.d.ts.map +1 -0
- package/dist/vector/services/index.d.ts +13 -0
- package/dist/vector/services/index.d.ts.map +1 -0
- package/dist/vector/services/trajectory-tracker.d.ts +405 -0
- package/dist/vector/services/trajectory-tracker.d.ts.map +1 -0
- package/dist/vector/services/trajectory-tracker.js +445 -0
- package/dist/vector/services/trajectory-tracker.js.map +1 -0
- package/dist/vector/services/vector-store.d.ts +339 -0
- package/dist/vector/services/vector-store.d.ts.map +1 -0
- package/dist/vector/services/vector-store.js +748 -0
- package/dist/vector/services/vector-store.js.map +1 -0
- package/dist/vector/types.d.ts +677 -0
- package/dist/vector/types.d.ts.map +1 -0
- package/dist/workflow/adapters/goap-adapter.d.ts +196 -0
- package/dist/workflow/adapters/goap-adapter.d.ts.map +1 -0
- package/dist/workflow/adapters/goap-adapter.js +706 -0
- package/dist/workflow/adapters/goap-adapter.js.map +1 -0
- package/dist/workflow/adapters/index.d.ts +10 -0
- package/dist/workflow/adapters/index.d.ts.map +1 -0
- package/dist/workflow/config.d.ts +135 -0
- package/dist/workflow/config.d.ts.map +1 -0
- package/dist/workflow/config.js +92 -0
- package/dist/workflow/config.js.map +1 -0
- package/dist/workflow/handlers/index.d.ts +9 -0
- package/dist/workflow/handlers/index.d.ts.map +1 -0
- package/dist/workflow/handlers/webhook-handlers.d.ts +397 -0
- package/dist/workflow/handlers/webhook-handlers.d.ts.map +1 -0
- package/dist/workflow/handlers/webhook-handlers.js +454 -0
- package/dist/workflow/handlers/webhook-handlers.js.map +1 -0
- package/dist/workflow/index.d.ts +42 -0
- package/dist/workflow/index.d.ts.map +1 -0
- package/dist/workflow/services/index.d.ts +9 -0
- package/dist/workflow/services/index.d.ts.map +1 -0
- package/dist/workflow/services/workflow-service.d.ts +318 -0
- package/dist/workflow/services/workflow-service.d.ts.map +1 -0
- package/dist/workflow/services/workflow-service.js +577 -0
- package/dist/workflow/services/workflow-service.js.map +1 -0
- package/dist/workflow/types.d.ts +470 -0
- package/dist/workflow/types.d.ts.map +1 -0
- package/dist/workflow/workflows/realtime-collab.d.ts +245 -0
- package/dist/workflow/workflows/realtime-collab.d.ts.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
import "../../../workflow/config.js";
|
|
2
|
+
import "../../../workflow/adapters/goap-adapter.js";
|
|
3
|
+
import { createWorkflowService } from "../../../workflow/services/workflow-service.js";
|
|
4
|
+
let workflowServiceInstance;
|
|
5
|
+
function getWorkflowService() {
|
|
6
|
+
if (!workflowServiceInstance) {
|
|
7
|
+
workflowServiceInstance = createWorkflowService();
|
|
8
|
+
}
|
|
9
|
+
return workflowServiceInstance;
|
|
10
|
+
}
|
|
11
|
+
const workflowListTool = {
|
|
12
|
+
name: "kg_workflow_list",
|
|
13
|
+
description: "List all active workflows with optional filtering",
|
|
14
|
+
inputSchema: {
|
|
15
|
+
type: "object",
|
|
16
|
+
properties: {
|
|
17
|
+
status: {
|
|
18
|
+
type: "string",
|
|
19
|
+
description: "Filter by workflow status",
|
|
20
|
+
enum: ["running", "completed", "failed", "suspended", "all"]
|
|
21
|
+
},
|
|
22
|
+
type: {
|
|
23
|
+
type: "string",
|
|
24
|
+
description: "Filter by workflow type",
|
|
25
|
+
enum: ["realtime-collab", "analysis", "sync", "custom", "all"]
|
|
26
|
+
},
|
|
27
|
+
limit: {
|
|
28
|
+
type: "number",
|
|
29
|
+
description: "Maximum number of workflows to return",
|
|
30
|
+
default: 50
|
|
31
|
+
},
|
|
32
|
+
offset: {
|
|
33
|
+
type: "number",
|
|
34
|
+
description: "Number of workflows to skip (for pagination)",
|
|
35
|
+
default: 0
|
|
36
|
+
},
|
|
37
|
+
sortBy: {
|
|
38
|
+
type: "string",
|
|
39
|
+
description: "Field to sort by",
|
|
40
|
+
enum: ["startedAt", "lastEventAt", "status", "type"],
|
|
41
|
+
default: "startedAt"
|
|
42
|
+
},
|
|
43
|
+
sortOrder: {
|
|
44
|
+
type: "string",
|
|
45
|
+
description: "Sort order",
|
|
46
|
+
enum: ["asc", "desc"],
|
|
47
|
+
default: "desc"
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
function filterWorkflows(workflows, options) {
|
|
53
|
+
let filtered = workflows.map((w) => ({
|
|
54
|
+
id: w.id,
|
|
55
|
+
type: w.type,
|
|
56
|
+
startedAt: w.startedAt,
|
|
57
|
+
status: w.status,
|
|
58
|
+
currentStep: w.currentStep,
|
|
59
|
+
lastEventAt: w.lastEventAt,
|
|
60
|
+
duration: w.lastEventAt ? w.lastEventAt.getTime() - w.startedAt.getTime() : Date.now() - w.startedAt.getTime(),
|
|
61
|
+
isActive: w.status === "running" || w.status === "suspended"
|
|
62
|
+
}));
|
|
63
|
+
if (options.status && options.status !== "all") {
|
|
64
|
+
filtered = filtered.filter((w) => w.status === options.status);
|
|
65
|
+
}
|
|
66
|
+
if (options.type && options.type !== "all") {
|
|
67
|
+
filtered = filtered.filter((w) => w.type === options.type);
|
|
68
|
+
}
|
|
69
|
+
const sortBy = options.sortBy || "startedAt";
|
|
70
|
+
const sortOrder = options.sortOrder || "desc";
|
|
71
|
+
const multiplier = sortOrder === "desc" ? -1 : 1;
|
|
72
|
+
filtered.sort((a, b) => {
|
|
73
|
+
let aVal;
|
|
74
|
+
let bVal;
|
|
75
|
+
switch (sortBy) {
|
|
76
|
+
case "startedAt":
|
|
77
|
+
aVal = a.startedAt.getTime();
|
|
78
|
+
bVal = b.startedAt.getTime();
|
|
79
|
+
break;
|
|
80
|
+
case "lastEventAt":
|
|
81
|
+
aVal = a.lastEventAt?.getTime() || 0;
|
|
82
|
+
bVal = b.lastEventAt?.getTime() || 0;
|
|
83
|
+
break;
|
|
84
|
+
case "status":
|
|
85
|
+
aVal = a.status;
|
|
86
|
+
bVal = b.status;
|
|
87
|
+
break;
|
|
88
|
+
case "type":
|
|
89
|
+
aVal = a.type;
|
|
90
|
+
bVal = b.type;
|
|
91
|
+
break;
|
|
92
|
+
default:
|
|
93
|
+
aVal = a.startedAt.getTime();
|
|
94
|
+
bVal = b.startedAt.getTime();
|
|
95
|
+
}
|
|
96
|
+
if (aVal < bVal) return -1 * multiplier;
|
|
97
|
+
if (aVal > bVal) return 1 * multiplier;
|
|
98
|
+
return 0;
|
|
99
|
+
});
|
|
100
|
+
return filtered;
|
|
101
|
+
}
|
|
102
|
+
function createWorkflowListHandler() {
|
|
103
|
+
return async (params) => {
|
|
104
|
+
const startTime = Date.now();
|
|
105
|
+
const {
|
|
106
|
+
status = "all",
|
|
107
|
+
type = "all",
|
|
108
|
+
limit = 50,
|
|
109
|
+
offset = 0,
|
|
110
|
+
sortBy = "startedAt",
|
|
111
|
+
sortOrder = "desc"
|
|
112
|
+
} = params || {};
|
|
113
|
+
try {
|
|
114
|
+
const service = getWorkflowService();
|
|
115
|
+
const serviceStatus = service.getStatus();
|
|
116
|
+
const allWorkflows = serviceStatus.activeWorkflows;
|
|
117
|
+
const filteredWorkflows = filterWorkflows(allWorkflows, {
|
|
118
|
+
status,
|
|
119
|
+
type,
|
|
120
|
+
sortBy,
|
|
121
|
+
sortOrder
|
|
122
|
+
});
|
|
123
|
+
const numLimit = typeof limit === "number" ? limit : 50;
|
|
124
|
+
const numOffset = typeof offset === "number" ? offset : 0;
|
|
125
|
+
const paginatedWorkflows = filteredWorkflows.slice(
|
|
126
|
+
numOffset,
|
|
127
|
+
numOffset + numLimit
|
|
128
|
+
);
|
|
129
|
+
const summary = {
|
|
130
|
+
total: allWorkflows.length,
|
|
131
|
+
filtered: filteredWorkflows.length,
|
|
132
|
+
returned: paginatedWorkflows.length,
|
|
133
|
+
byStatus: {
|
|
134
|
+
running: allWorkflows.filter((w) => w.status === "running").length,
|
|
135
|
+
completed: allWorkflows.filter((w) => w.status === "completed").length,
|
|
136
|
+
failed: allWorkflows.filter((w) => w.status === "failed").length,
|
|
137
|
+
suspended: allWorkflows.filter((w) => w.status === "suspended").length
|
|
138
|
+
},
|
|
139
|
+
byType: allWorkflows.reduce((acc, w) => {
|
|
140
|
+
acc[w.type] = (acc[w.type] || 0) + 1;
|
|
141
|
+
return acc;
|
|
142
|
+
}, {})
|
|
143
|
+
};
|
|
144
|
+
const workflows = paginatedWorkflows.map((w) => ({
|
|
145
|
+
id: w.id,
|
|
146
|
+
type: w.type,
|
|
147
|
+
status: w.status,
|
|
148
|
+
currentStep: w.currentStep,
|
|
149
|
+
startedAt: w.startedAt.toISOString(),
|
|
150
|
+
lastEventAt: w.lastEventAt?.toISOString(),
|
|
151
|
+
duration: w.duration,
|
|
152
|
+
isActive: w.isActive
|
|
153
|
+
}));
|
|
154
|
+
return {
|
|
155
|
+
success: true,
|
|
156
|
+
data: {
|
|
157
|
+
workflows,
|
|
158
|
+
summary,
|
|
159
|
+
pagination: {
|
|
160
|
+
limit: numLimit,
|
|
161
|
+
offset: numOffset,
|
|
162
|
+
hasMore: numOffset + numLimit < filteredWorkflows.length,
|
|
163
|
+
nextOffset: numOffset + numLimit < filteredWorkflows.length ? numOffset + numLimit : null
|
|
164
|
+
},
|
|
165
|
+
serviceStatus: {
|
|
166
|
+
isRunning: serviceStatus.isRunning,
|
|
167
|
+
watchedPaths: serviceStatus.watchedPaths.length,
|
|
168
|
+
lastActivity: serviceStatus.lastActivity?.toISOString()
|
|
169
|
+
}
|
|
170
|
+
},
|
|
171
|
+
metadata: {
|
|
172
|
+
executionTime: Date.now() - startTime,
|
|
173
|
+
filters: {
|
|
174
|
+
status: status || "all",
|
|
175
|
+
type: type || "all",
|
|
176
|
+
sortBy: sortBy || "startedAt",
|
|
177
|
+
sortOrder: sortOrder || "desc"
|
|
178
|
+
},
|
|
179
|
+
itemCount: workflows.length
|
|
180
|
+
}
|
|
181
|
+
};
|
|
182
|
+
} catch (error) {
|
|
183
|
+
return {
|
|
184
|
+
success: false,
|
|
185
|
+
error: error instanceof Error ? error.message : String(error),
|
|
186
|
+
metadata: { executionTime: Date.now() - startTime }
|
|
187
|
+
};
|
|
188
|
+
}
|
|
189
|
+
};
|
|
190
|
+
}
|
|
191
|
+
export {
|
|
192
|
+
createWorkflowListHandler,
|
|
193
|
+
workflowListTool
|
|
194
|
+
};
|
|
195
|
+
//# sourceMappingURL=list.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list.js","sources":["../../../../src/mcp-server/tools/workflow/list.ts"],"sourcesContent":["/**\n * Workflow List Tool\n *\n * MCP tool for listing all active workflows with filtering\n * and sorting capabilities.\n *\n * @module mcp-server/tools/workflow/list\n */\n\nimport type { Tool } from '@modelcontextprotocol/sdk/types.js';\nimport type { ToolHandler, ToolResult } from '../../types/index.js';\nimport {\n createWorkflowService,\n type WorkflowService,\n type WorkflowRunMetadata,\n} from '../../../workflow/index.js';\n\n/** Singleton workflow service instance */\nlet workflowServiceInstance: WorkflowService | undefined;\n\n/**\n * Get or create the workflow service instance\n *\n * @returns WorkflowService instance\n */\nfunction getWorkflowService(): WorkflowService {\n if (!workflowServiceInstance) {\n workflowServiceInstance = createWorkflowService();\n }\n return workflowServiceInstance;\n}\n\n/**\n * Workflow list tool definition\n *\n * Defines the MCP tool interface for listing workflows.\n * Supports filtering by status and type with pagination.\n */\nexport const workflowListTool: Tool = {\n name: 'kg_workflow_list',\n description: 'List all active workflows with optional filtering',\n inputSchema: {\n type: 'object' as const,\n properties: {\n status: {\n type: 'string',\n description: 'Filter by workflow status',\n enum: ['running', 'completed', 'failed', 'suspended', 'all'],\n },\n type: {\n type: 'string',\n description: 'Filter by workflow type',\n enum: ['realtime-collab', 'analysis', 'sync', 'custom', 'all'],\n },\n limit: {\n type: 'number',\n description: 'Maximum number of workflows to return',\n default: 50,\n },\n offset: {\n type: 'number',\n description: 'Number of workflows to skip (for pagination)',\n default: 0,\n },\n sortBy: {\n type: 'string',\n description: 'Field to sort by',\n enum: ['startedAt', 'lastEventAt', 'status', 'type'],\n default: 'startedAt',\n },\n sortOrder: {\n type: 'string',\n description: 'Sort order',\n enum: ['asc', 'desc'],\n default: 'desc',\n },\n },\n },\n};\n\n/**\n * Workflow filter options\n */\ninterface WorkflowFilterOptions {\n status?: string;\n type?: string;\n limit?: number;\n offset?: number;\n sortBy?: string;\n sortOrder?: 'asc' | 'desc';\n}\n\n/**\n * Extended workflow info with computed fields\n */\ninterface WorkflowInfo {\n /** Unique run identifier */\n id: string;\n /** Type of workflow being executed */\n type: string;\n /** Timestamp when the workflow started */\n startedAt: Date;\n /** Current status of the workflow */\n status: 'running' | 'completed' | 'failed' | 'suspended';\n /** ID of the currently executing step */\n currentStep?: string;\n /** Timestamp of the last event in this workflow */\n lastEventAt?: Date;\n /** Computed duration in milliseconds */\n duration?: number;\n /** Whether workflow is currently active */\n isActive: boolean;\n}\n\n/**\n * Filter workflows based on provided options\n *\n * @param workflows - Array of workflow metadata\n * @param options - Filter options\n * @returns Filtered array of workflows\n */\nfunction filterWorkflows(\n workflows: WorkflowRunMetadata[],\n options: WorkflowFilterOptions\n): WorkflowInfo[] {\n let filtered: WorkflowInfo[] = workflows.map(w => ({\n id: w.id,\n type: w.type,\n startedAt: w.startedAt,\n status: w.status,\n currentStep: w.currentStep,\n lastEventAt: w.lastEventAt,\n duration: w.lastEventAt\n ? w.lastEventAt.getTime() - w.startedAt.getTime()\n : Date.now() - w.startedAt.getTime(),\n isActive: w.status === 'running' || w.status === 'suspended',\n }));\n\n // Filter by status\n if (options.status && options.status !== 'all') {\n filtered = filtered.filter(w => w.status === options.status);\n }\n\n // Filter by type\n if (options.type && options.type !== 'all') {\n filtered = filtered.filter(w => w.type === options.type);\n }\n\n // Sort\n const sortBy = options.sortBy || 'startedAt';\n const sortOrder = options.sortOrder || 'desc';\n const multiplier = sortOrder === 'desc' ? -1 : 1;\n\n filtered.sort((a, b) => {\n let aVal: string | number | Date;\n let bVal: string | number | Date;\n\n switch (sortBy) {\n case 'startedAt':\n aVal = a.startedAt.getTime();\n bVal = b.startedAt.getTime();\n break;\n case 'lastEventAt':\n aVal = a.lastEventAt?.getTime() || 0;\n bVal = b.lastEventAt?.getTime() || 0;\n break;\n case 'status':\n aVal = a.status;\n bVal = b.status;\n break;\n case 'type':\n aVal = a.type;\n bVal = b.type;\n break;\n default:\n aVal = a.startedAt.getTime();\n bVal = b.startedAt.getTime();\n }\n\n if (aVal < bVal) return -1 * multiplier;\n if (aVal > bVal) return 1 * multiplier;\n return 0;\n });\n\n return filtered;\n}\n\n/**\n * Create handler for workflow list tool\n *\n * Creates an async handler that lists all workflows with\n * optional filtering, sorting, and pagination.\n *\n * @returns ToolHandler function for listing workflows\n *\n * @example\n * ```typescript\n * const handler = createWorkflowListHandler();\n *\n * // List all running workflows\n * const running = await handler({ status: 'running' });\n *\n * // List with pagination\n * const page2 = await handler({ limit: 10, offset: 10 });\n *\n * // List sorted by type\n * const byType = await handler({ sortBy: 'type', sortOrder: 'asc' });\n * ```\n */\nexport function createWorkflowListHandler(): ToolHandler {\n return async (params): Promise<ToolResult> => {\n const startTime = Date.now();\n const {\n status = 'all',\n type = 'all',\n limit = 50,\n offset = 0,\n sortBy = 'startedAt',\n sortOrder = 'desc',\n } = params || {};\n\n try {\n const service = getWorkflowService();\n const serviceStatus = service.getStatus();\n\n // Get all active workflows\n const allWorkflows = serviceStatus.activeWorkflows;\n\n // Apply filters\n const filteredWorkflows = filterWorkflows(allWorkflows, {\n status: status as string,\n type: type as string,\n sortBy: sortBy as string,\n sortOrder: sortOrder as 'asc' | 'desc',\n });\n\n // Apply pagination\n const numLimit = typeof limit === 'number' ? limit : 50;\n const numOffset = typeof offset === 'number' ? offset : 0;\n const paginatedWorkflows = filteredWorkflows.slice(\n numOffset,\n numOffset + numLimit\n );\n\n // Compute summary statistics\n const summary = {\n total: allWorkflows.length,\n filtered: filteredWorkflows.length,\n returned: paginatedWorkflows.length,\n byStatus: {\n running: allWorkflows.filter(w => w.status === 'running').length,\n completed: allWorkflows.filter(w => w.status === 'completed').length,\n failed: allWorkflows.filter(w => w.status === 'failed').length,\n suspended: allWorkflows.filter(w => w.status === 'suspended').length,\n },\n byType: allWorkflows.reduce((acc, w) => {\n acc[w.type] = (acc[w.type] || 0) + 1;\n return acc;\n }, {} as Record<string, number>),\n };\n\n // Format workflow data for response\n const workflows = paginatedWorkflows.map(w => ({\n id: w.id,\n type: w.type,\n status: w.status,\n currentStep: w.currentStep,\n startedAt: w.startedAt.toISOString(),\n lastEventAt: w.lastEventAt?.toISOString(),\n duration: w.duration,\n isActive: w.isActive,\n }));\n\n return {\n success: true,\n data: {\n workflows,\n summary,\n pagination: {\n limit: numLimit,\n offset: numOffset,\n hasMore: numOffset + numLimit < filteredWorkflows.length,\n nextOffset: numOffset + numLimit < filteredWorkflows.length\n ? numOffset + numLimit\n : null,\n },\n serviceStatus: {\n isRunning: serviceStatus.isRunning,\n watchedPaths: serviceStatus.watchedPaths.length,\n lastActivity: serviceStatus.lastActivity?.toISOString(),\n },\n },\n metadata: {\n executionTime: Date.now() - startTime,\n filters: {\n status: status || 'all',\n type: type || 'all',\n sortBy: sortBy || 'startedAt',\n sortOrder: sortOrder || 'desc',\n },\n itemCount: workflows.length,\n },\n };\n } catch (error) {\n return {\n success: false,\n error: error instanceof Error ? error.message : String(error),\n metadata: { executionTime: Date.now() - startTime },\n };\n }\n };\n}\n"],"names":[],"mappings":";;;AAkBA,IAAI;AAOJ,SAAS,qBAAsC;AAC7C,MAAI,CAAC,yBAAyB;AAC5B,8BAA0B,sBAAA;AAAA,EAC5B;AACA,SAAO;AACT;AAQO,MAAM,mBAAyB;AAAA,EACpC,MAAM;AAAA,EACN,aAAa;AAAA,EACb,aAAa;AAAA,IACX,MAAM;AAAA,IACN,YAAY;AAAA,MACV,QAAQ;AAAA,QACN,MAAM;AAAA,QACN,aAAa;AAAA,QACb,MAAM,CAAC,WAAW,aAAa,UAAU,aAAa,KAAK;AAAA,MAAA;AAAA,MAE7D,MAAM;AAAA,QACJ,MAAM;AAAA,QACN,aAAa;AAAA,QACb,MAAM,CAAC,mBAAmB,YAAY,QAAQ,UAAU,KAAK;AAAA,MAAA;AAAA,MAE/D,OAAO;AAAA,QACL,MAAM;AAAA,QACN,aAAa;AAAA,QACb,SAAS;AAAA,MAAA;AAAA,MAEX,QAAQ;AAAA,QACN,MAAM;AAAA,QACN,aAAa;AAAA,QACb,SAAS;AAAA,MAAA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,IAAA,IAAQ,UAAA;AAAA,MAAU;AAAA,IAEtD;AAAA,EACF;AACF;"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Workflow Start Tool
|
|
3
|
+
*
|
|
4
|
+
* MCP tool for starting a new workflow execution.
|
|
5
|
+
* Integrates with the WorkflowService for workflow orchestration.
|
|
6
|
+
*
|
|
7
|
+
* @module mcp-server/tools/workflow/start
|
|
8
|
+
*/
|
|
9
|
+
import type { Tool } from '@modelcontextprotocol/sdk/types.js';
|
|
10
|
+
import type { ToolHandler } from '../../types/index.js';
|
|
11
|
+
/**
|
|
12
|
+
* Workflow start tool definition
|
|
13
|
+
*
|
|
14
|
+
* Defines the MCP tool interface for starting workflows.
|
|
15
|
+
* Supports multiple workflow types including collaboration,
|
|
16
|
+
* analysis, and custom workflows.
|
|
17
|
+
*/
|
|
18
|
+
export declare const workflowStartTool: Tool;
|
|
19
|
+
/**
|
|
20
|
+
* Create handler for workflow start tool
|
|
21
|
+
*
|
|
22
|
+
* Creates an async handler that starts the specified workflow type
|
|
23
|
+
* and returns execution metadata.
|
|
24
|
+
*
|
|
25
|
+
* @returns ToolHandler function for starting workflows
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* ```typescript
|
|
29
|
+
* const handler = createWorkflowStartHandler();
|
|
30
|
+
* const result = await handler({
|
|
31
|
+
* workflowId: 'collaboration',
|
|
32
|
+
* input: {
|
|
33
|
+
* graphId: 'graph-123',
|
|
34
|
+
* docPath: './docs/spec.md'
|
|
35
|
+
* }
|
|
36
|
+
* });
|
|
37
|
+
* ```
|
|
38
|
+
*/
|
|
39
|
+
export declare function createWorkflowStartHandler(): ToolHandler;
|
|
40
|
+
//# sourceMappingURL=start.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"start.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/workflow/start.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,oCAAoC,CAAC;AAC/D,OAAO,KAAK,EAAE,WAAW,EAAc,MAAM,sBAAsB,CAAC;AAqBpE;;;;;;GAMG;AACH,eAAO,MAAM,iBAAiB,EAAE,IA+C/B,CAAC;AAoBF;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,0BAA0B,IAAI,WAAW,CAsHxD"}
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
import "../../../workflow/config.js";
|
|
2
|
+
import "../../../workflow/adapters/goap-adapter.js";
|
|
3
|
+
import { createWorkflowService } from "../../../workflow/services/workflow-service.js";
|
|
4
|
+
let workflowServiceInstance;
|
|
5
|
+
function getWorkflowService() {
|
|
6
|
+
if (!workflowServiceInstance) {
|
|
7
|
+
workflowServiceInstance = createWorkflowService();
|
|
8
|
+
}
|
|
9
|
+
return workflowServiceInstance;
|
|
10
|
+
}
|
|
11
|
+
const workflowStartTool = {
|
|
12
|
+
name: "kg_workflow_start",
|
|
13
|
+
description: "Start a new workflow for knowledge graph operations",
|
|
14
|
+
inputSchema: {
|
|
15
|
+
type: "object",
|
|
16
|
+
properties: {
|
|
17
|
+
workflowId: {
|
|
18
|
+
type: "string",
|
|
19
|
+
description: "Workflow type to start (collaboration, analysis, sync)",
|
|
20
|
+
enum: ["collaboration", "analysis", "sync", "custom"]
|
|
21
|
+
},
|
|
22
|
+
input: {
|
|
23
|
+
type: "object",
|
|
24
|
+
description: "Workflow input data",
|
|
25
|
+
properties: {
|
|
26
|
+
graphId: {
|
|
27
|
+
type: "string",
|
|
28
|
+
description: "Knowledge graph identifier"
|
|
29
|
+
},
|
|
30
|
+
docPath: {
|
|
31
|
+
type: "string",
|
|
32
|
+
description: "Path to the source document"
|
|
33
|
+
},
|
|
34
|
+
options: {
|
|
35
|
+
type: "object",
|
|
36
|
+
description: "Additional workflow options",
|
|
37
|
+
properties: {
|
|
38
|
+
autoStart: {
|
|
39
|
+
type: "boolean",
|
|
40
|
+
description: "Auto-start development when ready"
|
|
41
|
+
},
|
|
42
|
+
watchPaths: {
|
|
43
|
+
type: "array",
|
|
44
|
+
description: "Paths to watch for changes",
|
|
45
|
+
items: { type: "string" }
|
|
46
|
+
},
|
|
47
|
+
threshold: {
|
|
48
|
+
type: "number",
|
|
49
|
+
description: "Completeness threshold (0-1)"
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
required: ["workflowId"]
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
function createWorkflowStartHandler() {
|
|
60
|
+
return async (params) => {
|
|
61
|
+
const startTime = Date.now();
|
|
62
|
+
const { workflowId, input = {} } = params || {};
|
|
63
|
+
if (!workflowId || typeof workflowId !== "string") {
|
|
64
|
+
return {
|
|
65
|
+
success: false,
|
|
66
|
+
error: "Workflow ID is required",
|
|
67
|
+
metadata: { executionTime: Date.now() - startTime }
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
const validWorkflowTypes = ["collaboration", "analysis", "sync", "custom"];
|
|
71
|
+
if (!validWorkflowTypes.includes(workflowId)) {
|
|
72
|
+
return {
|
|
73
|
+
success: false,
|
|
74
|
+
error: `Invalid workflow type: ${workflowId}. Valid types: ${validWorkflowTypes.join(", ")}`,
|
|
75
|
+
metadata: { executionTime: Date.now() - startTime }
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
try {
|
|
79
|
+
const service = getWorkflowService();
|
|
80
|
+
const typedInput = input;
|
|
81
|
+
const status = service.getStatus();
|
|
82
|
+
if (!status.isRunning) {
|
|
83
|
+
await service.start();
|
|
84
|
+
}
|
|
85
|
+
if (typedInput.options?.watchPaths) {
|
|
86
|
+
for (const path of typedInput.options.watchPaths) {
|
|
87
|
+
service.watch(path);
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
let result;
|
|
91
|
+
switch (workflowId) {
|
|
92
|
+
case "collaboration":
|
|
93
|
+
result = await service.startCollaborationWorkflow(
|
|
94
|
+
typedInput.graphId || `graph-${Date.now()}`,
|
|
95
|
+
typedInput.docPath || "./"
|
|
96
|
+
);
|
|
97
|
+
break;
|
|
98
|
+
case "analysis":
|
|
99
|
+
const analysis = await service.analyzeGaps(typedInput.docPath || "./");
|
|
100
|
+
result = {
|
|
101
|
+
success: true,
|
|
102
|
+
workflowId: `analysis-${Date.now()}`,
|
|
103
|
+
startedAt: /* @__PURE__ */ new Date(),
|
|
104
|
+
completedAt: /* @__PURE__ */ new Date(),
|
|
105
|
+
outcome: "completed",
|
|
106
|
+
artifacts: analysis.recommendations,
|
|
107
|
+
data: analysis
|
|
108
|
+
};
|
|
109
|
+
break;
|
|
110
|
+
case "sync":
|
|
111
|
+
const watchPaths = typedInput.options?.watchPaths || [typedInput.docPath || "./"];
|
|
112
|
+
for (const path of watchPaths) {
|
|
113
|
+
service.watch(path);
|
|
114
|
+
}
|
|
115
|
+
result = {
|
|
116
|
+
success: true,
|
|
117
|
+
workflowId: `sync-${Date.now()}`,
|
|
118
|
+
startedAt: /* @__PURE__ */ new Date(),
|
|
119
|
+
outcome: "completed",
|
|
120
|
+
artifacts: watchPaths
|
|
121
|
+
};
|
|
122
|
+
break;
|
|
123
|
+
case "custom":
|
|
124
|
+
const plan = await service.createPlan("start-development");
|
|
125
|
+
result = {
|
|
126
|
+
success: plan.achievable,
|
|
127
|
+
workflowId: `custom-${Date.now()}`,
|
|
128
|
+
startedAt: /* @__PURE__ */ new Date(),
|
|
129
|
+
completedAt: /* @__PURE__ */ new Date(),
|
|
130
|
+
outcome: plan.achievable ? "completed" : "failed",
|
|
131
|
+
artifacts: plan.actionIds,
|
|
132
|
+
data: { plan }
|
|
133
|
+
};
|
|
134
|
+
break;
|
|
135
|
+
}
|
|
136
|
+
return {
|
|
137
|
+
success: result.success,
|
|
138
|
+
data: {
|
|
139
|
+
workflowId: result.workflowId,
|
|
140
|
+
type: workflowId,
|
|
141
|
+
startedAt: result.startedAt,
|
|
142
|
+
completedAt: result.completedAt,
|
|
143
|
+
outcome: result.outcome,
|
|
144
|
+
artifacts: result.artifacts,
|
|
145
|
+
...result.error ? { error: result.error } : {}
|
|
146
|
+
},
|
|
147
|
+
metadata: {
|
|
148
|
+
executionTime: Date.now() - startTime,
|
|
149
|
+
serviceStatus: service.getStatus().isRunning ? "running" : "stopped"
|
|
150
|
+
}
|
|
151
|
+
};
|
|
152
|
+
} catch (error) {
|
|
153
|
+
return {
|
|
154
|
+
success: false,
|
|
155
|
+
error: error instanceof Error ? error.message : String(error),
|
|
156
|
+
metadata: { executionTime: Date.now() - startTime }
|
|
157
|
+
};
|
|
158
|
+
}
|
|
159
|
+
};
|
|
160
|
+
}
|
|
161
|
+
export {
|
|
162
|
+
createWorkflowStartHandler,
|
|
163
|
+
workflowStartTool
|
|
164
|
+
};
|
|
165
|
+
//# sourceMappingURL=start.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"start.js","sources":["../../../../src/mcp-server/tools/workflow/start.ts"],"sourcesContent":["/**\n * Workflow Start Tool\n *\n * MCP tool for starting a new workflow execution.\n * Integrates with the WorkflowService for workflow orchestration.\n *\n * @module mcp-server/tools/workflow/start\n */\n\nimport type { Tool } from '@modelcontextprotocol/sdk/types.js';\nimport type { ToolHandler, ToolResult } from '../../types/index.js';\nimport {\n createWorkflowService,\n type WorkflowService,\n} from '../../../workflow/index.js';\n\n/** Singleton workflow service instance */\nlet workflowServiceInstance: WorkflowService | undefined;\n\n/**\n * Get or create the workflow service instance\n *\n * @returns WorkflowService instance\n */\nfunction getWorkflowService(): WorkflowService {\n if (!workflowServiceInstance) {\n workflowServiceInstance = createWorkflowService();\n }\n return workflowServiceInstance;\n}\n\n/**\n * Workflow start tool definition\n *\n * Defines the MCP tool interface for starting workflows.\n * Supports multiple workflow types including collaboration,\n * analysis, and custom workflows.\n */\nexport const workflowStartTool: Tool = {\n name: 'kg_workflow_start',\n description: 'Start a new workflow for knowledge graph operations',\n inputSchema: {\n type: 'object' as const,\n properties: {\n workflowId: {\n type: 'string',\n description: 'Workflow type to start (collaboration, analysis, sync)',\n enum: ['collaboration', 'analysis', 'sync', 'custom'],\n },\n input: {\n type: 'object',\n description: 'Workflow input data',\n properties: {\n graphId: {\n type: 'string',\n description: 'Knowledge graph identifier',\n },\n docPath: {\n type: 'string',\n description: 'Path to the source document',\n },\n options: {\n type: 'object',\n description: 'Additional workflow options',\n properties: {\n autoStart: {\n type: 'boolean',\n description: 'Auto-start development when ready',\n },\n watchPaths: {\n type: 'array',\n description: 'Paths to watch for changes',\n items: { type: 'string' },\n },\n threshold: {\n type: 'number',\n description: 'Completeness threshold (0-1)',\n },\n },\n },\n },\n },\n },\n required: ['workflowId'],\n },\n};\n\n/**\n * Workflow type definitions for different workflow scenarios\n */\ntype WorkflowType = 'collaboration' | 'analysis' | 'sync' | 'custom';\n\n/**\n * Input structure for workflow execution\n */\ninterface WorkflowInput {\n graphId?: string;\n docPath?: string;\n options?: {\n autoStart?: boolean;\n watchPaths?: string[];\n threshold?: number;\n };\n}\n\n/**\n * Create handler for workflow start tool\n *\n * Creates an async handler that starts the specified workflow type\n * and returns execution metadata.\n *\n * @returns ToolHandler function for starting workflows\n *\n * @example\n * ```typescript\n * const handler = createWorkflowStartHandler();\n * const result = await handler({\n * workflowId: 'collaboration',\n * input: {\n * graphId: 'graph-123',\n * docPath: './docs/spec.md'\n * }\n * });\n * ```\n */\nexport function createWorkflowStartHandler(): ToolHandler {\n return async (params): Promise<ToolResult> => {\n const startTime = Date.now();\n const { workflowId, input = {} } = params || {};\n\n // Validate required parameters\n if (!workflowId || typeof workflowId !== 'string') {\n return {\n success: false,\n error: 'Workflow ID is required',\n metadata: { executionTime: Date.now() - startTime },\n };\n }\n\n const validWorkflowTypes: WorkflowType[] = ['collaboration', 'analysis', 'sync', 'custom'];\n if (!validWorkflowTypes.includes(workflowId as WorkflowType)) {\n return {\n success: false,\n error: `Invalid workflow type: ${workflowId}. Valid types: ${validWorkflowTypes.join(', ')}`,\n metadata: { executionTime: Date.now() - startTime },\n };\n }\n\n try {\n const service = getWorkflowService();\n const typedInput = input as WorkflowInput;\n\n // Ensure service is started\n const status = service.getStatus();\n if (!status.isRunning) {\n await service.start();\n }\n\n // Add watch paths if specified\n if (typedInput.options?.watchPaths) {\n for (const path of typedInput.options.watchPaths) {\n service.watch(path);\n }\n }\n\n let result;\n switch (workflowId as WorkflowType) {\n case 'collaboration':\n // Start collaboration workflow\n result = await service.startCollaborationWorkflow(\n typedInput.graphId || `graph-${Date.now()}`,\n typedInput.docPath || './'\n );\n break;\n\n case 'analysis':\n // Run gap analysis workflow\n const analysis = await service.analyzeGaps(typedInput.docPath || './');\n result = {\n success: true,\n workflowId: `analysis-${Date.now()}`,\n startedAt: new Date(),\n completedAt: new Date(),\n outcome: 'completed' as const,\n artifacts: analysis.recommendations,\n data: analysis,\n };\n break;\n\n case 'sync':\n // Sync workflow for file watching\n const watchPaths = typedInput.options?.watchPaths || [typedInput.docPath || './'];\n for (const path of watchPaths) {\n service.watch(path);\n }\n result = {\n success: true,\n workflowId: `sync-${Date.now()}`,\n startedAt: new Date(),\n outcome: 'completed' as const,\n artifacts: watchPaths,\n };\n break;\n\n case 'custom':\n // Custom workflow using GOAP planning\n const plan = await service.createPlan('start-development');\n result = {\n success: plan.achievable,\n workflowId: `custom-${Date.now()}`,\n startedAt: new Date(),\n completedAt: new Date(),\n outcome: plan.achievable ? 'completed' as const : 'failed' as const,\n artifacts: plan.actionIds,\n data: { plan },\n };\n break;\n }\n\n return {\n success: result.success,\n data: {\n workflowId: result.workflowId,\n type: workflowId,\n startedAt: result.startedAt,\n completedAt: result.completedAt,\n outcome: result.outcome,\n artifacts: result.artifacts,\n ...(result.error ? { error: result.error } : {}),\n },\n metadata: {\n executionTime: Date.now() - startTime,\n serviceStatus: service.getStatus().isRunning ? 'running' : 'stopped',\n },\n };\n } catch (error) {\n return {\n success: false,\n error: error instanceof Error ? error.message : String(error),\n metadata: { executionTime: Date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AAQ,KAAK,IAAA,CAAK;AAAA,YAC9B,+BAAe,KAAA;AAAA,YACf,SAAS;AAAA,YACT,WAAW;AAAA,UAAA;AAEb;AAAA,QAEF,KAAK;AAEH,gBAAM,OAAO,MAAM,QAAQ,WAAW,mBAAmB;AACzD,mBAAS;AAAA,YACP,SAAS,KAAK;AAAA,YACd,YAAY,UAAU,KAAK,IAAA,CAAK;AAAA,YAChC,+BAAe,KAAA;AAAA,YACf,iCAAiB,KAAA;AAAA,YACjB,SAAS,KAAK,aAAa,cAAuB;AAAA,YAClD,WAAW,KAAK;AAAA,YAChB,MAAM,EAAE,KAAA;AAAA,UAAK;AAEf;AAAA,MAAA;AAGJ,aAAO;AAAA,QACL,SAAS,OAAO;AAAA,QAChB,MAAM;AAAA,UACJ,YAAY,OAAO;AAAA,UACnB,MAAM;AAAA,UACN,WAAW,OAAO;AAAA,UAClB,aAAa,OAAO;AAAA,UACpB,SAAS,OAAO;AAAA,UAChB,WAAW,OAAO;AAAA,UAClB,GAAI,OAAO,QAAQ,EAAE,OAAO,OAAO,MAAA,IAAU,CAAA;AAAA,QAAC;AAAA,QAEhD,UAAU;AAAA,UACR,eAAe,KAAK,IAAA,IAAQ;AAAA,UAC5B,eAAe,QAAQ,YAAY,YAAY,YAAY;AAAA,QAAA;AAAA,MAC7D;AAAA,IAEJ,SAAS,OAAO;AACd,aAAO;AAAA,QACL,SAAS;AAAA,QACT,OAAO,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK;AAAA,QAC5D,UAAU,EAAE,eAAe,KAAK,IAAA,IAAQ,UAAA;AAAA,MAAU;AAAA,IAEtD;AAAA,EACF;AACF;"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Workflow Status Tool
|
|
3
|
+
*
|
|
4
|
+
* MCP tool for checking the status of a specific workflow
|
|
5
|
+
* or the overall workflow service status.
|
|
6
|
+
*
|
|
7
|
+
* @module mcp-server/tools/workflow/status
|
|
8
|
+
*/
|
|
9
|
+
import type { Tool } from '@modelcontextprotocol/sdk/types.js';
|
|
10
|
+
import type { ToolHandler } from '../../types/index.js';
|
|
11
|
+
/**
|
|
12
|
+
* Workflow status tool definition
|
|
13
|
+
*
|
|
14
|
+
* Defines the MCP tool interface for checking workflow status.
|
|
15
|
+
* Can query specific workflow by ID or get service-wide status.
|
|
16
|
+
*/
|
|
17
|
+
export declare const workflowStatusTool: Tool;
|
|
18
|
+
/**
|
|
19
|
+
* Create handler for workflow status tool
|
|
20
|
+
*
|
|
21
|
+
* Creates an async handler that returns the status of a specific
|
|
22
|
+
* workflow or the overall workflow service.
|
|
23
|
+
*
|
|
24
|
+
* @returns ToolHandler function for checking workflow status
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* ```typescript
|
|
28
|
+
* const handler = createWorkflowStatusHandler();
|
|
29
|
+
*
|
|
30
|
+
* // Check specific workflow
|
|
31
|
+
* const result = await handler({ workflowId: 'collab-123-abc' });
|
|
32
|
+
*
|
|
33
|
+
* // Check service status with metrics
|
|
34
|
+
* const serviceStatus = await handler({ includeMetrics: true });
|
|
35
|
+
* ```
|
|
36
|
+
*/
|
|
37
|
+
export declare function createWorkflowStatusHandler(): ToolHandler;
|
|
38
|
+
//# sourceMappingURL=status.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"status.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/workflow/status.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,oCAAoC,CAAC;AAC/D,OAAO,KAAK,EAAE,WAAW,EAAc,MAAM,sBAAsB,CAAC;AAsBpE;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB,EAAE,IAsBhC,CAAC;AAkCF;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,2BAA2B,IAAI,WAAW,CAqEzD"}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import "../../../workflow/config.js";
|
|
2
|
+
import "../../../workflow/adapters/goap-adapter.js";
|
|
3
|
+
import { createWorkflowService } from "../../../workflow/services/workflow-service.js";
|
|
4
|
+
let workflowServiceInstance;
|
|
5
|
+
function getWorkflowService() {
|
|
6
|
+
if (!workflowServiceInstance) {
|
|
7
|
+
workflowServiceInstance = createWorkflowService();
|
|
8
|
+
}
|
|
9
|
+
return workflowServiceInstance;
|
|
10
|
+
}
|
|
11
|
+
const workflowStatusTool = {
|
|
12
|
+
name: "kg_workflow_status",
|
|
13
|
+
description: "Check the status of a workflow or the workflow service",
|
|
14
|
+
inputSchema: {
|
|
15
|
+
type: "object",
|
|
16
|
+
properties: {
|
|
17
|
+
workflowId: {
|
|
18
|
+
type: "string",
|
|
19
|
+
description: "Specific workflow ID to check (optional, returns service status if not provided)"
|
|
20
|
+
},
|
|
21
|
+
includeMetrics: {
|
|
22
|
+
type: "boolean",
|
|
23
|
+
description: "Include execution metrics and statistics",
|
|
24
|
+
default: false
|
|
25
|
+
},
|
|
26
|
+
includeConfig: {
|
|
27
|
+
type: "boolean",
|
|
28
|
+
description: "Include service configuration details",
|
|
29
|
+
default: false
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
function createWorkflowStatusHandler() {
|
|
35
|
+
return async (params) => {
|
|
36
|
+
const startTime = Date.now();
|
|
37
|
+
const { workflowId, includeMetrics = false, includeConfig = false } = params || {};
|
|
38
|
+
try {
|
|
39
|
+
const service = getWorkflowService();
|
|
40
|
+
const serviceStatus = service.getStatus();
|
|
41
|
+
const response = {
|
|
42
|
+
found: false,
|
|
43
|
+
service: {
|
|
44
|
+
isRunning: serviceStatus.isRunning,
|
|
45
|
+
activeWorkflowCount: serviceStatus.activeWorkflows.length,
|
|
46
|
+
watchedPaths: serviceStatus.watchedPaths,
|
|
47
|
+
lastActivity: serviceStatus.lastActivity
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
if (workflowId && typeof workflowId === "string") {
|
|
51
|
+
const workflow = service.getWorkflow(workflowId);
|
|
52
|
+
if (workflow) {
|
|
53
|
+
response.found = true;
|
|
54
|
+
response.workflow = workflow;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
if (includeMetrics) {
|
|
58
|
+
const stats = serviceStatus.stats;
|
|
59
|
+
response.stats = {
|
|
60
|
+
totalExecutions: stats.totalExecutions,
|
|
61
|
+
successfulExecutions: stats.successfulExecutions,
|
|
62
|
+
failedExecutions: stats.failedExecutions,
|
|
63
|
+
averageDuration: stats.averageDuration,
|
|
64
|
+
successRate: stats.totalExecutions > 0 ? stats.successfulExecutions / stats.totalExecutions * 100 : 0
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
if (includeConfig) {
|
|
68
|
+
const config = service.getConfig();
|
|
69
|
+
response.config = {
|
|
70
|
+
inactivityTimeout: config.inactivityTimeout || 3e5,
|
|
71
|
+
autoStartThreshold: config.autoStartThreshold || 0.7,
|
|
72
|
+
watchPaths: config.watchPaths || [],
|
|
73
|
+
debug: config.debug || false
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
return {
|
|
77
|
+
success: true,
|
|
78
|
+
data: response,
|
|
79
|
+
metadata: {
|
|
80
|
+
executionTime: Date.now() - startTime,
|
|
81
|
+
requestedWorkflowId: workflowId || null
|
|
82
|
+
}
|
|
83
|
+
};
|
|
84
|
+
} catch (error) {
|
|
85
|
+
return {
|
|
86
|
+
success: false,
|
|
87
|
+
error: error instanceof Error ? error.message : String(error),
|
|
88
|
+
metadata: { executionTime: Date.now() - startTime }
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
export {
|
|
94
|
+
createWorkflowStatusHandler,
|
|
95
|
+
workflowStatusTool
|
|
96
|
+
};
|
|
97
|
+
//# sourceMappingURL=status.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"status.js","sources":["../../../../src/mcp-server/tools/workflow/status.ts"],"sourcesContent":["/**\n * Workflow Status Tool\n *\n * MCP tool for checking the status of a specific workflow\n * or the overall workflow service status.\n *\n * @module mcp-server/tools/workflow/status\n */\n\nimport type { Tool } from '@modelcontextprotocol/sdk/types.js';\nimport type { ToolHandler, ToolResult } from '../../types/index.js';\nimport {\n createWorkflowService,\n type WorkflowService,\n type WorkflowRunMetadata,\n} from '../../../workflow/index.js';\n\n/** Singleton workflow service instance */\nlet workflowServiceInstance: WorkflowService | undefined;\n\n/**\n * Get or create the workflow service instance\n *\n * @returns WorkflowService instance\n */\nfunction getWorkflowService(): WorkflowService {\n if (!workflowServiceInstance) {\n workflowServiceInstance = createWorkflowService();\n }\n return workflowServiceInstance;\n}\n\n/**\n * Workflow status tool definition\n *\n * Defines the MCP tool interface for checking workflow status.\n * Can query specific workflow by ID or get service-wide status.\n */\nexport const workflowStatusTool: Tool = {\n name: 'kg_workflow_status',\n description: 'Check the status of a workflow or the workflow service',\n inputSchema: {\n type: 'object' as const,\n properties: {\n workflowId: {\n type: 'string',\n description: 'Specific workflow ID to check (optional, returns service status if not provided)',\n },\n includeMetrics: {\n type: 'boolean',\n description: 'Include execution metrics and statistics',\n default: false,\n },\n includeConfig: {\n type: 'boolean',\n description: 'Include service configuration details',\n default: false,\n },\n },\n },\n};\n\n/**\n * Workflow status response structure\n */\ninterface WorkflowStatusResponse {\n /** Whether a specific workflow was found */\n found: boolean;\n /** Workflow metadata if found */\n workflow?: WorkflowRunMetadata;\n /** Service-level status */\n service: {\n isRunning: boolean;\n activeWorkflowCount: number;\n watchedPaths: string[];\n lastActivity?: Date;\n };\n /** Execution statistics (if requested) */\n stats?: {\n totalExecutions: number;\n successfulExecutions: number;\n failedExecutions: number;\n averageDuration: number;\n successRate: number;\n };\n /** Service configuration (if requested) */\n config?: {\n inactivityTimeout: number;\n autoStartThreshold: number;\n watchPaths: string[];\n debug: boolean;\n };\n}\n\n/**\n * Create handler for workflow status tool\n *\n * Creates an async handler that returns the status of a specific\n * workflow or the overall workflow service.\n *\n * @returns ToolHandler function for checking workflow status\n *\n * @example\n * ```typescript\n * const handler = createWorkflowStatusHandler();\n *\n * // Check specific workflow\n * const result = await handler({ workflowId: 'collab-123-abc' });\n *\n * // Check service status with metrics\n * const serviceStatus = await handler({ includeMetrics: true });\n * ```\n */\nexport function createWorkflowStatusHandler(): ToolHandler {\n return async (params): Promise<ToolResult> => {\n const startTime = Date.now();\n const { workflowId, includeMetrics = false, includeConfig = false } = params || {};\n\n try {\n const service = getWorkflowService();\n const serviceStatus = service.getStatus();\n\n const response: WorkflowStatusResponse = {\n found: false,\n service: {\n isRunning: serviceStatus.isRunning,\n activeWorkflowCount: serviceStatus.activeWorkflows.length,\n watchedPaths: serviceStatus.watchedPaths,\n lastActivity: serviceStatus.lastActivity,\n },\n };\n\n // Check specific workflow if ID provided\n if (workflowId && typeof workflowId === 'string') {\n const workflow = service.getWorkflow(workflowId);\n if (workflow) {\n response.found = true;\n response.workflow = workflow;\n }\n }\n\n // Include execution statistics if requested\n if (includeMetrics) {\n const stats = serviceStatus.stats;\n response.stats = {\n totalExecutions: stats.totalExecutions,\n successfulExecutions: stats.successfulExecutions,\n failedExecutions: stats.failedExecutions,\n averageDuration: stats.averageDuration,\n successRate: stats.totalExecutions > 0\n ? (stats.successfulExecutions / stats.totalExecutions) * 100\n : 0,\n };\n }\n\n // Include configuration if requested\n if (includeConfig) {\n const config = service.getConfig();\n response.config = {\n inactivityTimeout: config.inactivityTimeout || 300000,\n autoStartThreshold: config.autoStartThreshold || 0.7,\n watchPaths: config.watchPaths || [],\n debug: config.debug || false,\n };\n }\n\n return {\n success: true,\n data: response,\n metadata: {\n executionTime: Date.now() - startTime,\n requestedWorkflowId: workflowId || null,\n },\n };\n } catch (error) {\n return {\n success: false,\n error: error instanceof Error ? error.message : String(error),\n metadata: { executionTime: Date.now() - startTime },\n };\n }\n };\n}\n"],"names":[],"mappings":";;;AAkBA,IAAI;AAOJ,SAAS,qBAAsC;AAC7C,MAAI,CAA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;AAAA,QAAA;AAAA,MAER;AAGA,UAAI,eAAe;AACjB,cAAM,SAAS,QAAQ,UAAA;AACvB,iBAAS,SAAS;AAAA,UAChB,mBAAmB,OAAO,qBAAqB;AAAA,UAC/C,oBAAoB,OAAO,sBAAsB;AAAA,UACjD,YAAY,OAAO,cAAc,CAAA;AAAA,UACjC,OAAO,OAAO,SAAS;AAAA,QAAA;AAAA,MAE3B;AAEA,aAAO;AAAA,QACL,SAAS;AAAA,QACT,MAAM;AAAA,QACN,UAAU;AAAA,UACR,eAAe,KAAK,IAAA,IAAQ;AAAA,UAC5B,qBAAqB,cAAc;AAAA,QAAA;AAAA,MACrC;AAAA,IAEJ,SAAS,OAAO;AACd,aAAO;AAAA,QACL,SAAS;AAAA,QACT,OAAO,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK;AAAA,QAC5D,UAAU,EAAE,eAAe,KAAK,IAAA,IAAQ,UAAA;AAAA,MAAU;AAAA,IAEtD;AAAA,EACF;AACF;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { __exports as compile } from "../../../../_virtual/
|
|
1
|
+
import { __exports as compile } from "../../../../_virtual/index10.js";
|
|
2
2
|
import { __require as requireCodegen } from "./codegen/index.js";
|
|
3
3
|
import { __require as requireValidation_error } from "../runtime/validation_error.js";
|
|
4
4
|
import { __require as requireNames } from "./names.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { __exports as applicator } from "../../../../../_virtual/
|
|
1
|
+
import { __exports as applicator } from "../../../../../_virtual/index8.js";
|
|
2
2
|
import { __require as requireAdditionalItems } from "./additionalItems.js";
|
|
3
3
|
import { __require as requirePrefixItems } from "./prefixItems.js";
|
|
4
4
|
import { __require as requireItems } from "./items.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { __exports as core } from "../../../../../_virtual/
|
|
1
|
+
import { __exports as core } from "../../../../../_virtual/index6.js";
|
|
2
2
|
import { __require as requireId } from "./id.js";
|
|
3
3
|
import { __require as requireRef } from "./ref.js";
|
|
4
4
|
var hasRequiredCore;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { __exports as validation } from "../../../../../_virtual/
|
|
1
|
+
import { __exports as validation } from "../../../../../_virtual/index7.js";
|
|
2
2
|
import { __require as requireLimitNumber } from "./limitNumber.js";
|
|
3
3
|
import { __require as requireMultipleOf } from "./multipleOf.js";
|
|
4
4
|
import { __require as requireLimitLength } from "./limitLength.js";
|