2da5f12c1f
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
24 lines
682 B
TypeScript
24 lines
682 B
TypeScript
/// <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
|
|
}
|