mirror of
https://github.com/Heretek-AI/opencode.git
synced 2026-11-22 00:45:12 -10:00
+7


![opencode-agent[bot]](/assets/img/avatar_default.png)



![opencode-agent[bot]](/assets/img/avatar_default.png)

41283933ff
Co-authored-by: Brendan Allan <[email protected]> Co-authored-by: opencode-agent[bot] <opencode-agent[bot]@users.noreply.github.com> Co-authored-by: Affan Ali <[email protected]> Co-authored-by: affanali2k3 <[email protected]> Co-authored-by: Frank <[email protected]> Co-authored-by: opencode-agent[bot] <219766164+opencode-agent[bot]@users.noreply.github.com> Co-authored-by: James Long <[email protected]> Co-authored-by: Aiden Cline <[email protected]> Co-authored-by: Jay V <[email protected]> Co-authored-by: Dax Raad <[email protected]> Co-authored-by: Aarav Sareen <[email protected]> Co-authored-by: OpeOginni <[email protected]> Co-authored-by: Luke Parker <[email protected]> Co-authored-by: Ben Guthrie <[email protected]> Co-authored-by: Dax <[email protected]> Co-authored-by: Filip <[email protected]>
31 lines
1.1 KiB
TypeScript
31 lines
1.1 KiB
TypeScript
import { NodeFileSystem } from "@effect/platform-node"
|
|
import { compile, emitEffectImported, emitPromise, write } from "@opencode-ai/httpapi-codegen"
|
|
import { ClientApi, endpointNames, groupNames, omitEndpoints } from "../src/contract"
|
|
import { Effect } from "effect"
|
|
import { fileURLToPath } from "url"
|
|
|
|
const contract = compile(ClientApi, { groupNames, endpointNames, omitEndpoints })
|
|
|
|
await Effect.runPromise(
|
|
Effect.all(
|
|
[
|
|
write(
|
|
emitPromise(contract, {
|
|
outputTypes: {
|
|
"events.subscribe": {
|
|
name: "OpenCodeEventEncoded",
|
|
import: 'import type { OpenCodeEventEncoded } from "@opencode-ai/protocol/groups/event"',
|
|
},
|
|
},
|
|
}),
|
|
fileURLToPath(new URL("../src/generated", import.meta.url)),
|
|
),
|
|
write(
|
|
emitEffectImported(contract, { module: "../contract", api: "ClientApi" }),
|
|
fileURLToPath(new URL("../src/generated-effect", import.meta.url)),
|
|
),
|
|
],
|
|
{ concurrency: 2, discard: true },
|
|
).pipe(Effect.provide(NodeFileSystem.layer)),
|
|
)
|