wecool-chat 0.7.1 → 0.8.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 +19 -3
- package/README.ja.md +4 -12
- package/README.md +4 -12
- package/dist/browser-Cgo1GySj.js +1358 -0
- package/dist/core/client.d.ts +20 -1
- package/dist/core/client.d.ts.map +1 -1
- package/dist/core/consume-stream.d.ts +5 -0
- package/dist/core/consume-stream.d.ts.map +1 -1
- package/dist/core/debug-logger.d.ts +26 -0
- package/dist/core/debug-logger.d.ts.map +1 -0
- package/dist/core/i18n/messages.d.ts +21 -0
- package/dist/core/i18n/messages.d.ts.map +1 -1
- package/dist/core/run-conversation.d.ts +12 -0
- package/dist/core/run-conversation.d.ts.map +1 -1
- package/dist/core/tool-runner.d.ts +7 -1
- package/dist/core/tool-runner.d.ts.map +1 -1
- package/dist/core/types.d.ts +67 -4
- package/dist/core/types.d.ts.map +1 -1
- package/dist/define-DZ0itsfG.js +4 -0
- package/dist/index.css +3 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +13558 -18625
- package/dist/messages-B7Kpa6yx.js +117 -0
- package/dist/plugin.d.ts +1 -1
- package/dist/plugin.js +2 -2
- package/dist/plugins/qrcode/tool.d.ts +9 -6
- package/dist/plugins/qrcode/tool.d.ts.map +1 -1
- package/dist/plugins/qrcode.d.ts +1 -1
- package/dist/plugins/qrcode.js +102 -91
- package/dist/ui/components/ChatFooter.d.ts +2 -2
- package/dist/ui/components/ChatFooter.d.ts.map +1 -1
- package/dist/ui/components/ChatHeader.d.ts +10 -1
- package/dist/ui/components/ChatHeader.d.ts.map +1 -1
- package/dist/ui/components/ChatHeaderMenu.d.ts +1 -1
- package/dist/ui/components/ChatHeaderMenu.d.ts.map +1 -1
- package/dist/ui/components/ChatPanel.d.ts +10 -3
- package/dist/ui/components/ChatPanel.d.ts.map +1 -1
- package/dist/ui/components/ChatWidget.d.ts +1 -1
- package/dist/ui/components/ChatWidget.d.ts.map +1 -1
- package/dist/ui/components/ConversationSelect.d.ts +15 -0
- package/dist/ui/components/ConversationSelect.d.ts.map +1 -0
- package/dist/ui/components/CopyIndicator.d.ts +1 -1
- package/dist/ui/components/CopyIndicator.d.ts.map +1 -1
- package/dist/ui/components/FloatButton.d.ts +1 -1
- package/dist/ui/components/FloatButton.d.ts.map +1 -1
- package/dist/ui/components/MessageActionsPopover.d.ts +1 -1
- package/dist/ui/components/MessageActionsPopover.d.ts.map +1 -1
- package/dist/ui/components/MessageAttachments.d.ts +1 -1
- package/dist/ui/components/MessageAttachments.d.ts.map +1 -1
- package/dist/ui/components/MessageBubble.d.ts +1 -1
- package/dist/ui/components/MessageBubble.d.ts.map +1 -1
- package/dist/ui/components/MessageCopyButton.d.ts +1 -1
- package/dist/ui/components/MessageCopyButton.d.ts.map +1 -1
- package/dist/ui/components/MessageEditor.d.ts +1 -1
- package/dist/ui/components/MessageEditor.d.ts.map +1 -1
- package/dist/ui/components/MessageList.d.ts +1 -1
- package/dist/ui/components/MessageList.d.ts.map +1 -1
- package/dist/ui/components/MessagePopoverButton.d.ts +1 -1
- package/dist/ui/components/MessagePopoverButton.d.ts.map +1 -1
- package/dist/ui/components/MessageRow.d.ts +1 -1
- package/dist/ui/components/MessageRow.d.ts.map +1 -1
- package/dist/ui/components/MessageRowActions.d.ts +1 -1
- package/dist/ui/components/MessageRowActions.d.ts.map +1 -1
- package/dist/ui/components/markdown/CodeBlock.d.ts +1 -1
- package/dist/ui/components/markdown/CodeBlock.d.ts.map +1 -1
- package/dist/ui/components/markdown/MarkdownMessage.d.ts +1 -1
- package/dist/ui/components/markdown/MarkdownMessage.d.ts.map +1 -1
- package/dist/ui/components/markdown/trim-autolink-cjk.d.ts +21 -0
- package/dist/ui/components/markdown/trim-autolink-cjk.d.ts.map +1 -0
- package/dist/ui/hooks/use-send-message.d.ts +14 -0
- package/dist/ui/hooks/use-send-message.d.ts.map +1 -1
- package/dist/ui/hooks/useChatStream.d.ts +21 -0
- package/dist/ui/hooks/useChatStream.d.ts.map +1 -1
- package/dist/ui/hooks/useConversationList.d.ts +29 -0
- package/dist/ui/hooks/useConversationList.d.ts.map +1 -0
- package/dist/ui/types.d.ts +6 -0
- package/dist/ui/types.d.ts.map +1 -1
- package/package.json +26 -26
- package/dist/_commonjsHelpers-C6fGbg64.js +0 -6
- package/dist/browser-beO7dF90.js +0 -1538
package/CHANGELOG.md
CHANGED
|
@@ -1,9 +1,25 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
## 0.8.0
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 5984f52: tool 停止シグナルとエラーハンドリングを整備(issue #100)。`ToolHandlerEnvelope` に `stop` フィールドを追加し、tool 側の判断で LLM ループを即終了して `userMessage` を表示できる(`ToolStopSignal` / `ToolStopCategory` 型を export、`forLLM` は optional 化・後方互換)。server `max_turns` SSE イベント追加、`MAX_TOOL_ITERATIONS` 上限到達時は throw でなく i18n 文言(`maxTurnsReached`)を表示。server エラーレスポンスを `{ code, message }` 形式に統一し client の i18n マップで表示、`/api/chat` 入口に zod 検証(message 10000 字 / history 50 件 / toolResults 20 件 / tools 50 件)を導入。公式 qrcode plugin の `text_too_long` を `stop` 経路に移行し、LLM が同じ tool を上限まで再試行する症状を解消。i18n キー追加: `maxTurnsReached` / `stopFallbackUserMessage` / `errorMessageTooLong` / `errorInvalidRequest` / `qrcodeStopTextTooLong`(ja / en)
|
|
8
|
+
- 5984f52: 会話履歴の自動保存・復元(issue #12)。チャット完了ごとにサーバーへ自動保存され、次回ウィジェットを開くと過去の会話一覧から選択してメッセージを復元・再開できる。「新しい会話」ボタンで空のチャットに戻れる。`ChatClient.listConversations()` / `getConversation(sessionId)` / `setConversationId(sessionId)`、`useChatStream` の `initialMessages` オプションと `loadMessages()`、新型 `ConversationSummary` / `ConversationDetail` を追加
|
|
9
|
+
- e5a1807: 開発者向け debug モード追加(issue #36)。`ChatConfig` に `debug?: boolean`(既定 false)を追加し、`debug: true` で初期化すると `[wecool-chat:debug]` プレフィックスで内部イベント(initialized / send / done / error / cancel / unmounted)がブラウザ console に出力される。埋め込み先サイトでのトラブルシューティング用で、メッセージ本文や apiKey 等の秘匿値は出力しない。新型 `DebugLogger` を export
|
|
10
|
+
- 5984f52: `MarkdownMessage` を named export として追加。`import { MarkdownMessage } from "wecool-chat"` でホストアプリから再利用できる
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- 5984f52: 保管型 XSS サニタイズ(サーバー側)。会話保存前に `<>&"'` を文字参照にエスケープする。Markdown 記法への影響なし。`<script>` / `javascript:` 等の攻撃パターンはサーバーログに記録する
|
|
15
|
+
|
|
16
|
+
## [0.7.1] - 2026-06-08
|
|
17
|
+
|
|
18
|
+
### Added
|
|
19
|
+
|
|
20
|
+
- **ホスト連携 API を追加**(issue #168)。`additionalSystemPrompt`(ホストから system prompt を追加)、`onStateChange`(チャット状態変化の通知)、`augmentUserMessage`(送信直前のユーザーメッセージ拡張)。中断 + 再開フローでの会話履歴の整合性を保てるようになった。
|
|
21
|
+
|
|
22
|
+
> 注: 0.7.1 は手動リリース時に CHANGELOG への記録が漏れており、このエントリは後から補完したもの。0.8.0 以降は changesets により自動生成・自動転記される。
|
|
7
23
|
|
|
8
24
|
## [0.7.0] - 2026-06-04
|
|
9
25
|
|
package/README.ja.md
CHANGED
|
@@ -507,9 +507,7 @@ onMounted(() => {
|
|
|
507
507
|
dispose = initWecoolChat({
|
|
508
508
|
endpoint: "https://api.wecool.dev",
|
|
509
509
|
apiKey: import.meta.env.VITE_WECOOL_API_KEY,
|
|
510
|
-
tools: [
|
|
511
|
-
/* ... */
|
|
512
|
-
],
|
|
510
|
+
tools: [/* ... */],
|
|
513
511
|
});
|
|
514
512
|
});
|
|
515
513
|
|
|
@@ -577,9 +575,7 @@ onUnmounted(() => dispose?.());
|
|
|
577
575
|
const dispose = initWecoolChat({
|
|
578
576
|
endpoint: "https://api.wecool.dev",
|
|
579
577
|
apiKey: "<your-api-key>",
|
|
580
|
-
tools: [
|
|
581
|
-
/* ... */
|
|
582
|
-
],
|
|
578
|
+
tools: [/* ... */],
|
|
583
579
|
});
|
|
584
580
|
// window.addEventListener("beforeunload", () => dispose());
|
|
585
581
|
</script>
|
|
@@ -606,9 +602,7 @@ export function Chat() {
|
|
|
606
602
|
dispose.current = initWecoolChat({
|
|
607
603
|
endpoint: process.env.NEXT_PUBLIC_API_URL!,
|
|
608
604
|
apiKey: process.env.NEXT_PUBLIC_WECOOL_API_KEY,
|
|
609
|
-
tools: [
|
|
610
|
-
/* ... */
|
|
611
|
-
],
|
|
605
|
+
tools: [/* ... */],
|
|
612
606
|
});
|
|
613
607
|
// クリーンアップ忘れ注意
|
|
614
608
|
return () => dispose.current?.();
|
|
@@ -783,9 +777,7 @@ const history = [createUserMessage("ダークモードにして")];
|
|
|
783
777
|
|
|
784
778
|
for await (const event of client.chat({
|
|
785
779
|
message: "ダークモードにして",
|
|
786
|
-
tools: [
|
|
787
|
-
/* ToolDefinition[] */
|
|
788
|
-
],
|
|
780
|
+
tools: [/* ToolDefinition[] */],
|
|
789
781
|
history,
|
|
790
782
|
})) {
|
|
791
783
|
switch (event.type) {
|
package/README.md
CHANGED
|
@@ -508,9 +508,7 @@ onMounted(() => {
|
|
|
508
508
|
dispose = initWecoolChat({
|
|
509
509
|
endpoint: "https://api.wecool.dev",
|
|
510
510
|
apiKey: import.meta.env.VITE_WECOOL_API_KEY,
|
|
511
|
-
tools: [
|
|
512
|
-
/* ... */
|
|
513
|
-
],
|
|
511
|
+
tools: [/* ... */],
|
|
514
512
|
});
|
|
515
513
|
});
|
|
516
514
|
|
|
@@ -578,9 +576,7 @@ onUnmounted(() => dispose?.());
|
|
|
578
576
|
const dispose = initWecoolChat({
|
|
579
577
|
endpoint: "https://api.wecool.dev",
|
|
580
578
|
apiKey: "<your-api-key>",
|
|
581
|
-
tools: [
|
|
582
|
-
/* ... */
|
|
583
|
-
],
|
|
579
|
+
tools: [/* ... */],
|
|
584
580
|
});
|
|
585
581
|
// window.addEventListener("beforeunload", () => dispose());
|
|
586
582
|
</script>
|
|
@@ -607,9 +603,7 @@ export function Chat() {
|
|
|
607
603
|
dispose.current = initWecoolChat({
|
|
608
604
|
endpoint: process.env.NEXT_PUBLIC_API_URL!,
|
|
609
605
|
apiKey: process.env.NEXT_PUBLIC_WECOOL_API_KEY,
|
|
610
|
-
tools: [
|
|
611
|
-
/* ... */
|
|
612
|
-
],
|
|
606
|
+
tools: [/* ... */],
|
|
613
607
|
});
|
|
614
608
|
// Don't forget cleanup
|
|
615
609
|
return () => dispose.current?.();
|
|
@@ -788,9 +782,7 @@ const history = [createUserMessage("switch to dark mode")];
|
|
|
788
782
|
|
|
789
783
|
for await (const event of client.chat({
|
|
790
784
|
message: "switch to dark mode",
|
|
791
|
-
tools: [
|
|
792
|
-
/* ToolDefinition[] */
|
|
793
|
-
],
|
|
785
|
+
tools: [/* ToolDefinition[] */],
|
|
794
786
|
history,
|
|
795
787
|
})) {
|
|
796
788
|
switch (event.type) {
|