@opencode/server 2.0.22 → 2.0.23

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 → options-0b1t2b2s.js} +2 -2
  5. package/dist/chunks/{auth-w5qev33e.js → options-2vy10eeh.js} +2 -2
  6. package/dist/chunks/{auth-vak2mhq3.js → options-30gqa6y8.js} +11 -8
  7. package/dist/chunks/{auth-2nzbqq6w.js → options-387sf4vs.js} +1 -1
  8. package/dist/chunks/{auth-rrt24jy6.js → options-3c937re8.js} +2 -2
  9. package/dist/chunks/{auth-5ybpxcad.js → options-54sczv30.js} +7 -7
  10. package/dist/chunks/{auth-39fhjz78.js → options-5fmydwgy.js} +1 -1
  11. package/dist/chunks/{auth-t9jkrcq1.js → options-5p62ed52.js} +5 -5
  12. package/dist/chunks/{auth-xsrtpxyd.js → options-5w24ch67.js} +4 -4
  13. package/dist/chunks/{auth-pz0jzgeb.js → options-62qjgyra.js} +2 -2
  14. package/dist/chunks/{auth-rg7j7cph.js → options-6sgwm4gr.js} +2 -2
  15. package/dist/chunks/{auth-p2pbe694.js → options-7nkw7zmw.js} +6 -6
  16. package/dist/chunks/{auth-0ar9gf7q.js → options-acgs9zzk.js} +13 -6
  17. package/dist/chunks/{auth-anm12x33.js → options-anm12x33.js} +1 -1
  18. package/dist/chunks/{auth-1w959dsa.js → options-aqzs83qc.js} +4 -4
  19. package/dist/chunks/{auth-vvagfka3.js → options-bkk2wfbz.js} +7 -7
  20. package/dist/chunks/{auth-2b206wcs.js → options-bptmkrac.js} +2 -2
  21. package/dist/chunks/{auth-scvg88rk.js → options-ccfecbt4.js} +1 -1
  22. package/dist/chunks/{auth-frv6gfy7.js → options-d00srfh1.js} +6 -5
  23. package/dist/chunks/{auth-9aabh8fh.js → options-da5stqtt.js} +2 -2
  24. package/dist/chunks/{auth-wtp56sjr.js → options-dvemjn3r.js} +11 -9
  25. package/dist/chunks/{auth-ar2c062s.js → options-ep84ha6r.js} +3 -3
  26. package/dist/chunks/{auth-vjmrn89t.js → options-fsrvj92d.js} +2 -2
  27. package/dist/chunks/{auth-5gkna4pv.js → options-gdqqe6m4.js} +33 -33
  28. package/dist/chunks/{auth-gtkdacvk.js → options-gtkdacvk.js} +1 -1
  29. package/dist/chunks/{auth-g404tgwp.js → options-j54drd5e.js} +1 -1
  30. package/dist/chunks/{auth-96sfj8c0.js → options-jhsx8jtg.js} +2 -2
  31. package/dist/chunks/{auth-0h6q40e6.js → options-jskw5q1g.js} +1 -1
  32. package/dist/chunks/{auth-35z95kj0.js → options-k4rfktze.js} +3 -3
  33. package/dist/chunks/{auth-rbn15j6z.js → options-kr61w04k.js} +8 -8
  34. package/dist/chunks/{auth-j4tb0vx8.js → options-m9wzfeff.js} +2 -2
  35. package/dist/chunks/{auth-jk9mr6vp.js → options-mpbfcr4e.js} +5 -2
  36. package/dist/chunks/{auth-11g6bym3.js → options-n7kafg5g.js} +2 -2
  37. package/dist/chunks/options-nvmdgpqv.js +71 -0
  38. package/dist/chunks/{auth-23w8t84j.js → options-nxdx74sv.js} +5 -4
  39. package/dist/chunks/{auth-a7ke583f.js → options-pg3sqc69.js} +5 -4
  40. package/dist/chunks/{auth-zhw07218.js → options-q4y3mw2d.js} +2 -2
  41. package/dist/chunks/{auth-0658f5hp.js → options-qcy0p5fz.js} +2 -2
  42. package/dist/chunks/{auth-sryvrekq.js → options-srcrrwjk.js} +2 -2
  43. package/dist/chunks/{auth-rn5anws3.js → options-swb5yrqf.js} +2 -2
  44. package/dist/chunks/{auth-b0kafjgg.js → options-vkrn1g9x.js} +17 -17
  45. package/dist/chunks/{auth-7cv7ehbj.js → options-w8db1rkr.js} +2 -2
  46. package/dist/chunks/{auth-wym6bqm8.js → options-wzq8v6r1.js} +7 -7
  47. package/dist/chunks/{auth-trr1emsb.js → options-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 +49 -49
  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 +5 -5
  97. package/dist/process.d.ts +2 -1
  98. package/dist/process.js +51 -51
  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 +3 -3
  104. package/dist/service-status.js +3 -3
  105. package/dist/workerd.js +51 -50
  106. package/package.json +8 -8
  107. package/dist/chunks/auth-k9ssaf54.js +0 -32
  108. /package/dist/chunks/{auth-9rqn6x4v.js → options-9rqn6x4v.js} +0 -0
  109. /package/dist/chunks/{auth-hezj1jdf.js → options-hezj1jdf.js} +0 -0
  110. /package/dist/chunks/{auth-q4bn6dy8.js → options-q4bn6dy8.js} +0 -0
  111. /package/dist/chunks/{auth-smaf4a18.js → options-smaf4a18.js} +0 -0
  112. /package/dist/chunks/{auth-t8yzmczr.js → options-t8yzmczr.js} +0 -0
  113. /package/dist/chunks/{auth-yc7nft6q.js → options-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/options-ep84ha6r.js";
4
+ import"./chunks/options-d00srfh1.js";
5
+ import"./chunks/options-nxdx74sv.js";
6
+ import"./chunks/options-acgs9zzk.js";
7
+ import"./chunks/options-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/options-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 "./options-smaf4a18.js";
5
5
  import {
6
6
  Api2
7
- } from "./auth-ar2c062s.js";
7
+ } from "./options-ep84ha6r.js";
8
8
 
9
9
  // src/handlers/message.ts
10
10
  import { SessionMessage } from "@opencode/core/session/message";
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  response2
3
- } from "./auth-0ar9gf7q.js";
3
+ } from "./options-acgs9zzk.js";
4
4
  import {
5
5
  Api2
6
- } from "./auth-ar2c062s.js";
6
+ } from "./options-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 "./options-smaf4a18.js";
7
+ import {
8
+ locationErrors2
9
+ } from "./options-acgs9zzk.js";
7
10
  import {
8
11
  Api2
9
- } from "./auth-ar2c062s.js";
12
+ } from "./options-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 "./options-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 "./options-acgs9zzk.js";
4
4
  import {
5
5
  Api2
6
- } from "./auth-ar2c062s.js";
6
+ } from "./options-ep84ha6r.js";
7
7
 
8
8
  // src/handlers/mcp.ts
9
9
  import { Mcp } from "@opencode/core/mcp/index";
@@ -1,17 +1,17 @@
1
1
  import {
2
2
  __export
3
- } from "./auth-9rqn6x4v.js";
3
+ } from "./options-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: () => Service5,
11
11
  SubscriberCapacity: () => SubscriberCapacity2,
12
12
  SubscriberOverflowError: () => SubscriberOverflowError2,
13
13
  frame: () => frame2,
14
- layer: () => layer3,
14
+ layer: () => layer5,
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 Service5 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 Service5.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 layer5 = Layer.effect(Service5, 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, Service5, frame2, make4, layer5, exports_event_feed };
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  Api2
3
- } from "./auth-ar2c062s.js";
3
+ } from "./options-ep84ha6r.js";
4
4
 
5
5
  // src/handlers/project.ts
6
6
  import { Project } from "@opencode/core/project";
@@ -1,22 +1,22 @@
1
1
  import {
2
2
  __export
3
- } from "./auth-9rqn6x4v.js";
3
+ } from "./options-9rqn6x4v.js";
4
4
 
5
5
  // src/server-info.ts
6
6
  var exports_server_info = {};
7
7
  __export(exports_server_info, {
8
8
  ServerInfo: () => exports_server_info,
9
- Service: () => Service5,
9
+ Service: () => Service4,
10
10
  connectionURLs: () => connectionURLs2,
11
11
  layer: () => layer4
12
12
  });
13
13
  import { Context, Layer } from "effect";
14
14
  import { networkInterfaces } from "node:os";
15
15
 
16
- class Service5 extends Context.Service()("@opencode/server/ServerInfo") {
16
+ class Service4 extends Context.Service()("@opencode/server/ServerInfo") {
17
17
  }
18
18
  function layer4(urls, tmp, app = {}) {
19
- return Layer.succeed(Service5, Service5.of({ urls, app, paths: { tmp } }));
19
+ return Layer.succeed(Service4, Service4.of({ urls, app, paths: { tmp } }));
20
20
  }
21
21
  function connectionURLs2(value, requestedHostname) {
22
22
  const url = new URL(value);
@@ -33,4 +33,4 @@ function connectionURLs2(value, requestedHostname) {
33
33
  ];
34
34
  }
35
35
 
36
- export { Service5, layer4, connectionURLs2, exports_server_info };
36
+ export { Service4, layer4, connectionURLs2, exports_server_info };
@@ -1,15 +1,15 @@
1
1
  import {
2
2
  __export
3
- } from "./auth-9rqn6x4v.js";
3
+ } from "./options-9rqn6x4v.js";
4
4
 
5
5
  // src/service-status.ts
6
6
  var exports_service_status = {};
7
7
  __export(exports_service_status, {
8
8
  Status: () => exports_service_status,
9
- make: () => make2
9
+ make: () => make3
10
10
  });
11
11
  import { Effect, Ref } from "effect";
12
- var make2 = Effect.fnUntraced(function* (options = {}) {
12
+ var make3 = Effect.fnUntraced(function* (options = {}) {
13
13
  const current = yield* Ref.make(options.initial ?? { type: "starting" });
14
14
  const beginStopping = Ref.update(current, (status) => status.type === "stopping" ? status : { type: "stopping" });
15
15
  return {
@@ -20,4 +20,4 @@ var make2 = Effect.fnUntraced(function* (options = {}) {
20
20
  };
21
21
  });
22
22
 
23
- export { make2, exports_service_status };
23
+ export { make3, exports_service_status };
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  response2
3
- } from "./auth-0ar9gf7q.js";
3
+ } from "./options-acgs9zzk.js";
4
4
  import {
5
5
  Api2
6
- } from "./auth-ar2c062s.js";
6
+ } from "./options-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 "./options-acgs9zzk.js";
4
4
  import {
5
5
  Api2
6
- } from "./auth-ar2c062s.js";
6
+ } from "./options-ep84ha6r.js";
7
7
 
8
8
  // src/handlers/integration.ts
9
9
  import { Integration } from "@opencode/core/integration";
@@ -1,26 +1,26 @@
1
1
  import {
2
2
  isAllowedCorsOrigin2
3
- } from "./auth-q4bn6dy8.js";
3
+ } from "./options-q4bn6dy8.js";
4
4
  import {
5
5
  createRoutes2
6
- } from "./auth-b0kafjgg.js";
6
+ } from "./options-vkrn1g9x.js";
7
7
  import {
8
8
  __export
9
- } from "./auth-9rqn6x4v.js";
9
+ } from "./options-9rqn6x4v.js";
10
10
 
11
11
  // src/fetch.ts
12
12
  var exports_fetch = {};
13
13
  __export(exports_fetch, {
14
14
  ServerFetch: () => exports_fetch,
15
- make: () => make3
15
+ make: () => make2
16
16
  });
17
17
  import { Context, Effect, Layer } from "effect";
18
18
  import { HttpEffect, HttpMiddleware, HttpRouter, HttpServer } from "effect/unstable/http";
19
19
  import { SessionRestart } from "@opencode/core/session/execution/restart";
20
- var make3 = Effect.fn("ServerFetch.make")(function* (options = {}, boot = {}) {
20
+ var make2 = Effect.fn("ServerFetch.make")(function* (options = {}, boot = {}) {
21
21
  const context = yield* Layer.build(createRoutes2(options, () => [], boot.overrides ?? []).pipe(Layer.provide(HttpServer.layerServices)));
22
22
  yield* Effect.forkDetach(Context.get(context, SessionRestart.Service).resumeSuspendedSessions);
23
23
  return Context.get(context, HttpRouter.HttpRouter).asHttpEffect().pipe(HttpMiddleware.cors({ allowedOrigins: (origin) => isAllowedCorsOrigin2(origin, options), maxAge: 86400 }), HttpEffect.toWebHandlerWith(context));
24
24
  });
25
25
 
26
- export { make3, exports_fetch };
26
+ export { make2, exports_fetch };
@@ -1,17 +1,24 @@
1
1
  import {
2
2
  missingSession2
3
- } from "./auth-smaf4a18.js";
3
+ } from "./options-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 "./options-9rqn6x4v.js";
4
4
 
5
5
  // src/auth.ts
6
6
  var exports_auth = {};
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  Api2
3
- } from "./auth-ar2c062s.js";
3
+ } from "./options-ep84ha6r.js";
4
4
  import {
5
- Service4,
5
+ Service5,
6
6
  frame2
7
- } from "./auth-5ybpxcad.js";
7
+ } from "./options-54sczv30.js";
8
8
 
9
9
  // src/handlers/event.ts
10
10
  import { Event } from "@opencode/schema/event";
@@ -12,7 +12,7 @@ import { Effect, Stream } from "effect";
12
12
  import { HttpServerResponse } from "effect/unstable/http";
13
13
  import { HttpApiBuilder } from "effect/unstable/httpapi";
14
14
  var EventHandler2 = HttpApiBuilder.group(Api2, "server.event", (handlers) => Effect.gen(function* () {
15
- const feed = yield* Service4;
15
+ const feed = yield* Service5;
16
16
  return handlers.handleRaw("event.subscribe", () => Effect.gen(function* () {
17
17
  const connected = {
18
18
  id: Event.ID.create(),
@@ -1,23 +1,23 @@
1
1
  import {
2
2
  __export
3
- } from "./auth-9rqn6x4v.js";
3
+ } from "./options-9rqn6x4v.js";
4
4
 
5
5
  // src/pty-environment.ts
6
6
  var exports_pty_environment = {};
7
7
  __export(exports_pty_environment, {
8
8
  PtyEnvironment: () => exports_pty_environment,
9
- Service: () => Service3,
9
+ Service: () => Service2,
10
10
  layer: () => layer2,
11
- node: () => node3
11
+ node: () => node2
12
12
  });
13
13
  import { Context, Effect, Layer } from "effect";
14
14
  import { makeGlobalNode } from "@opencode/util/effect/app-node";
15
15
 
16
- class Service3 extends Context.Service()("@opencode/ServerPtyEnvironment") {
16
+ class Service2 extends Context.Service()("@opencode/ServerPtyEnvironment") {
17
17
  }
18
- var layer2 = Layer.succeed(Service3, Service3.of({
18
+ var layer2 = Layer.succeed(Service2, Service2.of({
19
19
  get: () => Effect.succeed({})
20
20
  }));
21
- var node3 = makeGlobalNode({ service: Service3, layer: layer2, deps: [] });
21
+ var node2 = makeGlobalNode({ service: Service2, layer: layer2, deps: [] });
22
22
 
23
- export { Service3, layer2, node3, exports_pty_environment };
23
+ export { Service2, layer2, node2, exports_pty_environment };
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  response2
3
- } from "./auth-0ar9gf7q.js";
3
+ } from "./options-acgs9zzk.js";
4
4
  import {
5
5
  Api2
6
- } from "./auth-ar2c062s.js";
6
+ } from "./options-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 "./options-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 "./options-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,6 +1,6 @@
1
1
  import {
2
2
  Api2
3
- } from "./auth-ar2c062s.js";
3
+ } from "./options-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,34 +1,36 @@
1
1
  import {
2
2
  Api2
3
- } from "./auth-ar2c062s.js";
3
+ } from "./options-ep84ha6r.js";
4
4
  import {
5
5
  SESSION_TTL_SECONDS2,
6
6
  Config2,
7
7
  issueSession2,
8
8
  sessionCookieName2
9
- } from "./auth-anm12x33.js";
9
+ } from "./options-anm12x33.js";
10
10
  import {
11
- Service5
12
- } from "./auth-t9jkrcq1.js";
11
+ Service4
12
+ } from "./options-5p62ed52.js";
13
13
  import {
14
- Service2
15
- } from "./auth-rbn15j6z.js";
14
+ Service3
15
+ } from "./options-kr61w04k.js";
16
16
 
17
17
  // src/handlers/server.ts
18
18
  import { Duration, Effect } from "effect";
19
19
  import { HttpServerRequest, HttpServerResponse } from "effect/unstable/http";
20
20
  import { HttpApiBuilder } from "effect/unstable/httpapi";
21
+ import { PersistentPty } from "@opencode/core/persistent-pty";
21
22
  import { UnauthorizedError } from "@opencode/protocol/errors";
22
23
  var ServerHandler2 = HttpApiBuilder.group(Api2, "server.server", (handlers) => Effect.gen(function* () {
23
- const pairing = yield* Service2;
24
+ const pairing = yield* Service3;
24
25
  const auth = yield* Config2;
25
26
  return handlers.handle("server.info", () => Effect.gen(function* () {
26
- const info = yield* Service5;
27
+ const info = yield* Service4;
27
28
  return {
28
29
  version: info.app.version ?? "unknown",
29
30
  pid: process.pid ?? 0,
30
31
  urls: info.urls(),
31
- paths: info.paths
32
+ paths: info.paths,
33
+ capabilities: { persistentPty: PersistentPty.available }
32
34
  };
33
35
  })).handle("server.pair", () => pairing.issue()).handle("server.connect", Effect.fn(function* (ctx) {
34
36
  const request = yield* HttpServerRequest.HttpServerRequest;
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  LocationMiddleware2
3
- } from "./auth-0ar9gf7q.js";
3
+ } from "./options-acgs9zzk.js";
4
4
  import {
5
5
  FormLocationMiddleware2
6
- } from "./auth-frv6gfy7.js";
6
+ } from "./options-d00srfh1.js";
7
7
  import {
8
8
  SessionLocationMiddleware2
9
- } from "./auth-23w8t84j.js";
9
+ } from "./options-nxdx74sv.js";
10
10
 
11
11
  // src/api.ts
12
12
  import { makeDefaultApi } from "@opencode/protocol/api";
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  response2
3
- } from "./auth-0ar9gf7q.js";
3
+ } from "./options-acgs9zzk.js";
4
4
  import {
5
5
  Api2
6
- } from "./auth-ar2c062s.js";
6
+ } from "./options-ep84ha6r.js";
7
7
 
8
8
  // src/handlers/model.ts
9
9
  import { Model } from "@opencode/core/model";