Skip to content

Commit daff119

Browse files
chore: generate
1 parent e0d1ff4 commit daff119

2 files changed

Lines changed: 52 additions & 28 deletions

File tree

packages/opencode/specs/effect/http-api.md

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -170,23 +170,23 @@ Use raw Effect HTTP routes where `HttpApi` does not fit. The goal is deleting Ho
170170

171171
## Current Route Status
172172

173-
| Area | Status | Notes |
174-
| ------------------------- | ----------------- | ---------------------------------------------------------------------------------------- |
175-
| `question` | `bridged` | `GET /question`, reply, reject |
176-
| `permission` | `bridged` | list and reply |
177-
| `provider` | `bridged` | list, auth, OAuth authorize/callback |
178-
| `config` | `bridged` | read, providers, update |
179-
| `project` | `bridged` | list, current, git init, update |
180-
| `file` | `bridged` partial | find text/file/symbol, list/content/status |
181-
| `mcp` | `bridged` | status, add, OAuth, connect/disconnect |
182-
| `workspace` | `bridged` | adaptor/list/status/create/remove/session-restore |
183-
| top-level instance routes | `bridged` | path, vcs, command, agent, skill, lsp, formatter, dispose |
184-
| experimental JSON routes | `bridged` | console, tool, worktree list/mutations, global session list, resource list |
185-
| `session` | `bridged` partial | read routes; lifecycle, message mutations, streaming remain |
186-
| `sync` | `bridged` | start/replay/history |
187-
| `event` | `special` | SSE |
188-
| `pty` | `special` | websocket |
189-
| `tui` | `special` | UI bridge |
173+
| Area | Status | Notes |
174+
| ------------------------- | ----------------- | -------------------------------------------------------------------------- |
175+
| `question` | `bridged` | `GET /question`, reply, reject |
176+
| `permission` | `bridged` | list and reply |
177+
| `provider` | `bridged` | list, auth, OAuth authorize/callback |
178+
| `config` | `bridged` | read, providers, update |
179+
| `project` | `bridged` | list, current, git init, update |
180+
| `file` | `bridged` partial | find text/file/symbol, list/content/status |
181+
| `mcp` | `bridged` | status, add, OAuth, connect/disconnect |
182+
| `workspace` | `bridged` | adaptor/list/status/create/remove/session-restore |
183+
| top-level instance routes | `bridged` | path, vcs, command, agent, skill, lsp, formatter, dispose |
184+
| experimental JSON routes | `bridged` | console, tool, worktree list/mutations, global session list, resource list |
185+
| `session` | `bridged` partial | read routes; lifecycle, message mutations, streaming remain |
186+
| `sync` | `bridged` | start/replay/history |
187+
| `event` | `special` | SSE |
188+
| `pty` | `special` | websocket |
189+
| `tui` | `special` | UI bridge |
190190

191191
## Full Route Checklist
192192

packages/opencode/test/server/httpapi-session.test.ts

Lines changed: 35 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -86,23 +86,47 @@ describe("session HttpApi", () => {
8686
const message = await createTextMessage(tmp.path, parent.id, "hello")
8787
await createTextMessage(tmp.path, parent.id, "world")
8888

89-
expect((await json<Session.Info[]>(await app().request(`${SessionPaths.list}?roots=true`, { headers }))).map((item) => item.id)).toContain(parent.id)
89+
expect(
90+
(await json<Session.Info[]>(await app().request(`${SessionPaths.list}?roots=true`, { headers }))).map(
91+
(item) => item.id,
92+
),
93+
).toContain(parent.id)
9094

9195
expect(await json<Record<string, unknown>>(await app().request(SessionPaths.status, { headers }))).toEqual({})
9296

93-
expect(await json<Session.Info>(await app().request(pathFor(SessionPaths.get, { sessionID: parent.id }), { headers }))).toMatchObject({ id: parent.id, title: "parent" })
94-
95-
expect((await json<Session.Info[]>(await app().request(pathFor(SessionPaths.children, { sessionID: parent.id }), { headers }))).map((item) => item.id)).toEqual([child.id])
96-
97-
expect(await json<unknown[]>(await app().request(pathFor(SessionPaths.todo, { sessionID: parent.id }), { headers }))).toEqual([])
98-
99-
expect(await json<unknown[]>(await app().request(pathFor(SessionPaths.diff, { sessionID: parent.id }), { headers }))).toEqual([])
100-
101-
const messages = await app().request(`${pathFor(SessionPaths.messages, { sessionID: parent.id })}?limit=1`, { headers })
97+
expect(
98+
await json<Session.Info>(await app().request(pathFor(SessionPaths.get, { sessionID: parent.id }), { headers })),
99+
).toMatchObject({ id: parent.id, title: "parent" })
100+
101+
expect(
102+
(
103+
await json<Session.Info[]>(
104+
await app().request(pathFor(SessionPaths.children, { sessionID: parent.id }), { headers }),
105+
)
106+
).map((item) => item.id),
107+
).toEqual([child.id])
108+
109+
expect(
110+
await json<unknown[]>(await app().request(pathFor(SessionPaths.todo, { sessionID: parent.id }), { headers })),
111+
).toEqual([])
112+
113+
expect(
114+
await json<unknown[]>(await app().request(pathFor(SessionPaths.diff, { sessionID: parent.id }), { headers })),
115+
).toEqual([])
116+
117+
const messages = await app().request(`${pathFor(SessionPaths.messages, { sessionID: parent.id })}?limit=1`, {
118+
headers,
119+
})
102120
const messagePage = await json<MessageV2.WithParts[]>(messages)
103121
expect(messages.headers.get("x-next-cursor")).toBeTruthy()
104122
expect(messagePage[0]?.parts[0]).toMatchObject({ type: "text" })
105123

106-
expect(await json<MessageV2.WithParts>(await app().request(pathFor(SessionPaths.message, { sessionID: parent.id, messageID: message.id }), { headers }))).toMatchObject({ info: { id: message.id } })
124+
expect(
125+
await json<MessageV2.WithParts>(
126+
await app().request(pathFor(SessionPaths.message, { sessionID: parent.id, messageID: message.id }), {
127+
headers,
128+
}),
129+
),
130+
).toMatchObject({ info: { id: message.id } })
107131
})
108132
})

0 commit comments

Comments
 (0)