@waniwani/sdk 0.4.9-beta.7 → 0.4.9-beta.9

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.
@@ -1,4 +1,5 @@
1
1
  import * as react from 'react';
2
+ import { RefObject } from 'react';
2
3
  import * as react_jsx_runtime from 'react/jsx-runtime';
3
4
  import { ContentBlock } from '@modelcontextprotocol/sdk/types.js';
4
5
 
@@ -133,6 +134,11 @@ interface ChatCardProps extends ChatBaseProps {
133
134
  interface ChatHandle {
134
135
  /** Programmatically send a user message into the chat */
135
136
  sendMessage: (text: string) => void;
137
+ /**
138
+ * Send a user message and wait for the assistant response to complete.
139
+ * Returns the final assistant message. Useful for eval/testing flows.
140
+ */
141
+ sendMessageAndWait: (text: string) => Promise<unknown>;
136
142
  /** Scroll to the chat input, focus it, and show a highlight glow */
137
143
  focus: () => void;
138
144
  }
@@ -142,7 +148,13 @@ type ChatWidgetProps = ChatBarProps;
142
148
  declare const ChatBar: react.ForwardRefExoticComponent<ChatBarProps & react.RefAttributes<ChatHandle>>;
143
149
 
144
150
  type EvalPanelProps = {
151
+ /** API endpoint to fetch sessions from
152
+ *
153
+ * @default "/api/waniwani"
154
+ */
145
155
  api?: string;
156
+ /** Ref to the ChatCard or ChatBar so eval turns flow through the chat UI */
157
+ chatRef: RefObject<ChatHandle | null>;
146
158
  };
147
159
  /**
148
160
  * Dev-only evaluation panel for replaying recorded sessions and asserting tool usage.