@opencode/server 2.0.22 → 2.0.24

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 (113) hide show
  1. package/dist/api.d.ts +1 -1
  2. package/dist/api.js +5 -5
  3. package/dist/auth.js +1 -1
  4. package/dist/chunks/{auth-kqk7gaza.js → event-feed-0b1t2b2s.js} +2 -2
  5. package/dist/chunks/{auth-5gkna4pv.js → event-feed-0nvjg055.js} +33 -33
  6. package/dist/chunks/{auth-w5qev33e.js → event-feed-2vy10eeh.js} +2 -2
  7. package/dist/chunks/{auth-vak2mhq3.js → event-feed-30gqa6y8.js} +11 -8
  8. package/dist/chunks/{auth-2nzbqq6w.js → event-feed-387sf4vs.js} +1 -1
  9. package/dist/chunks/{auth-rrt24jy6.js → event-feed-3c937re8.js} +2 -2
  10. package/dist/chunks/{auth-39fhjz78.js → event-feed-5fmydwgy.js} +1 -1
  11. package/dist/chunks/{auth-pz0jzgeb.js → event-feed-62qjgyra.js} +2 -2
  12. package/dist/chunks/{auth-rg7j7cph.js → event-feed-6sgwm4gr.js} +2 -2
  13. package/dist/chunks/{auth-0ar9gf7q.js → event-feed-acgs9zzk.js} +13 -6
  14. package/dist/chunks/{auth-anm12x33.js → event-feed-anm12x33.js} +1 -1
  15. package/dist/chunks/{auth-2b206wcs.js → event-feed-bptmkrac.js} +2 -2
  16. package/dist/chunks/{auth-scvg88rk.js → event-feed-ccfecbt4.js} +1 -1
  17. package/dist/chunks/{auth-frv6gfy7.js → event-feed-d00srfh1.js} +6 -5
  18. package/dist/chunks/{auth-5ybpxcad.js → event-feed-d0efjmp3.js} +7 -7
  19. package/dist/chunks/{auth-9aabh8fh.js → event-feed-da5stqtt.js} +2 -2
  20. package/dist/chunks/{auth-ar2c062s.js → event-feed-ep84ha6r.js} +3 -3
  21. package/dist/chunks/{auth-wym6bqm8.js → event-feed-f90y8hv1.js} +7 -7
  22. package/dist/chunks/{auth-vjmrn89t.js → event-feed-fsrvj92d.js} +2 -2
  23. package/dist/chunks/{auth-gtkdacvk.js → event-feed-gtkdacvk.js} +1 -1
  24. package/dist/chunks/{auth-b0kafjgg.js → event-feed-hqjvw1vc.js} +16 -16
  25. package/dist/chunks/{auth-g404tgwp.js → event-feed-j54drd5e.js} +1 -1
  26. package/dist/chunks/{auth-96sfj8c0.js → event-feed-jhsx8jtg.js} +2 -2
  27. package/dist/chunks/{auth-0h6q40e6.js → event-feed-jskw5q1g.js} +1 -1
  28. package/dist/chunks/{auth-35z95kj0.js → event-feed-k4rfktze.js} +3 -3
  29. package/dist/chunks/{auth-j4tb0vx8.js → event-feed-m9wzfeff.js} +2 -2
  30. package/dist/chunks/{auth-jk9mr6vp.js → event-feed-mpbfcr4e.js} +5 -2
  31. package/dist/chunks/{auth-wtp56sjr.js → event-feed-mz8smzxk.js} +11 -9
  32. package/dist/chunks/{auth-11g6bym3.js → event-feed-n7kafg5g.js} +2 -2
  33. package/dist/chunks/event-feed-nvmdgpqv.js +71 -0
  34. package/dist/chunks/{auth-23w8t84j.js → event-feed-nxdx74sv.js} +5 -4
  35. package/dist/chunks/{auth-a7ke583f.js → event-feed-pg3sqc69.js} +5 -4
  36. package/dist/chunks/{auth-1w959dsa.js → event-feed-ppd3f187.js} +4 -4
  37. package/dist/chunks/{auth-p2pbe694.js → event-feed-pvrbm2ca.js} +3 -3
  38. package/dist/chunks/{auth-zhw07218.js → event-feed-q4y3mw2d.js} +2 -2
  39. package/dist/chunks/{auth-0658f5hp.js → event-feed-qcy0p5fz.js} +2 -2
  40. package/dist/chunks/{auth-t9jkrcq1.js → event-feed-s4aja1df.js} +7 -7
  41. package/dist/chunks/{auth-sryvrekq.js → event-feed-srcrrwjk.js} +2 -2
  42. package/dist/chunks/{auth-rn5anws3.js → event-feed-swb5yrqf.js} +2 -2
  43. package/dist/chunks/{auth-7cv7ehbj.js → event-feed-w8db1rkr.js} +2 -2
  44. package/dist/chunks/{auth-vvagfka3.js → event-feed-wv5twc2g.js} +7 -7
  45. package/dist/chunks/{auth-rbn15j6z.js → event-feed-x6486bry.js} +7 -7
  46. package/dist/chunks/{auth-xsrtpxyd.js → event-feed-xsrtpxyd.js} +1 -1
  47. package/dist/chunks/{auth-trr1emsb.js → event-feed-zhqf1t9m.js} +1 -1
  48. package/dist/cors.js +1 -1
  49. package/dist/event-feed.js +5 -5
  50. package/dist/fetch.d.ts +2 -1
  51. package/dist/fetch.js +47 -47
  52. package/dist/handlers/agent.js +6 -6
  53. package/dist/handlers/command.js +6 -6
  54. package/dist/handlers/config.js +6 -6
  55. package/dist/handlers/credential.js +6 -6
  56. package/dist/handlers/debug.js +6 -6
  57. package/dist/handlers/event.js +7 -7
  58. package/dist/handlers/form.js +6 -6
  59. package/dist/handlers/fs.js +6 -6
  60. package/dist/handlers/generate.js +6 -6
  61. package/dist/handlers/integration.js +6 -6
  62. package/dist/handlers/location.js +6 -6
  63. package/dist/handlers/mcp.js +6 -6
  64. package/dist/handlers/message.js +6 -6
  65. package/dist/handlers/migration.js +6 -6
  66. package/dist/handlers/model.js +6 -6
  67. package/dist/handlers/permission.js +6 -6
  68. package/dist/handlers/persistent-pty.js +8 -8
  69. package/dist/handlers/plugin.js +6 -6
  70. package/dist/handlers/project.js +6 -6
  71. package/dist/handlers/provider.js +6 -6
  72. package/dist/handlers/pty-socket.js +1 -1
  73. package/dist/handlers/pty.js +9 -9
  74. package/dist/handlers/reference.js +6 -6
  75. package/dist/handlers/rpc.js +6 -6
  76. package/dist/handlers/server.js +9 -9
  77. package/dist/handlers/session-error.js +1 -1
  78. package/dist/handlers/session.js +6 -6
  79. package/dist/handlers/shell.js +6 -6
  80. package/dist/handlers/skill.js +6 -6
  81. package/dist/handlers/vcs.d.ts +4 -1
  82. package/dist/handlers/vcs.js +6 -6
  83. package/dist/handlers/websearch.js +6 -6
  84. package/dist/handlers/worktree.js +6 -6
  85. package/dist/handlers.d.ts +1 -1
  86. package/dist/handlers.js +43 -43
  87. package/dist/location.d.ts +5 -3
  88. package/dist/location.js +6 -4
  89. package/dist/middleware/authorization.js +2 -2
  90. package/dist/middleware/form-location.d.ts +3 -3
  91. package/dist/middleware/form-location.js +3 -3
  92. package/dist/middleware/schema-error.js +1 -1
  93. package/dist/middleware/session-location.d.ts +3 -3
  94. package/dist/middleware/session-location.js +3 -3
  95. package/dist/options.d.ts +1 -0
  96. package/dist/pairing.js +3 -3
  97. package/dist/process.d.ts +2 -1
  98. package/dist/process.js +49 -49
  99. package/dist/pty-environment.js +5 -5
  100. package/dist/request-tracing.js +1 -1
  101. package/dist/routes.d.ts +2 -2
  102. package/dist/routes.js +46 -46
  103. package/dist/server-info.js +5 -5
  104. package/dist/service-status.js +1 -1
  105. package/dist/workerd.js +49 -48
  106. package/package.json +8 -8
  107. package/dist/chunks/auth-k9ssaf54.js +0 -32
  108. /package/dist/chunks/{auth-9rqn6x4v.js → event-feed-9rqn6x4v.js} +0 -0
  109. /package/dist/chunks/{auth-hezj1jdf.js → event-feed-hezj1jdf.js} +0 -0
  110. /package/dist/chunks/{auth-q4bn6dy8.js → event-feed-q4bn6dy8.js} +0 -0
  111. /package/dist/chunks/{auth-smaf4a18.js → event-feed-smaf4a18.js} +0 -0
  112. /package/dist/chunks/{auth-t8yzmczr.js → event-feed-t8yzmczr.js} +0 -0
  113. /package/dist/chunks/{auth-yc7nft6q.js → event-feed-yc7nft6q.js} +0 -0
package/dist/api.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { LocationMiddleware } from "./location";
2
2
  import { FormLocationMiddleware } from "./middleware/form-location";
3
3
  import { SessionLocationMiddleware } from "./middleware/session-location";
4
- export declare const Api: import("@opencode/protocol/api").Api<LocationMiddleware, import("effect/unstable/httpapi/HttpApiMiddleware").HttpApiMiddleware<import("@opencode/core/instance").Services, never, never>, FormLocationMiddleware, import("effect/unstable/httpapi/HttpApiMiddleware").HttpApiMiddleware<import("@opencode/core/instance").Services, readonly [typeof import("@opencode/protocol/errors").InvalidRequestError, typeof import("@opencode/protocol/errors").SessionNotFoundError], never>, SessionLocationMiddleware, import("effect/unstable/httpapi/HttpApiMiddleware").HttpApiMiddleware<import("@opencode/core/instance").Services, readonly [typeof import("@opencode/protocol/errors").InvalidRequestError, typeof import("@opencode/protocol/errors").SessionNotFoundError], never>, import("effect/unstable/httpapi/HttpApiGroup").HttpApiGroup<"server.event", import("effect/unstable/httpapi/HttpApiEndpoint").HttpApiEndpoint<"event.subscribe", "GET", "/api/event", never, never, never, never, import("effect/unstable/httpapi/HttpApiSchema").StreamSse<import("effect/unstable/httpapi/HttpApiSchema").SseEventFromData<import("effect/Schema").Union<readonly [import("effect/Schema").Struct<{
4
+ export declare const Api: import("@opencode/protocol/api").Api<LocationMiddleware, import("effect/unstable/httpapi/HttpApiMiddleware").HttpApiMiddleware<import("@opencode/core/instance").Services, readonly [typeof import("@opencode/protocol/errors").LocationNotFoundError], never>, FormLocationMiddleware, import("effect/unstable/httpapi/HttpApiMiddleware").HttpApiMiddleware<import("@opencode/core/instance").Services, readonly [typeof import("@opencode/protocol/errors").InvalidRequestError, typeof import("@opencode/protocol/errors").SessionNotFoundError, typeof import("@opencode/protocol/errors").LocationNotFoundError], never>, SessionLocationMiddleware, import("effect/unstable/httpapi/HttpApiMiddleware").HttpApiMiddleware<import("@opencode/core/instance").Services, readonly [typeof import("@opencode/protocol/errors").InvalidRequestError, typeof import("@opencode/protocol/errors").SessionNotFoundError, typeof import("@opencode/protocol/errors").LocationNotFoundError], never>, import("effect/unstable/httpapi/HttpApiGroup").HttpApiGroup<"server.event", import("effect/unstable/httpapi/HttpApiEndpoint").HttpApiEndpoint<"event.subscribe", "GET", "/api/event", never, never, never, never, import("effect/unstable/httpapi/HttpApiSchema").StreamSse<import("effect/unstable/httpapi/HttpApiSchema").SseEventFromData<import("effect/Schema").Union<readonly [import("effect/Schema").Struct<{
5
5
  readonly id: import("effect/Schema").brand<import("effect/Schema").String, "Event.ID"> & {
6
6
  create: () => string & import("effect/Brand").Brand<"Event.ID">;
7
7
  };
package/dist/api.js CHANGED
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  Api2
3
- } from "./chunks/auth-ar2c062s.js";
4
- import"./chunks/auth-frv6gfy7.js";
5
- import"./chunks/auth-23w8t84j.js";
6
- import"./chunks/auth-0ar9gf7q.js";
7
- import"./chunks/auth-smaf4a18.js";
3
+ } from "./chunks/event-feed-ep84ha6r.js";
4
+ import"./chunks/event-feed-d00srfh1.js";
5
+ import"./chunks/event-feed-nxdx74sv.js";
6
+ import"./chunks/event-feed-acgs9zzk.js";
7
+ import"./chunks/event-feed-smaf4a18.js";
8
8
  export {
9
9
  Api2 as Api
10
10
  };
package/dist/auth.js CHANGED
@@ -7,7 +7,7 @@ import {
7
7
  verifySession2,
8
8
  sessionCookieName2,
9
9
  exports_auth
10
- } from "./chunks/auth-anm12x33.js";
10
+ } from "./chunks/event-feed-anm12x33.js";
11
11
  export {
12
12
  Config2 as Config,
13
13
  SESSION_TTL_SECONDS2 as SESSION_TTL_SECONDS,
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  missingSession2,
3
3
  failedMessageDecode2
4
- } from "./auth-smaf4a18.js";
4
+ } from "./event-feed-smaf4a18.js";
5
5
  import {
6
6
  Api2
7
- } from "./auth-ar2c062s.js";
7
+ } from "./event-feed-ep84ha6r.js";
8
8
 
9
9
  // src/handlers/message.ts
10
10
  import { SessionMessage } from "@opencode/core/session/message";
@@ -1,99 +1,99 @@
1
1
  import {
2
2
  GenerateHandler2
3
- } from "./auth-jk9mr6vp.js";
3
+ } from "./event-feed-mpbfcr4e.js";
4
4
  import {
5
5
  MessageHandler2
6
- } from "./auth-kqk7gaza.js";
6
+ } from "./event-feed-0b1t2b2s.js";
7
7
  import {
8
8
  ModelHandler2
9
- } from "./auth-vjmrn89t.js";
9
+ } from "./event-feed-fsrvj92d.js";
10
10
  import {
11
11
  ProviderHandler2
12
- } from "./auth-rn5anws3.js";
12
+ } from "./event-feed-swb5yrqf.js";
13
13
  import {
14
14
  SessionHandler2
15
- } from "./auth-vak2mhq3.js";
15
+ } from "./event-feed-30gqa6y8.js";
16
16
  import {
17
17
  PermissionHandler2
18
- } from "./auth-a7ke583f.js";
18
+ } from "./event-feed-pg3sqc69.js";
19
19
  import {
20
20
  FileSystemHandler2
21
- } from "./auth-96sfj8c0.js";
21
+ } from "./event-feed-jhsx8jtg.js";
22
22
  import {
23
23
  FormHandler2
24
- } from "./auth-w5qev33e.js";
24
+ } from "./event-feed-2vy10eeh.js";
25
25
  import {
26
26
  CommandHandler2
27
- } from "./auth-zhw07218.js";
27
+ } from "./event-feed-q4y3mw2d.js";
28
28
  import {
29
29
  SkillHandler2
30
- } from "./auth-j4tb0vx8.js";
30
+ } from "./event-feed-m9wzfeff.js";
31
31
  import {
32
32
  RpcHandler2
33
- } from "./auth-trr1emsb.js";
33
+ } from "./event-feed-zhqf1t9m.js";
34
34
  import {
35
- layer3
36
- } from "./auth-5ybpxcad.js";
35
+ layer4
36
+ } from "./event-feed-d0efjmp3.js";
37
37
  import {
38
38
  EventHandler2
39
- } from "./auth-1w959dsa.js";
39
+ } from "./event-feed-ppd3f187.js";
40
40
  import {
41
41
  AgentHandler2
42
- } from "./auth-0658f5hp.js";
42
+ } from "./event-feed-qcy0p5fz.js";
43
43
  import {
44
44
  PluginHandler2
45
- } from "./auth-pz0jzgeb.js";
45
+ } from "./event-feed-62qjgyra.js";
46
46
  import {
47
47
  ServerHandler2
48
- } from "./auth-wtp56sjr.js";
48
+ } from "./event-feed-mz8smzxk.js";
49
49
  import {
50
50
  DebugHandler2
51
- } from "./auth-7cv7ehbj.js";
51
+ } from "./event-feed-w8db1rkr.js";
52
52
  import {
53
53
  PtyHandler2
54
- } from "./auth-wym6bqm8.js";
54
+ } from "./event-feed-f90y8hv1.js";
55
55
  import {
56
56
  PersistentPtyHandler2
57
- } from "./auth-35z95kj0.js";
57
+ } from "./event-feed-k4rfktze.js";
58
58
  import {
59
59
  ShellHandler2
60
- } from "./auth-sryvrekq.js";
60
+ } from "./event-feed-srcrrwjk.js";
61
61
  import {
62
62
  ReferenceHandler2
63
- } from "./auth-11g6bym3.js";
63
+ } from "./event-feed-n7kafg5g.js";
64
64
  import {
65
65
  LocationHandler2
66
- } from "./auth-9aabh8fh.js";
66
+ } from "./event-feed-da5stqtt.js";
67
67
  import {
68
68
  IntegrationHandler2
69
- } from "./auth-rg7j7cph.js";
69
+ } from "./event-feed-6sgwm4gr.js";
70
70
  import {
71
71
  WebSearchHandler2
72
- } from "./auth-2b206wcs.js";
72
+ } from "./event-feed-bptmkrac.js";
73
73
  import {
74
74
  McpHandler2
75
- } from "./auth-rrt24jy6.js";
75
+ } from "./event-feed-3c937re8.js";
76
76
  import {
77
77
  CredentialHandler2
78
- } from "./auth-g404tgwp.js";
78
+ } from "./event-feed-j54drd5e.js";
79
79
  import {
80
80
  ProjectHandler2
81
- } from "./auth-39fhjz78.js";
81
+ } from "./event-feed-5fmydwgy.js";
82
82
  import {
83
83
  WorktreeHandler2
84
- } from "./auth-scvg88rk.js";
84
+ } from "./event-feed-ccfecbt4.js";
85
85
  import {
86
86
  VcsHandler2
87
- } from "./auth-k9ssaf54.js";
87
+ } from "./event-feed-nvmdgpqv.js";
88
88
  import {
89
89
  MigrationHandler2
90
- } from "./auth-2nzbqq6w.js";
90
+ } from "./event-feed-387sf4vs.js";
91
91
  import {
92
92
  ConfigHandler2
93
- } from "./auth-0h6q40e6.js";
93
+ } from "./event-feed-jskw5q1g.js";
94
94
 
95
95
  // src/handlers.ts
96
96
  import { Layer } from "effect";
97
- var handlers2 = Layer.mergeAll(ServerHandler2, DebugHandler2, MigrationHandler2, LocationHandler2, AgentHandler2, PluginHandler2, SessionHandler2, MessageHandler2, ModelHandler2, GenerateHandler2, ProviderHandler2, IntegrationHandler2, WebSearchHandler2, McpHandler2, CredentialHandler2, ProjectHandler2, FormHandler2, PermissionHandler2, FileSystemHandler2, CommandHandler2, SkillHandler2, RpcHandler2, EventHandler2.pipe(Layer.provide(layer3)), PtyHandler2, PersistentPtyHandler2, ShellHandler2, ReferenceHandler2, WorktreeHandler2, VcsHandler2, ConfigHandler2);
97
+ var handlers2 = Layer.mergeAll(ServerHandler2, DebugHandler2, MigrationHandler2, LocationHandler2, AgentHandler2, PluginHandler2, SessionHandler2, MessageHandler2, ModelHandler2, GenerateHandler2, ProviderHandler2, IntegrationHandler2, WebSearchHandler2, McpHandler2, CredentialHandler2, ProjectHandler2, FormHandler2, PermissionHandler2, FileSystemHandler2, CommandHandler2, SkillHandler2, RpcHandler2, EventHandler2.pipe(Layer.provide(layer4)), PtyHandler2, PersistentPtyHandler2, ShellHandler2, ReferenceHandler2, WorktreeHandler2, VcsHandler2, ConfigHandler2);
98
98
 
99
99
  export { handlers2 };
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  response2
3
- } from "./auth-0ar9gf7q.js";
3
+ } from "./event-feed-acgs9zzk.js";
4
4
  import {
5
5
  Api2
6
- } from "./auth-ar2c062s.js";
6
+ } from "./event-feed-ep84ha6r.js";
7
7
 
8
8
  // src/handlers/form.ts
9
9
  import { Form } from "@opencode/core/form";
@@ -3,10 +3,13 @@ import {
3
3
  missingMessage2,
4
4
  failedMessageDecode2,
5
5
  failedSnapshot2
6
- } from "./auth-smaf4a18.js";
6
+ } from "./event-feed-smaf4a18.js";
7
+ import {
8
+ locationErrors2
9
+ } from "./event-feed-acgs9zzk.js";
7
10
  import {
8
11
  Api2
9
- } from "./auth-ar2c062s.js";
12
+ } from "./event-feed-ep84ha6r.js";
10
13
 
11
14
  // src/handlers/session.ts
12
15
  import { Session } from "@opencode/core/session";
@@ -188,7 +191,7 @@ var SessionHandler2 = HttpApiBuilder.group(Api2, "server.session", (handlers) =>
188
191
  }).pipe(Effect.catchTag("Session.NotFoundError", missingSession2), Effect.catchTag("Session.PromptConflictError", (error) => Effect.fail(new ConflictError({
189
192
  message: `Prompt message ID conflicts with an existing durable record: ${error.messageID}`,
190
193
  resource: error.messageID
191
- }))), 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" }))))
194
+ }))), 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" }))), locationErrors2)
192
195
  };
193
196
  })).handle("session.command", Effect.fn(function* (ctx) {
194
197
  yield* session.command({
@@ -205,14 +208,14 @@ var SessionHandler2 = HttpApiBuilder.group(Api2, "server.session", (handlers) =>
205
208
  }))), Effect.catchTag("Command.ExecutionError", (error) => Effect.fail(new CommandExecutionError({
206
209
  command: error.command,
207
210
  message: error.message
208
- }))));
211
+ }))), locationErrors2);
209
212
  return HttpApiSchema.NoContent.make();
210
213
  })).handle("session.skill", Effect.fn(function* (ctx) {
211
214
  yield* session.skill({
212
215
  sessionID: ctx.params.sessionID,
213
216
  skill: ctx.payload.id,
214
217
  resume: ctx.payload.resume
215
- }).pipe(Effect.catchTag("Session.NotFoundError", missingSession2), Effect.catchTag("Session.SkillNotFoundError", (error) => Effect.fail(new SkillNotFoundError({ skill: error.skill, message: `Skill not found: ${error.skill}` }))));
218
+ }).pipe(Effect.catchTag("Session.NotFoundError", missingSession2), Effect.catchTag("Session.SkillNotFoundError", (error) => Effect.fail(new SkillNotFoundError({ skill: error.skill, message: `Skill not found: ${error.skill}` }))), locationErrors2);
216
219
  return HttpApiSchema.NoContent.make();
217
220
  })).handle("session.synthetic", Effect.fn(function* (ctx) {
218
221
  const data = yield* session.synthetic({
@@ -248,11 +251,11 @@ var SessionHandler2 = HttpApiBuilder.group(Api2, "server.session", (handlers) =>
248
251
  files: ctx.payload.files
249
252
  });
250
253
  return {
251
- data: yield* session.revert.stage({ ...ctx.params, ...ctx.payload }).pipe(Effect.catchTag("Session.NotFoundError", missingSession2), Effect.catchTag("Session.MessageNotFoundError", missingMessage2), Effect.catchTag("Session.BusyError", busySession), Effect.catchTag("Snapshot.Error", failedSnapshot2("stage session revert", ctx.params.sessionID)))
254
+ data: yield* session.revert.stage({ ...ctx.params, ...ctx.payload }).pipe(Effect.catchTag("Session.NotFoundError", missingSession2), Effect.catchTag("Session.MessageNotFoundError", missingMessage2), Effect.catchTag("Session.BusyError", busySession), Effect.catchTag("Snapshot.Error", failedSnapshot2("stage session revert", ctx.params.sessionID)), locationErrors2)
252
255
  };
253
256
  })).handle("session.revert.clear", Effect.fn(function* (ctx) {
254
257
  yield* Effect.log("session.revert.clear", { sessionID: ctx.params.sessionID });
255
- yield* session.revert.clear(ctx.params.sessionID).pipe(Effect.catchTag("Session.NotFoundError", missingSession2), Effect.catchTag("Session.BusyError", busySession), Effect.catchTag("Snapshot.Error", failedSnapshot2("clear session revert", ctx.params.sessionID)));
258
+ yield* session.revert.clear(ctx.params.sessionID).pipe(Effect.catchTag("Session.NotFoundError", missingSession2), Effect.catchTag("Session.BusyError", busySession), Effect.catchTag("Snapshot.Error", failedSnapshot2("clear session revert", ctx.params.sessionID)), locationErrors2);
256
259
  return HttpApiSchema.NoContent.make();
257
260
  })).handle("session.revert.commit", Effect.fn(function* (ctx) {
258
261
  yield* Effect.log("session.revert.commit", { sessionID: ctx.params.sessionID });
@@ -264,7 +267,7 @@ var SessionHandler2 = HttpApiBuilder.group(Api2, "server.session", (handlers) =>
264
267
  };
265
268
  })).handle("session.diff", Effect.fn(function* (ctx) {
266
269
  return {
267
- data: yield* session.diff({ sessionID: ctx.params.sessionID, ...ctx.query }).pipe(Effect.catchTag("Session.NotFoundError", missingSession2), Effect.catchTag("Session.MessageNotFoundError", missingMessage2), Effect.catchTag("Session.TurnRangeError", (error) => new InvalidRequestError({ message: error.message, field: error.field })), Effect.catchTag("Snapshot.Error", failedSnapshot2("diff session turn", ctx.params.sessionID)))
270
+ data: yield* session.diff({ sessionID: ctx.params.sessionID, ...ctx.query }).pipe(Effect.catchTag("Session.NotFoundError", missingSession2), Effect.catchTag("Session.MessageNotFoundError", missingMessage2), Effect.catchTag("Session.TurnRangeError", (error) => new InvalidRequestError({ message: error.message, field: error.field })), Effect.catchTag("Snapshot.Error", failedSnapshot2("diff session turn", ctx.params.sessionID)), locationErrors2)
268
271
  };
269
272
  })).handle("session.inbox.list", Effect.fn(function* (ctx) {
270
273
  return {
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  Api2
3
- } from "./auth-ar2c062s.js";
3
+ } from "./event-feed-ep84ha6r.js";
4
4
 
5
5
  // src/handlers/migration.ts
6
6
  import { V1Migration } from "@opencode/core/database/v1-migration";
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  response2
3
- } from "./auth-0ar9gf7q.js";
3
+ } from "./event-feed-acgs9zzk.js";
4
4
  import {
5
5
  Api2
6
- } from "./auth-ar2c062s.js";
6
+ } from "./event-feed-ep84ha6r.js";
7
7
 
8
8
  // src/handlers/mcp.ts
9
9
  import { Mcp } from "@opencode/core/mcp/index";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  Api2
3
- } from "./auth-ar2c062s.js";
3
+ } from "./event-feed-ep84ha6r.js";
4
4
 
5
5
  // src/handlers/project.ts
6
6
  import { Project } from "@opencode/core/project";
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  response2
3
- } from "./auth-0ar9gf7q.js";
3
+ } from "./event-feed-acgs9zzk.js";
4
4
  import {
5
5
  Api2
6
- } from "./auth-ar2c062s.js";
6
+ } from "./event-feed-ep84ha6r.js";
7
7
 
8
8
  // src/handlers/plugin.ts
9
9
  import { Plugin } from "@opencode/core/plugin";
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  response2
3
- } from "./auth-0ar9gf7q.js";
3
+ } from "./event-feed-acgs9zzk.js";
4
4
  import {
5
5
  Api2
6
- } from "./auth-ar2c062s.js";
6
+ } from "./event-feed-ep84ha6r.js";
7
7
 
8
8
  // src/handlers/integration.ts
9
9
  import { Integration } from "@opencode/core/integration";
@@ -1,17 +1,24 @@
1
1
  import {
2
2
  missingSession2
3
- } from "./auth-smaf4a18.js";
3
+ } from "./event-feed-smaf4a18.js";
4
4
 
5
5
  // src/location.ts
6
+ import { FileSystem } from "@opencode/core/filesystem";
6
7
  import { Location } from "@opencode/core/location";
7
8
  import { LocationServiceMap } from "@opencode/core/location-services";
8
9
  import { AbsolutePath } from "@opencode/core/schema";
9
10
  import { Session } from "@opencode/core/session";
10
- import { InvalidRequestError } from "@opencode/protocol/errors";
11
+ import { LocationNotFoundError, InvalidRequestError } from "@opencode/protocol/errors";
11
12
  import { Effect, Layer, Schema } from "effect";
12
13
  import { HttpServerRequest } from "effect/unstable/http";
13
14
  import { HttpApiMiddleware } from "effect/unstable/httpapi";
14
- class LocationMiddleware2 extends HttpApiMiddleware.Service()("@opencode/HttpApiLocation") {
15
+ class LocationMiddleware2 extends HttpApiMiddleware.Service()("@opencode/HttpApiLocation", { error: [LocationNotFoundError] }) {
16
+ }
17
+ function locationErrors2(effect) {
18
+ return effect.pipe(Effect.catchIf((error) => error instanceof FileSystem.DirectoryNotFoundError, (error) => Effect.fail(new LocationNotFoundError({
19
+ location: { directory: error.directory },
20
+ message: `Location not found: ${error.directory}`
21
+ }))));
15
22
  }
16
23
  function response2(data) {
17
24
  return Effect.gen(function* () {
@@ -44,12 +51,12 @@ function decode(input) {
44
51
  return input;
45
52
  }
46
53
  }
47
- var layer5 = Layer.effect(LocationMiddleware2, Effect.gen(function* () {
54
+ var layer3 = Layer.effect(LocationMiddleware2, Effect.gen(function* () {
48
55
  const locations = yield* LocationServiceMap.Service;
49
56
  return LocationMiddleware2.of((effect) => Effect.gen(function* () {
50
57
  const request = yield* HttpServerRequest.HttpServerRequest;
51
- return yield* effect.pipe(Effect.provide(locations.get(requestRef2(request))));
58
+ return yield* effect.pipe(Effect.provide(locations.get(requestRef2(request))), locationErrors2);
52
59
  }));
53
60
  }));
54
61
 
55
- export { LocationMiddleware2, response2, sessionInfo2, requestRef2, layer5 };
62
+ export { LocationMiddleware2, locationErrors2, response2, sessionInfo2, requestRef2, layer3 };
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  __export
3
- } from "./auth-9rqn6x4v.js";
3
+ } from "./event-feed-9rqn6x4v.js";
4
4
 
5
5
  // src/auth.ts
6
6
  var exports_auth = {};
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  response2
3
- } from "./auth-0ar9gf7q.js";
3
+ } from "./event-feed-acgs9zzk.js";
4
4
  import {
5
5
  Api2
6
- } from "./auth-ar2c062s.js";
6
+ } from "./event-feed-ep84ha6r.js";
7
7
 
8
8
  // src/handlers/websearch.ts
9
9
  import { WebSearch } from "@opencode/core/websearch";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  Api2
3
- } from "./auth-ar2c062s.js";
3
+ } from "./event-feed-ep84ha6r.js";
4
4
 
5
5
  // src/handlers/worktree.ts
6
6
  import { Git } from "@opencode/core/git";
@@ -1,18 +1,19 @@
1
1
  import {
2
+ locationErrors2,
2
3
  sessionInfo2,
3
4
  requestRef2
4
- } from "./auth-0ar9gf7q.js";
5
+ } from "./event-feed-acgs9zzk.js";
5
6
 
6
7
  // src/middleware/form-location.ts
7
8
  import { Instance } from "@opencode/core/instance/service";
8
9
  import { LocationServiceMap } from "@opencode/core/location-services";
9
10
  import { Session } from "@opencode/core/session";
10
- import { InvalidRequestError, SessionNotFoundError } from "@opencode/protocol/errors";
11
+ import { LocationNotFoundError, InvalidRequestError, SessionNotFoundError } from "@opencode/protocol/errors";
11
12
  import { Effect, Layer } from "effect";
12
13
  import { HttpRouter, HttpServerRequest } from "effect/unstable/http";
13
14
  import { HttpApiMiddleware } from "effect/unstable/httpapi";
14
15
  class FormLocationMiddleware2 extends HttpApiMiddleware.Service()("@opencode/HttpApiFormLocation", {
15
- error: [InvalidRequestError, SessionNotFoundError]
16
+ error: [InvalidRequestError, SessionNotFoundError, LocationNotFoundError]
16
17
  }) {
17
18
  }
18
19
  var formLocationLayer2 = Layer.effect(FormLocationMiddleware2, Effect.gen(function* () {
@@ -23,10 +24,10 @@ var formLocationLayer2 = Layer.effect(FormLocationMiddleware2, Effect.gen(functi
23
24
  const route = yield* HttpRouter.RouteContext;
24
25
  if (route.params.sessionID === "global") {
25
26
  const request = yield* HttpServerRequest.HttpServerRequest;
26
- return yield* effect.pipe(Effect.provide(locations.get(requestRef2(request))));
27
+ return yield* effect.pipe(Effect.provide(locations.get(requestRef2(request))), locationErrors2);
27
28
  }
28
29
  const session = yield* sessionInfo2(sessions, route.params.sessionID);
29
- return yield* effect.pipe(instances.provide(session));
30
+ return yield* effect.pipe(instances.provide(session), locationErrors2);
30
31
  }));
31
32
  }));
32
33
 
@@ -1,17 +1,17 @@
1
1
  import {
2
2
  __export
3
- } from "./auth-9rqn6x4v.js";
3
+ } from "./event-feed-9rqn6x4v.js";
4
4
 
5
5
  // src/event-feed.ts
6
6
  var exports_event_feed = {};
7
7
  __export(exports_event_feed, {
8
8
  EncodingError: () => EncodingError2,
9
9
  EventFeed: () => exports_event_feed,
10
- Service: () => Service4,
10
+ Service: () => Service3,
11
11
  SubscriberCapacity: () => SubscriberCapacity2,
12
12
  SubscriberOverflowError: () => SubscriberOverflowError2,
13
13
  frame: () => frame2,
14
- layer: () => layer3,
14
+ layer: () => layer4,
15
15
  make: () => make4
16
16
  });
17
17
  import { Bus } from "@opencode/core/bus";
@@ -30,7 +30,7 @@ class EncodingError2 extends Schema.TaggedError()("EventFeed.EncodingError", {
30
30
  }) {
31
31
  }
32
32
 
33
- class Service4 extends Context.Service()("@opencode/server/EventFeed") {
33
+ class Service3 extends Context.Service()("@opencode/server/EventFeed") {
34
34
  }
35
35
  function frame2(event) {
36
36
  return `data: ${JSON.stringify(event)}
@@ -71,13 +71,13 @@ var make4 = Effect.fn("EventFeed.make")(function* (observe, options) {
71
71
  });
72
72
  const unsubscribe = yield* observe(publish);
73
73
  yield* Effect.addFinalizer(() => unsubscribe);
74
- return Service4.of({
74
+ return Service3.of({
75
75
  subscribe: Effect.acquireRelease(Queue.dropping(capacity).pipe(Effect.tap((queue) => Effect.sync(() => subscribers.add(queue)))), (queue) => Effect.sync(() => subscribers.delete(queue)).pipe(Effect.andThen(Queue.shutdown(queue)), Effect.asVoid)).pipe(Effect.map(Stream.fromQueue))
76
76
  });
77
77
  });
78
- var layer3 = Layer.effect(Service4, Effect.gen(function* () {
78
+ var layer4 = Layer.effect(Service3, Effect.gen(function* () {
79
79
  const bus = yield* Bus.Service;
80
80
  return yield* make4(bus.listen);
81
81
  }));
82
82
 
83
- export { SubscriberCapacity2, SubscriberOverflowError2, EncodingError2, Service4, frame2, make4, layer3, exports_event_feed };
83
+ export { SubscriberCapacity2, SubscriberOverflowError2, EncodingError2, Service3, frame2, make4, layer4, exports_event_feed };
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  Api2
3
- } from "./auth-ar2c062s.js";
3
+ } from "./event-feed-ep84ha6r.js";
4
4
 
5
5
  // src/handlers/location.ts
6
6
  import { Location } from "@opencode/core/location";
@@ -16,7 +16,7 @@ var LocationHandler2 = HttpApiBuilder.group(Api2, "server.location", (handlers)
16
16
  directory: location.directory,
17
17
  project: location.project
18
18
  });
19
- })).handle("location.reload", () => LocationServiceMap.reload().pipe(Effect.provideService(LocationServiceMap.Service, locations), Effect.catchCause((cause) => Cause.hasInterruptsOnly(cause) ? Effect.failCause(cause) : Effect.fail(new ServiceUnavailableError({ message: Cause.pretty(cause), service: "location" })))));
19
+ })).handle("location.reload", () => LocationServiceMap.reload().pipe(Effect.provideService(LocationServiceMap.Service, locations), Effect.catchCause((cause) => Cause.hasInterruptsOnly(cause) ? Effect.failCause(Cause.fromReasons(cause.reasons.filter(Cause.isInterruptReason))) : Effect.fail(new ServiceUnavailableError({ message: Cause.pretty(cause), service: "location" })))));
20
20
  }));
21
21
 
22
22
  export { LocationHandler2 };
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  LocationMiddleware2
3
- } from "./auth-0ar9gf7q.js";
3
+ } from "./event-feed-acgs9zzk.js";
4
4
  import {
5
5
  FormLocationMiddleware2
6
- } from "./auth-frv6gfy7.js";
6
+ } from "./event-feed-d00srfh1.js";
7
7
  import {
8
8
  SessionLocationMiddleware2
9
- } from "./auth-23w8t84j.js";
9
+ } from "./event-feed-nxdx74sv.js";
10
10
 
11
11
  // src/api.ts
12
12
  import { makeDefaultApi } from "@opencode/protocol/api";
@@ -1,19 +1,19 @@
1
1
  import {
2
2
  response2
3
- } from "./auth-0ar9gf7q.js";
3
+ } from "./event-feed-acgs9zzk.js";
4
4
  import {
5
5
  Api2
6
- } from "./auth-ar2c062s.js";
6
+ } from "./event-feed-ep84ha6r.js";
7
7
  import {
8
8
  CorsConfig2,
9
9
  isAllowedRequestOrigin2
10
- } from "./auth-q4bn6dy8.js";
10
+ } from "./event-feed-q4bn6dy8.js";
11
11
  import {
12
- Service3
13
- } from "./auth-vvagfka3.js";
12
+ Service5
13
+ } from "./event-feed-wv5twc2g.js";
14
14
  import {
15
15
  runPtySocket2
16
- } from "./auth-hezj1jdf.js";
16
+ } from "./event-feed-hezj1jdf.js";
17
17
 
18
18
  // src/handlers/pty.ts
19
19
  import { Pty } from "@opencode/core/pty";
@@ -37,7 +37,7 @@ var ticketScope = Effect.gen(function* () {
37
37
  var PtyHandler2 = HttpApiBuilder.group(Api2, "server.pty", (handlers) => Effect.gen(function* () {
38
38
  const tickets = yield* PtyTicket.Service;
39
39
  const cors = yield* CorsConfig2;
40
- const environment = yield* Service3;
40
+ const environment = yield* Service5;
41
41
  return handlers.handle("pty.list", Effect.fn(function* () {
42
42
  const pty = yield* Pty.Service;
43
43
  return yield* response2(pty.list());
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  response2
3
- } from "./auth-0ar9gf7q.js";
3
+ } from "./event-feed-acgs9zzk.js";
4
4
  import {
5
5
  Api2
6
- } from "./auth-ar2c062s.js";
6
+ } from "./event-feed-ep84ha6r.js";
7
7
 
8
8
  // src/handlers/model.ts
9
9
  import { Model } from "@opencode/core/model";
@@ -4,7 +4,7 @@ import {
4
4
  authorized2,
5
5
  verifySession2,
6
6
  sessionCookieName2
7
- } from "./auth-anm12x33.js";
7
+ } from "./event-feed-anm12x33.js";
8
8
 
9
9
  // src/middleware/authorization.ts
10
10
  import { UnauthorizedError } from "@opencode/protocol/errors";