@opencode/server 2.3.0 → 2.3.1

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 (141) hide show
  1. package/dist/api.js +5 -5
  2. package/dist/auth.js +1 -1
  3. package/dist/chunks/{auth-a8jcac9a.js → request-tracing-05c5061t.js} +1 -1
  4. package/dist/chunks/{auth-j87xz9bt.js → request-tracing-0e81et3m.js} +3 -3
  5. package/dist/chunks/{auth-6jfbq4sw.js → request-tracing-0gf4dfn8.js} +33 -33
  6. package/dist/chunks/{auth-91858wp1.js → request-tracing-2pbbrzpp.js} +2 -2
  7. package/dist/chunks/{auth-e6e4kz0w.js → request-tracing-39nnfjx1.js} +4 -4
  8. package/dist/chunks/{auth-yjbzmfhm.js → request-tracing-3te71694.js} +5 -5
  9. package/dist/chunks/{auth-09kw3a77.js → request-tracing-4ed680xg.js} +2 -2
  10. package/dist/chunks/{auth-rha2aq18.js → request-tracing-4p2y0qs3.js} +2 -2
  11. package/dist/chunks/{auth-50bbk3b2.js → request-tracing-50bbk3b2.js} +1 -1
  12. package/dist/chunks/{auth-78rcgzsr.js → request-tracing-78rcgzsr.js} +1 -1
  13. package/dist/chunks/{auth-7b9xm1qg.js → request-tracing-7b9xm1qg.js} +1 -1
  14. package/dist/chunks/{auth-n1423xpw.js → request-tracing-7nb2rv11.js} +4 -4
  15. package/dist/chunks/{auth-enp1bp7r.js → request-tracing-861wfsmy.js} +1 -1
  16. package/dist/chunks/request-tracing-8sb6qqpn.js +28 -0
  17. package/dist/chunks/request-tracing-9cd3a4b8.js +69 -0
  18. package/dist/chunks/{auth-az0609r6.js → request-tracing-9grnt8dc.js} +2 -2
  19. package/dist/chunks/{auth-5s0wnsg4.js → request-tracing-ap1t95t8.js} +3 -3
  20. package/dist/chunks/{auth-yqhefp4s.js → request-tracing-ayveq98d.js} +23 -3
  21. package/dist/chunks/{auth-b3bmdkga.js → request-tracing-b3bmdkga.js} +1 -1
  22. package/dist/chunks/{auth-4q6e7fh8.js → request-tracing-b4mqtccx.js} +2 -2
  23. package/dist/chunks/{auth-z9zyd4qg.js → request-tracing-d4534456.js} +4 -4
  24. package/dist/chunks/{auth-5cpb32hf.js → request-tracing-d8b9pm2q.js} +1 -1
  25. package/dist/chunks/{auth-8mj7kvhm.js → request-tracing-dezpcckc.js} +2 -2
  26. package/dist/chunks/{auth-djr0jy89.js → request-tracing-djr0jy89.js} +1 -1
  27. package/dist/chunks/{auth-kkdkqt8j.js → request-tracing-dx89xydc.js} +2 -2
  28. package/dist/chunks/{auth-d0edqfxx.js → request-tracing-et00mhwf.js} +2 -2
  29. package/dist/chunks/{auth-qd0r787n.js → request-tracing-f8r9p2vr.js} +2 -2
  30. package/dist/chunks/{auth-3p9jwgak.js → request-tracing-fvpjvjpp.js} +6 -6
  31. package/dist/chunks/{auth-a4mwssda.js → request-tracing-g6yhb3a8.js} +15 -11
  32. package/dist/chunks/{auth-qcg3sqtb.js → request-tracing-h1thjy6x.js} +2 -2
  33. package/dist/chunks/{auth-rs3v36hp.js → request-tracing-h286a6py.js} +2 -2
  34. package/dist/chunks/{auth-htyf2qs7.js → request-tracing-htyf2qs7.js} +1 -1
  35. package/dist/chunks/{auth-cezwbsk5.js → request-tracing-hx8bsq9d.js} +1 -1
  36. package/dist/chunks/{auth-j4at0y5c.js → request-tracing-j4at0y5c.js} +1 -1
  37. package/dist/chunks/{auth-6kawhtwy.js → request-tracing-jjvpqmx6.js} +4 -4
  38. package/dist/chunks/{auth-btahnm2b.js → request-tracing-kg0ybx4v.js} +3 -3
  39. package/dist/chunks/{auth-myqk22k5.js → request-tracing-myqk22k5.js} +2 -2
  40. package/dist/chunks/{auth-kqr36gas.js → request-tracing-mzs0n5xz.js} +7 -7
  41. package/dist/chunks/request-tracing-n26yr6pw.js +21 -0
  42. package/dist/chunks/{auth-pab2cyby.js → request-tracing-n5et0xgm.js} +8 -8
  43. package/dist/chunks/{auth-p86kew8c.js → request-tracing-p86kew8c.js} +2 -2
  44. package/dist/chunks/{auth-ny1j968n.js → request-tracing-q44yktpv.js} +2 -2
  45. package/dist/chunks/{auth-bm3bken1.js → request-tracing-r7knxm63.js} +7 -20
  46. package/dist/chunks/{auth-gyryr0mf.js → request-tracing-rd9e3qfx.js} +4 -4
  47. package/dist/chunks/{auth-te8jwba1.js → request-tracing-s9tkswmw.js} +2 -2
  48. package/dist/chunks/request-tracing-sy2e93cn.js +46 -0
  49. package/dist/chunks/{auth-t32e1bbt.js → request-tracing-t32e1bbt.js} +1 -1
  50. package/dist/chunks/{auth-yk755swr.js → request-tracing-tk56ffsq.js} +2 -2
  51. package/dist/chunks/{auth-etdgpyr8.js → request-tracing-v0r38a4t.js} +25 -15
  52. package/dist/chunks/{auth-f559fakr.js → request-tracing-v8aqacn3.js} +2 -2
  53. package/dist/chunks/{auth-2eaky32g.js → request-tracing-vbgqk0mr.js} +2 -2
  54. package/dist/chunks/{auth-6z9pvq7p.js → request-tracing-x4b2rtcb.js} +1 -1
  55. package/dist/chunks/{auth-zkya65ny.js → request-tracing-z2ndp6vh.js} +8 -8
  56. package/dist/chunks/{auth-zcvan105.js → request-tracing-zbe9jfhy.js} +1 -1
  57. package/dist/content-headers.js +1 -1
  58. package/dist/cors.js +1 -1
  59. package/dist/event-feed.js +3 -3
  60. package/dist/fetch.d.ts +3 -0
  61. package/dist/fetch.js +61 -58
  62. package/dist/handlers/agent.js +6 -6
  63. package/dist/handlers/artifact.js +3 -3
  64. package/dist/handlers/automation.d.ts +25 -0
  65. package/dist/handlers/automation.js +7 -0
  66. package/dist/handlers/blob.d.ts +7 -0
  67. package/dist/handlers/blob.js +8 -0
  68. package/dist/handlers/command.js +6 -6
  69. package/dist/handlers/config.js +6 -6
  70. package/dist/handlers/credential.js +7 -7
  71. package/dist/handlers/debug.js +6 -6
  72. package/dist/handlers/event.js +7 -7
  73. package/dist/handlers/form.js +6 -6
  74. package/dist/handlers/fs.js +8 -7
  75. package/dist/handlers/generate.d.ts +2 -1
  76. package/dist/handlers/generate.js +6 -6
  77. package/dist/handlers/integration.js +6 -6
  78. package/dist/handlers/job.d.ts +11 -1
  79. package/dist/handlers/job.js +2 -2
  80. package/dist/handlers/location.js +6 -6
  81. package/dist/handlers/mcp.js +8 -8
  82. package/dist/handlers/media.js +2 -2
  83. package/dist/handlers/message.js +7 -7
  84. package/dist/handlers/migration.js +6 -6
  85. package/dist/handlers/model.js +6 -6
  86. package/dist/handlers/permission.js +6 -6
  87. package/dist/handlers/persistent-pty.d.ts +1 -1
  88. package/dist/handlers/persistent-pty.js +15 -13
  89. package/dist/handlers/plugin.js +6 -6
  90. package/dist/handlers/project.js +6 -6
  91. package/dist/handlers/provider.js +6 -6
  92. package/dist/handlers/pty-socket.js +1 -1
  93. package/dist/handlers/pty.js +8 -8
  94. package/dist/handlers/reference.js +6 -6
  95. package/dist/handlers/rpc.js +6 -6
  96. package/dist/handlers/server.js +9 -9
  97. package/dist/handlers/session-error.js +1 -1
  98. package/dist/handlers/session.js +7 -7
  99. package/dist/handlers/shell.js +6 -6
  100. package/dist/handlers/skill.js +6 -6
  101. package/dist/handlers/usage.js +6 -6
  102. package/dist/handlers/vcs.js +6 -6
  103. package/dist/handlers/voice.js +6 -6
  104. package/dist/handlers/websearch.js +6 -6
  105. package/dist/handlers/worktree.js +6 -6
  106. package/dist/handlers.d.ts +1 -1
  107. package/dist/handlers.js +52 -50
  108. package/dist/location.js +2 -2
  109. package/dist/media-uri.js +1 -1
  110. package/dist/middleware/authorization.js +2 -2
  111. package/dist/middleware/defect-response.d.ts +2 -0
  112. package/dist/middleware/defect-response.js +6 -0
  113. package/dist/middleware/form-location.js +3 -3
  114. package/dist/middleware/schema-error.js +1 -1
  115. package/dist/middleware/session-location.js +3 -3
  116. package/dist/options.d.ts +3 -0
  117. package/dist/options.js +3 -0
  118. package/dist/pairing.js +3 -3
  119. package/dist/process.d.ts +3 -0
  120. package/dist/process.js +64 -61
  121. package/dist/range.d.ts +6 -0
  122. package/dist/range.js +8 -0
  123. package/dist/request-site.js +2 -2
  124. package/dist/request-tracing.js +1 -1
  125. package/dist/routes.d.ts +5 -3
  126. package/dist/routes.js +56 -53
  127. package/dist/server-info.js +3 -3
  128. package/dist/service-status.js +3 -3
  129. package/dist/workerd.d.ts +1 -0
  130. package/dist/workerd.js +66 -59
  131. package/package.json +9 -9
  132. package/dist/chunks/auth-059rbh9c.js +0 -43
  133. package/dist/handlers/schedule.d.ts +0 -314
  134. package/dist/handlers/schedule.js +0 -7
  135. /package/dist/chunks/{auth-9rqn6x4v.js → request-tracing-9rqn6x4v.js} +0 -0
  136. /package/dist/chunks/{auth-bd8755ek.js → request-tracing-bd8755ek.js} +0 -0
  137. /package/dist/chunks/{auth-q187pxxd.js → request-tracing-q187pxxd.js} +0 -0
  138. /package/dist/chunks/{auth-q4bn6dy8.js → request-tracing-q4bn6dy8.js} +0 -0
  139. /package/dist/chunks/{auth-smaf4a18.js → request-tracing-smaf4a18.js} +0 -0
  140. /package/dist/chunks/{auth-xthc02cw.js → request-tracing-xthc02cw.js} +0 -0
  141. /package/dist/chunks/{auth-yc7nft6q.js → request-tracing-yc7nft6q.js} +0 -0
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  response2
3
- } from "./auth-50bbk3b2.js";
3
+ } from "./request-tracing-50bbk3b2.js";
4
4
  import {
5
5
  Api2
6
- } from "./auth-j87xz9bt.js";
6
+ } from "./request-tracing-0e81et3m.js";
7
7
 
8
8
  // src/handlers/shell.ts
9
9
  import { Shell } from "@opencode/core/shell";
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  __export
3
- } from "./auth-9rqn6x4v.js";
3
+ } from "./request-tracing-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: () => Service3,
10
+ Service: () => Service2,
11
11
  SubscriberCapacity: () => SubscriberCapacity2,
12
12
  SubscriberOverflowError: () => SubscriberOverflowError2,
13
13
  frame: () => frame2,
@@ -30,7 +30,7 @@ class EncodingError2 extends Schema.TaggedError()("EventFeed.EncodingError", {
30
30
  }) {
31
31
  }
32
32
 
33
- class Service3 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)}
@@ -72,13 +72,13 @@ var make4 = Effect.fn("EventFeed.make")(function* (observe, options) {
72
72
  });
73
73
  const unsubscribe = yield* observe(publish);
74
74
  yield* Effect.addFinalizer(() => unsubscribe);
75
- return Service3.of({
75
+ return Service2.of({
76
76
  subscribe: (types) => Effect.acquireRelease(Queue.dropping(capacity).pipe(Effect.tap((queue) => Effect.sync(() => subscribers.set(queue, types?.length ? new Set(types) : undefined)))), (queue) => Effect.sync(() => subscribers.delete(queue)).pipe(Effect.andThen(Queue.shutdown(queue)), Effect.asVoid)).pipe(Effect.map(Stream.fromQueue))
77
77
  });
78
78
  });
79
- var layer2 = Layer.effect(Service3, Effect.gen(function* () {
79
+ var layer2 = Layer.effect(Service2, Effect.gen(function* () {
80
80
  const bus = yield* Bus.Service;
81
81
  return yield* make4(bus.listen);
82
82
  }));
83
83
 
84
- export { SubscriberCapacity2, SubscriberOverflowError2, EncodingError2, Service3, frame2, make4, layer2, exports_event_feed };
84
+ export { SubscriberCapacity2, SubscriberOverflowError2, EncodingError2, Service2, frame2, make4, layer2, exports_event_feed };
@@ -1,25 +1,28 @@
1
1
  import {
2
2
  Api2
3
- } from "./auth-j87xz9bt.js";
3
+ } from "./request-tracing-0e81et3m.js";
4
4
  import {
5
5
  CorsConfig2,
6
6
  isAllowedRequestOrigin2
7
- } from "./auth-q4bn6dy8.js";
7
+ } from "./request-tracing-q4bn6dy8.js";
8
8
  import {
9
9
  makeArtifact2
10
- } from "./auth-p86kew8c.js";
10
+ } from "./request-tracing-p86kew8c.js";
11
+ import {
12
+ makeBlobGet2
13
+ } from "./request-tracing-sy2e93cn.js";
14
+ import {
15
+ makeAutomation2
16
+ } from "./request-tracing-9cd3a4b8.js";
11
17
  import {
12
18
  makeJob2
13
- } from "./auth-78rcgzsr.js";
19
+ } from "./request-tracing-78rcgzsr.js";
14
20
  import {
15
21
  makeMediaGet2
16
- } from "./auth-djr0jy89.js";
22
+ } from "./request-tracing-djr0jy89.js";
17
23
  import {
18
24
  runPtySocket2
19
- } from "./auth-q187pxxd.js";
20
- import {
21
- makeSchedule2
22
- } from "./auth-059rbh9c.js";
25
+ } from "./request-tracing-q187pxxd.js";
23
26
 
24
27
  // src/handlers/persistent-pty.ts
25
28
  import { PersistentPty } from "@opencode/core/persistent-pty";
@@ -46,8 +49,9 @@ var PersistentPtyHandler2 = HttpApiBuilder.group(Api2, "server.experimental", (h
46
49
  const artifact = yield* makeArtifact2;
47
50
  const job = yield* makeJob2;
48
51
  const mediaGet = yield* makeMediaGet2;
49
- const schedule = yield* makeSchedule2;
50
- return handlers.handleRaw("media.get", (ctx) => mediaGet(ctx.params.hash, ctx.request)).handle("job.list", (ctx) => job.list(ctx.query)).handle("artifacts.providers", (ctx) => artifact.providers(ctx.query, ctx.request)).handle("artifacts.list", (ctx) => artifact.list(ctx.query, ctx.request)).handle("artifacts.create", (ctx) => artifact.create(ctx.query, ctx.payload, ctx.request)).handle("artifacts.get", (ctx) => artifact.get(ctx.params.artifactID, ctx.query, ctx.request)).handle("artifacts.update", (ctx) => artifact.update(ctx.params.artifactID, ctx.query, ctx.payload, ctx.request)).handle("artifacts.delete", (ctx) => artifact.remove(ctx.params.artifactID, ctx.query, ctx.request)).handleRaw("artifacts.view", (ctx) => artifact.view(ctx.params.artifactID, ctx.query, ctx.request)).handle("schedule.create", (ctx) => schedule.create(ctx.payload)).handle("schedule.list", (ctx) => schedule.list(ctx.query.sessionID)).handle("schedule.get", (ctx) => schedule.get(ctx.params.scheduleID)).handle("schedule.pause", (ctx) => schedule.pause(ctx.params.scheduleID)).handle("schedule.resume", (ctx) => schedule.resume(ctx.params.scheduleID)).handle("schedule.delete", (ctx) => schedule.remove(ctx.params.scheduleID)).handle("persistentPty.read", Effect.fn(function* (ctx) {
52
+ const blobGet = yield* makeBlobGet2;
53
+ const automation = yield* makeAutomation2;
54
+ return handlers.handleRaw("media.get", (ctx) => mediaGet(ctx.params.hash, ctx.request)).handleRaw("blob.get", (ctx) => blobGet(ctx.params.id, ctx.request)).handle("job.list", (ctx) => job.list(ctx.query)).handle("artifacts.providers", (ctx) => artifact.providers(ctx.query, ctx.request)).handle("artifacts.list", (ctx) => artifact.list(ctx.query, ctx.request)).handle("artifacts.create", (ctx) => artifact.create(ctx.query, ctx.payload, ctx.request)).handle("artifacts.get", (ctx) => artifact.get(ctx.params.artifactID, ctx.query, ctx.request)).handle("artifacts.update", (ctx) => artifact.update(ctx.params.artifactID, ctx.query, ctx.payload, ctx.request)).handle("artifacts.delete", (ctx) => artifact.remove(ctx.params.artifactID, ctx.query, ctx.request)).handleRaw("artifacts.view", (ctx) => artifact.view(ctx.params.artifactID, ctx.query, ctx.request)).handle("automation.create", (ctx) => automation.create(ctx.payload)).handle("automation.list", (ctx) => automation.list(ctx.query)).handle("automation.get", (ctx) => automation.get(ctx.params.automationID)).handle("automation.pause", (ctx) => automation.pause(ctx.params.automationID)).handle("automation.resume", (ctx) => automation.resume(ctx.params.automationID)).handle("automation.delete", (ctx) => automation.remove(ctx.params.automationID)).handle("persistentPty.read", Effect.fn(function* (ctx) {
51
55
  return { data: yield* pty.read(ctx.params.sessionID, ctx.query.lines).pipe(mapUnavailable) };
52
56
  })).handle("persistentPty.list", Effect.fn(function* (ctx) {
53
57
  return { data: yield* pty.list(ctx.params.sessionID).pipe(mapUnavailable) };
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  requestRef2
3
- } from "./auth-50bbk3b2.js";
3
+ } from "./request-tracing-50bbk3b2.js";
4
4
  import {
5
5
  Api2
6
- } from "./auth-j87xz9bt.js";
6
+ } from "./request-tracing-0e81et3m.js";
7
7
 
8
8
  // src/handlers/debug.ts
9
9
  import { LocationServiceMap } from "@opencode/core/location-service-map";
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  response2
3
- } from "./auth-50bbk3b2.js";
3
+ } from "./request-tracing-50bbk3b2.js";
4
4
  import {
5
5
  Api2
6
- } from "./auth-j87xz9bt.js";
6
+ } from "./request-tracing-0e81et3m.js";
7
7
 
8
8
  // src/handlers/vcs.ts
9
9
  import { Vcs } from "@opencode/core/vcs";
@@ -2,7 +2,7 @@ import {
2
2
  locationErrors2,
3
3
  sessionInfo2,
4
4
  requestRef2
5
- } from "./auth-50bbk3b2.js";
5
+ } from "./request-tracing-50bbk3b2.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
  Api2
3
- } from "./auth-j87xz9bt.js";
3
+ } from "./request-tracing-0e81et3m.js";
4
4
 
5
5
  // src/handlers/config.ts
6
6
  import { Config } from "@opencode/core/config";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  __export
3
- } from "./auth-9rqn6x4v.js";
3
+ } from "./request-tracing-9rqn6x4v.js";
4
4
 
5
5
  // src/auth.ts
6
6
  var exports_auth = {};
@@ -2,18 +2,18 @@ import {
2
2
  locationErrors2,
3
3
  response2,
4
4
  requestRef2
5
- } from "./auth-50bbk3b2.js";
5
+ } from "./request-tracing-50bbk3b2.js";
6
6
  import {
7
7
  Api2
8
- } from "./auth-j87xz9bt.js";
8
+ } from "./request-tracing-0e81et3m.js";
9
9
  import {
10
10
  CorsConfig2,
11
11
  isAllowedRequestOrigin2
12
- } from "./auth-q4bn6dy8.js";
12
+ } from "./request-tracing-q4bn6dy8.js";
13
13
  import {
14
14
  runPtySocket2,
15
15
  holdLocation2
16
- } from "./auth-q187pxxd.js";
16
+ } from "./request-tracing-q187pxxd.js";
17
17
 
18
18
  // src/handlers/pty.ts
19
19
  import { Pty } from "@opencode/core/pty";
@@ -1,14 +1,14 @@
1
1
  import {
2
2
  missingSession2
3
- } from "./auth-smaf4a18.js";
3
+ } from "./request-tracing-smaf4a18.js";
4
4
  import {
5
5
  locationErrors2,
6
6
  response2,
7
7
  sessionInfo2
8
- } from "./auth-50bbk3b2.js";
8
+ } from "./request-tracing-50bbk3b2.js";
9
9
  import {
10
10
  Api2
11
- } from "./auth-j87xz9bt.js";
11
+ } from "./request-tracing-0e81et3m.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
  isAllowedRequestOrigin2
3
- } from "./auth-q4bn6dy8.js";
3
+ } from "./request-tracing-q4bn6dy8.js";
4
4
  import {
5
5
  __export
6
- } from "./auth-9rqn6x4v.js";
6
+ } from "./request-tracing-9rqn6x4v.js";
7
7
 
8
8
  // src/request-site.ts
9
9
  var exports_request_site = {};
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  __export
3
- } from "./auth-9rqn6x4v.js";
3
+ } from "./request-tracing-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: () => Service2,
9
+ Service: () => Service4,
10
10
  node: () => node2
11
11
  });
12
12
  import { Cache, Context, Duration, Effect, Layer } from "effect";
@@ -14,12 +14,12 @@ 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 Service2 extends Context.Service()("@opencode/ServerPairing") {
17
+ class Service4 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(Service2, Effect.gen(function* () {
20
+ var layer = Layer.effect(Service4, Effect.gen(function* () {
21
21
  const cache = yield* Cache.make({ capacity: 1000, lookup: noLookup, timeToLive: TTL });
22
- return Service2.of({
22
+ return Service4.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(Service2, Effect.gen(function* () {
30
30
  })
31
31
  });
32
32
  }));
33
- var node2 = makeGlobalNode({ service: Service2, layer, deps: [] });
33
+ var node2 = makeGlobalNode({ service: Service4, layer, deps: [] });
34
34
 
35
- export { Service2, node2, exports_pairing };
35
+ export { Service4, node2, exports_pairing };
@@ -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,32 +1,32 @@
1
1
  import {
2
2
  isAllowedCorsOrigin2
3
- } from "./auth-q4bn6dy8.js";
3
+ } from "./request-tracing-q4bn6dy8.js";
4
4
  import {
5
5
  middleware2
6
- } from "./auth-myqk22k5.js";
6
+ } from "./request-tracing-myqk22k5.js";
7
7
  import {
8
8
  withoutParentSpan2
9
- } from "./auth-yc7nft6q.js";
9
+ } from "./request-tracing-yc7nft6q.js";
10
10
  import {
11
11
  createRoutes2
12
- } from "./auth-etdgpyr8.js";
12
+ } from "./request-tracing-v0r38a4t.js";
13
13
  import {
14
14
  __export
15
- } from "./auth-9rqn6x4v.js";
15
+ } from "./request-tracing-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: () => make2
21
+ make: () => make3
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 make2 = Effect.fn("ServerFetch.make")(function* (options = {}, boot = {}) {
26
+ var make3 = 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 { make2, exports_fetch };
32
+ export { make3, exports_fetch };
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  missingSession2
3
- } from "./auth-smaf4a18.js";
3
+ } from "./request-tracing-smaf4a18.js";
4
4
  import {
5
5
  locationErrors2,
6
6
  response2,
7
7
  requestRef2
8
- } from "./auth-50bbk3b2.js";
8
+ } from "./request-tracing-50bbk3b2.js";
9
9
 
10
10
  // src/handlers/artifact.ts
11
11
  import { Artifact } from "@opencode/core/artifact";
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  response2
3
- } from "./auth-50bbk3b2.js";
3
+ } from "./request-tracing-50bbk3b2.js";
4
4
  import {
5
5
  Api2
6
- } from "./auth-j87xz9bt.js";
6
+ } from "./request-tracing-0e81et3m.js";
7
7
 
8
8
  // src/handlers/skill.ts
9
9
  import { Skill } from "@opencode/core/skill";
@@ -1,12 +1,15 @@
1
1
  import {
2
2
  response2
3
- } from "./auth-50bbk3b2.js";
3
+ } from "./request-tracing-50bbk3b2.js";
4
4
  import {
5
5
  Api2
6
- } from "./auth-j87xz9bt.js";
6
+ } from "./request-tracing-0e81et3m.js";
7
7
  import {
8
8
  download2
9
- } from "./auth-t32e1bbt.js";
9
+ } from "./request-tracing-t32e1bbt.js";
10
+ import {
11
+ parse2
12
+ } from "./request-tracing-8sb6qqpn.js";
10
13
 
11
14
  // src/handlers/fs.ts
12
15
  import { FileSystem } from "@opencode/core/filesystem";
@@ -71,7 +74,7 @@ function serveFile(request, file, content) {
71
74
  if (isNotModified(request, etag, lastModified))
72
75
  return HttpServerResponse.empty({ status: 304, headers: { ...validators, ...content } });
73
76
  const rangeHeader = request.method === "GET" ? request.headers["range"] : undefined;
74
- const range = rangeHeader !== undefined && matchesIfRange(request.headers["if-range"], etag, lastModified) ? parseRange(rangeHeader, file.size) : undefined;
77
+ const range = rangeHeader !== undefined && matchesIfRange(request.headers["if-range"], etag, lastModified) ? parse2(rangeHeader, file.size) : undefined;
75
78
  if (range === "unsatisfiable")
76
79
  return HttpServerResponse.empty({
77
80
  status: 416,
@@ -107,21 +110,5 @@ function matchesIfRange(ifRange, etag, lastModified) {
107
110
  function stripWeak(etag) {
108
111
  return etag.trim().replace(/^w\//i, "");
109
112
  }
110
- function parseRange(header, size) {
111
- const match = /^bytes=\s*(\d*)\s*-\s*(\d*)\s*$/i.exec(header.trim());
112
- if (match === null || match[1] === "" && match[2] === "")
113
- return;
114
- if (match[1] === "") {
115
- const suffix = Number(match[2]);
116
- if (suffix === 0 || size === 0)
117
- return "unsatisfiable";
118
- return { start: Math.max(size - suffix, 0), end: size - 1 };
119
- }
120
- const start = Number(match[1]);
121
- const end = match[2] === "" ? size - 1 : Number(match[2]);
122
- if (start > end || start >= size)
123
- return "unsatisfiable";
124
- return { start, end: Math.min(end, size - 1) };
125
- }
126
113
 
127
114
  export { FileSystemHandler2 };
@@ -3,16 +3,16 @@ import {
3
3
  missingMessage2,
4
4
  failedMessageDecode2,
5
5
  failedSnapshot2
6
- } from "./auth-smaf4a18.js";
6
+ } from "./request-tracing-smaf4a18.js";
7
7
  import {
8
8
  locationErrors2
9
- } from "./auth-50bbk3b2.js";
9
+ } from "./request-tracing-50bbk3b2.js";
10
10
  import {
11
11
  Api2
12
- } from "./auth-j87xz9bt.js";
12
+ } from "./request-tracing-0e81et3m.js";
13
13
  import {
14
14
  wantsMediaRefs2
15
- } from "./auth-xthc02cw.js";
15
+ } from "./request-tracing-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
  response2
3
- } from "./auth-50bbk3b2.js";
3
+ } from "./request-tracing-50bbk3b2.js";
4
4
  import {
5
5
  Api2
6
- } from "./auth-j87xz9bt.js";
6
+ } from "./request-tracing-0e81et3m.js";
7
7
 
8
8
  // src/handlers/reference.ts
9
9
  import { Reference } from "@opencode/core/reference";
@@ -0,0 +1,46 @@
1
+ import {
2
+ download2
3
+ } from "./request-tracing-t32e1bbt.js";
4
+ import {
5
+ parse2
6
+ } from "./request-tracing-8sb6qqpn.js";
7
+
8
+ // src/handlers/blob.ts
9
+ import { BlobStore } from "@opencode/core/blob-store";
10
+ import { BlobNotFoundError } from "@opencode/protocol/errors";
11
+ import { FSUtil } from "@opencode/util/fs-util";
12
+ import { Effect } from "effect";
13
+ import { HttpServerResponse } from "effect/http";
14
+ var makeBlobGet2 = Effect.gen(function* () {
15
+ const blobs = yield* BlobStore.Service;
16
+ const fs = yield* FSUtil.Service;
17
+ return (id, request) => Effect.gen(function* () {
18
+ const blob = yield* blobs.read(id).pipe(Effect.mapError((error) => new BlobNotFoundError({ blobID: error.id, message: error.message })));
19
+ const etag = `"${id}"`;
20
+ const headers = {
21
+ ...download2({ mime: blob.mime }),
22
+ "cache-control": "private, max-age=604800, immutable",
23
+ etag,
24
+ "accept-ranges": "bytes"
25
+ };
26
+ if (request.headers["if-none-match"]?.split(",").some((tag) => tag.trim() === "*" || tag.trim().replace(/^w\//i, "") === etag))
27
+ return HttpServerResponse.empty({ status: 304, headers });
28
+ const ifRange = request.headers["if-range"];
29
+ const range = ifRange === undefined || ifRange.trim() === etag ? parse2(request.headers["range"], blob.bytes) : undefined;
30
+ if (range === "unsatisfiable")
31
+ return HttpServerResponse.empty({
32
+ status: 416,
33
+ headers: { ...headers, "content-range": `bytes */${blob.bytes}` }
34
+ });
35
+ const offset = range?.start ?? 0;
36
+ const length = range === undefined ? blob.bytes : range.end - range.start + 1;
37
+ return HttpServerResponse.stream(fs.stream(blob.path, { offset, bytesToRead: length }), {
38
+ status: range === undefined ? 200 : 206,
39
+ contentType: headers["content-type"],
40
+ contentLength: length,
41
+ headers: range === undefined ? headers : { ...headers, "content-range": `bytes ${range.start}-${range.end}/${blob.bytes}` }
42
+ });
43
+ });
44
+ });
45
+
46
+ export { makeBlobGet2 };
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  __export
3
- } from "./auth-9rqn6x4v.js";
3
+ } from "./request-tracing-9rqn6x4v.js";
4
4
 
5
5
  // src/content-headers.ts
6
6
  var exports_content_headers = {};
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  Api2
3
- } from "./auth-j87xz9bt.js";
3
+ } from "./request-tracing-0e81et3m.js";
4
4
  import {
5
5
  requireConnectable2
6
- } from "./auth-91858wp1.js";
6
+ } from "./request-tracing-2pbbrzpp.js";
7
7
 
8
8
  // src/handlers/credential.ts
9
9
  import { Credential } from "@opencode/core/credential";
@@ -1,36 +1,39 @@
1
1
  import {
2
2
  layer4
3
- } from "./auth-50bbk3b2.js";
3
+ } from "./request-tracing-50bbk3b2.js";
4
4
  import {
5
5
  formLocationLayer2
6
- } from "./auth-htyf2qs7.js";
6
+ } from "./request-tracing-htyf2qs7.js";
7
7
  import {
8
8
  sessionLocationLayer2
9
- } from "./auth-b3bmdkga.js";
9
+ } from "./request-tracing-b3bmdkga.js";
10
10
  import {
11
11
  Api2
12
- } from "./auth-j87xz9bt.js";
12
+ } from "./request-tracing-0e81et3m.js";
13
13
  import {
14
14
  Config2
15
- } from "./auth-j4at0y5c.js";
15
+ } from "./request-tracing-j4at0y5c.js";
16
16
  import {
17
17
  CorsConfig2
18
- } from "./auth-q4bn6dy8.js";
18
+ } from "./request-tracing-q4bn6dy8.js";
19
19
  import {
20
20
  layer3
21
- } from "./auth-yjbzmfhm.js";
21
+ } from "./request-tracing-3te71694.js";
22
22
  import {
23
23
  node2
24
- } from "./auth-kqr36gas.js";
24
+ } from "./request-tracing-mzs0n5xz.js";
25
25
  import {
26
26
  handlers2
27
- } from "./auth-6jfbq4sw.js";
27
+ } from "./request-tracing-0gf4dfn8.js";
28
28
  import {
29
29
  authorizationLayer2
30
- } from "./auth-7b9xm1qg.js";
30
+ } from "./request-tracing-7b9xm1qg.js";
31
31
  import {
32
32
  schemaErrorLayer2
33
- } from "./auth-bd8755ek.js";
33
+ } from "./request-tracing-bd8755ek.js";
34
+ import {
35
+ defectResponseLayer2
36
+ } from "./request-tracing-n26yr6pw.js";
34
37
 
35
38
  // src/routes.ts
36
39
  import { Database } from "@opencode/core/database/database";
@@ -48,6 +51,8 @@ import { PermissionSaved } from "@opencode/core/permission/saved";
48
51
  import { PtyTicket } from "@opencode/core/pty/ticket";
49
52
  import { PersistentPty } from "@opencode/core/persistent-pty";
50
53
  import { Project } from "@opencode/core/project";
54
+ import { BlobStore } from "@opencode/core/blob-store";
55
+ import { VideoGeneration } from "@opencode/core/video-generation";
51
56
  import { Worktree } from "@opencode/core/worktree";
52
57
  import { Session } from "@opencode/core/session";
53
58
  import { Instance } from "@opencode/core/instance/service";
@@ -65,7 +70,7 @@ import { LocationServiceMap } from "@opencode/core/location-service-map";
65
70
  import { LocationActivity } from "@opencode/core/location-activity";
66
71
  import { ModelsDev } from "@opencode/core/models-dev";
67
72
  import { SessionRestart } from "@opencode/core/session/execution/restart";
68
- import { Schedule } from "@opencode/core/schedule";
73
+ import { Automation } from "@opencode/core/automation";
69
74
  import { PluginUpdate } from "@opencode/core/plugin/update";
70
75
  import { SdkPlugins } from "@opencode/core/plugin/sdk";
71
76
  import { WellKnown } from "@opencode/core/wellknown";
@@ -104,7 +109,9 @@ var applicationServiceNodes = [
104
109
  LocationServiceMap.node,
105
110
  LocationActivity.node,
106
111
  SessionRestart.node,
107
- Schedule.node,
112
+ Automation.node,
113
+ BlobStore.node,
114
+ VideoGeneration.node,
108
115
  Workspace.node,
109
116
  FileWatch.node
110
117
  ];
@@ -133,7 +140,10 @@ function makeRoutes(auth, options, serviceURLs, overrides, instances) {
133
140
  file: options.config?.file,
134
141
  content: options.config?.content
135
142
  })),
136
- InstructionDiscovery.node.replace(InstructionDiscovery.configured({ project: options.config?.project })),
143
+ InstructionDiscovery.node.replace(InstructionDiscovery.configured({
144
+ project: options.config?.project,
145
+ claude: options.instructions?.claude
146
+ })),
137
147
  ShellSelect.node.replace(ShellSelect.configured({ gitbash: options.windows?.gitbash })),
138
148
  Mcp.node.replace(Mcp.configured({
139
149
  clientInfo: {
@@ -158,7 +168,7 @@ function makeRoutes(auth, options, serviceURLs, overrides, instances) {
158
168
  return serviceLayer.pipe(Layer.flatMap((context) => {
159
169
  const services = Layer.succeedContext(context);
160
170
  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));
161
- 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));
171
+ 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.merge(defectResponseLayer2), Layer.provideMerge(services), Layer.provideMerge(HttpRouter.layer));
162
172
  return Layer.merge(api, V1Migration.layer.pipe(Layer.provide(services)));
163
173
  }));
164
174
  }
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  response2
3
- } from "./auth-50bbk3b2.js";
3
+ } from "./request-tracing-50bbk3b2.js";
4
4
  import {
5
5
  Api2
6
- } from "./auth-j87xz9bt.js";
6
+ } from "./request-tracing-0e81et3m.js";
7
7
 
8
8
  // src/handlers/form.ts
9
9
  import { Form } from "@opencode/core/form";
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  response2
3
- } from "./auth-50bbk3b2.js";
3
+ } from "./request-tracing-50bbk3b2.js";
4
4
  import {
5
5
  Api2
6
- } from "./auth-j87xz9bt.js";
6
+ } from "./request-tracing-0e81et3m.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
  Api2
3
- } from "./auth-j87xz9bt.js";
3
+ } from "./request-tracing-0e81et3m.js";
4
4
 
5
5
  // src/handlers/migration.ts
6
6
  import { V1Migration } from "@opencode/core/database/v1-migration";