@a5c-ai/tasks-adapter 5.1.1-staging.00ceebd28cf2
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 +125 -0
- package/dist/auth/forge-interface.d.ts +67 -0
- package/dist/auth/forge-interface.d.ts.map +1 -0
- package/dist/auth/forge-interface.js +69 -0
- package/dist/auth/github-app.d.ts +64 -0
- package/dist/auth/github-app.d.ts.map +1 -0
- package/dist/auth/github-app.js +141 -0
- package/dist/auth/github-oauth.d.ts +27 -0
- package/dist/auth/github-oauth.d.ts.map +1 -0
- package/dist/auth/github-oauth.js +89 -0
- package/dist/auth/index.d.ts +8 -0
- package/dist/auth/index.d.ts.map +1 -0
- package/dist/auth/index.js +14 -0
- package/dist/auth/jwt.d.ts +24 -0
- package/dist/auth/jwt.d.ts.map +1 -0
- package/dist/auth/jwt.js +43 -0
- package/dist/auth/middleware.d.ts +22 -0
- package/dist/auth/middleware.d.ts.map +1 -0
- package/dist/auth/middleware.js +36 -0
- package/dist/auth/ssh-keys.d.ts +21 -0
- package/dist/auth/ssh-keys.d.ts.map +1 -0
- package/dist/auth/ssh-keys.js +59 -0
- package/dist/auth/types.d.ts +165 -0
- package/dist/auth/types.d.ts.map +1 -0
- package/dist/auth/types.js +53 -0
- package/dist/backend.d.ts +248 -0
- package/dist/backend.d.ts.map +1 -0
- package/dist/backend.js +40 -0
- package/dist/backends/adapters.d.ts +99 -0
- package/dist/backends/adapters.d.ts.map +1 -0
- package/dist/backends/adapters.js +308 -0
- package/dist/backends/external-tracker.d.ts +133 -0
- package/dist/backends/external-tracker.d.ts.map +1 -0
- package/dist/backends/external-tracker.js +731 -0
- package/dist/backends/git-native.d.ts +69 -0
- package/dist/backends/git-native.d.ts.map +1 -0
- package/dist/backends/git-native.js +797 -0
- package/dist/backends/github-issues.d.ts +78 -0
- package/dist/backends/github-issues.d.ts.map +1 -0
- package/dist/backends/github-issues.js +806 -0
- package/dist/backends/index.d.ts +52 -0
- package/dist/backends/index.d.ts.map +1 -0
- package/dist/backends/index.js +151 -0
- package/dist/backends/server.d.ts +42 -0
- package/dist/backends/server.d.ts.map +1 -0
- package/dist/backends/server.js +305 -0
- package/dist/cli/auth-store.d.ts +49 -0
- package/dist/cli/auth-store.d.ts.map +1 -0
- package/dist/cli/auth-store.js +150 -0
- package/dist/cli/client-config.d.ts +10 -0
- package/dist/cli/client-config.d.ts.map +1 -0
- package/dist/cli/client-config.js +87 -0
- package/dist/cli/commands/ask.d.ts +3 -0
- package/dist/cli/commands/ask.d.ts.map +1 -0
- package/dist/cli/commands/ask.js +171 -0
- package/dist/cli/commands/auth.d.ts +3 -0
- package/dist/cli/commands/auth.d.ts.map +1 -0
- package/dist/cli/commands/auth.js +510 -0
- package/dist/cli/commands/breakpoints.d.ts +3 -0
- package/dist/cli/commands/breakpoints.d.ts.map +1 -0
- package/dist/cli/commands/breakpoints.js +311 -0
- package/dist/cli/commands/responder-loop.d.ts +3 -0
- package/dist/cli/commands/responder-loop.d.ts.map +1 -0
- package/dist/cli/commands/responder-loop.js +78 -0
- package/dist/cli/commands/responders.d.ts +3 -0
- package/dist/cli/commands/responders.d.ts.map +1 -0
- package/dist/cli/commands/responders.js +157 -0
- package/dist/cli/commands/rules.d.ts +3 -0
- package/dist/cli/commands/rules.d.ts.map +1 -0
- package/dist/cli/commands/rules.js +105 -0
- package/dist/cli/commands/server.d.ts +3 -0
- package/dist/cli/commands/server.d.ts.map +1 -0
- package/dist/cli/commands/server.js +34 -0
- package/dist/cli/commands/tasks.d.ts +3 -0
- package/dist/cli/commands/tasks.d.ts.map +1 -0
- package/dist/cli/commands/tasks.js +281 -0
- package/dist/cli/commands/templates.d.ts +3 -0
- package/dist/cli/commands/templates.d.ts.map +1 -0
- package/dist/cli/commands/templates.js +100 -0
- package/dist/cli/index.d.ts +4 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +9 -0
- package/dist/cli/output.d.ts +26 -0
- package/dist/cli/output.d.ts.map +1 -0
- package/dist/cli/output.js +143 -0
- package/dist/cli/program.d.ts +6 -0
- package/dist/cli/program.d.ts.map +1 -0
- package/dist/cli/program.js +38 -0
- package/dist/cli/tasks-adapter.d.ts +3 -0
- package/dist/cli/tasks-adapter.d.ts.map +1 -0
- package/dist/cli/tasks-adapter.js +4 -0
- package/dist/client/answer-poller.d.ts +52 -0
- package/dist/client/answer-poller.d.ts.map +1 -0
- package/dist/client/answer-poller.js +200 -0
- package/dist/client/auth-client.d.ts +200 -0
- package/dist/client/auth-client.d.ts.map +1 -0
- package/dist/client/auth-client.js +309 -0
- package/dist/client/breakpoint-router.d.ts +45 -0
- package/dist/client/breakpoint-router.d.ts.map +1 -0
- package/dist/client/breakpoint-router.js +45 -0
- package/dist/client/index.d.ts +17 -0
- package/dist/client/index.d.ts.map +1 -0
- package/dist/client/index.js +16 -0
- package/dist/client/profile-validator.d.ts +34 -0
- package/dist/client/profile-validator.d.ts.map +1 -0
- package/dist/client/profile-validator.js +89 -0
- package/dist/client/responder-client.d.ts +39 -0
- package/dist/client/responder-client.d.ts.map +1 -0
- package/dist/client/responder-client.js +72 -0
- package/dist/client/responder-matcher.d.ts +49 -0
- package/dist/client/responder-matcher.d.ts.map +1 -0
- package/dist/client/responder-matcher.js +226 -0
- package/dist/client/server-client.d.ts +124 -0
- package/dist/client/server-client.d.ts.map +1 -0
- package/dist/client/server-client.js +266 -0
- package/dist/client/timeout-manager.d.ts +47 -0
- package/dist/client/timeout-manager.d.ts.map +1 -0
- package/dist/client/timeout-manager.js +77 -0
- package/dist/config.d.ts +20 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +93 -0
- package/dist/harness/index.d.ts +4 -0
- package/dist/harness/index.d.ts.map +1 -0
- package/dist/harness/index.js +2 -0
- package/dist/harness/interaction-provider.d.ts +71 -0
- package/dist/harness/interaction-provider.d.ts.map +1 -0
- package/dist/harness/interaction-provider.js +124 -0
- package/dist/harness/routing-rules.d.ts +7 -0
- package/dist/harness/routing-rules.d.ts.map +1 -0
- package/dist/harness/routing-rules.js +37 -0
- package/dist/index.d.ts +29 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +33 -0
- package/dist/mcp/backend-resolver.d.ts +43 -0
- package/dist/mcp/backend-resolver.d.ts.map +1 -0
- package/dist/mcp/backend-resolver.js +111 -0
- package/dist/mcp/http-transport.d.ts +37 -0
- package/dist/mcp/http-transport.d.ts.map +1 -0
- package/dist/mcp/http-transport.js +103 -0
- package/dist/mcp/index.d.ts +16 -0
- package/dist/mcp/index.d.ts.map +1 -0
- package/dist/mcp/index.js +12 -0
- package/dist/mcp/server.d.ts +20 -0
- package/dist/mcp/server.d.ts.map +1 -0
- package/dist/mcp/server.js +259 -0
- package/dist/mcp/tools/answer-breakpoint.d.ts +32 -0
- package/dist/mcp/tools/answer-breakpoint.d.ts.map +1 -0
- package/dist/mcp/tools/answer-breakpoint.js +45 -0
- package/dist/mcp/tools/ask-breakpoint.d.ts +58 -0
- package/dist/mcp/tools/ask-breakpoint.d.ts.map +1 -0
- package/dist/mcp/tools/ask-breakpoint.js +78 -0
- package/dist/mcp/tools/check-status.d.ts +16 -0
- package/dist/mcp/tools/check-status.d.ts.map +1 -0
- package/dist/mcp/tools/check-status.js +18 -0
- package/dist/mcp/tools/claim-breakpoint.d.ts +18 -0
- package/dist/mcp/tools/claim-breakpoint.d.ts.map +1 -0
- package/dist/mcp/tools/claim-breakpoint.js +28 -0
- package/dist/mcp/tools/list-breakpoints.d.ts +16 -0
- package/dist/mcp/tools/list-breakpoints.d.ts.map +1 -0
- package/dist/mcp/tools/list-breakpoints.js +14 -0
- package/dist/mcp/tools/list-responders.d.ts +18 -0
- package/dist/mcp/tools/list-responders.d.ts.map +1 -0
- package/dist/mcp/tools/list-responders.js +37 -0
- package/dist/mcp/tools/native-tasks.d.ts +270 -0
- package/dist/mcp/tools/native-tasks.d.ts.map +1 -0
- package/dist/mcp/tools/native-tasks.js +481 -0
- package/dist/mcp/tools/poll-breakpoints.d.ts +18 -0
- package/dist/mcp/tools/poll-breakpoints.d.ts.map +1 -0
- package/dist/mcp/tools/poll-breakpoints.js +36 -0
- package/dist/mcp/tools/verify-answer.d.ts +16 -0
- package/dist/mcp/tools/verify-answer.d.ts.map +1 -0
- package/dist/mcp/tools/verify-answer.js +38 -0
- package/dist/proven/index.d.ts +5 -0
- package/dist/proven/index.d.ts.map +1 -0
- package/dist/proven/index.js +3 -0
- package/dist/proven/keys.d.ts +33 -0
- package/dist/proven/keys.d.ts.map +1 -0
- package/dist/proven/keys.js +117 -0
- package/dist/proven/sign.d.ts +16 -0
- package/dist/proven/sign.d.ts.map +1 -0
- package/dist/proven/sign.js +60 -0
- package/dist/proven/types.d.ts +26 -0
- package/dist/proven/types.d.ts.map +1 -0
- package/dist/proven/types.js +5 -0
- package/dist/proven/verify.d.ts +6 -0
- package/dist/proven/verify.d.ts.map +1 -0
- package/dist/proven/verify.js +58 -0
- package/dist/responders/types.d.ts +38 -0
- package/dist/responders/types.d.ts.map +1 -0
- package/dist/responders/types.js +1 -0
- package/dist/router.d.ts +51 -0
- package/dist/router.d.ts.map +1 -0
- package/dist/router.js +200 -0
- package/dist/types.d.ts +7711 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +479 -0
- package/package.json +96 -0
- package/responder/README.md +42 -0
- package/responder/backend-responder.json +9 -0
- package/responder/devops-responder.json +9 -0
- package/responder/frontend-responder.json +9 -0
- package/responder/schema.json +89 -0
|
@@ -0,0 +1,259 @@
|
|
|
1
|
+
import { McpServer, ResourceTemplate } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
2
|
+
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
3
|
+
import { EmptyResultSchema, SubscribeRequestSchema, UnsubscribeRequestSchema, } from "@modelcontextprotocol/sdk/types.js";
|
|
4
|
+
import { askBreakpointDescription, askBreakpointParams, handleAskBreakpoint, } from "./tools/ask-breakpoint.js";
|
|
5
|
+
import { checkBreakpointStatusDescription, checkBreakpointStatusParams, handleCheckBreakpointStatus, } from "./tools/check-status.js";
|
|
6
|
+
import { listBreakpointsDescription, listBreakpointsParams, handleListBreakpoints, } from "./tools/list-breakpoints.js";
|
|
7
|
+
import { answerBreakpointDescription, answerBreakpointParams, handleAnswerBreakpoint, } from "./tools/answer-breakpoint.js";
|
|
8
|
+
import { verifyBreakpointAnswerDescription, verifyBreakpointAnswerParams, handleVerifyBreakpointAnswer, } from "./tools/verify-answer.js";
|
|
9
|
+
import { listRespondersDescription, listRespondersParams, handleListResponders, } from "./tools/list-responders.js";
|
|
10
|
+
import { assignTaskDescription, assignTaskParams, addCommentDescription, addCommentParams, addCommentToBreakpointDescription, addCommentToBreakpointParams, bulkUpdateTasksDescription, bulkUpdateTasksParams, cancelBreakpointDescription, cancelBreakpointParams, createTaskDescription, createTaskParams, createTodoDescription, createTodoParams, escalateDescription, escalateBreakpointDescription, escalateBreakpointParams, escalateParams, exportTasksDescription, exportTasksParams, handleAssignTask, handleAddComment, handleAddCommentToBreakpoint, handleBulkUpdateTasks, handleCancelBreakpoint, handleCreateTask, handleCreateTodo, handleEscalate, handleEscalateBreakpoint, handleExportTasks, handleSearchTasks, handleTaskStats, searchTasksDescription, searchTasksParams, taskStatsDescription, taskStatsParams, } from "./tools/native-tasks.js";
|
|
11
|
+
import { claimBreakpointDescription, claimBreakpointParams, handleClaimBreakpoint, } from "./tools/claim-breakpoint.js";
|
|
12
|
+
import { pollBreakpointsDescription, pollBreakpointsParams, handlePollBreakpoints, } from "./tools/poll-breakpoints.js";
|
|
13
|
+
import { resolveBreakpointBackend } from "./backend-resolver.js";
|
|
14
|
+
import { createDefaultBackend } from "../backends/index.js";
|
|
15
|
+
/**
|
|
16
|
+
* Resolve the backend for an MCP tool call.
|
|
17
|
+
* Uses the backend-resolver (env var, routing config) or defaults to git-native.
|
|
18
|
+
*/
|
|
19
|
+
function resolveToolBackend(params) {
|
|
20
|
+
if (!params?.backend && params?.breakpointsDir) {
|
|
21
|
+
return createDefaultBackend({ breakpointsDir: params.breakpointsDir });
|
|
22
|
+
}
|
|
23
|
+
const { backend } = resolveBreakpointBackend({
|
|
24
|
+
explicitBackend: params?.backend,
|
|
25
|
+
breakpointsDir: params?.breakpointsDir,
|
|
26
|
+
domain: params?.domain,
|
|
27
|
+
tags: params?.tags,
|
|
28
|
+
});
|
|
29
|
+
return backend;
|
|
30
|
+
}
|
|
31
|
+
function toCompatShape(shape) {
|
|
32
|
+
return shape;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Create a tasks-adapter MCP server with breakpoint, responder, and native task tools registered.
|
|
36
|
+
*/
|
|
37
|
+
export function createBreakpointMcpServer() {
|
|
38
|
+
const server = new McpServer({
|
|
39
|
+
name: "tasks-adapter",
|
|
40
|
+
version: "0.1.0",
|
|
41
|
+
}, {
|
|
42
|
+
capabilities: {
|
|
43
|
+
resources: {
|
|
44
|
+
listChanged: true,
|
|
45
|
+
subscribe: true,
|
|
46
|
+
},
|
|
47
|
+
},
|
|
48
|
+
});
|
|
49
|
+
const subscribedResources = new Set();
|
|
50
|
+
server.server.setRequestHandler(SubscribeRequestSchema, (request) => {
|
|
51
|
+
subscribedResources.add(request.params.uri);
|
|
52
|
+
return EmptyResultSchema.parse({});
|
|
53
|
+
});
|
|
54
|
+
server.server.setRequestHandler(UnsubscribeRequestSchema, (request) => {
|
|
55
|
+
subscribedResources.delete(request.params.uri);
|
|
56
|
+
return EmptyResultSchema.parse({});
|
|
57
|
+
});
|
|
58
|
+
server.registerResource("breakpoint", new ResourceTemplate("breakpoint://{id}", {
|
|
59
|
+
list: async () => {
|
|
60
|
+
const backend = resolveToolBackend();
|
|
61
|
+
if (!backend.searchBreakpoints)
|
|
62
|
+
return { resources: [] };
|
|
63
|
+
const result = await backend.searchBreakpoints({});
|
|
64
|
+
return {
|
|
65
|
+
resources: result.items.map((breakpoint) => ({
|
|
66
|
+
uri: `breakpoint://${breakpoint.id}`,
|
|
67
|
+
name: breakpoint.id,
|
|
68
|
+
description: breakpoint.text,
|
|
69
|
+
mimeType: "application/json",
|
|
70
|
+
})),
|
|
71
|
+
};
|
|
72
|
+
},
|
|
73
|
+
}), {
|
|
74
|
+
title: "Breakpoint",
|
|
75
|
+
description: "Read a breakpoint by id using breakpoint://[id]. Subscribe to the URI to receive resource update notifications from transports that support them.",
|
|
76
|
+
mimeType: "application/json",
|
|
77
|
+
}, async (uri, variables) => {
|
|
78
|
+
const id = String(variables.id);
|
|
79
|
+
const breakpoint = await resolveToolBackend().getBreakpoint(id);
|
|
80
|
+
return {
|
|
81
|
+
contents: [{
|
|
82
|
+
uri: uri.toString(),
|
|
83
|
+
mimeType: "application/json",
|
|
84
|
+
text: JSON.stringify({
|
|
85
|
+
...breakpoint,
|
|
86
|
+
subscribed: subscribedResources.has(uri.toString()),
|
|
87
|
+
}, null, 2),
|
|
88
|
+
}],
|
|
89
|
+
};
|
|
90
|
+
});
|
|
91
|
+
// ── Submitter-side tools ──────────────────────────────────────────────
|
|
92
|
+
server.tool("ask_breakpoint", askBreakpointDescription, toCompatShape(askBreakpointParams), async (args) => {
|
|
93
|
+
const backend = resolveToolBackend(args);
|
|
94
|
+
const result = await handleAskBreakpoint(args, backend);
|
|
95
|
+
return {
|
|
96
|
+
content: [{ type: "text", text: JSON.stringify(result, null, 2) }],
|
|
97
|
+
};
|
|
98
|
+
});
|
|
99
|
+
server.tool("check_breakpoint_status", checkBreakpointStatusDescription, toCompatShape(checkBreakpointStatusParams), async (args) => {
|
|
100
|
+
const backend = resolveToolBackend(args);
|
|
101
|
+
const result = await handleCheckBreakpointStatus(args, backend);
|
|
102
|
+
return {
|
|
103
|
+
content: [{ type: "text", text: JSON.stringify(result, null, 2) }],
|
|
104
|
+
};
|
|
105
|
+
});
|
|
106
|
+
server.tool("list_breakpoints", listBreakpointsDescription, toCompatShape(listBreakpointsParams), async (args) => {
|
|
107
|
+
const backend = resolveToolBackend(args);
|
|
108
|
+
const result = await handleListBreakpoints(args, backend);
|
|
109
|
+
return {
|
|
110
|
+
content: [{ type: "text", text: JSON.stringify(result, null, 2) }],
|
|
111
|
+
};
|
|
112
|
+
});
|
|
113
|
+
server.tool("create_todo", createTodoDescription, toCompatShape(createTodoParams), async (args) => {
|
|
114
|
+
const backend = resolveToolBackend(args);
|
|
115
|
+
const result = await handleCreateTodo(args, backend);
|
|
116
|
+
return {
|
|
117
|
+
content: [{ type: "text", text: JSON.stringify(result, null, 2) }],
|
|
118
|
+
};
|
|
119
|
+
});
|
|
120
|
+
server.tool("create_task", createTaskDescription, toCompatShape(createTaskParams), async (args) => {
|
|
121
|
+
const backend = resolveToolBackend(args);
|
|
122
|
+
const result = await handleCreateTask(args, backend);
|
|
123
|
+
return {
|
|
124
|
+
content: [{ type: "text", text: JSON.stringify(result, null, 2) }],
|
|
125
|
+
};
|
|
126
|
+
});
|
|
127
|
+
server.tool("assign_task", assignTaskDescription, toCompatShape(assignTaskParams), async (args) => {
|
|
128
|
+
const backend = resolveToolBackend(args);
|
|
129
|
+
const result = await handleAssignTask(args, backend);
|
|
130
|
+
return {
|
|
131
|
+
content: [{ type: "text", text: JSON.stringify(result, null, 2) }],
|
|
132
|
+
};
|
|
133
|
+
});
|
|
134
|
+
server.tool("search_tasks", searchTasksDescription, toCompatShape(searchTasksParams), async (args) => {
|
|
135
|
+
const backend = resolveToolBackend(args);
|
|
136
|
+
const result = await handleSearchTasks(args, backend);
|
|
137
|
+
return {
|
|
138
|
+
content: [{ type: "text", text: JSON.stringify(result, null, 2) }],
|
|
139
|
+
};
|
|
140
|
+
});
|
|
141
|
+
server.tool("cancel_breakpoint", cancelBreakpointDescription, toCompatShape(cancelBreakpointParams), async (args) => {
|
|
142
|
+
const backend = resolveToolBackend(args);
|
|
143
|
+
const result = await handleCancelBreakpoint(args, backend);
|
|
144
|
+
await server.server.sendResourceUpdated({ uri: `breakpoint://${args.breakpointId}` }).catch(() => { });
|
|
145
|
+
return {
|
|
146
|
+
content: [{ type: "text", text: JSON.stringify(result, null, 2) }],
|
|
147
|
+
};
|
|
148
|
+
});
|
|
149
|
+
server.tool("add_comment", addCommentDescription, toCompatShape(addCommentParams), async (args) => {
|
|
150
|
+
const backend = resolveToolBackend(args);
|
|
151
|
+
const result = await handleAddComment(args, backend);
|
|
152
|
+
return {
|
|
153
|
+
content: [{ type: "text", text: JSON.stringify(result, null, 2) }],
|
|
154
|
+
};
|
|
155
|
+
});
|
|
156
|
+
server.tool("add_comment_to_breakpoint", addCommentToBreakpointDescription, toCompatShape(addCommentToBreakpointParams), async (args) => {
|
|
157
|
+
const backend = resolveToolBackend(args);
|
|
158
|
+
const result = await handleAddCommentToBreakpoint(args, backend);
|
|
159
|
+
await server.server.sendResourceUpdated({ uri: `breakpoint://${args.breakpointId}` }).catch(() => { });
|
|
160
|
+
return {
|
|
161
|
+
content: [{ type: "text", text: JSON.stringify(result, null, 2) }],
|
|
162
|
+
};
|
|
163
|
+
});
|
|
164
|
+
server.tool("bulk_update_tasks", bulkUpdateTasksDescription, toCompatShape(bulkUpdateTasksParams), async (args) => {
|
|
165
|
+
const backend = resolveToolBackend(args);
|
|
166
|
+
const result = await handleBulkUpdateTasks(args, backend);
|
|
167
|
+
return {
|
|
168
|
+
content: [{ type: "text", text: JSON.stringify(result, null, 2) }],
|
|
169
|
+
};
|
|
170
|
+
});
|
|
171
|
+
server.tool("task_stats", taskStatsDescription, toCompatShape(taskStatsParams), async (args) => {
|
|
172
|
+
const backend = resolveToolBackend(args);
|
|
173
|
+
const result = await handleTaskStats(args, backend);
|
|
174
|
+
return {
|
|
175
|
+
content: [{ type: "text", text: JSON.stringify(result, null, 2) }],
|
|
176
|
+
};
|
|
177
|
+
});
|
|
178
|
+
server.tool("export_tasks", exportTasksDescription, toCompatShape(exportTasksParams), async (args) => {
|
|
179
|
+
const backend = resolveToolBackend(args);
|
|
180
|
+
const result = await handleExportTasks(args, backend);
|
|
181
|
+
return {
|
|
182
|
+
content: [{ type: "text", text: JSON.stringify(result, null, 2) }],
|
|
183
|
+
};
|
|
184
|
+
});
|
|
185
|
+
server.tool("escalate", escalateDescription, toCompatShape(escalateParams), async (args) => {
|
|
186
|
+
const backend = resolveToolBackend(args);
|
|
187
|
+
const result = await handleEscalate(args, backend);
|
|
188
|
+
return {
|
|
189
|
+
content: [{ type: "text", text: JSON.stringify(result, null, 2) }],
|
|
190
|
+
};
|
|
191
|
+
});
|
|
192
|
+
server.tool("escalate_breakpoint", escalateBreakpointDescription, toCompatShape(escalateBreakpointParams), async (args) => {
|
|
193
|
+
const backend = resolveToolBackend(args);
|
|
194
|
+
const result = await handleEscalateBreakpoint(args, backend);
|
|
195
|
+
await server.server.sendResourceUpdated({ uri: `breakpoint://${args.breakpointId}` }).catch(() => { });
|
|
196
|
+
return {
|
|
197
|
+
content: [{ type: "text", text: JSON.stringify(result, null, 2) }],
|
|
198
|
+
};
|
|
199
|
+
});
|
|
200
|
+
server.tool("answer_breakpoint", answerBreakpointDescription, toCompatShape(answerBreakpointParams), async (args) => {
|
|
201
|
+
const backend = resolveToolBackend(args);
|
|
202
|
+
const result = await handleAnswerBreakpoint(args, backend);
|
|
203
|
+
return {
|
|
204
|
+
content: [{ type: "text", text: JSON.stringify(result, null, 2) }],
|
|
205
|
+
};
|
|
206
|
+
});
|
|
207
|
+
server.tool("verify_breakpoint_answer", verifyBreakpointAnswerDescription, toCompatShape(verifyBreakpointAnswerParams), async (args) => {
|
|
208
|
+
const backend = resolveToolBackend(args);
|
|
209
|
+
const result = await handleVerifyBreakpointAnswer(args, backend);
|
|
210
|
+
return {
|
|
211
|
+
content: [{ type: "text", text: JSON.stringify(result, null, 2) }],
|
|
212
|
+
};
|
|
213
|
+
});
|
|
214
|
+
// ── Responder-side tools ──────────────────────────────────────────────
|
|
215
|
+
server.tool("list_responders", listRespondersDescription, toCompatShape(listRespondersParams), async (args) => {
|
|
216
|
+
const backend = resolveToolBackend(args);
|
|
217
|
+
const result = await handleListResponders(args, backend);
|
|
218
|
+
return {
|
|
219
|
+
content: [{ type: "text", text: JSON.stringify(result, null, 2) }],
|
|
220
|
+
};
|
|
221
|
+
});
|
|
222
|
+
server.tool("claim_breakpoint", claimBreakpointDescription, toCompatShape(claimBreakpointParams), async (args) => {
|
|
223
|
+
const backend = resolveToolBackend(args);
|
|
224
|
+
const result = await handleClaimBreakpoint(args, backend);
|
|
225
|
+
return {
|
|
226
|
+
content: [{ type: "text", text: JSON.stringify(result, null, 2) }],
|
|
227
|
+
};
|
|
228
|
+
});
|
|
229
|
+
server.tool("poll_breakpoints", pollBreakpointsDescription, toCompatShape(pollBreakpointsParams), async (args) => {
|
|
230
|
+
const backend = resolveToolBackend(args);
|
|
231
|
+
const result = await handlePollBreakpoints(args, backend);
|
|
232
|
+
return {
|
|
233
|
+
content: [{ type: "text", text: JSON.stringify(result, null, 2) }],
|
|
234
|
+
};
|
|
235
|
+
});
|
|
236
|
+
return server;
|
|
237
|
+
}
|
|
238
|
+
/**
|
|
239
|
+
* Start the tasks-adapter MCP server on stdio transport.
|
|
240
|
+
*/
|
|
241
|
+
export async function startBreakpointMcpServer() {
|
|
242
|
+
const server = createBreakpointMcpServer();
|
|
243
|
+
const transport = new StdioServerTransport();
|
|
244
|
+
await server.connect(transport);
|
|
245
|
+
}
|
|
246
|
+
/**
|
|
247
|
+
* Start the tasks-adapter MCP server on HTTP transport with Streamable HTTP.
|
|
248
|
+
*
|
|
249
|
+
* The HTTP server provides:
|
|
250
|
+
* - POST/GET/DELETE /mcp -- MCP Streamable HTTP transport
|
|
251
|
+
* - GET /healthz -- health check
|
|
252
|
+
* - Bearer token authentication (when BPX_MCP_TOKEN is set or token is provided)
|
|
253
|
+
*/
|
|
254
|
+
export async function startHttpBreakpointMcpServer(options) {
|
|
255
|
+
// Dynamic import to avoid pulling in http-transport for stdio-only usage
|
|
256
|
+
const { startHttpMcpServer } = await import("./http-transport.js");
|
|
257
|
+
const server = createBreakpointMcpServer();
|
|
258
|
+
return startHttpMcpServer(server, options);
|
|
259
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import type { BreakpointBackend } from "../../backend.js";
|
|
3
|
+
import type { BreakpointPublicAnswer } from "../../types.js";
|
|
4
|
+
export declare const answerBreakpointDescription: string;
|
|
5
|
+
export declare const answerBreakpointParams: {
|
|
6
|
+
breakpointId: z.ZodString;
|
|
7
|
+
text: z.ZodString;
|
|
8
|
+
approved: z.ZodOptional<z.ZodBoolean>;
|
|
9
|
+
responderId: z.ZodString;
|
|
10
|
+
responderName: z.ZodString;
|
|
11
|
+
confidence: z.ZodOptional<z.ZodNumber>;
|
|
12
|
+
references: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
13
|
+
sign: z.ZodOptional<z.ZodBoolean>;
|
|
14
|
+
keyFingerprint: z.ZodOptional<z.ZodString>;
|
|
15
|
+
backend: z.ZodOptional<z.ZodString>;
|
|
16
|
+
breakpointsDir: z.ZodOptional<z.ZodString>;
|
|
17
|
+
};
|
|
18
|
+
export interface AnswerBreakpointParams {
|
|
19
|
+
breakpointId: string;
|
|
20
|
+
text: string;
|
|
21
|
+
approved?: boolean;
|
|
22
|
+
responderId: string;
|
|
23
|
+
responderName: string;
|
|
24
|
+
confidence?: number;
|
|
25
|
+
references?: string[];
|
|
26
|
+
sign?: boolean;
|
|
27
|
+
keyFingerprint?: string;
|
|
28
|
+
backend?: string;
|
|
29
|
+
breakpointsDir?: string;
|
|
30
|
+
}
|
|
31
|
+
export declare function handleAnswerBreakpoint(params: AnswerBreakpointParams, backend: BreakpointBackend): Promise<BreakpointPublicAnswer>;
|
|
32
|
+
//# sourceMappingURL=answer-breakpoint.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"answer-breakpoint.d.ts","sourceRoot":"","sources":["../../../src/mcp/tools/answer-breakpoint.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,iBAAiB,EAAsB,MAAM,kBAAkB,CAAC;AAC9E,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AAI7D,eAAO,MAAM,2BAA2B,QAEC,CAAC;AAI1C,eAAO,MAAM,sBAAsB;;;;;;;;;;;;CAsBlC,CAAC;AAIF,MAAM,WAAW,sBAAsB;IACrC,YAAY,EAAE,MAAM,CAAC;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,aAAa,EAAE,MAAM,CAAC;IACtB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;IACtB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAID,wBAAsB,sBAAsB,CAC1C,MAAM,EAAE,sBAAsB,EAC9B,OAAO,EAAE,iBAAiB,GACzB,OAAO,CAAC,sBAAsB,CAAC,CA2BjC"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
// ── Tool Description ────────────────────────────────────────────────────
|
|
3
|
+
export const answerBreakpointDescription = "Submit an answer to a pending breakpoint. Optionally sign the answer " +
|
|
4
|
+
"cryptographically for verified trust.";
|
|
5
|
+
// ── Tool Param Schema ───────────────────────────────────────────────────
|
|
6
|
+
export const answerBreakpointParams = {
|
|
7
|
+
breakpointId: z.string().describe("The ID of the breakpoint to answer."),
|
|
8
|
+
text: z.string().describe("The answer text."),
|
|
9
|
+
approved: z.boolean().optional().describe("For approval-type breakpoints, whether to approve or reject."),
|
|
10
|
+
responderId: z.string().describe("Your responder identity."),
|
|
11
|
+
responderName: z.string().describe("Your display name."),
|
|
12
|
+
confidence: z.number().min(0).max(100).optional().describe("Confidence level 0-100. Defaults to 80."),
|
|
13
|
+
references: z.array(z.string()).optional().describe("Supporting references or links."),
|
|
14
|
+
sign: z.boolean().optional().describe("When true, cryptographically sign the answer with your private key."),
|
|
15
|
+
keyFingerprint: z.string().optional().describe("Ed25519 key fingerprint to use for signing. Required when sign=true."),
|
|
16
|
+
backend: z.string().optional(),
|
|
17
|
+
breakpointsDir: z.string().optional(),
|
|
18
|
+
};
|
|
19
|
+
// ── Handler ─────────────────────────────────────────────────────────────
|
|
20
|
+
export async function handleAnswerBreakpoint(params, backend) {
|
|
21
|
+
if (!params.breakpointId || params.breakpointId.length === 0) {
|
|
22
|
+
throw new Error("breakpointId is required and must be non-empty");
|
|
23
|
+
}
|
|
24
|
+
if (!params.text && params.text !== "") {
|
|
25
|
+
throw new Error("text is required");
|
|
26
|
+
}
|
|
27
|
+
if (!params.responderId || params.responderId.length === 0) {
|
|
28
|
+
throw new Error("responderId is required and must be non-empty");
|
|
29
|
+
}
|
|
30
|
+
if (!params.responderName || params.responderName.length === 0) {
|
|
31
|
+
throw new Error("responderName is required and must be non-empty");
|
|
32
|
+
}
|
|
33
|
+
const answerParams = {
|
|
34
|
+
responderId: params.responderId,
|
|
35
|
+
responderName: params.responderName,
|
|
36
|
+
text: params.text,
|
|
37
|
+
approved: params.approved,
|
|
38
|
+
confidence: params.confidence,
|
|
39
|
+
references: params.references,
|
|
40
|
+
sign: params.sign,
|
|
41
|
+
keyFingerprint: params.keyFingerprint,
|
|
42
|
+
};
|
|
43
|
+
const answer = await backend.answerBreakpoint(params.breakpointId, answerParams);
|
|
44
|
+
return answer;
|
|
45
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import type { BreakpointBackend } from "../../backend.js";
|
|
3
|
+
import type { BreakpointWaitResult } from "../../types.js";
|
|
4
|
+
export declare const askBreakpointDescription: string;
|
|
5
|
+
export declare const askBreakpointParams: {
|
|
6
|
+
question: z.ZodString;
|
|
7
|
+
context: z.ZodOptional<z.ZodString>;
|
|
8
|
+
markdown: z.ZodOptional<z.ZodString>;
|
|
9
|
+
codeSnippets: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
10
|
+
filename: z.ZodString;
|
|
11
|
+
code: z.ZodString;
|
|
12
|
+
language: z.ZodOptional<z.ZodString>;
|
|
13
|
+
}, "strip", z.ZodTypeAny, {
|
|
14
|
+
code: string;
|
|
15
|
+
filename: string;
|
|
16
|
+
language?: string | undefined;
|
|
17
|
+
}, {
|
|
18
|
+
code: string;
|
|
19
|
+
filename: string;
|
|
20
|
+
language?: string | undefined;
|
|
21
|
+
}>, "many">>;
|
|
22
|
+
fileReferences: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
23
|
+
tags: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
24
|
+
domain: z.ZodOptional<z.ZodString>;
|
|
25
|
+
urgency: z.ZodOptional<z.ZodEnum<["low", "medium", "high"]>>;
|
|
26
|
+
interactionKind: z.ZodOptional<z.ZodEnum<["clarification", "approval", "intervention", "notification", "handoff"]>>;
|
|
27
|
+
targetResponders: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
28
|
+
routingStrategy: z.ZodDefault<z.ZodEnum<["single", "first-response-wins", "collect-all", "quorum"]>>;
|
|
29
|
+
timeout: z.ZodOptional<z.ZodNumber>;
|
|
30
|
+
breakpointId: z.ZodOptional<z.ZodString>;
|
|
31
|
+
backend: z.ZodOptional<z.ZodString>;
|
|
32
|
+
breakpointsDir: z.ZodOptional<z.ZodString>;
|
|
33
|
+
proven: z.ZodOptional<z.ZodBoolean>;
|
|
34
|
+
};
|
|
35
|
+
export interface AskBreakpointParams {
|
|
36
|
+
question: string;
|
|
37
|
+
context?: string;
|
|
38
|
+
markdown?: string;
|
|
39
|
+
codeSnippets?: Array<{
|
|
40
|
+
filename: string;
|
|
41
|
+
code: string;
|
|
42
|
+
language?: string;
|
|
43
|
+
}>;
|
|
44
|
+
fileReferences?: string[];
|
|
45
|
+
tags?: string[];
|
|
46
|
+
domain?: string;
|
|
47
|
+
urgency?: "low" | "medium" | "high";
|
|
48
|
+
interactionKind?: "clarification" | "approval" | "intervention" | "notification" | "handoff";
|
|
49
|
+
targetResponders?: string[];
|
|
50
|
+
routingStrategy?: "single" | "first-response-wins" | "collect-all" | "quorum";
|
|
51
|
+
timeout?: number;
|
|
52
|
+
breakpointId?: string;
|
|
53
|
+
backend?: string;
|
|
54
|
+
breakpointsDir?: string;
|
|
55
|
+
proven?: boolean;
|
|
56
|
+
}
|
|
57
|
+
export declare function handleAskBreakpoint(params: AskBreakpointParams, backend: BreakpointBackend): Promise<BreakpointWaitResult>;
|
|
58
|
+
//# sourceMappingURL=ask-breakpoint.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ask-breakpoint.d.ts","sourceRoot":"","sources":["../../../src/mcp/tools/ask-breakpoint.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB,OAAO,KAAK,EAAE,iBAAiB,EAA0B,MAAM,kBAAkB,CAAC;AAElF,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAK3D,eAAO,MAAM,wBAAwB,QAImB,CAAC;AAIzD,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqD/B,CAAC;AAIF,MAAM,WAAW,mBAAmB;IAClC,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,YAAY,CAAC,EAAE,KAAK,CAAC;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAC5E,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;IAC1B,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,KAAK,GAAG,QAAQ,GAAG,MAAM,CAAC;IACpC,eAAe,CAAC,EAAE,eAAe,GAAG,UAAU,GAAG,cAAc,GAAG,cAAc,GAAG,SAAS,CAAC;IAC7F,gBAAgB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC5B,eAAe,CAAC,EAAE,QAAQ,GAAG,qBAAqB,GAAG,aAAa,GAAG,QAAQ,CAAC;IAC9E,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAID,wBAAsB,mBAAmB,CACvC,MAAM,EAAE,mBAAmB,EAC3B,OAAO,EAAE,iBAAiB,GACzB,OAAO,CAAC,oBAAoB,CAAC,CA+C/B"}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { selectBreakpointAnswer, supportsProvenAnswers, unsupportedBackendFeatureMessage, } from "../../backend.js";
|
|
3
|
+
import { isProvenBreakpointAnswer } from "../../types.js";
|
|
4
|
+
import { DEFAULT_TIMEOUT_MS } from "../../types.js";
|
|
5
|
+
// ── Tool Description ────────────────────────────────────────────────────
|
|
6
|
+
export const askBreakpointDescription = "Submit a breakpoint question and wait for a human responder's answer. " +
|
|
7
|
+
"Use this when you encounter a decision, approval, or question that " +
|
|
8
|
+
"requires human judgment. The tool blocks until an answer is received, " +
|
|
9
|
+
"the timeout elapses, or the breakpoint is cancelled.";
|
|
10
|
+
// ── Tool Param Schema ───────────────────────────────────────────────────
|
|
11
|
+
export const askBreakpointParams = {
|
|
12
|
+
question: z.string().describe("The breakpoint question text."),
|
|
13
|
+
context: z.string().optional().describe("Additional context: what was tried, relevant code, etc."),
|
|
14
|
+
markdown: z.string().optional().describe("Rich markdown context for rendering."),
|
|
15
|
+
codeSnippets: z.array(z.object({
|
|
16
|
+
filename: z.string(),
|
|
17
|
+
code: z.string(),
|
|
18
|
+
language: z.string().optional(),
|
|
19
|
+
})).optional().describe("Structured code snippets with metadata."),
|
|
20
|
+
fileReferences: z.array(z.string()).optional().describe("File paths relevant to the breakpoint."),
|
|
21
|
+
tags: z.array(z.string()).optional().describe("Keywords for categorizing and routing the breakpoint."),
|
|
22
|
+
domain: z.string().optional().describe("Domain area (e.g., 'backend', 'security', 'devops')."),
|
|
23
|
+
urgency: z.enum(["low", "medium", "high"]).optional().describe("Urgency level of the breakpoint."),
|
|
24
|
+
interactionKind: z.enum([
|
|
25
|
+
"clarification", "approval", "intervention", "notification", "handoff",
|
|
26
|
+
]).optional().describe("Semantic classification of the interaction type."),
|
|
27
|
+
targetResponders: z.array(z.string()).optional().describe("Specific responder IDs to route this breakpoint to."),
|
|
28
|
+
routingStrategy: z.enum([
|
|
29
|
+
"single", "first-response-wins", "collect-all", "quorum",
|
|
30
|
+
]).default("first-response-wins").describe("How to route the breakpoint to responders."),
|
|
31
|
+
timeout: z.number().positive().optional().describe("Timeout in milliseconds. Defaults to 30 minutes."),
|
|
32
|
+
breakpointId: z.string().optional().describe("Canonical breakpoint identity for cross-run matching and auto-approval rules."),
|
|
33
|
+
backend: z.string().optional().describe("Explicit backend to use (e.g., 'git-native'). Defaults to configured backend."),
|
|
34
|
+
breakpointsDir: z.string().optional().describe("Path to .breakpoints directory (git-native backend)."),
|
|
35
|
+
proven: z.boolean().optional().describe("When true, require the answer to be cryptographically signed."),
|
|
36
|
+
};
|
|
37
|
+
// ── Handler ─────────────────────────────────────────────────────────────
|
|
38
|
+
export async function handleAskBreakpoint(params, backend) {
|
|
39
|
+
if (!params.question || params.question.length === 0) {
|
|
40
|
+
throw new Error("question is required and must be non-empty");
|
|
41
|
+
}
|
|
42
|
+
const timeoutMs = params.timeout ?? DEFAULT_TIMEOUT_MS;
|
|
43
|
+
const submitParams = {
|
|
44
|
+
text: params.question,
|
|
45
|
+
context: {
|
|
46
|
+
description: params.context ?? "",
|
|
47
|
+
codeSnippets: params.codeSnippets ?? [],
|
|
48
|
+
fileReferences: params.fileReferences ?? [],
|
|
49
|
+
tags: params.tags ?? [],
|
|
50
|
+
markdown: params.markdown,
|
|
51
|
+
domain: params.domain,
|
|
52
|
+
urgency: params.urgency,
|
|
53
|
+
interactionKind: params.interactionKind,
|
|
54
|
+
},
|
|
55
|
+
routing: {
|
|
56
|
+
strategy: params.routingStrategy ?? "first-response-wins",
|
|
57
|
+
targetResponders: params.targetResponders ?? [],
|
|
58
|
+
timeoutMs,
|
|
59
|
+
presentToUser: false,
|
|
60
|
+
breakpointId: params.breakpointId,
|
|
61
|
+
},
|
|
62
|
+
proven: params.proven,
|
|
63
|
+
};
|
|
64
|
+
if (params.proven && !supportsProvenAnswers(backend.name)) {
|
|
65
|
+
throw new Error(unsupportedBackendFeatureMessage(backend.name, "ask_breakpoint.proven"));
|
|
66
|
+
}
|
|
67
|
+
const breakpoint = await backend.submitBreakpoint(submitParams);
|
|
68
|
+
const waitResult = await backend.waitForAnswer(breakpoint.id, {
|
|
69
|
+
timeoutMs,
|
|
70
|
+
});
|
|
71
|
+
if (params.proven && waitResult.answered) {
|
|
72
|
+
const answer = waitResult.answer ?? selectBreakpointAnswer(waitResult.breakpoint);
|
|
73
|
+
if (!answer || !isProvenBreakpointAnswer(answer)) {
|
|
74
|
+
throw new Error(`Breakpoint ${breakpoint.id} required a signed answer, but the returned answer was unsigned.`);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
return waitResult;
|
|
78
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import type { BreakpointBackend } from "../../backend.js";
|
|
3
|
+
import type { Breakpoint } from "../../types.js";
|
|
4
|
+
export declare const checkBreakpointStatusDescription: string;
|
|
5
|
+
export declare const checkBreakpointStatusParams: {
|
|
6
|
+
breakpointId: z.ZodString;
|
|
7
|
+
backend: z.ZodOptional<z.ZodString>;
|
|
8
|
+
breakpointsDir: z.ZodOptional<z.ZodString>;
|
|
9
|
+
};
|
|
10
|
+
export interface CheckBreakpointStatusParams {
|
|
11
|
+
breakpointId: string;
|
|
12
|
+
backend?: string;
|
|
13
|
+
breakpointsDir?: string;
|
|
14
|
+
}
|
|
15
|
+
export declare function handleCheckBreakpointStatus(params: CheckBreakpointStatusParams, backend: BreakpointBackend): Promise<Breakpoint>;
|
|
16
|
+
//# sourceMappingURL=check-status.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"check-status.d.ts","sourceRoot":"","sources":["../../../src/mcp/tools/check-status.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAC1D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAIjD,eAAO,MAAM,gCAAgC,QAEW,CAAC;AAIzD,eAAO,MAAM,2BAA2B;;;;CAIvC,CAAC;AAIF,MAAM,WAAW,2BAA2B;IAC1C,YAAY,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAID,wBAAsB,2BAA2B,CAC/C,MAAM,EAAE,2BAA2B,EACnC,OAAO,EAAE,iBAAiB,GACzB,OAAO,CAAC,UAAU,CAAC,CAOrB"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
// ── Tool Description ────────────────────────────────────────────────────
|
|
3
|
+
export const checkBreakpointStatusDescription = "Check the current status of a pending breakpoint. Returns the breakpoint " +
|
|
4
|
+
"state, any answers received, and timing information.";
|
|
5
|
+
// ── Tool Param Schema ───────────────────────────────────────────────────
|
|
6
|
+
export const checkBreakpointStatusParams = {
|
|
7
|
+
breakpointId: z.string().describe("The ID of the breakpoint to check."),
|
|
8
|
+
backend: z.string().optional(),
|
|
9
|
+
breakpointsDir: z.string().optional(),
|
|
10
|
+
};
|
|
11
|
+
// ── Handler ─────────────────────────────────────────────────────────────
|
|
12
|
+
export async function handleCheckBreakpointStatus(params, backend) {
|
|
13
|
+
if (!params.breakpointId || params.breakpointId.length === 0) {
|
|
14
|
+
throw new Error("breakpointId is required and must be non-empty");
|
|
15
|
+
}
|
|
16
|
+
const breakpoint = await backend.getBreakpoint(params.breakpointId);
|
|
17
|
+
return breakpoint;
|
|
18
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import type { BreakpointBackend } from "../../backend.js";
|
|
3
|
+
import type { Breakpoint } from "../../types.js";
|
|
4
|
+
export declare const claimBreakpointDescription: string;
|
|
5
|
+
export declare const claimBreakpointParams: {
|
|
6
|
+
breakpointId: z.ZodString;
|
|
7
|
+
responderId: z.ZodString;
|
|
8
|
+
backend: z.ZodOptional<z.ZodString>;
|
|
9
|
+
breakpointsDir: z.ZodOptional<z.ZodString>;
|
|
10
|
+
};
|
|
11
|
+
export interface ClaimBreakpointToolParams {
|
|
12
|
+
breakpointId: string;
|
|
13
|
+
responderId: string;
|
|
14
|
+
backend?: string;
|
|
15
|
+
breakpointsDir?: string;
|
|
16
|
+
}
|
|
17
|
+
export declare function handleClaimBreakpoint(params: ClaimBreakpointToolParams, backend: BreakpointBackend): Promise<Breakpoint>;
|
|
18
|
+
//# sourceMappingURL=claim-breakpoint.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"claim-breakpoint.d.ts","sourceRoot":"","sources":["../../../src/mcp/tools/claim-breakpoint.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAC1D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAIjD,eAAO,MAAM,0BAA0B,QAGsC,CAAC;AAI9E,eAAO,MAAM,qBAAqB;;;;;CAOjC,CAAC;AAIF,MAAM,WAAW,yBAAyB;IACxC,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAID,wBAAsB,qBAAqB,CACzC,MAAM,EAAE,yBAAyB,EACjC,OAAO,EAAE,iBAAiB,GACzB,OAAO,CAAC,UAAU,CAAC,CAgBrB"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
// ── Tool Description ────────────────────────────────────────────────────
|
|
3
|
+
export const claimBreakpointDescription = "Claim a pending breakpoint so other responders know you are working on it. " +
|
|
4
|
+
"You should claim a breakpoint before answering it. " +
|
|
5
|
+
"Only responders listed in the breakpoint's targetResponders can claim it.";
|
|
6
|
+
// ── Tool Param Schema ───────────────────────────────────────────────────
|
|
7
|
+
export const claimBreakpointParams = {
|
|
8
|
+
breakpointId: z.string().describe("The ID of the breakpoint to claim."),
|
|
9
|
+
responderId: z
|
|
10
|
+
.string()
|
|
11
|
+
.describe("The responder ID claiming this breakpoint."),
|
|
12
|
+
backend: z.string().optional(),
|
|
13
|
+
breakpointsDir: z.string().optional(),
|
|
14
|
+
};
|
|
15
|
+
// ── Handler ─────────────────────────────────────────────────────────────
|
|
16
|
+
export async function handleClaimBreakpoint(params, backend) {
|
|
17
|
+
if (!params.breakpointId || params.breakpointId.length === 0) {
|
|
18
|
+
throw new Error("breakpointId is required and must be non-empty");
|
|
19
|
+
}
|
|
20
|
+
if (!params.responderId || params.responderId.length === 0) {
|
|
21
|
+
throw new Error("responderId is required and must be non-empty");
|
|
22
|
+
}
|
|
23
|
+
if (!backend.claimBreakpoint) {
|
|
24
|
+
throw new Error(`Backend "${backend.name}" does not support claiming breakpoints`);
|
|
25
|
+
}
|
|
26
|
+
const breakpoint = await backend.claimBreakpoint(params.breakpointId, params.responderId);
|
|
27
|
+
return breakpoint;
|
|
28
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import type { BreakpointBackend } from "../../backend.js";
|
|
3
|
+
import type { Breakpoint } from "../../types.js";
|
|
4
|
+
export declare const listBreakpointsDescription = "List pending breakpoints awaiting answers. Optionally filter by responder.";
|
|
5
|
+
export declare const listBreakpointsParams: {
|
|
6
|
+
responderId: z.ZodOptional<z.ZodString>;
|
|
7
|
+
backend: z.ZodOptional<z.ZodString>;
|
|
8
|
+
breakpointsDir: z.ZodOptional<z.ZodString>;
|
|
9
|
+
};
|
|
10
|
+
export interface ListBreakpointsParams {
|
|
11
|
+
responderId?: string;
|
|
12
|
+
backend?: string;
|
|
13
|
+
breakpointsDir?: string;
|
|
14
|
+
}
|
|
15
|
+
export declare function handleListBreakpoints(params: ListBreakpointsParams, backend: BreakpointBackend): Promise<Breakpoint[]>;
|
|
16
|
+
//# sourceMappingURL=list-breakpoints.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list-breakpoints.d.ts","sourceRoot":"","sources":["../../../src/mcp/tools/list-breakpoints.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAC1D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAIjD,eAAO,MAAM,0BAA0B,+EACuC,CAAC;AAI/E,eAAO,MAAM,qBAAqB;;;;CAMjC,CAAC;AAIF,MAAM,WAAW,qBAAqB;IACpC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAID,wBAAsB,qBAAqB,CACzC,MAAM,EAAE,qBAAqB,EAC7B,OAAO,EAAE,iBAAiB,GACzB,OAAO,CAAC,UAAU,EAAE,CAAC,CAGvB"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
// ── Tool Description ────────────────────────────────────────────────────
|
|
3
|
+
export const listBreakpointsDescription = "List pending breakpoints awaiting answers. Optionally filter by responder.";
|
|
4
|
+
// ── Tool Param Schema ───────────────────────────────────────────────────
|
|
5
|
+
export const listBreakpointsParams = {
|
|
6
|
+
responderId: z.string().optional().describe("Filter by responder ID. Omit to list all pending breakpoints."),
|
|
7
|
+
backend: z.string().optional(),
|
|
8
|
+
breakpointsDir: z.string().optional(),
|
|
9
|
+
};
|
|
10
|
+
// ── Handler ─────────────────────────────────────────────────────────────
|
|
11
|
+
export async function handleListBreakpoints(params, backend) {
|
|
12
|
+
const breakpoints = await backend.listPendingBreakpoints(params.responderId);
|
|
13
|
+
return breakpoints;
|
|
14
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import type { BreakpointBackend } from "../../backend.js";
|
|
3
|
+
import type { ResponderProfile } from "../../types.js";
|
|
4
|
+
export declare const listRespondersDescription: string;
|
|
5
|
+
export declare const listRespondersParams: {
|
|
6
|
+
domain: z.ZodOptional<z.ZodString>;
|
|
7
|
+
tags: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
8
|
+
backend: z.ZodOptional<z.ZodString>;
|
|
9
|
+
breakpointsDir: z.ZodOptional<z.ZodString>;
|
|
10
|
+
};
|
|
11
|
+
export interface ListRespondersToolParams {
|
|
12
|
+
domain?: string;
|
|
13
|
+
tags?: string[];
|
|
14
|
+
backend?: string;
|
|
15
|
+
breakpointsDir?: string;
|
|
16
|
+
}
|
|
17
|
+
export declare function handleListResponders(params: ListRespondersToolParams, backend: BreakpointBackend): Promise<ResponderProfile[]>;
|
|
18
|
+
//# sourceMappingURL=list-responders.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list-responders.d.ts","sourceRoot":"","sources":["../../../src/mcp/tools/list-responders.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAC1D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAIvD,eAAO,MAAM,yBAAyB,QAGmB,CAAC;AAI1D,eAAO,MAAM,oBAAoB;;;;;CAWhC,CAAC;AAIF,MAAM,WAAW,wBAAwB;IACvC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAID,wBAAsB,oBAAoB,CACxC,MAAM,EAAE,wBAAwB,EAChC,OAAO,EAAE,iBAAiB,GACzB,OAAO,CAAC,gBAAgB,EAAE,CAAC,CAyB7B"}
|