@streamoid/agent 0.6.16 → 0.6.18

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/dist/index.d.ts CHANGED
@@ -154,3 +154,75 @@ export declare function AgentPanel(props: AgentPanelProps): ReactElement;
154
154
 
155
155
  /** The embeddable chat shell AgentPanel wraps — for advanced composition. */
156
156
  export declare function AgentChatShell(props: { adapters: AgentChatShellAdapters }): ReactElement;
157
+
158
+ /* ── Search or Ask CXO ─────────────────────────────────────────────────────
159
+ *
160
+ * NOTE FOR MAINTAINERS: this file is COPIED VERBATIM into the published
161
+ * package (`build:lib` does `cp lib-template/index.d.ts dist-lib/dist/`), so it
162
+ * is a second, hand-kept surface alongside `src/embed/index.ts`. Exporting
163
+ * something there and not here ships a value with no type, and the consumer's
164
+ * `tsc` fails on the import rather than at runtime. */
165
+
166
+ /** One search hit. Mirrors `ConversationSearchResult` in `src/api/chat.ts` —
167
+ * keep the two in step, field for field. */
168
+ export interface ConversationSearchResult {
169
+ conversation_id: string;
170
+ workspace_id?: string | null;
171
+ message_id?: string | null;
172
+ conversation_title?: string | null;
173
+ /** The matching text. Required — the result row renders it. */
174
+ snippet: string;
175
+ role?: string | null;
176
+ created_at?: string | null;
177
+ updated_at?: string | null;
178
+ matched_on: 'message' | 'title';
179
+ rank: number;
180
+ }
181
+
182
+ export interface ConversationSearchDialogProps {
183
+ workspaceId?: string | null;
184
+ /** Override the search call. Defaults to this workspace's conversations, so a
185
+ * host embedding the panel needs no API client of its own. */
186
+ search?: (query: string) => Promise<ConversationSearchResult[]>;
187
+ onClose(): void;
188
+ onSelectResult(result: ConversationSearchResult): void;
189
+ /** Start a NEW chat from the typed text. Supplying it turns the search box
190
+ * into "Search or Ask CXO": an Ask row appears and Enter submits it. Throw
191
+ * or reject to keep the dialog open with an inline error. Omit for
192
+ * search-only. */
193
+ onAsk?(query: string): Promise<void> | void;
194
+ placeholder?: string;
195
+ emptyStateTitle?: string;
196
+ emptyStateDescription?: string;
197
+ }
198
+
199
+ /** "Search or Ask CXO" — the command dialog a host opens from its sidebar's
200
+ * search trigger, identical in every product. */
201
+ export declare function ConversationSearchDialog(
202
+ props: ConversationSearchDialogProps,
203
+ ): ReactElement;
204
+
205
+ /** Input for {@link startConversation}. */
206
+ export interface StartConversationInput {
207
+ workspaceId: string;
208
+ userId: string;
209
+ email: string;
210
+ /** The user's first message. Trimmed; empty is rejected. */
211
+ prompt: string;
212
+ }
213
+
214
+ /**
215
+ * Start a NEW conversation from a first message and return its id — for a host
216
+ * that has a question but no chat open yet (the dialog's Ask row). Hand the id
217
+ * back to the panel through `adapters.chatId`.
218
+ *
219
+ * Delegates to the same send path the chat itself uses, so `enc_token`,
220
+ * `color_mode` and `host_context` are filled in from inside the bundle; a host
221
+ * cannot see those and should not try to send them itself.
222
+ *
223
+ * Resolves `null` when the inputs are incomplete or the send fails, so a caller
224
+ * can show "could not start this chat" without unpacking an error.
225
+ */
226
+ export declare function startConversation(
227
+ input: StartConversationInput,
228
+ ): Promise<string | null>;