@siglo/query 0.0.0-stage → 1.3.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/LICENSE +21 -0
- package/README.md +64 -2
- package/dist/cursor.d.ts +16 -0
- package/dist/cursor.d.ts.map +1 -0
- package/dist/cursor.js +52 -0
- package/dist/cursor.js.map +1 -0
- package/dist/engine.d.ts +27 -0
- package/dist/engine.d.ts.map +1 -0
- package/dist/engine.js +225 -0
- package/dist/engine.js.map +1 -0
- package/dist/graphql/backing.d.ts +4 -0
- package/dist/graphql/backing.d.ts.map +1 -0
- package/dist/graphql/backing.js +6 -0
- package/dist/graphql/backing.js.map +1 -0
- package/dist/graphql/projection.d.ts +15 -0
- package/dist/graphql/projection.d.ts.map +1 -0
- package/dist/graphql/projection.js +69 -0
- package/dist/graphql/projection.js.map +1 -0
- package/dist/graphql/resolvers.d.ts +89 -0
- package/dist/graphql/resolvers.d.ts.map +1 -0
- package/dist/graphql/resolvers.js +190 -0
- package/dist/graphql/resolvers.js.map +1 -0
- package/dist/graphql/scalars.d.ts +5 -0
- package/dist/graphql/scalars.d.ts.map +1 -0
- package/dist/graphql/scalars.js +91 -0
- package/dist/graphql/scalars.js.map +1 -0
- package/dist/graphql/schema.d.ts +6 -0
- package/dist/graphql/schema.d.ts.map +1 -0
- package/dist/graphql/schema.js +254 -0
- package/dist/graphql/schema.js.map +1 -0
- package/dist/graphql/subscriptions.d.ts +44 -0
- package/dist/graphql/subscriptions.d.ts.map +1 -0
- package/dist/graphql/subscriptions.js +271 -0
- package/dist/graphql/subscriptions.js.map +1 -0
- package/dist/graphql/transport.d.ts +40 -0
- package/dist/graphql/transport.d.ts.map +1 -0
- package/dist/graphql/transport.js +234 -0
- package/dist/graphql/transport.js.map +1 -0
- package/dist/index.d.ts +13 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +29 -0
- package/dist/index.js.map +1 -0
- package/dist/integrations/express.d.ts +30 -0
- package/dist/integrations/express.d.ts.map +1 -0
- package/dist/integrations/express.js +157 -0
- package/dist/integrations/express.js.map +1 -0
- package/dist/integrations/fastify.d.ts +33 -0
- package/dist/integrations/fastify.d.ts.map +1 -0
- package/dist/integrations/fastify.js +116 -0
- package/dist/integrations/fastify.js.map +1 -0
- package/dist/integrations/hono.d.ts +27 -0
- package/dist/integrations/hono.d.ts.map +1 -0
- package/dist/integrations/hono.js +131 -0
- package/dist/integrations/hono.js.map +1 -0
- package/dist/integrations/index.d.ts +4 -0
- package/dist/integrations/index.d.ts.map +1 -0
- package/dist/integrations/index.js +20 -0
- package/dist/integrations/index.js.map +1 -0
- package/dist/mcp/index.d.ts +5 -0
- package/dist/mcp/index.d.ts.map +1 -0
- package/dist/mcp/index.js +21 -0
- package/dist/mcp/index.js.map +1 -0
- package/dist/mcp/prompts.d.ts +25 -0
- package/dist/mcp/prompts.d.ts.map +1 -0
- package/dist/mcp/prompts.js +102 -0
- package/dist/mcp/prompts.js.map +1 -0
- package/dist/mcp/resources.d.ts +25 -0
- package/dist/mcp/resources.d.ts.map +1 -0
- package/dist/mcp/resources.js +111 -0
- package/dist/mcp/resources.js.map +1 -0
- package/dist/mcp/server.d.ts +108 -0
- package/dist/mcp/server.d.ts.map +1 -0
- package/dist/mcp/server.js +238 -0
- package/dist/mcp/server.js.map +1 -0
- package/dist/mcp/tools.d.ts +212 -0
- package/dist/mcp/tools.d.ts.map +1 -0
- package/dist/mcp/tools.js +318 -0
- package/dist/mcp/tools.js.map +1 -0
- package/dist/memory.d.ts +33 -0
- package/dist/memory.d.ts.map +1 -0
- package/dist/memory.js +78 -0
- package/dist/memory.js.map +1 -0
- package/dist/types.d.ts +112 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +3 -0
- package/dist/types.js.map +1 -0
- package/package.json +89 -4
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../src/mcp/server.ts"],"names":[],"mappings":"AAAA,OAAO,EAA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ty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.WorkflowMcpServer = void 0;
|
|
4
|
+
exports.createWorkflowMcpServer = createWorkflowMcpServer;
|
|
5
|
+
const node_http_1 = require("node:http");
|
|
6
|
+
const core_1 = require("@siglo/core");
|
|
7
|
+
const index_js_1 = require("@modelcontextprotocol/sdk/server/index.js");
|
|
8
|
+
const sse_js_1 = require("@modelcontextprotocol/sdk/server/sse.js");
|
|
9
|
+
const stdio_js_1 = require("@modelcontextprotocol/sdk/server/stdio.js");
|
|
10
|
+
const types_js_1 = require("@modelcontextprotocol/sdk/types.js");
|
|
11
|
+
const engine_1 = require("../engine");
|
|
12
|
+
const schema_1 = require("../graphql/schema");
|
|
13
|
+
const prompts_1 = require("./prompts");
|
|
14
|
+
const resources_1 = require("./resources");
|
|
15
|
+
const tools_1 = require("./tools");
|
|
16
|
+
function buildProtocolServer(engine, schema, scope, info) {
|
|
17
|
+
const server = new index_js_1.Server(info, {
|
|
18
|
+
capabilities: {
|
|
19
|
+
tools: {},
|
|
20
|
+
resources: {},
|
|
21
|
+
prompts: {},
|
|
22
|
+
},
|
|
23
|
+
});
|
|
24
|
+
server.setRequestHandler(types_js_1.ListToolsRequestSchema, async () => ({
|
|
25
|
+
tools: tools_1.WORKFLOW_MCP_TOOLS,
|
|
26
|
+
}));
|
|
27
|
+
server.setRequestHandler(types_js_1.CallToolRequestSchema, async (request) => {
|
|
28
|
+
const toolArgs = (0, core_1.isPlainObject)(request.params.arguments) ? request.params.arguments : undefined;
|
|
29
|
+
return (0, tools_1.executeMcpTool)(request.params.name, toolArgs, {
|
|
30
|
+
engine,
|
|
31
|
+
schema,
|
|
32
|
+
namespace: scope.namespace,
|
|
33
|
+
defaultNamespace: scope.defaultNamespace,
|
|
34
|
+
});
|
|
35
|
+
});
|
|
36
|
+
server.setRequestHandler(types_js_1.ListResourcesRequestSchema, async () => ({
|
|
37
|
+
resources: resources_1.WORKFLOW_MCP_RESOURCES,
|
|
38
|
+
}));
|
|
39
|
+
server.setRequestHandler(types_js_1.ListResourceTemplatesRequestSchema, async () => ({
|
|
40
|
+
resourceTemplates: resources_1.WORKFLOW_MCP_RESOURCE_TEMPLATES,
|
|
41
|
+
}));
|
|
42
|
+
server.setRequestHandler(types_js_1.ReadResourceRequestSchema, async (request) => {
|
|
43
|
+
return (0, resources_1.readMcpResource)(request.params.uri, {
|
|
44
|
+
engine,
|
|
45
|
+
namespace: scope.namespace,
|
|
46
|
+
defaultNamespace: scope.defaultNamespace,
|
|
47
|
+
});
|
|
48
|
+
});
|
|
49
|
+
server.setRequestHandler(types_js_1.ListPromptsRequestSchema, async () => ({
|
|
50
|
+
prompts: prompts_1.WORKFLOW_MCP_PROMPTS,
|
|
51
|
+
}));
|
|
52
|
+
server.setRequestHandler(types_js_1.GetPromptRequestSchema, async (request) => {
|
|
53
|
+
const promptArgs = (0, core_1.isPlainObject)(request.params.arguments)
|
|
54
|
+
? Object.fromEntries(Object.entries(request.params.arguments).filter((entry) => typeof entry[1] === 'string'))
|
|
55
|
+
: undefined;
|
|
56
|
+
return (0, prompts_1.getMcpPrompt)(request.params.name, promptArgs, {
|
|
57
|
+
engine,
|
|
58
|
+
namespace: scope.namespace,
|
|
59
|
+
defaultNamespace: scope.defaultNamespace,
|
|
60
|
+
});
|
|
61
|
+
});
|
|
62
|
+
return server;
|
|
63
|
+
}
|
|
64
|
+
class WorkflowMcpServer {
|
|
65
|
+
engine;
|
|
66
|
+
schema;
|
|
67
|
+
server;
|
|
68
|
+
options;
|
|
69
|
+
info;
|
|
70
|
+
scope;
|
|
71
|
+
sseSessions = new Map();
|
|
72
|
+
httpServer;
|
|
73
|
+
ownsHttpServer = false;
|
|
74
|
+
requestListener;
|
|
75
|
+
constructor(options) {
|
|
76
|
+
if (!options.engine && !options.storage) {
|
|
77
|
+
throw new Error('WorkflowMcpServer requires either an engine or a storage adapter');
|
|
78
|
+
}
|
|
79
|
+
this.options = options;
|
|
80
|
+
this.engine =
|
|
81
|
+
options.engine ??
|
|
82
|
+
(0, engine_1.createWorkflowQueryEngine)({
|
|
83
|
+
storage: options.storage,
|
|
84
|
+
redactFields: options.redactFields,
|
|
85
|
+
resolveWorkflow: options.resolveWorkflow,
|
|
86
|
+
emitter: options.emitter,
|
|
87
|
+
subscriptionManager: options.subscriptionManager,
|
|
88
|
+
});
|
|
89
|
+
this.schema = options.schema ?? (0, schema_1.createWorkflowGraphQLSchema)(this.engine);
|
|
90
|
+
this.info = {
|
|
91
|
+
name: options.name ?? '@siglo/query-mcp',
|
|
92
|
+
version: options.version ?? '1.2.8',
|
|
93
|
+
};
|
|
94
|
+
this.scope = {
|
|
95
|
+
namespace: options.namespace,
|
|
96
|
+
defaultNamespace: options.defaultNamespace,
|
|
97
|
+
};
|
|
98
|
+
this.server = buildProtocolServer(this.engine, this.schema, this.scope, this.info);
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Connects the MCP server to an explicit MCP Transport instance
|
|
102
|
+
* (e.g. `InMemoryTransport`, `StdioServerTransport`, or `SSEServerTransport`).
|
|
103
|
+
*/
|
|
104
|
+
async connect(transport) {
|
|
105
|
+
await this.server.connect(transport);
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* Starts the MCP server using the configured transport (`'stdio'` or `'sse'`).
|
|
109
|
+
*/
|
|
110
|
+
async start() {
|
|
111
|
+
const mode = this.options.transport ?? 'stdio';
|
|
112
|
+
if (mode === 'stdio') {
|
|
113
|
+
const stdioTransport = new stdio_js_1.StdioServerTransport(this.options.stdin, this.options.stdout);
|
|
114
|
+
await this.server.connect(stdioTransport);
|
|
115
|
+
return;
|
|
116
|
+
}
|
|
117
|
+
if (mode === 'sse') {
|
|
118
|
+
const sseConfig = this.options.sse ?? {};
|
|
119
|
+
const ssePath = sseConfig.ssePath ?? '/sse';
|
|
120
|
+
const messagePath = sseConfig.messagePath ?? '/messages';
|
|
121
|
+
this.requestListener = (req, res) => {
|
|
122
|
+
const reqUrl = new URL(req.url ?? '/', `http://${req.headers.host ?? 'localhost'}`);
|
|
123
|
+
if (req.method === 'GET' && reqUrl.pathname === ssePath) {
|
|
124
|
+
void this.handleSseConnect(req, res, messagePath);
|
|
125
|
+
return;
|
|
126
|
+
}
|
|
127
|
+
if (req.method === 'POST' && reqUrl.pathname === messagePath) {
|
|
128
|
+
void this.handleSseMessage(req, res);
|
|
129
|
+
return;
|
|
130
|
+
}
|
|
131
|
+
if (!sseConfig.httpServer) {
|
|
132
|
+
res.statusCode = 404;
|
|
133
|
+
res.setHeader('Content-Type', 'application/json; charset=utf-8');
|
|
134
|
+
res.end(JSON.stringify({ error: 'Not Found' }));
|
|
135
|
+
}
|
|
136
|
+
};
|
|
137
|
+
if (sseConfig.httpServer) {
|
|
138
|
+
this.httpServer = sseConfig.httpServer;
|
|
139
|
+
this.ownsHttpServer = false;
|
|
140
|
+
this.httpServer.on('request', this.requestListener);
|
|
141
|
+
return;
|
|
142
|
+
}
|
|
143
|
+
const port = sseConfig.port ?? 0;
|
|
144
|
+
const host = sseConfig.host ?? '127.0.0.1';
|
|
145
|
+
this.httpServer = (0, node_http_1.createServer)(this.requestListener);
|
|
146
|
+
this.ownsHttpServer = true;
|
|
147
|
+
await new Promise((resolve, reject) => {
|
|
148
|
+
this.httpServer.once('error', reject);
|
|
149
|
+
this.httpServer.listen(port, host, () => {
|
|
150
|
+
this.httpServer.removeListener('error', reject);
|
|
151
|
+
resolve();
|
|
152
|
+
});
|
|
153
|
+
});
|
|
154
|
+
return;
|
|
155
|
+
}
|
|
156
|
+
throw new Error(`Unsupported MCP transport: '${String(mode)}'`);
|
|
157
|
+
}
|
|
158
|
+
/**
|
|
159
|
+
* Handles an incoming HTTP GET request to establish an MCP SSE session.
|
|
160
|
+
*/
|
|
161
|
+
async handleSseConnect(_req, res, messagePath = this.options.sse?.messagePath ?? '/messages') {
|
|
162
|
+
const transport = new sse_js_1.SSEServerTransport(messagePath, res);
|
|
163
|
+
const sessionServer = buildProtocolServer(this.engine, this.schema, this.scope, this.info);
|
|
164
|
+
const sessionId = transport.sessionId;
|
|
165
|
+
this.sseSessions.set(sessionId, { transport, server: sessionServer });
|
|
166
|
+
const cleanup = () => {
|
|
167
|
+
this.sseSessions.delete(sessionId);
|
|
168
|
+
};
|
|
169
|
+
res.on('close', cleanup);
|
|
170
|
+
transport.onclose = cleanup;
|
|
171
|
+
await sessionServer.connect(transport);
|
|
172
|
+
return transport;
|
|
173
|
+
}
|
|
174
|
+
/**
|
|
175
|
+
* Handles an incoming HTTP POST message for an active MCP SSE session.
|
|
176
|
+
*/
|
|
177
|
+
async handleSseMessage(req, res, parsedBody) {
|
|
178
|
+
const reqUrl = new URL(req.url ?? '/', `http://${req.headers.host ?? 'localhost'}`);
|
|
179
|
+
const requestedSessionId = reqUrl.searchParams.get('sessionId');
|
|
180
|
+
let session = requestedSessionId ? this.sseSessions.get(requestedSessionId) : undefined;
|
|
181
|
+
if (!session && !requestedSessionId && this.sseSessions.size === 1) {
|
|
182
|
+
session = this.sseSessions.values().next().value;
|
|
183
|
+
}
|
|
184
|
+
if (!session) {
|
|
185
|
+
res.statusCode = 404;
|
|
186
|
+
res.setHeader('Content-Type', 'application/json; charset=utf-8');
|
|
187
|
+
res.end(JSON.stringify({ error: 'MCP SSE session not found' }));
|
|
188
|
+
return;
|
|
189
|
+
}
|
|
190
|
+
await session.transport.handlePostMessage(req, res, parsedBody);
|
|
191
|
+
}
|
|
192
|
+
/**
|
|
193
|
+
* Returns the bound HTTP SSE URL when started in standalone `'sse'` mode.
|
|
194
|
+
*/
|
|
195
|
+
getSseUrl() {
|
|
196
|
+
if (!this.httpServer)
|
|
197
|
+
return undefined;
|
|
198
|
+
const addr = this.httpServer.address();
|
|
199
|
+
if (!addr || typeof addr === 'string')
|
|
200
|
+
return undefined;
|
|
201
|
+
const host = addr.address === '::' || addr.address === '0.0.0.0' ? '127.0.0.1' : addr.address;
|
|
202
|
+
const ssePath = this.options.sse?.ssePath ?? '/sse';
|
|
203
|
+
return `http://${host}:${addr.port}${ssePath}`;
|
|
204
|
+
}
|
|
205
|
+
/**
|
|
206
|
+
* Stops the MCP server, closes active transports, and releases resources.
|
|
207
|
+
*/
|
|
208
|
+
async close() {
|
|
209
|
+
for (const [id, session] of this.sseSessions.entries()) {
|
|
210
|
+
this.sseSessions.delete(id);
|
|
211
|
+
try {
|
|
212
|
+
await session.server.close();
|
|
213
|
+
}
|
|
214
|
+
catch {
|
|
215
|
+
// ignore close errors
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
if (this.httpServer && this.requestListener && !this.ownsHttpServer) {
|
|
219
|
+
this.httpServer.removeListener('request', this.requestListener);
|
|
220
|
+
}
|
|
221
|
+
if (this.httpServer && this.ownsHttpServer) {
|
|
222
|
+
const srv = this.httpServer;
|
|
223
|
+
this.httpServer = undefined;
|
|
224
|
+
await new Promise(resolve => {
|
|
225
|
+
srv.close(() => resolve());
|
|
226
|
+
});
|
|
227
|
+
}
|
|
228
|
+
await this.server.close();
|
|
229
|
+
}
|
|
230
|
+
async stop() {
|
|
231
|
+
await this.close();
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
exports.WorkflowMcpServer = WorkflowMcpServer;
|
|
235
|
+
function createWorkflowMcpServer(options) {
|
|
236
|
+
return new WorkflowMcpServer(options);
|
|
237
|
+
}
|
|
238
|
+
//# sourceMappingURL=server.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"server.js","sourceRoot":"","sources":["../../src/mcp/server.ts"],"names":[],"mappings":";;;AA+VA,0DAEC;AAjWD,yCAA+G;AAC/G,sCAA4C;AAG5C,wEAAmE;AACnE,oEAA6E;AAC7E,wEAAiF;AAEjF,iEAQ4C;AAE5C,sCAAgF;AAChF,8CAAgE;AAEhE,uCAA+D;AAC/D,2CAAuG;AACvG,mCAAyF;AA8DzF,SAAS,mBAAmB,CACxB,MAA2B,EAC3B,MAAqB,EACrB,KAA4B,EAC5B,IAAuC;IAEvC,MAAM,MAAM,GAAG,IAAI,iBAAM,CAA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AAI,IAAI,CAAC,eAAe,IAAI,CAAC,IAAI,CAAC,cAAc,EAAE,CAAC;YAClE,IAAI,CAAC,UAAU,CAAC,cAAc,CAAC,SAAS,EAAE,IAAI,CAAC,eAAe,CAAC,CAAC;QACpE,CAAC;QAED,IAAI,IAAI,CAAC,UAAU,IAAI,IAAI,CAAC,cAAc,EAAE,CAAC;YACzC,MAAM,GAAG,GAAG,IAAI,CAAC,UAAU,CAAC;YAC5B,IAAI,CAAC,UAAU,GAAG,SAAS,CAAC;YAC5B,MAAM,IAAI,OAAO,CAAO,OAAO,CAAC,EAAE;gBAC9B,GAAG,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,OAAO,EAAE,CAAC,CAAC;YAC/B,CAAC,CAAC,CAAC;QACP,CAAC;QAED,MAAM,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC;IAC9B,CAAC;IAED,KAAK,CAAC,IAAI;QACN,MAAM,IAAI,CAAC,KAAK,EAAE,CAAC;IACvB,CAAC;CACJ;AAtMD,8CAsMC;AAED,SAAgB,uBAAuB,CAAC,OAAiC;IACrE,OAAO,IAAI,iBAAiB,CAAC,OAAO,CAAC,CAAC;AAC1C,CAAC"}
|
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
import { type GraphQLSchema } from 'graphql';
|
|
2
|
+
import type { WorkflowQueryEngine } from '../engine';
|
|
3
|
+
import type { WorkflowExecution } from '../types';
|
|
4
|
+
export interface McpTenantScopeOptions {
|
|
5
|
+
/**
|
|
6
|
+
* Bound tenant namespace. When configured, requests are locked to this tenant
|
|
7
|
+
* and conflicting `namespace` arguments are rejected.
|
|
8
|
+
*/
|
|
9
|
+
namespace?: string;
|
|
10
|
+
/**
|
|
11
|
+
* Default namespace used when `namespace` is not locked and the caller omits `namespace`.
|
|
12
|
+
* Defaults to `'default'`.
|
|
13
|
+
*/
|
|
14
|
+
defaultNamespace?: string;
|
|
15
|
+
}
|
|
16
|
+
export declare function resolveMcpNamespace(requested?: string, options?: McpTenantScopeOptions): string;
|
|
17
|
+
export declare function formatWorkflowSummary(item: WorkflowExecution): {
|
|
18
|
+
waitRecord?: {
|
|
19
|
+
correlationKey: string;
|
|
20
|
+
eventName: string | null;
|
|
21
|
+
expiresAt: string | null;
|
|
22
|
+
lockedBy: string | null;
|
|
23
|
+
status: string | null;
|
|
24
|
+
} | undefined;
|
|
25
|
+
metadata?: Record<string, unknown> | undefined;
|
|
26
|
+
expiresAt?: string | undefined;
|
|
27
|
+
stackId: string;
|
|
28
|
+
workflowId: string | null;
|
|
29
|
+
namespace: string;
|
|
30
|
+
status: string;
|
|
31
|
+
revision: number;
|
|
32
|
+
createdAt: string;
|
|
33
|
+
updatedAt: string;
|
|
34
|
+
};
|
|
35
|
+
export declare function formatWorkflowDetail(item: WorkflowExecution, includeSteps?: boolean): {
|
|
36
|
+
compensations: import("../types").CompensationRecord[];
|
|
37
|
+
steps?: import("../types").StepExecution[] | undefined;
|
|
38
|
+
error?: object | undefined;
|
|
39
|
+
context: {} | null;
|
|
40
|
+
waitRecord?: {
|
|
41
|
+
correlationKey: string;
|
|
42
|
+
eventName: string | null;
|
|
43
|
+
expiresAt: string | null;
|
|
44
|
+
lockedBy: string | null;
|
|
45
|
+
status: string | null;
|
|
46
|
+
} | undefined;
|
|
47
|
+
metadata?: Record<string, unknown> | undefined;
|
|
48
|
+
expiresAt?: string | undefined;
|
|
49
|
+
stackId: string;
|
|
50
|
+
workflowId: string | null;
|
|
51
|
+
namespace: string;
|
|
52
|
+
status: string;
|
|
53
|
+
revision: number;
|
|
54
|
+
createdAt: string;
|
|
55
|
+
updatedAt: string;
|
|
56
|
+
};
|
|
57
|
+
export declare const WORKFLOW_MCP_TOOLS: ({
|
|
58
|
+
name: string;
|
|
59
|
+
description: string;
|
|
60
|
+
inputSchema: {
|
|
61
|
+
type: "object";
|
|
62
|
+
properties: {
|
|
63
|
+
workflowId: {
|
|
64
|
+
type: string;
|
|
65
|
+
description: string;
|
|
66
|
+
};
|
|
67
|
+
status: {
|
|
68
|
+
type: string;
|
|
69
|
+
enum: string[];
|
|
70
|
+
};
|
|
71
|
+
namespace: {
|
|
72
|
+
type: string;
|
|
73
|
+
description: string;
|
|
74
|
+
};
|
|
75
|
+
createdAfter: {
|
|
76
|
+
type: string;
|
|
77
|
+
description: string;
|
|
78
|
+
};
|
|
79
|
+
createdBefore: {
|
|
80
|
+
type: string;
|
|
81
|
+
description: string;
|
|
82
|
+
};
|
|
83
|
+
metadataFilter: {
|
|
84
|
+
type: string;
|
|
85
|
+
description: string;
|
|
86
|
+
};
|
|
87
|
+
limit: {
|
|
88
|
+
type: string;
|
|
89
|
+
default: number;
|
|
90
|
+
};
|
|
91
|
+
stackId?: undefined;
|
|
92
|
+
contextPath?: undefined;
|
|
93
|
+
includeSteps?: undefined;
|
|
94
|
+
query?: undefined;
|
|
95
|
+
variables?: undefined;
|
|
96
|
+
correlationKey?: undefined;
|
|
97
|
+
payload?: undefined;
|
|
98
|
+
};
|
|
99
|
+
required?: undefined;
|
|
100
|
+
};
|
|
101
|
+
} | {
|
|
102
|
+
name: string;
|
|
103
|
+
description: string;
|
|
104
|
+
inputSchema: {
|
|
105
|
+
type: "object";
|
|
106
|
+
properties: {
|
|
107
|
+
stackId: {
|
|
108
|
+
type: string;
|
|
109
|
+
description: string;
|
|
110
|
+
};
|
|
111
|
+
namespace: {
|
|
112
|
+
type: string;
|
|
113
|
+
description: string;
|
|
114
|
+
};
|
|
115
|
+
contextPath: {
|
|
116
|
+
type: string;
|
|
117
|
+
description: string;
|
|
118
|
+
};
|
|
119
|
+
includeSteps: {
|
|
120
|
+
type: string;
|
|
121
|
+
default: boolean;
|
|
122
|
+
};
|
|
123
|
+
workflowId?: undefined;
|
|
124
|
+
status?: undefined;
|
|
125
|
+
createdAfter?: undefined;
|
|
126
|
+
createdBefore?: undefined;
|
|
127
|
+
metadataFilter?: undefined;
|
|
128
|
+
limit?: undefined;
|
|
129
|
+
query?: undefined;
|
|
130
|
+
variables?: undefined;
|
|
131
|
+
correlationKey?: undefined;
|
|
132
|
+
payload?: undefined;
|
|
133
|
+
};
|
|
134
|
+
required: string[];
|
|
135
|
+
};
|
|
136
|
+
} | {
|
|
137
|
+
name: string;
|
|
138
|
+
description: string;
|
|
139
|
+
inputSchema: {
|
|
140
|
+
type: "object";
|
|
141
|
+
properties: {
|
|
142
|
+
query: {
|
|
143
|
+
type: string;
|
|
144
|
+
description: string;
|
|
145
|
+
};
|
|
146
|
+
variables: {
|
|
147
|
+
type: string;
|
|
148
|
+
description: string;
|
|
149
|
+
};
|
|
150
|
+
namespace: {
|
|
151
|
+
type: string;
|
|
152
|
+
description: string;
|
|
153
|
+
};
|
|
154
|
+
workflowId?: undefined;
|
|
155
|
+
status?: undefined;
|
|
156
|
+
createdAfter?: undefined;
|
|
157
|
+
createdBefore?: undefined;
|
|
158
|
+
metadataFilter?: undefined;
|
|
159
|
+
limit?: undefined;
|
|
160
|
+
stackId?: undefined;
|
|
161
|
+
contextPath?: undefined;
|
|
162
|
+
includeSteps?: undefined;
|
|
163
|
+
correlationKey?: undefined;
|
|
164
|
+
payload?: undefined;
|
|
165
|
+
};
|
|
166
|
+
required: string[];
|
|
167
|
+
};
|
|
168
|
+
} | {
|
|
169
|
+
name: string;
|
|
170
|
+
description: string;
|
|
171
|
+
inputSchema: {
|
|
172
|
+
type: "object";
|
|
173
|
+
properties: {
|
|
174
|
+
correlationKey: {
|
|
175
|
+
type: string;
|
|
176
|
+
description: string;
|
|
177
|
+
};
|
|
178
|
+
payload: {
|
|
179
|
+
type: string;
|
|
180
|
+
description: string;
|
|
181
|
+
};
|
|
182
|
+
namespace: {
|
|
183
|
+
type: string;
|
|
184
|
+
description: string;
|
|
185
|
+
};
|
|
186
|
+
workflowId?: undefined;
|
|
187
|
+
status?: undefined;
|
|
188
|
+
createdAfter?: undefined;
|
|
189
|
+
createdBefore?: undefined;
|
|
190
|
+
metadataFilter?: undefined;
|
|
191
|
+
limit?: undefined;
|
|
192
|
+
stackId?: undefined;
|
|
193
|
+
contextPath?: undefined;
|
|
194
|
+
includeSteps?: undefined;
|
|
195
|
+
query?: undefined;
|
|
196
|
+
variables?: undefined;
|
|
197
|
+
};
|
|
198
|
+
required: string[];
|
|
199
|
+
};
|
|
200
|
+
})[];
|
|
201
|
+
export interface McpToolExecutionContext extends McpTenantScopeOptions {
|
|
202
|
+
engine: WorkflowQueryEngine;
|
|
203
|
+
schema?: GraphQLSchema;
|
|
204
|
+
}
|
|
205
|
+
export declare function executeMcpTool(name: string, rawArgs: Record<string, unknown> | undefined, ctx: McpToolExecutionContext): Promise<{
|
|
206
|
+
content: Array<{
|
|
207
|
+
type: 'text';
|
|
208
|
+
text: string;
|
|
209
|
+
}>;
|
|
210
|
+
isError?: boolean;
|
|
211
|
+
}>;
|
|
212
|
+
//# sourceMappingURL=tools.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../../src/mcp/tools.ts"],"names":[],"mappings":"AAAA,OAAO,EAA+B,KAAK,aAAa,EAAE,MAAM,SAAS,CAAC;AAE1E,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AAErD,OAAO,KAAK,EAAE,iBAAiB,EAAkB,MAAM,UAAU,CAAC;AAElE,MAAM,WAAW,qBAAqB;IAClC;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED,wBAAgB,mBAAmB,CAAC,SAAS,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,qBAAqB,GAAG,MAAM,CAkB/F;AA4BD,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,iBAAiB;;;;;;;;;;;;;;;;;EAuB5D;AAED,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,iBAAiB,EAAE,YAAY,UAAO;;;;;;;;;;;;;;;;;;;;;EAahF;AA8BD,eAAO,MAAM,kBAAkB;;;;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