@opencode/server 2.0.25 → 2.0.27

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 (144) hide show
  1. package/dist/api.d.ts +17 -14
  2. package/dist/api.js +5 -5
  3. package/dist/auth.js +1 -1
  4. package/dist/chunks/{location-1nwce8pe.js → pty-environment-08x9tjee.js} +2 -2
  5. package/dist/chunks/{location-sstsrjtg.js → pty-environment-0chp8crd.js} +8 -8
  6. package/dist/chunks/pty-environment-0d864bga.js +15 -0
  7. package/dist/chunks/{location-c7mfxxxb.js → pty-environment-1k1cts14.js} +6 -6
  8. package/dist/chunks/{location-0d9kah4z.js → pty-environment-383t61pr.js} +7 -7
  9. package/dist/chunks/{location-v9pcqbqn.js → pty-environment-43r48nqn.js} +3 -3
  10. package/dist/chunks/{location-7gfv664k.js → pty-environment-4d1eemzq.js} +6 -4
  11. package/dist/chunks/{location-krn4521r.js → pty-environment-4dv9a668.js} +3 -3
  12. package/dist/chunks/{location-w070c2h2.js → pty-environment-4hhhes7w.js} +3 -3
  13. package/dist/chunks/{location-f7sjppyz.js → pty-environment-4yg61rns.js} +32 -31
  14. package/dist/chunks/{location-gtkdacvk.js → pty-environment-5ytyqf1q.js} +5 -4
  15. package/dist/chunks/{location-7rxakzjh.js → pty-environment-5zsr2h86.js} +2 -2
  16. package/dist/chunks/{location-hvft24jv.js → pty-environment-7vd5668a.js} +2 -2
  17. package/dist/chunks/{location-weqhmjbd.js → pty-environment-8137b89p.js} +3 -3
  18. package/dist/chunks/{location-m9xs9t19.js → pty-environment-8ad8dwnf.js} +7 -7
  19. package/dist/chunks/{location-0vyswjsz.js → pty-environment-97eb2r3v.js} +3 -3
  20. package/dist/chunks/{location-9cw9axw5.js → pty-environment-9snwnvf8.js} +3 -3
  21. package/dist/chunks/{location-x2by5wsf.js → pty-environment-aey6dvfz.js} +30 -34
  22. package/dist/chunks/{location-anm12x33.js → pty-environment-anm12x33.js} +1 -1
  23. package/dist/chunks/{location-f2c3fmpg.js → pty-environment-b56hqv74.js} +13 -5
  24. package/dist/chunks/{location-dqsr2g0t.js → pty-environment-bx47k33v.js} +3 -3
  25. package/dist/chunks/{location-93wjydnn.js → pty-environment-c6kb7fmf.js} +7 -7
  26. package/dist/chunks/{location-t8yzmczr.js → pty-environment-erzfdgke.js} +1 -1
  27. package/dist/chunks/{location-td9k2nw3.js → pty-environment-ewe1fzkk.js} +6 -3
  28. package/dist/chunks/{location-934cmkaf.js → pty-environment-ftaz8n62.js} +3 -3
  29. package/dist/chunks/pty-environment-h6rt5k9s.js +24 -0
  30. package/dist/chunks/{location-4znne276.js → pty-environment-h8ws5ssa.js} +2 -2
  31. package/dist/chunks/{location-ap5bajez.js → pty-environment-hkm2snxm.js} +33 -33
  32. package/dist/chunks/{location-796j10e5.js → pty-environment-j4zqsxgy.js} +3 -3
  33. package/dist/chunks/{location-16qfdx6b.js → pty-environment-nn6dbt3f.js} +3 -3
  34. package/dist/chunks/{location-ceje7ncg.js → pty-environment-pfs7tp5t.js} +20 -19
  35. package/dist/chunks/{location-1xva44q8.js → pty-environment-ptey1p5v.js} +3 -3
  36. package/dist/chunks/{location-g85r3kcp.js → pty-environment-qbh90c1d.js} +3 -3
  37. package/dist/chunks/{location-jzqzrtw5.js → pty-environment-rf01ee6q.js} +2 -2
  38. package/dist/chunks/{location-yybdkkb6.js → pty-environment-rntbwr87.js} +3 -3
  39. package/dist/chunks/{location-cqdj4ap7.js → pty-environment-ssyxw8nc.js} +5 -5
  40. package/dist/chunks/{location-9gvk307e.js → pty-environment-sxyyq1rb.js} +10 -10
  41. package/dist/chunks/{location-gny2k2ap.js → pty-environment-tqspcwns.js} +4 -4
  42. package/dist/chunks/{location-4rww2e47.js → pty-environment-vb5yx5r0.js} +3 -3
  43. package/dist/chunks/{location-n52yc5x0.js → pty-environment-vbzm2jgm.js} +3 -3
  44. package/dist/chunks/{location-2sy3c7de.js → pty-environment-vghchchj.js} +10 -10
  45. package/dist/chunks/{location-xsrtpxyd.js → pty-environment-vpz7f20y.js} +4 -4
  46. package/dist/chunks/{location-ym27c8rr.js → pty-environment-y1gfy88d.js} +4 -4
  47. package/dist/chunks/{location-ajzgetf8.js → pty-environment-yehasrps.js} +3 -3
  48. package/dist/chunks/{location-y1grnrmm.js → pty-environment-z6sxg6td.js} +2 -2
  49. package/dist/chunks/{location-ca257yb3.js → pty-environment-zessacar.js} +3 -3
  50. package/dist/cors.js +1 -1
  51. package/dist/event-feed.js +7 -7
  52. package/dist/fetch.d.ts +1 -1
  53. package/dist/fetch.js +49 -49
  54. package/dist/handlers/agent.d.ts +1 -1
  55. package/dist/handlers/agent.js +6 -6
  56. package/dist/handlers/command.d.ts +1 -1
  57. package/dist/handlers/command.js +6 -6
  58. package/dist/handlers/config.d.ts +1 -1
  59. package/dist/handlers/config.js +6 -6
  60. package/dist/handlers/credential.d.ts +1 -1
  61. package/dist/handlers/credential.js +6 -6
  62. package/dist/handlers/debug.d.ts +1 -1
  63. package/dist/handlers/debug.js +6 -6
  64. package/dist/handlers/event.d.ts +1 -1
  65. package/dist/handlers/event.js +7 -7
  66. package/dist/handlers/form.d.ts +1 -1
  67. package/dist/handlers/form.js +6 -6
  68. package/dist/handlers/fs.d.ts +1 -1
  69. package/dist/handlers/fs.js +6 -6
  70. package/dist/handlers/generate.d.ts +1 -1
  71. package/dist/handlers/generate.js +6 -6
  72. package/dist/handlers/integration.d.ts +1 -1
  73. package/dist/handlers/integration.js +6 -6
  74. package/dist/handlers/location.d.ts +1 -1
  75. package/dist/handlers/location.js +6 -6
  76. package/dist/handlers/mcp.d.ts +1 -1
  77. package/dist/handlers/mcp.js +6 -6
  78. package/dist/handlers/message.d.ts +1 -1
  79. package/dist/handlers/message.js +6 -6
  80. package/dist/handlers/migration.d.ts +1 -1
  81. package/dist/handlers/migration.js +6 -6
  82. package/dist/handlers/model.d.ts +1 -1
  83. package/dist/handlers/model.js +6 -6
  84. package/dist/handlers/permission.d.ts +1 -1
  85. package/dist/handlers/permission.js +6 -6
  86. package/dist/handlers/persistent-pty.d.ts +1 -1
  87. package/dist/handlers/persistent-pty.js +8 -8
  88. package/dist/handlers/plugin.d.ts +1 -1
  89. package/dist/handlers/plugin.js +6 -6
  90. package/dist/handlers/project.d.ts +1 -1
  91. package/dist/handlers/project.js +6 -6
  92. package/dist/handlers/provider.d.ts +1 -1
  93. package/dist/handlers/provider.js +6 -6
  94. package/dist/handlers/pty-socket.d.ts +10 -2
  95. package/dist/handlers/pty-socket.js +1 -1
  96. package/dist/handlers/pty.d.ts +1 -1
  97. package/dist/handlers/pty.js +9 -9
  98. package/dist/handlers/reference.d.ts +1 -1
  99. package/dist/handlers/reference.js +6 -6
  100. package/dist/handlers/rpc.d.ts +1 -1
  101. package/dist/handlers/rpc.js +6 -6
  102. package/dist/handlers/server.d.ts +1 -1
  103. package/dist/handlers/server.js +9 -9
  104. package/dist/handlers/session-error.js +1 -1
  105. package/dist/handlers/session.d.ts +1 -1
  106. package/dist/handlers/session.js +6 -6
  107. package/dist/handlers/shell.d.ts +1 -1
  108. package/dist/handlers/shell.js +6 -6
  109. package/dist/handlers/skill.d.ts +1 -1
  110. package/dist/handlers/skill.js +6 -6
  111. package/dist/handlers/vcs.d.ts +1 -1
  112. package/dist/handlers/vcs.js +6 -6
  113. package/dist/handlers/websearch.d.ts +1 -1
  114. package/dist/handlers/websearch.js +6 -6
  115. package/dist/handlers/worktree.d.ts +1 -1
  116. package/dist/handlers/worktree.js +6 -6
  117. package/dist/handlers.d.ts +1 -1
  118. package/dist/handlers.js +43 -43
  119. package/dist/location.d.ts +5 -3
  120. package/dist/location.js +4 -2
  121. package/dist/middleware/authorization.d.ts +1 -1
  122. package/dist/middleware/authorization.js +2 -2
  123. package/dist/middleware/form-location.d.ts +2 -2
  124. package/dist/middleware/form-location.js +3 -3
  125. package/dist/middleware/schema-error.js +1 -1
  126. package/dist/middleware/session-location.d.ts +1 -1
  127. package/dist/middleware/session-location.js +3 -3
  128. package/dist/pairing.js +5 -5
  129. package/dist/process.d.ts +5 -4
  130. package/dist/process.js +52 -52
  131. package/dist/pty-environment.js +5 -5
  132. package/dist/request-tracing.js +1 -1
  133. package/dist/routes.d.ts +3 -3
  134. package/dist/routes.js +46 -46
  135. package/dist/server-info.js +5 -5
  136. package/dist/service-status.js +3 -3
  137. package/dist/workerd.js +50 -50
  138. package/package.json +14 -12
  139. package/dist/chunks/location-hezj1jdf.js +0 -7
  140. package/dist/chunks/location-vb9atgxj.js +0 -15
  141. /package/dist/chunks/{location-9rqn6x4v.js → pty-environment-9rqn6x4v.js} +0 -0
  142. /package/dist/chunks/{location-q4bn6dy8.js → pty-environment-q4bn6dy8.js} +0 -0
  143. /package/dist/chunks/{location-smaf4a18.js → pty-environment-smaf4a18.js} +0 -0
  144. /package/dist/chunks/{location-yc7nft6q.js → pty-environment-yc7nft6q.js} +0 -0
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  Api2
3
- } from "./location-9cw9axw5.js";
3
+ } from "./pty-environment-9snwnvf8.js";
4
4
  import {
5
5
  CorsConfig2,
6
6
  isAllowedRequestOrigin2
7
- } from "./location-q4bn6dy8.js";
7
+ } from "./pty-environment-q4bn6dy8.js";
8
8
  import {
9
9
  runPtySocket2
10
- } from "./location-hezj1jdf.js";
10
+ } from "./pty-environment-h6rt5k9s.js";
11
11
 
12
12
  // src/handlers/persistent-pty.ts
13
13
  import { PersistentPty } from "@opencode/core/persistent-pty";
@@ -18,10 +18,10 @@ import {
18
18
  PTY_CONNECT_TOKEN_HEADER,
19
19
  PTY_CONNECT_TOKEN_HEADER_VALUE
20
20
  } from "@opencode/protocol/groups/persistent-pty";
21
- import { Effect, Queue, Semaphore } from "effect";
22
- import { HttpServerRequest, HttpServerResponse } from "effect/unstable/http";
23
- import { HttpApiBuilder, HttpApiSchema } from "effect/unstable/httpapi";
24
- import { Socket } from "effect/unstable/socket";
21
+ import { Effect, Queue } from "effect";
22
+ import { HttpServerRequest, HttpServerResponse } from "effect/http";
23
+ import { HttpApiBuilder, HttpApiSchema } from "effect/http-api";
24
+ import { Socket } from "effect/socket";
25
25
  var PersistentPtyHandler2 = HttpApiBuilder.group(Api2, "server.experimental", (handlers) => Effect.gen(function* () {
26
26
  const tickets = yield* PtyTicket.Service;
27
27
  const cors = yield* CorsConfig2;
@@ -77,9 +77,7 @@ var PersistentPtyHandler2 = HttpApiBuilder.group(Api2, "server.experimental", (h
77
77
  if (!Number.isSafeInteger(cursor) || cursor < 0)
78
78
  return HttpServerResponse.empty({ status: 400 });
79
79
  const socket = yield* Effect.orDie(ctx.request.upgrade);
80
- const write = yield* socket.writer;
81
80
  const outbox = yield* Queue.unbounded();
82
- const input = yield* Semaphore.make(1);
83
81
  let attachment;
84
82
  const onOpen = Effect.gen(function* () {
85
83
  attachment = yield* pty.attach(ctx.params.ptyID, {
@@ -123,32 +121,30 @@ var PersistentPtyHandler2 = HttpApiBuilder.group(Api2, "server.experimental", (h
123
121
  Queue.offerUnsafe(outbox, JSON.stringify({ type: "replay_complete", endOffset: attachment.replay.endOffset }));
124
122
  attachment.activate();
125
123
  });
126
- const drain = Effect.gen(function* () {
127
- while (true) {
128
- const item = yield* Queue.take(outbox);
129
- yield* write(item);
130
- if (item instanceof Socket.CloseEvent)
131
- return;
132
- }
124
+ yield* runPtySocket2({
125
+ socket,
126
+ outbox,
127
+ onOpen,
128
+ onMessage: (message) => {
129
+ if (!attachment)
130
+ return Effect.void;
131
+ const data = typeof message === "string" ? Buffer.from(message) : message;
132
+ if (!framedInput)
133
+ return pty.input(ctx.params.ptyID, attachmentID, attachment.info.size.cols, attachment.info.size.rows, data).pipe(Effect.ignore);
134
+ if (data.byteLength < 5)
135
+ return Effect.void;
136
+ const view = new DataView(data.buffer, data.byteOffset, data.byteLength);
137
+ const type = data[0];
138
+ const cols = view.getUint16(1);
139
+ const rows = view.getUint16(3);
140
+ if (type !== 0 && type !== 1 || cols === 0 || rows === 0)
141
+ return Effect.void;
142
+ if (type === 0)
143
+ return pty.control(ctx.params.ptyID, attachmentID, cols, rows).pipe(Effect.ignore);
144
+ return pty.input(ctx.params.ptyID, attachmentID, cols, rows, data.subarray(5)).pipe(Effect.ignore);
145
+ },
146
+ detach: () => attachment?.detach()
133
147
  });
134
- yield* runPtySocket2(drain, socket.runRaw((message) => input.withPermit(Effect.suspend(() => {
135
- if (!attachment)
136
- return Effect.void;
137
- const data = typeof message === "string" ? Buffer.from(message) : message;
138
- if (!framedInput)
139
- return pty.input(ctx.params.ptyID, attachmentID, attachment.info.size.cols, attachment.info.size.rows, data).pipe(Effect.ignore);
140
- if (data.byteLength < 5)
141
- return Effect.void;
142
- const view = new DataView(data.buffer, data.byteOffset, data.byteLength);
143
- const type = data[0];
144
- const cols = view.getUint16(1);
145
- const rows = view.getUint16(3);
146
- if (type !== 0 && type !== 1 || cols === 0 || rows === 0)
147
- return Effect.void;
148
- if (type === 0)
149
- return pty.control(ctx.params.ptyID, attachmentID, cols, rows).pipe(Effect.ignore);
150
- return pty.input(ctx.params.ptyID, attachmentID, cols, rows, data.subarray(5)).pipe(Effect.ignore);
151
- })), { onOpen }), () => attachment?.detach()).pipe(Effect.catchReason("SocketError", "SocketCloseError", () => Effect.void), Effect.orDie);
152
148
  return HttpServerResponse.empty();
153
149
  }));
154
150
  }));
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  __export
3
- } from "./location-9rqn6x4v.js";
3
+ } from "./pty-environment-9rqn6x4v.js";
4
4
 
5
5
  // src/auth.ts
6
6
  var exports_auth = {};
@@ -1,17 +1,18 @@
1
1
  import {
2
2
  missingSession2
3
- } from "./location-smaf4a18.js";
3
+ } from "./pty-environment-smaf4a18.js";
4
4
 
5
5
  // src/location.ts
6
6
  import { FileSystem } from "@opencode/core/filesystem";
7
7
  import { Location } from "@opencode/core/location";
8
+ import { Plugin } from "@opencode/core/plugin";
8
9
  import { LocationServiceMap } from "@opencode/core/location-services";
9
10
  import { AbsolutePath } from "@opencode/core/schema";
10
11
  import { Session } from "@opencode/core/session";
11
- import { LocationNotFoundError, InvalidRequestError } from "@opencode/protocol/errors";
12
+ import { LocationNotFoundError, InvalidRequestError, ServiceUnavailableError } from "@opencode/protocol/errors";
12
13
  import { Effect, Layer, Schema } from "effect";
13
- import { HttpServerRequest } from "effect/unstable/http";
14
- import { HttpApiMiddleware } from "effect/unstable/httpapi";
14
+ import { HttpServerRequest } from "effect/http";
15
+ import { HttpApiMiddleware } from "effect/http-api";
15
16
  class LocationMiddleware2 extends HttpApiMiddleware.Service()("@opencode/HttpApiLocation", { error: [LocationNotFoundError] }) {
16
17
  }
17
18
  function locationErrors2(effect) {
@@ -20,6 +21,13 @@ function locationErrors2(effect) {
20
21
  message: `Location not found: ${error.directory}`
21
22
  }))));
22
23
  }
24
+ var awaitPlugins2 = Plugin.awaitActivation.pipe(Effect.timeoutOrElse({
25
+ duration: "5 seconds",
26
+ orElse: () => Effect.fail(new ServiceUnavailableError({
27
+ message: "Location plugins did not finish activating",
28
+ service: "plugin"
29
+ }))
30
+ }));
23
31
  function response2(data) {
24
32
  return Effect.gen(function* () {
25
33
  const location = yield* Location.Service;
@@ -59,4 +67,4 @@ var layer5 = Layer.effect(LocationMiddleware2, Effect.gen(function* () {
59
67
  }));
60
68
  }));
61
69
 
62
- export { LocationMiddleware2, locationErrors2, response2, sessionInfo2, requestRef2, layer5 };
70
+ export { LocationMiddleware2, locationErrors2, awaitPlugins2, response2, sessionInfo2, requestRef2, layer5 };
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  response2
3
- } from "./location-f2c3fmpg.js";
3
+ } from "./pty-environment-b56hqv74.js";
4
4
  import {
5
5
  Api2
6
- } from "./location-9cw9axw5.js";
6
+ } from "./pty-environment-9snwnvf8.js";
7
7
 
8
8
  // src/handlers/skill.ts
9
9
  import { Skill } from "@opencode/core/skill";
10
- import { HttpApiBuilder } from "effect/unstable/httpapi";
10
+ import { HttpApiBuilder } from "effect/http-api";
11
11
  var SkillHandler2 = HttpApiBuilder.group(Api2, "server.skill", (handlers) => handlers.handle("skill.list", () => response2(Skill.Service.use((skill) => skill.list()))));
12
12
 
13
13
  export { SkillHandler2 };
@@ -1,22 +1,22 @@
1
1
  import {
2
2
  __export
3
- } from "./location-9rqn6x4v.js";
3
+ } from "./pty-environment-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: () => Service4,
9
+ Service: () => Service2,
10
10
  connectionURLs: () => connectionURLs2,
11
- layer: () => layer4
11
+ layer: () => layer2
12
12
  });
13
13
  import { Context, Layer } from "effect";
14
14
  import { networkInterfaces } from "node:os";
15
15
 
16
- class Service4 extends Context.Service()("@opencode/server/ServerInfo") {
16
+ class Service2 extends Context.Service()("@opencode/server/ServerInfo") {
17
17
  }
18
- function layer4(urls, tmp, app = {}) {
19
- return Layer.succeed(Service4, Service4.of({ urls, app, paths: { tmp } }));
18
+ function layer2(urls, tmp, app = {}) {
19
+ return Layer.succeed(Service2, Service2.of({ urls, app, paths: { tmp } }));
20
20
  }
21
21
  function connectionURLs2(value, requestedHostname) {
22
22
  const url = new URL(value);
@@ -38,4 +38,4 @@ function connectionURLs2(value, requestedHostname) {
38
38
  ];
39
39
  }
40
40
 
41
- export { Service4, layer4, connectionURLs2, exports_server_info };
41
+ export { Service2, layer2, connectionURLs2, exports_server_info };
@@ -1,6 +1,6 @@
1
1
  // src/middleware/schema-error.ts
2
2
  import { Effect } from "effect";
3
- import { HttpApiMiddleware } from "effect/unstable/httpapi";
3
+ import { HttpApiMiddleware } from "effect/http-api";
4
4
  import { InvalidRequestError } from "@opencode/protocol/errors";
5
5
  import { SchemaErrorMiddleware } from "@opencode/protocol/middleware/schema-error";
6
6
  import { SchemaErrorMiddleware as SchemaErrorMiddleware2 } from "@opencode/protocol/middleware/schema-error";
@@ -1,19 +1,22 @@
1
1
  import {
2
+ awaitPlugins2,
2
3
  response2
3
- } from "./location-f2c3fmpg.js";
4
+ } from "./pty-environment-b56hqv74.js";
4
5
  import {
5
6
  Api2
6
- } from "./location-9cw9axw5.js";
7
+ } from "./pty-environment-9snwnvf8.js";
7
8
 
8
9
  // src/handlers/model.ts
9
10
  import { Model } from "@opencode/core/model";
10
11
  import { Effect } from "effect";
11
- import { HttpApiBuilder } from "effect/unstable/httpapi";
12
+ import { HttpApiBuilder } from "effect/http-api";
12
13
  var ModelHandler2 = HttpApiBuilder.group(Api2, "server.model", (handlers) => Effect.gen(function* () {
13
14
  return handlers.handle("model.list", Effect.fn(function* () {
15
+ yield* awaitPlugins2;
14
16
  const models = yield* Model.Service;
15
17
  return yield* response2(models.available());
16
18
  })).handle("model.default", Effect.fn(function* () {
19
+ yield* awaitPlugins2;
17
20
  const models = yield* Model.Service;
18
21
  return yield* response2(models.default());
19
22
  }));
@@ -1,15 +1,15 @@
1
1
  import {
2
2
  response2
3
- } from "./location-f2c3fmpg.js";
3
+ } from "./pty-environment-b56hqv74.js";
4
4
  import {
5
5
  Api2
6
- } from "./location-9cw9axw5.js";
6
+ } from "./pty-environment-9snwnvf8.js";
7
7
 
8
8
  // src/handlers/integration.ts
9
9
  import { Integration } from "@opencode/core/integration";
10
10
  import { Plugin } from "@opencode/core/plugin";
11
11
  import { Effect } from "effect";
12
- import { HttpApiBuilder, HttpApiSchema } from "effect/unstable/httpapi";
12
+ import { HttpApiBuilder, HttpApiSchema } from "effect/http-api";
13
13
  import {
14
14
  IntegrationAttemptNotFoundError,
15
15
  IntegrationMethodNotFoundError,
@@ -0,0 +1,24 @@
1
+ // src/handlers/pty-socket.ts
2
+ import { Effect, Queue } from "effect";
3
+ import { Socket } from "effect/socket";
4
+ function runPtySocket2(input) {
5
+ const drain = Effect.gen(function* () {
6
+ const writer = yield* input.socket.writer;
7
+ while (true) {
8
+ const item = yield* Queue.take(input.outbox);
9
+ yield* writer.write(item);
10
+ if (item instanceof Socket.CloseEvent)
11
+ return;
12
+ }
13
+ });
14
+ const read = Effect.gen(function* () {
15
+ const reader = yield* input.socket.reader;
16
+ if (input.onOpen)
17
+ yield* input.onOpen;
18
+ while (true)
19
+ yield* Effect.forEach(yield* reader.pull, input.onMessage, { discard: true });
20
+ });
21
+ return Effect.raceFirst(drain, read).pipe(Effect.ensuring(Effect.sync(input.detach)), Effect.catchReason("SocketError", "SocketCloseError", () => Effect.void), Effect.orDie);
22
+ }
23
+
24
+ export { runPtySocket2 };
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  Api2
3
- } from "./location-9cw9axw5.js";
3
+ } from "./pty-environment-9snwnvf8.js";
4
4
 
5
5
  // src/handlers/location.ts
6
6
  import { Location } from "@opencode/core/location";
7
7
  import { LocationServiceMap } from "@opencode/core/location-service-map";
8
8
  import { ServiceUnavailableError } from "@opencode/protocol/errors";
9
9
  import { Cause, Effect } from "effect";
10
- import { HttpApiBuilder } from "effect/unstable/httpapi";
10
+ import { HttpApiBuilder } from "effect/http-api";
11
11
  var LocationHandler2 = HttpApiBuilder.group(Api2, "server.location", (handlers) => Effect.gen(function* () {
12
12
  const locations = yield* LocationServiceMap.Service;
13
13
  return handlers.handle("location.get", Effect.fn(function* () {
@@ -1,99 +1,99 @@
1
1
  import {
2
2
  GenerateHandler2
3
- } from "./location-7gfv664k.js";
3
+ } from "./pty-environment-4d1eemzq.js";
4
4
  import {
5
5
  MessageHandler2
6
- } from "./location-4rww2e47.js";
6
+ } from "./pty-environment-vb5yx5r0.js";
7
7
  import {
8
8
  ModelHandler2
9
- } from "./location-td9k2nw3.js";
9
+ } from "./pty-environment-ewe1fzkk.js";
10
10
  import {
11
11
  ProviderHandler2
12
- } from "./location-0vyswjsz.js";
12
+ } from "./pty-environment-97eb2r3v.js";
13
13
  import {
14
14
  SessionHandler2
15
- } from "./location-gny2k2ap.js";
15
+ } from "./pty-environment-tqspcwns.js";
16
16
  import {
17
17
  PermissionHandler2
18
- } from "./location-ym27c8rr.js";
18
+ } from "./pty-environment-y1gfy88d.js";
19
19
  import {
20
20
  FileSystemHandler2
21
- } from "./location-cqdj4ap7.js";
21
+ } from "./pty-environment-ssyxw8nc.js";
22
22
  import {
23
23
  FormHandler2
24
- } from "./location-v9pcqbqn.js";
24
+ } from "./pty-environment-43r48nqn.js";
25
25
  import {
26
26
  CommandHandler2
27
- } from "./location-1xva44q8.js";
27
+ } from "./pty-environment-ptey1p5v.js";
28
28
  import {
29
29
  SkillHandler2
30
- } from "./location-dqsr2g0t.js";
30
+ } from "./pty-environment-bx47k33v.js";
31
31
  import {
32
32
  RpcHandler2
33
- } from "./location-y1grnrmm.js";
33
+ } from "./pty-environment-z6sxg6td.js";
34
34
  import {
35
- layer2
36
- } from "./location-2sy3c7de.js";
35
+ layer4
36
+ } from "./pty-environment-vghchchj.js";
37
37
  import {
38
38
  EventHandler2
39
- } from "./location-c7mfxxxb.js";
39
+ } from "./pty-environment-1k1cts14.js";
40
40
  import {
41
41
  AgentHandler2
42
- } from "./location-yybdkkb6.js";
42
+ } from "./pty-environment-rntbwr87.js";
43
43
  import {
44
44
  PluginHandler2
45
- } from "./location-weqhmjbd.js";
45
+ } from "./pty-environment-8137b89p.js";
46
46
  import {
47
47
  ServerHandler2
48
- } from "./location-9gvk307e.js";
48
+ } from "./pty-environment-sxyyq1rb.js";
49
49
  import {
50
50
  DebugHandler2
51
- } from "./location-n52yc5x0.js";
51
+ } from "./pty-environment-vbzm2jgm.js";
52
52
  import {
53
53
  PtyHandler2
54
- } from "./location-f7sjppyz.js";
54
+ } from "./pty-environment-4yg61rns.js";
55
55
  import {
56
56
  PersistentPtyHandler2
57
- } from "./location-x2by5wsf.js";
57
+ } from "./pty-environment-aey6dvfz.js";
58
58
  import {
59
59
  ShellHandler2
60
- } from "./location-krn4521r.js";
60
+ } from "./pty-environment-4dv9a668.js";
61
61
  import {
62
62
  ReferenceHandler2
63
- } from "./location-ajzgetf8.js";
63
+ } from "./pty-environment-yehasrps.js";
64
64
  import {
65
65
  LocationHandler2
66
- } from "./location-4znne276.js";
66
+ } from "./pty-environment-h8ws5ssa.js";
67
67
  import {
68
68
  IntegrationHandler2
69
- } from "./location-934cmkaf.js";
69
+ } from "./pty-environment-ftaz8n62.js";
70
70
  import {
71
71
  WebSearchHandler2
72
- } from "./location-16qfdx6b.js";
72
+ } from "./pty-environment-nn6dbt3f.js";
73
73
  import {
74
74
  McpHandler2
75
- } from "./location-ca257yb3.js";
75
+ } from "./pty-environment-zessacar.js";
76
76
  import {
77
77
  CredentialHandler2
78
- } from "./location-1nwce8pe.js";
78
+ } from "./pty-environment-08x9tjee.js";
79
79
  import {
80
80
  ProjectHandler2
81
- } from "./location-vb9atgxj.js";
81
+ } from "./pty-environment-0d864bga.js";
82
82
  import {
83
83
  WorktreeHandler2
84
- } from "./location-hvft24jv.js";
84
+ } from "./pty-environment-7vd5668a.js";
85
85
  import {
86
86
  VcsHandler2
87
- } from "./location-g85r3kcp.js";
87
+ } from "./pty-environment-qbh90c1d.js";
88
88
  import {
89
89
  MigrationHandler2
90
- } from "./location-jzqzrtw5.js";
90
+ } from "./pty-environment-rf01ee6q.js";
91
91
  import {
92
92
  ConfigHandler2
93
- } from "./location-7rxakzjh.js";
93
+ } from "./pty-environment-5zsr2h86.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(layer2)), 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,14 +1,14 @@
1
1
  import {
2
2
  locationErrors2,
3
3
  sessionInfo2
4
- } from "./location-f2c3fmpg.js";
4
+ } from "./pty-environment-b56hqv74.js";
5
5
 
6
6
  // src/middleware/session-location.ts
7
7
  import { Instance } from "@opencode/core/instance/service";
8
8
  import { Session } from "@opencode/core/session";
9
9
  import { Effect, Layer } from "effect";
10
- import { HttpRouter } from "effect/unstable/http";
11
- import { HttpApiMiddleware } from "effect/unstable/httpapi";
10
+ import { HttpRouter } from "effect/http";
11
+ import { HttpApiMiddleware } from "effect/http-api";
12
12
  import { LocationNotFoundError, InvalidRequestError, SessionNotFoundError } from "@opencode/protocol/errors";
13
13
  class SessionLocationMiddleware2 extends HttpApiMiddleware.Service()("@opencode/HttpApiSessionLocation", {
14
14
  error: [InvalidRequestError, SessionNotFoundError, LocationNotFoundError]
@@ -1,15 +1,15 @@
1
1
  import {
2
2
  response2
3
- } from "./location-f2c3fmpg.js";
3
+ } from "./pty-environment-b56hqv74.js";
4
4
  import {
5
5
  Api2
6
- } from "./location-9cw9axw5.js";
6
+ } from "./pty-environment-9snwnvf8.js";
7
7
 
8
8
  // src/handlers/websearch.ts
9
9
  import { WebSearch } from "@opencode/core/websearch";
10
10
  import { InvalidRequestError, ServiceUnavailableError } from "@opencode/protocol/errors";
11
11
  import { Effect } from "effect";
12
- import { HttpApiBuilder } from "effect/unstable/httpapi";
12
+ import { HttpApiBuilder } from "effect/http-api";
13
13
  var WebSearchHandler2 = HttpApiBuilder.group(Api2, "server.websearch", (handlers) => Effect.gen(function* () {
14
14
  return handlers.handle("websearch.providers", Effect.fn("server.websearch.providers")(function* () {
15
15
  const websearch = yield* WebSearch.Service;
@@ -1,39 +1,39 @@
1
1
  import {
2
2
  layer5
3
- } from "./location-f2c3fmpg.js";
3
+ } from "./pty-environment-b56hqv74.js";
4
4
  import {
5
5
  formLocationLayer2
6
- } from "./location-w070c2h2.js";
6
+ } from "./pty-environment-4hhhes7w.js";
7
7
  import {
8
8
  sessionLocationLayer2
9
- } from "./location-796j10e5.js";
9
+ } from "./pty-environment-j4zqsxgy.js";
10
10
  import {
11
11
  Api2
12
- } from "./location-9cw9axw5.js";
12
+ } from "./pty-environment-9snwnvf8.js";
13
13
  import {
14
14
  Config2
15
- } from "./location-anm12x33.js";
15
+ } from "./pty-environment-anm12x33.js";
16
16
  import {
17
17
  CorsConfig2
18
- } from "./location-q4bn6dy8.js";
18
+ } from "./pty-environment-q4bn6dy8.js";
19
19
  import {
20
- layer4
21
- } from "./location-93wjydnn.js";
22
- import {
23
- node3
24
- } from "./location-sstsrjtg.js";
20
+ layer2
21
+ } from "./pty-environment-c6kb7fmf.js";
25
22
  import {
26
23
  node2
27
- } from "./location-0d9kah4z.js";
24
+ } from "./pty-environment-0chp8crd.js";
25
+ import {
26
+ node3
27
+ } from "./pty-environment-383t61pr.js";
28
28
  import {
29
29
  handlers2
30
- } from "./location-ap5bajez.js";
30
+ } from "./pty-environment-hkm2snxm.js";
31
31
  import {
32
32
  authorizationLayer2
33
- } from "./location-gtkdacvk.js";
33
+ } from "./pty-environment-5ytyqf1q.js";
34
34
  import {
35
35
  schemaErrorLayer2
36
- } from "./location-t8yzmczr.js";
36
+ } from "./pty-environment-erzfdgke.js";
37
37
 
38
38
  // src/routes.ts
39
39
  import { Database } from "@opencode/core/database/database";
@@ -69,8 +69,8 @@ import { SdkPlugins } from "@opencode/core/plugin/sdk";
69
69
  import { WellKnown } from "@opencode/core/wellknown";
70
70
  import { Workspace } from "@opencode/core/workspace";
71
71
  import { Watcher } from "@opencode/core/filesystem/watcher";
72
- import { HttpRouter } from "effect/unstable/http";
73
- import { HttpApiBuilder } from "effect/unstable/httpapi";
72
+ import { HttpRouter } from "effect/http";
73
+ import { HttpApiBuilder } from "effect/http-api";
74
74
  import { Context, Effect, Layer, Option } from "effect";
75
75
  var applicationServiceNodes = [
76
76
  Global.node,
@@ -80,6 +80,7 @@ var applicationServiceNodes = [
80
80
  httpClient,
81
81
  Job.node,
82
82
  Project.node,
83
+ Project.sweepNode,
83
84
  Worktree.node,
84
85
  Session.node,
85
86
  Instance.node,
@@ -91,8 +92,8 @@ var applicationServiceNodes = [
91
92
  PersistentPty.node,
92
93
  Credential.node,
93
94
  WellKnown.node,
94
- node2,
95
95
  node3,
96
+ node2,
96
97
  LocationServiceMap.node,
97
98
  LocationActivity.node,
98
99
  SessionRestart.node,
@@ -144,7 +145,7 @@ function makeRoutes(auth, options, serviceURLs, overrides, instances) {
144
145
  })) : build(overrides);
145
146
  return serviceLayer.pipe(Layer.flatMap((context) => {
146
147
  const services = Layer.succeedContext(context);
147
- const requestServices = Layer.merge(Layer.succeedContext(Context.pick(Database.Service, Credential.Service, PermissionSaved.Service, PluginUpdate.Service, Project.Service, WellKnown.Service)(context)), layer4(serviceURLs, Context.get(context, Global.Service).tmp, options.app));
148
+ const requestServices = Layer.merge(Layer.succeedContext(Context.pick(Database.Service, Credential.Service, PermissionSaved.Service, PluginUpdate.Service, Project.Service, WellKnown.Service)(context)), layer2(serviceURLs, Context.get(context, Global.Service).tmp, options.app));
148
149
  const api = HttpApiBuilder.layer(Api2, { openapiPath: "/openapi.json" }).pipe(Layer.provide(handlers2.pipe(Layer.provide(services), Layer.provide(Layer.succeed(CorsConfig2, options)))), Layer.provide(formLocationLayer2), Layer.provide(sessionLocationLayer2), Layer.provide(layer5), Layer.provide(authorizationLayer2), Layer.provide(schemaErrorLayer2), Layer.provide(auth), HttpRouter.provideRequest(requestServices), Layer.provideMerge(services), Layer.provideMerge(HttpRouter.layer));
149
150
  return Layer.merge(api, V1Migration.layer.pipe(Layer.provide(services)));
150
151
  }));
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  response2
3
- } from "./location-f2c3fmpg.js";
3
+ } from "./pty-environment-b56hqv74.js";
4
4
  import {
5
5
  Api2
6
- } from "./location-9cw9axw5.js";
6
+ } from "./pty-environment-9snwnvf8.js";
7
7
 
8
8
  // src/handlers/command.ts
9
9
  import { Command } from "@opencode/core/command";
10
- import { HttpApiBuilder } from "effect/unstable/httpapi";
10
+ import { HttpApiBuilder } from "effect/http-api";
11
11
  var CommandHandler2 = HttpApiBuilder.group(Api2, "server.command", (handlers) => handlers.handle("command.list", () => response2(Command.Service.use((command) => command.list()))));
12
12
 
13
13
  export { CommandHandler2 };
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  response2
3
- } from "./location-f2c3fmpg.js";
3
+ } from "./pty-environment-b56hqv74.js";
4
4
  import {
5
5
  Api2
6
- } from "./location-9cw9axw5.js";
6
+ } from "./pty-environment-9snwnvf8.js";
7
7
 
8
8
  // src/handlers/vcs.ts
9
9
  import { Vcs } from "@opencode/core/vcs";
@@ -16,7 +16,7 @@ import { LocationServiceMap } from "@opencode/core/location-services";
16
16
  import { ConflictError, InvalidRequestError, ServiceUnavailableError } from "@opencode/protocol/errors";
17
17
  import { VcsInitNotSupportedError } from "@opencode/protocol/groups/vcs";
18
18
  import { Effect } from "effect";
19
- import { HttpApiBuilder, HttpApiSchema } from "effect/unstable/httpapi";
19
+ import { HttpApiBuilder, HttpApiSchema } from "effect/http-api";
20
20
  var VcsHandler2 = HttpApiBuilder.group(Api2, "server.vcs", (handlers) => Effect.gen(function* () {
21
21
  const project = yield* Project.Service;
22
22
  const bus = yield* Bus.Service;
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  Api2
3
- } from "./location-9cw9axw5.js";
3
+ } from "./pty-environment-9snwnvf8.js";
4
4
 
5
5
  // src/handlers/migration.ts
6
6
  import { V1Migration } from "@opencode/core/database/v1-migration";
7
- import { HttpApiBuilder } from "effect/unstable/httpapi";
7
+ import { HttpApiBuilder } from "effect/http-api";
8
8
  import { Effect } from "effect";
9
9
  var MigrationHandler2 = HttpApiBuilder.group(Api2, "server.migration", (handlers) => handlers.handle("migration.v1.status", Effect.fn(function* () {
10
10
  return yield* V1Migration.status();
@@ -1,14 +1,14 @@
1
1
  import {
2
2
  response2
3
- } from "./location-f2c3fmpg.js";
3
+ } from "./pty-environment-b56hqv74.js";
4
4
  import {
5
5
  Api2
6
- } from "./location-9cw9axw5.js";
6
+ } from "./pty-environment-9snwnvf8.js";
7
7
 
8
8
  // src/handlers/agent.ts
9
9
  import { Agent } from "@opencode/core/agent";
10
10
  import { Effect } from "effect";
11
- import { HttpApiBuilder } from "effect/unstable/httpapi";
11
+ import { HttpApiBuilder } from "effect/http-api";
12
12
  import { AgentNotFoundError } from "@opencode/protocol/errors";
13
13
  var AgentHandler2 = HttpApiBuilder.group(Api2, "server.agent", (handlers) => handlers.handle("agent.list", () => Effect.gen(function* () {
14
14
  return yield* response2(Agent.Service.use((agent) => agent.list()));