|
5 | 5 | * common error patterns (401, network errors). |
6 | 6 | */ |
7 | 7 |
|
8 | | -import type { ChatSession, UserProfile, StreamChatParams, UserData, Intent, ListIntentsOptions, IntentListResult, OpportunityListOptions, Opportunity, OpportunityDetail, Network, NetworkMember, NetworkRequest, NetworkCreateResult, NetworkInvitationResult, Conversation, ConversationMessage, Negotiation, NegotiationListOptions, EnrichmentResult, ToolResult } from "./types"; |
| 8 | +import type { UserProfile, UserData, Intent, ListIntentsOptions, IntentListResult, OpportunityListOptions, Opportunity, OpportunityDetail, Network, NetworkMember, NetworkRequest, NetworkCreateResult, NetworkInvitationResult, Conversation, ConversationMessage, Negotiation, NegotiationListOptions, EnrichmentResult, ToolResult } from "./types"; |
9 | 9 |
|
10 | 10 | // Re-export all types for backward compatibility |
11 | | -export type { ChatSession, UserProfile, StreamChatParams, UserData, Intent, ListIntentsOptions, IntentListResult, OpportunityListOptions, Opportunity, OpportunityActor, OpportunityInterpretation, OpportunityDetection, OpportunityDetail, OpportunityParty, Network, NetworkMember, NetworkRequest, NetworkCreateResult, NetworkInvitationResult, ConversationParticipant, Conversation, MessagePart, ConversationMessage, Negotiation, NegotiationListOptions, NegotiationSpeaker, NegotiationTurn, NegotiationOutcome, EnrichedProfile, EnrichmentResult, ToolResult } from "./types"; |
| 11 | +export type { UserProfile, UserData, Intent, ListIntentsOptions, IntentListResult, OpportunityListOptions, Opportunity, OpportunityActor, OpportunityInterpretation, OpportunityDetection, OpportunityDetail, OpportunityParty, Network, NetworkMember, NetworkRequest, NetworkCreateResult, NetworkInvitationResult, ConversationParticipant, Conversation, MessagePart, ConversationMessage, Negotiation, NegotiationListOptions, NegotiationSpeaker, NegotiationTurn, NegotiationOutcome, EnrichedProfile, EnrichmentResult, ToolResult } from "./types"; |
12 | 12 |
|
13 | 13 | export interface UptakeQuestion { |
14 | 14 | id: string; |
@@ -64,18 +64,6 @@ export class ApiClient { |
64 | 64 | return { "x-api-key": this.token }; |
65 | 65 | } |
66 | 66 |
|
67 | | - /** |
68 | | - * List all chat sessions for the authenticated user. |
69 | | - * |
70 | | - * @returns Array of session objects. |
71 | | - * @throws Error on auth failure or network error. |
72 | | - */ |
73 | | - async listSessions(): Promise<ChatSession[]> { |
74 | | - const res = await this.get("/api/chat/sessions"); |
75 | | - const body = (await res.json()) as { sessions: ChatSession[] }; |
76 | | - return body.sessions; |
77 | | - } |
78 | | - |
79 | 67 | /** |
80 | 68 | * Revoke one exact server-issued CLI API key with caller and target proof. |
81 | 69 | * |
@@ -161,36 +149,6 @@ export class ApiClient { |
161 | 149 | return await res.json() as Record<string, unknown>; |
162 | 150 | } |
163 | 151 |
|
164 | | - /** |
165 | | - * Open an SSE stream to the chat endpoint. |
166 | | - * |
167 | | - * Returns the raw Response so the caller can read the body |
168 | | - * as a stream and parse SSE events incrementally. |
169 | | - * |
170 | | - * @param params - Stream parameters (message, optional sessionId). |
171 | | - * @returns The raw fetch Response with SSE body. |
172 | | - * @throws Error on auth failure or network error. |
173 | | - */ |
174 | | - async streamChat(params: StreamChatParams): Promise<Response> { |
175 | | - const res = await fetch(`${this.baseUrl}/api/chat/stream`, { |
176 | | - method: "POST", |
177 | | - headers: { |
178 | | - "Content-Type": "application/json", |
179 | | - ...this.authHeaders(), |
180 | | - }, |
181 | | - body: JSON.stringify({ |
182 | | - message: params.message, |
183 | | - ...(params.sessionId ? { sessionId: params.sessionId } : {}), |
184 | | - }), |
185 | | - }); |
186 | | - |
187 | | - if (!res.ok) { |
188 | | - await this.handleError(res); |
189 | | - } |
190 | | - |
191 | | - return res; |
192 | | - } |
193 | | - |
194 | 152 | /** |
195 | 153 | * List intents with optional pagination and filters. |
196 | 154 | * |
|
0 commit comments