feat(client): add browser host SDK

This commit is contained in:
LukeParkerDev 2026-07-28 15:35:35 +10:00
commit f814e4758c
26 changed files with 3503 additions and 29 deletions

View file

@ -1,2 +1,2 @@
export { ClientError } from "./client-error"
export * as OpenCode from "./client"
export { ClientError } from "./client-error.js"
export * as OpenCode from "./client.js"

View file

@ -8,14 +8,14 @@ describe("HttpApiCodegen.write", () => {
const writes: Array<{ readonly path: string; readonly content: string }> = []
const output: Output = {
operations: [],
files: [{ path: "session.ts", content: "export const session = {}" }],
files: [{ path: "session.ts", content: 'export { session } from "../../session-data"' }],
}
return Effect.gen(function* () {
yield* write(output, "/generated")
expect(writes).toEqual([
{ path: "/generated/session.ts", content: "export const session = {}\n" },
{ path: "/generated/session.ts", content: 'export { session } from "../../session-data.js"\n' },
{ path: "/generated/.httpapi-codegen.json", content: '[\n "session.ts"\n]\n' },
])
}).pipe(