feat: add ci test runner, session routing, bash parser, and test fixtures
- script/run-ci-tests.ts: CI test sharding and isolation logic - script/run-ci-tests.test.ts: tests for CI test target selection - src/features/background-agent/session-route.ts: session prompt routing for background agents - src/hooks/interactive-bash-session/parser.ts: interactive bash output parser - src/hooks/ralph-loop/completion-promise-detector-test-input.ts: test fixture for completion promise detection
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
/// <reference types="bun-types" />
|
||||
import type { PluginInput } from "@opencode-ai/plugin"
|
||||
|
||||
export type SessionMessage = {
|
||||
info?: { role?: string }
|
||||
parts?: Array<{ type: string; text?: string }>
|
||||
}
|
||||
|
||||
export function createPluginInput(messages: SessionMessage[]): PluginInput {
|
||||
const pluginInput = {
|
||||
client: { session: {} } as PluginInput["client"],
|
||||
project: {} as PluginInput["project"],
|
||||
directory: "/tmp",
|
||||
worktree: "/tmp",
|
||||
serverUrl: new URL("http://localhost"),
|
||||
$: {} as PluginInput["$"],
|
||||
} as PluginInput
|
||||
|
||||
pluginInput.client.session.messages =
|
||||
(async () => ({ data: messages })) as unknown as PluginInput["client"]["session"]["messages"]
|
||||
|
||||
return pluginInput
|
||||
}
|
||||
Reference in New Issue
Block a user