feat(acp): bridge durable image prompts and replies

This commit is contained in:
Tianyi Cui
2026-08-11 15:36:22 +08:00
parent 49426cae02
commit 4f87c1fe6d
37 changed files with 1808 additions and 223 deletions

View File

@@ -25,6 +25,7 @@ import { vi } from 'vitest'
import {
ClientSideConnection,
PROTOCOL_VERSION,
type ContentBlock as AcpContentBlock,
type RequestPermissionRequest,
type RequestPermissionResponse,
type SessionNotification,
@@ -69,6 +70,7 @@ export type InputStep =
| { op: 'newSession' }
| { op: 'newSessionExpectError'; additionalDirectories?: string[] }
| { op: 'prompt'; text: string }
| { op: 'promptContent'; content: AcpContentBlock[] }
| { op: 'promptAndWaitForAgentMessage'; text: string; waitForText: string }
| { op: 'promptExpectError'; text: string }
| {
@@ -422,6 +424,12 @@ async function runStep(
await client.prompt({ sessionId, prompt: [{ type: 'text', text: step.text }] })
return
}
case 'promptContent': {
const sessionId = getSessionId()
if (sessionId === undefined) throw new Error('snapshot-harness: promptContent before newSession')
await client.prompt({ sessionId, prompt: step.content })
return
}
case 'promptAndWaitForAgentMessage': {
const sessionId = getSessionId()
if (sessionId === undefined) throw new Error('snapshot-harness: promptAndWaitForAgentMessage before newSession')