@opencode/server 0.0.0-dev-21578 → 0.0.0-dev-21586

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 (109) hide show
  1. package/dist/api.d.ts +621 -621
  2. package/dist/api.js +5 -5
  3. package/dist/auth.js +1 -1
  4. package/dist/chunks/{pairing-gb66h69v.js → service-status-026wrard.js} +3 -3
  5. package/dist/chunks/{pairing-9k4wjdze.js → service-status-10jzh2zk.js} +3 -3
  6. package/dist/chunks/{pairing-1ahadpvw.js → service-status-1ahadpvw.js} +1 -1
  7. package/dist/chunks/{pairing-wtxh433d.js → service-status-2s3n8phw.js} +2 -2
  8. package/dist/chunks/{pairing-e6e4kz0w.js → service-status-39nnfjx1.js} +4 -4
  9. package/dist/chunks/{pairing-19dc7z8q.js → service-status-4vaqgjp8.js} +2 -2
  10. package/dist/chunks/{pairing-6kta5392.js → service-status-5bchp9s2.js} +2 -2
  11. package/dist/chunks/{pairing-0m09ryg3.js → service-status-61g22bd8.js} +6 -9
  12. package/dist/chunks/{pairing-6v4wsps6.js → service-status-6v4wsps6.js} +1 -1
  13. package/dist/chunks/{pairing-b1prsepx.js → service-status-7dtbad8d.js} +5 -5
  14. package/dist/chunks/{pairing-e54xd2ay.js → service-status-9h3s5d39.js} +3 -3
  15. package/dist/chunks/{pairing-67kmywtk.js → service-status-aajxxgqb.js} +2 -2
  16. package/dist/chunks/{pairing-brhdn8vr.js → service-status-b7rpzsrb.js} +15 -38
  17. package/dist/chunks/{pairing-pxdkane5.js → service-status-bvbs05c3.js} +3 -3
  18. package/dist/chunks/{pairing-4p1svrjf.js → service-status-c9pn3jbn.js} +11 -15
  19. package/dist/chunks/{pairing-gx2yvssc.js → service-status-dc18tjnc.js} +3 -3
  20. package/dist/chunks/{pairing-r5z214xg.js → service-status-dnwg64ce.js} +7 -7
  21. package/dist/chunks/{pairing-v1jdrp9c.js → service-status-e2cx9grb.js} +1 -1
  22. package/dist/chunks/{pairing-atk2et4d.js → service-status-g0g9ma1m.js} +2 -2
  23. package/dist/chunks/{pairing-6t8za67t.js → service-status-g1bp01xw.js} +2 -2
  24. package/dist/chunks/{pairing-gqq6kfhc.js → service-status-gqq6kfhc.js} +1 -1
  25. package/dist/chunks/{pairing-vtvdbwhg.js → service-status-hxgz4x38.js} +2 -2
  26. package/dist/chunks/{pairing-nvdz1s2r.js → service-status-j3626vk8.js} +2 -2
  27. package/dist/chunks/{pairing-hb50yt85.js → service-status-j46s7rqq.js} +6 -6
  28. package/dist/chunks/{pairing-j4at0y5c.js → service-status-j4at0y5c.js} +1 -1
  29. package/dist/chunks/{pairing-hspp8v12.js → service-status-j66ekhc9.js} +2 -2
  30. package/dist/chunks/{pairing-z1d627xv.js → service-status-knpef8bj.js} +4 -4
  31. package/dist/chunks/{pairing-m0y4004e.js → service-status-ksvmmk2r.js} +1 -1
  32. package/dist/chunks/{pairing-pgkv2xkd.js → service-status-m95ds782.js} +8 -8
  33. package/dist/chunks/{pairing-q8cqvm6j.js → service-status-nmcxqxxx.js} +2 -2
  34. package/dist/chunks/{pairing-rmttg9h7.js → service-status-ntj59ngc.js} +3 -3
  35. package/dist/chunks/{pairing-6br0y3ag.js → service-status-qbrxhger.js} +1 -1
  36. package/dist/chunks/{pairing-77mqkxfz.js → service-status-rrf9gkkq.js} +2 -2
  37. package/dist/chunks/{pairing-aqzwjzmb.js → service-status-scq1j2yg.js} +1 -1
  38. package/dist/chunks/{pairing-j8p25vmv.js → service-status-t7dxwnb0.js} +2 -2
  39. package/dist/chunks/{pairing-74sf36cc.js → service-status-vg73xc24.js} +1 -1
  40. package/dist/chunks/{pairing-s1vhsdh5.js → service-status-vg7gkftg.js} +2 -2
  41. package/dist/chunks/{pairing-xxxx0904.js → service-status-vkgak0vv.js} +2 -2
  42. package/dist/chunks/{pairing-69weg9qz.js → service-status-w9jcwh65.js} +8 -8
  43. package/dist/chunks/{pairing-mxptzv15.js → service-status-wnyjqs9a.js} +34 -34
  44. package/dist/chunks/{pairing-ej45n981.js → service-status-xt7xrv1r.js} +2 -2
  45. package/dist/chunks/{pairing-cqhyyp3f.js → service-status-y7p3rgqn.js} +2 -2
  46. package/dist/chunks/{pairing-yet0vexm.js → service-status-yet0vexm.js} +1 -1
  47. package/dist/chunks/{pairing-gv627jgt.js → service-status-zfjz2b4g.js} +1 -1
  48. package/dist/cors.js +1 -1
  49. package/dist/event-feed.js +5 -5
  50. package/dist/fetch.js +49 -50
  51. package/dist/handlers/agent.js +6 -6
  52. package/dist/handlers/command.js +6 -6
  53. package/dist/handlers/config.js +6 -6
  54. package/dist/handlers/credential.js +6 -6
  55. package/dist/handlers/debug.js +6 -6
  56. package/dist/handlers/event.js +7 -7
  57. package/dist/handlers/form.js +6 -6
  58. package/dist/handlers/fs.js +6 -6
  59. package/dist/handlers/generate.js +6 -6
  60. package/dist/handlers/integration.js +6 -6
  61. package/dist/handlers/location.js +6 -6
  62. package/dist/handlers/mcp.js +6 -6
  63. package/dist/handlers/message.js +6 -6
  64. package/dist/handlers/migration.js +6 -6
  65. package/dist/handlers/model.js +6 -6
  66. package/dist/handlers/permission.js +6 -6
  67. package/dist/handlers/persistent-pty.js +8 -8
  68. package/dist/handlers/plugin.js +6 -6
  69. package/dist/handlers/project.js +6 -6
  70. package/dist/handlers/provider.js +6 -6
  71. package/dist/handlers/pty-socket.js +1 -1
  72. package/dist/handlers/pty.d.ts +1 -2
  73. package/dist/handlers/pty.js +8 -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.js +6 -6
  82. package/dist/handlers/voice.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 -44
  87. package/dist/location.js +2 -2
  88. package/dist/middleware/authorization.js +2 -2
  89. package/dist/middleware/form-location.js +3 -3
  90. package/dist/middleware/schema-error.js +1 -1
  91. package/dist/middleware/session-location.js +3 -3
  92. package/dist/pairing.js +5 -5
  93. package/dist/process.js +51 -52
  94. package/dist/request-tracing.js +1 -1
  95. package/dist/routes.d.ts +2 -3
  96. package/dist/routes.js +46 -47
  97. package/dist/server-info.js +3 -3
  98. package/dist/service-status.js +3 -3
  99. package/dist/workerd.js +50 -51
  100. package/package.json +8 -8
  101. package/dist/chunks/pairing-75d8a1k2.js +0 -23
  102. package/dist/pty-environment.d.ts +0 -13
  103. package/dist/pty-environment.js +0 -12
  104. /package/dist/chunks/{pairing-9rqn6x4v.js → service-status-9rqn6x4v.js} +0 -0
  105. /package/dist/chunks/{pairing-erzfdgke.js → service-status-erzfdgke.js} +0 -0
  106. /package/dist/chunks/{pairing-h6rt5k9s.js → service-status-h6rt5k9s.js} +0 -0
  107. /package/dist/chunks/{pairing-q4bn6dy8.js → service-status-q4bn6dy8.js} +0 -0
  108. /package/dist/chunks/{pairing-smaf4a18.js → service-status-smaf4a18.js} +0 -0
  109. /package/dist/chunks/{pairing-yc7nft6q.js → service-status-yc7nft6q.js} +0 -0
package/dist/api.js CHANGED
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  Api2
3
- } from "./chunks/pairing-gb66h69v.js";
4
- import"./chunks/pairing-1ahadpvw.js";
5
- import"./chunks/pairing-yet0vexm.js";
6
- import"./chunks/pairing-gqq6kfhc.js";
7
- import"./chunks/pairing-smaf4a18.js";
3
+ } from "./chunks/service-status-026wrard.js";
4
+ import"./chunks/service-status-yet0vexm.js";
5
+ import"./chunks/service-status-1ahadpvw.js";
6
+ import"./chunks/service-status-gqq6kfhc.js";
7
+ import"./chunks/service-status-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/pairing-j4at0y5c.js";
10
+ } from "./chunks/service-status-j4at0y5c.js";
11
11
  export {
12
12
  Config2 as Config,
13
13
  SESSION_TTL_SECONDS2 as SESSION_TTL_SECONDS,
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  LocationMiddleware2
3
- } from "./pairing-gqq6kfhc.js";
3
+ } from "./service-status-gqq6kfhc.js";
4
4
  import {
5
5
  FormLocationMiddleware2
6
- } from "./pairing-1ahadpvw.js";
6
+ } from "./service-status-1ahadpvw.js";
7
7
  import {
8
8
  SessionLocationMiddleware2
9
- } from "./pairing-yet0vexm.js";
9
+ } from "./service-status-yet0vexm.js";
10
10
 
11
11
  // src/api.ts
12
12
  import { makeDefaultApi } from "@opencode/protocol/api";
@@ -3,13 +3,13 @@ import {
3
3
  missingMessage2,
4
4
  failedMessageDecode2,
5
5
  failedSnapshot2
6
- } from "./pairing-smaf4a18.js";
6
+ } from "./service-status-smaf4a18.js";
7
7
  import {
8
8
  locationErrors2
9
- } from "./pairing-gqq6kfhc.js";
9
+ } from "./service-status-gqq6kfhc.js";
10
10
  import {
11
11
  Api2
12
- } from "./pairing-gb66h69v.js";
12
+ } from "./service-status-026wrard.js";
13
13
 
14
14
  // src/handlers/session.ts
15
15
  import { Session } from "@opencode/core/session";
@@ -2,7 +2,7 @@ import {
2
2
  locationErrors2,
3
3
  sessionInfo2,
4
4
  requestRef2
5
- } from "./pairing-gqq6kfhc.js";
5
+ } from "./service-status-gqq6kfhc.js";
6
6
 
7
7
  // src/middleware/form-location.ts
8
8
  import { Instance } from "@opencode/core/instance/service";
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  response2
3
- } from "./pairing-gqq6kfhc.js";
3
+ } from "./service-status-gqq6kfhc.js";
4
4
  import {
5
5
  Api2
6
- } from "./pairing-gb66h69v.js";
6
+ } from "./service-status-026wrard.js";
7
7
 
8
8
  // src/handlers/form.ts
9
9
  import { Form } from "@opencode/core/form";
@@ -1,15 +1,15 @@
1
1
  import {
2
2
  __export
3
- } from "./pairing-9rqn6x4v.js";
3
+ } from "./service-status-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: () => make3
9
+ make: () => make2
10
10
  });
11
11
  import { Effect, Ref } from "effect";
12
- var make3 = Effect.fnUntraced(function* (options = {}) {
12
+ var make2 = 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 make3 = Effect.fnUntraced(function* (options = {}) {
20
20
  };
21
21
  });
22
22
 
23
- export { make3, exports_service_status };
23
+ export { make2, exports_service_status };
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  response2
3
- } from "./pairing-gqq6kfhc.js";
3
+ } from "./service-status-gqq6kfhc.js";
4
4
  import {
5
5
  Api2
6
- } from "./pairing-gb66h69v.js";
6
+ } from "./service-status-026wrard.js";
7
7
 
8
8
  // src/handlers/integration.ts
9
9
  import { Integration } from "@opencode/core/integration";
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  response2
3
- } from "./pairing-gqq6kfhc.js";
3
+ } from "./service-status-gqq6kfhc.js";
4
4
  import {
5
5
  Api2
6
- } from "./pairing-gb66h69v.js";
6
+ } from "./service-status-026wrard.js";
7
7
 
8
8
  // src/handlers/provider.ts
9
9
  import { Provider } from "@opencode/core/provider";
@@ -1,15 +1,15 @@
1
1
  import {
2
2
  missingSession2,
3
3
  failedMessageDecode2
4
- } from "./pairing-smaf4a18.js";
4
+ } from "./service-status-smaf4a18.js";
5
5
  import {
6
6
  Api2
7
- } from "./pairing-gb66h69v.js";
7
+ } from "./service-status-026wrard.js";
8
8
 
9
9
  // src/handlers/message.ts
10
10
  import { SessionMessage } from "@opencode/core/session/message";
11
11
  import { Session } from "@opencode/core/session";
12
- import { Effect, Schema } from "effect";
12
+ import { Effect, Option, Schema } from "effect";
13
13
  import { HttpApiBuilder } from "effect/http-api";
14
14
  import { InvalidCursorError } from "@opencode/protocol/errors";
15
15
  var DefaultMessagesLimit = 50;
@@ -18,13 +18,13 @@ var Cursor = Schema.Struct({
18
18
  order: Schema.Union([Schema.Literal("asc"), Schema.Literal("desc")]),
19
19
  direction: Schema.Union([Schema.Literal("previous"), Schema.Literal("next")])
20
20
  });
21
- var decodeCursor = Schema.decodeUnknownSync(Cursor);
21
+ var decodeCursor = Schema.decodeUnknownOption(Schema.fromJsonString(Cursor));
22
22
  var cursor = {
23
23
  encode(message, order, direction) {
24
24
  return Buffer.from(JSON.stringify({ id: message.id, order, direction })).toString("base64url");
25
25
  },
26
26
  decode(input) {
27
- return decodeCursor(JSON.parse(Buffer.from(input, "base64url").toString("utf8")));
27
+ return decodeCursor(Buffer.from(input, "base64url").toString("utf8"));
28
28
  }
29
29
  };
30
30
  var MessageHandler2 = HttpApiBuilder.group(Api2, "server.message", (handlers) => Effect.gen(function* () {
@@ -32,10 +32,7 @@ var MessageHandler2 = HttpApiBuilder.group(Api2, "server.message", (handlers) =>
32
32
  return handlers.handle("session.messages", Effect.fn(function* (ctx) {
33
33
  if (ctx.query.cursor && ctx.query.order !== undefined)
34
34
  return yield* new InvalidCursorError({ message: "Cursor cannot be combined with order" });
35
- const decoded = yield* Effect.try({
36
- try: () => ctx.query.cursor ? cursor.decode(ctx.query.cursor) : undefined,
37
- catch: () => new InvalidCursorError({ message: "Invalid cursor" })
38
- });
35
+ const decoded = ctx.query.cursor ? Option.getOrUndefined(cursor.decode(ctx.query.cursor)) ?? (yield* new InvalidCursorError({ message: "Invalid cursor" })) : undefined;
39
36
  const order = decoded?.order ?? ctx.query.order ?? "desc";
40
37
  const messages = yield* session.messages({
41
38
  sessionID: ctx.params.sessionID,
@@ -4,7 +4,7 @@ import {
4
4
  authorized2,
5
5
  verifySession2,
6
6
  sessionCookieName2
7
- } from "./pairing-j4at0y5c.js";
7
+ } from "./service-status-j4at0y5c.js";
8
8
 
9
9
  // src/middleware/authorization.ts
10
10
  import { UnauthorizedError } from "@opencode/protocol/errors";
@@ -1,22 +1,22 @@
1
1
  import {
2
2
  __export
3
- } from "./pairing-9rqn6x4v.js";
3
+ } from "./service-status-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: () => Service3,
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 Service3 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(Service3, Service3.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);
@@ -38,4 +38,4 @@ function connectionURLs2(value, requestedHostname) {
38
38
  ];
39
39
  }
40
40
 
41
- export { Service3, layer4, connectionURLs2, exports_server_info };
41
+ export { Service4, layer4, connectionURLs2, exports_server_info };
@@ -1,14 +1,14 @@
1
1
  import {
2
2
  missingSession2
3
- } from "./pairing-smaf4a18.js";
3
+ } from "./service-status-smaf4a18.js";
4
4
  import {
5
5
  locationErrors2,
6
6
  response2,
7
7
  sessionInfo2
8
- } from "./pairing-gqq6kfhc.js";
8
+ } from "./service-status-gqq6kfhc.js";
9
9
  import {
10
10
  Api2
11
- } from "./pairing-gb66h69v.js";
11
+ } from "./service-status-026wrard.js";
12
12
 
13
13
  // src/handlers/permission.ts
14
14
  import { Instance } from "@opencode/core/instance/service";
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  response2
3
- } from "./pairing-gqq6kfhc.js";
3
+ } from "./service-status-gqq6kfhc.js";
4
4
  import {
5
5
  Api2
6
- } from "./pairing-gb66h69v.js";
6
+ } from "./service-status-026wrard.js";
7
7
 
8
8
  // src/handlers/command.ts
9
9
  import { Command } from "@opencode/core/command";
@@ -2,20 +2,17 @@ import {
2
2
  locationErrors2,
3
3
  response2,
4
4
  requestRef2
5
- } from "./pairing-gqq6kfhc.js";
5
+ } from "./service-status-gqq6kfhc.js";
6
6
  import {
7
7
  Api2
8
- } from "./pairing-gb66h69v.js";
8
+ } from "./service-status-026wrard.js";
9
9
  import {
10
10
  CorsConfig2,
11
11
  isAllowedRequestOrigin2
12
- } from "./pairing-q4bn6dy8.js";
13
- import {
14
- Service2
15
- } from "./pairing-75d8a1k2.js";
12
+ } from "./service-status-q4bn6dy8.js";
16
13
  import {
17
14
  runPtySocket2
18
- } from "./pairing-h6rt5k9s.js";
15
+ } from "./service-status-h6rt5k9s.js";
19
16
 
20
17
  // src/handlers/pty.ts
21
18
  import { Pty } from "@opencode/core/pty";
@@ -33,63 +30,43 @@ import {
33
30
  PTY_CONNECT_TOKEN_HEADER,
34
31
  PTY_CONNECT_TOKEN_HEADER_VALUE
35
32
  } from "@opencode/protocol/groups/pty";
36
- var ticketScope = Effect.gen(function* () {
37
- const location = yield* Location.Service;
38
- return { directory: location.directory, workspaceID: location.workspaceID };
39
- });
33
+ var notFound = (ptyID) => new PtyNotFoundError({ ptyID, message: `PTY session not found: ${ptyID}` });
40
34
  var PtyHandler2 = HttpApiBuilder.group(Api2, "server.pty", (handlers) => Effect.gen(function* () {
41
35
  const locations = yield* LocationServiceMap.Service;
42
36
  const tickets = yield* PtyTicket.Service;
43
37
  const cors = yield* CorsConfig2;
44
- const environment = yield* Service2;
45
38
  return handlers.handle("pty.list", Effect.fn(function* () {
46
39
  const pty = yield* Pty.Service;
47
40
  return yield* response2(pty.list());
48
41
  })).handle("pty.create", Effect.fn(function* (ctx) {
49
42
  const pty = yield* Pty.Service;
50
43
  const location = yield* Location.Service;
51
- const cwd = ctx.payload.cwd || location.directory;
52
44
  return yield* response2(pty.create({
53
45
  ...ctx.payload,
54
- args: ctx.payload.args ? [...ctx.payload.args] : undefined,
55
- cwd,
56
- env: {
57
- ...ctx.payload.env,
58
- ...yield* environment.get({ directory: location.directory, cwd })
59
- }
46
+ cwd: ctx.payload.cwd || location.directory
60
47
  }));
61
48
  })).handle("pty.get", Effect.fn(function* (ctx) {
62
49
  const pty = yield* Pty.Service;
63
- return yield* response2(pty.get(ctx.params.ptyID).pipe(Effect.catchTag("Pty.NotFoundError", () => new PtyNotFoundError({
64
- ptyID: ctx.params.ptyID,
65
- message: `PTY session not found: ${ctx.params.ptyID}`
66
- }))));
50
+ return yield* response2(pty.get(ctx.params.ptyID).pipe(Effect.catchTag("Pty.NotFoundError", () => notFound(ctx.params.ptyID))));
67
51
  })).handle("pty.update", Effect.fn(function* (ctx) {
68
52
  const pty = yield* Pty.Service;
69
- return yield* response2(pty.update(ctx.params.ptyID, {
70
- ...ctx.payload,
71
- size: ctx.payload.size ? { ...ctx.payload.size } : undefined
72
- }).pipe(Effect.catchTag("Pty.NotFoundError", () => new PtyNotFoundError({
73
- ptyID: ctx.params.ptyID,
74
- message: `PTY session not found: ${ctx.params.ptyID}`
75
- }))));
53
+ return yield* response2(pty.update(ctx.params.ptyID, ctx.payload).pipe(Effect.catchTag("Pty.NotFoundError", () => notFound(ctx.params.ptyID))));
76
54
  })).handle("pty.remove", Effect.fn(function* (ctx) {
77
55
  const pty = yield* Pty.Service;
78
- yield* pty.remove(ctx.params.ptyID).pipe(Effect.catchTag("Pty.NotFoundError", () => new PtyNotFoundError({
79
- ptyID: ctx.params.ptyID,
80
- message: `PTY session not found: ${ctx.params.ptyID}`
81
- })));
56
+ yield* pty.remove(ctx.params.ptyID).pipe(Effect.catchTag("Pty.NotFoundError", () => notFound(ctx.params.ptyID)));
82
57
  return HttpApiSchema.NoContent.make();
83
58
  })).handle("pty.connectToken", Effect.fn(function* (ctx) {
84
59
  const request = yield* HttpServerRequest.HttpServerRequest;
85
60
  if (request.headers[PTY_CONNECT_TOKEN_HEADER] !== PTY_CONNECT_TOKEN_HEADER_VALUE || !isAllowedRequestOrigin2(request.headers.origin, request.headers.host, cors))
86
61
  return yield* new ForbiddenError({ message: "Invalid PTY connect token request" });
87
62
  const pty = yield* Pty.Service;
88
- yield* pty.get(ctx.params.ptyID).pipe(Effect.catchTag("Pty.NotFoundError", () => new PtyNotFoundError({
63
+ const location = yield* Location.Service;
64
+ yield* pty.get(ctx.params.ptyID).pipe(Effect.catchTag("Pty.NotFoundError", () => notFound(ctx.params.ptyID)));
65
+ return yield* response2(tickets.issue({
89
66
  ptyID: ctx.params.ptyID,
90
- message: `PTY session not found: ${ctx.params.ptyID}`
91
- })));
92
- return yield* response2(tickets.issue({ ptyID: ctx.params.ptyID, ...yield* ticketScope }));
67
+ directory: location.directory,
68
+ workspaceID: location.workspaceID
69
+ }));
93
70
  })).handleRaw("pty.connect", Effect.fn("PtyHandler.connect")(function* (ctx) {
94
71
  if (!isAllowedRequestOrigin2(ctx.request.headers.origin, ctx.request.headers.host, cors))
95
72
  return HttpServerResponse.empty({ status: 403 });
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  response2
3
- } from "./pairing-gqq6kfhc.js";
3
+ } from "./service-status-gqq6kfhc.js";
4
4
  import {
5
5
  Api2
6
- } from "./pairing-gb66h69v.js";
6
+ } from "./service-status-026wrard.js";
7
7
 
8
8
  // src/handlers/mcp.ts
9
9
  import { Mcp } from "@opencode/core/mcp/index";
@@ -14,7 +14,7 @@ var notFound = (effect) => effect.pipe(Effect.mapError((error) => new McpServerN
14
14
  var McpHandler2 = HttpApiBuilder.group(Api2, "server.mcp", (handlers) => Effect.gen(function* () {
15
15
  return handlers.handle("mcp.list", Effect.fn(function* () {
16
16
  const service = yield* Mcp.Service;
17
- return yield* response2(service.servers().pipe(Effect.map((servers) => servers.map((info) => ({ name: info.name, status: info.status, integrationID: info.integrationID })))));
17
+ return yield* response2(service.servers());
18
18
  })).handle("mcp.add", Effect.fn(function* (ctx) {
19
19
  const service = yield* Mcp.Service;
20
20
  yield* service.add(ctx.params.server, ctx.payload.config);
@@ -1,39 +1,36 @@
1
1
  import {
2
2
  layer3
3
- } from "./pairing-gqq6kfhc.js";
3
+ } from "./service-status-gqq6kfhc.js";
4
4
  import {
5
5
  formLocationLayer2
6
- } from "./pairing-1ahadpvw.js";
6
+ } from "./service-status-1ahadpvw.js";
7
7
  import {
8
8
  sessionLocationLayer2
9
- } from "./pairing-yet0vexm.js";
9
+ } from "./service-status-yet0vexm.js";
10
10
  import {
11
11
  Api2
12
- } from "./pairing-gb66h69v.js";
12
+ } from "./service-status-026wrard.js";
13
13
  import {
14
14
  Config2
15
- } from "./pairing-j4at0y5c.js";
15
+ } from "./service-status-j4at0y5c.js";
16
16
  import {
17
17
  CorsConfig2
18
- } from "./pairing-q4bn6dy8.js";
18
+ } from "./service-status-q4bn6dy8.js";
19
19
  import {
20
20
  layer4
21
- } from "./pairing-b1prsepx.js";
22
- import {
23
- node3
24
- } from "./pairing-69weg9qz.js";
21
+ } from "./service-status-7dtbad8d.js";
25
22
  import {
26
23
  node2
27
- } from "./pairing-75d8a1k2.js";
24
+ } from "./service-status-w9jcwh65.js";
28
25
  import {
29
26
  handlers2
30
- } from "./pairing-mxptzv15.js";
27
+ } from "./service-status-wnyjqs9a.js";
31
28
  import {
32
29
  authorizationLayer2
33
- } from "./pairing-6v4wsps6.js";
30
+ } from "./service-status-6v4wsps6.js";
34
31
  import {
35
32
  schemaErrorLayer2
36
- } from "./pairing-erzfdgke.js";
33
+ } from "./service-status-erzfdgke.js";
37
34
 
38
35
  // src/routes.ts
39
36
  import { Database } from "@opencode/core/database/database";
@@ -93,7 +90,6 @@ var applicationServiceNodes = [
93
90
  Credential.node,
94
91
  WellKnown.node,
95
92
  node2,
96
- node3,
97
93
  LocationServiceMap.node,
98
94
  LocationActivity.node,
99
95
  SessionRestart.node,
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  Api2
3
- } from "./pairing-gb66h69v.js";
3
+ } from "./service-status-026wrard.js";
4
4
  import {
5
5
  CorsConfig2,
6
6
  isAllowedRequestOrigin2
7
- } from "./pairing-q4bn6dy8.js";
7
+ } from "./service-status-q4bn6dy8.js";
8
8
  import {
9
9
  runPtySocket2
10
- } from "./pairing-h6rt5k9s.js";
10
+ } from "./service-status-h6rt5k9s.js";
11
11
 
12
12
  // src/handlers/persistent-pty.ts
13
13
  import { PersistentPty } from "@opencode/core/persistent-pty";
@@ -1,17 +1,17 @@
1
1
  import {
2
2
  __export
3
- } from "./pairing-9rqn6x4v.js";
3
+ } from "./service-status-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: () => Service5,
10
+ Service: () => Service2,
11
11
  SubscriberCapacity: () => SubscriberCapacity2,
12
12
  SubscriberOverflowError: () => SubscriberOverflowError2,
13
13
  frame: () => frame2,
14
- layer: () => layer5,
14
+ layer: () => layer2,
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 Service5 extends Context.Service()("@opencode/server/EventFeed") {
33
+ class Service2 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 Service5.of({
74
+ return Service2.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 layer5 = Layer.effect(Service5, Effect.gen(function* () {
78
+ var layer2 = Layer.effect(Service2, 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, Service5, frame2, make4, layer5, exports_event_feed };
83
+ export { SubscriberCapacity2, SubscriberOverflowError2, EncodingError2, Service2, frame2, make4, layer2, exports_event_feed };
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  Api2
3
- } from "./pairing-gb66h69v.js";
3
+ } from "./service-status-026wrard.js";
4
4
 
5
5
  // src/handlers/credential.ts
6
6
  import { Credential } from "@opencode/core/credential";
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  awaitPlugins2,
3
3
  response2
4
- } from "./pairing-gqq6kfhc.js";
4
+ } from "./service-status-gqq6kfhc.js";
5
5
  import {
6
6
  Api2
7
- } from "./pairing-gb66h69v.js";
7
+ } from "./service-status-026wrard.js";
8
8
 
9
9
  // src/handlers/websearch.ts
10
10
  import { WebSearch } from "@opencode/core/websearch";
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  response2
3
- } from "./pairing-gqq6kfhc.js";
3
+ } from "./service-status-gqq6kfhc.js";
4
4
  import {
5
5
  Api2
6
- } from "./pairing-gb66h69v.js";
6
+ } from "./service-status-026wrard.js";
7
7
 
8
8
  // src/handlers/plugin.ts
9
9
  import { Plugin } from "@opencode/core/plugin";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  missingSession2
3
- } from "./pairing-smaf4a18.js";
3
+ } from "./service-status-smaf4a18.js";
4
4
 
5
5
  // src/location.ts
6
6
  import { FileSystem } from "@opencode/core/filesystem";
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  response2
3
- } from "./pairing-gqq6kfhc.js";
3
+ } from "./service-status-gqq6kfhc.js";
4
4
  import {
5
5
  Api2
6
- } from "./pairing-gb66h69v.js";
6
+ } from "./service-status-026wrard.js";
7
7
 
8
8
  // src/handlers/shell.ts
9
9
  import { Shell } from "@opencode/core/shell";
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  requestRef2
3
- } from "./pairing-gqq6kfhc.js";
3
+ } from "./service-status-gqq6kfhc.js";
4
4
  import {
5
5
  Api2
6
- } from "./pairing-gb66h69v.js";
6
+ } from "./service-status-026wrard.js";
7
7
 
8
8
  // src/handlers/debug.ts
9
9
  import { LocationServiceMap } from "@opencode/core/location-service-map";
@@ -1,26 +1,26 @@
1
1
  import {
2
2
  isAllowedCorsOrigin2
3
- } from "./pairing-q4bn6dy8.js";
3
+ } from "./service-status-q4bn6dy8.js";
4
4
  import {
5
5
  createRoutes2
6
- } from "./pairing-4p1svrjf.js";
6
+ } from "./service-status-c9pn3jbn.js";
7
7
  import {
8
8
  __export
9
- } from "./pairing-9rqn6x4v.js";
9
+ } from "./service-status-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: () => make2
15
+ make: () => make3
16
16
  });
17
17
  import { Context, Effect, Layer } from "effect";
18
18
  import { HttpEffect, HttpMiddleware, HttpRouter, HttpServer } from "effect/http";
19
19
  import { SessionRestart } from "@opencode/core/session/execution/restart";
20
- var make2 = Effect.fn("ServerFetch.make")(function* (options = {}, boot = {}) {
20
+ var make3 = 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 { make2, exports_fetch };
26
+ export { make3, exports_fetch };
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  __export
3
- } from "./pairing-9rqn6x4v.js";
3
+ } from "./service-status-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 "./pairing-gqq6kfhc.js";
3
+ } from "./service-status-gqq6kfhc.js";
4
4
  import {
5
5
  Api2
6
- } from "./pairing-gb66h69v.js";
6
+ } from "./service-status-026wrard.js";
7
7
 
8
8
  // src/handlers/skill.ts
9
9
  import { Skill } from "@opencode/core/skill";