@aphrody/m3-ai 3.3.5 → 3.3.7
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/A2APeerInspector.d.ts +1 -1
- package/dist/A2APeerInspector.d.ts.map +1 -1
- package/dist/A2ATaskTimeline.d.ts +1 -1
- package/dist/AgUiEventStream.d.ts +1 -1
- package/dist/AgUiEventStream.d.ts.map +1 -1
- package/dist/ChatComposer.d.ts +9 -1
- package/dist/ChatComposer.d.ts.map +1 -1
- package/dist/ConversationList.d.ts +32 -0
- package/dist/ConversationList.d.ts.map +1 -0
- package/dist/Markdown.d.ts +31 -1
- package/dist/Markdown.d.ts.map +1 -1
- package/dist/MemoryPanel.d.ts +26 -0
- package/dist/MemoryPanel.d.ts.map +1 -0
- package/dist/MessageBubble.d.ts +13 -1
- package/dist/MessageBubble.d.ts.map +1 -1
- package/dist/ModelSelector.d.ts +5 -1
- package/dist/ModelSelector.d.ts.map +1 -1
- package/dist/ModelUnavailable.d.ts +16 -0
- package/dist/ModelUnavailable.d.ts.map +1 -0
- package/dist/ToolCall.d.ts.map +1 -1
- package/dist/ag-ui.d.ts +13 -0
- package/dist/ag-ui.d.ts.map +1 -0
- package/dist/chatIcons.d.ts +34 -0
- package/dist/chatIcons.d.ts.map +1 -0
- package/dist/chatLabels.d.ts +71 -0
- package/dist/chatLabels.d.ts.map +1 -0
- package/dist/citations.d.ts +57 -0
- package/dist/citations.d.ts.map +1 -0
- package/dist/index.d.ts +20 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1955 -654
- package/dist/index.js.map +20 -13
- package/dist/openaiChatStream.d.ts +140 -0
- package/dist/openaiChatStream.d.ts.map +1 -0
- package/dist/useOpenAIChat.d.ts +30 -0
- package/dist/useOpenAIChat.d.ts.map +1 -0
- package/package.json +11 -6
- package/src/AgUiEventStream.ts +1 -1
- package/src/ag-ui.ts +19 -0
- package/src/index.ts +1 -1
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
import type { Citation } from "./citations";
|
|
2
|
+
export type ChatRole = "system" | "user" | "assistant" | "tool";
|
|
3
|
+
/** One complete tool call, as OpenAI returns it once every delta is merged. */
|
|
4
|
+
export interface OpenAIToolCall {
|
|
5
|
+
id: string;
|
|
6
|
+
type: "function";
|
|
7
|
+
function: {
|
|
8
|
+
name: string;
|
|
9
|
+
arguments: string;
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
/** One message of the conversation, in the shape the chat components render. */
|
|
13
|
+
export interface ChatMessage {
|
|
14
|
+
id: string;
|
|
15
|
+
role: ChatRole;
|
|
16
|
+
content: string;
|
|
17
|
+
/** `reasoning_content` deltas (reasoning models), kept apart from the answer. */
|
|
18
|
+
reasoning?: string;
|
|
19
|
+
toolCalls?: OpenAIToolCall[];
|
|
20
|
+
/** For a `tool` message: the call it answers. */
|
|
21
|
+
toolCallId?: string;
|
|
22
|
+
finishReason?: string | null;
|
|
23
|
+
/** Grounded answer: the numbered passages `[n]` the text refers to. */
|
|
24
|
+
citations?: Citation[];
|
|
25
|
+
/** The backend refused to answer (out of the sources' scope). */
|
|
26
|
+
refusal?: boolean;
|
|
27
|
+
}
|
|
28
|
+
/** What one SSE chunk contributes. */
|
|
29
|
+
export type ChatStreamEvent = {
|
|
30
|
+
type: "content";
|
|
31
|
+
text: string;
|
|
32
|
+
} | {
|
|
33
|
+
type: "reasoning";
|
|
34
|
+
text: string;
|
|
35
|
+
} | {
|
|
36
|
+
type: "tool_call_delta";
|
|
37
|
+
index: number;
|
|
38
|
+
id?: string;
|
|
39
|
+
name?: string;
|
|
40
|
+
arguments?: string;
|
|
41
|
+
} | {
|
|
42
|
+
type: "citations";
|
|
43
|
+
citations: Citation[];
|
|
44
|
+
} | {
|
|
45
|
+
type: "refusal";
|
|
46
|
+
text?: string;
|
|
47
|
+
} | {
|
|
48
|
+
type: "finish";
|
|
49
|
+
reason: string;
|
|
50
|
+
} | {
|
|
51
|
+
type: "done";
|
|
52
|
+
};
|
|
53
|
+
export type ChatStreamErrorKind = "network" | "http" | "aborted" | "parse" | "stream";
|
|
54
|
+
/** Typed failure of a chat request. `unavailable` marks a model that cannot answer right now. */
|
|
55
|
+
export declare class ChatStreamError extends Error {
|
|
56
|
+
readonly kind: ChatStreamErrorKind;
|
|
57
|
+
readonly status?: number;
|
|
58
|
+
readonly unavailable: boolean;
|
|
59
|
+
constructor(kind: ChatStreamErrorKind, message: string, options?: {
|
|
60
|
+
status?: number;
|
|
61
|
+
cause?: unknown;
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
/** HTTP statuses that mean "no model to answer" rather than "bad request". */
|
|
65
|
+
export declare function isUnavailableStatus(status: number | undefined): boolean;
|
|
66
|
+
/**
|
|
67
|
+
* Incremental SSE parser: feed it decoded text in arbitrary pieces, it calls `onData` with the
|
|
68
|
+
* payload of every complete event (multi-line `data:` fields joined by `\n`). Comments and
|
|
69
|
+
* other fields are ignored.
|
|
70
|
+
*/
|
|
71
|
+
export declare function createSseParser(onData: (data: string) => void): {
|
|
72
|
+
push(chunk: string): void;
|
|
73
|
+
flush(): void;
|
|
74
|
+
};
|
|
75
|
+
/**
|
|
76
|
+
* Decode one `data:` payload of a chat-completions stream into events. `[DONE]` yields `done`.
|
|
77
|
+
* A payload carrying `error` throws a `stream` error; malformed JSON throws a `parse` error.
|
|
78
|
+
* Top-level `citations` / `refusal: true` (grounded backends such as Shenron) are passed on.
|
|
79
|
+
*/
|
|
80
|
+
export declare function parseChatCompletionChunk(payload: string): ChatStreamEvent[];
|
|
81
|
+
/** Merge a tool-call delta into the calls accumulated so far (returns a new array). */
|
|
82
|
+
export declare function accumulateToolCall(calls: readonly OpenAIToolCall[], delta: Extract<ChatStreamEvent, {
|
|
83
|
+
type: "tool_call_delta";
|
|
84
|
+
}>): OpenAIToolCall[];
|
|
85
|
+
/** The request body messages, in the OpenAI wire shape. */
|
|
86
|
+
export declare function toOpenAIMessages(messages: readonly ChatMessage[]): Record<string, unknown>[];
|
|
87
|
+
export interface StreamChatOptions {
|
|
88
|
+
/** API root including `/v1` (e.g. `http://127.0.0.1:8080/v1`). */
|
|
89
|
+
baseUrl: string;
|
|
90
|
+
model?: string;
|
|
91
|
+
messages: readonly ChatMessage[];
|
|
92
|
+
/** Extra body fields (`temperature`, `tools`, `max_tokens`...). */
|
|
93
|
+
body?: Record<string, unknown>;
|
|
94
|
+
headers?: Record<string, string>;
|
|
95
|
+
signal?: AbortSignal;
|
|
96
|
+
fetch?: typeof fetch;
|
|
97
|
+
}
|
|
98
|
+
/** `<baseUrl>/chat/completions`, tolerant of a trailing slash. */
|
|
99
|
+
export declare function chatCompletionsUrl(baseUrl: string): string;
|
|
100
|
+
/**
|
|
101
|
+
* POST a streaming chat completion and yield its events until `[DONE]` or the end of the body.
|
|
102
|
+
*
|
|
103
|
+
* Throws `ChatStreamError`: `network` (fetch rejected: server down), `http` (non-2xx status;
|
|
104
|
+
* `unavailable` for 404/502/503/504), `aborted` (the signal fired), `parse` / `stream`.
|
|
105
|
+
*/
|
|
106
|
+
export declare function streamChatCompletion(options: StreamChatOptions): AsyncGenerator<ChatStreamEvent, void, undefined>;
|
|
107
|
+
export type ChatStatus = "idle" | "streaming" | "error" | "unavailable";
|
|
108
|
+
export interface ChatState {
|
|
109
|
+
messages: ChatMessage[];
|
|
110
|
+
status: ChatStatus;
|
|
111
|
+
error: ChatStreamError | null;
|
|
112
|
+
}
|
|
113
|
+
export type ChatAction = {
|
|
114
|
+
type: "start";
|
|
115
|
+
user: ChatMessage;
|
|
116
|
+
assistantId: string;
|
|
117
|
+
} | {
|
|
118
|
+
type: "event";
|
|
119
|
+
assistantId: string;
|
|
120
|
+
event: ChatStreamEvent;
|
|
121
|
+
} | {
|
|
122
|
+
type: "finish";
|
|
123
|
+
} | {
|
|
124
|
+
type: "fail";
|
|
125
|
+
error: ChatStreamError;
|
|
126
|
+
} | {
|
|
127
|
+
type: "stop";
|
|
128
|
+
} | {
|
|
129
|
+
type: "reset";
|
|
130
|
+
messages?: ChatMessage[];
|
|
131
|
+
} | {
|
|
132
|
+
type: "set";
|
|
133
|
+
messages: ChatMessage[];
|
|
134
|
+
};
|
|
135
|
+
export declare function initialChatState(messages?: ChatMessage[]): ChatState;
|
|
136
|
+
/** Pure reducer of a streamed conversation (the state behind `useOpenAIChat`). */
|
|
137
|
+
export declare function chatReducer(state: ChatState, action: ChatAction): ChatState;
|
|
138
|
+
/** Message id: `crypto.randomUUID` when present, else a process-local counter. */
|
|
139
|
+
export declare function newMessageId(): string;
|
|
140
|
+
//# sourceMappingURL=openaiChatStream.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"openaiChatStream.d.ts","sourceRoot":"","sources":["../src/openaiChatStream.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAE5C,MAAM,MAAM,QAAQ,GAAG,QAAQ,GAAG,MAAM,GAAG,WAAW,GAAG,MAAM,CAAC;AAEhE,+EAA+E;AAC/E,MAAM,WAAW,cAAc;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,UAAU,CAAC;IACjB,QAAQ,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,CAAA;KAAE,CAAC;CAC/C;AAED,gFAAgF;AAChF,MAAM,WAAW,WAAW;IAC1B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,QAAQ,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,iFAAiF;IACjF,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,cAAc,EAAE,CAAC;IAC7B,iDAAiD;IACjD,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,uEAAuE;IACvE,SAAS,CAAC,EAAE,QAAQ,EAAE,CAAC;IACvB,iEAAiE;IACjE,OAAO,CAAC,EAAE,OAAO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AAW,SAAS;IACxB,QAAQ,EAAE,WAAW,EAAE,CAAC;IACxB,MAAM,EAAE,UAAU,CAAC;IACnB,KAAK,EAAE,eAAe,GAAG,IAAI,CAAC;CAC/B;AAED,MAAM,MAAM,UAAU,GAClB;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,IAAI,EAAE,WAAW,CAAC;IAAC,WAAW,EAAE,MAAM,CAAA;CAAE,GACzD;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,WAAW,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,eAAe,CAAA;CAAE,GAC9D;IAAE,IAAI,EAAE,QAAQ,CAAA;CAAE,GAClB;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,eAAe,CAAA;CAAE,GACxC;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,GAChB;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,QAAQ,CAAC,EAAE,WAAW,EAAE,CAAA;CAAE,GAC3C;IAAE,IAAI,EAAE,KAAK,CAAC;IAAC,QAAQ,EAAE,WAAW,EAAE,CAAA;CAAE,CAAC;AAE7C,wBAAgB,gBAAgB,CAAC,QAAQ,GAAE,WAAW,EAAO,GAAG,SAAS,CAExE;AAqBD,kFAAkF;AAClF,wBAAgB,WAAW,CAAC,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,UAAU,GAAG,SAAS,CAwC3E;AAGD,kFAAkF;AAClF,wBAAgB,YAAY,IAAI,MAAM,CAKrC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { type ChatMessage, type ChatStatus, ChatStreamError } from "./openaiChatStream";
|
|
2
|
+
export interface UseOpenAIChatOptions {
|
|
3
|
+
/** API root including `/v1` (e.g. `http://127.0.0.1:8080/v1`). */
|
|
4
|
+
baseUrl: string;
|
|
5
|
+
model?: string;
|
|
6
|
+
fetch?: typeof fetch;
|
|
7
|
+
headers?: Record<string, string>;
|
|
8
|
+
initialMessages?: ChatMessage[];
|
|
9
|
+
/** Messages sent before the conversation on every request (system prompt...). */
|
|
10
|
+
preamble?: ChatMessage[];
|
|
11
|
+
/** Extra body fields (`temperature`, `tools`...). */
|
|
12
|
+
body?: Record<string, unknown>;
|
|
13
|
+
/** Called with the finished assistant message. */
|
|
14
|
+
onFinish?: (message: ChatMessage) => void;
|
|
15
|
+
onError?: (error: ChatStreamError) => void;
|
|
16
|
+
}
|
|
17
|
+
export interface UseOpenAIChatResult {
|
|
18
|
+
messages: ChatMessage[];
|
|
19
|
+
status: ChatStatus;
|
|
20
|
+
error: ChatStreamError | null;
|
|
21
|
+
/** Send a user message and stream the answer. Ignored while streaming. */
|
|
22
|
+
send: (content: string) => Promise<void>;
|
|
23
|
+
/** Abort the running request; the partial answer stays. */
|
|
24
|
+
stop: () => void;
|
|
25
|
+
/** Abort and clear (or replace) the conversation. */
|
|
26
|
+
reset: (messages?: ChatMessage[]) => void;
|
|
27
|
+
setMessages: (messages: ChatMessage[]) => void;
|
|
28
|
+
}
|
|
29
|
+
export declare function useOpenAIChat(options: UseOpenAIChatOptions): UseOpenAIChatResult;
|
|
30
|
+
//# sourceMappingURL=useOpenAIChat.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useOpenAIChat.d.ts","sourceRoot":"","sources":["../src/useOpenAIChat.ts"],"names":[],"mappings":"AAQA,OAAO,EACL,KAAK,WAAW,EAChB,KAAK,UAAU,EACf,eAAe,EAKhB,MAAM,oBAAoB,CAAC;AAE5B,MAAM,WAAW,oBAAoB;IACnC,kEAAkE;IAClE,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,OAAO,KAAK,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACjC,eAAe,CAAC,EAAE,WAAW,EAAE,CAAC;IAChC,iFAAiF;IACjF,QAAQ,CAAC,EAAE,WAAW,EAAE,CAAC;IACzB,qDAAqD;IACrD,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC/B,kDAAkD;IAClD,QAAQ,CAAC,EAAE,CAAC,OAAO,EAAE,WAAW,KAAK,IAAI,CAAC;IAC1C,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,eAAe,KAAK,IAAI,CAAC;CAC5C;AAED,MAAM,WAAW,mBAAmB;IAClC,QAAQ,EAAE,WAAW,EAAE,CAAC;IACxB,MAAM,EAAE,UAAU,CAAC;IACnB,KAAK,EAAE,eAAe,GAAG,IAAI,CAAC;IAC9B,0EAA0E;IAC1E,IAAI,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACzC,2DAA2D;IAC3D,IAAI,EAAE,MAAM,IAAI,CAAC;IACjB,qDAAqD;IACrD,KAAK,EAAE,CAAC,QAAQ,CAAC,EAAE,WAAW,EAAE,KAAK,IAAI,CAAC;IAC1C,WAAW,EAAE,CAAC,QAAQ,EAAE,WAAW,EAAE,KAAK,IAAI,CAAC;CAChD;AAED,wBAAgB,aAAa,CAAC,OAAO,EAAE,oBAAoB,GAAG,mBAAmB,CA8EhF"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aphrody/m3-ai",
|
|
3
|
-
"version": "3.3.
|
|
3
|
+
"version": "3.3.7",
|
|
4
4
|
"description": "Material Design 3 agent-interaction components (tool calls, markdown, chat composer, workers, tasks): the SpaceUI (@spacedrive/ai) set rebuilt on @aphrody/m3-primitives.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"material-3",
|
|
@@ -27,7 +27,8 @@
|
|
|
27
27
|
"import": "./src/index.ts",
|
|
28
28
|
"types": "./src/index.ts",
|
|
29
29
|
"default": "./dist/index.js"
|
|
30
|
-
}
|
|
30
|
+
},
|
|
31
|
+
"./ag-ui": "./src/ag-ui.ts"
|
|
31
32
|
},
|
|
32
33
|
"publishConfig": {
|
|
33
34
|
"access": "public"
|
|
@@ -39,9 +40,13 @@
|
|
|
39
40
|
"test": "bun test"
|
|
40
41
|
},
|
|
41
42
|
"dependencies": {
|
|
42
|
-
"@
|
|
43
|
-
"@
|
|
44
|
-
"@
|
|
43
|
+
"@ag-ui/a2ui-toolkit": "0.0.4",
|
|
44
|
+
"@ag-ui/client": "npm:@aphrody/ag-ui-client@1.0.1-aphrody.1",
|
|
45
|
+
"@ag-ui/core": "1.0.1",
|
|
46
|
+
"@ag-ui/encoder": "1.0.1",
|
|
47
|
+
"@ag-ui/proto": "1.0.1",
|
|
48
|
+
"@aphrody/m3-motion": "3.3.7",
|
|
49
|
+
"@aphrody/m3-primitives": "3.3.7",
|
|
45
50
|
"@aphrody/mcp-ui": "7.1.1-aphrody.1",
|
|
46
51
|
"clsx": "^2.1.1",
|
|
47
52
|
"motion": "^13.4.4",
|
|
@@ -50,7 +55,7 @@
|
|
|
50
55
|
"remark-gfm": "^4.0.1"
|
|
51
56
|
},
|
|
52
57
|
"devDependencies": {
|
|
53
|
-
"@aphrody/m3-config": "3.3.
|
|
58
|
+
"@aphrody/m3-config": "3.3.7"
|
|
54
59
|
},
|
|
55
60
|
"peerDependencies": {
|
|
56
61
|
"react": ">=18.0.0",
|
package/src/AgUiEventStream.ts
CHANGED
package/src/ag-ui.ts
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
2
|
+
/**
|
|
3
|
+
* @aphrody/ag-ui
|
|
4
|
+
*
|
|
5
|
+
* Full-stack Bun + TS 7 AG-UI Protocol Suite for Aphrody.
|
|
6
|
+
* Provides typed event-driven agent lifecycle streaming, binary Protobuf transport,
|
|
7
|
+
* A2UI declarative component generation, and Agent-to-User reactive adapters.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
// Core Protocol & Schema
|
|
11
|
+
export * from "@ag-ui/core";
|
|
12
|
+
export { EventEncoder, type EventEncoderParams } from "@ag-ui/encoder";
|
|
13
|
+
export { encode as encodeProto, decode as decodeProto, AGUI_MEDIA_TYPE } from "@ag-ui/proto";
|
|
14
|
+
|
|
15
|
+
// Client runtime & transformers
|
|
16
|
+
export * from "@ag-ui/client";
|
|
17
|
+
|
|
18
|
+
// A2UI Declarative UI Toolkit
|
|
19
|
+
export * from "@ag-ui/a2ui-toolkit";
|
package/src/index.ts
CHANGED
|
@@ -86,7 +86,7 @@ export { TaskCreateForm } from "./TaskCreateForm";
|
|
|
86
86
|
export type { TaskCreateFormProps, TaskCreateFormData } from "./TaskCreateForm";
|
|
87
87
|
|
|
88
88
|
// AG-UI Protocol & Agent-to-User (A2U) Bridge
|
|
89
|
-
export { EventType } from "
|
|
89
|
+
export { EventType } from "./ag-ui";
|
|
90
90
|
export {
|
|
91
91
|
AgUiEventAccumulator,
|
|
92
92
|
agUiEventsToTranscriptSteps,
|