wecool-chat 0.6.0 → 0.7.1
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/CHANGELOG.md +59 -1
- package/README.ja.md +286 -29
- package/README.md +291 -29
- package/dist/_commonjsHelpers-C6fGbg64.js +6 -0
- package/dist/browser-beO7dF90.js +1538 -0
- package/dist/core/cancellation-log.d.ts.map +1 -0
- package/dist/core/client.d.ts +64 -0
- package/dist/core/client.d.ts.map +1 -0
- package/dist/core/consume-stream.d.ts +28 -0
- package/dist/core/consume-stream.d.ts.map +1 -0
- package/dist/{i18n → core/i18n}/messages.d.ts +4 -0
- package/dist/core/i18n/messages.d.ts.map +1 -0
- package/dist/core/index.d.ts +12 -0
- package/dist/core/index.d.ts.map +1 -0
- package/dist/core/run-conversation.d.ts +50 -0
- package/dist/core/run-conversation.d.ts.map +1 -0
- package/dist/core/sse-parser.d.ts.map +1 -0
- package/dist/core/stream-state.d.ts +63 -0
- package/dist/core/stream-state.d.ts.map +1 -0
- package/dist/{hooks → core}/tool-runner.d.ts +4 -5
- package/dist/core/tool-runner.d.ts.map +1 -0
- package/dist/core/types.d.ts +328 -0
- package/dist/core/types.d.ts.map +1 -0
- package/dist/index.css +1 -1
- package/dist/index.d.ts +32 -14
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +11272 -10467
- package/dist/plugin/context.d.ts +15 -0
- package/dist/plugin/context.d.ts.map +1 -0
- package/dist/plugin/define.d.ts +30 -0
- package/dist/plugin/define.d.ts.map +1 -0
- package/dist/plugin/id.d.ts +19 -0
- package/dist/plugin/id.d.ts.map +1 -0
- package/dist/plugin/index.d.ts +21 -0
- package/dist/plugin/index.d.ts.map +1 -0
- package/dist/plugin/logger.d.ts +11 -0
- package/dist/plugin/logger.d.ts.map +1 -0
- package/dist/plugin/registry.d.ts +21 -0
- package/dist/plugin/registry.d.ts.map +1 -0
- package/dist/plugin/types.d.ts +109 -0
- package/dist/plugin/types.d.ts.map +1 -0
- package/dist/plugin.d.ts +2 -0
- package/dist/plugin.js +4 -0
- package/dist/plugins/qrcode/__tests__/format-result.test.d.ts +2 -0
- package/dist/plugins/qrcode/__tests__/format-result.test.d.ts.map +1 -0
- package/dist/plugins/qrcode/__tests__/index.test.d.ts +2 -0
- package/dist/plugins/qrcode/__tests__/index.test.d.ts.map +1 -0
- package/dist/plugins/qrcode/__tests__/tool.test.d.ts +2 -0
- package/dist/plugins/qrcode/__tests__/tool.test.d.ts.map +1 -0
- package/dist/plugins/qrcode/format-result.d.ts +59 -0
- package/dist/plugins/qrcode/format-result.d.ts.map +1 -0
- package/dist/plugins/qrcode/index.d.ts +23 -0
- package/dist/plugins/qrcode/index.d.ts.map +1 -0
- package/dist/plugins/qrcode/tool.d.ts +50 -0
- package/dist/plugins/qrcode/tool.d.ts.map +1 -0
- package/dist/plugins/qrcode.d.ts +2 -0
- package/dist/plugins/qrcode.js +161 -0
- package/dist/{builtin-tools → ui/builtin-tools}/get-current-page-info.d.ts +1 -1
- package/dist/ui/builtin-tools/get-current-page-info.d.ts.map +1 -0
- package/dist/ui/builtin-tools/index.d.ts.map +1 -0
- package/dist/{builtin-tools → ui/builtin-tools}/merge-builtin-tools.d.ts +1 -1
- package/dist/ui/builtin-tools/merge-builtin-tools.d.ts.map +1 -0
- package/dist/ui/components/ChatFooter.d.ts.map +1 -0
- package/dist/ui/components/ChatHeader.d.ts +15 -0
- package/dist/ui/components/ChatHeader.d.ts.map +1 -0
- package/dist/ui/components/ChatHeaderMenu.d.ts +12 -0
- package/dist/ui/components/ChatHeaderMenu.d.ts.map +1 -0
- package/dist/ui/components/ChatPanel.d.ts +32 -0
- package/dist/ui/components/ChatPanel.d.ts.map +1 -0
- package/dist/ui/components/ChatWidget.d.ts +3 -0
- package/dist/ui/components/ChatWidget.d.ts.map +1 -0
- package/dist/{components → ui/components}/CopyIndicator.d.ts +1 -1
- package/dist/ui/components/CopyIndicator.d.ts.map +1 -0
- package/dist/{components → ui/components}/FloatButton.d.ts +2 -1
- package/dist/ui/components/FloatButton.d.ts.map +1 -0
- package/dist/{components → ui/components}/MessageActionsPopover.d.ts +1 -1
- package/dist/ui/components/MessageActionsPopover.d.ts.map +1 -0
- package/dist/ui/components/MessageAttachments.d.ts +21 -0
- package/dist/ui/components/MessageAttachments.d.ts.map +1 -0
- package/dist/{components → ui/components}/MessageBubble.d.ts +14 -7
- package/dist/ui/components/MessageBubble.d.ts.map +1 -0
- package/dist/{components → ui/components}/MessageCopyButton.d.ts +1 -1
- package/dist/ui/components/MessageCopyButton.d.ts.map +1 -0
- package/dist/{components → ui/components}/MessageEditor.d.ts +1 -1
- package/dist/ui/components/MessageEditor.d.ts.map +1 -0
- package/dist/ui/components/MessageList.d.ts +21 -0
- package/dist/ui/components/MessageList.d.ts.map +1 -0
- package/dist/{components → ui/components}/MessagePopoverButton.d.ts +1 -1
- package/dist/ui/components/MessagePopoverButton.d.ts.map +1 -0
- package/dist/ui/components/MessageRow.d.ts +18 -0
- package/dist/ui/components/MessageRow.d.ts.map +1 -0
- package/dist/{components → ui/components}/MessageRowActions.d.ts +2 -2
- package/dist/ui/components/MessageRowActions.d.ts.map +1 -0
- package/dist/{components → ui/components}/markdown/CodeBlock.d.ts +1 -1
- package/dist/ui/components/markdown/CodeBlock.d.ts.map +1 -0
- package/dist/{components → ui/components}/markdown/MarkdownMessage.d.ts +5 -1
- package/dist/ui/components/markdown/MarkdownMessage.d.ts.map +1 -0
- package/dist/ui/components/markdown/sanitize-clipboard.d.ts.map +1 -0
- package/dist/ui/components/markdown/stable-prefix.d.ts.map +1 -0
- package/dist/ui/components/markdown/strip-data-images.d.ts +2 -0
- package/dist/ui/components/markdown/strip-data-images.d.ts.map +1 -0
- package/dist/ui/components/markdown/url-transform.d.ts.map +1 -0
- package/dist/ui/components/message-row-handlers.d.ts.map +1 -0
- package/dist/ui/hooks/use-editing-message.d.ts.map +1 -0
- package/dist/ui/hooks/use-menu-keyboard.d.ts.map +1 -0
- package/dist/ui/hooks/use-message-history.d.ts +20 -0
- package/dist/ui/hooks/use-message-history.d.ts.map +1 -0
- package/dist/{hooks → ui/hooks}/use-send-message.d.ts +15 -14
- package/dist/ui/hooks/use-send-message.d.ts.map +1 -0
- package/dist/ui/hooks/use-stream-lifecycle.d.ts +80 -0
- package/dist/ui/hooks/use-stream-lifecycle.d.ts.map +1 -0
- package/dist/{hooks → ui/hooks}/use-tool-runner.d.ts +2 -3
- package/dist/ui/hooks/use-tool-runner.d.ts.map +1 -0
- package/dist/ui/hooks/useActiveMessage.d.ts.map +1 -0
- package/dist/{hooks → ui/hooks}/useChatStream.d.ts +21 -3
- package/dist/ui/hooks/useChatStream.d.ts.map +1 -0
- package/dist/ui/hooks/useCopyToClipboard.d.ts.map +1 -0
- package/dist/ui/hooks/useDismissOnOutside.d.ts.map +1 -0
- package/dist/ui/hooks/useDraggablePanel.d.ts +32 -0
- package/dist/ui/hooks/useDraggablePanel.d.ts.map +1 -0
- package/dist/ui/hooks/useFocusTrap.d.ts.map +1 -0
- package/dist/ui/hooks/useMediaQuery.d.ts.map +1 -0
- package/dist/ui/hooks/useScrollToBottom.d.ts +22 -0
- package/dist/ui/hooks/useScrollToBottom.d.ts.map +1 -0
- package/dist/ui/i18n/format-time.d.ts +10 -0
- package/dist/ui/i18n/format-time.d.ts.map +1 -0
- package/dist/ui/i18n/locale-context.d.ts +10 -0
- package/dist/ui/i18n/locale-context.d.ts.map +1 -0
- package/dist/{i18n → ui/i18n}/messages-context.d.ts +1 -1
- package/dist/ui/i18n/messages-context.d.ts.map +1 -0
- package/dist/{mount.d.ts → ui/mount.d.ts} +1 -1
- package/dist/ui/mount.d.ts.map +1 -0
- package/dist/ui/styles/index.d.ts.map +1 -0
- package/dist/ui/types.d.ts +42 -0
- package/dist/ui/types.d.ts.map +1 -0
- package/package.json +23 -3
- package/dist/builtin-tools/get-current-page-info.d.ts.map +0 -1
- package/dist/builtin-tools/index.d.ts.map +0 -1
- package/dist/builtin-tools/merge-builtin-tools.d.ts.map +0 -1
- package/dist/client.d.ts +0 -47
- package/dist/client.d.ts.map +0 -1
- package/dist/components/ChatFooter.d.ts.map +0 -1
- package/dist/components/ChatHeader.d.ts +0 -7
- package/dist/components/ChatHeader.d.ts.map +0 -1
- package/dist/components/ChatPanel.d.ts +0 -22
- package/dist/components/ChatPanel.d.ts.map +0 -1
- package/dist/components/ChatWidget.d.ts +0 -3
- package/dist/components/ChatWidget.d.ts.map +0 -1
- package/dist/components/CopyIndicator.d.ts.map +0 -1
- package/dist/components/FloatButton.d.ts.map +0 -1
- package/dist/components/MessageActionsPopover.d.ts.map +0 -1
- package/dist/components/MessageBubble.d.ts.map +0 -1
- package/dist/components/MessageCopyButton.d.ts.map +0 -1
- package/dist/components/MessageEditor.d.ts.map +0 -1
- package/dist/components/MessageList.d.ts +0 -10
- package/dist/components/MessageList.d.ts.map +0 -1
- package/dist/components/MessagePopoverButton.d.ts.map +0 -1
- package/dist/components/MessageRow.d.ts +0 -17
- package/dist/components/MessageRow.d.ts.map +0 -1
- package/dist/components/MessageRowActions.d.ts.map +0 -1
- package/dist/components/markdown/CodeBlock.d.ts.map +0 -1
- package/dist/components/markdown/MarkdownMessage.d.ts.map +0 -1
- package/dist/components/markdown/sanitize-clipboard.d.ts.map +0 -1
- package/dist/components/markdown/stable-prefix.d.ts.map +0 -1
- package/dist/components/markdown/url-transform.d.ts.map +0 -1
- package/dist/components/message-row-handlers.d.ts.map +0 -1
- package/dist/hooks/cancellation-log.d.ts.map +0 -1
- package/dist/hooks/consume-stream.d.ts +0 -20
- package/dist/hooks/consume-stream.d.ts.map +0 -1
- package/dist/hooks/run-conversation.d.ts +0 -23
- package/dist/hooks/run-conversation.d.ts.map +0 -1
- package/dist/hooks/stream-state.d.ts +0 -23
- package/dist/hooks/stream-state.d.ts.map +0 -1
- package/dist/hooks/tool-runner.d.ts.map +0 -1
- package/dist/hooks/use-editing-message.d.ts.map +0 -1
- package/dist/hooks/use-menu-keyboard.d.ts.map +0 -1
- package/dist/hooks/use-send-message.d.ts.map +0 -1
- package/dist/hooks/use-stream-lifecycle.d.ts +0 -42
- package/dist/hooks/use-stream-lifecycle.d.ts.map +0 -1
- package/dist/hooks/use-tool-runner.d.ts.map +0 -1
- package/dist/hooks/useActiveMessage.d.ts.map +0 -1
- package/dist/hooks/useChatStream.d.ts.map +0 -1
- package/dist/hooks/useCopyToClipboard.d.ts.map +0 -1
- package/dist/hooks/useDismissOnOutside.d.ts.map +0 -1
- package/dist/hooks/useFocusTrap.d.ts.map +0 -1
- package/dist/hooks/useMediaQuery.d.ts.map +0 -1
- package/dist/hooks/useScrollToBottom.d.ts +0 -12
- package/dist/hooks/useScrollToBottom.d.ts.map +0 -1
- package/dist/i18n/messages-context.d.ts.map +0 -1
- package/dist/i18n/messages.d.ts.map +0 -1
- package/dist/mount.d.ts.map +0 -1
- package/dist/sse-parser.d.ts.map +0 -1
- package/dist/styles/index.d.ts.map +0 -1
- package/dist/types.d.ts +0 -148
- package/dist/types.d.ts.map +0 -1
- /package/dist/{hooks → core}/cancellation-log.d.ts +0 -0
- /package/dist/{sse-parser.d.ts → core/sse-parser.d.ts} +0 -0
- /package/dist/{builtin-tools → ui/builtin-tools}/index.d.ts +0 -0
- /package/dist/{components → ui/components}/ChatFooter.d.ts +0 -0
- /package/dist/{components → ui/components}/markdown/sanitize-clipboard.d.ts +0 -0
- /package/dist/{components → ui/components}/markdown/stable-prefix.d.ts +0 -0
- /package/dist/{components → ui/components}/markdown/url-transform.d.ts +0 -0
- /package/dist/{components → ui/components}/message-row-handlers.d.ts +0 -0
- /package/dist/{hooks → ui/hooks}/use-editing-message.d.ts +0 -0
- /package/dist/{hooks → ui/hooks}/use-menu-keyboard.d.ts +0 -0
- /package/dist/{hooks → ui/hooks}/useActiveMessage.d.ts +0 -0
- /package/dist/{hooks → ui/hooks}/useCopyToClipboard.d.ts +0 -0
- /package/dist/{hooks → ui/hooks}/useDismissOnOutside.d.ts +0 -0
- /package/dist/{hooks → ui/hooks}/useFocusTrap.d.ts +0 -0
- /package/dist/{hooks → ui/hooks}/useMediaQuery.d.ts +0 -0
- /package/dist/{styles → ui/styles}/index.d.ts +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cancellation-log.d.ts","sourceRoot":"","sources":["../../src/core/cancellation-log.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,YAAY,GAAG,aAAa,GAAG,eAAe,CAAC;AAE3D,QAAA,MAAM,YAAY,GAAI,KAAK,OAAO,KAAG,OACqB,CAAC;AAE3D;;;;GAIG;AACH,eAAO,MAAM,aAAa,GAAI,KAAK,OAAO,EAAE,QAAQ,WAAW,KAAG,YAAY,GAAG,IAGhF,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,eAAe,GAAI,QAAQ,YAAY,EAAE,SAAS,OAAO,KAAG,IAExE,CAAC;AAEF,OAAO,EAAE,YAAY,EAAE,CAAC"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { ToolDefinition, Message, ChatEvent } from './types';
|
|
2
|
+
type ChatParams = {
|
|
3
|
+
message?: string;
|
|
4
|
+
tools: ToolDefinition[];
|
|
5
|
+
history?: Message[];
|
|
6
|
+
/**
|
|
7
|
+
* LLM がツールを呼べるか制御する。OpenAI 標準の `tool_choice` をそのまま転送する。
|
|
8
|
+
*
|
|
9
|
+
* - `undefined` / `"auto"`: 既定。LLM がツール呼出か text か自由に決める
|
|
10
|
+
* - `"none"`: ツール呼出を禁止し、text のみを返させる。
|
|
11
|
+
* `narrateToolResults` 機構で「tool 結果を語る追加ラウンド」を実行するときに使う
|
|
12
|
+
*/
|
|
13
|
+
toolChoice?: "auto" | "none";
|
|
14
|
+
/**
|
|
15
|
+
* シーン固有の追加システムプロンプト。`ChatConfig.additionalSystemPrompt` から伝搬。
|
|
16
|
+
* 空文字 / undefined のときは payload に乗せず、API 側で従来挙動 (= 共有プロンプトのみ)。
|
|
17
|
+
*/
|
|
18
|
+
additionalSystemPrompt?: string;
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* API client for communicating with the chat backend via SSE
|
|
22
|
+
*/
|
|
23
|
+
export declare class ChatClient {
|
|
24
|
+
private endpoint;
|
|
25
|
+
private apiKey?;
|
|
26
|
+
private conversationId;
|
|
27
|
+
constructor(endpoint: string, apiKey?: string);
|
|
28
|
+
getConversationId(): string;
|
|
29
|
+
resetConversation(): void;
|
|
30
|
+
/**
|
|
31
|
+
* Send a chat message or tool results and receive SSE events.
|
|
32
|
+
*/
|
|
33
|
+
chat(params: ChatParams, signal?: AbortSignal): AsyncGenerator<ChatEvent>;
|
|
34
|
+
private buildHeaders;
|
|
35
|
+
private buildBody;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Create a unique message ID
|
|
39
|
+
*/
|
|
40
|
+
export declare function createMessageId(): string;
|
|
41
|
+
/**
|
|
42
|
+
* Create a user message
|
|
43
|
+
*/
|
|
44
|
+
export declare function createUserMessage(content: string): Message;
|
|
45
|
+
/**
|
|
46
|
+
* Create an assistant message
|
|
47
|
+
*/
|
|
48
|
+
export declare function createAssistantMessage(content: string): Message;
|
|
49
|
+
/**
|
|
50
|
+
* Create an assistant message that represents an error so it can live inline
|
|
51
|
+
* in the message list and be regenerated from the same UI affordance.
|
|
52
|
+
*/
|
|
53
|
+
export declare function createErrorMessage(content: string): Message;
|
|
54
|
+
/**
|
|
55
|
+
* Create a tool result message
|
|
56
|
+
*
|
|
57
|
+
* @param toolCallId - LLM が tool_use を発行したときの一意な call ID。
|
|
58
|
+
* 省略可だが、API へ送る際に `tool_call_id` として再利用するため、
|
|
59
|
+
* 並列で複数 tool を呼ぶシナリオでは必須。
|
|
60
|
+
* @param attachments - UI 添付物 (画像など)。LLM 履歴・バックエンドへは送られない
|
|
61
|
+
*/
|
|
62
|
+
export declare function createToolMessage(toolName: string, args: Record<string, unknown>, result: unknown, toolCallId?: string, attachments?: Message["attachments"]): Message;
|
|
63
|
+
export {};
|
|
64
|
+
//# sourceMappingURL=client.d.ts.map
|
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AAC,MAAM,EAAE,OAAO,CAAC,EAC7B,MAAM,EAAE,OAAO,EACf,UAAU,CAAC,EAAE,MAAM,EACnB,WAAW,CAAC,EAAE,OAAO,CAAC,aAAa,CAAC,GACnC,OAAO,CAcT"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { ChatEvent, Message, ToolUseEvent } from './types';
|
|
2
|
+
import { StreamIdRef } from './stream-state';
|
|
3
|
+
export type StreamRoundResult = {
|
|
4
|
+
toolUses: ToolUseEvent[];
|
|
5
|
+
/** テキスト応答で完結した場合の最終テキスト。tool_use のみのターンでは null */
|
|
6
|
+
finalText: string | null;
|
|
7
|
+
/**
|
|
8
|
+
* 中断時に削除すべき空 placeholder の ID(内容ありなら null)。
|
|
9
|
+
* tool_use のみのターンで text が一切来なかった場合も placeholder は生成しないので null。
|
|
10
|
+
* toolCalls が積まれている placeholder は「空」とは見做さず、保持する。
|
|
11
|
+
*/
|
|
12
|
+
emptyPlaceholderId: string | null;
|
|
13
|
+
/** 本ラウンドで生成した assistant placeholder の ID。後段で削除したい場合に使う */
|
|
14
|
+
placeholderId: string | null;
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* React 非依存の setState 互換型。`useState<Message[]>` の setter 関数はそのまま代入可能。
|
|
18
|
+
*/
|
|
19
|
+
export type SetMessages = (updater: Message[] | ((prev: Message[]) => Message[])) => void;
|
|
20
|
+
/**
|
|
21
|
+
* 1ラウンド分の SSE を消費し、text_delta のストリーミング反映と tool_use の蓄積を行う。
|
|
22
|
+
*
|
|
23
|
+
* 戻り値:
|
|
24
|
+
* - finalText: テキスト応答で完結した場合の本文(履歴追記は呼び出し側で行う = 一方向データフロー)
|
|
25
|
+
* - emptyPlaceholderId: 中断時に削除すべき空 placeholder の ID
|
|
26
|
+
*/
|
|
27
|
+
export declare const consumeStreamRound: (stream: AsyncGenerator<ChatEvent>, setMessages: SetMessages, streamId: number, currentStreamIdRef: StreamIdRef) => Promise<StreamRoundResult>;
|
|
28
|
+
//# sourceMappingURL=consume-stream.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"consume-stream.d.ts","sourceRoot":"","sources":["../../src/core/consume-stream.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAqB,SAAS,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACnF,OAAO,EAAmB,KAAK,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAEnE,MAAM,MAAM,iBAAiB,GAAG;IAC9B,QAAQ,EAAE,YAAY,EAAE,CAAC;IACzB,kDAAkD;IAClD,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB;;;;OAIG;IACH,kBAAkB,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC,0DAA0D;IAC1D,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;CAC9B,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG,CAAC,OAAO,EAAE,OAAO,EAAE,GAAG,CAAC,CAAC,IAAI,EAAE,OAAO,EAAE,KAAK,OAAO,EAAE,CAAC,KAAK,IAAI,CAAC;AAqH1F;;;;;;GAMG;AACH,eAAO,MAAM,kBAAkB,GAC7B,QAAQ,cAAc,CAAC,SAAS,CAAC,EACjC,aAAa,WAAW,EACxB,UAAU,MAAM,EAChB,oBAAoB,WAAW,KAC9B,OAAO,CAAC,iBAAiB,CAuB3B,CAAC"}
|
|
@@ -37,6 +37,10 @@ export type Messages = {
|
|
|
37
37
|
messageLogLabel: string;
|
|
38
38
|
loadingAnnouncement: string;
|
|
39
39
|
inputLabel: string;
|
|
40
|
+
downloadAttachment: string;
|
|
41
|
+
dragHandleLabel: string;
|
|
42
|
+
resetPositionButton: string;
|
|
43
|
+
settingsMenuToggle: string;
|
|
40
44
|
};
|
|
41
45
|
/**
|
|
42
46
|
* 指定 locale のメッセージ集を取得する。未指定 / 未対応 locale は ja を返す。
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"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AAO,MAAM,WAAW,GAAI,SAAS,MAAM,KAAG,QAG7C,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* chat-core の公開エントリポイント。
|
|
3
|
+
* React / DOM 非依存の API のみをまとめて再エクスポートする。
|
|
4
|
+
*
|
|
5
|
+
* 将来 `packages/chat-core` として物理分離する際は、このファイルがそのまま
|
|
6
|
+
* 新パッケージのエントリ(`packages/chat-core/src/index.ts`)になる。
|
|
7
|
+
*/
|
|
8
|
+
export type { Tool, ToolDefinition, ToolParameters, ChatConfig, Message, ToolCall, ChatEvent, } from './types';
|
|
9
|
+
export { ChatClient, createMessageId, createUserMessage, createAssistantMessage, createToolMessage, } from './client';
|
|
10
|
+
export { parseChatSSE } from './sse-parser';
|
|
11
|
+
export { getMessages, type Locale, type Messages } from './i18n/messages';
|
|
12
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/core/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,YAAY,EACV,IAAI,EACJ,cAAc,EACd,cAAc,EACd,UAAU,EACV,OAAO,EACP,QAAQ,EACR,SAAS,GACV,MAAM,SAAS,CAAC;AAEjB,OAAO,EACL,UAAU,EACV,eAAe,EACf,iBAAiB,EACjB,sBAAsB,EACtB,iBAAiB,GAClB,MAAM,UAAU,CAAC;AAElB,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAE5C,OAAO,EAAE,WAAW,EAAE,KAAK,MAAM,EAAE,KAAK,QAAQ,EAAE,MAAM,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { ChatClient } from './client';
|
|
2
|
+
import { Message, ToolDefinition, ToolUseEvent } from './types';
|
|
3
|
+
import { ToolExecution } from './tool-runner';
|
|
4
|
+
import { SetMessages } from './consume-stream';
|
|
5
|
+
import { StreamIdRef } from './stream-state';
|
|
6
|
+
export type RunConversationParams = {
|
|
7
|
+
client: ChatClient;
|
|
8
|
+
toolDefinitions: ToolDefinition[];
|
|
9
|
+
initialMessage: string;
|
|
10
|
+
initialHistory: Message[];
|
|
11
|
+
setMessages: SetMessages;
|
|
12
|
+
runTool: (event: ToolUseEvent, signal: AbortSignal) => Promise<ToolExecution>;
|
|
13
|
+
signal: AbortSignal;
|
|
14
|
+
streamId: number;
|
|
15
|
+
currentStreamIdRef: StreamIdRef;
|
|
16
|
+
removeMessageById: (id: string) => void;
|
|
17
|
+
/**
|
|
18
|
+
* true の場合、tool 実行直後にもう 1 回 LLM (`tool_choice: "none"`) に
|
|
19
|
+
* 問い合わせて text のみを取得し、画面に表示する。
|
|
20
|
+
* 詳細は ChatConfig.narrateToolResults を参照。
|
|
21
|
+
*/
|
|
22
|
+
narrateToolResults?: boolean;
|
|
23
|
+
/** ChatConfig.additionalSystemPrompt をそのまま client.chat へ伝搬 */
|
|
24
|
+
additionalSystemPrompt?: string;
|
|
25
|
+
/**
|
|
26
|
+
* tool 実行フェーズに突入する直前に呼ばれる。
|
|
27
|
+
* 呼び出し側は「LLM ストリーミング中」と「tool 実行中」を区別したいとき、
|
|
28
|
+
* ローディング表示用のフラグを切替えるために使う(awaitConfirmation pending 中も含む)。
|
|
29
|
+
*/
|
|
30
|
+
onToolStart?: () => void;
|
|
31
|
+
/**
|
|
32
|
+
* tool 実行が完了した直後(次の LLM ラウンドに入る直前)に呼ばれる。
|
|
33
|
+
*/
|
|
34
|
+
onToolEnd?: () => void;
|
|
35
|
+
};
|
|
36
|
+
/**
|
|
37
|
+
* チャットの全ラウンドを回す。`MAX_TOOL_ITERATIONS` を超えたら例外で打ち切る。
|
|
38
|
+
*
|
|
39
|
+
* 継続ターン (= iter2+) で `body.message` が空になるため、初回 user 発話が API に
|
|
40
|
+
* 渡らず LLM コンテキストから消える事象があった。これを防ぐため iter1 完了直後に
|
|
41
|
+
* `createUserMessage(initialMessage)` を history に積み、以降の `body.history` に
|
|
42
|
+
* 必ず最新 user 発話が乗るようにする。
|
|
43
|
+
*
|
|
44
|
+
* 重複は起きない: iter1 では history に user 発話は未追加で、`nextMessage` が
|
|
45
|
+
* `body.message` として送られる。iter1 が done を返した時点で append しても、
|
|
46
|
+
* その回の API 送信は既に完了しているため、`body.history` と `body.message` の
|
|
47
|
+
* 二重計上にはならない。
|
|
48
|
+
*/
|
|
49
|
+
export declare const runConversation: (params: RunConversationParams) => Promise<void>;
|
|
50
|
+
//# sourceMappingURL=run-conversation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"run-conversation.d.ts","sourceRoot":"","sources":["../../src/core/run-conversation.ts"],"names":[],"mappings":"AAAA,OAAO,EAA6C,KAAK,UAAU,EAAE,MAAM,UAAU,CAAC;AACtF,OAAO,KAAK,EAAE,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACrE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,EAAsB,KAAK,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACxE,OAAO,EAIL,KAAK,WAAW,EACjB,MAAM,gBAAgB,CAAC;AASxB,MAAM,MAAM,qBAAqB,GAAG;IAClC,MAAM,EAAE,UAAU,CAAC;IACnB,eAAe,EAAE,cAAc,EAAE,CAAC;IAClC,cAAc,EAAE,MAAM,CAAC;IACvB,cAAc,EAAE,OAAO,EAAE,CAAC;IAC1B,WAAW,EAAE,WAAW,CAAC;IACzB,OAAO,EAAE,CAAC,KAAK,EAAE,YAAY,EAAE,MAAM,EAAE,WAAW,KAAK,OAAO,CAAC,aAAa,CAAC,CAAC;IAC9E,MAAM,EAAE,WAAW,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,kBAAkB,EAAE,WAAW,CAAC;IAChC,iBAAiB,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IACxC;;;;OAIG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,8DAA8D;IAC9D,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC;;;;OAIG;IACH,WAAW,CAAC,EAAE,MAAM,IAAI,CAAC;IACzB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;CACxB,CAAC;AAqJF;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,eAAe,GAAU,QAAQ,qBAAqB,KAAG,OAAO,CAAC,IAAI,CA2CjF,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sse-parser.d.ts","sourceRoot":"","sources":["../../src/core/sse-parser.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAEzC;;;GAGG;AACH,wBAAuB,YAAY,CACjC,MAAM,EAAE,cAAc,CAAC,UAAU,CAAC,GAAG,IAAI,GACxC,cAAc,CAAC,SAAS,CAAC,CA4B3B"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { Message, ToolUseEvent } from './types';
|
|
2
|
+
import { SetMessages } from './consume-stream';
|
|
3
|
+
import { ToolExecution } from './tool-runner';
|
|
4
|
+
/**
|
|
5
|
+
* React 非依存の ref 互換型。`useRef<number>(...)` の戻り値はそのまま代入可能。
|
|
6
|
+
*/
|
|
7
|
+
export type StreamIdRef = {
|
|
8
|
+
readonly current: number;
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* 中断時に未応答 tool_use へ注入する synthetic tool_result の中身。
|
|
12
|
+
*
|
|
13
|
+
* Why: OpenAI / Anthropic とも「tool_use の直後に対応する tool_result が必須」のため、
|
|
14
|
+
* 中断で tool_result が出ないままだと次ターン以降の history が破綻する。中断であることを
|
|
15
|
+
* LLM に明示しつつペアリングを保つ。
|
|
16
|
+
*/
|
|
17
|
+
export type InterruptedToolResult = {
|
|
18
|
+
interrupted: true;
|
|
19
|
+
reason: "user_followup";
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* 中断で synthetic 注入する際に使う共通定数。
|
|
23
|
+
* `tool-runner.ts` も abort catch 内でこれを再利用し、`reason` 文字列の typo を型で防ぐ。
|
|
24
|
+
*/
|
|
25
|
+
export declare const INTERRUPTED_RESULT: {
|
|
26
|
+
readonly interrupted: true;
|
|
27
|
+
readonly reason: "user_followup";
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* 現在の sendMessage 呼び出しが「最新ストリーム」かどうか。
|
|
31
|
+
* 古いストリームの遅延 yield / throw を抑止するための判定。
|
|
32
|
+
*/
|
|
33
|
+
export declare const isCurrentStream: (streamId: number, currentRef: StreamIdRef) => boolean;
|
|
34
|
+
/**
|
|
35
|
+
* 与えられた tool_use 群が「まだ history に tool result メッセージとして積まれていない」ものに対し、
|
|
36
|
+
* synthetic tool_result (`{ interrupted: true, reason: "user_followup" }`) を持つ
|
|
37
|
+
* `role:"tool"` メッセージを追加する。
|
|
38
|
+
*
|
|
39
|
+
* Why: ストリーム中断により Promise.all(runTool) が完走せず executions が空のまま
|
|
40
|
+
* runStreamRound から抜けたとき、messages から見ると assistant.toolCalls に対応する
|
|
41
|
+
* tool メッセージが欠落し、history 整合性が壊れる。ここで synthetic を注入して
|
|
42
|
+
* 「中断された」という意味論を残しつつペアリングを成立させる。
|
|
43
|
+
*/
|
|
44
|
+
export declare const appendSyntheticToolResults: (setMessages: SetMessages, toolUses: ToolUseEvent[]) => void;
|
|
45
|
+
/**
|
|
46
|
+
* abort または streamId 不一致を検知したときの後処理。
|
|
47
|
+
*
|
|
48
|
+
* 1. 空 placeholder (text なし & toolCalls なし) を履歴から削除する
|
|
49
|
+
* 2. 未応答の tool_use があれば synthetic tool_result を注入し、history 整合性を保つ
|
|
50
|
+
*
|
|
51
|
+
* 引数 `pendingToolUses` を渡せば、まだ tool 実行に入る前に中断したケースでも
|
|
52
|
+
* 必要な synthetic を補える。
|
|
53
|
+
*/
|
|
54
|
+
export declare const cleanupOnInterruption: (emptyPlaceholderId: string | null, removeMessageById: (id: string) => void, pendingToolUses?: ToolUseEvent[], setMessages?: SetMessages) => void;
|
|
55
|
+
/**
|
|
56
|
+
* Promise.all で並列実行したツール結果を、履歴用 Message 配列に変換する純粋関数。
|
|
57
|
+
*
|
|
58
|
+
* 過去の wecool-chat には別途 `ToolResult` を `body.toolResults` として送る経路があったが、
|
|
59
|
+
* history に積んだ `role:"tool"` メッセージと冗長で、API 側の重複防止フィルタが
|
|
60
|
+
* 過去ターンの tool 結果まで消すバグの温床になっていたため廃止した。
|
|
61
|
+
*/
|
|
62
|
+
export declare const collectToolOutputs: (executions: ToolExecution[]) => Message[];
|
|
63
|
+
//# sourceMappingURL=stream-state.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stream-state.d.ts","sourceRoot":"","sources":["../../src/core/stream-state.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAErD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAEnD;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG;IAAE,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC;AAEvD;;;;;;GAMG;AACH,MAAM,MAAM,qBAAqB,GAAG;IAAE,WAAW,EAAE,IAAI,CAAC;IAAC,MAAM,EAAE,eAAe,CAAA;CAAE,CAAC;AAEnF;;;GAGG;AACH,eAAO,MAAM,kBAAkB;;;CAGW,CAAC;AAE3C;;;GAGG;AACH,eAAO,MAAM,eAAe,GAAI,UAAU,MAAM,EAAE,YAAY,WAAW,KAAG,OAC3C,CAAC;AAElC;;;;;;;;;GASG;AACH,eAAO,MAAM,0BAA0B,GACrC,aAAa,WAAW,EACxB,UAAU,YAAY,EAAE,KACvB,IASF,CAAC;AAEF;;;;;;;;GAQG;AACH,eAAO,MAAM,qBAAqB,GAChC,oBAAoB,MAAM,GAAG,IAAI,EACjC,mBAAmB,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,EACvC,kBAAkB,YAAY,EAAE,EAChC,cAAc,WAAW,KACxB,IAKF,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,kBAAkB,GAAI,YAAY,aAAa,EAAE,KAAG,OAAO,EAMvE,CAAC"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
type ToolUseEvent = Extract<ChatEvent, {
|
|
3
|
-
type: "tool_use";
|
|
4
|
-
}>;
|
|
1
|
+
import { Tool, ToolAttachment, ToolUseEvent } from './types';
|
|
5
2
|
export type ToolExecution = {
|
|
6
3
|
event: ToolUseEvent;
|
|
4
|
+
/** LLM 履歴・バックエンドに送る結果 */
|
|
7
5
|
result: unknown;
|
|
6
|
+
/** UI でだけ描画する添付物。LLM 履歴にもバックエンドにも送らない */
|
|
7
|
+
attachments?: ToolAttachment[];
|
|
8
8
|
};
|
|
9
9
|
export type ToolRunnerCallbacks = {
|
|
10
10
|
onToolExecute?: (toolName: string, args: unknown) => void;
|
|
@@ -20,5 +20,4 @@ export declare const executeToolCall: (event: ToolUseEvent, findTool: (name: str
|
|
|
20
20
|
timeoutMs?: number;
|
|
21
21
|
signal?: AbortSignal;
|
|
22
22
|
}) => Promise<ToolExecution>;
|
|
23
|
-
export {};
|
|
24
23
|
//# sourceMappingURL=tool-runner.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tool-runner.d.ts","sourceRoot":"","sources":["../../src/core/tool-runner.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAGlE,MAAM,MAAM,aAAa,GAAG;IAC1B,KAAK,EAAE,YAAY,CAAC;IACpB,yBAAyB;IACzB,MAAM,EAAE,OAAO,CAAC;IAChB,yCAAyC;IACzC,WAAW,CAAC,EAAE,cAAc,EAAE,CAAC;CAChC,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG;IAChC,aAAa,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IAC1D,YAAY,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,KAAK,IAAI,CAAC;CAC5D,CAAC;AAkDF;;;;;GAKG;AACH,eAAO,MAAM,eAAe,GAC1B,OAAO,YAAY,EACnB,UAAU,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,GAAG,SAAS,EAC5C,SAAS,mBAAmB,GAAG;IAAE,SAAS,CAAC,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,WAAW,CAAA;CAAE,KAC1E,OAAO,CAAC,aAAa,CAmCvB,CAAC"}
|
|
@@ -0,0 +1,328 @@
|
|
|
1
|
+
import { ChatPlugin } from '../plugin/types';
|
|
2
|
+
/**
|
|
3
|
+
* JSON Schema for tool parameters
|
|
4
|
+
*/
|
|
5
|
+
export type ToolParameters = {
|
|
6
|
+
type: "object";
|
|
7
|
+
properties: Record<string, {
|
|
8
|
+
type: "string" | "number" | "boolean" | "array" | "object";
|
|
9
|
+
description?: string;
|
|
10
|
+
enum?: string[];
|
|
11
|
+
items?: {
|
|
12
|
+
type: string;
|
|
13
|
+
};
|
|
14
|
+
}>;
|
|
15
|
+
required?: string[];
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* Tool 実行時に handler が受け取れる任意 context。
|
|
19
|
+
* 既存 user tools は無視できる optional 引数。
|
|
20
|
+
*/
|
|
21
|
+
export type ToolHandlerContext = {
|
|
22
|
+
/** ツール実行ごとの AbortSignal。ストリーム cancel と連動 */
|
|
23
|
+
signal: AbortSignal;
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* Tool が UI 側でだけ表示したい添付物。
|
|
27
|
+
*
|
|
28
|
+
* Why: 画像 base64 のような大きなデータを LLM context / バックエンドリクエストに乗せると
|
|
29
|
+
* 通信・トークン消費が肥大化する。`attachments` に入れた要素は ChatWidget が直接描画し、
|
|
30
|
+
* LLM の履歴・バックエンドペイロードには載らない。
|
|
31
|
+
*
|
|
32
|
+
* 新しい添付物種別が必要になったら、ここに union メンバーを追加する (`pluginApiVersion: 1` 互換)。
|
|
33
|
+
*/
|
|
34
|
+
export type ToolAttachment = {
|
|
35
|
+
type: "image";
|
|
36
|
+
/** PNG / JPEG / GIF / WebP のみ許可。SVG は XSS 経路があるため拒否 */
|
|
37
|
+
mimeType: "image/png" | "image/jpeg" | "image/gif" | "image/webp";
|
|
38
|
+
/** base64 本体 (data URL の `data:...,` プレフィックスは含めない) */
|
|
39
|
+
base64: string;
|
|
40
|
+
/** alt テキスト。スクリーンリーダー向け */
|
|
41
|
+
alt?: string;
|
|
42
|
+
/** 表示の意味的タイトル (省略可) */
|
|
43
|
+
title?: string;
|
|
44
|
+
/**
|
|
45
|
+
* ユーザーが DL ボタンを押したとき保存するファイル名 (省略時は ChatWidget が生成)。
|
|
46
|
+
* 拡張子は省略しても良い (mimeType から推定される)。
|
|
47
|
+
*/
|
|
48
|
+
filename?: string;
|
|
49
|
+
};
|
|
50
|
+
/**
|
|
51
|
+
* Tool handler が `{ forLLM, attachments }` の 2 経路に分けて結果を返すための封筒。
|
|
52
|
+
*
|
|
53
|
+
* - `forLLM`: 従来通り LLM 履歴・バックエンドへ送られる
|
|
54
|
+
* - `attachments`: ChatWidget が UI として描画するだけで LLM 履歴にもバックエンドにも送らない
|
|
55
|
+
*
|
|
56
|
+
* handler が plain な値を return した場合は従来動作 (全て LLM 履歴行き) を維持する。
|
|
57
|
+
*/
|
|
58
|
+
export type ToolHandlerEnvelope = {
|
|
59
|
+
forLLM: unknown;
|
|
60
|
+
attachments?: ToolAttachment[];
|
|
61
|
+
};
|
|
62
|
+
/**
|
|
63
|
+
* Tool definition that can be executed by the LLM
|
|
64
|
+
*/
|
|
65
|
+
export type Tool = {
|
|
66
|
+
/** Unique identifier for the tool */
|
|
67
|
+
name: string;
|
|
68
|
+
/** Human-readable description for the LLM to understand when to use this tool */
|
|
69
|
+
description: string;
|
|
70
|
+
/** JSON Schema defining the expected parameters */
|
|
71
|
+
parameters: ToolParameters;
|
|
72
|
+
/** Function to execute when the LLM calls this tool. ctx は optional で既存実装と互換 */
|
|
73
|
+
handler: (args: Record<string, unknown>, ctx?: ToolHandlerContext) => unknown | Promise<unknown>;
|
|
74
|
+
};
|
|
75
|
+
/**
|
|
76
|
+
* Tool definition sent to the API (without handler)
|
|
77
|
+
*/
|
|
78
|
+
export type ToolDefinition = {
|
|
79
|
+
name: string;
|
|
80
|
+
description: string;
|
|
81
|
+
parameters: ToolParameters;
|
|
82
|
+
};
|
|
83
|
+
/**
|
|
84
|
+
* Configuration for initializing the chat widget
|
|
85
|
+
*/
|
|
86
|
+
export type ChatConfig = {
|
|
87
|
+
/** API endpoint URL */
|
|
88
|
+
endpoint: string;
|
|
89
|
+
/** API key for authentication */
|
|
90
|
+
apiKey?: string;
|
|
91
|
+
/** List of tools available to the LLM */
|
|
92
|
+
tools: Tool[];
|
|
93
|
+
/** UI language */
|
|
94
|
+
locale?: "ja" | "en";
|
|
95
|
+
/** Callback when a tool is about to be executed */
|
|
96
|
+
onToolExecute?: (toolName: string, args: unknown) => void;
|
|
97
|
+
/** Callback when a tool execution completes */
|
|
98
|
+
onToolResult?: (toolName: string, result: unknown) => void;
|
|
99
|
+
/** Callback when an error occurs */
|
|
100
|
+
onError?: (error: Error) => void;
|
|
101
|
+
/** Timeout in milliseconds for tool handler execution (default: 30000) */
|
|
102
|
+
toolTimeout?: number;
|
|
103
|
+
/** Custom class name for the widget container */
|
|
104
|
+
className?: string;
|
|
105
|
+
/** Placeholder text for the input field */
|
|
106
|
+
placeholder?: string;
|
|
107
|
+
/**
|
|
108
|
+
* Color theme.
|
|
109
|
+
* - `"auto"` (default behavior when explicitly set): follow OS `prefers-color-scheme`.
|
|
110
|
+
* - `"light"` (default): force light theme. Existing behavior, ensures backward compat.
|
|
111
|
+
* - `"dark"`: force dark theme.
|
|
112
|
+
*
|
|
113
|
+
* `"auto"` のときは `data-wecool-theme` 属性を付けず CSS の @media に委ねる
|
|
114
|
+
* (JS マウント遅延に起因するライト→ダーク切替フラッシュを回避)。
|
|
115
|
+
*/
|
|
116
|
+
theme?: "auto" | "light" | "dark";
|
|
117
|
+
/**
|
|
118
|
+
* Shadow DOM へのマウントを無効化する逃げ道(既定は false = Shadow 有効)。
|
|
119
|
+
* E2E テスト等で Shadow 越しに DOM を覗くのが面倒な場合の互換オプション。
|
|
120
|
+
*/
|
|
121
|
+
disableShadowDom?: boolean;
|
|
122
|
+
/**
|
|
123
|
+
* チャットウィジェットの配置パターン。
|
|
124
|
+
*
|
|
125
|
+
* 未指定時の挙動 (後方互換):
|
|
126
|
+
* - `initWecoolChat` で container を渡さない → `floating-bottom-right` 相当
|
|
127
|
+
* - container を渡す → コンテナ内に埋め込み (旧 inline)
|
|
128
|
+
*
|
|
129
|
+
* パターン一覧:
|
|
130
|
+
* - `floating-bottom-right` / `floating-bottom-left` / `floating-top-right` / `floating-top-left`:
|
|
131
|
+
* 画面四隅にフロートする小窓型 (既存 floating の四方向版)
|
|
132
|
+
* - `sidebar-left` / `sidebar-right`:
|
|
133
|
+
* 画面端に約 360px の固定パネルを置く (Education のような常時相談型)
|
|
134
|
+
* - `header-banner`:
|
|
135
|
+
* 画面上端に横長バナーとして固定 (Travel のような相談カウンター型)。
|
|
136
|
+
* `transparent: true` を併用すると背景を半透明化して本文を透かす
|
|
137
|
+
* - `footer-fixed`:
|
|
138
|
+
* 画面下端に横長で固定 (簡易な常時表示型)
|
|
139
|
+
* - `inline-custom`:
|
|
140
|
+
* Shadow DOM を解除し、ホスト DOM に直接マウント。レイアウトは利用者が完全制御。
|
|
141
|
+
* `disableShadowDom: true` と同等の機能だが、意図 (= カスタムレイアウト想定) を名前で示す
|
|
142
|
+
* - `input-only`:
|
|
143
|
+
* 入力欄 (送信欄 + 送信/クリア/停止ボタン) だけをマウントする最小モード。
|
|
144
|
+
* メッセージ履歴とヘッダーは描画しない。ホスト側で message 一覧を独自描画したい場合に使う
|
|
145
|
+
* (合わせて `onMessagesChange` で message 配列を受け取る)。Shadow DOM は解除される。
|
|
146
|
+
*/
|
|
147
|
+
layout?: "floating-bottom-right" | "floating-bottom-left" | "floating-top-right" | "floating-top-left" | "sidebar-left" | "sidebar-right" | "header-banner" | "footer-fixed" | "inline-custom" | "input-only";
|
|
148
|
+
/**
|
|
149
|
+
* `layout: "header-banner"` のとき背景を半透明にし、本文を透かして見せる。
|
|
150
|
+
* 他の layout では無視される。
|
|
151
|
+
*/
|
|
152
|
+
transparent?: boolean;
|
|
153
|
+
/**
|
|
154
|
+
* チャット履歴 (Message[]) が変化するたびに呼ばれる callback。
|
|
155
|
+
* ホスト側で会話履歴を独自描画したい場合や、`layout: "input-only"` で
|
|
156
|
+
* ヘッダー / メッセージリスト非表示にして本文側に積む構成のときに使う。
|
|
157
|
+
* 値は wecool 内部 useChatStream の messages のスナップショット (同一参照ではない)。
|
|
158
|
+
*/
|
|
159
|
+
onMessagesChange?: (messages: Message[]) => void;
|
|
160
|
+
/**
|
|
161
|
+
* Plugin システムで読み込む plugin の配列。
|
|
162
|
+
* 各 plugin の `setup` は宣言順に実行される。
|
|
163
|
+
* 1 つの plugin の例外は他に影響しない。
|
|
164
|
+
*
|
|
165
|
+
* @since 0.7.0
|
|
166
|
+
*/
|
|
167
|
+
plugins?: ChatPlugin[];
|
|
168
|
+
/**
|
|
169
|
+
* tool 実行後、その結果を LLM に自然言語で語らせる追加ラウンドを挟むか。
|
|
170
|
+
*
|
|
171
|
+
* - `true`: tool 実行直後にもう 1 回 LLM に問い合わせ (`tool_choice: "none"`)、
|
|
172
|
+
* text のみを取得して画面に表示する。複数 tool 連鎖シーン (店内 QR 注文等)
|
|
173
|
+
* で「各 tool 後に AI コメントが入る」会話感を出すために使う。
|
|
174
|
+
* - `false` / 未指定 (既定): 追加ラウンドを行わない。従来挙動。
|
|
175
|
+
*
|
|
176
|
+
* 副作用: OpenAI 呼出回数が増える (≈ 2 倍)。料金影響を避けたいシーンでは
|
|
177
|
+
* 有効化しないこと。
|
|
178
|
+
*
|
|
179
|
+
* @since 0.8.0
|
|
180
|
+
*/
|
|
181
|
+
narrateToolResults?: boolean;
|
|
182
|
+
/**
|
|
183
|
+
* シーン固有の追加システムプロンプト。最大 4000 文字、共有プロンプト末尾に append される。
|
|
184
|
+
*
|
|
185
|
+
* Why: 共有 SYSTEM_PROMPTS.CHAT (汎用方針) を汚さず、シーン (例: dining 店内 QR 注文) 側から
|
|
186
|
+
* 「注文外発話を抑制」「経路B 用の set_value/confirm_value ガイダンス」のような
|
|
187
|
+
* 局所制約を流し込みたい。`packages/chat` 自身はドメイン非依存を維持するため、
|
|
188
|
+
* 文字列の中身はホスト側が組み立てる。
|
|
189
|
+
*
|
|
190
|
+
* @since 0.9.0
|
|
191
|
+
*/
|
|
192
|
+
additionalSystemPrompt?: string;
|
|
193
|
+
/**
|
|
194
|
+
* チャットのライフサイクル状態 (LLM ストリーミング中 / ツール実行中) が変化したときに呼ばれる。
|
|
195
|
+
*
|
|
196
|
+
* Why: `layout: "input-only"` 等で wecool-chat の標準 UI を使わず、ホスト側で
|
|
197
|
+
* 独自にローディング表示を制御したいときに、内部の isStreaming / isToolPending を
|
|
198
|
+
* 購読する正規経路として用意する。
|
|
199
|
+
*
|
|
200
|
+
* 発火条件: 前回通知した state と比較していずれかが変化したターンのみ。
|
|
201
|
+
* 連続 true → true のような無変化遷移では発火しない。
|
|
202
|
+
*
|
|
203
|
+
* @since 0.9.0
|
|
204
|
+
*/
|
|
205
|
+
onStateChange?: (state: ChatState) => void;
|
|
206
|
+
/**
|
|
207
|
+
* 送信前に user message を加工する hook。ホスト側で動的 context (画面状態 / ページ情報等) を
|
|
208
|
+
* user message に注入できる。業界標準パターン (Claude Code / Vercel AI SDK / OpenAI 推奨) に
|
|
209
|
+
* 倣い、毎ターン変化する状態は system prompt ではなく user message 側に乗せて
|
|
210
|
+
* プロンプトキャッシュを温存する。
|
|
211
|
+
*
|
|
212
|
+
* 戻り値で元の text を完全に置換する。元の text は破棄され、加工結果が API に送られる。
|
|
213
|
+
* 未指定なら user message は素通し (後方互換)。
|
|
214
|
+
*
|
|
215
|
+
* @since 0.9.0
|
|
216
|
+
*/
|
|
217
|
+
augmentUserMessage?: (text: string) => string;
|
|
218
|
+
};
|
|
219
|
+
/**
|
|
220
|
+
* チャットのライフサイクル状態。`onStateChange` callback に渡される。
|
|
221
|
+
*
|
|
222
|
+
* Why: フラットな callback (`onStreamingChange`) を状態ごとに増殖させると将来追加 (permission 待ち、
|
|
223
|
+
* queue 中等) でシグネチャが膨れ、ホスト側の購読コードも増える。最初からオブジェクト型にすることで、
|
|
224
|
+
* 将来 optional フィールドを追加するだけで購読側のシグネチャを維持できる。
|
|
225
|
+
*/
|
|
226
|
+
export type ChatState = {
|
|
227
|
+
/** LLM SSE 受信中 (text_delta / tool_use 受信中) */
|
|
228
|
+
isStreaming: boolean;
|
|
229
|
+
/** ツール handler 実行中 (awaitConfirmation 等の pending を含む) */
|
|
230
|
+
isToolPending: boolean;
|
|
231
|
+
};
|
|
232
|
+
/**
|
|
233
|
+
* assistant メッセージが発行した tool_use を保持するための型。
|
|
234
|
+
*
|
|
235
|
+
* Why: ストリーム中断時に「assistant が tool_use を呼んだが tool_result がまだ無い」
|
|
236
|
+
* 状態を後段で検出するために必要。`role:"assistant"` メッセージにこの配列を持たせると、
|
|
237
|
+
* 中断後の cleanup で「未応答 tool_use 一覧」をここから抽出できる。
|
|
238
|
+
*
|
|
239
|
+
* LLM プロバイダへ送る tool_calls とは別物 (API へは `role:"tool"` メッセージから
|
|
240
|
+
* `expandToolMessage` で展開される)。クライアント内部の整合性管理用フィールド。
|
|
241
|
+
*/
|
|
242
|
+
export type AssistantToolCall = {
|
|
243
|
+
toolCallId: string;
|
|
244
|
+
name: string;
|
|
245
|
+
input: Record<string, unknown>;
|
|
246
|
+
};
|
|
247
|
+
/**
|
|
248
|
+
* Chat message
|
|
249
|
+
*/
|
|
250
|
+
export type Message = {
|
|
251
|
+
id: string;
|
|
252
|
+
role: "user" | "assistant" | "system" | "tool";
|
|
253
|
+
content: string;
|
|
254
|
+
timestamp: number;
|
|
255
|
+
toolCall?: {
|
|
256
|
+
name: string;
|
|
257
|
+
arguments: Record<string, unknown>;
|
|
258
|
+
};
|
|
259
|
+
/**
|
|
260
|
+
* LLM (OpenAI 等) が tool_use を発行したときに付ける一意な call ID。
|
|
261
|
+
* 同じターンで同一 tool を複数回呼んだ場合でも個別に識別するために必要。
|
|
262
|
+
* `role:"tool"` メッセージにこの ID を保持し、API へ送る際に `tool_call_id` として
|
|
263
|
+
* 元の assistant.tool_calls[].id と紐づける。
|
|
264
|
+
*/
|
|
265
|
+
toolCallId?: string;
|
|
266
|
+
toolResult?: unknown;
|
|
267
|
+
/**
|
|
268
|
+
* assistant ロールにのみ立つ。本メッセージが発行した tool_use のリスト。
|
|
269
|
+
* 中断時に「未応答の tool_use」を検出して synthetic tool_result を注入するために使う。
|
|
270
|
+
*
|
|
271
|
+
* 通常完了時は対応する `role:"tool"` メッセージが直後に積まれるため、API への
|
|
272
|
+
* 送信には影響しない (`buildBody` は本フィールドを送信しない)。
|
|
273
|
+
*/
|
|
274
|
+
toolCalls?: AssistantToolCall[];
|
|
275
|
+
/**
|
|
276
|
+
* tool 実行が返した UI 添付物。LLM 履歴・バックエンドには送られず、ChatWidget が描画する。
|
|
277
|
+
* `tool` ロールのメッセージにのみ立つ。
|
|
278
|
+
*/
|
|
279
|
+
attachments?: ToolAttachment[];
|
|
280
|
+
/** assistant ロールにのみ立つ。エラー由来の行であることを示す */
|
|
281
|
+
isError?: boolean;
|
|
282
|
+
/**
|
|
283
|
+
* API (LLM) 送信時に `content` の代わりに使う本文。指定時のみ送信側で置換され、UI 表示には影響しない。
|
|
284
|
+
*
|
|
285
|
+
* Why: `augmentUserMessage` で動的 context (画面状態等) を user message に注入したいが、
|
|
286
|
+
* ユーザーが見るチャット履歴には素のテキストだけ出したい、というケースを満たすため、
|
|
287
|
+
* 「表示用 content」と「送信用 content」を 1 つの message に同梱する。
|
|
288
|
+
*/
|
|
289
|
+
contentForApi?: string;
|
|
290
|
+
};
|
|
291
|
+
/**
|
|
292
|
+
* Tool call from the API
|
|
293
|
+
*/
|
|
294
|
+
export type ToolCall = {
|
|
295
|
+
name: string;
|
|
296
|
+
arguments: Record<string, unknown>;
|
|
297
|
+
};
|
|
298
|
+
/**
|
|
299
|
+
* SSE event received from the server
|
|
300
|
+
*/
|
|
301
|
+
export type ChatEvent = {
|
|
302
|
+
type: "thinking";
|
|
303
|
+
status: string;
|
|
304
|
+
} | {
|
|
305
|
+
type: "tool_use";
|
|
306
|
+
toolCallId: string;
|
|
307
|
+
name: string;
|
|
308
|
+
input: Record<string, unknown>;
|
|
309
|
+
} | {
|
|
310
|
+
type: "text";
|
|
311
|
+
content: string;
|
|
312
|
+
} | {
|
|
313
|
+
type: "text_delta";
|
|
314
|
+
delta: string;
|
|
315
|
+
} | {
|
|
316
|
+
type: "error";
|
|
317
|
+
message: string;
|
|
318
|
+
} | {
|
|
319
|
+
type: "done";
|
|
320
|
+
conversationId: string;
|
|
321
|
+
};
|
|
322
|
+
/**
|
|
323
|
+
* `ChatEvent` のうち tool_use 種別のみを抜き出した派生型。
|
|
324
|
+
*/
|
|
325
|
+
export type ToolUseEvent = Extract<ChatEvent, {
|
|
326
|
+
type: "tool_use";
|
|
327
|
+
}>;
|
|
328
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/core/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAElD;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG;IAC3B,IAAI,EAAE,QAA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