@a5c-ai/tasks-adapter 5.1.1-staging.0ad6ac75ae4a
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,124 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Maps a babysitter ProcessContext.breakpoint() call to a tasks-adapter
|
|
3
|
+
* backend call, handling routing, context assembly, and result mapping.
|
|
4
|
+
*/
|
|
5
|
+
export class BreakpointMuxInteractionProvider {
|
|
6
|
+
defaultBackend;
|
|
7
|
+
backends;
|
|
8
|
+
routingConfig;
|
|
9
|
+
defaultTimeoutMs;
|
|
10
|
+
constructor(options) {
|
|
11
|
+
this.defaultBackend = options.defaultBackend;
|
|
12
|
+
this.backends = {
|
|
13
|
+
[options.defaultBackend.name]: options.defaultBackend,
|
|
14
|
+
...(options.backends ?? {}),
|
|
15
|
+
};
|
|
16
|
+
this.routingConfig = options.routingConfig;
|
|
17
|
+
this.defaultTimeoutMs = options.defaultTimeoutMs ?? 30 * 60 * 1000;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Route a breakpoint through the appropriate backend.
|
|
21
|
+
*
|
|
22
|
+
* This method is called from the babysitter harness when a process
|
|
23
|
+
* invokes `ctx.breakpoint(payload, options)`.
|
|
24
|
+
*
|
|
25
|
+
* @param payload - The breakpoint payload from the process context.
|
|
26
|
+
* @param options - Breakpoint routing options from the process context.
|
|
27
|
+
* @returns A BreakpointResult compatible with babysitter's ProcessContext.
|
|
28
|
+
*/
|
|
29
|
+
async handleBreakpoint(payload, options) {
|
|
30
|
+
// 1. Resolve backend via routing rules
|
|
31
|
+
const backend = this.resolveBackend(options.domain, options.tags);
|
|
32
|
+
// 2. Build BreakpointContext from payload and options
|
|
33
|
+
const context = this.buildContext(payload, options);
|
|
34
|
+
// 3. Build BreakpointRouting
|
|
35
|
+
const responders = Array.isArray(options.expert)
|
|
36
|
+
? options.expert
|
|
37
|
+
: options.expert
|
|
38
|
+
? [options.expert]
|
|
39
|
+
: [];
|
|
40
|
+
const routing = {
|
|
41
|
+
strategy: options.strategy ?? "first-response-wins",
|
|
42
|
+
targetResponders: responders,
|
|
43
|
+
timeoutMs: options.timeoutMs ?? this.defaultTimeoutMs,
|
|
44
|
+
presentToUser: options.presentAlwaysApprove ?? true,
|
|
45
|
+
breakpointId: options.breakpointId,
|
|
46
|
+
autoApproveAfterN: options.autoApproveAfterN,
|
|
47
|
+
};
|
|
48
|
+
// 4. Submit and wait
|
|
49
|
+
const breakpoint = await backend.submitBreakpoint({
|
|
50
|
+
text: options.label ?? this.extractTextFromPayload(payload),
|
|
51
|
+
context,
|
|
52
|
+
routing,
|
|
53
|
+
});
|
|
54
|
+
const result = await backend.waitForAnswer(breakpoint.id, {
|
|
55
|
+
timeoutMs: routing.timeoutMs,
|
|
56
|
+
});
|
|
57
|
+
// 5. Map to babysitter BreakpointResult shape
|
|
58
|
+
return {
|
|
59
|
+
approved: result.answer?.approved ?? result.answered,
|
|
60
|
+
response: result.answer?.text,
|
|
61
|
+
feedback: result.answer?.text,
|
|
62
|
+
respondedBy: result.answer?.responderName,
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Resolve the backend using routing configuration.
|
|
67
|
+
*/
|
|
68
|
+
resolveBackend(domain, tags) {
|
|
69
|
+
if (!this.routingConfig)
|
|
70
|
+
return this.defaultBackend;
|
|
71
|
+
for (const rule of this.routingConfig.routes) {
|
|
72
|
+
if (this.matchesRule(rule, domain, tags)) {
|
|
73
|
+
const backend = this.backends[rule.backend];
|
|
74
|
+
if (backend)
|
|
75
|
+
return backend;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
return this.defaultBackend;
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Check if a routing rule matches the given domain and tags.
|
|
82
|
+
*/
|
|
83
|
+
matchesRule(rule, domain, tags) {
|
|
84
|
+
if (rule.domains && domain) {
|
|
85
|
+
if (rule.domains.includes(domain))
|
|
86
|
+
return true;
|
|
87
|
+
}
|
|
88
|
+
if (rule.tags && tags && tags.length > 0) {
|
|
89
|
+
if (rule.tags.some((t) => tags.includes(t)))
|
|
90
|
+
return true;
|
|
91
|
+
}
|
|
92
|
+
return false;
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Build a BreakpointContext from the process payload and options.
|
|
96
|
+
*/
|
|
97
|
+
buildContext(payload, options) {
|
|
98
|
+
const description = typeof payload === "string"
|
|
99
|
+
? payload
|
|
100
|
+
: JSON.stringify(payload, null, 2);
|
|
101
|
+
return {
|
|
102
|
+
description,
|
|
103
|
+
codeSnippets: [],
|
|
104
|
+
fileReferences: [],
|
|
105
|
+
tags: options.tags ?? [],
|
|
106
|
+
domain: options.domain,
|
|
107
|
+
interactionKind: options.interactionKind,
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* Extract a text summary from an arbitrary payload.
|
|
112
|
+
*/
|
|
113
|
+
extractTextFromPayload(payload) {
|
|
114
|
+
if (typeof payload === "string")
|
|
115
|
+
return payload;
|
|
116
|
+
if (payload && typeof payload === "object" && "question" in payload) {
|
|
117
|
+
return String(payload.question);
|
|
118
|
+
}
|
|
119
|
+
if (payload && typeof payload === "object" && "text" in payload) {
|
|
120
|
+
return String(payload.text);
|
|
121
|
+
}
|
|
122
|
+
return "Breakpoint requires human input";
|
|
123
|
+
}
|
|
124
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { RoutingConfig } from "../types.js";
|
|
2
|
+
/**
|
|
3
|
+
* Load routing configuration from the filesystem.
|
|
4
|
+
* Searches default paths in order, returns the first found.
|
|
5
|
+
*/
|
|
6
|
+
export declare function loadRoutingConfig(configPath?: string, cwd?: string): Promise<RoutingConfig | null>;
|
|
7
|
+
//# sourceMappingURL=routing-rules.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"routing-rules.d.ts","sourceRoot":"","sources":["../../src/harness/routing-rules.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAQjD;;;GAGG;AACH,wBAAsB,iBAAiB,CACrC,UAAU,CAAC,EAAE,MAAM,EACnB,GAAG,CAAC,EAAE,MAAM,GACX,OAAO,CAAC,aAAa,GAAG,IAAI,CAAC,CAiB/B"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { promises as fs } from "node:fs";
|
|
2
|
+
import * as path from "node:path";
|
|
3
|
+
import { RoutingConfigSchema } from "../types.js";
|
|
4
|
+
const DEFAULT_CONFIG_PATHS = [
|
|
5
|
+
".a5c/breakpoints-routing.json",
|
|
6
|
+
".breakpoints/routing.json",
|
|
7
|
+
];
|
|
8
|
+
/**
|
|
9
|
+
* Load routing configuration from the filesystem.
|
|
10
|
+
* Searches default paths in order, returns the first found.
|
|
11
|
+
*/
|
|
12
|
+
export async function loadRoutingConfig(configPath, cwd) {
|
|
13
|
+
const basePath = cwd ?? process.cwd();
|
|
14
|
+
if (configPath) {
|
|
15
|
+
const absPath = path.isAbsolute(configPath)
|
|
16
|
+
? configPath
|
|
17
|
+
: path.resolve(basePath, configPath);
|
|
18
|
+
return readAndParseConfig(absPath);
|
|
19
|
+
}
|
|
20
|
+
for (const relPath of DEFAULT_CONFIG_PATHS) {
|
|
21
|
+
const absPath = path.resolve(basePath, relPath);
|
|
22
|
+
const config = await readAndParseConfig(absPath);
|
|
23
|
+
if (config)
|
|
24
|
+
return config;
|
|
25
|
+
}
|
|
26
|
+
return null;
|
|
27
|
+
}
|
|
28
|
+
async function readAndParseConfig(filePath) {
|
|
29
|
+
try {
|
|
30
|
+
const raw = await fs.readFile(filePath, "utf-8");
|
|
31
|
+
const parsed = JSON.parse(raw);
|
|
32
|
+
return RoutingConfigSchema.parse(parsed);
|
|
33
|
+
}
|
|
34
|
+
catch {
|
|
35
|
+
return null;
|
|
36
|
+
}
|
|
37
|
+
}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export { BreakpointStatusSchema, BreakpointStrategySchema, ResponderTypeSchema, UrgencySchema, TaskPrioritySchema, InteractionKindSchema, CodeSnippetSchema, BreakpointContextLinkSchema, BreakpointContextSectionSchema, BreakpointContextArtifactSchema, BreakpointContextSchema, BreakpointRoutingSchema, ResponderProfileSchema, BreakpointAnswerRatingSchema, DecisionMemorySchema, BreakpointAnswerSchema, BreakpointSubmitterSchema, BreakpointDependencySchema, BreakpointCommentSchema, BreakpointHistoryEntrySchema, BreakpointAuditEntrySchema, BreakpointFormFieldSchema, BreakpointFormDefinitionSchema, BreakpointFormSubmissionSchema, BreakpointSlaSchema, BreakpointMetricsSchema, NotificationProviderSchema, NotificationConfigSchema, EscalationStepSchema, EscalationChainSchema, BreakpointSchema, BreakpointWaitResultSchema, ProvenBreakpointAnswerSchema, ProvenVerificationResultSchema, ExpertiseAreaSchema, BreakpointBrowserSessionSchema, BreakpointSessionViewSchema, GitNativeBackendConfigSchema, ServerBackendConfigSchema, GitHubIssuesBackendConfigSchema, ExternalTrackerProviderSchema, ExternalTrackerStatusSchema, ExternalTrackerSyncDirectionSchema, ExternalTrackerConflictStrategySchema, ExternalTrackerAuthConfigSchema, ExternalTrackerFieldMappingSchema, ExternalTrackerWebhookConfigSchema, ExternalTrackerBackendConfigSchema, AgentMuxBackendConfigSchema, BackendConfigSchema, RoutingRuleSchema, RoutingConfigSchema, DEFAULT_POLL_INTERVAL_MS, DEFAULT_TIMEOUT_MS, BREAKPOINTS_DIR, BREAKPOINTS_KEYS_DIR, BREAKPOINTS_TRUSTED_KEYS_DIR, BREAKPOINTS_PRIVATE_KEYS_DIR, generateBreakpointId, validateBreakpointTransition, } from "./types.js";
|
|
2
|
+
export type { BreakpointStatus, BreakpointStrategy, ResponderType, Urgency, TaskPriority, InteractionKind, CodeSnippet, BreakpointContextLink, BreakpointContextSection, BreakpointContextArtifact, BreakpointContext, BreakpointRouting, ResponderProfile, BreakpointAnswerRating, DecisionMemory, BreakpointAnswer, BreakpointSubmitter, BreakpointDependency, BreakpointComment, BreakpointHistoryEntry, BreakpointAuditEntry, BreakpointFormField, BreakpointFormDefinition, BreakpointFormSubmission, BreakpointSla, BreakpointMetrics, NotificationProvider, NotificationConfig, EscalationStep, EscalationChain, BreakpointTransitionValidation, Breakpoint, BreakpointWaitResult, ProvenBreakpointAnswer, ProvenVerificationResult, ExpertiseArea, BreakpointBrowserSession, BreakpointSessionView, ServerBackendConfig, GitHubIssuesBackendConfig, ExternalTrackerProvider, ExternalTrackerStatus, ExternalTrackerSyncDirection, ExternalTrackerConflictStrategy, ExternalTrackerAuthConfig, ExternalTrackerFieldMapping, ExternalTrackerWebhookConfig, ExternalTrackerBackendConfig, AgentMuxBackendConfig, GitHubRepo, ProjectMember, TeamMember, TeamInvitation, Team, KnownUser, Project, ProjectSummary, BackendConfig, RoutingRule, RoutingConfig, } from "./types.js";
|
|
3
|
+
export { TaskRouter, routeTask, routingHints, isHostDelegableRoute, } from "./router.js";
|
|
4
|
+
export type { RoutableTaskDef, TaskRouteContext, TaskRouteDecision, } from "./router.js";
|
|
5
|
+
export type { Responder, BaseResponder, HumanResponder, AgentResponder, TrackerResponder, InternalResponder, TaskRoutingHints, RoutedResponder, } from "./responders/types.js";
|
|
6
|
+
export type { AddBreakpointCommentParams, AssignBreakpointParams, BreakpointBackend, BreakpointBackendCapabilities, BreakpointExport, BreakpointMetricsSummary, BreakpointSearchQuery, BulkBreakpointOperationResult, BulkUpdateBreakpointItemResult, BulkUpdateBreakpointsParams, SubmitBreakpointParams, SearchBreakpointsResult, TransitionBreakpointParams, WaitForAnswerOptions, SubmitAnswerParams, ListRespondersParams, } from "./backend.js";
|
|
7
|
+
export { UnsupportedBreakpointFeatureError, unsupportedBreakpointBackendCapabilities, unsupportedBreakpointFeature, } from "./backend.js";
|
|
8
|
+
export { createBackend, createDefaultBackend, resolveBackend, matchRoute, registerBackendFactory, listRegisteredBackends, } from "./backends/index.js";
|
|
9
|
+
export type { BackendFactory } from "./backends/index.js";
|
|
10
|
+
export { GitNativeBackend } from "./backends/git-native.js";
|
|
11
|
+
export type { GitNativeBackendOptions } from "./backends/git-native.js";
|
|
12
|
+
export { GitHubIssuesBackend, getGitHubToken, parseAnswerFromComment } from "./backends/github-issues.js";
|
|
13
|
+
export { ExternalTrackerBackend, GenericRestTrackerAdapter, JiraTrackerAdapter, LinearTrackerAdapter, createExternalTrackerAdapter, redactExternalTrackerSecrets, } from "./backends/external-tracker.js";
|
|
14
|
+
export type { ExternalTrackerAdapter, ExternalTrackerComment, ExternalTrackerCreateIssueInput, ExternalTrackerIssue, ExternalTrackerReference, ExternalTrackerWebhookEvent, ExternalTrackerWebhookResult, } from "./backends/external-tracker.js";
|
|
15
|
+
export { ServerBreakpointBackend, ServerBackendError } from "./backends/server.js";
|
|
16
|
+
export type { ServerBreakpointBackendConfig } from "./backends/server.js";
|
|
17
|
+
export { AgentMuxResponderBackend, AgentMuxResponderBackendError, } from "./backends/adapters.js";
|
|
18
|
+
export type { AgentMuxClientLike, AgentMuxResponderBackendConfig, AgentMuxRunHandleLike, AgentMuxRunOptions, AgentMuxRunResult, } from "./backends/adapters.js";
|
|
19
|
+
export { generateKeyPair, saveTrustedPublicKey, savePrivateKey, loadTrustedPublicKeys, loadPrivateKey, rotateKey, signAnswer, signAnswerWithKeyRecord, verifyAnswer, } from "./proven/index.js";
|
|
20
|
+
export type { KeyPairMetadata, PublicKeyRecord, PrivateKeyRecord, } from "./proven/index.js";
|
|
21
|
+
export { createBreakpointMcpServer, startBreakpointMcpServer, } from "./mcp/index.js";
|
|
22
|
+
export { handleCreateTodo, createTodoDescription, createTodoParams, handleAssignTask, assignTaskDescription, assignTaskParams, handleSearchTasks, searchTasksDescription, searchTasksParams, handleAddComment, addCommentDescription, addCommentParams, handleBulkUpdateTasks, bulkUpdateTasksDescription, bulkUpdateTasksParams, handleTaskStats, taskStatsDescription, taskStatsParams, handleExportTasks, exportTasksDescription, exportTasksParams, handleEscalate, escalateDescription, escalateParams, } from "./mcp/index.js";
|
|
23
|
+
export type { NativeTaskResult, SearchTasksResult, } from "./mcp/index.js";
|
|
24
|
+
export { BreakpointMuxInteractionProvider, loadRoutingConfig, } from "./harness/index.js";
|
|
25
|
+
export type { BreakpointMuxProviderOptions } from "./harness/index.js";
|
|
26
|
+
export { resolveRepositoryRoot, resolveConfigRoot, resolveResponderDirectory, resolveRoutingConfigPath, loadRoutingConfigSync, } from "./config.js";
|
|
27
|
+
export type { RepoConfigResolutionOptions } from "./config.js";
|
|
28
|
+
export * from "./client/index.js";
|
|
29
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,sBAAsB,EACtB,wBAAwB,EACxB,mBAAmB,EACnB,aAAa,EACb,kBAAkB,EAClB,qBAAqB,EACrB,iBAAiB,EACjB,2BAA2B,EAC3B,8BAA8B,EAC9B,+BAA+B,EAC/B,uBAAuB,EACvB,uBAAuB,EACvB,sBAAsB,EACtB,4BAA4B,EAC5B,oBAAoB,EACpB,sBAAsB,EACtB,yBAAyB,EACzB,0BAA0B,EAC1B,uBAAuB,EACvB,4BAA4B,EAC5B,0BAA0B,EAC1B,yBAAyB,EACzB,8BAA8B,EAC9B,8BAA8B,EAC9B,mBAAmB,EACnB,uBAAuB,EACvB,0BAA0B,EAC1B,wBAAwB,EACxB,oBAAoB,EACpB,qBAAqB,EACrB,gBAAgB,EAChB,0BAA0B,EAC1B,4BAA4B,EAC5B,8BAA8B,EAC9B,mBAAmB,EACnB,8BAA8B,EAC9B,2BAA2B,EAC3B,4BAA4B,EAC5B,yBAAyB,EACzB,+BAA+B,EAC/B,6BAA6B,EAC7B,2BAA2B,EAC3B,kCAAkC,EAClC,qCAAqC,EACrC,+BAA+B,EAC/B,iCAAiC,EACjC,kCAAkC,EAClC,kCAAkC,EAClC,2BAA2B,EAC3B,mBAAmB,EACnB,iBAAiB,EACjB,mBAAmB,EAEnB,wBAAwB,EACxB,kBAAkB,EAClB,eAAe,EACf,oBAAoB,EACpB,4BAA4B,EAC5B,4BAA4B,EAE5B,oBAAoB,EACpB,4BAA4B,GAC7B,MAAM,YAAY,CAAC;AAEpB,YAAY,EACV,gBAAgB,EAChB,kBAAkB,EAClB,aAAa,EACb,OAAO,EACP,YAAY,EACZ,eAAe,EACf,WAAW,EACX,qBAAqB,EACrB,wBAAwB,EACxB,yBAAyB,EACzB,iBAAiB,EACjB,iBAAiB,EACjB,gBAAgB,EAChB,sBAAsB,EACtB,cAAc,EACd,gBAAgB,EAChB,mBAAmB,EACnB,oBAAoB,EACpB,iBAAiB,EACjB,sBAAsB,EACtB,oBAAoB,EACpB,mBAAmB,EACnB,wBAAwB,EACxB,wBAAwB,EACxB,aAAa,EACb,iBAAiB,EACjB,oBAAoB,EACpB,kBAAkB,EAClB,cAAc,EACd,eAAe,EACf,8BAA8B,EAC9B,UAAU,EACV,oBAAoB,EACpB,sBAAsB,EACtB,wBAAwB,EACxB,aAAa,EACb,wBAAwB,EACxB,qBAAqB,EACrB,mBAAmB,EACnB,yBAAyB,EACzB,uBAAuB,EACvB,qBAAqB,EACrB,4BAA4B,EAC5B,+BAA+B,EAC/B,yBAAyB,EACzB,2BAA2B,EAC3B,4BAA4B,EAC5B,4BAA4B,EAC5B,qBAAqB,EACrB,UAAU,EACV,aAAa,EACb,UAAU,EACV,cAAc,EACd,IAAI,EACJ,SAAS,EACT,OAAO,EACP,cAAc,EACd,aAAa,EACb,WAAW,EACX,aAAa,GACd,MAAM,YAAY,CAAC;AAEpB,OAAO,EACL,UAAU,EACV,SAAS,EACT,YAAY,EACZ,oBAAoB,GACrB,MAAM,aAAa,CAAC;AAErB,YAAY,EACV,eAAe,EACf,gBAAgB,EAChB,iBAAiB,GAClB,MAAM,aAAa,CAAC;AAErB,YAAY,EACV,SAAS,EACT,aAAa,EACb,cAAc,EACd,cAAc,EACd,gBAAgB,EAChB,iBAAiB,EACjB,gBAAgB,EAChB,eAAe,GAChB,MAAM,uBAAuB,CAAC;AAG/B,YAAY,EACV,0BAA0B,EAC1B,sBAAsB,EACtB,iBAAiB,EACjB,6BAA6B,EAC7B,gBAAgB,EAChB,wBAAwB,EACxB,qBAAqB,EACrB,6BAA6B,EAC7B,8BAA8B,EAC9B,2BAA2B,EAC3B,sBAAsB,EACtB,uBAAuB,EACvB,0BAA0B,EAC1B,oBAAoB,EACpB,kBAAkB,EAClB,oBAAoB,GACrB,MAAM,cAAc,CAAC;AAEtB,OAAO,EACL,iCAAiC,EACjC,wCAAwC,EACxC,4BAA4B,GAC7B,MAAM,cAAc,CAAC;AAGtB,OAAO,EACL,aAAa,EACb,oBAAoB,EACpB,cAAc,EACd,UAAU,EACV,sBAAsB,EACtB,sBAAsB,GACvB,MAAM,qBAAqB,CAAC;AAE7B,YAAY,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAG1D,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC5D,YAAY,EAAE,uBAAuB,EAAE,MAAM,0BAA0B,CAAC;AAGxE,OAAO,EAAE,mBAAmB,EAAE,cAAc,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AAG1G,OAAO,EACL,sBAAsB,EACtB,yBAAyB,EACzB,kBAAkB,EAClB,oBAAoB,EACpB,4BAA4B,EAC5B,4BAA4B,GAC7B,MAAM,gCAAgC,CAAC;AAExC,YAAY,EACV,sBAAsB,EACtB,sBAAsB,EACtB,+BAA+B,EAC/B,oBAAoB,EACpB,wBAAwB,EACxB,2BAA2B,EAC3B,4BAA4B,GAC7B,MAAM,gCAAgC,CAAC;AAGxC,OAAO,EAAE,uBAAuB,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AACnF,YAAY,EAAE,6BAA6B,EAAE,MAAM,sBAAsB,CAAC;AAG1E,OAAO,EACL,wBAAwB,EACxB,6BAA6B,GAC9B,MAAM,wBAAwB,CAAC;AAChC,YAAY,EACV,kBAAkB,EAClB,8BAA8B,EAC9B,qBAAqB,EACrB,kBAAkB,EAClB,iBAAiB,GAClB,MAAM,wBAAwB,CAAC;AAGhC,OAAO,EACL,eAAe,EACf,oBAAoB,EACpB,cAAc,EACd,qBAAqB,EACrB,cAAc,EACd,SAAS,EACT,UAAU,EACV,uBAAuB,EACvB,YAAY,GACb,MAAM,mBAAmB,CAAC;AAE3B,YAAY,EACV,eAAe,EACf,eAAe,EACf,gBAAgB,GACjB,MAAM,mBAAmB,CAAC;AAG3B,OAAO,EACL,yBAAyB,EACzB,wBAAwB,GACzB,MAAM,gBAAgB,CAAC;AAExB,OAAO,EACL,gBAAgB,EAChB,qBAAqB,EACrB,gBAAgB,EAChB,gBAAgB,EAChB,qBAAqB,EACrB,gBAAgB,EAChB,iBAAiB,EACjB,sBAAsB,EACtB,iBAAiB,EACjB,gBAAgB,EAChB,qBAAqB,EACrB,gBAAgB,EAChB,qBAAqB,EACrB,0BAA0B,EAC1B,qBAAqB,EACrB,eAAe,EACf,oBAAoB,EACpB,eAAe,EACf,iBAAiB,EACjB,sBAAsB,EACtB,iBAAiB,EACjB,cAAc,EACd,mBAAmB,EACnB,cAAc,GACf,MAAM,gBAAgB,CAAC;AAExB,YAAY,EACV,gBAAgB,EAChB,iBAAiB,GAClB,MAAM,gBAAgB,CAAC;AAGxB,OAAO,EACL,gCAAgC,EAChC,iBAAiB,GAClB,MAAM,oBAAoB,CAAC;AAE5B,YAAY,EAAE,4BAA4B,EAAE,MAAM,oBAAoB,CAAC;AAGvE,OAAO,EACL,qBAAqB,EACrB,iBAAiB,EACjB,yBAAyB,EACzB,wBAAwB,EACxB,qBAAqB,GACtB,MAAM,aAAa,CAAC;AAErB,YAAY,EAAE,2BAA2B,EAAE,MAAM,aAAa,CAAC;AAG/D,cAAc,mBAAmB,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
// ── Types and Schemas ────────────────────────────────────────────────────
|
|
2
|
+
export {
|
|
3
|
+
// Zod schemas
|
|
4
|
+
BreakpointStatusSchema, BreakpointStrategySchema, ResponderTypeSchema, UrgencySchema, TaskPrioritySchema, InteractionKindSchema, CodeSnippetSchema, BreakpointContextLinkSchema, BreakpointContextSectionSchema, BreakpointContextArtifactSchema, BreakpointContextSchema, BreakpointRoutingSchema, ResponderProfileSchema, BreakpointAnswerRatingSchema, DecisionMemorySchema, BreakpointAnswerSchema, BreakpointSubmitterSchema, BreakpointDependencySchema, BreakpointCommentSchema, BreakpointHistoryEntrySchema, BreakpointAuditEntrySchema, BreakpointFormFieldSchema, BreakpointFormDefinitionSchema, BreakpointFormSubmissionSchema, BreakpointSlaSchema, BreakpointMetricsSchema, NotificationProviderSchema, NotificationConfigSchema, EscalationStepSchema, EscalationChainSchema, BreakpointSchema, BreakpointWaitResultSchema, ProvenBreakpointAnswerSchema, ProvenVerificationResultSchema, ExpertiseAreaSchema, BreakpointBrowserSessionSchema, BreakpointSessionViewSchema, GitNativeBackendConfigSchema, ServerBackendConfigSchema, GitHubIssuesBackendConfigSchema, ExternalTrackerProviderSchema, ExternalTrackerStatusSchema, ExternalTrackerSyncDirectionSchema, ExternalTrackerConflictStrategySchema, ExternalTrackerAuthConfigSchema, ExternalTrackerFieldMappingSchema, ExternalTrackerWebhookConfigSchema, ExternalTrackerBackendConfigSchema, AgentMuxBackendConfigSchema, BackendConfigSchema, RoutingRuleSchema, RoutingConfigSchema,
|
|
5
|
+
// Constants
|
|
6
|
+
DEFAULT_POLL_INTERVAL_MS, DEFAULT_TIMEOUT_MS, BREAKPOINTS_DIR, BREAKPOINTS_KEYS_DIR, BREAKPOINTS_TRUSTED_KEYS_DIR, BREAKPOINTS_PRIVATE_KEYS_DIR,
|
|
7
|
+
// Utility
|
|
8
|
+
generateBreakpointId, validateBreakpointTransition, } from "./types.js";
|
|
9
|
+
export { TaskRouter, routeTask, routingHints, isHostDelegableRoute, } from "./router.js";
|
|
10
|
+
export { UnsupportedBreakpointFeatureError, unsupportedBreakpointBackendCapabilities, unsupportedBreakpointFeature, } from "./backend.js";
|
|
11
|
+
// ── Backend Factory ──────────────────────────────────────────────────────
|
|
12
|
+
export { createBackend, createDefaultBackend, resolveBackend, matchRoute, registerBackendFactory, listRegisteredBackends, } from "./backends/index.js";
|
|
13
|
+
// ── Git-Native Backend ──────────────────────────────────────────────
|
|
14
|
+
export { GitNativeBackend } from "./backends/git-native.js";
|
|
15
|
+
// ── GitHub Issues Backend ──────────────────────────────────────────
|
|
16
|
+
export { GitHubIssuesBackend, getGitHubToken, parseAnswerFromComment } from "./backends/github-issues.js";
|
|
17
|
+
// ── External Tracker Backend ───────────────────────────────────────
|
|
18
|
+
export { ExternalTrackerBackend, GenericRestTrackerAdapter, JiraTrackerAdapter, LinearTrackerAdapter, createExternalTrackerAdapter, redactExternalTrackerSecrets, } from "./backends/external-tracker.js";
|
|
19
|
+
// ── Server Backend ─────────────────────────────────────────────────
|
|
20
|
+
export { ServerBreakpointBackend, ServerBackendError } from "./backends/server.js";
|
|
21
|
+
// ── Agent Adapter Backend ──────────────────────────────────────────────
|
|
22
|
+
export { AgentMuxResponderBackend, AgentMuxResponderBackendError, } from "./backends/adapters.js";
|
|
23
|
+
// ── Proven Breakpoints ──────────────────────────────────────────────
|
|
24
|
+
export { generateKeyPair, saveTrustedPublicKey, savePrivateKey, loadTrustedPublicKeys, loadPrivateKey, rotateKey, signAnswer, signAnswerWithKeyRecord, verifyAnswer, } from "./proven/index.js";
|
|
25
|
+
// ── MCP Server ──────────────────────────────────────────────────────
|
|
26
|
+
export { createBreakpointMcpServer, startBreakpointMcpServer, } from "./mcp/index.js";
|
|
27
|
+
export { handleCreateTodo, createTodoDescription, createTodoParams, handleAssignTask, assignTaskDescription, assignTaskParams, handleSearchTasks, searchTasksDescription, searchTasksParams, handleAddComment, addCommentDescription, addCommentParams, handleBulkUpdateTasks, bulkUpdateTasksDescription, bulkUpdateTasksParams, handleTaskStats, taskStatsDescription, taskStatsParams, handleExportTasks, exportTasksDescription, exportTasksParams, handleEscalate, escalateDescription, escalateParams, } from "./mcp/index.js";
|
|
28
|
+
// ── Harness Integration ─────────────────────────────────────────────
|
|
29
|
+
export { BreakpointMuxInteractionProvider, loadRoutingConfig, } from "./harness/index.js";
|
|
30
|
+
// ── Config Utilities ────────────────────────────────────────────────
|
|
31
|
+
export { resolveRepositoryRoot, resolveConfigRoot, resolveResponderDirectory, resolveRoutingConfigPath, loadRoutingConfigSync, } from "./config.js";
|
|
32
|
+
// ── Client Classes ─────────────────────────────────────────────────
|
|
33
|
+
export * from "./client/index.js";
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import type { BreakpointBackend } from "../backend.js";
|
|
2
|
+
/**
|
|
3
|
+
* Context used for matching a breakpoint against routing rules.
|
|
4
|
+
*/
|
|
5
|
+
export interface BackendResolveContext {
|
|
6
|
+
/** Domain of the breakpoint (e.g. "backend", "security"). */
|
|
7
|
+
domain?: string;
|
|
8
|
+
/** Tags on the breakpoint. */
|
|
9
|
+
tags?: string[];
|
|
10
|
+
/** Explicit backend override from the MCP tool params. */
|
|
11
|
+
explicitBackend?: string;
|
|
12
|
+
/** Explicit git-native breakpoints directory override from the MCP tool params. */
|
|
13
|
+
breakpointsDir?: string;
|
|
14
|
+
/** Explicit config root override. */
|
|
15
|
+
configRoot?: string;
|
|
16
|
+
}
|
|
17
|
+
export interface ResolvedBackend {
|
|
18
|
+
/** The resolved backend instance. */
|
|
19
|
+
backend: BreakpointBackend;
|
|
20
|
+
/**
|
|
21
|
+
* "explicit-override" when MCP params force the choice,
|
|
22
|
+
* "routed" when a routing rule matched,
|
|
23
|
+
* "env-override" when BMUX_BACKEND forced the choice,
|
|
24
|
+
* "default" when falling back to git-native.
|
|
25
|
+
*/
|
|
26
|
+
source: "explicit-override" | "routed" | "env-override" | "default";
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Resolve the appropriate BreakpointBackend for a request.
|
|
30
|
+
*
|
|
31
|
+
* Resolution order:
|
|
32
|
+
* 1. Explicit MCP param override.
|
|
33
|
+
* 1. BMUX_BACKEND env var -- forces a specific backend type.
|
|
34
|
+
* For "git-native" this uses the default git-native backend.
|
|
35
|
+
* For "github-issues" this requires a routing config to be present
|
|
36
|
+
* (to know which repo/owner/labels to use).
|
|
37
|
+
* 2. BMUX_BACKEND env var -- forces a specific backend type.
|
|
38
|
+
* 3. `.a5c/routing.json` -- if present and a rule matches the
|
|
39
|
+
* breakpoint's domain/tags, create the backend from the rule.
|
|
40
|
+
* 4. Fall back to git-native backend (default behaviour).
|
|
41
|
+
*/
|
|
42
|
+
export declare function resolveBreakpointBackend(ctx?: BackendResolveContext): ResolvedBackend;
|
|
43
|
+
//# sourceMappingURL=backend-resolver.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"backend-resolver.d.ts","sourceRoot":"","sources":["../../src/mcp/backend-resolver.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAkBvD;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC,6DAA6D;IAC7D,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,8BAA8B;IAC9B,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,0DAA0D;IAC1D,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,mFAAmF;IACnF,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,qCAAqC;IACrC,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,eAAe;IAC9B,qCAAqC;IACrC,OAAO,EAAE,iBAAiB,CAAC;IAC3B;;;;;OAKG;IACH,MAAM,EAAE,mBAAmB,GAAG,QAAQ,GAAG,cAAc,GAAG,SAAS,CAAC;CACrE;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,wBAAwB,CACtC,GAAG,GAAE,qBAA0B,GAC9B,eAAe,CAwEjB"}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import { createBackend, createDefaultBackend, matchRoute } from "../backends/index.js";
|
|
2
|
+
import { loadRoutingConfigSync } from "../config.js";
|
|
3
|
+
/**
|
|
4
|
+
* Build a minimal BreakpointContext suitable for routing resolution.
|
|
5
|
+
*/
|
|
6
|
+
function buildRoutingContext(ctx) {
|
|
7
|
+
return {
|
|
8
|
+
description: "",
|
|
9
|
+
codeSnippets: [],
|
|
10
|
+
fileReferences: [],
|
|
11
|
+
tags: ctx.tags ?? [],
|
|
12
|
+
domain: ctx.domain,
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Resolve the appropriate BreakpointBackend for a request.
|
|
17
|
+
*
|
|
18
|
+
* Resolution order:
|
|
19
|
+
* 1. Explicit MCP param override.
|
|
20
|
+
* 1. BMUX_BACKEND env var -- forces a specific backend type.
|
|
21
|
+
* For "git-native" this uses the default git-native backend.
|
|
22
|
+
* For "github-issues" this requires a routing config to be present
|
|
23
|
+
* (to know which repo/owner/labels to use).
|
|
24
|
+
* 2. BMUX_BACKEND env var -- forces a specific backend type.
|
|
25
|
+
* 3. `.a5c/routing.json` -- if present and a rule matches the
|
|
26
|
+
* breakpoint's domain/tags, create the backend from the rule.
|
|
27
|
+
* 4. Fall back to git-native backend (default behaviour).
|
|
28
|
+
*/
|
|
29
|
+
export function resolveBreakpointBackend(ctx = {}) {
|
|
30
|
+
if (ctx.explicitBackend) {
|
|
31
|
+
if (ctx.explicitBackend === "git-native") {
|
|
32
|
+
return {
|
|
33
|
+
backend: createBackend("git-native", {
|
|
34
|
+
breakpointsDir: ctx.breakpointsDir,
|
|
35
|
+
}),
|
|
36
|
+
source: "explicit-override",
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
const routingConfig = loadRoutingConfigSync(ctx.configRoot);
|
|
40
|
+
if (routingConfig) {
|
|
41
|
+
const matched = matchRouteForBackendType(routingConfig, ctx.explicitBackend, ctx);
|
|
42
|
+
if (matched) {
|
|
43
|
+
return { backend: matched, source: "explicit-override" };
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
throw new Error(`Explicit backend "${ctx.explicitBackend}" could not be resolved. ` +
|
|
47
|
+
"Define a matching backend in routing.json or use backend=\"git-native\".");
|
|
48
|
+
}
|
|
49
|
+
const envBackend = process.env.BMUX_BACKEND;
|
|
50
|
+
// -- 1. Env override ---------------------------------------------------
|
|
51
|
+
if (envBackend) {
|
|
52
|
+
if (envBackend === "git-native") {
|
|
53
|
+
return {
|
|
54
|
+
backend: createDefaultBackend({ breakpointsDir: ctx.breakpointsDir }),
|
|
55
|
+
source: "env-override",
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
// For non-default backends we need routing config to know the target details.
|
|
59
|
+
const routingConfig = loadRoutingConfigSync(ctx.configRoot);
|
|
60
|
+
if (routingConfig) {
|
|
61
|
+
const matched = matchRouteForBackendType(routingConfig, envBackend, ctx);
|
|
62
|
+
if (matched) {
|
|
63
|
+
return { backend: matched, source: "env-override" };
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
// If env says github-issues but no routing config, that is a misconfiguration.
|
|
67
|
+
// Fall through to default so we do not break.
|
|
68
|
+
}
|
|
69
|
+
// -- 2. Routing config -------------------------------------------------
|
|
70
|
+
const routingConfig = loadRoutingConfigSync(ctx.configRoot);
|
|
71
|
+
if (routingConfig) {
|
|
72
|
+
const backendName = matchRoute(routingConfig, buildRoutingContext(ctx));
|
|
73
|
+
if (backendName !== "git-native") {
|
|
74
|
+
// Find the route that matched to extract its config
|
|
75
|
+
for (const rule of routingConfig.routes) {
|
|
76
|
+
if (rule.backend === backendName) {
|
|
77
|
+
const backend = createBackend(rule.backendConfig.type, rule.backendConfig);
|
|
78
|
+
return { backend, source: "routed" };
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
// -- 3. Default backend ------------------------------------------------
|
|
84
|
+
return {
|
|
85
|
+
backend: createDefaultBackend({ breakpointsDir: ctx.breakpointsDir }),
|
|
86
|
+
source: "default",
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Find the first routing rule whose backendConfig.type matches the given
|
|
91
|
+
* backend type and (optionally) matches the breakpoint context.
|
|
92
|
+
*/
|
|
93
|
+
function matchRouteForBackendType(routingConfig, backendType, ctx) {
|
|
94
|
+
// Try context-aware match first
|
|
95
|
+
if (ctx.domain || (ctx.tags && ctx.tags.length > 0)) {
|
|
96
|
+
const matchedName = matchRoute(routingConfig, buildRoutingContext(ctx));
|
|
97
|
+
for (const rule of routingConfig.routes) {
|
|
98
|
+
if (rule.backend === matchedName &&
|
|
99
|
+
rule.backendConfig.type === backendType) {
|
|
100
|
+
return createBackend(backendType, rule.backendConfig);
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
// Fall back to first rule with the requested type
|
|
105
|
+
for (const rule of routingConfig.routes) {
|
|
106
|
+
if (rule.backendConfig.type === backendType) {
|
|
107
|
+
return createBackend(backendType, rule.backendConfig);
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
return undefined;
|
|
111
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { type Server } from "node:http";
|
|
2
|
+
import { StreamableHTTPServerTransport } from "@modelcontextprotocol/sdk/server/streamableHttp.js";
|
|
3
|
+
import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
4
|
+
export interface HttpMcpServerOptions {
|
|
5
|
+
/** Port to listen on. Defaults to BPX_MCP_PORT env var or 3848. */
|
|
6
|
+
port?: number;
|
|
7
|
+
/** Bearer token for authentication. Defaults to BPX_MCP_TOKEN env var. */
|
|
8
|
+
bearerToken?: string;
|
|
9
|
+
/** Enable stateful sessions (generates session IDs). Defaults to true. */
|
|
10
|
+
stateful?: boolean;
|
|
11
|
+
/** Enable JSON responses instead of SSE streams. Defaults to false. */
|
|
12
|
+
enableJsonResponse?: boolean;
|
|
13
|
+
}
|
|
14
|
+
export interface HttpMcpServerResult {
|
|
15
|
+
/** The underlying Node.js HTTP server. */
|
|
16
|
+
httpServer: Server;
|
|
17
|
+
/** The StreamableHTTPServerTransport instance. */
|
|
18
|
+
transport: StreamableHTTPServerTransport;
|
|
19
|
+
/** The resolved port the server is listening on. */
|
|
20
|
+
port: number;
|
|
21
|
+
/** Close the server and transport gracefully. */
|
|
22
|
+
close: () => Promise<void>;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Create an HTTP server that serves the MCP protocol via Streamable HTTP transport.
|
|
26
|
+
*
|
|
27
|
+
* The server provides:
|
|
28
|
+
* - POST/GET/DELETE /mcp -- MCP Streamable HTTP transport endpoint
|
|
29
|
+
* - GET /healthz -- health check endpoint
|
|
30
|
+
* - Bearer token authentication on /mcp routes (when token is configured)
|
|
31
|
+
*/
|
|
32
|
+
export declare function createHttpMcpServer(mcpServer: McpServer, options?: HttpMcpServerOptions): HttpMcpServerResult;
|
|
33
|
+
/**
|
|
34
|
+
* Create and start an HTTP MCP server, returning when it is listening.
|
|
35
|
+
*/
|
|
36
|
+
export declare function startHttpMcpServer(mcpServer: McpServer, options?: HttpMcpServerOptions): Promise<HttpMcpServerResult>;
|
|
37
|
+
//# sourceMappingURL=http-transport.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"http-transport.d.ts","sourceRoot":"","sources":["../../src/mcp/http-transport.ts"],"names":[],"mappings":"AAAA,OAAO,EAA2D,KAAK,MAAM,EAAE,MAAM,WAAW,CAAC;AAEjG,OAAO,EAAE,6BAA6B,EAAE,MAAM,oDAAoD,CAAC;AACnG,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAUzE,MAAM,WAAW,oBAAoB;IACnC,mEAAmE;IACnE,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,0EAA0E;IAC1E,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,0EAA0E;IAC1E,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,uEAAuE;IACvE,kBAAkB,CAAC,EAAE,OAAO,CAAC;CAC9B;AAED,MAAM,WAAW,mBAAmB;IAClC,0CAA0C;IAC1C,UAAU,EAAE,MAAM,CAAC;IACnB,kDAAkD;IAClD,SAAS,EAAE,6BAA6B,CAAC;IACzC,oDAAoD;IACpD,IAAI,EAAE,MAAM,CAAC;IACb,iDAAiD;IACjD,KAAK,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CAC5B;AAgCD;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,CACjC,SAAS,EAAE,SAAS,EACpB,OAAO,GAAE,oBAAyB,GACjC,mBAAmB,CAgErB;AAED;;GAEG;AACH,wBAAsB,kBAAkB,CACtC,SAAS,EAAE,SAAS,EACpB,OAAO,GAAE,oBAAyB,GACjC,OAAO,CAAC,mBAAmB,CAAC,CAU9B"}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { createServer } from "node:http";
|
|
2
|
+
import { randomUUID } from "node:crypto";
|
|
3
|
+
import { StreamableHTTPServerTransport } from "@modelcontextprotocol/sdk/server/streamableHttp.js";
|
|
4
|
+
// ── Constants ──────────────────────────────────────────────────────────────
|
|
5
|
+
const DEFAULT_MCP_HTTP_PORT = 3848;
|
|
6
|
+
const MCP_PATH = "/mcp";
|
|
7
|
+
const HEALTH_PATH = "/healthz";
|
|
8
|
+
// ── Bearer Token Auth ──────────────────────────────────────────────────────
|
|
9
|
+
function validateBearerToken(req, expectedToken) {
|
|
10
|
+
const authHeader = req.headers.authorization;
|
|
11
|
+
if (!authHeader) {
|
|
12
|
+
return { valid: false, error: "Missing Authorization header" };
|
|
13
|
+
}
|
|
14
|
+
if (!authHeader.startsWith("Bearer ")) {
|
|
15
|
+
return { valid: false, error: "Authorization header must use Bearer scheme" };
|
|
16
|
+
}
|
|
17
|
+
const token = authHeader.slice(7);
|
|
18
|
+
if (token !== expectedToken) {
|
|
19
|
+
return { valid: false, error: "Invalid bearer token" };
|
|
20
|
+
}
|
|
21
|
+
return { valid: true };
|
|
22
|
+
}
|
|
23
|
+
function sendJsonError(res, statusCode, message) {
|
|
24
|
+
res.writeHead(statusCode, { "Content-Type": "application/json" });
|
|
25
|
+
res.end(JSON.stringify({ error: message }));
|
|
26
|
+
}
|
|
27
|
+
// ── HTTP Server Factory ────────────────────────────────────────────────────
|
|
28
|
+
/**
|
|
29
|
+
* Create an HTTP server that serves the MCP protocol via Streamable HTTP transport.
|
|
30
|
+
*
|
|
31
|
+
* The server provides:
|
|
32
|
+
* - POST/GET/DELETE /mcp -- MCP Streamable HTTP transport endpoint
|
|
33
|
+
* - GET /healthz -- health check endpoint
|
|
34
|
+
* - Bearer token authentication on /mcp routes (when token is configured)
|
|
35
|
+
*/
|
|
36
|
+
export function createHttpMcpServer(mcpServer, options = {}) {
|
|
37
|
+
const port = options.port ?? (process.env.BPX_MCP_PORT ? parseInt(process.env.BPX_MCP_PORT, 10) : DEFAULT_MCP_HTTP_PORT);
|
|
38
|
+
const bearerToken = options.bearerToken ?? process.env.BPX_MCP_TOKEN;
|
|
39
|
+
const stateful = options.stateful ?? true;
|
|
40
|
+
const transport = new StreamableHTTPServerTransport({
|
|
41
|
+
sessionIdGenerator: stateful ? () => randomUUID() : undefined,
|
|
42
|
+
enableJsonResponse: options.enableJsonResponse ?? false,
|
|
43
|
+
});
|
|
44
|
+
const httpServer = createServer((req, res) => {
|
|
45
|
+
const url = new URL(req.url ?? "/", `http://localhost:${port}`);
|
|
46
|
+
const pathname = url.pathname;
|
|
47
|
+
// ── Health check (no auth required) ────────────────────────────────
|
|
48
|
+
if (pathname === HEALTH_PATH && req.method === "GET") {
|
|
49
|
+
res.writeHead(200, { "Content-Type": "application/json" });
|
|
50
|
+
res.end(JSON.stringify({ status: "ok", transport: "streamable-http" }));
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
// ── MCP endpoint ───────────────────────────────────────────────────
|
|
54
|
+
if (pathname === MCP_PATH) {
|
|
55
|
+
// Bearer token auth (if configured)
|
|
56
|
+
if (bearerToken) {
|
|
57
|
+
const authResult = validateBearerToken(req, bearerToken);
|
|
58
|
+
if (!authResult.valid) {
|
|
59
|
+
const statusCode = req.headers.authorization ? 403 : 401;
|
|
60
|
+
sendJsonError(res, statusCode, authResult.error);
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
// Delegate to the StreamableHTTPServerTransport
|
|
65
|
+
transport.handleRequest(req, res).catch((err) => {
|
|
66
|
+
const message = err instanceof Error ? err.message : "Internal server error";
|
|
67
|
+
if (!res.headersSent) {
|
|
68
|
+
sendJsonError(res, 500, message);
|
|
69
|
+
}
|
|
70
|
+
});
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
// ── 404 for everything else ────────────────────────────────────────
|
|
74
|
+
sendJsonError(res, 404, "Not found");
|
|
75
|
+
});
|
|
76
|
+
// Connect MCP server to transport (deferred to allow caller to set up listeners first)
|
|
77
|
+
const connectPromise = mcpServer.connect(transport);
|
|
78
|
+
const close = async () => {
|
|
79
|
+
await connectPromise;
|
|
80
|
+
await transport.close();
|
|
81
|
+
await new Promise((resolve, reject) => {
|
|
82
|
+
httpServer.close((err) => (err ? reject(err) : resolve()));
|
|
83
|
+
});
|
|
84
|
+
};
|
|
85
|
+
return {
|
|
86
|
+
httpServer,
|
|
87
|
+
transport,
|
|
88
|
+
port,
|
|
89
|
+
close,
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Create and start an HTTP MCP server, returning when it is listening.
|
|
94
|
+
*/
|
|
95
|
+
export async function startHttpMcpServer(mcpServer, options = {}) {
|
|
96
|
+
const result = createHttpMcpServer(mcpServer, options);
|
|
97
|
+
await new Promise((resolve) => {
|
|
98
|
+
result.httpServer.listen(result.port, () => {
|
|
99
|
+
resolve();
|
|
100
|
+
});
|
|
101
|
+
});
|
|
102
|
+
return result;
|
|
103
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export { createBreakpointMcpServer, startBreakpointMcpServer, startHttpBreakpointMcpServer, } from "./server.js";
|
|
2
|
+
export { createHttpMcpServer, startHttpMcpServer } from "./http-transport.js";
|
|
3
|
+
export type { HttpMcpServerOptions, HttpMcpServerResult } from "./http-transport.js";
|
|
4
|
+
export { handleAskBreakpoint, askBreakpointDescription, askBreakpointParams, } from "./tools/ask-breakpoint.js";
|
|
5
|
+
export { handleCheckBreakpointStatus, checkBreakpointStatusDescription, checkBreakpointStatusParams, } from "./tools/check-status.js";
|
|
6
|
+
export { handleListBreakpoints, listBreakpointsDescription, listBreakpointsParams, } from "./tools/list-breakpoints.js";
|
|
7
|
+
export { handleAnswerBreakpoint, answerBreakpointDescription, answerBreakpointParams, } from "./tools/answer-breakpoint.js";
|
|
8
|
+
export { handleVerifyBreakpointAnswer, verifyBreakpointAnswerDescription, verifyBreakpointAnswerParams, } from "./tools/verify-answer.js";
|
|
9
|
+
export { handleListResponders, listRespondersDescription, listRespondersParams, } from "./tools/list-responders.js";
|
|
10
|
+
export { handleClaimBreakpoint, claimBreakpointDescription, claimBreakpointParams, } from "./tools/claim-breakpoint.js";
|
|
11
|
+
export { handlePollBreakpoints, pollBreakpointsDescription, pollBreakpointsParams, } from "./tools/poll-breakpoints.js";
|
|
12
|
+
export { handleCreateTodo, createTodoDescription, createTodoParams, handleAssignTask, assignTaskDescription, assignTaskParams, handleSearchTasks, searchTasksDescription, searchTasksParams, handleAddComment, addCommentDescription, addCommentParams, handleBulkUpdateTasks, bulkUpdateTasksDescription, bulkUpdateTasksParams, handleTaskStats, taskStatsDescription, taskStatsParams, handleExportTasks, exportTasksDescription, exportTasksParams, handleEscalate, escalateDescription, escalateParams, } from "./tools/native-tasks.js";
|
|
13
|
+
export type { NativeTaskResult, SearchTasksResult, } from "./tools/native-tasks.js";
|
|
14
|
+
export { resolveBreakpointBackend, } from "./backend-resolver.js";
|
|
15
|
+
export type { BackendResolveContext, ResolvedBackend, } from "./backend-resolver.js";
|
|
16
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/mcp/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,yBAAyB,EACzB,wBAAwB,EACxB,4BAA4B,GAC7B,MAAM,aAAa,CAAC;AAErB,OAAO,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAC9E,YAAY,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAErF,OAAO,EACL,mBAAmB,EACnB,wBAAwB,EACxB,mBAAmB,GACpB,MAAM,2BAA2B,CAAC;AAEnC,OAAO,EACL,2BAA2B,EAC3B,gCAAgC,EAChC,2BAA2B,GAC5B,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EACL,qBAAqB,EACrB,0BAA0B,EAC1B,qBAAqB,GACtB,MAAM,6BAA6B,CAAC;AAErC,OAAO,EACL,sBAAsB,EACtB,2BAA2B,EAC3B,sBAAsB,GACvB,MAAM,8BAA8B,CAAC;AAEtC,OAAO,EACL,4BAA4B,EAC5B,iCAAiC,EACjC,4BAA4B,GAC7B,MAAM,0BAA0B,CAAC;AAElC,OAAO,EACL,oBAAoB,EACpB,yBAAyB,EACzB,oBAAoB,GACrB,MAAM,4BAA4B,CAAC;AAEpC,OAAO,EACL,qBAAqB,EACrB,0BAA0B,EAC1B,qBAAqB,GACtB,MAAM,6BAA6B,CAAC;AAErC,OAAO,EACL,qBAAqB,EACrB,0BAA0B,EAC1B,qBAAqB,GACtB,MAAM,6BAA6B,CAAC;AAErC,OAAO,EACL,gBAAgB,EAChB,qBAAqB,EACrB,gBAAgB,EAChB,gBAAgB,EAChB,qBAAqB,EACrB,gBAAgB,EAChB,iBAAiB,EACjB,sBAAsB,EACtB,iBAAiB,EACjB,gBAAgB,EAChB,qBAAqB,EACrB,gBAAgB,EAChB,qBAAqB,EACrB,0BAA0B,EAC1B,qBAAqB,EACrB,eAAe,EACf,oBAAoB,EACpB,eAAe,EACf,iBAAiB,EACjB,sBAAsB,EACtB,iBAAiB,EACjB,cAAc,EACd,mBAAmB,EACnB,cAAc,GACf,MAAM,yBAAyB,CAAC;AAEjC,YAAY,EACV,gBAAgB,EAChB,iBAAiB,GAClB,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EACL,wBAAwB,GACzB,MAAM,uBAAuB,CAAC;AAE/B,YAAY,EACV,qBAAqB,EACrB,eAAe,GAChB,MAAM,uBAAuB,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export { createBreakpointMcpServer, startBreakpointMcpServer, startHttpBreakpointMcpServer, } from "./server.js";
|
|
2
|
+
export { createHttpMcpServer, startHttpMcpServer } from "./http-transport.js";
|
|
3
|
+
export { handleAskBreakpoint, askBreakpointDescription, askBreakpointParams, } from "./tools/ask-breakpoint.js";
|
|
4
|
+
export { handleCheckBreakpointStatus, checkBreakpointStatusDescription, checkBreakpointStatusParams, } from "./tools/check-status.js";
|
|
5
|
+
export { handleListBreakpoints, listBreakpointsDescription, listBreakpointsParams, } from "./tools/list-breakpoints.js";
|
|
6
|
+
export { handleAnswerBreakpoint, answerBreakpointDescription, answerBreakpointParams, } from "./tools/answer-breakpoint.js";
|
|
7
|
+
export { handleVerifyBreakpointAnswer, verifyBreakpointAnswerDescription, verifyBreakpointAnswerParams, } from "./tools/verify-answer.js";
|
|
8
|
+
export { handleListResponders, listRespondersDescription, listRespondersParams, } from "./tools/list-responders.js";
|
|
9
|
+
export { handleClaimBreakpoint, claimBreakpointDescription, claimBreakpointParams, } from "./tools/claim-breakpoint.js";
|
|
10
|
+
export { handlePollBreakpoints, pollBreakpointsDescription, pollBreakpointsParams, } from "./tools/poll-breakpoints.js";
|
|
11
|
+
export { handleCreateTodo, createTodoDescription, createTodoParams, handleAssignTask, assignTaskDescription, assignTaskParams, handleSearchTasks, searchTasksDescription, searchTasksParams, handleAddComment, addCommentDescription, addCommentParams, handleBulkUpdateTasks, bulkUpdateTasksDescription, bulkUpdateTasksParams, handleTaskStats, taskStatsDescription, taskStatsParams, handleExportTasks, exportTasksDescription, exportTasksParams, handleEscalate, escalateDescription, escalateParams, } from "./tools/native-tasks.js";
|
|
12
|
+
export { resolveBreakpointBackend, } from "./backend-resolver.js";
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
2
|
+
import type { HttpMcpServerOptions, HttpMcpServerResult } from "./http-transport.js";
|
|
3
|
+
/**
|
|
4
|
+
* Create a tasks-adapter MCP server with breakpoint, responder, and native task tools registered.
|
|
5
|
+
*/
|
|
6
|
+
export declare function createBreakpointMcpServer(): McpServer;
|
|
7
|
+
/**
|
|
8
|
+
* Start the tasks-adapter MCP server on stdio transport.
|
|
9
|
+
*/
|
|
10
|
+
export declare function startBreakpointMcpServer(): Promise<void>;
|
|
11
|
+
/**
|
|
12
|
+
* Start the tasks-adapter MCP server on HTTP transport with Streamable HTTP.
|
|
13
|
+
*
|
|
14
|
+
* The HTTP server provides:
|
|
15
|
+
* - POST/GET/DELETE /mcp -- MCP Streamable HTTP transport
|
|
16
|
+
* - GET /healthz -- health check
|
|
17
|
+
* - Bearer token authentication (when BPX_MCP_TOKEN is set or token is provided)
|
|
18
|
+
*/
|
|
19
|
+
export declare function startHttpBreakpointMcpServer(options?: HttpMcpServerOptions): Promise<HttpMcpServerResult>;
|
|
20
|
+
//# sourceMappingURL=server.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../src/mcp/server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAoB,MAAM,yCAAyC,CAAC;AAStF,OAAO,KAAK,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AA8GrF;;GAEG;AACH,wBAAgB,yBAAyB,IAAI,SAAS,CA2UrD;AAED;;GAEG;AACH,wBAAsB,wBAAwB,IAAI,OAAO,CAAC,IAAI,CAAC,CAI9D;AAED;;;;;;;GAOG;AACH,wBAAsB,4BAA4B,CAChD,OAAO,CAAC,EAAE,oBAAoB,GAC7B,OAAO,CAAC,mBAAmB,CAAC,CAK9B"}
|