wecool-chat 0.7.1 → 0.9.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.
Files changed (201) hide show
  1. package/CHANGELOG.md +50 -3
  2. package/README.ja.md +161 -13
  3. package/README.md +301 -33
  4. package/dist/CopyIndicator-D50ixqNB.js +407 -0
  5. package/dist/MarkdownBody-eopKrDot.js +19983 -0
  6. package/dist/abort-BjeyCmGn.js +6 -0
  7. package/dist/browser-D1aZQhQL.js +1358 -0
  8. package/dist/core/client.d.ts +46 -2
  9. package/dist/core/client.d.ts.map +1 -1
  10. package/dist/core/consume-stream.d.ts +5 -0
  11. package/dist/core/consume-stream.d.ts.map +1 -1
  12. package/dist/core/debug-logger.d.ts +26 -0
  13. package/dist/core/debug-logger.d.ts.map +1 -0
  14. package/dist/core/error-reporter.d.ts +59 -0
  15. package/dist/core/error-reporter.d.ts.map +1 -0
  16. package/dist/core/global-error-capture.d.ts +10 -0
  17. package/dist/core/global-error-capture.d.ts.map +1 -0
  18. package/dist/core/i18n/messages.d.ts +83 -0
  19. package/dist/core/i18n/messages.d.ts.map +1 -1
  20. package/dist/core/run-conversation.d.ts +12 -0
  21. package/dist/core/run-conversation.d.ts.map +1 -1
  22. package/dist/core/sanitize-user-message.d.ts +11 -0
  23. package/dist/core/sanitize-user-message.d.ts.map +1 -0
  24. package/dist/core/stream-state.d.ts.map +1 -1
  25. package/dist/core/tool-confirmation.d.ts +35 -0
  26. package/dist/core/tool-confirmation.d.ts.map +1 -0
  27. package/dist/core/tool-runner.d.ts +15 -1
  28. package/dist/core/tool-runner.d.ts.map +1 -1
  29. package/dist/core/types.d.ts +168 -4
  30. package/dist/core/types.d.ts.map +1 -1
  31. package/dist/core/widget-origin.d.ts +33 -0
  32. package/dist/core/widget-origin.d.ts.map +1 -0
  33. package/dist/define-DZ0itsfG.js +4 -0
  34. package/dist/index.css +3 -1
  35. package/dist/index.d.ts +5 -1
  36. package/dist/index.d.ts.map +1 -1
  37. package/dist/index.js +8421 -32540
  38. package/dist/loader.d.ts +12 -0
  39. package/dist/loader.d.ts.map +1 -0
  40. package/dist/messages-CveZLPSJ.js +175 -0
  41. package/dist/observe/__tests__/format.test.d.ts +2 -0
  42. package/dist/observe/__tests__/format.test.d.ts.map +1 -0
  43. package/dist/observe/__tests__/http.test.d.ts +2 -0
  44. package/dist/observe/__tests__/http.test.d.ts.map +1 -0
  45. package/dist/observe/__tests__/index.test.d.ts +2 -0
  46. package/dist/observe/__tests__/index.test.d.ts.map +1 -0
  47. package/dist/observe/__tests__/js-error.test.d.ts +2 -0
  48. package/dist/observe/__tests__/js-error.test.d.ts.map +1 -0
  49. package/dist/observe/__tests__/redact.test.d.ts +2 -0
  50. package/dist/observe/__tests__/redact.test.d.ts.map +1 -0
  51. package/dist/observe/__tests__/ring-buffer.test.d.ts +2 -0
  52. package/dist/observe/__tests__/ring-buffer.test.d.ts.map +1 -0
  53. package/dist/observe/format.d.ts +10 -0
  54. package/dist/observe/format.d.ts.map +1 -0
  55. package/dist/observe/index.d.ts +33 -0
  56. package/dist/observe/index.d.ts.map +1 -0
  57. package/dist/observe/observers/http.d.ts +24 -0
  58. package/dist/observe/observers/http.d.ts.map +1 -0
  59. package/dist/observe/observers/js-error.d.ts +22 -0
  60. package/dist/observe/observers/js-error.d.ts.map +1 -0
  61. package/dist/observe/redact.d.ts +27 -0
  62. package/dist/observe/redact.d.ts.map +1 -0
  63. package/dist/observe/ring-buffer.d.ts +20 -0
  64. package/dist/observe/ring-buffer.d.ts.map +1 -0
  65. package/dist/observe/types.d.ts +25 -0
  66. package/dist/observe/types.d.ts.map +1 -0
  67. package/dist/plugin/registry.d.ts.map +1 -1
  68. package/dist/plugin/types.d.ts +19 -1
  69. package/dist/plugin/types.d.ts.map +1 -1
  70. package/dist/plugin.d.ts +1 -1
  71. package/dist/plugin.js +2 -2
  72. package/dist/plugins/page-reader/__tests__/get-meta.test.d.ts +2 -0
  73. package/dist/plugins/page-reader/__tests__/get-meta.test.d.ts.map +1 -0
  74. package/dist/plugins/page-reader/__tests__/index.test.d.ts +2 -0
  75. package/dist/plugins/page-reader/__tests__/index.test.d.ts.map +1 -0
  76. package/dist/plugins/page-reader/__tests__/read-content.test.d.ts +2 -0
  77. package/dist/plugins/page-reader/__tests__/read-content.test.d.ts.map +1 -0
  78. package/dist/plugins/page-reader/__tests__/scroll.test.d.ts +2 -0
  79. package/dist/plugins/page-reader/__tests__/scroll.test.d.ts.map +1 -0
  80. package/dist/plugins/page-reader/index.d.ts +18 -0
  81. package/dist/plugins/page-reader/index.d.ts.map +1 -0
  82. package/dist/plugins/page-reader/tools/get-meta.d.ts +29 -0
  83. package/dist/plugins/page-reader/tools/get-meta.d.ts.map +1 -0
  84. package/dist/plugins/page-reader/tools/read-content.d.ts +34 -0
  85. package/dist/plugins/page-reader/tools/read-content.d.ts.map +1 -0
  86. package/dist/plugins/page-reader/tools/scroll.d.ts +29 -0
  87. package/dist/plugins/page-reader/tools/scroll.d.ts.map +1 -0
  88. package/dist/plugins/page-reader.d.ts +2 -0
  89. package/dist/plugins/page-reader.js +230 -0
  90. package/dist/plugins/qrcode/tool.d.ts +9 -6
  91. package/dist/plugins/qrcode/tool.d.ts.map +1 -1
  92. package/dist/plugins/qrcode.d.ts +1 -1
  93. package/dist/plugins/qrcode.js +121 -100
  94. package/dist/plugins/shared/abort.d.ts +7 -0
  95. package/dist/plugins/shared/abort.d.ts.map +1 -0
  96. package/dist/ui/builtin-tools/get-current-page-info.d.ts.map +1 -1
  97. package/dist/ui/builtin-tools/index.d.ts +1 -1
  98. package/dist/ui/builtin-tools/index.d.ts.map +1 -1
  99. package/dist/ui/builtin-tools/merge-builtin-tools.d.ts +9 -0
  100. package/dist/ui/builtin-tools/merge-builtin-tools.d.ts.map +1 -1
  101. package/dist/ui/commands/builtin-commands.d.ts +46 -0
  102. package/dist/ui/commands/builtin-commands.d.ts.map +1 -0
  103. package/dist/ui/components/ChatErrorBoundary.d.ts +30 -0
  104. package/dist/ui/components/ChatErrorBoundary.d.ts.map +1 -0
  105. package/dist/ui/components/ChatFooter.d.ts +18 -2
  106. package/dist/ui/components/ChatFooter.d.ts.map +1 -1
  107. package/dist/ui/components/ChatHeader.d.ts +14 -1
  108. package/dist/ui/components/ChatHeader.d.ts.map +1 -1
  109. package/dist/ui/components/ChatHeaderMenu.d.ts +7 -2
  110. package/dist/ui/components/ChatHeaderMenu.d.ts.map +1 -1
  111. package/dist/ui/components/ChatPanel.d.ts +35 -4
  112. package/dist/ui/components/ChatPanel.d.ts.map +1 -1
  113. package/dist/ui/components/ChatWidget.d.ts +1 -1
  114. package/dist/ui/components/ChatWidget.d.ts.map +1 -1
  115. package/dist/ui/components/CommandConfirmationCard.d.ts +22 -0
  116. package/dist/ui/components/CommandConfirmationCard.d.ts.map +1 -0
  117. package/dist/ui/components/CommandOverlays.d.ts +28 -0
  118. package/dist/ui/components/CommandOverlays.d.ts.map +1 -0
  119. package/dist/ui/components/CommandPalette.d.ts +25 -0
  120. package/dist/ui/components/CommandPalette.d.ts.map +1 -0
  121. package/dist/ui/components/ConversationSelect.d.ts +15 -0
  122. package/dist/ui/components/ConversationSelect.d.ts.map +1 -0
  123. package/dist/ui/components/CopyIndicator.d.ts +1 -1
  124. package/dist/ui/components/CopyIndicator.d.ts.map +1 -1
  125. package/dist/ui/components/FloatButton.d.ts +1 -1
  126. package/dist/ui/components/FloatButton.d.ts.map +1 -1
  127. package/dist/ui/components/HelpDialogContent.d.ts +7 -0
  128. package/dist/ui/components/HelpDialogContent.d.ts.map +1 -0
  129. package/dist/ui/components/MessageActionsPopover.d.ts +1 -1
  130. package/dist/ui/components/MessageActionsPopover.d.ts.map +1 -1
  131. package/dist/ui/components/MessageAttachments.d.ts +1 -1
  132. package/dist/ui/components/MessageAttachments.d.ts.map +1 -1
  133. package/dist/ui/components/MessageBubble.d.ts +1 -1
  134. package/dist/ui/components/MessageBubble.d.ts.map +1 -1
  135. package/dist/ui/components/MessageCopyButton.d.ts +1 -1
  136. package/dist/ui/components/MessageCopyButton.d.ts.map +1 -1
  137. package/dist/ui/components/MessageEditor.d.ts +1 -1
  138. package/dist/ui/components/MessageEditor.d.ts.map +1 -1
  139. package/dist/ui/components/MessageList.d.ts +6 -1
  140. package/dist/ui/components/MessageList.d.ts.map +1 -1
  141. package/dist/ui/components/MessagePopoverButton.d.ts +1 -1
  142. package/dist/ui/components/MessagePopoverButton.d.ts.map +1 -1
  143. package/dist/ui/components/MessageRow.d.ts +1 -1
  144. package/dist/ui/components/MessageRow.d.ts.map +1 -1
  145. package/dist/ui/components/MessageRowActions.d.ts +1 -1
  146. package/dist/ui/components/MessageRowActions.d.ts.map +1 -1
  147. package/dist/ui/components/ResizeHandles.d.ts +15 -0
  148. package/dist/ui/components/ResizeHandles.d.ts.map +1 -0
  149. package/dist/ui/components/ToolConfirmationCard.d.ts +22 -0
  150. package/dist/ui/components/ToolConfirmationCard.d.ts.map +1 -0
  151. package/dist/ui/components/ToolConfirmationRecord.d.ts +16 -0
  152. package/dist/ui/components/ToolConfirmationRecord.d.ts.map +1 -0
  153. package/dist/ui/components/ToolsDialogContent.d.ts +20 -0
  154. package/dist/ui/components/ToolsDialogContent.d.ts.map +1 -0
  155. package/dist/ui/components/WidgetDialog.d.ts +22 -0
  156. package/dist/ui/components/WidgetDialog.d.ts.map +1 -0
  157. package/dist/ui/components/markdown/CodeBlock.d.ts +1 -1
  158. package/dist/ui/components/markdown/CodeBlock.d.ts.map +1 -1
  159. package/dist/ui/components/markdown/MarkdownBody.d.ts +28 -0
  160. package/dist/ui/components/markdown/MarkdownBody.d.ts.map +1 -0
  161. package/dist/ui/components/markdown/MarkdownMessage.d.ts +13 -14
  162. package/dist/ui/components/markdown/MarkdownMessage.d.ts.map +1 -1
  163. package/dist/ui/components/markdown/trim-autolink-cjk.d.ts +21 -0
  164. package/dist/ui/components/markdown/trim-autolink-cjk.d.ts.map +1 -0
  165. package/dist/ui/hooks/conversationPersistence.d.ts +21 -0
  166. package/dist/ui/hooks/conversationPersistence.d.ts.map +1 -0
  167. package/dist/ui/hooks/resize-geometry.d.ts +42 -0
  168. package/dist/ui/hooks/resize-geometry.d.ts.map +1 -0
  169. package/dist/ui/hooks/use-command-execution.d.ts +38 -0
  170. package/dist/ui/hooks/use-command-execution.d.ts.map +1 -0
  171. package/dist/ui/hooks/use-command-palette.d.ts +45 -0
  172. package/dist/ui/hooks/use-command-palette.d.ts.map +1 -0
  173. package/dist/ui/hooks/use-fullscreen.d.ts +21 -0
  174. package/dist/ui/hooks/use-fullscreen.d.ts.map +1 -0
  175. package/dist/ui/hooks/use-global-error-capture.d.ts +16 -0
  176. package/dist/ui/hooks/use-global-error-capture.d.ts.map +1 -0
  177. package/dist/ui/hooks/use-locale-preference.d.ts +14 -0
  178. package/dist/ui/hooks/use-locale-preference.d.ts.map +1 -0
  179. package/dist/ui/hooks/use-menu-keyboard.d.ts +7 -1
  180. package/dist/ui/hooks/use-menu-keyboard.d.ts.map +1 -1
  181. package/dist/ui/hooks/use-send-message.d.ts +20 -0
  182. package/dist/ui/hooks/use-send-message.d.ts.map +1 -1
  183. package/dist/ui/hooks/use-tool-confirmation.d.ts +22 -0
  184. package/dist/ui/hooks/use-tool-confirmation.d.ts.map +1 -0
  185. package/dist/ui/hooks/use-tool-runner.d.ts +17 -2
  186. package/dist/ui/hooks/use-tool-runner.d.ts.map +1 -1
  187. package/dist/ui/hooks/use-visitor-id.d.ts +10 -0
  188. package/dist/ui/hooks/use-visitor-id.d.ts.map +1 -0
  189. package/dist/ui/hooks/useChatStream.d.ts +35 -0
  190. package/dist/ui/hooks/useChatStream.d.ts.map +1 -1
  191. package/dist/ui/hooks/useConversationList.d.ts +33 -0
  192. package/dist/ui/hooks/useConversationList.d.ts.map +1 -0
  193. package/dist/ui/hooks/useDraggablePanel.d.ts +2 -0
  194. package/dist/ui/hooks/useDraggablePanel.d.ts.map +1 -1
  195. package/dist/ui/hooks/useResizablePanel.d.ts +48 -0
  196. package/dist/ui/hooks/useResizablePanel.d.ts.map +1 -0
  197. package/dist/ui/types.d.ts +6 -0
  198. package/dist/ui/types.d.ts.map +1 -1
  199. package/package.json +43 -27
  200. package/dist/_commonjsHelpers-C6fGbg64.js +0 -6
  201. package/dist/browser-beO7dF90.js +0 -1538
@@ -1 +1 @@
1
- {"version":3,"file":"use-tool-runner.d.ts","sourceRoot":"","sources":["../../../src/ui/hooks/use-tool-runner.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAC3D,OAAO,EAEL,KAAK,mBAAmB,EACxB,KAAK,aAAa,EACnB,MAAM,wBAAwB,CAAC;AAEhC,MAAM,MAAM,oBAAoB,GAAG;IACjC,KAAK,EAAE,IAAI,EAAE,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,GAAG,mBAAmB,CAAC;AAExB;;;;;GAKG;AACH,eAAO,MAAM,aAAa,GACxB,SAAS,oBAAoB,KAC5B,CAAC,CAAC,KAAK,EAAE,YAAY,EAAE,MAAM,EAAE,WAAW,KAAK,OAAO,CAAC,aAAa,CAAC,CAevE,CAAC"}
1
+ {"version":3,"file":"use-tool-runner.d.ts","sourceRoot":"","sources":["../../../src/ui/hooks/use-tool-runner.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAC3D,OAAO,EAEL,KAAK,mBAAmB,EACxB,KAAK,aAAa,EACnB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAmB,KAAK,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AAI7F,MAAM,MAAM,oBAAoB,GAAG;IACjC,KAAK,EAAE,IAAI,EAAE,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;;;;;OAOG;IACH,mBAAmB,CAAC,EAAE,uBAAuB,CAAC;CAC/C,GAAG,mBAAmB,CAAC;AAExB;;;;;;;;;;GAUG;AACH,eAAO,MAAM,aAAa,GACxB,SAAS,oBAAoB,KAC5B,CAAC,CAAC,KAAK,EAAE,YAAY,EAAE,MAAM,EAAE,WAAW,KAAK,OAAO,CAAC,aAAa,CAAC,CAqDvE,CAAC"}
@@ -0,0 +1,10 @@
1
+ /**
2
+ * ブラウザ単位の匿名訪問者 ID を返すフック(issue #266)。
3
+ *
4
+ * 初回マウント時に localStorage から読み取り、無ければ生成して永続化する。
5
+ * この ID は全 API リクエストのヘッダに載り、会話履歴の復元スコープを
6
+ * 「同じブラウザで話した本人」に絞るために使われる。
7
+ * @returns 訪問者 ID(UUID)。コンポーネントの生存期間中は不変
8
+ */
9
+ export declare function useVisitorId(): string;
10
+ //# sourceMappingURL=use-visitor-id.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-visitor-id.d.ts","sourceRoot":"","sources":["../../../src/ui/hooks/use-visitor-id.ts"],"names":[],"mappings":"AAyBA;;;;;;;GAOG;AACH,wBAAgB,YAAY,IAAI,MAAM,CAIrC"}
@@ -1,6 +1,9 @@
1
1
  import { ChatClient } from '../../core/client';
2
2
  import { ChatState, Message, Tool, ToolDefinition } from '../../core/types';
3
3
  import { ToolRunnerCallbacks } from '../../core/tool-runner';
4
+ import { PendingToolConfirmation } from '../../core/tool-confirmation';
5
+ import { DebugLogger } from '../../core/debug-logger';
6
+ import { ErrorReporter } from '../../core/error-reporter';
4
7
  /**
5
8
  * 画面に表示する文言を外部から差し替えるためのオプション。
6
9
  * 多言語対応や独自文言を入れたいときに利用する。
@@ -8,6 +11,16 @@ import { ToolRunnerCallbacks } from '../../core/tool-runner';
8
11
  export type ChatStreamMessages = {
9
12
  /** 通信エラー時に画面に表示するフォールバック文言 */
10
13
  genericError?: string;
14
+ /** LLM ループが上限に達したときに表示する文言 (i18n 済み) */
15
+ maxTurnsReached?: string;
16
+ /** tool が `stop` を `userMessage` 未指定で返したときの fallback 文言 (i18n 済み) */
17
+ stopFallback?: string;
18
+ /**
19
+ * server からの 4xx エラーレスポンスの `code` をユーザー向け文言にマッピングする。
20
+ * 例: `{ MESSAGE_TOO_LONG: "メッセージが長すぎます。10,000 文字以内に..." }`。
21
+ * code が無い / マップに無いエラーは `genericError` にフォールバックする。
22
+ */
23
+ apiErrors?: Record<string, string | undefined>;
11
24
  };
12
25
  /**
13
26
  * useChatStream を呼ぶ側が渡すオプション一式。
@@ -32,6 +45,15 @@ export type UseChatStreamOptions = {
32
45
  onStateChange?: (state: ChatState) => void;
33
46
  /** ChatConfig.augmentUserMessage をそのまま伝搬する */
34
47
  augmentUserMessage?: (text: string) => string;
48
+ /** 会話復元時の初期メッセージ。省略時は空配列 */
49
+ initialMessages?: Message[];
50
+ /** 開発者向け debug logger。未指定なら no-op(createDebugLogger(false))にフォールバック */
51
+ debugLogger?: DebugLogger;
52
+ /**
53
+ * チャット API 呼び出しの失敗を収集エンドポイントへ送るレポーター。
54
+ * null / 未指定なら送信しない(errorReporting: false 時)。
55
+ */
56
+ errorReporter?: ErrorReporter | null;
35
57
  } & ToolRunnerCallbacks;
36
58
  /**
37
59
  * useChatStream が返す値の形。
@@ -60,6 +82,19 @@ export type UseChatStreamResult = {
60
82
  editMessage: (messageId: string, newContent: string) => void;
61
83
  cancel: () => void;
62
84
  clear: () => void;
85
+ /**
86
+ * 指定セッションの会話を復元する。
87
+ * client の conversationId を sessionId に切り替え、messages を差し替える。
88
+ * ストリーミング中は no-op。
89
+ */
90
+ loadMessages: (sessionId: string, messages: Message[]) => void;
91
+ /**
92
+ * `requiresConfirmation: true` の tool で承認待ち中の確認カード一覧。
93
+ * 決着 (承認 / 拒否 / 中断) すると即座に消える。履歴復元では復元されない (揮発状態)。
94
+ */
95
+ pendingConfirmations: PendingToolConfirmation[];
96
+ /** 確認カードのボタン押下で呼ぶ。approved: true = 実行、false = 拒否 */
97
+ respondToConfirmation: (toolCallId: string, approved: boolean) => void;
63
98
  };
64
99
  /**
65
100
  * ChatWidget が必要とする「チャットの状態と操作」を一括で提供するカスタムフック。
@@ -1 +1 @@
1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BAAuB,EAAE,CAAC;IAChD,oDAAoD;IACpD,qBAAqB,EAAE,CAAC,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,KAAK,IAAI,CAAC;CACxE,CAAC;AAiBF;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,oBAAoB,GAAG,mBAAmB,CA2MhF"}
@@ -0,0 +1,33 @@
1
+ import { ChatClient } from '../../core/client';
2
+ import { ConversationSummary, Message } from '../../core/types';
3
+ type UseConversationListOptions = {
4
+ client: ChatClient;
5
+ messages: Message[];
6
+ sendMessage: (content: string) => Promise<void>;
7
+ loadMessages: (sessionId: string, messages: Message[]) => void;
8
+ clear: () => void;
9
+ /** `ChatConfig.persistConversation` の伝搬。"tab" のとき sessionStorage で会話を継続する */
10
+ persistConversation?: "tab";
11
+ };
12
+ type UseConversationListResult = {
13
+ conversations: ConversationSummary[];
14
+ /** 現在選択中のセッション ID。null のときは「+ 新しい会話」が選択状態になる */
15
+ selectedSessionId: string | null;
16
+ selectConversation: (sessionId: string) => Promise<void>;
17
+ startNewConversation: () => void;
18
+ /**
19
+ * メッセージ送信のラッパー。新規会話の最初のメッセージ送信完了後、
20
+ * サーバー保存(応答完了時)に合わせて会話一覧を再取得する。
21
+ * 送信前に楽観的追加はしない(保存に失敗した会話は一覧に出さない)。
22
+ */
23
+ sendMessageAndRefresh: (content: string) => Promise<void>;
24
+ };
25
+ /**
26
+ * 会話一覧の取得・選択・新規作成を管理するフック。
27
+ * マウント時に一覧を自動取得し、選択時は会話詳細を取得して loadMessages に流す。
28
+ * `persistConversation: "tab"` のときは conversationId を sessionStorage に保存し、
29
+ * マウント時に前回の会話を自動復元する(タブ内のページ遷移・リロードで会話が継続する)。
30
+ */
31
+ export declare function useConversationList({ client, messages, sendMessage, loadMessages, clear, persistConversation, }: UseConversationListOptions): UseConversationListResult;
32
+ export {};
33
+ //# sourceMappingURL=useConversationList.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useConversationList.d.ts","sourceRoot":"","sources":["../../../src/ui/hooks/useConversationList.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,KAAK,EAAE,mBAAmB,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAQrE,KAAK,0BAA0B,GAAG;IAChC,MAAM,EAAE,UAAU,CAAC;IACnB,QAAQ,EAAE,OAAO,EAAE,CAAC;IACpB,WAAW,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAChD,YAAY,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,KAAK,IAAI,CAAC;IAC/D,KAAK,EAAE,MAAM,IAAI,CAAC;IAClB,6EAA6E;IAC7E,mBAAmB,CAAC,EAAE,KAAK,CAAC;CAC7B,CAAC;AAEF,KAAK,yBAAyB,GAAG;IAC/B,aAAa,EAAE,mBAAmB,EAAE,CAAC;IACrC,gDAAgD;IAChD,iBAAiB,EAAE,MAAM,GAAG,IAAI,CAAC;IACjC,kBAAkB,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACzD,oBAAoB,EAAE,MAAM,IAAI,CAAC;IACjC;;;;OAIG;IACH,qBAAqB,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CAC3D,CAAC;AAEF;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,EAClC,MAAM,EACN,QAAQ,EACR,WAAW,EACX,YAAY,EACZ,KAAK,EACL,mBAAmB,GACpB,EAAE,0BAA0B,GAAG,yBAAyB,CAyGxD"}
@@ -15,6 +15,8 @@ type UseDraggablePanelResult = {
15
15
  onHeaderPointerDown: (event: ReactPointerEvent<HTMLDivElement>) => void;
16
16
  onHeaderKeyDown: (event: ReactKeyboardEvent<HTMLDivElement>) => void;
17
17
  resetPosition: () => void;
18
+ /** リサイズ等の外部操作が、アンカー配置の現在位置を明示座標として確定させる入口 */
19
+ commitPosition: (next: DragPosition) => void;
18
20
  };
19
21
  /**
20
22
  * floating panel をヘッダー全体で掴んで移動可能にするフック。
@@ -1 +1 @@
1
- {"version":3,"file":"useDraggablePanel.d.ts","sourceRoot":"","sources":["../../../src/ui/hooks/useDraggablePanel.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,aAAa,IAAI,kBAAkB,EACxC,KAAK,YAAY,IAAI,iBAAiB,EACtC,KAAK,SAAS,EAMf,MAAM,OAAO,CAAC;AAEf,MAAM,MAAM,YAAY,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,CAAC;AAEzD,KAAK,wBAAwB,GAAG;IAC9B,2DAA2D;IAC3D,QAAQ,EAAE,SAAS,CAAC,WAAW,GAAG,IAAI,CAAC,CAAC;IACxC,2CAA2C;IAC3C,MAAM,EAAE,OAAO,CAAC;CACjB,CAAC;AAEF,KAAK,uBAAuB,GAAG;IAC7B,QAAQ,EAAE,YAAY,GAAG,IAAI,CAAC;IAC9B,UAAU,EAAE,OAAO,CAAC;IACpB,mBAAmB,EAAE,CAAC,KAAK,EAAE,iBAAiB,CAAC,cAAc,CAAC,KAAK,IAAI,CAAC;IACxE,eAAe,EAAE,CAAC,KAAK,EAAE,kBAAkB,CAAC,cAAc,CAAC,KAAK,IAAI,CAAC;IACrE,aAAa,EAAE,MAAM,IAAI,CAAC;CAC3B,CAAC;AAkEF;;;;;;;;;;GAUG;AACH,eAAO,MAAM,iBAAiB,GAAI,uBAG/B,wBAAwB,KAAG,uBAmI7B,CAAC"}
1
+ {"version":3,"file":"useDraggablePanel.d.ts","sourceRoot":"","sources":["../../../src/ui/hooks/useDraggablePanel.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,aAAa,IAAI,kBAAkB,EACxC,KAAK,YAAY,IAAI,iBAAiB,EACtC,KAAK,SAAS,EAMf,MAAM,OAAO,CAAC;AAEf,MAAM,MAAM,YAAY,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,CAAC;AAEzD,KAAK,wBAAwB,GAAG;IAC9B,2DAA2D;IAC3D,QAAQ,EAAE,SAAS,CAAC,WAAW,GAAG,IAAI,CAAC,CAAC;IACxC,2CAA2C;IAC3C,MAAM,EAAE,OAAO,CAAC;CACjB,CAAC;AAEF,KAAK,uBAAuB,GAAG;IAC7B,QAAQ,EAAE,YAAY,GAAG,IAAI,CAAC;IAC9B,UAAU,EAAE,OAAO,CAAC;IACpB,mBAAmB,EAAE,CAAC,KAAK,EAAE,iBAAiB,CAAC,cAAc,CAAC,KAAK,IAAI,CAAC;IACxE,eAAe,EAAE,CAAC,KAAK,EAAE,kBAAkB,CAAC,cAAc,CAAC,KAAK,IAAI,CAAC;IACrE,aAAa,EAAE,MAAM,IAAI,CAAC;IAC1B,6CAA6C;IAC7C,cAAc,EAAE,CAAC,IAAI,EAAE,YAAY,KAAK,IAAI,CAAC;CAC9C,CAAC;AAkEF;;;;;;;;;;GAUG;AACH,eAAO,MAAM,iBAAiB,GAAI,uBAG/B,wBAAwB,KAAG,uBAuJ7B,CAAC"}
@@ -0,0 +1,48 @@
1
+ import { KeyboardEvent as ReactKeyboardEvent, PointerEvent as ReactPointerEvent, RefObject } from 'react';
2
+ import { DragPosition } from './useDraggablePanel';
3
+ import { ResizeDirection } from './resize-geometry';
4
+ export type { ResizeDirection } from './resize-geometry';
5
+ /** リサイズ後のパネル寸法(px)。null は「未リサイズ = CSS 既定サイズ」 */
6
+ export type PanelSize = {
7
+ width: number;
8
+ height: number;
9
+ };
10
+ type UseResizablePanelOptions = {
11
+ /** リサイズ対象のパネル要素への ref。開始時の矩形取得に使う */
12
+ panelRef: RefObject<HTMLElement | null>;
13
+ /** floating && isOpen && !isFullscreen のときのみ有効化 */
14
+ active: boolean;
15
+ /** ドラッグ移動等で位置が明示座標化済みか。キーボードリサイズの伸長上限の計算に使う */
16
+ hasExplicitPosition: boolean;
17
+ /**
18
+ * リサイズ開始時と W/N 辺の追従時に、位置を明示座標として確定させる。
19
+ * 方向プリセット(右下貼り付き等)のままでは幅の変更で「掴んだ辺の反対側」が
20
+ * 動いてしまうため、開始時点でアンカーを解除する必要がある。
21
+ */
22
+ onCommitPosition: (position: DragPosition) => void;
23
+ };
24
+ type UseResizablePanelResult = {
25
+ size: PanelSize | null;
26
+ isResizing: boolean;
27
+ startResize: (direction: ResizeDirection, event: ReactPointerEvent<HTMLElement>) => void;
28
+ onResizeHandleKeyDown: (event: ReactKeyboardEvent<HTMLElement>) => void;
29
+ resetSize: () => void;
30
+ };
31
+ /**
32
+ * floating パネルを四隅・四辺のハンドルでリサイズ可能にするフック。
33
+ *
34
+ * - サイズは state で保持(永続化しない)。null なら CSS 既定サイズのまま
35
+ * - 右下隅ハンドル向けに矢印キー 8px / Shift+矢印 32px / Home リセットのキーボード操作を提供
36
+ * - window resize 時に保持サイズを viewport 内へ補正(rAF でスロットル)
37
+ * - タッチは開始時点で無視する(CSS の pointer: coarse 非表示と合わせた二段ガード。
38
+ * タッチ対応ノート PC では primary pointer が fine でハンドルが表示されるため、
39
+ * メディアクエリだけでは指タッチが素通りする)
40
+ *
41
+ * 追従は #83 の移動(document リスナー方式)と異なり setPointerCapture を使う。
42
+ * リサイズはポインタがパネル外へ大きく出る操作で、ホストページ内の iframe 上を
43
+ * 横切ると document リスナーでは pointermove が途絶えるため。capture はイベント配送を
44
+ * ハンドル要素に固定するので iframe を跨いでも追従し、座標は viewport 基準の
45
+ * clientX/Y なのでハンドル自身が動いても計算は壊れない。
46
+ */
47
+ export declare const useResizablePanel: ({ panelRef, active, hasExplicitPosition, onCommitPosition, }: UseResizablePanelOptions) => UseResizablePanelResult;
48
+ //# sourceMappingURL=useResizablePanel.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useResizablePanel.d.ts","sourceRo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import { DebugLogger } from '../core/debug-logger';
2
3
  /**
3
4
  * ホスト側から sendMessage / editMessage 等を呼ぶための外向き API。
4
5
  *
@@ -38,5 +39,10 @@ export type ChatWidgetProps = {
38
39
  controlsRef?: {
39
40
  current: WecoolChatControls | null;
40
41
  };
42
+ /**
43
+ * 開発者向け debug logger。`initWecoolChat` が `config.debug` から生成して渡す。
44
+ * 未指定なら ChatWidget 側で `config.debug` からフォールバック生成する。
45
+ */
46
+ debugLogger?: DebugLogger;
41
47
  };
42
48
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/ui/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAEtD;;;;;GAKG;AACH,MAAM,MAAM,kBAAkB,GAAG;IAC/B,0BAA0B;IAC1B,WAAW,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACpC,+CAA+C;IAC/C,WAAW,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,KAAK,IAAI,CAAC;IAC7D,4BAA4B;IAC5B,UAAU,EAAE,MAAM,IAAI,CAAC;IACvB,eAAe;IACf,KAAK,EAAE,MAAM,IAAI,CAAC;IAClB,uBAAuB;IACvB,MAAM,EAAE,MAAM,IAAI,CAAC;CACpB,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG;IAC5B,MAAM,EAAE,IAAI,CAAC,UAAU,EAAE,OAAO,CAAC,GAAG;QAAE,KAAK,CAAC,EAAE,IAAI,EAAE,CAAA;KAAE,CAAC;IACvD,KAAK,CAAC,EAAE,IAAI,EAAE,CAAC;IACf,kDAAkD;IAClD,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,2CAA2C;IAC3C,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,iCAAiC;IACjC,QAAQ,CAAC,EAAE,cAAc,GAA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AW,CAAC,EAAE,WAAW,CAAC;CAC3B,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wecool-chat",
3
- "version": "0.7.1",
3
+ "version": "0.9.0",
4
4
  "description": "Drop-in LLM chat widget that executes your JavaScript functions via natural language",
5
5
  "type": "module",
6
6
  "sideEffects": [
@@ -22,6 +22,10 @@
22
22
  "types": "./dist/plugins/qrcode.d.ts",
23
23
  "import": "./dist/plugins/qrcode.js"
24
24
  },
25
+ "./plugins/page-reader": {
26
+ "types": "./dist/plugins/page-reader.d.ts",
27
+ "import": "./dist/plugins/page-reader.js"
28
+ },
25
29
  "./styles.css": "./dist/index.css"
26
30
  },
27
31
  "typesVersions": {
@@ -31,12 +35,16 @@
31
35
  ],
32
36
  "plugins/qrcode": [
33
37
  "./dist/plugins/qrcode.d.ts"
38
+ ],
39
+ "plugins/page-reader": [
40
+ "./dist/plugins/page-reader.d.ts"
34
41
  ]
35
42
  }
36
43
  },
37
44
  "files": [
38
45
  "dist",
39
46
  "!dist/__tests__",
47
+ "!dist/widget.js",
40
48
  "docs/screenshots",
41
49
  "README.md",
42
50
  "README.ja.md",
@@ -45,47 +53,44 @@
45
53
  "publishConfig": {
46
54
  "access": "public"
47
55
  },
48
- "scripts": {
49
- "build": "tsc && vite build",
50
- "lint": "eslint src",
51
- "test": "vitest run",
52
- "test:watch": "vitest",
53
- "check:styles": "node ../../scripts/ci-check-styles.mjs"
54
- },
55
56
  "dependencies": {
56
57
  "clsx": "^2.1.1",
57
58
  "highlight.js": "^11.11.1",
58
59
  "lucide-react": "^0.511.0",
59
60
  "qrcode": "^1.5.4",
60
- "react": "^19.2.6",
61
- "react-dom": "^19.2.6",
61
+ "react": "^19.2.7",
62
+ "react-dom": "^19.2.7",
62
63
  "react-markdown": "^10.1.0",
63
64
  "rehype-highlight": "^7.0.2",
64
65
  "remark-gfm": "^4.0.1"
65
66
  },
66
67
  "devDependencies": {
67
68
  "@eslint/js": "^10.0.1",
68
- "@types/qrcode": "^1.5.5",
69
- "@tailwindcss/vite": "^4.3.0",
69
+ "@size-limit/file": "^12.1.0",
70
+ "@tailwindcss/vite": "^4.3.2",
70
71
  "@testing-library/react": "^16.3.2",
71
72
  "@testing-library/user-event": "^14.6.1",
72
- "@types/react": "^19.2.14",
73
+ "@types/qrcode": "^1.5.5",
74
+ "@types/react": "^19.2.17",
73
75
  "@types/react-dom": "^19.2.3",
74
- "@typescript-eslint/eslint-plugin": "^8.59.3",
75
- "@typescript-eslint/parser": "^8.59.3",
76
- "@vitejs/plugin-react": "^5.2.0",
77
- "axe-core": "^4.11.4",
78
- "eslint": "^10.4.0",
76
+ "@typescript-eslint/eslint-plugin": "^8.63.0",
77
+ "@typescript-eslint/parser": "^8.63.0",
78
+ "@vitejs/plugin-react": "^6.0.3",
79
+ "@vitest/coverage-v8": "^4.1.9",
80
+ "axe-core": "^4.12.1",
81
+ "eslint": "^10.4.1",
79
82
  "eslint-plugin-jsx-a11y": "^6.10.2",
80
- "globals": "^17.6.0",
83
+ "globals": "^17.7.0",
81
84
  "jsdom": "^29.1.1",
82
- "react": "^19.2.4",
83
- "react-dom": "^19.2.4",
84
- "tailwindcss": "^4.3.0",
85
+ "react": "^19.2.7",
86
+ "react-dom": "^19.2.7",
87
+ "rollup-plugin-visualizer": "^7.0.1",
88
+ "size-limit": "^12.1.0",
89
+ "tailwindcss": "^4.3.2",
85
90
  "typescript": "^5.9.3",
86
- "vite": "^7.3.3",
87
- "vite-plugin-dts": "^5.0.0",
88
- "vitest": "^4.1.6"
91
+ "vite": "^8.1.3",
92
+ "vite-plugin-dts": "^5.0.3",
93
+ "vitest": "^4.1.10"
89
94
  },
90
95
  "keywords": [
91
96
  "llm",
@@ -105,5 +110,16 @@
105
110
  "bugs": {
106
111
  "email": "wecool.dev@gmail.com"
107
112
  },
108
- "author": "wecool-dev"
109
- }
113
+ "author": "wecool-dev",
114
+ "scripts": {
115
+ "build": "tsc && vite build",
116
+ "build:loader": "vite build --config vite.config.loader.ts",
117
+ "size": "size-limit",
118
+ "analyze": "ANALYZE=true vite build",
119
+ "lint": "eslint src",
120
+ "test": "vitest run",
121
+ "test:coverage": "vitest run --coverage",
122
+ "test:watch": "vitest",
123
+ "check:styles": "node ../../scripts/ci-check-styles.mjs"
124
+ }
125
+ }
@@ -1,6 +0,0 @@
1
- function e(t) {
2
- return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
3
- }
4
- export {
5
- e as g
6
- };