Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,6 @@ export interface AssistantMessagePage {
/** Pass as `before` to load older messages; null at the start of the conversation. */
cursor: string | null;
}
export interface AssistantRunBody {
content: string;
}
export type AssistantRunEvent =
| { type: 'run.started'; runId?: string }
| { type: 'run.completed'; runId?: string }
Expand All @@ -60,19 +57,13 @@ export type AssistantRunEvent =
| { type: 'tool_call.started'; toolCallId: string; name: string }
| { type: 'tool_call.done'; toolCallId: string };

export type AssistantRunState = 'idle' | 'running' | 'disconnected';

export interface AssistantTransport {
/** Conversations of the note the transport was created for. */
export interface AssistantConversationApi {
/** Conversations of the note the API was created for. */
listConversations(): Promise<AssistantConversation[]>;
createConversation(body: { title?: string }): Promise<AssistantConversation>;
deleteConversation(conversationId: string): Promise<void>;
/** The latest page of history, or the page before `before` (a page cursor). */
getMessages(conversationId: string, before?: string): Promise<AssistantMessagePage>;
/** Observe local run state, including a lost connection until history is reloaded. */
subscribeRunState?(conversationId: string, listener: (state: AssistantRunState) => void): () => void;
/** Aborting stops local event consumption; it does not cancel a run already accepted by the server. */
openRun(conversationId: string, body: AssistantRunBody, signal: AbortSignal): AsyncIterable<AssistantRunEvent>;
}

export class AssistantStreamError extends Error {
Expand Down
Loading
Loading