task: implement sdk runner

This commit is contained in:
YeonGyu-Kim
2026-03-16 14:43:47 +09:00
parent 8c4fa47e5e
commit 96f4b3b56c
20 changed files with 1350 additions and 137 deletions
+27
View File
@@ -0,0 +1,27 @@
# @oh-my-openagent/sdk
Programmatic runner for starting or attaching to an OpenCode server, running oh-my-openagent sessions, and consuming normalized lifecycle events.
## `run()`
```ts
import { createOmoRunner } from "@oh-my-openagent/sdk"
const runner = createOmoRunner({ directory: process.cwd(), agent: "prometheus" })
const result = await runner.run("Plan the next release")
await runner.close()
```
## `stream()`
```ts
import { createOmoRunner } from "@oh-my-openagent/sdk"
const runner = createOmoRunner({ directory: process.cwd() })
for await (const event of runner.stream("Investigate the build failure")) {
console.log(event.type)
}
await runner.close()
```