@opencode/server 2.0.7 → 2.0.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (104) hide show
  1. package/dist/api.d.ts +4 -4
  2. package/dist/api.js +10 -9
  3. package/dist/auth.js +12 -17
  4. package/dist/chunks/fetch-00nn3k4b.js +20 -0
  5. package/dist/chunks/fetch-04xw3v55.js +23 -0
  6. package/dist/chunks/fetch-0d9kah4z.js +23 -0
  7. package/dist/chunks/fetch-19c9ysa1.js +61 -0
  8. package/dist/chunks/fetch-1c4qas2w.js +346 -0
  9. package/dist/chunks/fetch-254zvkj6.js +22 -0
  10. package/dist/chunks/fetch-3kzx88w9.js +26 -0
  11. package/dist/chunks/fetch-4cf3x1kw.js +21 -0
  12. package/dist/chunks/fetch-4g0fa6m0.js +32 -0
  13. package/dist/chunks/fetch-4vn5bvkr.js +25 -0
  14. package/dist/chunks/fetch-5rwqcaw2.js +33 -0
  15. package/dist/chunks/fetch-6gkz39ey.js +55 -0
  16. package/dist/chunks/fetch-6nvan4e0.js +17 -0
  17. package/dist/chunks/fetch-7rzt3wm8.js +13 -0
  18. package/dist/chunks/fetch-8bajbwjh.js +40 -0
  19. package/dist/chunks/fetch-99sfd1j8.js +83 -0
  20. package/dist/chunks/fetch-9rqn6x4v.js +16 -0
  21. package/dist/chunks/fetch-a6yp8301.js +156 -0
  22. package/dist/chunks/fetch-arj41x43.js +77 -0
  23. package/dist/chunks/fetch-b0b71rwa.js +39 -0
  24. package/dist/chunks/fetch-bjrwanme.js +22 -0
  25. package/dist/chunks/fetch-br99j6q1.js +35 -0
  26. package/dist/chunks/fetch-ceh2h0m9.js +25 -0
  27. package/dist/chunks/fetch-csspsf0t.js +99 -0
  28. package/dist/chunks/fetch-d4bshj6j.js +37 -0
  29. package/dist/chunks/fetch-hezj1jdf.js +7 -0
  30. package/dist/chunks/fetch-hjnxtxmk.js +34 -0
  31. package/dist/chunks/fetch-j2pfq4q6.js +42 -0
  32. package/dist/chunks/fetch-m6wvgbfq.js +60 -0
  33. package/dist/chunks/fetch-n0er2m55.js +163 -0
  34. package/dist/chunks/fetch-pnqq1zxv.js +29 -0
  35. package/dist/chunks/fetch-q0ycym90.js +13 -0
  36. package/dist/chunks/fetch-q4bn6dy8.js +39 -0
  37. package/dist/chunks/fetch-qm92ga5h.js +26 -0
  38. package/dist/chunks/fetch-qnwpcgp7.js +22 -0
  39. package/dist/chunks/fetch-r7e9r02j.js +13 -0
  40. package/dist/chunks/fetch-rcg4y18n.js +59 -0
  41. package/dist/chunks/fetch-req22b70.js +22 -0
  42. package/dist/chunks/fetch-s4aja1df.js +36 -0
  43. package/dist/chunks/fetch-smaf4a18.js +28 -0
  44. package/dist/chunks/fetch-t8yzmczr.js +18 -0
  45. package/dist/chunks/fetch-vgpejxxy.js +149 -0
  46. package/dist/chunks/fetch-xsrtpxyd.js +23 -0
  47. package/dist/chunks/fetch-yc7nft6q.js +5 -0
  48. package/dist/chunks/fetch-ychamt23.js +139 -0
  49. package/dist/chunks/fetch-ysabas57.js +13 -0
  50. package/dist/chunks/fetch-z5shrcz9.js +19 -0
  51. package/dist/chunks/fetch-zp2jm6dt.js +15 -0
  52. package/dist/chunks/fetch-zyv89x5n.js +30 -0
  53. package/dist/cors.js +10 -36
  54. package/dist/event-feed.js +20 -60
  55. package/dist/fetch.js +53 -11
  56. package/dist/handlers/agent.js +11 -17
  57. package/dist/handlers/command.js +11 -5
  58. package/dist/handlers/config.js +11 -16
  59. package/dist/handlers/credential.js +11 -14
  60. package/dist/handlers/debug.js +11 -11
  61. package/dist/handlers/event.js +12 -27
  62. package/dist/handlers/form.js +11 -9
  63. package/dist/handlers/fs.js +11 -22
  64. package/dist/handlers/generate.js +11 -15
  65. package/dist/handlers/integration.js +10 -142
  66. package/dist/handlers/location.js +11 -16
  67. package/dist/handlers/mcp.js +11 -31
  68. package/dist/handlers/message.js +10 -42
  69. package/dist/handlers/migration.js +11 -7
  70. package/dist/handlers/model.js +11 -14
  71. package/dist/handlers/permission.js +11 -57
  72. package/dist/handlers/persistent-pty.js +12 -135
  73. package/dist/handlers/plugin.js +11 -47
  74. package/dist/handlers/project.js +11 -9
  75. package/dist/handlers/provider.js +11 -20
  76. package/dist/handlers/pty-socket.js +6 -4
  77. package/dist/handlers/pty.js +13 -107
  78. package/dist/handlers/reference.js +11 -5
  79. package/dist/handlers/rpc.js +11 -15
  80. package/dist/handlers/server.js +12 -13
  81. package/dist/handlers/session-error.js +12 -26
  82. package/dist/handlers/session.js +10 -311
  83. package/dist/handlers/shell.js +11 -25
  84. package/dist/handlers/skill.js +11 -5
  85. package/dist/handlers/vcs.js +11 -19
  86. package/dist/handlers/websearch.js +11 -31
  87. package/dist/handlers/worktree.js +11 -37
  88. package/dist/handlers.d.ts +1 -1
  89. package/dist/handlers.js +46 -33
  90. package/dist/location.js +15 -49
  91. package/dist/middleware/authorization.js +11 -49
  92. package/dist/middleware/form-location.js +10 -25
  93. package/dist/middleware/schema-error.js +8 -15
  94. package/dist/middleware/session-location.js +10 -19
  95. package/dist/options.js +5 -1
  96. package/dist/process.js +108 -28
  97. package/dist/pty-environment.js +12 -9
  98. package/dist/request-tracing.js +6 -2
  99. package/dist/routes.d.ts +2 -2
  100. package/dist/routes.js +52 -118
  101. package/dist/server-info.js +12 -22
  102. package/dist/service-status.js +8 -11
  103. package/dist/workerd.js +80 -12
  104. package/package.json +8 -8
@@ -1,13 +1,12 @@
1
- import { Effect } from "effect";
2
- import { HttpApiBuilder } from "effect/unstable/httpapi";
3
- import { Api } from "../api";
4
- import { ServerInfo } from "../server-info";
5
- export const ServerHandler = HttpApiBuilder.group(Api, "server.server", (handlers) => handlers.handle("server.info", () => Effect.gen(function* () {
6
- const info = yield* ServerInfo.Service;
7
- return {
8
- version: info.app.version ?? "unknown",
9
- pid: process.pid ?? 0,
10
- urls: info.urls(),
11
- paths: info.paths
12
- };
13
- })));
1
+ import {
2
+ ServerHandler2
3
+ } from "../chunks/fetch-4cf3x1kw.js";
4
+ import"../chunks/fetch-s4aja1df.js";
5
+ import"../chunks/fetch-z5shrcz9.js";
6
+ import"../chunks/fetch-3kzx88w9.js";
7
+ import"../chunks/fetch-5rwqcaw2.js";
8
+ import"../chunks/fetch-6gkz39ey.js";
9
+ import"../chunks/fetch-smaf4a18.js";
10
+ export {
11
+ ServerHandler2 as ServerHandler
12
+ };
@@ -1,26 +1,12 @@
1
- import { Session } from "@opencode/core/session";
2
- import { MessageNotFoundError, SessionNotFoundError, UnknownError } from "@opencode/protocol/errors";
3
- import { Effect } from "effect";
4
- export function missingSession(error) {
5
- return new SessionNotFoundError({
6
- sessionID: error.sessionID,
7
- message: `Session not found: ${error.sessionID}`
8
- });
9
- }
10
- export function missingMessage(error) {
11
- return new MessageNotFoundError({
12
- sessionID: error.sessionID,
13
- messageID: error.messageID,
14
- message: `Message not found: ${error.messageID}`
15
- });
16
- }
17
- export function failedMessageDecode(error) {
18
- const ref = `err_${crypto.randomUUID().slice(0, 8)}`;
19
- return Effect.logError("failed to decode session message").pipe(Effect.annotateLogs({ ref, sessionID: error.sessionID, messageID: error.messageID }), Effect.andThen(Effect.fail(new UnknownError({ message: "Unexpected server error. Check server logs for details.", ref }))));
20
- }
21
- export function failedSnapshot(operation, sessionID) {
22
- return (error) => {
23
- const ref = `err_${crypto.randomUUID().slice(0, 8)}`;
24
- return Effect.logError(`failed to ${operation}`, { cause: error }).pipe(Effect.annotateLogs({ ref, sessionID }), Effect.andThen(Effect.fail(new UnknownError({ message: "Unexpected server error. Check server logs for details.", ref }))));
25
- };
26
- }
1
+ import {
2
+ missingSession2,
3
+ missingMessage2,
4
+ failedMessageDecode2,
5
+ failedSnapshot2
6
+ } from "../chunks/fetch-smaf4a18.js";
7
+ export {
8
+ failedMessageDecode2 as failedMessageDecode,
9
+ failedSnapshot2 as failedSnapshot,
10
+ missingMessage2 as missingMessage,
11
+ missingSession2 as missingSession
12
+ };
@@ -1,312 +1,11 @@
1
- import { Session } from "@opencode/core/session";
2
- import { SessionStats } from "@opencode/core/session/stats";
3
- import { SessionTitle } from "@opencode/core/session/title";
4
- import { SessionTransfer } from "@opencode/core/session/transfer";
5
- import { InstructionEntry } from "@opencode/core/session/instruction-entry";
6
- import { Form } from "@opencode/core/form";
7
- import { DateTime, Effect, Stream } from "effect";
8
- import { HttpApiBuilder, HttpApiSchema } from "effect/unstable/httpapi";
9
- import { Api } from "../api";
10
- import { SessionsCursor } from "@opencode/protocol/groups/session";
11
1
  import {
12
- ConflictError,
13
- CommandExecutionError,
14
- CommandNotFoundError,
15
- FormAlreadySettledError,
16
- FormInvalidAnswerError,
17
- FormNotFoundError,
18
- InvalidRequestError,
19
- InvalidCursorError,
20
- MessageNotFoundError,
21
- ServiceUnavailableError,
22
- SessionBusyError,
23
- SkillNotFoundError
24
- } from "@opencode/protocol/errors";
25
- import { AbsolutePath } from "@opencode/core/schema";
26
- import { failedMessageDecode, failedSnapshot, missingMessage, missingSession } from "./session-error";
27
- const DefaultSessionsLimit = 50;
28
- function missingForm(id) {
29
- return new FormNotFoundError({ id, message: `Form not found: ${id}` });
30
- }
31
- export const SessionHandler = HttpApiBuilder.group(Api, "server.session", (handlers) => Effect.gen(function* () {
32
- const session = yield* Session.Service, transfer = yield* SessionTransfer.Service, requireOwnedForm = Effect.fnUntraced(function* (sessionID, formID) {
33
- const form = yield* Form.Service, info = yield* form.get(formID).pipe(Effect.catchTag("Form.NotFoundError", () => missingForm(formID)));
34
- if (info.sessionID !== sessionID)
35
- return yield* missingForm(formID);
36
- return { form, info };
37
- }), busySession = (error) => new SessionBusyError({
38
- sessionID: error.sessionID,
39
- message: `Session is busy: ${error.sessionID}`
40
- }), pendingMutation = (effect, conflict) => effect.pipe(Effect.catchTag("Session.NotFoundError", missingSession), Effect.catchTag("Session.InboxConflictError", (error) => new ConflictError({ resource: error.inboxID, message: `${conflict}: ${error.inboxID}` })), Effect.as(HttpApiSchema.NoContent.make()));
41
- return handlers.handle("session.list", Effect.fn(function* (ctx) {
42
- const query = ctx.query.cursor !== void 0 ? yield* SessionsCursor.parse(ctx.query.cursor).pipe(Effect.mapError(() => new InvalidCursorError({ message: "Invalid cursor" }))) : ctx.query, sessions = (yield* session.list({
43
- ...query,
44
- limit: ctx.query.limit ?? DefaultSessionsLimit
45
- })).data, first = sessions[0], last = sessions.at(-1);
46
- return {
47
- data: sessions,
48
- cursor: {
49
- previous: first ? SessionsCursor.make({
50
- ...query,
51
- anchor: {
52
- id: first.id,
53
- time: DateTime.toEpochMillis(first.time.updated),
54
- direction: "previous"
55
- }
56
- }) : void 0,
57
- next: last ? SessionsCursor.make({
58
- ...query,
59
- anchor: {
60
- id: last.id,
61
- time: DateTime.toEpochMillis(last.time.updated),
62
- direction: "next"
63
- }
64
- }) : void 0
65
- }
66
- };
67
- })).handle("session.stats", Effect.fn(function* (ctx) {
68
- const timezone = ctx.query.timezone ?? "UTC";
69
- yield* Effect.try({
70
- try: () => new Intl.DateTimeFormat("en-US", { timeZone: timezone }),
71
- catch: () => new InvalidRequestError({ message: `Invalid time zone: ${timezone}` })
72
- });
73
- return {
74
- data: yield* SessionStats.get({
75
- from: ctx.query.from,
76
- to: ctx.query.to,
77
- projectID: ctx.query.project,
78
- timezone,
79
- tools: ctx.query.tools
80
- }).pipe(Effect.mapError(() => new InvalidRequestError({ message: "Stats range must end after it starts" })))
81
- };
82
- })).handle("session.create", Effect.fn(function* (ctx) {
83
- return {
84
- data: yield* session.create({
85
- id: ctx.payload.id,
86
- title: ctx.payload.title,
87
- agent: ctx.payload.agent,
88
- model: ctx.payload.model,
89
- metadata: ctx.payload.metadata,
90
- permissions: ctx.payload.permissions,
91
- location: ctx.payload.location ?? { directory: AbsolutePath.make(process.cwd()) }
92
- }).pipe(Effect.orDie)
93
- };
94
- })).handle("session.import", Effect.fn(function* (ctx) {
95
- return {
96
- data: yield* transfer.import({
97
- data: { info: ctx.payload.info, messages: ctx.payload.messages },
98
- location: ctx.payload.location ?? { directory: AbsolutePath.make(process.cwd()) }
99
- }).pipe(Effect.catchTag("Session.NotFoundError", missingSession), Effect.catchTag("SessionTransfer.ImportConflictError", (error) => new ConflictError({
100
- message: `Session already exists: ${error.sessionID}`,
101
- resource: error.sessionID
102
- })))
103
- };
104
- })).handle("session.export", Effect.fn(function* (ctx) {
105
- return {
106
- data: yield* transfer.export({ sessionID: ctx.params.sessionID, sanitize: ctx.query.sanitize }).pipe(Effect.catchTag("Session.NotFoundError", missingSession), Effect.catchTag("Session.MessageDecodeError", failedMessageDecode))
107
- };
108
- })).handle("session.active", Effect.fn(function* () {
109
- const active = yield* session.active;
110
- return {
111
- data: Object.fromEntries(Array.from(active, (sessionID) => [sessionID, { type: "running" }]))
112
- };
113
- })).handle("session.get", Effect.fn(function* (ctx) {
114
- return {
115
- data: yield* session.get(ctx.params.sessionID).pipe(Effect.catchTag("Session.NotFoundError", missingSession))
116
- };
117
- })).handle("session.view", Effect.fn(function* (ctx) {
118
- yield* session.view({ sessionID: ctx.params.sessionID, idle: DateTime.toEpochMillis(ctx.payload.idle) }).pipe(Effect.catchTag("Session.NotFoundError", missingSession));
119
- return HttpApiSchema.NoContent.make();
120
- })).handle("session.remove", Effect.fn(function* (ctx) {
121
- yield* session.remove(ctx.params.sessionID).pipe(Effect.catchTag("Session.NotFoundError", missingSession));
122
- return HttpApiSchema.NoContent.make();
123
- })).handle("session.environment", Effect.fn(function* (ctx) {
124
- yield* session.environment({ sessionID: ctx.params.sessionID, variables: ctx.payload.variables }).pipe(Effect.catchTag("Session.NotFoundError", missingSession));
125
- return HttpApiSchema.NoContent.make();
126
- })).handle("session.fork", Effect.fn(function* (ctx) {
127
- return {
128
- data: yield* session.fork({ sessionID: ctx.params.sessionID, before: ctx.payload.before }).pipe(Effect.catchTag("Session.NotFoundError", missingSession), Effect.catchTag("Session.MessageNotFoundError", missingMessage), Effect.catchTag("Session.ForkEmptyError", (error) => new InvalidRequestError({ message: error.message, kind: "empty_session" })))
129
- };
130
- })).handle("session.switchAgent", Effect.fn(function* (ctx) {
131
- yield* session.switchAgent({ sessionID: ctx.params.sessionID, agent: ctx.payload.agent }).pipe(Effect.catchTag("Session.NotFoundError", missingSession));
132
- return HttpApiSchema.NoContent.make();
133
- })).handle("session.switchModel", Effect.fn(function* (ctx) {
134
- yield* session.switchModel({ sessionID: ctx.params.sessionID, model: ctx.payload.model }).pipe(Effect.catchTag("Session.NotFoundError", missingSession));
135
- return HttpApiSchema.NoContent.make();
136
- })).handle("session.update", Effect.fn(function* (ctx) {
137
- yield* session.get(ctx.params.sessionID).pipe(Effect.catchTag("Session.NotFoundError", missingSession));
138
- if (ctx.payload.title !== void 0)
139
- if (ctx.payload.title)
140
- yield* session.rename({ sessionID: ctx.params.sessionID, title: ctx.payload.title }).pipe(Effect.catchTag("Session.NotFoundError", missingSession));
141
- else
142
- yield* (yield* SessionTitle.Service).generate(ctx.params.sessionID);
143
- if (ctx.payload.permissions !== void 0)
144
- yield* session.setPermissions({ sessionID: ctx.params.sessionID, permissions: ctx.payload.permissions }).pipe(Effect.catchTag("Session.NotFoundError", missingSession));
145
- return HttpApiSchema.NoContent.make();
146
- })).handle("session.move", Effect.fn(function* (ctx) {
147
- yield* session.move({
148
- sessionID: ctx.params.sessionID,
149
- directory: ctx.payload.directory,
150
- delivery: ctx.payload.delivery
151
- }).pipe(Effect.catchTag("Session.NotFoundError", missingSession), Effect.catchTag("Session.DestinationNotFoundError", (error) => Effect.fail(new InvalidRequestError({ message: `Directory does not exist: ${error.directory}` }))), Effect.catchTag("Session.DestinationNotDirectoryError", (error) => Effect.fail(new InvalidRequestError({ message: `Not a directory: ${error.directory}` }))), Effect.catchTag("Session.DestinationUnavailableError", (error) => Effect.fail(new InvalidRequestError({ message: `Directory is unavailable: ${error.directory}` }))));
152
- return HttpApiSchema.NoContent.make();
153
- })).handle("session.prompt", Effect.fn(function* (ctx) {
154
- return {
155
- data: yield* session.prompt({
156
- sessionID: ctx.params.sessionID,
157
- id: ctx.payload.id,
158
- text: ctx.payload.text,
159
- files: ctx.payload.files,
160
- agents: ctx.payload.agents,
161
- skills: ctx.payload.skills,
162
- metadata: ctx.payload.metadata,
163
- delivery: ctx.payload.delivery,
164
- resume: ctx.payload.resume
165
- }).pipe(Effect.catchTag("Session.NotFoundError", missingSession), Effect.catchTag("Session.PromptConflictError", (error) => Effect.fail(new ConflictError({
166
- message: `Prompt message ID conflicts with an existing durable record: ${error.messageID}`,
167
- resource: error.messageID
168
- }))), Effect.catchTag("Session.AttachmentError", (error) => Effect.fail(new InvalidRequestError({ message: error.message, field: "files" }))), Effect.catchTag("Session.SkillNotFoundError", (error) => Effect.fail(new InvalidRequestError({ message: `Skill not found: ${error.skill}`, field: "skills" }))))
169
- };
170
- })).handle("session.command", Effect.fn(function* (ctx) {
171
- yield* session.command({
172
- sessionID: ctx.params.sessionID,
173
- command: ctx.payload.name,
174
- text: ctx.payload.text,
175
- files: ctx.payload.files,
176
- agents: ctx.payload.agents,
177
- skills: ctx.payload.skills,
178
- delivery: ctx.payload.delivery
179
- }).pipe(Effect.catchTag("Session.NotFoundError", missingSession), Effect.catchTag("Command.NotFoundError", (error) => Effect.fail(new CommandNotFoundError({
180
- command: error.command,
181
- message: error.message
182
- }))), Effect.catchTag("Command.ExecutionError", (error) => Effect.fail(new CommandExecutionError({
183
- command: error.command,
184
- message: error.message
185
- }))));
186
- return HttpApiSchema.NoContent.make();
187
- })).handle("session.skill", Effect.fn(function* (ctx) {
188
- yield* session.skill({
189
- sessionID: ctx.params.sessionID,
190
- skill: ctx.payload.id,
191
- resume: ctx.payload.resume
192
- }).pipe(Effect.catchTag("Session.NotFoundError", missingSession), Effect.catchTag("Session.SkillNotFoundError", (error) => Effect.fail(new SkillNotFoundError({ skill: error.skill, message: `Skill not found: ${error.skill}` }))));
193
- return HttpApiSchema.NoContent.make();
194
- })).handle("session.synthetic", Effect.fn(function* (ctx) {
195
- return { data: yield* session.synthetic({
196
- id: ctx.payload.id,
197
- sessionID: ctx.params.sessionID,
198
- text: ctx.payload.text,
199
- description: ctx.payload.description,
200
- metadata: ctx.payload.metadata,
201
- delivery: ctx.payload.delivery,
202
- resume: ctx.payload.resume
203
- }).pipe(Effect.catchTag("Session.NotFoundError", missingSession), Effect.catchTag("Session.SyntheticConflictError", (error) => Effect.fail(new ConflictError({
204
- message: `Synthetic input ID conflicts with an existing durable record: ${error.inputID}`,
205
- resource: error.inputID
206
- })))) };
207
- })).handle("session.shell", Effect.fn(function* (ctx) {
208
- yield* session.shell({ sessionID: ctx.params.sessionID, id: ctx.payload.id, command: ctx.payload.command }).pipe(Effect.catchTag("Session.NotFoundError", missingSession));
209
- return HttpApiSchema.NoContent.make();
210
- })).handle("session.compact", Effect.fn(function* (ctx) {
211
- return {
212
- data: yield* session.compact({ sessionID: ctx.params.sessionID, id: ctx.payload.id, delivery: ctx.payload.delivery }).pipe(Effect.catchTag("Session.NotFoundError", missingSession), Effect.catchTag("Session.CompactionConflictError", (error) => Effect.fail(new ConflictError({
213
- message: `Compaction input ID conflicts with an existing durable record: ${error.inputID}`,
214
- resource: error.inputID
215
- }))))
216
- };
217
- })).handle("session.wait", Effect.fn(function* (ctx) {
218
- yield* session.wait(ctx.params.sessionID).pipe(Effect.catchTag("Session.NotFoundError", missingSession));
219
- return HttpApiSchema.NoContent.make();
220
- })).handle("session.revert.stage", Effect.fn(function* (ctx) {
221
- yield* Effect.log("session.revert.stage", {
222
- sessionID: ctx.params.sessionID,
223
- messageID: ctx.payload.messageID,
224
- files: ctx.payload.files
225
- });
226
- return {
227
- data: yield* session.revert.stage({ ...ctx.params, ...ctx.payload }).pipe(Effect.catchTag("Session.NotFoundError", missingSession), Effect.catchTag("Session.MessageNotFoundError", missingMessage), Effect.catchTag("Session.BusyError", busySession), Effect.catchTag("Snapshot.Error", failedSnapshot("stage session revert", ctx.params.sessionID)))
228
- };
229
- })).handle("session.revert.clear", Effect.fn(function* (ctx) {
230
- yield* Effect.log("session.revert.clear", { sessionID: ctx.params.sessionID });
231
- yield* session.revert.clear(ctx.params.sessionID).pipe(Effect.catchTag("Session.NotFoundError", missingSession), Effect.catchTag("Session.BusyError", busySession), Effect.catchTag("Snapshot.Error", failedSnapshot("clear session revert", ctx.params.sessionID)));
232
- return HttpApiSchema.NoContent.make();
233
- })).handle("session.revert.commit", Effect.fn(function* (ctx) {
234
- yield* Effect.log("session.revert.commit", { sessionID: ctx.params.sessionID });
235
- yield* session.revert.commit(ctx.params.sessionID).pipe(Effect.catchTag("Session.NotFoundError", missingSession), Effect.catchTag("Session.BusyError", busySession));
236
- return HttpApiSchema.NoContent.make();
237
- })).handle("session.context", Effect.fn(function* (ctx) {
238
- return {
239
- data: yield* session.context(ctx.params.sessionID).pipe(Effect.catchTag("Session.NotFoundError", missingSession), Effect.catchTag("Session.MessageDecodeError", failedMessageDecode))
240
- };
241
- })).handle("session.diff", Effect.fn(function* (ctx) {
242
- return {
243
- data: yield* session.diff({ sessionID: ctx.params.sessionID, ...ctx.query }).pipe(Effect.catchTag("Session.NotFoundError", missingSession), Effect.catchTag("Session.MessageNotFoundError", missingMessage), Effect.catchTag("Session.TurnRangeError", (error) => new InvalidRequestError({ message: error.message, field: error.field })), Effect.catchTag("Snapshot.Error", failedSnapshot("diff session turn", ctx.params.sessionID)))
244
- };
245
- })).handle("session.inbox.list", Effect.fn(function* (ctx) {
246
- return {
247
- data: yield* session.inbox(ctx.params.sessionID).pipe(Effect.catchTag("Session.NotFoundError", missingSession))
248
- };
249
- })).handle("session.inbox.cancel", Effect.fn(function* (ctx) {
250
- yield* session.cancelInbox({ sessionID: ctx.params.sessionID, inboxID: ctx.params.inboxID }).pipe(Effect.catchTag("Session.NotFoundError", missingSession), Effect.catchTag("Session.InboxConflictError", () => Effect.void));
251
- return HttpApiSchema.NoContent.make();
252
- })).handle("session.inbox.update", Effect.fn(function* (ctx) {
253
- return yield* pendingMutation(ctx.payload.delivery === "steer" ? session.steerInbox({ sessionID: ctx.params.sessionID, inboxID: ctx.params.inboxID }) : session.queueInbox({ sessionID: ctx.params.sessionID, inboxID: ctx.params.inboxID }), `Pending input cannot change to ${ctx.payload.delivery}`);
254
- })).handle("session.instructions.entry.list", Effect.fn(function* (ctx) {
255
- return { data: yield* (yield* InstructionEntry.Service).list(ctx.params.sessionID) };
256
- })).handle("session.instructions.entry.put", Effect.fn(function* (ctx) {
257
- yield* (yield* InstructionEntry.Service).put({ sessionID: ctx.params.sessionID, key: ctx.params.key, value: ctx.payload.value });
258
- return HttpApiSchema.NoContent.make();
259
- })).handle("session.instructions.entry.remove", Effect.fn(function* (ctx) {
260
- yield* (yield* InstructionEntry.Service).remove({ sessionID: ctx.params.sessionID, key: ctx.params.key });
261
- return HttpApiSchema.NoContent.make();
262
- })).handle("session.generate", Effect.fn(function* (ctx) {
263
- return { data: { text: yield* session.generate({ sessionID: ctx.params.sessionID, prompt: ctx.payload.prompt }).pipe(Effect.mapError((error) => error._tag === "Session.NotFoundError" ? missingSession(error) : new ServiceUnavailableError({ message: error.message, service: "session generation" }))) } };
264
- })).handle("session.log", Effect.fn(function* (ctx) {
265
- yield* session.get(ctx.params.sessionID).pipe(Effect.catchTag("Session.NotFoundError", missingSession));
266
- return session.log({ sessionID: ctx.params.sessionID, after: ctx.query.after, follow: ctx.query.follow }).pipe(Stream.orDie);
267
- })).handle("session.interrupt", Effect.fn(function* (ctx) {
268
- return { interrupted: yield* session.interrupt(ctx.params.sessionID, { resume: ctx.query.resume }) };
269
- })).handle("session.background", Effect.fn(function* (ctx) {
270
- yield* session.background(ctx.params.sessionID).pipe(Effect.catchTag("Session.NotFoundError", missingSession));
271
- return HttpApiSchema.NoContent.make();
272
- })).handle("session.message", Effect.fn(function* (ctx) {
273
- yield* session.get(ctx.params.sessionID).pipe(Effect.catchTag("Session.NotFoundError", missingSession));
274
- const message = yield* session.message(ctx.params);
275
- if (message)
276
- return { data: message };
277
- return yield* new MessageNotFoundError({
278
- sessionID: ctx.params.sessionID,
279
- messageID: ctx.params.messageID,
280
- message: `Message not found: ${ctx.params.messageID}`
281
- });
282
- })).handle("session.form.list", Effect.fn(function* (ctx) {
283
- return { data: yield* (yield* Form.Service).list({ sessionID: ctx.params.sessionID }) };
284
- })).handle("session.form.create", Effect.fn(function* (ctx) {
285
- return { data: yield* (yield* Form.Service).create({
286
- id: ctx.payload.id,
287
- sessionID: ctx.params.sessionID,
288
- title: ctx.payload.title,
289
- metadata: ctx.payload.metadata,
290
- fields: ctx.payload.fields
291
- }).pipe(Effect.catchTags({
292
- "Form.AlreadyExistsError": (error) => new ConflictError({ resource: error.id, message: error.message }),
293
- "Form.InvalidFormError": (error) => new InvalidRequestError({ message: error.message, field: "fields" })
294
- })) };
295
- })).handle("session.form.get", Effect.fn(function* (ctx) {
296
- const owned = yield* requireOwnedForm(ctx.params.sessionID, ctx.params.formID), state = yield* owned.form.state(ctx.params.formID).pipe(Effect.catchTag("Form.NotFoundError", () => missingForm(ctx.params.formID)));
297
- return { data: { ...owned.info, state } };
298
- })).handle("session.form.reply", Effect.fn(function* (ctx) {
299
- yield* (yield* requireOwnedForm(ctx.params.sessionID, ctx.params.formID)).form.reply({ id: ctx.params.formID, answer: ctx.payload.answer }).pipe(Effect.catchTags({
300
- "Form.AlreadySettledError": (error) => new FormAlreadySettledError({ id: error.id, message: error.message }),
301
- "Form.InvalidAnswerError": (error) => new FormInvalidAnswerError({ id: error.id, message: error.message }),
302
- "Form.NotFoundError": () => missingForm(ctx.params.formID)
303
- }));
304
- return HttpApiSchema.NoContent.make();
305
- })).handle("session.form.cancel", Effect.fn(function* (ctx) {
306
- yield* (yield* requireOwnedForm(ctx.params.sessionID, ctx.params.formID)).form.cancel(ctx.params.formID).pipe(Effect.catchTags({
307
- "Form.AlreadySettledError": (error) => new FormAlreadySettledError({ id: error.id, message: error.message }),
308
- "Form.NotFoundError": () => missingForm(ctx.params.formID)
309
- }));
310
- return HttpApiSchema.NoContent.make();
311
- }));
312
- }));
2
+ SessionHandler2
3
+ } from "../chunks/fetch-1c4qas2w.js";
4
+ import"../chunks/fetch-z5shrcz9.js";
5
+ import"../chunks/fetch-3kzx88w9.js";
6
+ import"../chunks/fetch-5rwqcaw2.js";
7
+ import"../chunks/fetch-6gkz39ey.js";
8
+ import"../chunks/fetch-smaf4a18.js";
9
+ export {
10
+ SessionHandler2 as SessionHandler
11
+ };
@@ -1,25 +1,11 @@
1
- import { Shell } from "@opencode/core/shell";
2
- import { Location } from "@opencode/core/location";
3
- import { Effect } from "effect";
4
- import { HttpApiBuilder, HttpApiSchema } from "effect/unstable/httpapi";
5
- import { ShellNotFoundError } from "@opencode/protocol/errors";
6
- import { Api } from "../api";
7
- import { response } from "../location";
8
- export const ShellHandler = HttpApiBuilder.group(Api, "server.shell", (handlers) => Effect.gen(function* () {
9
- return handlers.handle("shell.list", Effect.fn(function* () {
10
- const shell = yield* Shell.Service;
11
- return yield* response(shell.list());
12
- })).handle("shell.create", Effect.fn(function* (ctx) {
13
- const shell = yield* Shell.Service, location = yield* Location.Service;
14
- return yield* response(shell.create({ ...ctx.payload, cwd: ctx.payload.cwd || location.directory }).pipe(Effect.orDie));
15
- })).handle("shell.get", Effect.fn(function* (ctx) {
16
- const shell = yield* Shell.Service;
17
- return yield* response(shell.get(ctx.params.id).pipe(Effect.catchTag("Shell.NotFoundError", () => new ShellNotFoundError({ id: ctx.params.id, message: `Shell command not found: ${ctx.params.id}` }))));
18
- })).handle("shell.output", Effect.fn(function* (ctx) {
19
- const shell = yield* Shell.Service;
20
- return yield* response(shell.output(ctx.params.id, { cursor: ctx.query.cursor, limit: ctx.query.limit }).pipe(Effect.catchTag("Shell.NotFoundError", () => new ShellNotFoundError({ id: ctx.params.id, message: `Shell command not found: ${ctx.params.id}` }))));
21
- })).handle("shell.remove", Effect.fn(function* (ctx) {
22
- yield* (yield* Shell.Service).remove(ctx.params.id).pipe(Effect.catchTag("Shell.NotFoundError", () => Effect.void));
23
- return HttpApiSchema.NoContent.make();
24
- }));
25
- }));
1
+ import {
2
+ ShellHandler2
3
+ } from "../chunks/fetch-br99j6q1.js";
4
+ import"../chunks/fetch-z5shrcz9.js";
5
+ import"../chunks/fetch-3kzx88w9.js";
6
+ import"../chunks/fetch-5rwqcaw2.js";
7
+ import"../chunks/fetch-6gkz39ey.js";
8
+ import"../chunks/fetch-smaf4a18.js";
9
+ export {
10
+ ShellHandler2 as ShellHandler
11
+ };
@@ -1,5 +1,11 @@
1
- import { Skill } from "@opencode/core/skill";
2
- import { HttpApiBuilder } from "effect/unstable/httpapi";
3
- import { Api } from "../api";
4
- import { response } from "../location";
5
- export const SkillHandler = HttpApiBuilder.group(Api, "server.skill", (handlers) => handlers.handle("skill.list", () => response(Skill.Service.use((skill) => skill.list()))));
1
+ import {
2
+ SkillHandler2
3
+ } from "../chunks/fetch-q0ycym90.js";
4
+ import"../chunks/fetch-z5shrcz9.js";
5
+ import"../chunks/fetch-3kzx88w9.js";
6
+ import"../chunks/fetch-5rwqcaw2.js";
7
+ import"../chunks/fetch-6gkz39ey.js";
8
+ import"../chunks/fetch-smaf4a18.js";
9
+ export {
10
+ SkillHandler2 as SkillHandler
11
+ };
@@ -1,19 +1,11 @@
1
- import { Vcs } from "@opencode/core/vcs";
2
- import { ServiceUnavailableError } from "@opencode/protocol/errors";
3
- import { Effect } from "effect";
4
- import { HttpApiBuilder } from "effect/unstable/httpapi";
5
- import { Api } from "../api";
6
- import { response } from "../location";
7
- export const VcsHandler = HttpApiBuilder.group(Api, "server.vcs", (handlers) => Effect.gen(function* () {
8
- return handlers.handle("vcs.get", () => response(Effect.gen(function* () {
9
- return yield* (yield* Vcs.Service).info();
10
- }))).handle("vcs.base", () => response(Effect.gen(function* () {
11
- return yield* (yield* Vcs.Service).base().pipe(Effect.mapError((error) => new ServiceUnavailableError({ service: "vcs", message: error.message })));
12
- }))).handle("vcs.status", () => response(Effect.gen(function* () {
13
- return yield* (yield* Vcs.Service).status();
14
- }))).handle("vcs.branch.list", (ctx) => response(Effect.gen(function* () {
15
- return yield* (yield* Vcs.Service).branches({ search: ctx.query.search, limit: Math.min(ctx.query.limit ?? 50, 100) });
16
- }))).handle("vcs.diff", (ctx) => response(Effect.gen(function* () {
17
- return yield* (yield* Vcs.Service).diff(ctx.query.mode, { context: ctx.query.context, base: ctx.query.base }).pipe(Effect.mapError((error) => new ServiceUnavailableError({ service: "vcs", message: error.message })));
18
- })));
19
- }));
1
+ import {
2
+ VcsHandler2
3
+ } from "../chunks/fetch-4g0fa6m0.js";
4
+ import"../chunks/fetch-z5shrcz9.js";
5
+ import"../chunks/fetch-3kzx88w9.js";
6
+ import"../chunks/fetch-5rwqcaw2.js";
7
+ import"../chunks/fetch-6gkz39ey.js";
8
+ import"../chunks/fetch-smaf4a18.js";
9
+ export {
10
+ VcsHandler2 as VcsHandler
11
+ };
@@ -1,31 +1,11 @@
1
- import { WebSearch } from "@opencode/core/websearch";
2
- import { InvalidRequestError, ServiceUnavailableError } from "@opencode/protocol/errors";
3
- import { Effect } from "effect";
4
- import { HttpApiBuilder } from "effect/unstable/httpapi";
5
- import { Api } from "../api";
6
- import { response } from "../location";
7
- export const WebSearchHandler = HttpApiBuilder.group(Api, "server.websearch", (handlers) => Effect.gen(function* () {
8
- return handlers.handle("websearch.providers", Effect.fn("server.websearch.providers")(function* () {
9
- const websearch = yield* WebSearch.Service;
10
- return yield* response(websearch.providers());
11
- })).handle("websearch.query", Effect.fn("server.websearch.query")(function* (request) {
12
- const websearch = yield* WebSearch.Service;
13
- return yield* response(websearch.query(request.payload).pipe(Effect.catchTags({
14
- "WebSearch.ProviderRequired": () => new InvalidRequestError({
15
- message: "Web search provider is required",
16
- kind: "websearch_provider_required",
17
- field: "providerID"
18
- }),
19
- "WebSearch.ProviderNotFound": (error) => new InvalidRequestError({
20
- message: `Web search provider not found: ${error.providerID}`,
21
- kind: "websearch_provider_not_found",
22
- field: "providerID"
23
- }),
24
- "WebSearch.Disabled": () => new InvalidRequestError({ message: "Web search is disabled", kind: "websearch_disabled" }),
25
- "WebSearch.Request": (error) => new ServiceUnavailableError({
26
- message: `Web search request failed: ${error.providerID}`,
27
- service: error.providerID
28
- })
29
- })));
30
- }));
31
- }));
1
+ import {
2
+ WebSearchHandler2
3
+ } from "../chunks/fetch-b0b71rwa.js";
4
+ import"../chunks/fetch-z5shrcz9.js";
5
+ import"../chunks/fetch-3kzx88w9.js";
6
+ import"../chunks/fetch-5rwqcaw2.js";
7
+ import"../chunks/fetch-6gkz39ey.js";
8
+ import"../chunks/fetch-smaf4a18.js";
9
+ export {
10
+ WebSearchHandler2 as WebSearchHandler
11
+ };
@@ -1,37 +1,11 @@
1
- import { Git } from "@opencode/core/git";
2
- import { Worktree } from "@opencode/core/worktree";
3
- import { Project } from "@opencode/core/project";
4
- import { ProjectNotFoundError } from "@opencode/protocol/errors";
5
- import { WorktreeError } from "@opencode/protocol/groups/worktree";
6
- import { Effect } from "effect";
7
- import { HttpApiBuilder, HttpApiSchema } from "effect/unstable/httpapi";
8
- import { Api } from "../api";
9
- export const WorktreeHandler = HttpApiBuilder.group(Api, "server.worktree", (handlers) => Effect.gen(function* () {
10
- const worktrees = yield* Worktree.Service;
11
- return handlers.handle("worktree.list", (ctx) => worktrees.list(ctx.query).pipe(Effect.catchTag("Project.NotFoundError", missingProject))).handle("worktree.create", (ctx) => worktrees.create(ctx.payload).pipe(badRequest)).handle("worktree.remove", (ctx) => worktrees.remove(ctx.payload).pipe(badRequest, Effect.as(HttpApiSchema.NoContent.make()))).handle("worktree.refresh", (ctx) => worktrees.refresh(ctx.payload).pipe(badRequest, Effect.as(HttpApiSchema.NoContent.make())));
12
- }));
13
- function badRequest(effect) {
14
- return effect.pipe(Effect.catchTag("Project.NotFoundError", missingProject), Effect.mapError((error) => error instanceof ProjectNotFoundError ? error : new WorktreeError({
15
- name: "WorktreeError",
16
- data: {
17
- message: message(error),
18
- forceRequired: error instanceof Git.WorktreeError || error instanceof Worktree.OperationError ? error.forceRequired : void 0
19
- }
20
- })));
21
- }
22
- function missingProject(error) {
23
- return Effect.fail(new ProjectNotFoundError({ projectID: error.projectID, message: `Project not found: ${error.projectID}` }));
24
- }
25
- function message(error) {
26
- if (error instanceof Worktree.SourceDirectoryNotFoundError)
27
- return error.directory ? `Worktree source not found: ${error.directory}` : `Worktree source not found for project: ${error.projectID}`;
28
- if (error instanceof Worktree.DestinationExistsError)
29
- return `Worktree destination already exists: ${error.directory}`;
30
- if (error instanceof Worktree.DirectoryUnavailableError)
31
- return `Worktree directory unavailable: ${error.directory}`;
32
- if (error instanceof Worktree.InvalidDirectoryError)
33
- return `Invalid worktree directory: ${error.directory}`;
34
- if (error instanceof Worktree.StrategyUnavailableError)
35
- return `Worktree strategy unavailable: ${error.strategy}`;
36
- return error.message;
37
- }
1
+ import {
2
+ WorktreeHandler2
3
+ } from "../chunks/fetch-j2pfq4q6.js";
4
+ import"../chunks/fetch-z5shrcz9.js";
5
+ import"../chunks/fetch-3kzx88w9.js";
6
+ import"../chunks/fetch-5rwqcaw2.js";
7
+ import"../chunks/fetch-6gkz39ey.js";
8
+ import"../chunks/fetch-smaf4a18.js";
9
+ export {
10
+ WorktreeHandler2 as WorktreeHandler
11
+ };
@@ -1,2 +1,2 @@
1
1
  import { Layer } from "effect";
2
- export declare const handlers: Layer.Layer<import("effect/unstable/httpapi/HttpApiGroup").Service<"server", "server.generate"> | import("effect/unstable/httpapi/HttpApiGroup").Service<"server", "server.message"> | import("effect/unstable/httpapi/HttpApiGroup").Service<"server", "server.model"> | import("effect/unstable/httpapi/HttpApiGroup").Service<"server", "server.provider"> | import("effect/unstable/httpapi/HttpApiGroup").Service<"server", "server.session"> | import("effect/unstable/httpapi/HttpApiGroup").Service<"server", "server.permission"> | import("effect/unstable/httpapi/HttpApiGroup").Service<"server", "server.fs"> | import("effect/unstable/httpapi/HttpApiGroup").Service<"server", "server.form"> | import("effect/unstable/httpapi/HttpApiGroup").Service<"server", "server.command"> | import("effect/unstable/httpapi/HttpApiGroup").Service<"server", "server.skill"> | import("effect/unstable/httpapi/HttpApiGroup").Service<"server", "server.rpc"> | import("effect/unstable/httpapi/HttpApiGroup").Service<"server", "server.event"> | import("effect/unstable/httpapi/HttpApiGroup").Service<"server", "server.agent"> | import("effect/unstable/httpapi/HttpApiGroup").Service<"server", "server.plugin"> | import("effect/unstable/httpapi/HttpApiGroup").Service<"server", "server.server"> | import("effect/unstable/httpapi/HttpApiGroup").Service<"server", "server.debug"> | import("effect/unstable/httpapi/HttpApiGroup").Service<"server", "server.pty"> | import("effect/unstable/httpapi/HttpApiGroup").Service<"server", "server.experimental"> | import("effect/unstable/httpapi/HttpApiGroup").Service<"server", "server.shell"> | import("effect/unstable/httpapi/HttpApiGroup").Service<"server", "server.reference"> | import("effect/unstable/httpapi/HttpApiGroup").Service<"server", "server.location"> | import("effect/unstable/httpapi/HttpApiGroup").Service<"server", "server.integration"> | import("effect/unstable/httpapi/HttpApiGroup").Service<"server", "server.websearch"> | import("effect/unstable/httpapi/HttpApiGroup").Service<"server", "server.mcp"> | import("effect/unstable/httpapi/HttpApiGroup").Service<"server", "server.credential"> | import("effect/unstable/httpapi/HttpApiGroup").Service<"server", "server.project"> | import("effect/unstable/httpapi/HttpApiGroup").Service<"server", "server.worktree"> | import("effect/unstable/httpapi/HttpApiGroup").Service<"server", "server.vcs"> | import("effect/unstable/httpapi/HttpApiGroup").Service<"server", "server.migration"> | import("effect/unstable/httpapi/HttpApiGroup").Service<"server", "server.config">, never, import("@opencode/protocol/middleware/schema-error").SchemaErrorMiddleware | import("@opencode/protocol/middleware/authorization").Authorization | import("@opencode/util/global").Service | import("@opencode/core/bus").Service | import("@opencode/core/persistent-pty/index").Service | import("@opencode/core/location-service-map").Service | import("@opencode/core/session").Service | import("@opencode/core/instance").Service | import("@opencode/core/worktree").Service | import("./location").LocationMiddleware | import("./middleware/form-location").FormLocationMiddleware | import("./middleware/session-location").SessionLocationMiddleware | import("@opencode/core/pty/ticket").Service | import("@opencode/core/session/transfer").Service | import("effect/unstable/http/HttpRouter").Request<"Requires", import("@opencode/core/database/database").Service> | import("effect/unstable/http/HttpRouter").Request<"Requires", import("@opencode/core/permission/saved").Service> | import("effect/unstable/http/HttpRouter").Request<"Requires", import("@opencode/core/plugin/update").Service> | import("effect/unstable/http/HttpRouter").Request<"Requires", import("./server-info").Service> | import("./pty-environment").Service | import("effect/unstable/http/HttpRouter").Request<"Requires", import("@opencode/core/wellknown").Service> | import("effect/unstable/http/HttpRouter").Request<"Requires", import("@opencode/core/credential").Service> | import("effect/unstable/http/HttpRouter").Request<"Requires", import("@opencode/core/project").Service>>;
2
+ export declare const handlers: Layer.Layer<import("effect/unstable/httpapi/HttpApiGroup").Service<"server", "server.generate"> | import("effect/unstable/httpapi/HttpApiGroup").Service<"server", "server.message"> | import("effect/unstable/httpapi/HttpApiGroup").Service<"server", "server.model"> | import("effect/unstable/httpapi/HttpApiGroup").Service<"server", "server.provider"> | import("effect/unstable/httpapi/HttpApiGroup").Service<"server", "server.session"> | import("effect/unstable/httpapi/HttpApiGroup").Service<"server", "server.permission"> | import("effect/unstable/httpapi/HttpApiGroup").Service<"server", "server.fs"> | import("effect/unstable/httpapi/HttpApiGroup").Service<"server", "server.form"> | import("effect/unstable/httpapi/HttpApiGroup").Service<"server", "server.command"> | import("effect/unstable/httpapi/HttpApiGroup").Service<"server", "server.skill"> | import("effect/unstable/httpapi/HttpApiGroup").Service<"server", "server.rpc"> | import("effect/unstable/httpapi/HttpApiGroup").Service<"server", "server.event"> | import("effect/unstable/httpapi/HttpApiGroup").Service<"server", "server.agent"> | import("effect/unstable/httpapi/HttpApiGroup").Service<"server", "server.plugin"> | import("effect/unstable/httpapi/HttpApiGroup").Service<"server", "server.server"> | import("effect/unstable/httpapi/HttpApiGroup").Service<"server", "server.debug"> | import("effect/unstable/httpapi/HttpApiGroup").Service<"server", "server.pty"> | import("effect/unstable/httpapi/HttpApiGroup").Service<"server", "server.experimental"> | import("effect/unstable/httpapi/HttpApiGroup").Service<"server", "server.shell"> | import("effect/unstable/httpapi/HttpApiGroup").Service<"server", "server.reference"> | import("effect/unstable/httpapi/HttpApiGroup").Service<"server", "server.location"> | import("effect/unstable/httpapi/HttpApiGroup").Service<"server", "server.integration"> | import("effect/unstable/httpapi/HttpApiGroup").Service<"server", "server.websearch"> | import("effect/unstable/httpapi/HttpApiGroup").Service<"server", "server.mcp"> | import("effect/unstable/httpapi/HttpApiGroup").Service<"server", "server.credential"> | import("effect/unstable/httpapi/HttpApiGroup").Service<"server", "server.project"> | import("effect/unstable/httpapi/HttpApiGroup").Service<"server", "server.worktree"> | import("effect/unstable/httpapi/HttpApiGroup").Service<"server", "server.vcs"> | import("effect/unstable/httpapi/HttpApiGroup").Service<"server", "server.migration"> | import("effect/unstable/httpapi/HttpApiGroup").Service<"server", "server.config">, never, import("@opencode/protocol/middleware/schema-error").SchemaErrorMiddleware | import("@opencode/protocol/middleware/authorization").Authorization | import("@opencode/util/global").Service | import("@opencode/core/bus").Service | import("@opencode/core/persistent-pty/index").Service | import("@opencode/core/location-service-map").Service | import("@opencode/core/session").Service | import("@opencode/core/worktree").Service | import("@opencode/core/instance").Service | import("./location").LocationMiddleware | import("./middleware/form-location").FormLocationMiddleware | import("./middleware/session-location").SessionLocationMiddleware | import("@opencode/core/pty/ticket").Service | import("@opencode/core/session/transfer").Service | import("effect/unstable/http/HttpRouter").Request<"Requires", import("@opencode/core/database/database").Service> | import("effect/unstable/http/HttpRouter").Request<"Requires", import("@opencode/core/permission/saved").Service> | import("effect/unstable/http/HttpRouter").Request<"Requires", import("@opencode/core/plugin/update").Service> | import("effect/unstable/http/HttpRouter").Request<"Requires", import("./server-info").Service> | import("./pty-environment").Service | import("effect/unstable/http/HttpRouter").Request<"Requires", import("@opencode/core/wellknown").Service> | import("effect/unstable/http/HttpRouter").Request<"Requires", import("@opencode/core/credential").Service> | import("effect/unstable/http/HttpRouter").Request<"Requires", import("@opencode/core/project").Service>>;