@mlx-node/server 0.0.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/dist/endpoints/messages.d.ts +13 -0
- package/dist/endpoints/messages.d.ts.map +1 -0
- package/dist/endpoints/messages.js +511 -0
- package/dist/endpoints/models.d.ts +5 -0
- package/dist/endpoints/models.d.ts.map +1 -0
- package/dist/endpoints/models.js +10 -0
- package/dist/endpoints/responses.d.ts +79 -0
- package/dist/endpoints/responses.d.ts.map +1 -0
- package/dist/endpoints/responses.js +2816 -0
- package/dist/errors.d.ts +43 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +84 -0
- package/dist/handler.d.ts +18 -0
- package/dist/handler.d.ts.map +1 -0
- package/dist/handler.js +35 -0
- package/dist/index.d.ts +23 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +16 -0
- package/dist/mappers/anthropic-request.d.ts +9 -0
- package/dist/mappers/anthropic-request.d.ts.map +1 -0
- package/dist/mappers/anthropic-request.js +241 -0
- package/dist/mappers/anthropic-response.d.ts +14 -0
- package/dist/mappers/anthropic-response.d.ts.map +1 -0
- package/dist/mappers/anthropic-response.js +112 -0
- package/dist/mappers/request.d.ts +18 -0
- package/dist/mappers/request.d.ts.map +1 -0
- package/dist/mappers/request.js +206 -0
- package/dist/mappers/response.d.ts +13 -0
- package/dist/mappers/response.d.ts.map +1 -0
- package/dist/mappers/response.js +116 -0
- package/dist/pending-writes.d.ts +337 -0
- package/dist/pending-writes.d.ts.map +1 -0
- package/dist/pending-writes.js +468 -0
- package/dist/registry.d.ts +363 -0
- package/dist/registry.d.ts.map +1 -0
- package/dist/registry.js +497 -0
- package/dist/router.d.ts +6 -0
- package/dist/router.d.ts.map +1 -0
- package/dist/router.js +78 -0
- package/dist/server.d.ts +80 -0
- package/dist/server.d.ts.map +1 -0
- package/dist/server.js +158 -0
- package/dist/session-registry.d.ts +297 -0
- package/dist/session-registry.d.ts.map +1 -0
- package/dist/session-registry.js +403 -0
- package/dist/streaming.d.ts +7 -0
- package/dist/streaming.d.ts.map +1 -0
- package/dist/streaming.js +16 -0
- package/dist/tool-call-buffer.d.ts +26 -0
- package/dist/tool-call-buffer.d.ts.map +1 -0
- package/dist/tool-call-buffer.js +51 -0
- package/dist/transport-visibility.d.ts +56 -0
- package/dist/transport-visibility.d.ts.map +1 -0
- package/dist/transport-visibility.js +161 -0
- package/dist/types-anthropic.d.ts +144 -0
- package/dist/types-anthropic.d.ts.map +1 -0
- package/dist/types-anthropic.js +2 -0
- package/dist/types.d.ts +220 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +2 -0
- package/package.json +36 -0
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Transport visibility tracking shared between the Responses and Messages
|
|
3
|
+
* endpoints. Gates "safe to suppress" on whether the client actually observed
|
|
4
|
+
* a terminal artefact for this turn.
|
|
5
|
+
*
|
|
6
|
+
* The helpers reject — and leave visibility flags unflipped — on ANY of:
|
|
7
|
+
* - the write callback reporting err != null;
|
|
8
|
+
* - a `'error'` event on `res`;
|
|
9
|
+
* - a `'close'` event on `res` or its socket;
|
|
10
|
+
* - a pre-write check finding the response/socket already destroyed.
|
|
11
|
+
*
|
|
12
|
+
* Flipping the flags from `res.end()` / `writeSSEEvent`'s synchronous return
|
|
13
|
+
* is not sufficient: on a dead socket `_writeRaw` can return without ever
|
|
14
|
+
* firing the callback or `'error'`, which would pin the per-model mutex on a
|
|
15
|
+
* client that cannot see anything we write.
|
|
16
|
+
*
|
|
17
|
+
* Non-terminal SSE writes remain synchronous — only the terminal event is
|
|
18
|
+
* flushed through the async helper. Streaming handlers independently attach a
|
|
19
|
+
* `res.once('close', …)` listener to flip `clientAborted` so the decode loop
|
|
20
|
+
* breaks at the next iteration boundary.
|
|
21
|
+
*/
|
|
22
|
+
import { writeSSEEvent } from './streaming.js';
|
|
23
|
+
export function createVisibility() {
|
|
24
|
+
return {
|
|
25
|
+
responseMode: null,
|
|
26
|
+
responseBodyWritten: false,
|
|
27
|
+
terminalEmitted: false,
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
/** True if `res` or its socket is already destroyed — writes will never be seen and callbacks may never fire. */
|
|
31
|
+
function isSocketGone(res) {
|
|
32
|
+
if (res.destroyed)
|
|
33
|
+
return true;
|
|
34
|
+
const sock = res.socket;
|
|
35
|
+
if (sock != null && sock.destroyed)
|
|
36
|
+
return true;
|
|
37
|
+
return false;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Write an HTTP 200 JSON response and await kernel ack via `res.end(body, cb)`.
|
|
41
|
+
* `responseMode` is committed AFTER `writeHead` returns so a synchronous throw
|
|
42
|
+
* from `writeHead` leaves `responseMode === null` for the outer catch.
|
|
43
|
+
* `responseBodyWritten` is flipped only on the callback's success path.
|
|
44
|
+
*/
|
|
45
|
+
export async function endJson(res, body, visibility) {
|
|
46
|
+
res.writeHead(200, { 'Content-Type': 'application/json' });
|
|
47
|
+
visibility.responseMode = 'json';
|
|
48
|
+
await new Promise((resolve, reject) => {
|
|
49
|
+
let settled = false;
|
|
50
|
+
const onError = (err) => {
|
|
51
|
+
settle(err instanceof Error ? err : new Error(String(err)));
|
|
52
|
+
};
|
|
53
|
+
const onClose = () => {
|
|
54
|
+
// `'close'` without a successful end callback = client never saw the body.
|
|
55
|
+
settle(new Error('response closed before write completion'));
|
|
56
|
+
};
|
|
57
|
+
const sock = res.socket;
|
|
58
|
+
const settle = (err) => {
|
|
59
|
+
if (settled)
|
|
60
|
+
return;
|
|
61
|
+
settled = true;
|
|
62
|
+
res.removeListener('error', onError);
|
|
63
|
+
res.removeListener('close', onClose);
|
|
64
|
+
if (sock != null)
|
|
65
|
+
sock.removeListener('close', onClose);
|
|
66
|
+
if (err != null) {
|
|
67
|
+
reject(err);
|
|
68
|
+
}
|
|
69
|
+
else {
|
|
70
|
+
visibility.responseBodyWritten = true;
|
|
71
|
+
resolve();
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
// Pre-check: `'close'` may have already fired and the write callback
|
|
75
|
+
// may never arrive on a destroyed peer — reject synchronously instead.
|
|
76
|
+
if (isSocketGone(res)) {
|
|
77
|
+
settle(new Error('response socket already destroyed before write'));
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
res.once('error', onError);
|
|
81
|
+
res.once('close', onClose);
|
|
82
|
+
if (sock != null)
|
|
83
|
+
sock.once('close', onClose);
|
|
84
|
+
try {
|
|
85
|
+
res.end(body, (err) => {
|
|
86
|
+
settle(err ?? null);
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
catch (err) {
|
|
90
|
+
settle(err instanceof Error ? err : new Error(String(err)));
|
|
91
|
+
}
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Emit the terminal SSE event for a streaming response and await kernel ack via
|
|
96
|
+
* `res.write(chunk, cb)`. `terminalEmitted` is flipped only on the success path.
|
|
97
|
+
* Used for `response.completed` / `response.failed`, `message_stop`, and the
|
|
98
|
+
* streaming `error` event. Non-terminal writes stay synchronous.
|
|
99
|
+
*/
|
|
100
|
+
export async function flushTerminalSSE(res, eventType, data, visibility) {
|
|
101
|
+
const payload = { type: eventType, ...data };
|
|
102
|
+
const chunk = `event: ${eventType}\ndata: ${JSON.stringify(payload)}\n\n`;
|
|
103
|
+
await new Promise((resolve, reject) => {
|
|
104
|
+
let settled = false;
|
|
105
|
+
const onError = (err) => {
|
|
106
|
+
settle(err instanceof Error ? err : new Error(String(err)));
|
|
107
|
+
};
|
|
108
|
+
const onClose = () => {
|
|
109
|
+
settle(new Error('response closed before terminal SSE write completion'));
|
|
110
|
+
};
|
|
111
|
+
const sock = res.socket;
|
|
112
|
+
const settle = (err) => {
|
|
113
|
+
if (settled)
|
|
114
|
+
return;
|
|
115
|
+
settled = true;
|
|
116
|
+
res.removeListener('error', onError);
|
|
117
|
+
res.removeListener('close', onClose);
|
|
118
|
+
if (sock != null)
|
|
119
|
+
sock.removeListener('close', onClose);
|
|
120
|
+
if (err != null) {
|
|
121
|
+
reject(err);
|
|
122
|
+
}
|
|
123
|
+
else {
|
|
124
|
+
visibility.terminalEmitted = true;
|
|
125
|
+
resolve();
|
|
126
|
+
}
|
|
127
|
+
};
|
|
128
|
+
if (isSocketGone(res)) {
|
|
129
|
+
settle(new Error('response socket already destroyed before terminal SSE write'));
|
|
130
|
+
return;
|
|
131
|
+
}
|
|
132
|
+
res.once('error', onError);
|
|
133
|
+
res.once('close', onClose);
|
|
134
|
+
if (sock != null)
|
|
135
|
+
sock.once('close', onClose);
|
|
136
|
+
try {
|
|
137
|
+
// Ignore backpressure return value — the callback + `'close'` listener
|
|
138
|
+
// + `isSocketGone` pre-check cover every settle path we need.
|
|
139
|
+
const ok = res.write(chunk, (err) => {
|
|
140
|
+
settle(err ?? null);
|
|
141
|
+
});
|
|
142
|
+
void ok;
|
|
143
|
+
}
|
|
144
|
+
catch (err) {
|
|
145
|
+
settle(err instanceof Error ? err : new Error(String(err)));
|
|
146
|
+
}
|
|
147
|
+
});
|
|
148
|
+
}
|
|
149
|
+
/** Commit to SSE mode — call immediately after `beginSSE(res)` so the outer catch routes SSE-shaped failures correctly. */
|
|
150
|
+
export function markSSEMode(visibility) {
|
|
151
|
+
visibility.responseMode = 'sse';
|
|
152
|
+
}
|
|
153
|
+
/** Best-effort synchronous SSE `error` event for the outer catch when the handler threw before flushing a terminal. */
|
|
154
|
+
export function writeFallbackErrorSSE(res, eventType, data) {
|
|
155
|
+
try {
|
|
156
|
+
writeSSEEvent(res, eventType, data);
|
|
157
|
+
}
|
|
158
|
+
catch {
|
|
159
|
+
// Socket is gone — let the caller complete the lifecycle via `end` / destroy.
|
|
160
|
+
}
|
|
161
|
+
}
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
/** Anthropic Messages API types: request/response shapes and SSE streaming events for POST /v1/messages. */
|
|
2
|
+
export interface AnthropicTextContentBlock {
|
|
3
|
+
type: 'text';
|
|
4
|
+
text: string;
|
|
5
|
+
}
|
|
6
|
+
export interface AnthropicImageContentBlock {
|
|
7
|
+
type: 'image';
|
|
8
|
+
source: {
|
|
9
|
+
type: 'base64';
|
|
10
|
+
media_type: string;
|
|
11
|
+
data: string;
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
export interface AnthropicToolResultContentBlock {
|
|
15
|
+
type: 'tool_result';
|
|
16
|
+
tool_use_id: string;
|
|
17
|
+
/** May be a string, text-block array, or mix of text and image blocks. Image-mixed shapes are rejected by the mapper; see `resolveToolResultContent`. */
|
|
18
|
+
content?: string | (AnthropicTextContentBlock | AnthropicImageContentBlock)[];
|
|
19
|
+
is_error?: boolean;
|
|
20
|
+
}
|
|
21
|
+
export interface AnthropicToolUseContentBlock {
|
|
22
|
+
type: 'tool_use';
|
|
23
|
+
id: string;
|
|
24
|
+
name: string;
|
|
25
|
+
input: Record<string, unknown>;
|
|
26
|
+
}
|
|
27
|
+
export interface AnthropicThinkingContentBlock {
|
|
28
|
+
type: 'thinking';
|
|
29
|
+
thinking: string;
|
|
30
|
+
}
|
|
31
|
+
export type AnthropicContentBlock = AnthropicTextContentBlock | AnthropicImageContentBlock | AnthropicToolResultContentBlock | AnthropicToolUseContentBlock | AnthropicThinkingContentBlock;
|
|
32
|
+
export interface SystemBlock {
|
|
33
|
+
type: 'text';
|
|
34
|
+
text: string;
|
|
35
|
+
cache_control?: {
|
|
36
|
+
type: string;
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
export interface AnthropicMessage {
|
|
40
|
+
role: 'user' | 'assistant';
|
|
41
|
+
content: string | AnthropicContentBlock[];
|
|
42
|
+
}
|
|
43
|
+
export interface AnthropicToolDefinition {
|
|
44
|
+
name: string;
|
|
45
|
+
description?: string;
|
|
46
|
+
input_schema: Record<string, unknown>;
|
|
47
|
+
}
|
|
48
|
+
export interface AnthropicToolChoice {
|
|
49
|
+
type: 'auto' | 'any' | 'tool';
|
|
50
|
+
name?: string;
|
|
51
|
+
disable_parallel_tool_use?: boolean;
|
|
52
|
+
}
|
|
53
|
+
export interface AnthropicMessagesRequest {
|
|
54
|
+
model: string;
|
|
55
|
+
messages: AnthropicMessage[];
|
|
56
|
+
max_tokens: number;
|
|
57
|
+
system?: string | SystemBlock[];
|
|
58
|
+
temperature?: number;
|
|
59
|
+
top_p?: number;
|
|
60
|
+
top_k?: number;
|
|
61
|
+
tools?: AnthropicToolDefinition[];
|
|
62
|
+
tool_choice?: AnthropicToolChoice;
|
|
63
|
+
stream?: boolean;
|
|
64
|
+
stop_sequences?: string[];
|
|
65
|
+
metadata?: {
|
|
66
|
+
user_id?: string;
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
export interface AnthropicResponseTextBlock {
|
|
70
|
+
type: 'text';
|
|
71
|
+
text: string;
|
|
72
|
+
}
|
|
73
|
+
export interface AnthropicResponseThinkingBlock {
|
|
74
|
+
type: 'thinking';
|
|
75
|
+
thinking: string;
|
|
76
|
+
}
|
|
77
|
+
export interface AnthropicResponseToolUseBlock {
|
|
78
|
+
type: 'tool_use';
|
|
79
|
+
id: string;
|
|
80
|
+
name: string;
|
|
81
|
+
input: Record<string, unknown>;
|
|
82
|
+
}
|
|
83
|
+
export type AnthropicResponseContent = AnthropicResponseTextBlock | AnthropicResponseThinkingBlock | AnthropicResponseToolUseBlock;
|
|
84
|
+
export interface AnthropicUsage {
|
|
85
|
+
input_tokens: number;
|
|
86
|
+
output_tokens: number;
|
|
87
|
+
}
|
|
88
|
+
export interface AnthropicMessagesResponse {
|
|
89
|
+
id: string;
|
|
90
|
+
type: 'message';
|
|
91
|
+
role: 'assistant';
|
|
92
|
+
model: string;
|
|
93
|
+
content: AnthropicResponseContent[];
|
|
94
|
+
stop_reason: 'end_turn' | 'max_tokens' | 'stop_sequence' | 'tool_use' | null;
|
|
95
|
+
stop_sequence: string | null;
|
|
96
|
+
usage: AnthropicUsage;
|
|
97
|
+
}
|
|
98
|
+
export interface AnthropicTextDelta {
|
|
99
|
+
type: 'text_delta';
|
|
100
|
+
text: string;
|
|
101
|
+
}
|
|
102
|
+
export interface AnthropicThinkingDelta {
|
|
103
|
+
type: 'thinking_delta';
|
|
104
|
+
thinking: string;
|
|
105
|
+
}
|
|
106
|
+
export interface AnthropicInputJsonDelta {
|
|
107
|
+
type: 'input_json_delta';
|
|
108
|
+
partial_json: string;
|
|
109
|
+
}
|
|
110
|
+
export type AnthropicDelta = AnthropicTextDelta | AnthropicThinkingDelta | AnthropicInputJsonDelta;
|
|
111
|
+
export interface AnthropicMessageStartEvent {
|
|
112
|
+
type: 'message_start';
|
|
113
|
+
message: AnthropicMessagesResponse;
|
|
114
|
+
}
|
|
115
|
+
export interface AnthropicContentBlockStartEvent {
|
|
116
|
+
type: 'content_block_start';
|
|
117
|
+
index: number;
|
|
118
|
+
content_block: AnthropicResponseContent;
|
|
119
|
+
}
|
|
120
|
+
export interface AnthropicContentBlockDeltaEvent {
|
|
121
|
+
type: 'content_block_delta';
|
|
122
|
+
index: number;
|
|
123
|
+
delta: AnthropicDelta;
|
|
124
|
+
}
|
|
125
|
+
export interface AnthropicContentBlockStopEvent {
|
|
126
|
+
type: 'content_block_stop';
|
|
127
|
+
index: number;
|
|
128
|
+
}
|
|
129
|
+
export interface AnthropicMessageDeltaEvent {
|
|
130
|
+
type: 'message_delta';
|
|
131
|
+
delta: {
|
|
132
|
+
stop_reason: string | null;
|
|
133
|
+
stop_sequence: string | null;
|
|
134
|
+
};
|
|
135
|
+
usage: {
|
|
136
|
+
input_tokens?: number;
|
|
137
|
+
output_tokens: number;
|
|
138
|
+
};
|
|
139
|
+
}
|
|
140
|
+
export interface AnthropicMessageStopEvent {
|
|
141
|
+
type: 'message_stop';
|
|
142
|
+
}
|
|
143
|
+
export type AnthropicStreamEvent = AnthropicMessageStartEvent | AnthropicContentBlockStartEvent | AnthropicContentBlockDeltaEvent | AnthropicContentBlockStopEvent | AnthropicMessageDeltaEvent | AnthropicMessageStopEvent;
|
|
144
|
+
//# sourceMappingURL=types-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,KAAK,EAAE,cAAc,CAAC;CACvB;AAED,MAAM,WAAW,8BAA8B;IAC7C,IAAI,EAAE,oBAAoB,CAAC;IAC3B,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,0BAA0B;IACzC,IAAI,EAAE,eAAe,CAAC;IACtB,KAAK,EAAE;QACL,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;QAC3B,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;KAC9B,CAAC;IACF,KAAK,EAAE;QAAE,YAAY,CAAC,EAAE,MAAM,CAAC;QAAC,aAAa,EAAE,MAAM,CAAA;KAAE,CAAC;CACzD;AAED,MAAM,WAAW,yBAAyB;IACxC,IAAI,EAAE,cAAc,CAAC;CACtB;AAED,MAAM,MAAM,oBAAoB,GAC5B,0BAA0B,GAC1B,+BAA+B,GAC/B,+BAA+B,GAC/B,8BAA8B,GAC9B,0BAA0B,GAC1B,yBAAyB,CAAC"}
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
/** OpenAI Responses API types: request/response shapes and SSE streaming events for POST /v1/responses. */
|
|
2
|
+
export interface InputTextPart {
|
|
3
|
+
type: 'input_text';
|
|
4
|
+
text: string;
|
|
5
|
+
}
|
|
6
|
+
export type ContentPart = InputTextPart;
|
|
7
|
+
export interface InputMessage {
|
|
8
|
+
type?: 'message';
|
|
9
|
+
role: 'user' | 'assistant' | 'system' | 'developer';
|
|
10
|
+
content: string | ContentPart[];
|
|
11
|
+
}
|
|
12
|
+
export interface InputFunctionCall {
|
|
13
|
+
type: 'function_call';
|
|
14
|
+
id: string;
|
|
15
|
+
call_id: string;
|
|
16
|
+
name: string;
|
|
17
|
+
arguments: string;
|
|
18
|
+
}
|
|
19
|
+
export interface InputFunctionCallOutput {
|
|
20
|
+
type: 'function_call_output';
|
|
21
|
+
call_id: string;
|
|
22
|
+
output: string;
|
|
23
|
+
}
|
|
24
|
+
export type InputItem = InputMessage | InputFunctionCall | InputFunctionCallOutput;
|
|
25
|
+
export interface ResponsesToolDefinition {
|
|
26
|
+
type: 'function';
|
|
27
|
+
name: string;
|
|
28
|
+
description?: string;
|
|
29
|
+
parameters?: Record<string, unknown>;
|
|
30
|
+
strict?: boolean;
|
|
31
|
+
}
|
|
32
|
+
export interface ResponsesAPIRequest {
|
|
33
|
+
model: string;
|
|
34
|
+
input: string | InputItem[];
|
|
35
|
+
instructions?: string;
|
|
36
|
+
tools?: ResponsesToolDefinition[];
|
|
37
|
+
tool_choice?: 'auto' | 'required' | 'none' | {
|
|
38
|
+
type: 'function';
|
|
39
|
+
name: string;
|
|
40
|
+
};
|
|
41
|
+
stream?: boolean;
|
|
42
|
+
temperature?: number;
|
|
43
|
+
top_p?: number;
|
|
44
|
+
max_output_tokens?: number;
|
|
45
|
+
reasoning?: {
|
|
46
|
+
effort?: string;
|
|
47
|
+
summary?: string;
|
|
48
|
+
};
|
|
49
|
+
previous_response_id?: string;
|
|
50
|
+
store?: boolean;
|
|
51
|
+
/**
|
|
52
|
+
* OpenAI-reserved `metadata` slot, repurposed here to carry MLX-Node
|
|
53
|
+
* extensions. Today this only exposes `retention_seconds` as a
|
|
54
|
+
* per-request override of `ServerConfig.responseRetentionSec`;
|
|
55
|
+
* unrelated keys are accepted and ignored (additive, forward-compat).
|
|
56
|
+
*/
|
|
57
|
+
metadata?: {
|
|
58
|
+
/**
|
|
59
|
+
* Per-request retention override for the stored response row, in
|
|
60
|
+
* seconds. Must be a finite positive integer in `[60, 90 * 86400]`
|
|
61
|
+
* (1 minute … 90 days). Out-of-range or non-integer values return
|
|
62
|
+
* 400. When omitted, the server-wide default applies.
|
|
63
|
+
*/
|
|
64
|
+
retention_seconds?: number;
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
export interface OutputTextPart {
|
|
68
|
+
type: 'output_text';
|
|
69
|
+
text: string;
|
|
70
|
+
annotations: never[];
|
|
71
|
+
}
|
|
72
|
+
export interface SummaryTextPart {
|
|
73
|
+
type: 'summary_text';
|
|
74
|
+
text: string;
|
|
75
|
+
}
|
|
76
|
+
export interface MessageOutputItem {
|
|
77
|
+
id: string;
|
|
78
|
+
type: 'message';
|
|
79
|
+
role: 'assistant';
|
|
80
|
+
status: 'completed' | 'incomplete' | 'in_progress';
|
|
81
|
+
content: OutputTextPart[];
|
|
82
|
+
}
|
|
83
|
+
export interface ReasoningOutputItem {
|
|
84
|
+
id: string;
|
|
85
|
+
type: 'reasoning';
|
|
86
|
+
summary: SummaryTextPart[];
|
|
87
|
+
}
|
|
88
|
+
export interface FunctionCallOutputItem {
|
|
89
|
+
id: string;
|
|
90
|
+
type: 'function_call';
|
|
91
|
+
call_id: string;
|
|
92
|
+
name: string;
|
|
93
|
+
arguments: string;
|
|
94
|
+
status: 'completed' | 'incomplete';
|
|
95
|
+
}
|
|
96
|
+
export type OutputItem = MessageOutputItem | ReasoningOutputItem | FunctionCallOutputItem;
|
|
97
|
+
export interface ResponseUsage {
|
|
98
|
+
input_tokens: number;
|
|
99
|
+
output_tokens: number;
|
|
100
|
+
output_tokens_details: {
|
|
101
|
+
reasoning_tokens: number;
|
|
102
|
+
};
|
|
103
|
+
total_tokens: number;
|
|
104
|
+
}
|
|
105
|
+
export interface ResponseError {
|
|
106
|
+
type: string;
|
|
107
|
+
message: string;
|
|
108
|
+
code: string | null;
|
|
109
|
+
param: string | null;
|
|
110
|
+
}
|
|
111
|
+
export interface ResponseObject {
|
|
112
|
+
id: string;
|
|
113
|
+
object: 'response';
|
|
114
|
+
created_at: number;
|
|
115
|
+
status: 'completed' | 'incomplete' | 'in_progress' | 'failed';
|
|
116
|
+
model: string;
|
|
117
|
+
output: OutputItem[];
|
|
118
|
+
output_text: string;
|
|
119
|
+
error: ResponseError | null;
|
|
120
|
+
incomplete_details: {
|
|
121
|
+
reason: string;
|
|
122
|
+
} | null;
|
|
123
|
+
usage: ResponseUsage;
|
|
124
|
+
instructions: string | null;
|
|
125
|
+
temperature: number | null;
|
|
126
|
+
top_p: number | null;
|
|
127
|
+
max_output_tokens: number | null;
|
|
128
|
+
tools: ResponsesToolDefinition[];
|
|
129
|
+
tool_choice: 'auto' | 'required' | 'none' | {
|
|
130
|
+
type: 'function';
|
|
131
|
+
name: string;
|
|
132
|
+
} | null;
|
|
133
|
+
reasoning: {
|
|
134
|
+
effort?: string;
|
|
135
|
+
summary?: string;
|
|
136
|
+
} | null;
|
|
137
|
+
previous_response_id: string | null;
|
|
138
|
+
}
|
|
139
|
+
export interface ResponseCreatedEvent {
|
|
140
|
+
type: 'response.created';
|
|
141
|
+
response: ResponseObject;
|
|
142
|
+
}
|
|
143
|
+
export interface ResponseInProgressEvent {
|
|
144
|
+
type: 'response.in_progress';
|
|
145
|
+
response: ResponseObject;
|
|
146
|
+
}
|
|
147
|
+
export interface ResponseCompletedEvent {
|
|
148
|
+
type: 'response.completed';
|
|
149
|
+
response: ResponseObject;
|
|
150
|
+
}
|
|
151
|
+
export interface ResponseFailedEvent {
|
|
152
|
+
type: 'response.failed';
|
|
153
|
+
response: ResponseObject;
|
|
154
|
+
}
|
|
155
|
+
export interface OutputItemAddedEvent {
|
|
156
|
+
type: 'response.output_item.added';
|
|
157
|
+
output_index: number;
|
|
158
|
+
item: OutputItem;
|
|
159
|
+
}
|
|
160
|
+
export interface OutputItemDoneEvent {
|
|
161
|
+
type: 'response.output_item.done';
|
|
162
|
+
output_index: number;
|
|
163
|
+
item: OutputItem;
|
|
164
|
+
}
|
|
165
|
+
export interface ContentPartAddedEvent {
|
|
166
|
+
type: 'response.content_part.added';
|
|
167
|
+
item_id: string;
|
|
168
|
+
output_index: number;
|
|
169
|
+
content_index: number;
|
|
170
|
+
part: OutputTextPart;
|
|
171
|
+
}
|
|
172
|
+
export interface ContentPartDoneEvent {
|
|
173
|
+
type: 'response.content_part.done';
|
|
174
|
+
item_id: string;
|
|
175
|
+
output_index: number;
|
|
176
|
+
content_index: number;
|
|
177
|
+
part: OutputTextPart;
|
|
178
|
+
}
|
|
179
|
+
export interface OutputTextDeltaEvent {
|
|
180
|
+
type: 'response.output_text.delta';
|
|
181
|
+
item_id: string;
|
|
182
|
+
output_index: number;
|
|
183
|
+
content_index: number;
|
|
184
|
+
delta: string;
|
|
185
|
+
}
|
|
186
|
+
export interface OutputTextDoneEvent {
|
|
187
|
+
type: 'response.output_text.done';
|
|
188
|
+
item_id: string;
|
|
189
|
+
output_index: number;
|
|
190
|
+
content_index: number;
|
|
191
|
+
text: string;
|
|
192
|
+
}
|
|
193
|
+
export interface ReasoningSummaryTextDeltaEvent {
|
|
194
|
+
type: 'response.reasoning_summary_text.delta';
|
|
195
|
+
item_id: string;
|
|
196
|
+
output_index: number;
|
|
197
|
+
summary_index: number;
|
|
198
|
+
delta: string;
|
|
199
|
+
}
|
|
200
|
+
export interface ReasoningSummaryTextDoneEvent {
|
|
201
|
+
type: 'response.reasoning_summary_text.done';
|
|
202
|
+
item_id: string;
|
|
203
|
+
output_index: number;
|
|
204
|
+
summary_index: number;
|
|
205
|
+
text: string;
|
|
206
|
+
}
|
|
207
|
+
export interface FunctionCallArgumentsDeltaEvent {
|
|
208
|
+
type: 'response.function_call_arguments.delta';
|
|
209
|
+
item_id: string;
|
|
210
|
+
output_index: number;
|
|
211
|
+
delta: string;
|
|
212
|
+
}
|
|
213
|
+
export interface FunctionCallArgumentsDoneEvent {
|
|
214
|
+
type: 'response.function_call_arguments.done';
|
|
215
|
+
item_id: string;
|
|
216
|
+
output_index: number;
|
|
217
|
+
arguments: string;
|
|
218
|
+
}
|
|
219
|
+
export type StreamEvent = ResponseCreatedEvent | ResponseInProgressEvent | ResponseCompletedEvent | ResponseFailedEvent | OutputItemAddedEvent | OutputItemDoneEvent | ContentPartAddedEvent | ContentPartDoneEvent | OutputTextDeltaEvent | OutputTextDoneEvent | ReasoningSummaryTextDeltaEvent | ReasoningSummaryTextDoneEvent | FunctionCallArgumentsDeltaEvent | FunctionCallArgumentsDoneEvent;
|
|
220
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
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6BAA6B,GAC7B,+BAA+B,GAC/B,8BAA8B,CAAC"}
|
package/dist/types.js
ADDED
package/package.json
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@mlx-node/server",
|
|
3
|
+
"version": "0.0.0",
|
|
4
|
+
"homepage": "https://github.com/mlx-node/mlx-node",
|
|
5
|
+
"bugs": {
|
|
6
|
+
"url": "https://github.com/mlx-node/mlx-node/issues"
|
|
7
|
+
},
|
|
8
|
+
"license": "MIT",
|
|
9
|
+
"repository": {
|
|
10
|
+
"type": "git",
|
|
11
|
+
"url": "https://github.com/mlx-node/mlx-node.git",
|
|
12
|
+
"directory": "packages/server"
|
|
13
|
+
},
|
|
14
|
+
"files": [
|
|
15
|
+
"dist"
|
|
16
|
+
],
|
|
17
|
+
"type": "module",
|
|
18
|
+
"main": "./dist/index.js",
|
|
19
|
+
"types": "./dist/index.d.ts",
|
|
20
|
+
"exports": {
|
|
21
|
+
".": {
|
|
22
|
+
"types": "./dist/index.d.ts",
|
|
23
|
+
"import": "./dist/index.js"
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
"scripts": {
|
|
27
|
+
"build": "tsc -b"
|
|
28
|
+
},
|
|
29
|
+
"dependencies": {
|
|
30
|
+
"@mlx-node/core": "workspace:*",
|
|
31
|
+
"@mlx-node/lm": "workspace:*"
|
|
32
|
+
},
|
|
33
|
+
"devDependencies": {
|
|
34
|
+
"@types/node": "catalog:"
|
|
35
|
+
}
|
|
36
|
+
}
|