@lushly-dev/afd-client 1.0.0 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +217 -34
- package/dist/backoff.d.ts +20 -0
- package/dist/backoff.d.ts.map +1 -0
- package/dist/backoff.js +42 -0
- package/dist/backoff.js.map +1 -0
- package/dist/client-errors.d.ts +39 -0
- package/dist/client-errors.d.ts.map +1 -0
- package/dist/client-errors.js +163 -0
- package/dist/client-errors.js.map +1 -0
- package/dist/client-events.d.ts +23 -0
- package/dist/client-events.d.ts.map +1 -0
- package/dist/client-events.js +47 -0
- package/dist/client-events.js.map +1 -0
- package/dist/client.d.ts +89 -31
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +364 -452
- package/dist/client.js.map +1 -1
- package/dist/direct-timeout.d.ts +22 -0
- package/dist/direct-timeout.d.ts.map +1 -0
- package/dist/direct-timeout.js +54 -0
- package/dist/direct-timeout.js.map +1 -0
- package/dist/direct-transport.d.ts +72 -0
- package/dist/direct-transport.d.ts.map +1 -0
- package/dist/direct-transport.js +231 -0
- package/dist/direct-transport.js.map +1 -0
- package/dist/direct-types.d.ts +108 -0
- package/dist/direct-types.d.ts.map +1 -0
- package/dist/direct-types.js +5 -0
- package/dist/direct-types.js.map +1 -0
- package/dist/direct-validation.d.ts +1 -1
- package/dist/direct-validation.d.ts.map +1 -1
- package/dist/direct-validation.js +4 -1
- package/dist/direct-validation.js.map +1 -1
- package/dist/direct.d.ts +62 -192
- package/dist/direct.d.ts.map +1 -1
- package/dist/direct.js +116 -450
- package/dist/direct.js.map +1 -1
- package/dist/handlers.d.ts.map +1 -1
- package/dist/handlers.js +24 -21
- package/dist/handlers.js.map +1 -1
- package/dist/handoff.d.ts +19 -6
- package/dist/handoff.d.ts.map +1 -1
- package/dist/handoff.js +112 -88
- package/dist/handoff.js.map +1 -1
- package/dist/index.d.ts +12 -7
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +10 -5
- package/dist/index.js.map +1 -1
- package/dist/mcp-session.d.ts +37 -0
- package/dist/mcp-session.d.ts.map +1 -0
- package/dist/mcp-session.js +159 -0
- package/dist/mcp-session.js.map +1 -0
- package/dist/mcp-stream.d.ts +59 -0
- package/dist/mcp-stream.d.ts.map +1 -0
- package/dist/mcp-stream.js +215 -0
- package/dist/mcp-stream.js.map +1 -0
- package/dist/request-abort.d.ts +3 -0
- package/dist/request-abort.d.ts.map +1 -0
- package/dist/request-abort.js +18 -0
- package/dist/request-abort.js.map +1 -0
- package/dist/result-parsing.d.ts +27 -0
- package/dist/result-parsing.d.ts.map +1 -0
- package/dist/result-parsing.js +107 -0
- package/dist/result-parsing.js.map +1 -0
- package/dist/sse-parser.d.ts +70 -0
- package/dist/sse-parser.d.ts.map +1 -0
- package/dist/sse-parser.js +159 -0
- package/dist/sse-parser.js.map +1 -0
- package/dist/transport.d.ts +53 -6
- package/dist/transport.d.ts.map +1 -1
- package/dist/transport.js +193 -40
- package/dist/transport.js.map +1 -1
- package/dist/types.d.ts +40 -10
- package/dist/types.d.ts.map +1 -1
- package/dist/unknown-tool.d.ts +28 -8
- package/dist/unknown-tool.d.ts.map +1 -1
- package/dist/unknown-tool.js +51 -52
- package/dist/unknown-tool.js.map +1 -1
- package/package.json +7 -7
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import { isBatchResult, isPipelineResult } from '@lushly-dev/afd-core';
|
|
2
|
+
export function getTextContent(result) {
|
|
3
|
+
return result.content
|
|
4
|
+
.filter((content) => content.type === 'text')
|
|
5
|
+
.map((content) => content.text)
|
|
6
|
+
.join('');
|
|
7
|
+
}
|
|
8
|
+
export function parseTextContent(result) {
|
|
9
|
+
const text = getTextContent(result);
|
|
10
|
+
try {
|
|
11
|
+
return JSON.parse(text);
|
|
12
|
+
}
|
|
13
|
+
catch {
|
|
14
|
+
return undefined;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
export function isCommandResult(value) {
|
|
18
|
+
return (typeof value === 'object' &&
|
|
19
|
+
value !== null &&
|
|
20
|
+
'success' in value &&
|
|
21
|
+
typeof value.success === 'boolean');
|
|
22
|
+
}
|
|
23
|
+
export function createBatchFailure(commands, startedAt, error, reasoning) {
|
|
24
|
+
return {
|
|
25
|
+
success: false,
|
|
26
|
+
results: [],
|
|
27
|
+
summary: {
|
|
28
|
+
total: commands.length,
|
|
29
|
+
successCount: 0,
|
|
30
|
+
failureCount: commands.length,
|
|
31
|
+
skippedCount: 0,
|
|
32
|
+
},
|
|
33
|
+
timing: {
|
|
34
|
+
startedAt,
|
|
35
|
+
completedAt: new Date().toISOString(),
|
|
36
|
+
totalMs: 0,
|
|
37
|
+
averageMs: 0,
|
|
38
|
+
},
|
|
39
|
+
confidence: 0,
|
|
40
|
+
reasoning,
|
|
41
|
+
error,
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* The error for a batch or pipeline whose request got no result: it timed out or the connection
|
|
46
|
+
* failed after the request may have reached the server, so some or all commands may have run.
|
|
47
|
+
*
|
|
48
|
+
* @param cause - The request error, already converted with `toCommandError()`
|
|
49
|
+
*/
|
|
50
|
+
export function outcomeUnknownError(cause, operation) {
|
|
51
|
+
return {
|
|
52
|
+
code: 'OUTCOME_UNKNOWN',
|
|
53
|
+
message: `No ${operation} result was received (${cause.message}). The server may have run some or all of its commands.`,
|
|
54
|
+
suggestion: `Check the effect of each command before retrying: running the ${operation} again can repeat writes that already happened.`,
|
|
55
|
+
retryable: false,
|
|
56
|
+
details: { cause: cause.code, ...cause.details },
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* A failed batch whose outcome is unknown. It reports no per-command statuses: `results` is
|
|
61
|
+
* empty and every summary count except `total` is zero, because no command is known to have
|
|
62
|
+
* failed or succeeded.
|
|
63
|
+
*/
|
|
64
|
+
export function createUnknownOutcomeBatch(commands, startedAt, error) {
|
|
65
|
+
return {
|
|
66
|
+
...createBatchFailure(commands, startedAt, error, error.message),
|
|
67
|
+
summary: { total: commands.length, successCount: 0, failureCount: 0, skippedCount: 0 },
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* A pipeline whose outcome is unknown. Like core's rejected pipelines it carries the error on a
|
|
72
|
+
* single pipeline-level entry (`index: -1`) instead of inventing a status for each step.
|
|
73
|
+
*/
|
|
74
|
+
export function createUnknownOutcomePipeline(request, error) {
|
|
75
|
+
return {
|
|
76
|
+
...createPipelineFailure(request),
|
|
77
|
+
steps: [{ index: -1, command: '', status: 'failure', error, executionTimeMs: 0 }],
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
export function createPipelineFailure(request, error) {
|
|
81
|
+
return {
|
|
82
|
+
data: undefined,
|
|
83
|
+
metadata: {
|
|
84
|
+
confidence: 0,
|
|
85
|
+
confidenceBreakdown: [],
|
|
86
|
+
reasoning: [],
|
|
87
|
+
warnings: [],
|
|
88
|
+
sources: [],
|
|
89
|
+
alternatives: [],
|
|
90
|
+
executionTimeMs: 0,
|
|
91
|
+
completedSteps: 0,
|
|
92
|
+
totalSteps: request.steps.length,
|
|
93
|
+
},
|
|
94
|
+
steps: error
|
|
95
|
+
? request.steps.map((step, index) => ({
|
|
96
|
+
index,
|
|
97
|
+
alias: step.as,
|
|
98
|
+
command: step.command,
|
|
99
|
+
status: 'failure',
|
|
100
|
+
error,
|
|
101
|
+
executionTimeMs: 0,
|
|
102
|
+
}))
|
|
103
|
+
: [],
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
export { isBatchResult, isPipelineResult };
|
|
107
|
+
//# sourceMappingURL=result-parsing.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"result-parsing.js","sourceRoot":"","sources":["../src/result-parsing.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAEvE,MAAM,UAAU,cAAc,CAAC,MAAyB;IACvD,OAAO,MAAM,CA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,EAAE,KAAK;YACX,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC,CAAC;gBACpC,KAAK;gBACL,KAAK,EAAE,IAAI,CAAC,EAAE;gBACd,OAAO,EAAE,IAAI,CAAC,OAAO;gBACrB,MAAM,EAAE,SAAkB;gBAC1B,KAAK;gBACL,eAAe,EAAE,CAAC;aAClB,CAAC,CAAC;YACJ,CAAC,CAAC,EAAE;KACL,CAAC;AACH,CAAC;AAED,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,CAAC"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Server-Sent Events parser shared by `McpClient.stream()` and the SSE handoff handler.
|
|
3
|
+
*
|
|
4
|
+
* Follows the WHATWG event-stream format: lines end in CRLF, LF or CR; a line starting with `:`
|
|
5
|
+
* is a comment; `field:value` drops one leading space from the value (`data:x` and `data: x` are
|
|
6
|
+
* the same); several `data` lines join with `\n`; a blank line dispatches the event. An event that
|
|
7
|
+
* the stream ends before its blank line is discarded, as the spec requires.
|
|
8
|
+
*
|
|
9
|
+
* Input is scanned once, so the cost is linear in the stream size, and one event (its data lines
|
|
10
|
+
* plus the line being read) is bounded by `maxEventSize` characters.
|
|
11
|
+
*/
|
|
12
|
+
/** Default bound for one event: 1 MiB of characters. */
|
|
13
|
+
export declare const DEFAULT_MAX_SSE_EVENT_SIZE: number;
|
|
14
|
+
/** One dispatched server-sent event. */
|
|
15
|
+
export interface SseEvent {
|
|
16
|
+
/** The `event` field, or `'message'` when the event had none. */
|
|
17
|
+
event: string;
|
|
18
|
+
/** The `data` lines joined with `\n`. */
|
|
19
|
+
data: string;
|
|
20
|
+
/** The last `id` field seen on the stream, if any. */
|
|
21
|
+
id?: string;
|
|
22
|
+
}
|
|
23
|
+
/** Thrown when one event grows beyond the parser's `maxEventSize`. */
|
|
24
|
+
export declare class SseEventTooLargeError extends Error {
|
|
25
|
+
readonly limit: number;
|
|
26
|
+
constructor(limit: number);
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Incremental event-stream parser. Feed decoded text with `feed()` (or `push()`); it yields the
|
|
30
|
+
* events that text completed.
|
|
31
|
+
*/
|
|
32
|
+
export declare class SseParser {
|
|
33
|
+
private readonly maxEventSize;
|
|
34
|
+
private lineParts;
|
|
35
|
+
private lineLength;
|
|
36
|
+
private dataLines;
|
|
37
|
+
private dataLength;
|
|
38
|
+
private eventType;
|
|
39
|
+
private lastEventId;
|
|
40
|
+
/** The previous chunk ended in CR, so a leading LF in the next chunk belongs to it. */
|
|
41
|
+
private pendingCr;
|
|
42
|
+
constructor(maxEventSize?: number);
|
|
43
|
+
/**
|
|
44
|
+
* Parse the next piece of the stream, returning the events it completed.
|
|
45
|
+
*
|
|
46
|
+
* @throws SseEventTooLargeError when the current event exceeds `maxEventSize`
|
|
47
|
+
*/
|
|
48
|
+
push(text: string): SseEvent[];
|
|
49
|
+
/**
|
|
50
|
+
* Parse the next piece of the stream, yielding each event as soon as it is complete, so the
|
|
51
|
+
* events before an oversized one are delivered before the error.
|
|
52
|
+
*
|
|
53
|
+
* @throws SseEventTooLargeError when the current event exceeds `maxEventSize`
|
|
54
|
+
*/
|
|
55
|
+
feed(text: string): Generator<SseEvent, void, unknown>;
|
|
56
|
+
private appendToLine;
|
|
57
|
+
private takeLine;
|
|
58
|
+
/** Apply one line; a blank line returns the event it completes, if any. */
|
|
59
|
+
private processLine;
|
|
60
|
+
private dispatch;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Read a byte stream as server-sent events.
|
|
64
|
+
*
|
|
65
|
+
* @param reader - Reader of the response body
|
|
66
|
+
* @param maxEventSize - Bound for one event in characters
|
|
67
|
+
* @throws SseEventTooLargeError when an event exceeds `maxEventSize`
|
|
68
|
+
*/
|
|
69
|
+
export declare function readSseEvents(reader: ReadableStreamDefaultReader<Uint8Array>, maxEventSize?: number): AsyncGenerator<SseEvent, void, unknown>;
|
|
70
|
+
//# sourceMappingURL=sse-parser.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sse-parser.d.ts","sourceRoot":"","sources":["../src/sse-parser.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,wDAAwD;AACxD,eAAO,MAAM,0BAA0B,QAAc,CAAC;AAEtD,wCAAwC;AACxC,MAAM,WAAW,QAAQ;IACxB,iEAAiE;IACjE,KAAK,EAAE,MAAM,CAAC;IACd,yCAAyC;IACzC,IAAI,EAAE,MAAM,CAAC;IACb,sDAAsD;IACtD,EAAE,CAAC,EAAE,MAAM,CAAC;CACZ;AAED,sEAAsE;AACtE,qBAAa,qBAAsB,SAAQ,KAAK;IACnC,QAAQ,CAAC,KAAK,EAAE,MAAM;gBAAb,KAAK,EAAE,MAAM;CAIlC;AAKD;;;GAGG;AACH,qBAAa,SAAS;IAUT,OAAO,CAAC,QAAQ,CAAC,YAAY;IATzC,OAAO,CAAC,SAAS,CAAgB;IACjC,OAAO,CAAC,UAAU,CAAK;IACvB,OAAO,CAAC,SAAS,CAAgB;IACjC,OAAO,CAAC,UAAU,CAAK;IACvB,OAAO,CAAC,SAAS,CAAM;IACvB,OAAO,CAAC,WAAW,CAAqB;IACxC,uFAAuF;IACvF,OAAO,CAAC,SAAS,CAAS;gBAEG,YAAY,SAA6B;IAEtE;;;;OAIG;IACH,IAAI,CAAC,IAAI,EAAE,MAAM,GAAG,QAAQ,EAAE;IAI9B;;;;;OAKG;IACF,IAAI,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,CAAC,QAAQ,EAAE,IAAI,EAAE,OAAO,CAAC;IAqBvD,OAAO,CAAC,YAAY;IASpB,OAAO,CAAC,QAAQ;IAOhB,2EAA2E;IAC3E,OAAO,CAAC,WAAW;IA2BnB,OAAO,CAAC,QAAQ;CAchB;AAED;;;;;;GAMG;AACH,wBAAuB,aAAa,CACnC,MAAM,EAAE,2BAA2B,CAAC,UAAU,CAAC,EAC/C,YAAY,SAA6B,GACvC,cAAc,CAAC,QAAQ,EAAE,IAAI,EAAE,OAAO,CAAC,CAUzC"}
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Server-Sent Events parser shared by `McpClient.stream()` and the SSE handoff handler.
|
|
3
|
+
*
|
|
4
|
+
* Follows the WHATWG event-stream format: lines end in CRLF, LF or CR; a line starting with `:`
|
|
5
|
+
* is a comment; `field:value` drops one leading space from the value (`data:x` and `data: x` are
|
|
6
|
+
* the same); several `data` lines join with `\n`; a blank line dispatches the event. An event that
|
|
7
|
+
* the stream ends before its blank line is discarded, as the spec requires.
|
|
8
|
+
*
|
|
9
|
+
* Input is scanned once, so the cost is linear in the stream size, and one event (its data lines
|
|
10
|
+
* plus the line being read) is bounded by `maxEventSize` characters.
|
|
11
|
+
*/
|
|
12
|
+
/** Default bound for one event: 1 MiB of characters. */
|
|
13
|
+
export const DEFAULT_MAX_SSE_EVENT_SIZE = 1024 * 1024;
|
|
14
|
+
/** Thrown when one event grows beyond the parser's `maxEventSize`. */
|
|
15
|
+
export class SseEventTooLargeError extends Error {
|
|
16
|
+
limit;
|
|
17
|
+
constructor(limit) {
|
|
18
|
+
super(`A server-sent event exceeded ${limit} characters`);
|
|
19
|
+
this.limit = limit;
|
|
20
|
+
this.name = 'SseEventTooLargeError';
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
const LF = 10;
|
|
24
|
+
const CR = 13;
|
|
25
|
+
/**
|
|
26
|
+
* Incremental event-stream parser. Feed decoded text with `feed()` (or `push()`); it yields the
|
|
27
|
+
* events that text completed.
|
|
28
|
+
*/
|
|
29
|
+
export class SseParser {
|
|
30
|
+
maxEventSize;
|
|
31
|
+
lineParts = [];
|
|
32
|
+
lineLength = 0;
|
|
33
|
+
dataLines = [];
|
|
34
|
+
dataLength = 0;
|
|
35
|
+
eventType = '';
|
|
36
|
+
lastEventId;
|
|
37
|
+
/** The previous chunk ended in CR, so a leading LF in the next chunk belongs to it. */
|
|
38
|
+
pendingCr = false;
|
|
39
|
+
constructor(maxEventSize = DEFAULT_MAX_SSE_EVENT_SIZE) {
|
|
40
|
+
this.maxEventSize = maxEventSize;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Parse the next piece of the stream, returning the events it completed.
|
|
44
|
+
*
|
|
45
|
+
* @throws SseEventTooLargeError when the current event exceeds `maxEventSize`
|
|
46
|
+
*/
|
|
47
|
+
push(text) {
|
|
48
|
+
return [...this.feed(text)];
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Parse the next piece of the stream, yielding each event as soon as it is complete, so the
|
|
52
|
+
* events before an oversized one are delivered before the error.
|
|
53
|
+
*
|
|
54
|
+
* @throws SseEventTooLargeError when the current event exceeds `maxEventSize`
|
|
55
|
+
*/
|
|
56
|
+
*feed(text) {
|
|
57
|
+
if (text.length === 0)
|
|
58
|
+
return;
|
|
59
|
+
let start = 0;
|
|
60
|
+
if (this.pendingCr && text.charCodeAt(0) === LF)
|
|
61
|
+
start = 1;
|
|
62
|
+
this.pendingCr = false;
|
|
63
|
+
for (let index = start; index < text.length; index++) {
|
|
64
|
+
const code = text.charCodeAt(index);
|
|
65
|
+
if (code !== LF && code !== CR)
|
|
66
|
+
continue;
|
|
67
|
+
this.appendToLine(text.slice(start, index));
|
|
68
|
+
const event = this.processLine(this.takeLine());
|
|
69
|
+
if (event)
|
|
70
|
+
yield event;
|
|
71
|
+
if (code === CR) {
|
|
72
|
+
if (index + 1 >= text.length)
|
|
73
|
+
this.pendingCr = true;
|
|
74
|
+
else if (text.charCodeAt(index + 1) === LF)
|
|
75
|
+
index++;
|
|
76
|
+
}
|
|
77
|
+
start = index + 1;
|
|
78
|
+
}
|
|
79
|
+
if (start < text.length)
|
|
80
|
+
this.appendToLine(text.slice(start));
|
|
81
|
+
}
|
|
82
|
+
appendToLine(part) {
|
|
83
|
+
if (part.length === 0)
|
|
84
|
+
return;
|
|
85
|
+
this.lineLength += part.length;
|
|
86
|
+
if (this.lineLength + this.dataLength > this.maxEventSize) {
|
|
87
|
+
throw new SseEventTooLargeError(this.maxEventSize);
|
|
88
|
+
}
|
|
89
|
+
this.lineParts.push(part);
|
|
90
|
+
}
|
|
91
|
+
takeLine() {
|
|
92
|
+
const line = this.lineParts.length === 1 ? (this.lineParts[0] ?? '') : this.lineParts.join('');
|
|
93
|
+
this.lineParts = [];
|
|
94
|
+
this.lineLength = 0;
|
|
95
|
+
return line;
|
|
96
|
+
}
|
|
97
|
+
/** Apply one line; a blank line returns the event it completes, if any. */
|
|
98
|
+
processLine(line) {
|
|
99
|
+
if (line.length === 0)
|
|
100
|
+
return this.dispatch();
|
|
101
|
+
if (line.charCodeAt(0) === 58 /* ':' */)
|
|
102
|
+
return undefined; // comment
|
|
103
|
+
const colon = line.indexOf(':');
|
|
104
|
+
const field = colon === -1 ? line : line.slice(0, colon);
|
|
105
|
+
let value = colon === -1 ? '' : line.slice(colon + 1);
|
|
106
|
+
if (value.charCodeAt(0) === 32 /* ' ' */)
|
|
107
|
+
value = value.slice(1);
|
|
108
|
+
switch (field) {
|
|
109
|
+
case 'data':
|
|
110
|
+
this.dataLines.push(value);
|
|
111
|
+
this.dataLength += value.length + 1;
|
|
112
|
+
break;
|
|
113
|
+
case 'event':
|
|
114
|
+
this.eventType = value;
|
|
115
|
+
break;
|
|
116
|
+
case 'id':
|
|
117
|
+
if (!value.includes('\0'))
|
|
118
|
+
this.lastEventId = value;
|
|
119
|
+
break;
|
|
120
|
+
default:
|
|
121
|
+
// `retry` and unknown fields do not affect the parsed events.
|
|
122
|
+
break;
|
|
123
|
+
}
|
|
124
|
+
return undefined;
|
|
125
|
+
}
|
|
126
|
+
dispatch() {
|
|
127
|
+
const event = this.dataLines.length > 0
|
|
128
|
+
? {
|
|
129
|
+
event: this.eventType || 'message',
|
|
130
|
+
data: this.dataLines.join('\n'),
|
|
131
|
+
...(this.lastEventId !== undefined ? { id: this.lastEventId } : {}),
|
|
132
|
+
}
|
|
133
|
+
: undefined;
|
|
134
|
+
this.dataLines = [];
|
|
135
|
+
this.dataLength = 0;
|
|
136
|
+
this.eventType = '';
|
|
137
|
+
return event;
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* Read a byte stream as server-sent events.
|
|
142
|
+
*
|
|
143
|
+
* @param reader - Reader of the response body
|
|
144
|
+
* @param maxEventSize - Bound for one event in characters
|
|
145
|
+
* @throws SseEventTooLargeError when an event exceeds `maxEventSize`
|
|
146
|
+
*/
|
|
147
|
+
export async function* readSseEvents(reader, maxEventSize = DEFAULT_MAX_SSE_EVENT_SIZE) {
|
|
148
|
+
const decoder = new TextDecoder();
|
|
149
|
+
const parser = new SseParser(maxEventSize);
|
|
150
|
+
while (true) {
|
|
151
|
+
const { done, value } = await reader.read();
|
|
152
|
+
if (done)
|
|
153
|
+
break;
|
|
154
|
+
yield* parser.feed(decoder.decode(value, { stream: true }));
|
|
155
|
+
}
|
|
156
|
+
// Anything after the last blank line is an incomplete event, which the spec discards.
|
|
157
|
+
yield* parser.feed(decoder.decode());
|
|
158
|
+
}
|
|
159
|
+
//# sourceMappingURL=sse-parser.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sse-parser.js","sourceRoot":"","sources":["../src/sse-parser.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,wDAAwD;AACxD,MAAM,CAAC,MAAM,0BAA0B,GAAG,IAAI,GAAG,IAAI,CAAC;AAYtD,sEAAsE;AACtE,MAAM,OAAO,qBAAsB,SAAQ,KAAK;IAC1B;IAArB,YAAqB,KAAa;QACjC,KAAK,CAAC,gCAAgC,KAAK,aAAa,CAAC,CAAC;QADtC,UAAK,GAAL,KAAK,CAAQ;QAEjC,IAAI,CAAC,IAAI,GAAG,uBAAuB,CAAC;IACrC,CAAC;CACD;AAED,MAAM,EAAE,GAAG,EAAE,CAAC;AACd,MAAM,EAAE,GAAG,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SAAS,IAAI,SAAS;gBAClC,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC;gBAC/B,GAAG,CAAC,IAAI,CAAC,WAAW,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,EAAE,EAAE,IAAI,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;aACnE;YACF,CAAC,CAAC,SAAS,CAAC;QACd,IAAI,CAAC,SAAS,GAAG,EAAE,CAAC;QACpB,IAAI,CAAC,UAAU,GAAG,CAAC,CAAC;QACpB,IAAI,CAAC,SAAS,GAAG,EAAE,CAAC;QACpB,OAAO,KAAK,CAAC;IACd,CAAC;CACD;AAED;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,SAAS,CAAC,CAAC,aAAa,CACnC,MAA+C,EAC/C,YAAY,GAAG,0BAA0B;IAEzC,MAAM,OAAO,GAAG,IAAI,WAAW,EAAE,CAAC;IAClC,MAAM,MAAM,GAAG,IAAI,SAAS,CAAC,YAAY,CAAC,CAAC;IAC3C,OAAO,IAAI,EAAE,CAAC;QACb,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,MAAM,MAAM,CAAC,IAAI,EAAE,CAAC;QAC5C,IAAI,IAAI;YAAE,MAAM;QAChB,KAAK,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;IAC7D,CAAC;IACD,sFAAsF;IACtF,KAAK,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;AACtC,CAAC"}
|
package/dist/transport.d.ts
CHANGED
|
@@ -2,16 +2,21 @@
|
|
|
2
2
|
* @fileoverview Transport layer for MCP communication
|
|
3
3
|
*/
|
|
4
4
|
import type { McpRequest, McpResponse } from '@lushly-dev/afd-core';
|
|
5
|
+
/**
|
|
6
|
+
* Consecutive network failures (no HTTP response at all) after which `HttpTransport` reports the
|
|
7
|
+
* connection as lost, so `McpClient` can reconnect.
|
|
8
|
+
*/
|
|
9
|
+
export declare const HTTP_FAILURES_BEFORE_CONNECTION_LOST = 3;
|
|
5
10
|
/**
|
|
6
11
|
* Transport interface for MCP communication.
|
|
7
12
|
*/
|
|
8
13
|
export interface Transport {
|
|
9
14
|
/** Connect to the server */
|
|
10
|
-
connect(): Promise<void>;
|
|
15
|
+
connect(signal?: AbortSignal): Promise<void>;
|
|
11
16
|
/** Disconnect from the server */
|
|
12
17
|
disconnect(): void;
|
|
13
18
|
/** Send a request and wait for response */
|
|
14
|
-
send(request: McpRequest): Promise<McpResponse>;
|
|
19
|
+
send(request: McpRequest, signal?: AbortSignal): Promise<McpResponse>;
|
|
15
20
|
/** Check if connected */
|
|
16
21
|
isConnected(): boolean;
|
|
17
22
|
/** Set message handler */
|
|
@@ -20,6 +25,19 @@ export interface Transport {
|
|
|
20
25
|
onError(handler: (error: Error) => void): void;
|
|
21
26
|
/** Set close handler */
|
|
22
27
|
onClose(handler: () => void): void;
|
|
28
|
+
/**
|
|
29
|
+
* The MCP session ID the server issued in its `initialize` response, if any. `McpClient`
|
|
30
|
+
* sends it with `stream()` requests, so a stream shares the session's context state.
|
|
31
|
+
*/
|
|
32
|
+
readonly sessionId?: string;
|
|
33
|
+
/**
|
|
34
|
+
* Start a new session with the last `initialize` request after the server rejected the
|
|
35
|
+
* current one (404). Resolves `false`, sending nothing, when there is no session to renew.
|
|
36
|
+
*/
|
|
37
|
+
renewSession?(signal?: AbortSignal, rejectedRevision?: number): Promise<boolean>;
|
|
38
|
+
/** Ownership/renewal snapshots used to reject stale stream responses after reset. */
|
|
39
|
+
readonly sessionGeneration?: number;
|
|
40
|
+
readonly sessionRevision?: number;
|
|
23
41
|
}
|
|
24
42
|
/**
|
|
25
43
|
* SSE (Server-Sent Events) transport for MCP.
|
|
@@ -27,6 +45,11 @@ export interface Transport {
|
|
|
27
45
|
* This transport:
|
|
28
46
|
* 1. Connects via SSE to receive messages from server
|
|
29
47
|
* 2. Sends requests via HTTP POST
|
|
48
|
+
*
|
|
49
|
+
* It speaks the AFD server's HTTP transport: requests go to the URL with its trailing `/sse`
|
|
50
|
+
* replaced by `/message`. The `endpoint` event of the legacy MCP SSE transport is not read, so
|
|
51
|
+
* servers that announce a different message URL (such as official MCP SDK servers) are not
|
|
52
|
+
* supported.
|
|
30
53
|
*/
|
|
31
54
|
export declare class SseTransport implements Transport {
|
|
32
55
|
private readonly sseUrl;
|
|
@@ -37,17 +60,26 @@ export declare class SseTransport implements Transport {
|
|
|
37
60
|
private closeHandler;
|
|
38
61
|
private connected;
|
|
39
62
|
private messageEndpoint;
|
|
63
|
+
private activeControllers;
|
|
64
|
+
private readonly session;
|
|
40
65
|
constructor(sseUrl: string, headers?: Record<string, string> | undefined);
|
|
41
|
-
connect(): Promise<void>;
|
|
66
|
+
connect(signal?: AbortSignal): Promise<void>;
|
|
42
67
|
disconnect(): void;
|
|
43
|
-
send(request: McpRequest): Promise<McpResponse>;
|
|
68
|
+
send(request: McpRequest, signal?: AbortSignal): Promise<McpResponse>;
|
|
69
|
+
get sessionId(): string | undefined;
|
|
70
|
+
get sessionGeneration(): number;
|
|
71
|
+
get sessionRevision(): number;
|
|
72
|
+
renewSession(signal?: AbortSignal, rejectedRevision?: number): Promise<boolean>;
|
|
44
73
|
isConnected(): boolean;
|
|
45
74
|
onMessage(handler: (response: McpResponse) => void): void;
|
|
46
75
|
onError(handler: (error: Error) => void): void;
|
|
47
76
|
onClose(handler: () => void): void;
|
|
77
|
+
private createRequestController;
|
|
48
78
|
}
|
|
49
79
|
/**
|
|
50
80
|
* HTTP transport for MCP (request/response only, no streaming).
|
|
81
|
+
*
|
|
82
|
+
* Connection loss is detected from consecutive requests that get no HTTP response at all.
|
|
51
83
|
*/
|
|
52
84
|
export declare class HttpTransport implements Transport {
|
|
53
85
|
readonly url: string;
|
|
@@ -55,15 +87,30 @@ export declare class HttpTransport implements Transport {
|
|
|
55
87
|
private messageHandler;
|
|
56
88
|
private closeHandler;
|
|
57
89
|
private connected;
|
|
90
|
+
private consecutiveFailures;
|
|
58
91
|
private messageUrl;
|
|
92
|
+
private activeControllers;
|
|
93
|
+
private readonly session;
|
|
59
94
|
constructor(url: string, headers?: Record<string, string> | undefined);
|
|
60
|
-
connect(): Promise<void>;
|
|
95
|
+
connect(signal?: AbortSignal): Promise<void>;
|
|
61
96
|
disconnect(): void;
|
|
62
|
-
send(request: McpRequest): Promise<McpResponse>;
|
|
97
|
+
send(request: McpRequest, signal?: AbortSignal): Promise<McpResponse>;
|
|
98
|
+
get sessionId(): string | undefined;
|
|
99
|
+
get sessionGeneration(): number;
|
|
100
|
+
get sessionRevision(): number;
|
|
101
|
+
renewSession(signal?: AbortSignal, rejectedRevision?: number): Promise<boolean>;
|
|
102
|
+
/**
|
|
103
|
+
* HTTP has no persistent connection to watch, so a request that gets no response at all
|
|
104
|
+
* counts as a failure. After {@link HTTP_FAILURES_BEFORE_CONNECTION_LOST} in a row the
|
|
105
|
+
* transport reports the connection as lost (its close handler runs, which lets `McpClient`
|
|
106
|
+
* reconnect). Any HTTP response, even an error status, resets the count.
|
|
107
|
+
*/
|
|
108
|
+
private recordNetworkFailure;
|
|
63
109
|
isConnected(): boolean;
|
|
64
110
|
onMessage(handler: (response: McpResponse) => void): void;
|
|
65
111
|
onError(_handler: (error: Error) => void): void;
|
|
66
112
|
onClose(handler: () => void): void;
|
|
113
|
+
private createRequestController;
|
|
67
114
|
}
|
|
68
115
|
/**
|
|
69
116
|
* Create a transport based on type.
|
package/dist/transport.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transport.d.ts","sourceRoot":"","sources":["../src/transport.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"transport.d.ts","sourceRoot":"","sources":["../src/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