feat(coding): add core host api composition
This commit is contained in:
@@ -384,6 +384,30 @@ export interface ForkResult {
|
||||
snapshot: ConversationSnapshot;
|
||||
}
|
||||
|
||||
export interface CodingRuntimeCommand {
|
||||
name: string;
|
||||
description?: string;
|
||||
}
|
||||
|
||||
export type ConversationInteractionResponse =
|
||||
| { interactionId: string; cancelled: true }
|
||||
| { interactionId: string; optionId: string }
|
||||
| { interactionId: string; confirmed: boolean }
|
||||
| { interactionId: string; value: string };
|
||||
|
||||
export interface CodingRuntimeDiagnostics {
|
||||
revision: {
|
||||
provider: number;
|
||||
resources: number;
|
||||
};
|
||||
workers: Array<{
|
||||
conversationId: string;
|
||||
generation: number;
|
||||
state: 'spawning' | 'ready' | 'queued' | 'running' | 'idle' | 'crashed';
|
||||
stage: 'starting' | 'idle' | 'queued' | 'running' | 'failed';
|
||||
}>;
|
||||
}
|
||||
|
||||
export interface CodingConversationRuntime {
|
||||
prepare(input: PrepareConversationInput): Promise<ConversationRuntimeState>;
|
||||
getSnapshot(conversationId: string): Promise<ConversationSnapshot>;
|
||||
@@ -397,5 +421,14 @@ export interface CodingConversationRuntime {
|
||||
fork(input: ForkConversationInput): Promise<ForkResult>;
|
||||
recover(conversationId: string): Promise<ConversationRuntimeState>;
|
||||
dispose(conversationId: string): Promise<void>;
|
||||
listCommands(conversationId: string): Promise<CodingRuntimeCommand[]>;
|
||||
listInteractions(conversationId?: string): Promise<ConversationInteraction[]>;
|
||||
respondInteraction(
|
||||
conversationId: string,
|
||||
response: ConversationInteractionResponse,
|
||||
): Promise<void>;
|
||||
getDiagnostics(): CodingRuntimeDiagnostics;
|
||||
markProviderStale(): void;
|
||||
markResourcesStale(): void;
|
||||
subscribe(listener: (patch: ConversationPatchEnvelope) => void): () => void;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user