@opencode/server 0.0.0-dev-20782 → 0.0.0-dev-20784

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 (142) hide show
  1. package/dist/api.d.ts +13 -13
  2. package/dist/api.js +5 -5
  3. package/dist/auth.js +1 -1
  4. package/dist/chunks/{workerd-yzp5qqh7.js → fetch-00mapsdc.js} +4 -4
  5. package/dist/chunks/{workerd-7rxakzjh.js → fetch-0b39h07j.js} +2 -2
  6. package/dist/chunks/{workerd-4znne276.js → fetch-0q1fp77w.js} +2 -2
  7. package/dist/chunks/{workerd-y1grnrmm.js → fetch-10bq7mg4.js} +2 -2
  8. package/dist/chunks/{workerd-zyx1txgf.js → fetch-125dj052.js} +10 -10
  9. package/dist/chunks/{workerd-4rww2e47.js → fetch-13tvbs17.js} +3 -3
  10. package/dist/chunks/{workerd-1nwce8pe.js → fetch-19taf7de.js} +2 -2
  11. package/dist/chunks/{workerd-vb9atgxj.js → fetch-360ay1ws.js} +2 -2
  12. package/dist/chunks/{workerd-ym27c8rr.js → fetch-44qh4kfc.js} +4 -4
  13. package/dist/chunks/{workerd-v9pcqbqn.js → fetch-4r8g7rwq.js} +3 -3
  14. package/dist/chunks/{workerd-5ybpxcad.js → fetch-54sczv30.js} +7 -7
  15. package/dist/chunks/{workerd-gtkdacvk.js → fetch-5ytyqf1q.js} +5 -4
  16. package/dist/chunks/{workerd-weqhmjbd.js → fetch-735x1s0d.js} +3 -3
  17. package/dist/chunks/{workerd-gny2k2ap.js → fetch-73mn2n3x.js} +4 -4
  18. package/dist/chunks/{workerd-1xva44q8.js → fetch-8cnxq26y.js} +3 -3
  19. package/dist/chunks/{workerd-934cmkaf.js → fetch-8d0mn004.js} +3 -3
  20. package/dist/chunks/{workerd-16qfdx6b.js → fetch-9e4rhycp.js} +3 -3
  21. package/dist/chunks/{workerd-anm12x33.js → fetch-anm12x33.js} +1 -1
  22. package/dist/chunks/{workerd-9very778.js → fetch-b8ygg5k2.js} +7 -7
  23. package/dist/chunks/{workerd-td9k2nw3.js → fetch-bwz286mg.js} +3 -3
  24. package/dist/chunks/{workerd-1pc0tr9h.js → fetch-en4n16hb.js} +33 -33
  25. package/dist/chunks/{workerd-t8yzmczr.js → fetch-erzfdgke.js} +1 -1
  26. package/dist/chunks/{workerd-n52yc5x0.js → fetch-f3xezvck.js} +3 -3
  27. package/dist/chunks/{workerd-rz196gzy.js → fetch-gd6nn1mx.js} +21 -21
  28. package/dist/chunks/{workerd-9cw9axw5.js → fetch-h2a6nn7k.js} +3 -3
  29. package/dist/chunks/fetch-h6rt5k9s.js +24 -0
  30. package/dist/chunks/{workerd-dqsr2g0t.js → fetch-j03v2rh9.js} +3 -3
  31. package/dist/chunks/{workerd-3hev21p5.js → fetch-jp72ysbz.js} +4 -4
  32. package/dist/chunks/{workerd-yybdkkb6.js → fetch-jphw74cq.js} +3 -3
  33. package/dist/chunks/{workerd-x2by5wsf.js → fetch-ke8kc592.js} +30 -34
  34. package/dist/chunks/{workerd-g85r3kcp.js → fetch-nqswsw3h.js} +3 -3
  35. package/dist/chunks/{workerd-0vyswjsz.js → fetch-p177e0cw.js} +3 -3
  36. package/dist/chunks/{workerd-krn4521r.js → fetch-qggsn6y0.js} +3 -3
  37. package/dist/chunks/{workerd-kr61w04k.js → fetch-rbn15j6z.js} +8 -8
  38. package/dist/chunks/{workerd-7gfv664k.js → fetch-s1824482.js} +3 -3
  39. package/dist/chunks/{workerd-h7se5k3v.js → fetch-sb0dyttf.js} +32 -31
  40. package/dist/chunks/{workerd-hvft24jv.js → fetch-tr76qvg4.js} +2 -2
  41. package/dist/chunks/{workerd-w070c2h2.js → fetch-ty73jqxf.js} +3 -3
  42. package/dist/chunks/{workerd-bkk2wfbz.js → fetch-vvagfka3.js} +7 -7
  43. package/dist/chunks/{workerd-796j10e5.js → fetch-vw0q3knq.js} +3 -3
  44. package/dist/chunks/{workerd-ca257yb3.js → fetch-x5jn5rep.js} +3 -3
  45. package/dist/chunks/{workerd-xsrtpxyd.js → fetch-xsrtpxyd.js} +1 -1
  46. package/dist/chunks/{workerd-jzqzrtw5.js → fetch-ybxyv6z5.js} +2 -2
  47. package/dist/chunks/{workerd-ajzgetf8.js → fetch-ysb51p4r.js} +3 -3
  48. package/dist/chunks/{workerd-a5j49w62.js → fetch-yvtnm9hy.js} +6 -6
  49. package/dist/chunks/{workerd-f2c3fmpg.js → fetch-ywn523ee.js} +5 -5
  50. package/dist/cors.js +1 -1
  51. package/dist/event-feed.js +5 -5
  52. package/dist/fetch.js +47 -47
  53. package/dist/handlers/agent.d.ts +1 -1
  54. package/dist/handlers/agent.js +6 -6
  55. package/dist/handlers/command.d.ts +1 -1
  56. package/dist/handlers/command.js +6 -6
  57. package/dist/handlers/config.d.ts +1 -1
  58. package/dist/handlers/config.js +6 -6
  59. package/dist/handlers/credential.d.ts +1 -1
  60. package/dist/handlers/credential.js +6 -6
  61. package/dist/handlers/debug.d.ts +1 -1
  62. package/dist/handlers/debug.js +6 -6
  63. package/dist/handlers/event.d.ts +1 -1
  64. package/dist/handlers/event.js +7 -7
  65. package/dist/handlers/form.d.ts +1 -1
  66. package/dist/handlers/form.js +6 -6
  67. package/dist/handlers/fs.d.ts +1 -1
  68. package/dist/handlers/fs.js +6 -6
  69. package/dist/handlers/generate.d.ts +1 -1
  70. package/dist/handlers/generate.js +6 -6
  71. package/dist/handlers/integration.d.ts +1 -1
  72. package/dist/handlers/integration.js +6 -6
  73. package/dist/handlers/location.d.ts +1 -1
  74. package/dist/handlers/location.js +6 -6
  75. package/dist/handlers/mcp.d.ts +1 -1
  76. package/dist/handlers/mcp.js +6 -6
  77. package/dist/handlers/message.d.ts +1 -1
  78. package/dist/handlers/message.js +6 -6
  79. package/dist/handlers/migration.d.ts +1 -1
  80. package/dist/handlers/migration.js +6 -6
  81. package/dist/handlers/model.d.ts +1 -1
  82. package/dist/handlers/model.js +6 -6
  83. package/dist/handlers/permission.d.ts +1 -1
  84. package/dist/handlers/permission.js +6 -6
  85. package/dist/handlers/persistent-pty.d.ts +1 -1
  86. package/dist/handlers/persistent-pty.js +8 -8
  87. package/dist/handlers/plugin.d.ts +1 -1
  88. package/dist/handlers/plugin.js +6 -6
  89. package/dist/handlers/project.d.ts +1 -1
  90. package/dist/handlers/project.js +6 -6
  91. package/dist/handlers/provider.d.ts +1 -1
  92. package/dist/handlers/provider.js +6 -6
  93. package/dist/handlers/pty-socket.d.ts +10 -2
  94. package/dist/handlers/pty-socket.js +1 -1
  95. package/dist/handlers/pty.d.ts +1 -1
  96. package/dist/handlers/pty.js +9 -9
  97. package/dist/handlers/reference.d.ts +1 -1
  98. package/dist/handlers/reference.js +6 -6
  99. package/dist/handlers/rpc.d.ts +1 -1
  100. package/dist/handlers/rpc.js +6 -6
  101. package/dist/handlers/server.d.ts +1 -1
  102. package/dist/handlers/server.js +9 -9
  103. package/dist/handlers/session-error.js +1 -1
  104. package/dist/handlers/session.d.ts +1 -1
  105. package/dist/handlers/session.js +6 -6
  106. package/dist/handlers/shell.d.ts +1 -1
  107. package/dist/handlers/shell.js +6 -6
  108. package/dist/handlers/skill.d.ts +1 -1
  109. package/dist/handlers/skill.js +6 -6
  110. package/dist/handlers/vcs.d.ts +1 -1
  111. package/dist/handlers/vcs.js +6 -6
  112. package/dist/handlers/websearch.d.ts +1 -1
  113. package/dist/handlers/websearch.js +6 -6
  114. package/dist/handlers/worktree.d.ts +1 -1
  115. package/dist/handlers/worktree.js +6 -6
  116. package/dist/handlers.d.ts +1 -1
  117. package/dist/handlers.js +43 -43
  118. package/dist/location.d.ts +2 -2
  119. package/dist/location.js +4 -4
  120. package/dist/middleware/authorization.d.ts +1 -1
  121. package/dist/middleware/authorization.js +2 -2
  122. package/dist/middleware/form-location.d.ts +1 -1
  123. package/dist/middleware/form-location.js +3 -3
  124. package/dist/middleware/schema-error.js +1 -1
  125. package/dist/middleware/session-location.d.ts +1 -1
  126. package/dist/middleware/session-location.js +3 -3
  127. package/dist/pairing.js +5 -5
  128. package/dist/process.d.ts +4 -3
  129. package/dist/process.js +50 -50
  130. package/dist/pty-environment.js +5 -5
  131. package/dist/request-tracing.js +1 -1
  132. package/dist/routes.d.ts +3 -3
  133. package/dist/routes.js +46 -46
  134. package/dist/server-info.js +5 -5
  135. package/dist/service-status.js +1 -1
  136. package/dist/workerd.js +48 -48
  137. package/package.json +14 -12
  138. package/dist/chunks/workerd-hezj1jdf.js +0 -7
  139. /package/dist/chunks/{workerd-9rqn6x4v.js → fetch-9rqn6x4v.js} +0 -0
  140. /package/dist/chunks/{workerd-q4bn6dy8.js → fetch-q4bn6dy8.js} +0 -0
  141. /package/dist/chunks/{workerd-smaf4a18.js → fetch-smaf4a18.js} +0 -0
  142. /package/dist/chunks/{workerd-yc7nft6q.js → fetch-yc7nft6q.js} +0 -0
@@ -1,99 +1,99 @@
1
1
  import {
2
2
  GenerateHandler2
3
- } from "./workerd-7gfv664k.js";
3
+ } from "./fetch-s1824482.js";
4
4
  import {
5
5
  MessageHandler2
6
- } from "./workerd-4rww2e47.js";
6
+ } from "./fetch-13tvbs17.js";
7
7
  import {
8
8
  ModelHandler2
9
- } from "./workerd-td9k2nw3.js";
9
+ } from "./fetch-bwz286mg.js";
10
10
  import {
11
11
  ProviderHandler2
12
- } from "./workerd-0vyswjsz.js";
12
+ } from "./fetch-p177e0cw.js";
13
13
  import {
14
14
  SessionHandler2
15
- } from "./workerd-gny2k2ap.js";
15
+ } from "./fetch-73mn2n3x.js";
16
16
  import {
17
17
  PermissionHandler2
18
- } from "./workerd-ym27c8rr.js";
18
+ } from "./fetch-44qh4kfc.js";
19
19
  import {
20
20
  FileSystemHandler2
21
- } from "./workerd-yzp5qqh7.js";
21
+ } from "./fetch-00mapsdc.js";
22
22
  import {
23
23
  FormHandler2
24
- } from "./workerd-v9pcqbqn.js";
24
+ } from "./fetch-4r8g7rwq.js";
25
25
  import {
26
26
  CommandHandler2
27
- } from "./workerd-1xva44q8.js";
27
+ } from "./fetch-8cnxq26y.js";
28
28
  import {
29
29
  SkillHandler2
30
- } from "./workerd-dqsr2g0t.js";
30
+ } from "./fetch-j03v2rh9.js";
31
31
  import {
32
32
  RpcHandler2
33
- } from "./workerd-y1grnrmm.js";
33
+ } from "./fetch-10bq7mg4.js";
34
34
  import {
35
- layer3
36
- } from "./workerd-5ybpxcad.js";
35
+ layer5
36
+ } from "./fetch-54sczv30.js";
37
37
  import {
38
38
  EventHandler2
39
- } from "./workerd-a5j49w62.js";
39
+ } from "./fetch-yvtnm9hy.js";
40
40
  import {
41
41
  AgentHandler2
42
- } from "./workerd-yybdkkb6.js";
42
+ } from "./fetch-jphw74cq.js";
43
43
  import {
44
44
  PluginHandler2
45
- } from "./workerd-weqhmjbd.js";
45
+ } from "./fetch-735x1s0d.js";
46
46
  import {
47
47
  ServerHandler2
48
- } from "./workerd-zyx1txgf.js";
48
+ } from "./fetch-125dj052.js";
49
49
  import {
50
50
  DebugHandler2
51
- } from "./workerd-n52yc5x0.js";
51
+ } from "./fetch-f3xezvck.js";
52
52
  import {
53
53
  PtyHandler2
54
- } from "./workerd-h7se5k3v.js";
54
+ } from "./fetch-sb0dyttf.js";
55
55
  import {
56
56
  PersistentPtyHandler2
57
- } from "./workerd-x2by5wsf.js";
57
+ } from "./fetch-ke8kc592.js";
58
58
  import {
59
59
  ShellHandler2
60
- } from "./workerd-krn4521r.js";
60
+ } from "./fetch-qggsn6y0.js";
61
61
  import {
62
62
  ReferenceHandler2
63
- } from "./workerd-ajzgetf8.js";
63
+ } from "./fetch-ysb51p4r.js";
64
64
  import {
65
65
  LocationHandler2
66
- } from "./workerd-4znne276.js";
66
+ } from "./fetch-0q1fp77w.js";
67
67
  import {
68
68
  IntegrationHandler2
69
- } from "./workerd-934cmkaf.js";
69
+ } from "./fetch-8d0mn004.js";
70
70
  import {
71
71
  WebSearchHandler2
72
- } from "./workerd-16qfdx6b.js";
72
+ } from "./fetch-9e4rhycp.js";
73
73
  import {
74
74
  McpHandler2
75
- } from "./workerd-ca257yb3.js";
75
+ } from "./fetch-x5jn5rep.js";
76
76
  import {
77
77
  CredentialHandler2
78
- } from "./workerd-1nwce8pe.js";
78
+ } from "./fetch-19taf7de.js";
79
79
  import {
80
80
  ProjectHandler2
81
- } from "./workerd-vb9atgxj.js";
81
+ } from "./fetch-360ay1ws.js";
82
82
  import {
83
83
  WorktreeHandler2
84
- } from "./workerd-hvft24jv.js";
84
+ } from "./fetch-tr76qvg4.js";
85
85
  import {
86
86
  VcsHandler2
87
- } from "./workerd-g85r3kcp.js";
87
+ } from "./fetch-nqswsw3h.js";
88
88
  import {
89
89
  MigrationHandler2
90
- } from "./workerd-jzqzrtw5.js";
90
+ } from "./fetch-ybxyv6z5.js";
91
91
  import {
92
92
  ConfigHandler2
93
- } from "./workerd-7rxakzjh.js";
93
+ } from "./fetch-0b39h07j.js";
94
94
 
95
95
  // src/handlers.ts
96
96
  import { Layer } from "effect";
97
- var handlers2 = Layer.mergeAll(ServerHandler2, DebugHandler2, MigrationHandler2, LocationHandler2, AgentHandler2, PluginHandler2, SessionHandler2, MessageHandler2, ModelHandler2, GenerateHandler2, ProviderHandler2, IntegrationHandler2, WebSearchHandler2, McpHandler2, CredentialHandler2, ProjectHandler2, FormHandler2, PermissionHandler2, FileSystemHandler2, CommandHandler2, SkillHandler2, RpcHandler2, EventHandler2.pipe(Layer.provide(layer3)), PtyHandler2, PersistentPtyHandler2, ShellHandler2, ReferenceHandler2, WorktreeHandler2, VcsHandler2, ConfigHandler2);
97
+ var handlers2 = Layer.mergeAll(ServerHandler2, DebugHandler2, MigrationHandler2, LocationHandler2, AgentHandler2, PluginHandler2, SessionHandler2, MessageHandler2, ModelHandler2, GenerateHandler2, ProviderHandler2, IntegrationHandler2, WebSearchHandler2, McpHandler2, CredentialHandler2, ProjectHandler2, FormHandler2, PermissionHandler2, FileSystemHandler2, CommandHandler2, SkillHandler2, RpcHandler2, EventHandler2.pipe(Layer.provide(layer5)), PtyHandler2, PersistentPtyHandler2, ShellHandler2, ReferenceHandler2, WorktreeHandler2, VcsHandler2, ConfigHandler2);
98
98
 
99
99
  export { handlers2 };
@@ -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,14 +1,14 @@
1
1
  import {
2
2
  requestRef2
3
- } from "./workerd-f2c3fmpg.js";
3
+ } from "./fetch-ywn523ee.js";
4
4
  import {
5
5
  Api2
6
- } from "./workerd-9cw9axw5.js";
6
+ } from "./fetch-h2a6nn7k.js";
7
7
 
8
8
  // src/handlers/debug.ts
9
9
  import { LocationServiceMap } from "@opencode/core/location-service-map";
10
10
  import { Effect, Option, RcMap } from "effect";
11
- import { HttpApiBuilder } from "effect/unstable/httpapi";
11
+ import { HttpApiBuilder } from "effect/http-api";
12
12
  var DebugHandler2 = HttpApiBuilder.group(Api2, "server.debug", (handlers) => handlers.handle("debug.location", Effect.fn(function* () {
13
13
  const locations = Option.getOrThrow(yield* Effect.serviceOption(LocationServiceMap.Service));
14
14
  return Array.from(yield* RcMap.keys(locations.rcMap));
@@ -1,39 +1,39 @@
1
1
  import {
2
- layer5
3
- } from "./workerd-f2c3fmpg.js";
2
+ layer4
3
+ } from "./fetch-ywn523ee.js";
4
4
  import {
5
5
  formLocationLayer2
6
- } from "./workerd-w070c2h2.js";
6
+ } from "./fetch-ty73jqxf.js";
7
7
  import {
8
8
  sessionLocationLayer2
9
- } from "./workerd-796j10e5.js";
9
+ } from "./fetch-vw0q3knq.js";
10
10
  import {
11
11
  Api2
12
- } from "./workerd-9cw9axw5.js";
12
+ } from "./fetch-h2a6nn7k.js";
13
13
  import {
14
14
  Config2
15
- } from "./workerd-anm12x33.js";
15
+ } from "./fetch-anm12x33.js";
16
16
  import {
17
17
  CorsConfig2
18
- } from "./workerd-q4bn6dy8.js";
19
- import {
20
- layer4
21
- } from "./workerd-9very778.js";
18
+ } from "./fetch-q4bn6dy8.js";
22
19
  import {
23
- node3
24
- } from "./workerd-kr61w04k.js";
20
+ layer3
21
+ } from "./fetch-b8ygg5k2.js";
25
22
  import {
26
23
  node2
27
- } from "./workerd-bkk2wfbz.js";
24
+ } from "./fetch-rbn15j6z.js";
25
+ import {
26
+ node3
27
+ } from "./fetch-vvagfka3.js";
28
28
  import {
29
29
  handlers2
30
- } from "./workerd-1pc0tr9h.js";
30
+ } from "./fetch-en4n16hb.js";
31
31
  import {
32
32
  authorizationLayer2
33
- } from "./workerd-gtkdacvk.js";
33
+ } from "./fetch-5ytyqf1q.js";
34
34
  import {
35
35
  schemaErrorLayer2
36
- } from "./workerd-t8yzmczr.js";
36
+ } from "./fetch-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,
@@ -91,8 +91,8 @@ var applicationServiceNodes = [
91
91
  PersistentPty.node,
92
92
  Credential.node,
93
93
  WellKnown.node,
94
- node2,
95
94
  node3,
95
+ node2,
96
96
  LocationServiceMap.node,
97
97
  LocationActivity.node,
98
98
  SessionRestart.node,
@@ -144,8 +144,8 @@ function makeRoutes(auth, options, serviceURLs, overrides, instances) {
144
144
  })) : build(overrides);
145
145
  return serviceLayer.pipe(Layer.flatMap((context) => {
146
146
  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 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));
147
+ const requestServices = Layer.merge(Layer.succeedContext(Context.pick(Database.Service, Credential.Service, PermissionSaved.Service, PluginUpdate.Service, Project.Service, WellKnown.Service)(context)), layer3(serviceURLs, Context.get(context, Global.Service).tmp, options.app));
148
+ 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(layer4), Layer.provide(authorizationLayer2), Layer.provide(schemaErrorLayer2), Layer.provide(auth), HttpRouter.provideRequest(requestServices), Layer.provideMerge(services), Layer.provideMerge(HttpRouter.layer));
149
149
  return Layer.merge(api, V1Migration.layer.pipe(Layer.provide(services)));
150
150
  }));
151
151
  }
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  LocationMiddleware2
3
- } from "./workerd-f2c3fmpg.js";
3
+ } from "./fetch-ywn523ee.js";
4
4
  import {
5
5
  FormLocationMiddleware2
6
- } from "./workerd-w070c2h2.js";
6
+ } from "./fetch-ty73jqxf.js";
7
7
  import {
8
8
  SessionLocationMiddleware2
9
- } from "./workerd-796j10e5.js";
9
+ } from "./fetch-vw0q3knq.js";
10
10
 
11
11
  // src/api.ts
12
12
  import { makeDefaultApi } from "@opencode/protocol/api";
@@ -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
  response2
3
- } from "./workerd-f2c3fmpg.js";
3
+ } from "./fetch-ywn523ee.js";
4
4
  import {
5
5
  Api2
6
- } from "./workerd-9cw9axw5.js";
6
+ } from "./fetch-h2a6nn7k.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,12 +1,12 @@
1
1
  import {
2
2
  isAllowedCorsOrigin2
3
- } from "./workerd-q4bn6dy8.js";
3
+ } from "./fetch-q4bn6dy8.js";
4
4
  import {
5
5
  createRoutes2
6
- } from "./workerd-rz196gzy.js";
6
+ } from "./fetch-gd6nn1mx.js";
7
7
  import {
8
8
  __export
9
- } from "./workerd-9rqn6x4v.js";
9
+ } from "./fetch-9rqn6x4v.js";
10
10
 
11
11
  // src/fetch.ts
12
12
  var exports_fetch = {};
@@ -15,7 +15,7 @@ __export(exports_fetch, {
15
15
  make: () => make3
16
16
  });
17
17
  import { Context, Effect, Layer } from "effect";
18
- import { HttpEffect, HttpMiddleware, HttpRouter, HttpServer } from "effect/unstable/http";
18
+ import { HttpEffect, HttpMiddleware, HttpRouter, HttpServer } from "effect/http";
19
19
  import { SessionRestart } from "@opencode/core/session/execution/restart";
20
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)));
@@ -1,14 +1,14 @@
1
1
  import {
2
2
  response2
3
- } from "./workerd-f2c3fmpg.js";
3
+ } from "./fetch-ywn523ee.js";
4
4
  import {
5
5
  Api2
6
- } from "./workerd-9cw9axw5.js";
6
+ } from "./fetch-h2a6nn7k.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()));
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  Api2
3
- } from "./workerd-9cw9axw5.js";
3
+ } from "./fetch-h2a6nn7k.js";
4
4
  import {
5
5
  CorsConfig2,
6
6
  isAllowedRequestOrigin2
7
- } from "./workerd-q4bn6dy8.js";
7
+ } from "./fetch-q4bn6dy8.js";
8
8
  import {
9
9
  runPtySocket2
10
- } from "./workerd-hezj1jdf.js";
10
+ } from "./fetch-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,9 +1,9 @@
1
1
  import {
2
2
  response2
3
- } from "./workerd-f2c3fmpg.js";
3
+ } from "./fetch-ywn523ee.js";
4
4
  import {
5
5
  Api2
6
- } from "./workerd-9cw9axw5.js";
6
+ } from "./fetch-h2a6nn7k.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,15 +1,15 @@
1
1
  import {
2
2
  response2
3
- } from "./workerd-f2c3fmpg.js";
3
+ } from "./fetch-ywn523ee.js";
4
4
  import {
5
5
  Api2
6
- } from "./workerd-9cw9axw5.js";
6
+ } from "./fetch-h2a6nn7k.js";
7
7
 
8
8
  // src/handlers/provider.ts
9
9
  import { Provider } from "@opencode/core/provider";
10
10
  import { ProviderNotFoundError } 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 ProviderHandler2 = HttpApiBuilder.group(Api2, "server.provider", (handlers) => Effect.gen(function* () {
14
14
  return handlers.handle("provider.list", Effect.fn(function* () {
15
15
  const providers = yield* Provider.Service;
@@ -1,15 +1,15 @@
1
1
  import {
2
2
  response2
3
- } from "./workerd-f2c3fmpg.js";
3
+ } from "./fetch-ywn523ee.js";
4
4
  import {
5
5
  Api2
6
- } from "./workerd-9cw9axw5.js";
6
+ } from "./fetch-h2a6nn7k.js";
7
7
 
8
8
  // src/handlers/shell.ts
9
9
  import { Shell } from "@opencode/core/shell";
10
10
  import { Location } from "@opencode/core/location";
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 { ShellNotFoundError } from "@opencode/protocol/errors";
14
14
  var ShellHandler2 = HttpApiBuilder.group(Api2, "server.shell", (handlers) => Effect.gen(function* () {
15
15
  return handlers.handle("shell.list", Effect.fn(function* () {
@@ -1,25 +1,25 @@
1
1
  import {
2
2
  __export
3
- } from "./workerd-9rqn6x4v.js";
3
+ } from "./fetch-9rqn6x4v.js";
4
4
 
5
5
  // src/pairing.ts
6
6
  var exports_pairing = {};
7
7
  __export(exports_pairing, {
8
8
  ServerPairing: () => exports_pairing,
9
- Service: () => Service3,
10
- node: () => node3
9
+ Service: () => Service2,
10
+ node: () => node2
11
11
  });
12
12
  import { Cache, Context, Duration, Effect, Layer } from "effect";
13
13
  import { makeGlobalNode } from "@opencode/util/effect/app-node";
14
14
  import { randomBytes } from "node:crypto";
15
15
  var TTL = Duration.minutes(5);
16
16
 
17
- class Service3 extends Context.Service()("@opencode/ServerPairing") {
17
+ class Service2 extends Context.Service()("@opencode/ServerPairing") {
18
18
  }
19
19
  var noLookup = () => Effect.die(new Error("ServerPairing cache must be used via set/invalidateWhen, never get"));
20
- var layer = Layer.effect(Service3, Effect.gen(function* () {
20
+ var layer = Layer.effect(Service2, Effect.gen(function* () {
21
21
  const cache = yield* Cache.make({ capacity: 1000, lookup: noLookup, timeToLive: TTL });
22
- return Service3.of({
22
+ return Service2.of({
23
23
  issue: Effect.fn("ServerPairing.issue")(function* () {
24
24
  const code = randomBytes(16).toString("base64url");
25
25
  yield* Cache.set(cache, code, true);
@@ -30,6 +30,6 @@ var layer = Layer.effect(Service3, Effect.gen(function* () {
30
30
  })
31
31
  });
32
32
  }));
33
- var node3 = makeGlobalNode({ service: Service3, layer, deps: [] });
33
+ var node2 = makeGlobalNode({ service: Service2, layer, deps: [] });
34
34
 
35
- export { Service3, node3, exports_pairing };
35
+ export { Service2, node2, exports_pairing };
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  locationErrors2
3
- } from "./workerd-f2c3fmpg.js";
3
+ } from "./fetch-ywn523ee.js";
4
4
  import {
5
5
  Api2
6
- } from "./workerd-9cw9axw5.js";
6
+ } from "./fetch-h2a6nn7k.js";
7
7
 
8
8
  // src/handlers/generate.ts
9
9
  import { Generate } from "@opencode/core/generate";
@@ -13,7 +13,7 @@ import { AbsolutePath } from "@opencode/core/schema";
13
13
  import { InvalidRequestError, ServiceUnavailableError } from "@opencode/protocol/errors";
14
14
  import { Global } from "@opencode/util/global";
15
15
  import { Effect } from "effect";
16
- import { HttpApiBuilder } from "effect/unstable/httpapi";
16
+ import { HttpApiBuilder } from "effect/http-api";
17
17
  var GenerateHandler2 = HttpApiBuilder.group(Api2, "server.generate", (handlers) => Effect.gen(function* () {
18
18
  const global = yield* Global.Service;
19
19
  const locations = yield* LocationServiceMap.Service;