@opencode/server 0.0.0-dev-1298 → 0.0.0-dev-1301

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 (121) hide show
  1. package/dist/api.js +5 -5
  2. package/dist/auth.js +1 -1
  3. package/dist/chunks/{media-uri-059rbh9c.js → api-059rbh9c.js} +1 -1
  4. package/dist/chunks/{media-uri-370cpmna.js → api-0a5jm2na.js} +2 -2
  5. package/dist/chunks/{media-uri-5553qfcy.js → api-0n1e9dnh.js} +3 -3
  6. package/dist/chunks/{media-uri-vvp99hc9.js → api-1je14sn4.js} +1 -1
  7. package/dist/chunks/{media-uri-rxyx8sa0.js → api-22wspztn.js} +2 -2
  8. package/dist/chunks/{media-uri-zgvwy66h.js → api-27hs38qv.js} +3 -3
  9. package/dist/chunks/{media-uri-4z8yg1dv.js → api-34xzc0ha.js} +4 -4
  10. package/dist/chunks/{media-uri-zds85vps.js → api-41yet3w7.js} +1 -1
  11. package/dist/chunks/{media-uri-1vxxxmgg.js → api-452na7zm.js} +2 -2
  12. package/dist/chunks/{media-uri-agenqygg.js → api-4vqvqsgg.js} +2 -2
  13. package/dist/chunks/{media-uri-zeatgpjd.js → api-595kch50.js} +8 -8
  14. package/dist/chunks/{media-uri-xbqm7mpj.js → api-6vs5sqy6.js} +2 -2
  15. package/dist/chunks/{media-uri-78rcgzsr.js → api-78rcgzsr.js} +1 -1
  16. package/dist/chunks/{media-uri-7b9xm1qg.js → api-7b9xm1qg.js} +1 -1
  17. package/dist/chunks/{media-uri-r2veymj8.js → api-84dqjc6j.js} +4 -4
  18. package/dist/chunks/{media-uri-r5696se6.js → api-9c4eyh8m.js} +3 -3
  19. package/dist/chunks/{media-uri-jqvq1ywe.js → api-b0sezs8j.js} +2 -2
  20. package/dist/chunks/{media-uri-0e4fm4yw.js → api-b2k9041j.js} +1 -1
  21. package/dist/chunks/{media-uri-wqv43pj9.js → api-c6sjpm0r.js} +2 -2
  22. package/dist/chunks/{media-uri-djr0jy89.js → api-djr0jy89.js} +1 -1
  23. package/dist/chunks/{media-uri-zmgfywqd.js → api-dk68ymtv.js} +1 -1
  24. package/dist/chunks/{media-uri-7cd61xtm.js → api-e46y0tfd.js} +2 -2
  25. package/dist/chunks/{media-uri-39nnfjx1.js → api-e6e4kz0w.js} +4 -4
  26. package/dist/chunks/{media-uri-qsfn57wq.js → api-e9906t2e.js} +4 -4
  27. package/dist/chunks/{media-uri-gk0yxcp6.js → api-gk0yxcp6.js} +1 -1
  28. package/dist/chunks/{media-uri-gqq6kfhc.js → api-gqq6kfhc.js} +1 -1
  29. package/dist/chunks/{media-uri-74kxthdf.js → api-h072q2hm.js} +1 -1
  30. package/dist/chunks/{media-uri-vtfzy3at.js → api-hax1v4bv.js} +2 -2
  31. package/dist/chunks/{media-uri-j4at0y5c.js → api-j4at0y5c.js} +1 -1
  32. package/dist/chunks/{media-uri-7x1re4zg.js → api-m5rae7m4.js} +2 -2
  33. package/dist/chunks/{media-uri-dfxfd950.js → api-mmvhrf5s.js} +4 -4
  34. package/dist/chunks/{media-uri-myqk22k5.js → api-myqk22k5.js} +2 -2
  35. package/dist/chunks/api-n26yr6pw.js +21 -0
  36. package/dist/chunks/{media-uri-p3f060n2.js → api-np3ws677.js} +2 -2
  37. package/dist/chunks/{media-uri-50xc6x42.js → api-ppma8fcc.js} +3 -3
  38. package/dist/chunks/{media-uri-gad4te90.js → api-ppqp5pr2.js} +35 -35
  39. package/dist/chunks/{media-uri-e7j57s3r.js → api-q93ntzen.js} +7 -7
  40. package/dist/chunks/{media-uri-sqxx1p54.js → api-qn8kkfq6.js} +2 -2
  41. package/dist/chunks/{media-uri-wh109kze.js → api-qs427q2r.js} +8 -8
  42. package/dist/chunks/{media-uri-amndpc82.js → api-r3h1014p.js} +2 -2
  43. package/dist/chunks/{media-uri-t32e1bbt.js → api-t32e1bbt.js} +1 -1
  44. package/dist/chunks/{media-uri-b65096pt.js → api-vhwcrt1z.js} +17 -14
  45. package/dist/chunks/{media-uri-w5yp0ga8.js → api-w5yp0ga8.js} +2 -2
  46. package/dist/chunks/{media-uri-kqr36gas.js → api-w9jcwh65.js} +7 -7
  47. package/dist/chunks/{media-uri-3p9jwgak.js → api-wecgp61r.js} +7 -7
  48. package/dist/chunks/{media-uri-2835150m.js → api-wxj3d9av.js} +2 -2
  49. package/dist/chunks/{media-uri-jc2vwkyw.js → api-x8dgc261.js} +2 -2
  50. package/dist/chunks/{media-uri-yet0vexm.js → api-yet0vexm.js} +1 -1
  51. package/dist/chunks/{media-uri-skcryrty.js → api-yr4wsvrw.js} +2 -2
  52. package/dist/chunks/{media-uri-7dtbad8d.js → api-z3e7v67k.js} +7 -7
  53. package/dist/chunks/{media-uri-xpg37vzc.js → api-z59gyc0x.js} +2 -2
  54. package/dist/chunks/{media-uri-rcmctvp9.js → api-z7gkfgax.js} +1 -1
  55. package/dist/content-headers.js +1 -1
  56. package/dist/cors.js +1 -1
  57. package/dist/event-feed.js +5 -5
  58. package/dist/fetch.js +59 -58
  59. package/dist/handlers/agent.js +6 -6
  60. package/dist/handlers/artifact.js +3 -3
  61. package/dist/handlers/command.js +6 -6
  62. package/dist/handlers/config.js +6 -6
  63. package/dist/handlers/credential.js +7 -7
  64. package/dist/handlers/debug.js +6 -6
  65. package/dist/handlers/event.js +7 -7
  66. package/dist/handlers/form.js +6 -6
  67. package/dist/handlers/fs.js +7 -7
  68. package/dist/handlers/generate.js +6 -6
  69. package/dist/handlers/integration.js +6 -6
  70. package/dist/handlers/job.js +2 -2
  71. package/dist/handlers/location.js +6 -6
  72. package/dist/handlers/mcp.js +8 -8
  73. package/dist/handlers/media.js +2 -2
  74. package/dist/handlers/message.js +7 -7
  75. package/dist/handlers/migration.js +6 -6
  76. package/dist/handlers/model.js +6 -6
  77. package/dist/handlers/permission.js +6 -6
  78. package/dist/handlers/persistent-pty.js +13 -13
  79. package/dist/handlers/plugin.js +6 -6
  80. package/dist/handlers/project.js +6 -6
  81. package/dist/handlers/provider.js +6 -6
  82. package/dist/handlers/pty-socket.js +1 -1
  83. package/dist/handlers/pty.js +8 -8
  84. package/dist/handlers/reference.js +6 -6
  85. package/dist/handlers/rpc.js +6 -6
  86. package/dist/handlers/schedule.js +2 -2
  87. package/dist/handlers/server.js +9 -9
  88. package/dist/handlers/session-error.js +1 -1
  89. package/dist/handlers/session.js +7 -7
  90. package/dist/handlers/shell.js +6 -6
  91. package/dist/handlers/skill.js +6 -6
  92. package/dist/handlers/usage.js +6 -6
  93. package/dist/handlers/vcs.js +6 -6
  94. package/dist/handlers/voice.js +6 -6
  95. package/dist/handlers/websearch.js +6 -6
  96. package/dist/handlers/worktree.js +6 -6
  97. package/dist/handlers.js +50 -50
  98. package/dist/location.js +2 -2
  99. package/dist/media-uri.js +1 -1
  100. package/dist/middleware/authorization.js +2 -2
  101. package/dist/middleware/defect-response.d.ts +2 -0
  102. package/dist/middleware/defect-response.js +6 -0
  103. package/dist/middleware/form-location.js +3 -3
  104. package/dist/middleware/schema-error.js +1 -1
  105. package/dist/middleware/session-location.js +3 -3
  106. package/dist/pairing.js +3 -3
  107. package/dist/process.js +60 -59
  108. package/dist/request-site.js +2 -2
  109. package/dist/request-tracing.js +1 -1
  110. package/dist/routes.js +54 -53
  111. package/dist/server-info.js +5 -5
  112. package/dist/service-status.js +3 -3
  113. package/dist/workerd.js +60 -59
  114. package/package.json +8 -8
  115. /package/dist/chunks/{media-uri-9rqn6x4v.js → api-9rqn6x4v.js} +0 -0
  116. /package/dist/chunks/{media-uri-bd8755ek.js → api-bd8755ek.js} +0 -0
  117. /package/dist/chunks/{media-uri-q187pxxd.js → api-q187pxxd.js} +0 -0
  118. /package/dist/chunks/{media-uri-q4bn6dy8.js → api-q4bn6dy8.js} +0 -0
  119. /package/dist/chunks/{media-uri-smaf4a18.js → api-smaf4a18.js} +0 -0
  120. /package/dist/chunks/{media-uri-xthc02cw.js → api-xthc02cw.js} +0 -0
  121. /package/dist/chunks/{media-uri-yc7nft6q.js → api-yc7nft6q.js} +0 -0
package/dist/api.js CHANGED
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  Api2
3
- } from "./chunks/media-uri-r5696se6.js";
4
- import"./chunks/media-uri-gk0yxcp6.js";
5
- import"./chunks/media-uri-yet0vexm.js";
6
- import"./chunks/media-uri-gqq6kfhc.js";
7
- import"./chunks/media-uri-smaf4a18.js";
3
+ } from "./chunks/api-9c4eyh8m.js";
4
+ import"./chunks/api-yet0vexm.js";
5
+ import"./chunks/api-gk0yxcp6.js";
6
+ import"./chunks/api-gqq6kfhc.js";
7
+ import"./chunks/api-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/media-uri-j4at0y5c.js";
10
+ } from "./chunks/api-j4at0y5c.js";
11
11
  export {
12
12
  Config2 as Config,
13
13
  SESSION_TTL_SECONDS2 as SESSION_TTL_SECONDS,
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  missingSession2
3
- } from "./media-uri-smaf4a18.js";
3
+ } from "./api-smaf4a18.js";
4
4
 
5
5
  // src/handlers/schedule.ts
6
6
  import { Permission } from "@opencode/core/permission";
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  awaitPlugins2,
3
3
  response2
4
- } from "./media-uri-gqq6kfhc.js";
4
+ } from "./api-gqq6kfhc.js";
5
5
  import {
6
6
  Api2
7
- } from "./media-uri-r5696se6.js";
7
+ } from "./api-9c4eyh8m.js";
8
8
 
9
9
  // src/handlers/model.ts
10
10
  import { Model } from "@opencode/core/model";
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  missingSession2,
3
3
  failedMessageDecode2
4
- } from "./media-uri-smaf4a18.js";
4
+ } from "./api-smaf4a18.js";
5
5
  import {
6
6
  Api2
7
- } from "./media-uri-r5696se6.js";
7
+ } from "./api-9c4eyh8m.js";
8
8
  import {
9
9
  wantsMediaRefs2
10
- } from "./media-uri-xthc02cw.js";
10
+ } from "./api-xthc02cw.js";
11
11
 
12
12
  // src/handlers/message.ts
13
13
  import { SessionMessage } from "@opencode/core/session/message";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  Api2
3
- } from "./media-uri-r5696se6.js";
3
+ } from "./api-9c4eyh8m.js";
4
4
 
5
5
  // src/handlers/migration.ts
6
6
  import { V1Migration } from "@opencode/core/database/v1-migration";
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  response2
3
- } from "./media-uri-gqq6kfhc.js";
3
+ } from "./api-gqq6kfhc.js";
4
4
  import {
5
5
  Api2
6
- } from "./media-uri-r5696se6.js";
6
+ } from "./api-9c4eyh8m.js";
7
7
 
8
8
  // src/handlers/shell.ts
9
9
  import { Shell } from "@opencode/core/shell";
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  response2
3
- } from "./media-uri-gqq6kfhc.js";
3
+ } from "./api-gqq6kfhc.js";
4
4
  import {
5
5
  Api2
6
- } from "./media-uri-r5696se6.js";
6
+ } from "./api-9c4eyh8m.js";
7
7
  import {
8
8
  download2
9
- } from "./media-uri-t32e1bbt.js";
9
+ } from "./api-t32e1bbt.js";
10
10
 
11
11
  // src/handlers/fs.ts
12
12
  import { FileSystem } from "@opencode/core/filesystem";
@@ -2,18 +2,18 @@ import {
2
2
  locationErrors2,
3
3
  response2,
4
4
  requestRef2
5
- } from "./media-uri-gqq6kfhc.js";
5
+ } from "./api-gqq6kfhc.js";
6
6
  import {
7
7
  Api2
8
- } from "./media-uri-r5696se6.js";
8
+ } from "./api-9c4eyh8m.js";
9
9
  import {
10
10
  CorsConfig2,
11
11
  isAllowedRequestOrigin2
12
- } from "./media-uri-q4bn6dy8.js";
12
+ } from "./api-q4bn6dy8.js";
13
13
  import {
14
14
  runPtySocket2,
15
15
  holdLocation2
16
- } from "./media-uri-q187pxxd.js";
16
+ } from "./api-q187pxxd.js";
17
17
 
18
18
  // src/handlers/mcp.ts
19
19
  import { Location } from "@opencode/core/location";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  Api2
3
- } from "./media-uri-r5696se6.js";
3
+ } from "./api-9c4eyh8m.js";
4
4
 
5
5
  // src/handlers/worktree.ts
6
6
  import { Git } from "@opencode/core/git";
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  Api2
3
- } from "./media-uri-r5696se6.js";
3
+ } from "./api-9c4eyh8m.js";
4
4
  import {
5
5
  requireConnectable2
6
- } from "./media-uri-amndpc82.js";
6
+ } from "./api-r3h1014p.js";
7
7
 
8
8
  // src/handlers/credential.ts
9
9
  import { Credential } from "@opencode/core/credential";
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  response2
3
- } from "./media-uri-gqq6kfhc.js";
3
+ } from "./api-gqq6kfhc.js";
4
4
  import {
5
5
  Api2
6
- } from "./media-uri-r5696se6.js";
6
+ } from "./api-9c4eyh8m.js";
7
7
 
8
8
  // src/handlers/vcs.ts
9
9
  import { Vcs } from "@opencode/core/vcs";
@@ -1,32 +1,32 @@
1
1
  import {
2
2
  isAllowedCorsOrigin2
3
- } from "./media-uri-q4bn6dy8.js";
3
+ } from "./api-q4bn6dy8.js";
4
4
  import {
5
5
  middleware2
6
- } from "./media-uri-myqk22k5.js";
6
+ } from "./api-myqk22k5.js";
7
7
  import {
8
8
  withoutParentSpan2
9
- } from "./media-uri-yc7nft6q.js";
9
+ } from "./api-yc7nft6q.js";
10
10
  import {
11
11
  createRoutes2
12
- } from "./media-uri-b65096pt.js";
12
+ } from "./api-vhwcrt1z.js";
13
13
  import {
14
14
  __export
15
- } from "./media-uri-9rqn6x4v.js";
15
+ } from "./api-9rqn6x4v.js";
16
16
 
17
17
  // src/fetch.ts
18
18
  var exports_fetch = {};
19
19
  __export(exports_fetch, {
20
20
  ServerFetch: () => exports_fetch,
21
- make: () => make3
21
+ make: () => make2
22
22
  });
23
23
  import { Context, Effect, Layer } from "effect";
24
24
  import { HttpEffect, HttpMiddleware, HttpRouter, HttpServer } from "effect/http";
25
25
  import { SessionRestart } from "@opencode/core/session/execution/restart";
26
- var make3 = Effect.fn("ServerFetch.make")(function* (options = {}, boot = {}) {
26
+ var make2 = Effect.fn("ServerFetch.make")(function* (options = {}, boot = {}) {
27
27
  const context = yield* Layer.build(createRoutes2(options, () => [], boot.overrides ?? []).pipe(Layer.provide(HttpServer.layerServices))).pipe(withoutParentSpan2);
28
28
  yield* Effect.forkDetach(Context.get(context, SessionRestart.Service).resumeSuspendedSessions);
29
29
  return Context.get(context, HttpRouter.HttpRouter).asHttpEffect().pipe(middleware2(options), HttpMiddleware.cors({ allowedOrigins: (origin) => isAllowedCorsOrigin2(origin, options), maxAge: 86400 }), HttpEffect.toWebHandlerWith(context));
30
30
  });
31
31
 
32
- export { make3, exports_fetch };
32
+ export { make2, exports_fetch };
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  response2
3
- } from "./media-uri-gqq6kfhc.js";
3
+ } from "./api-gqq6kfhc.js";
4
4
  import {
5
5
  Api2
6
- } from "./media-uri-r5696se6.js";
6
+ } from "./api-9c4eyh8m.js";
7
7
 
8
8
  // src/handlers/skill.ts
9
9
  import { Skill } from "@opencode/core/skill";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  missingSession2
3
- } from "./media-uri-smaf4a18.js";
3
+ } from "./api-smaf4a18.js";
4
4
 
5
5
  // src/handlers/job.ts
6
6
  import { Job } from "@opencode/core/job";
@@ -4,7 +4,7 @@ import {
4
4
  authorized2,
5
5
  verifySession2,
6
6
  sessionCookieName2
7
- } from "./media-uri-j4at0y5c.js";
7
+ } from "./api-j4at0y5c.js";
8
8
 
9
9
  // src/middleware/authorization.ts
10
10
  import { UnauthorizedError } from "@opencode/protocol/errors";
@@ -2,18 +2,18 @@ import {
2
2
  locationErrors2,
3
3
  response2,
4
4
  requestRef2
5
- } from "./media-uri-gqq6kfhc.js";
5
+ } from "./api-gqq6kfhc.js";
6
6
  import {
7
7
  Api2
8
- } from "./media-uri-r5696se6.js";
8
+ } from "./api-9c4eyh8m.js";
9
9
  import {
10
10
  CorsConfig2,
11
11
  isAllowedRequestOrigin2
12
- } from "./media-uri-q4bn6dy8.js";
12
+ } from "./api-q4bn6dy8.js";
13
13
  import {
14
14
  runPtySocket2,
15
15
  holdLocation2
16
- } from "./media-uri-q187pxxd.js";
16
+ } from "./api-q187pxxd.js";
17
17
 
18
18
  // src/handlers/pty.ts
19
19
  import { Pty } from "@opencode/core/pty";
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  LocationMiddleware2
3
- } from "./media-uri-gqq6kfhc.js";
3
+ } from "./api-gqq6kfhc.js";
4
4
  import {
5
5
  FormLocationMiddleware2
6
- } from "./media-uri-gk0yxcp6.js";
6
+ } from "./api-gk0yxcp6.js";
7
7
  import {
8
8
  SessionLocationMiddleware2
9
- } from "./media-uri-yet0vexm.js";
9
+ } from "./api-yet0vexm.js";
10
10
 
11
11
  // src/api.ts
12
12
  import { makeDefaultApi } from "@opencode/protocol/api";
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  response2
3
- } from "./media-uri-gqq6kfhc.js";
3
+ } from "./api-gqq6kfhc.js";
4
4
  import {
5
5
  Api2
6
- } from "./media-uri-r5696se6.js";
6
+ } from "./api-9c4eyh8m.js";
7
7
 
8
8
  // src/handlers/usage.ts
9
9
  import { UsageLimits } from "@opencode/core/usage-limits";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  Api2
3
- } from "./media-uri-r5696se6.js";
3
+ } from "./api-9c4eyh8m.js";
4
4
 
5
5
  // src/handlers/config.ts
6
6
  import { Config } from "@opencode/core/config";
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  locationErrors2,
3
3
  awaitPlugins2
4
- } from "./media-uri-gqq6kfhc.js";
4
+ } from "./api-gqq6kfhc.js";
5
5
  import {
6
6
  Api2
7
- } from "./media-uri-r5696se6.js";
7
+ } from "./api-9c4eyh8m.js";
8
8
 
9
9
  // src/handlers/generate.ts
10
10
  import { Generate } from "@opencode/core/generate";
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  CONTENT_SECURITY_POLICY2,
3
3
  disposition2
4
- } from "./media-uri-t32e1bbt.js";
4
+ } from "./api-t32e1bbt.js";
5
5
 
6
6
  // src/handlers/media.ts
7
7
  import { Database } from "@opencode/core/database/database";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  Api2
3
- } from "./media-uri-r5696se6.js";
3
+ } from "./api-9c4eyh8m.js";
4
4
 
5
5
  // src/handlers/project.ts
6
6
  import { Project } from "@opencode/core/project";
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  awaitPlugins2,
3
3
  response2
4
- } from "./media-uri-gqq6kfhc.js";
4
+ } from "./api-gqq6kfhc.js";
5
5
  import {
6
6
  Api2
7
- } from "./media-uri-r5696se6.js";
7
+ } from "./api-9c4eyh8m.js";
8
8
 
9
9
  // src/handlers/websearch.ts
10
10
  import { WebSearch } from "@opencode/core/websearch";
@@ -1,15 +1,15 @@
1
1
  import {
2
2
  __export
3
- } from "./media-uri-9rqn6x4v.js";
3
+ } from "./api-9rqn6x4v.js";
4
4
 
5
5
  // src/service-status.ts
6
6
  var exports_service_status = {};
7
7
  __export(exports_service_status, {
8
8
  Status: () => exports_service_status,
9
- make: () => make2
9
+ make: () => make3
10
10
  });
11
11
  import { Effect, Ref } from "effect";
12
- var make2 = Effect.fnUntraced(function* (options = {}) {
12
+ var make3 = Effect.fnUntraced(function* (options = {}) {
13
13
  const current = yield* Ref.make(options.initial ?? { type: "starting" });
14
14
  const beginStopping = Ref.update(current, (status) => status.type === "stopping" ? status : { type: "stopping" });
15
15
  return {
@@ -20,4 +20,4 @@ var make2 = Effect.fnUntraced(function* (options = {}) {
20
20
  };
21
21
  });
22
22
 
23
- export { make2, exports_service_status };
23
+ export { make3, exports_service_status };
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  Api2
3
- } from "./media-uri-r5696se6.js";
3
+ } from "./api-9c4eyh8m.js";
4
4
  import {
5
- Service3,
5
+ Service4,
6
6
  frame2
7
- } from "./media-uri-3p9jwgak.js";
7
+ } from "./api-wecgp61r.js";
8
8
 
9
9
  // src/handlers/event.ts
10
10
  import { Event } from "@opencode/schema/event";
@@ -12,7 +12,7 @@ import { Effect, Stream } from "effect";
12
12
  import { HttpServerResponse } from "effect/http";
13
13
  import { HttpApiBuilder } from "effect/http-api";
14
14
  var EventHandler2 = HttpApiBuilder.group(Api2, "server.event", (handlers) => Effect.gen(function* () {
15
- const feed = yield* Service3;
15
+ const feed = yield* Service4;
16
16
  return handlers.handleRaw("event.subscribe", (ctx) => Effect.gen(function* () {
17
17
  const connected = {
18
18
  id: Event.ID.create(),
@@ -2,7 +2,7 @@ import {
2
2
  locationErrors2,
3
3
  sessionInfo2,
4
4
  requestRef2
5
- } from "./media-uri-gqq6kfhc.js";
5
+ } from "./api-gqq6kfhc.js";
6
6
 
7
7
  // src/middleware/form-location.ts
8
8
  import { Instance } from "@opencode/core/instance/service";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  missingSession2
3
- } from "./media-uri-smaf4a18.js";
3
+ } from "./api-smaf4a18.js";
4
4
 
5
5
  // src/location.ts
6
6
  import { FileSystem } from "@opencode/core/filesystem";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  Api2
3
- } from "./media-uri-r5696se6.js";
3
+ } from "./api-9c4eyh8m.js";
4
4
 
5
5
  // src/handlers/location.ts
6
6
  import { Location } from "@opencode/core/location";
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  awaitPlugins2,
3
3
  response2
4
- } from "./media-uri-gqq6kfhc.js";
4
+ } from "./api-gqq6kfhc.js";
5
5
  import {
6
6
  Api2
7
- } from "./media-uri-r5696se6.js";
7
+ } from "./api-9c4eyh8m.js";
8
8
 
9
9
  // src/handlers/provider.ts
10
10
  import { Provider } from "@opencode/core/provider";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  __export
3
- } from "./media-uri-9rqn6x4v.js";
3
+ } from "./api-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 "./media-uri-gqq6kfhc.js";
3
+ } from "./api-gqq6kfhc.js";
4
4
  import {
5
5
  Api2
6
- } from "./media-uri-r5696se6.js";
6
+ } from "./api-9c4eyh8m.js";
7
7
 
8
8
  // src/handlers/form.ts
9
9
  import { Form } from "@opencode/core/form";
@@ -3,16 +3,16 @@ import {
3
3
  missingMessage2,
4
4
  failedMessageDecode2,
5
5
  failedSnapshot2
6
- } from "./media-uri-smaf4a18.js";
6
+ } from "./api-smaf4a18.js";
7
7
  import {
8
8
  locationErrors2
9
- } from "./media-uri-gqq6kfhc.js";
9
+ } from "./api-gqq6kfhc.js";
10
10
  import {
11
11
  Api2
12
- } from "./media-uri-r5696se6.js";
12
+ } from "./api-9c4eyh8m.js";
13
13
  import {
14
14
  wantsMediaRefs2
15
- } from "./media-uri-xthc02cw.js";
15
+ } from "./api-xthc02cw.js";
16
16
 
17
17
  // src/handlers/session.ts
18
18
  import { Instance } from "@opencode/core/instance/service";
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  isAllowedRequestOrigin2
3
- } from "./media-uri-q4bn6dy8.js";
3
+ } from "./api-q4bn6dy8.js";
4
4
  import {
5
5
  __export
6
- } from "./media-uri-9rqn6x4v.js";
6
+ } from "./api-9rqn6x4v.js";
7
7
 
8
8
  // src/request-site.ts
9
9
  var exports_request_site = {};
@@ -0,0 +1,21 @@
1
+ // src/middleware/defect-response.ts
2
+ import { StorageFailure } from "@opencode/core/database/storage-failure";
3
+ import { UnknownError } from "@opencode/protocol/errors";
4
+ import { Cause, Effect } from "effect";
5
+ import { HttpRouter, HttpServerError, HttpServerRequest, HttpServerResponse } from "effect/http";
6
+ var respond = HttpServerResponse.schemaJson(UnknownError);
7
+ var defectResponseLayer2 = HttpRouter.middleware((effect) => effect.pipe(Effect.catchCause((cause) => Effect.gen(function* () {
8
+ const [response] = yield* HttpServerError.causeResponse(cause);
9
+ if (response.status !== 500 || response.body._tag !== "Empty")
10
+ return yield* Effect.failCause(cause);
11
+ const request = yield* HttpServerRequest.HttpServerRequest;
12
+ const ref = `err_${crypto.randomUUID().slice(0, 8)}`;
13
+ yield* Effect.logError("request failed", cause).pipe(Effect.annotateLogs({ ref, route: `${request.method} ${request.url}` }));
14
+ const body = yield* respond(new UnknownError({
15
+ message: StorageFailure.message(cause) ?? "Server failed to handle the request. Check server logs for details.",
16
+ ref
17
+ }), { status: 500 }).pipe(Effect.orDie);
18
+ return yield* Effect.failCause(Cause.combine(cause, Cause.die(body)));
19
+ }))), { global: true });
20
+
21
+ export { defectResponseLayer2 };
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  response2
3
- } from "./media-uri-gqq6kfhc.js";
3
+ } from "./api-gqq6kfhc.js";
4
4
  import {
5
5
  Api2
6
- } from "./media-uri-r5696se6.js";
6
+ } from "./api-9c4eyh8m.js";
7
7
 
8
8
  // src/handlers/agent.ts
9
9
  import { Agent } from "@opencode/core/agent";
@@ -1,14 +1,14 @@
1
1
  import {
2
2
  missingSession2
3
- } from "./media-uri-smaf4a18.js";
3
+ } from "./api-smaf4a18.js";
4
4
  import {
5
5
  locationErrors2,
6
6
  response2,
7
7
  sessionInfo2
8
- } from "./media-uri-gqq6kfhc.js";
8
+ } from "./api-gqq6kfhc.js";
9
9
  import {
10
10
  Api2
11
- } from "./media-uri-r5696se6.js";
11
+ } from "./api-9c4eyh8m.js";
12
12
 
13
13
  // src/handlers/permission.ts
14
14
  import { Instance } from "@opencode/core/instance/service";