feat: add agent response scheduler

This commit is contained in:
2026-07-01 23:50:38 +01:00
parent 9aaefda216
commit e3a00fe632
33 changed files with 1690 additions and 505 deletions

View File

@@ -1,8 +1,3 @@
export interface SendMessageResult {
message: string
conversationId: string
}
export type AgentEvent =
| { type: "conversation_started"; conversationId: string }
| { type: "message_created"; text: string }
@@ -11,8 +6,11 @@ export type AgentEvent =
| { type: "message_finished" }
| { type: "message_failed"; error: string }
export type UserEvent = { type: "typing" }
export interface AgentServerApi {
sendMessage(message: string): Promise<SendMessageResult>
sendMessage(message: string): Promise<boolean>
notify(event: UserEvent): void
ping(): "pong"
}

View File

@@ -146,6 +146,19 @@ export const ConversationEntryMetadata = type({
/** Metadata bag attached to a conversation entry. */
export type ConversationEntryMetadata = typeof ConversationEntryMetadata.infer
export const ToolCallPayload = type({
toolName: "string",
})
export type ToolCallPayload = typeof ToolCallPayload.infer
export const ToolResultPayload = type({
toolName: "string",
ok: "boolean",
})
export type ToolResultPayload = typeof ToolResultPayload.infer
/** Generic object payload used by operational entries. */
export const GenericObjectPayload = type("Record<string, unknown>")
@@ -158,6 +171,8 @@ export type ConversationEntryPayload =
| AssistantMessagePayload
| AttachmentPayload
| ContextSummaryPayload
| ToolCallPayload
| ToolResultPayload
| GenericObjectPayload
export const Conversation = type({

View File

@@ -29,7 +29,9 @@ export {
SystemNoteConversationEntry,
TextMessagePart,
ToolCallConversationEntry,
ToolCallPayload,
ToolResultConversationEntry,
ToolResultPayload,
UserMessagePayload,
UserMessageConversationEntry,
} from "./conversation"