wecool-chat 0.6.0 → 0.7.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/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/{client.d.ts → core/client.d.ts} +15 -3
- package/dist/core/client.d.ts.map +1 -0
- package/dist/{hooks → core}/consume-stream.d.ts +9 -5
- 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 +38 -0
- package/dist/core/run-conversation.d.ts.map +1 -0
- package/dist/core/sse-parser.d.ts.map +1 -0
- package/dist/{hooks → core}/stream-state.d.ts +14 -11
- 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 +248 -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 +11062 -10369
- 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/{components → ui/components}/ChatPanel.d.ts +9 -2
- 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/{components → ui/components}/MessageList.d.ts +1 -1
- 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 +8 -14
- package/dist/ui/hooks/use-send-message.d.ts.map +1 -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 +5 -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.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.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.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.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.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.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}/use-stream-lifecycle.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
package/dist/index.d.ts
CHANGED
|
@@ -1,25 +1,43 @@
|
|
|
1
|
-
import { ChatWidget } from './components/ChatWidget';
|
|
2
|
-
import { ChatConfig } from './types';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
import { ChatWidget } from './ui/components/ChatWidget';
|
|
2
|
+
import { ChatConfig } from './core/types';
|
|
3
|
+
import { WecoolChatControls } from './ui/types';
|
|
4
|
+
/**
|
|
5
|
+
* `initWecoolChat` の戻り値型。
|
|
6
|
+
*
|
|
7
|
+
* 呼び出し可能な cleanup 関数として動作 (= 旧 API 互換) しつつ、
|
|
8
|
+
* `controller.sendMessage(...)` のようにメソッドからチャットを操作できる。
|
|
9
|
+
*
|
|
10
|
+
* controls の各メソッドはマウント完了後に有効になる。マウント前 or マウント後すぐは
|
|
11
|
+
* no-op のため、利用者は ref パターンや requestAnimationFrame で初期化完了を待つこと。
|
|
12
|
+
*/
|
|
13
|
+
export type WecoolChatController = (() => void) & WecoolChatControls;
|
|
14
|
+
export type { Tool, ToolDefinition, ToolParameters, ToolHandlerContext, ChatConfig, Message, ToolCall, ChatEvent, } from './core/types';
|
|
15
|
+
export type { ChatPlugin, PluginApiVersion, PluginContext, PluginId, PluginLogger, PluginTool, PluginToolInvocation, } from './plugin/types';
|
|
16
|
+
export { definePlugin } from './plugin/define';
|
|
17
|
+
export type { ChatWidgetProps, WecoolChatControls } from './ui/types';
|
|
18
|
+
export { ChatWidget } from './ui/components/ChatWidget';
|
|
19
|
+
export { ChatPanel } from './ui/components/ChatPanel';
|
|
20
|
+
export { ChatHeader } from './ui/components/ChatHeader';
|
|
21
|
+
export { ChatFooter } from './ui/components/ChatFooter';
|
|
22
|
+
export { MessageList } from './ui/components/MessageList';
|
|
23
|
+
export { FloatButton } from './ui/components/FloatButton';
|
|
24
|
+
export { ChatClient, createMessageId, createUserMessage, createAssistantMessage, createToolMessage, } from './core/client';
|
|
25
|
+
export { getCurrentPageInfo, mergeBuiltinTools } from './ui/builtin-tools';
|
|
12
26
|
/**
|
|
13
27
|
* Initialize the chat widget and mount it to the DOM.
|
|
14
28
|
*
|
|
15
29
|
* 既定では Shadow DOM 内へマウントして埋込先サイトの CSS から完全分離する。
|
|
16
|
-
* `config.disableShadowDom: true`
|
|
30
|
+
* `config.disableShadowDom: true` または `config.layout: "inline-custom"` / `"input-only"`
|
|
31
|
+
* を渡すと通常 DOM へ直マウントする。
|
|
32
|
+
*
|
|
33
|
+
* 戻り値は callable な controller で、関数として呼ぶと unmount、メソッドからは
|
|
34
|
+
* sendMessage / editMessage / regenerate / clear / cancel を実行できる。
|
|
17
35
|
*
|
|
18
36
|
* @param config - Chat configuration
|
|
19
37
|
* @param container - Container element or selector (default: creates a new div)
|
|
20
|
-
* @returns
|
|
38
|
+
* @returns Callable controller (関数呼び出しで unmount、メソッドで操作)
|
|
21
39
|
*/
|
|
22
|
-
export declare function initWecoolChat(config: ChatConfig, container?: HTMLElement | string):
|
|
40
|
+
export declare function initWecoolChat(config: ChatConfig, container?: HTMLElement | string): WecoolChatController;
|
|
23
41
|
declare const _default: {
|
|
24
42
|
initWecoolChat: typeof initWecoolChat;
|
|
25
43
|
ChatWidget: typeof ChatWidget;
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA,OAAO,sBAAsB,CAAC;AAC9B,OAAO,0BAA0B,CAAC;AAClC,OAAO,gCAAgC,CAAC;AACxC,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAExD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,KAAK,EAAmB,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAEtE;;;;;;;;GAQG;AACH,MAAM,MAAM,oBAAoB,GAAG,CAAC,MAAM,IAAI,CAAC,GAAG,kBAAkB,CAAC;AAGrE,YAAY,EACV,IAAI,EACJ,cAAc,EACd,cAAc,EACd,kBAAkB,EAClB,UAAU,EACV,OAAO,EACP,QAAQ,EACR,SAAS,GACV,MAAM,cAAc,CAAC;AAItB,YAAY,EACV,UAAU,EACV,gBAAgB,EAChB,aAAa,EACb,QAAQ,EACR,YAAY,EACZ,UAAU,EACV,oBAAoB,GACrB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAG/C,YAAY,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAGtE,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AACxD,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AACtD,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AACxD,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AACxD,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAC1D,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAG1D,OAAO,EACL,UAAU,EACV,eAAe,EACf,iBAAiB,EACjB,sBAAsB,EACtB,iBAAiB,GAClB,MAAM,eAAe,CAAC;AAGvB,OAAO,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAuD3E;;;;;;;;;;;;;GAaG;AACH,wBAAgB,cAAc,CAC5B,MAAM,EAAE,UAAU,EAClB,SAAS,CAAC,EAAE,WAAW,GAAG,MAAM,GAC/B,oBAAoB,CAoFtB;;;;;AAGD,wBAA8C"}
|