@opencode/server 0.0.0-dev-1299 → 0.0.0-dev-1302

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 (131) hide show
  1. package/dist/api.js +5 -5
  2. package/dist/auth.js +1 -1
  3. package/dist/chunks/{fetch-059rbh9c.js → api-059rbh9c.js} +1 -1
  4. package/dist/chunks/{fetch-09kw3a77.js → api-09kw3a77.js} +2 -2
  5. package/dist/chunks/{fetch-yqhefp4s.js → api-1h6b4sc5.js} +23 -3
  6. package/dist/chunks/{fetch-1ndv3m9h.js → api-1ndv3m9h.js} +4 -4
  7. package/dist/chunks/{fetch-2eaky32g.js → api-2eaky32g.js} +2 -2
  8. package/dist/chunks/{fetch-3rjhh738.js → api-3rjhh738.js} +2 -2
  9. package/dist/chunks/{fetch-4q6e7fh8.js → api-4q6e7fh8.js} +2 -2
  10. package/dist/chunks/{fetch-50bbk3b2.js → api-50bbk3b2.js} +1 -1
  11. package/dist/chunks/{fetch-5s0wnsg4.js → api-58psf7ej.js} +3 -3
  12. package/dist/chunks/{fetch-5cpb32hf.js → api-5cpb32hf.js} +1 -1
  13. package/dist/chunks/{fetch-6z9pvq7p.js → api-6z9pvq7p.js} +1 -1
  14. package/dist/chunks/{fetch-78rcgzsr.js → api-78rcgzsr.js} +1 -1
  15. package/dist/chunks/{fetch-7b9xm1qg.js → api-7b9xm1qg.js} +1 -1
  16. package/dist/chunks/{fetch-8mj7kvhm.js → api-8mj7kvhm.js} +2 -2
  17. package/dist/chunks/api-8sb6qqpn.js +28 -0
  18. package/dist/chunks/{fetch-91858wp1.js → api-91858wp1.js} +2 -2
  19. package/dist/chunks/{fetch-a8jcac9a.js → api-a8jcac9a.js} +1 -1
  20. package/dist/chunks/{fetch-az0609r6.js → api-az0609r6.js} +2 -2
  21. package/dist/chunks/{fetch-b3bmdkga.js → api-b3bmdkga.js} +1 -1
  22. package/dist/chunks/{fetch-tvqdwt6z.js → api-b6k4wrac.js} +4 -4
  23. package/dist/chunks/{fetch-btahnm2b.js → api-btahnm2b.js} +3 -3
  24. package/dist/chunks/{fetch-y9qrjf78.js → api-cdd9f8n8.js} +5 -5
  25. package/dist/chunks/{fetch-cezwbsk5.js → api-cezwbsk5.js} +1 -1
  26. package/dist/chunks/{fetch-d0edqfxx.js → api-d0edqfxx.js} +2 -2
  27. package/dist/chunks/{fetch-djr0jy89.js → api-djr0jy89.js} +1 -1
  28. package/dist/chunks/{fetch-hgh17xp5.js → api-dq1g6k8x.js} +12 -8
  29. package/dist/chunks/{fetch-e6e4kz0w.js → api-e6e4kz0w.js} +1 -1
  30. package/dist/chunks/{fetch-enp1bp7r.js → api-enp1bp7r.js} +1 -1
  31. package/dist/chunks/{fetch-y6b5qq9t.js → api-ewme8tzg.js} +7 -20
  32. package/dist/chunks/{fetch-f559fakr.js → api-f559fakr.js} +2 -2
  33. package/dist/chunks/{fetch-htyf2qs7.js → api-htyf2qs7.js} +1 -1
  34. package/dist/chunks/{fetch-j4at0y5c.js → api-j4at0y5c.js} +1 -1
  35. package/dist/chunks/{fetch-j87xz9bt.js → api-j87xz9bt.js} +3 -3
  36. package/dist/chunks/{fetch-kkdkqt8j.js → api-kkdkqt8j.js} +2 -2
  37. package/dist/chunks/{fetch-myqk22k5.js → api-myqk22k5.js} +2 -2
  38. package/dist/chunks/{fetch-mzs0n5xz.js → api-mzs0n5xz.js} +1 -1
  39. package/dist/chunks/{fetch-ny1j968n.js → api-ny1j968n.js} +2 -2
  40. package/dist/chunks/{fetch-p86kew8c.js → api-p86kew8c.js} +2 -2
  41. package/dist/chunks/{fetch-psw29prz.js → api-psw29prz.js} +4 -4
  42. package/dist/chunks/{fetch-qcg3sqtb.js → api-qcg3sqtb.js} +2 -2
  43. package/dist/chunks/{fetch-qd0r787n.js → api-qd0r787n.js} +2 -2
  44. package/dist/chunks/{fetch-qfyg9gb7.js → api-qfyg9gb7.js} +1 -1
  45. package/dist/chunks/{fetch-rha2aq18.js → api-rha2aq18.js} +2 -2
  46. package/dist/chunks/{fetch-rs3v36hp.js → api-rs3v36hp.js} +2 -2
  47. package/dist/chunks/api-sy2e93cn.js +46 -0
  48. package/dist/chunks/{fetch-t32e1bbt.js → api-t32e1bbt.js} +1 -1
  49. package/dist/chunks/{fetch-te8jwba1.js → api-te8jwba1.js} +2 -2
  50. package/dist/chunks/{fetch-tnqtz466.js → api-v8013z1z.js} +16 -12
  51. package/dist/chunks/{fetch-gyryr0mf.js → api-vdvwckee.js} +4 -4
  52. package/dist/chunks/{fetch-q2wtc6jx.js → api-wnren0wn.js} +33 -33
  53. package/dist/chunks/{fetch-yk755swr.js → api-yk755swr.js} +2 -2
  54. package/dist/chunks/{fetch-z3e7v67k.js → api-z3e7v67k.js} +1 -1
  55. package/dist/chunks/{fetch-zcvan105.js → api-zcvan105.js} +1 -1
  56. package/dist/content-headers.js +1 -1
  57. package/dist/cors.js +1 -1
  58. package/dist/event-feed.js +1 -1
  59. package/dist/fetch.js +59 -57
  60. package/dist/handlers/agent.js +6 -6
  61. package/dist/handlers/artifact.js +3 -3
  62. package/dist/handlers/blob.d.ts +7 -0
  63. package/dist/handlers/blob.js +8 -0
  64. package/dist/handlers/command.js +6 -6
  65. package/dist/handlers/config.js +6 -6
  66. package/dist/handlers/credential.js +7 -7
  67. package/dist/handlers/debug.js +6 -6
  68. package/dist/handlers/event.js +7 -7
  69. package/dist/handlers/form.js +6 -6
  70. package/dist/handlers/fs.js +8 -7
  71. package/dist/handlers/generate.d.ts +2 -1
  72. package/dist/handlers/generate.js +6 -6
  73. package/dist/handlers/integration.js +6 -6
  74. package/dist/handlers/job.js +2 -2
  75. package/dist/handlers/location.js +6 -6
  76. package/dist/handlers/mcp.js +8 -8
  77. package/dist/handlers/media.js +2 -2
  78. package/dist/handlers/message.js +7 -7
  79. package/dist/handlers/migration.js +6 -6
  80. package/dist/handlers/model.js +6 -6
  81. package/dist/handlers/permission.js +6 -6
  82. package/dist/handlers/persistent-pty.d.ts +1 -1
  83. package/dist/handlers/persistent-pty.js +15 -13
  84. package/dist/handlers/plugin.js +6 -6
  85. package/dist/handlers/project.js +6 -6
  86. package/dist/handlers/provider.js +6 -6
  87. package/dist/handlers/pty-socket.js +1 -1
  88. package/dist/handlers/pty.js +8 -8
  89. package/dist/handlers/reference.js +6 -6
  90. package/dist/handlers/rpc.js +6 -6
  91. package/dist/handlers/schedule.js +2 -2
  92. package/dist/handlers/server.js +9 -9
  93. package/dist/handlers/session-error.js +1 -1
  94. package/dist/handlers/session.js +7 -7
  95. package/dist/handlers/shell.js +6 -6
  96. package/dist/handlers/skill.js +6 -6
  97. package/dist/handlers/usage.js +6 -6
  98. package/dist/handlers/vcs.js +6 -6
  99. package/dist/handlers/voice.js +6 -6
  100. package/dist/handlers/websearch.js +6 -6
  101. package/dist/handlers/worktree.js +6 -6
  102. package/dist/handlers.d.ts +1 -1
  103. package/dist/handlers.js +52 -50
  104. package/dist/location.js +2 -2
  105. package/dist/media-uri.js +1 -1
  106. package/dist/middleware/authorization.js +2 -2
  107. package/dist/middleware/defect-response.js +1 -1
  108. package/dist/middleware/form-location.js +3 -3
  109. package/dist/middleware/schema-error.js +1 -1
  110. package/dist/middleware/session-location.js +3 -3
  111. package/dist/pairing.js +1 -1
  112. package/dist/process.js +60 -58
  113. package/dist/range.d.ts +6 -0
  114. package/dist/range.js +8 -0
  115. package/dist/request-site.js +2 -2
  116. package/dist/request-tracing.js +1 -1
  117. package/dist/routes.d.ts +4 -2
  118. package/dist/routes.js +56 -54
  119. package/dist/server-info.js +1 -1
  120. package/dist/service-status.js +1 -1
  121. package/dist/workerd.d.ts +1 -0
  122. package/dist/workerd.js +64 -58
  123. package/package.json +8 -8
  124. /package/dist/chunks/{fetch-9rqn6x4v.js → api-9rqn6x4v.js} +0 -0
  125. /package/dist/chunks/{fetch-bd8755ek.js → api-bd8755ek.js} +0 -0
  126. /package/dist/chunks/{fetch-n26yr6pw.js → api-n26yr6pw.js} +0 -0
  127. /package/dist/chunks/{fetch-q187pxxd.js → api-q187pxxd.js} +0 -0
  128. /package/dist/chunks/{fetch-q4bn6dy8.js → api-q4bn6dy8.js} +0 -0
  129. /package/dist/chunks/{fetch-smaf4a18.js → api-smaf4a18.js} +0 -0
  130. /package/dist/chunks/{fetch-xthc02cw.js → api-xthc02cw.js} +0 -0
  131. /package/dist/chunks/{fetch-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/fetch-j87xz9bt.js";
4
- import"./chunks/fetch-htyf2qs7.js";
5
- import"./chunks/fetch-b3bmdkga.js";
6
- import"./chunks/fetch-50bbk3b2.js";
7
- import"./chunks/fetch-smaf4a18.js";
3
+ } from "./chunks/api-j87xz9bt.js";
4
+ import"./chunks/api-htyf2qs7.js";
5
+ import"./chunks/api-b3bmdkga.js";
6
+ import"./chunks/api-50bbk3b2.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/fetch-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 "./fetch-smaf4a18.js";
3
+ } from "./api-smaf4a18.js";
4
4
 
5
5
  // src/handlers/schedule.ts
6
6
  import { Permission } from "@opencode/core/permission";
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  response2
3
- } from "./fetch-50bbk3b2.js";
3
+ } from "./api-50bbk3b2.js";
4
4
  import {
5
5
  Api2
6
- } from "./fetch-j87xz9bt.js";
6
+ } from "./api-j87xz9bt.js";
7
7
 
8
8
  // src/handlers/usage.ts
9
9
  import { UsageLimits } from "@opencode/core/usage-limits";
@@ -1,17 +1,21 @@
1
1
  import {
2
2
  locationErrors2,
3
3
  awaitPlugins2
4
- } from "./fetch-50bbk3b2.js";
4
+ } from "./api-50bbk3b2.js";
5
5
  import {
6
6
  Api2
7
- } from "./fetch-j87xz9bt.js";
7
+ } from "./api-j87xz9bt.js";
8
8
 
9
9
  // src/handlers/generate.ts
10
+ import { Flag } from "@opencode/core/flag";
10
11
  import { Generate } from "@opencode/core/generate";
12
+ import { VideoGeneration } from "@opencode/core/video-generation";
11
13
  import { Location } from "@opencode/core/location";
12
14
  import { LocationServiceMap } from "@opencode/core/location-services";
13
15
  import { AbsolutePath } from "@opencode/core/schema";
14
16
  import {
17
+ ForbiddenError,
18
+ VideoNotFoundError,
15
19
  InvalidRequestError,
16
20
  ModelNotFoundError,
17
21
  ProviderRequestError,
@@ -24,6 +28,7 @@ import { HttpApiBuilder } from "effect/http-api";
24
28
  var GenerateHandler2 = HttpApiBuilder.group(Api2, "server.generate", (handlers) => Effect.gen(function* () {
25
29
  const global = yield* Global.Service;
26
30
  const locations = yield* LocationServiceMap.Service;
31
+ const videos = yield* VideoGeneration.Service;
27
32
  const services = locations.get(Location.Ref.make({ directory: AbsolutePath.make(global.config) }));
28
33
  const text = Effect.fn("server.generate.text")(function* (request) {
29
34
  yield* awaitPlugins2;
@@ -46,7 +51,22 @@ var GenerateHandler2 = HttpApiBuilder.group(Api2, "server.generate", (handlers)
46
51
  const generate = yield* Generate.Service;
47
52
  return { data: yield* generate.decisions(request.payload).pipe(Effect.mapError(generateError)) };
48
53
  }, Effect.provide(services), locationErrors2);
49
- return handlers.handle("generate.text", text).handle("generate.textLegacy", text).handle("generate.image", image).handle("generate.decisions", decisions);
54
+ const videoEnabled = Effect.gen(function* () {
55
+ if (yield* Flag.enabled("video_generate"))
56
+ return;
57
+ return yield* new ForbiddenError({ message: "Video generation is disabled; enable experimental.video_generate" });
58
+ });
59
+ const videoCreate = Effect.fn("server.generate.video.create")(function* (request) {
60
+ yield* videoEnabled;
61
+ yield* awaitPlugins2;
62
+ return { data: yield* videos.start(request.payload).pipe(Effect.mapError(generateError)) };
63
+ }, Effect.provide(services), locationErrors2);
64
+ const videoGet = Effect.fn("server.generate.video.get")(function* (request) {
65
+ yield* videoEnabled;
66
+ const job = yield* videos.get(request.params.id).pipe(Effect.mapError((error) => new VideoNotFoundError({ videoID: error.id, message: error.message })));
67
+ return { data: job };
68
+ }, Effect.provide(services), locationErrors2);
69
+ return handlers.handle("generate.text", text).handle("generate.textLegacy", text).handle("generate.image", image).handle("generate.decisions", decisions).handle("generate.video.create", videoCreate).handle("generate.video.get", videoGet);
50
70
  }));
51
71
  function generateError(error) {
52
72
  switch (error._tag) {
@@ -2,18 +2,18 @@ import {
2
2
  locationErrors2,
3
3
  response2,
4
4
  requestRef2
5
- } from "./fetch-50bbk3b2.js";
5
+ } from "./api-50bbk3b2.js";
6
6
  import {
7
7
  Api2
8
- } from "./fetch-j87xz9bt.js";
8
+ } from "./api-j87xz9bt.js";
9
9
  import {
10
10
  CorsConfig2,
11
11
  isAllowedRequestOrigin2
12
- } from "./fetch-q4bn6dy8.js";
12
+ } from "./api-q4bn6dy8.js";
13
13
  import {
14
14
  runPtySocket2,
15
15
  holdLocation2
16
- } from "./fetch-q187pxxd.js";
16
+ } from "./api-q187pxxd.js";
17
17
 
18
18
  // src/handlers/mcp.ts
19
19
  import { Location } from "@opencode/core/location";
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  response2
3
- } from "./fetch-50bbk3b2.js";
3
+ } from "./api-50bbk3b2.js";
4
4
  import {
5
5
  Api2
6
- } from "./fetch-j87xz9bt.js";
6
+ } from "./api-j87xz9bt.js";
7
7
 
8
8
  // src/handlers/plugin.ts
9
9
  import { Plugin } from "@opencode/core/plugin";
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  Api2
3
- } from "./fetch-j87xz9bt.js";
3
+ } from "./api-j87xz9bt.js";
4
4
  import {
5
5
  Service3,
6
6
  frame2
7
- } from "./fetch-qfyg9gb7.js";
7
+ } from "./api-qfyg9gb7.js";
8
8
 
9
9
  // src/handlers/event.ts
10
10
  import { Event } from "@opencode/schema/event";
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  response2
3
- } from "./fetch-50bbk3b2.js";
3
+ } from "./api-50bbk3b2.js";
4
4
  import {
5
5
  Api2
6
- } from "./fetch-j87xz9bt.js";
6
+ } from "./api-j87xz9bt.js";
7
7
 
8
8
  // src/handlers/command.ts
9
9
  import { Command } from "@opencode/core/command";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  missingSession2
3
- } from "./fetch-smaf4a18.js";
3
+ } from "./api-smaf4a18.js";
4
4
 
5
5
  // src/location.ts
6
6
  import { FileSystem } from "@opencode/core/filesystem";
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  missingSession2,
3
3
  failedMessageDecode2
4
- } from "./fetch-smaf4a18.js";
4
+ } from "./api-smaf4a18.js";
5
5
  import {
6
6
  Api2
7
- } from "./fetch-j87xz9bt.js";
7
+ } from "./api-j87xz9bt.js";
8
8
  import {
9
9
  wantsMediaRefs2
10
- } from "./fetch-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 "./fetch-j87xz9bt.js";
3
+ } from "./api-j87xz9bt.js";
4
4
 
5
5
  // src/handlers/rpc.ts
6
6
  import { Rpc } from "@opencode/core/rpc";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  Api2
3
- } from "./fetch-j87xz9bt.js";
3
+ } from "./api-j87xz9bt.js";
4
4
 
5
5
  // src/handlers/migration.ts
6
6
  import { V1Migration } from "@opencode/core/database/v1-migration";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  missingSession2
3
- } from "./fetch-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 "./fetch-j4at0y5c.js";
7
+ } from "./api-j4at0y5c.js";
8
8
 
9
9
  // src/middleware/authorization.ts
10
10
  import { UnauthorizedError } from "@opencode/protocol/errors";
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  response2
3
- } from "./fetch-50bbk3b2.js";
3
+ } from "./api-50bbk3b2.js";
4
4
  import {
5
5
  Api2
6
- } from "./fetch-j87xz9bt.js";
6
+ } from "./api-j87xz9bt.js";
7
7
 
8
8
  // src/handlers/agent.ts
9
9
  import { Agent } from "@opencode/core/agent";
@@ -0,0 +1,28 @@
1
+ import {
2
+ __export
3
+ } from "./api-9rqn6x4v.js";
4
+
5
+ // src/range.ts
6
+ var exports_range = {};
7
+ __export(exports_range, {
8
+ ByteRange: () => exports_range,
9
+ parse: () => parse2
10
+ });
11
+ function parse2(header, size) {
12
+ const match = header === undefined ? null : /^bytes=\s*(\d*)\s*-\s*(\d*)\s*$/i.exec(header.trim());
13
+ if (match === null || match[1] === "" && match[2] === "")
14
+ return;
15
+ if (match[1] === "") {
16
+ const suffix = Number(match[2]);
17
+ if (suffix === 0 || size === 0)
18
+ return "unsatisfiable";
19
+ return { start: Math.max(size - suffix, 0), end: size - 1 };
20
+ }
21
+ const start = Number(match[1]);
22
+ const end = match[2] === "" ? size - 1 : Number(match[2]);
23
+ if (start > end || start >= size)
24
+ return "unsatisfiable";
25
+ return { start, end: Math.min(end, size - 1) };
26
+ }
27
+
28
+ export { parse2, exports_range };
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  response2
3
- } from "./fetch-50bbk3b2.js";
3
+ } from "./api-50bbk3b2.js";
4
4
  import {
5
5
  Api2
6
- } from "./fetch-j87xz9bt.js";
6
+ } from "./api-j87xz9bt.js";
7
7
 
8
8
  // src/handlers/integration.ts
9
9
  import { Integration } from "@opencode/core/integration";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  Api2
3
- } from "./fetch-j87xz9bt.js";
3
+ } from "./api-j87xz9bt.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 "./fetch-50bbk3b2.js";
4
+ } from "./api-50bbk3b2.js";
5
5
  import {
6
6
  Api2
7
- } from "./fetch-j87xz9bt.js";
7
+ } from "./api-j87xz9bt.js";
8
8
 
9
9
  // src/handlers/provider.ts
10
10
  import { Provider } from "@opencode/core/provider";
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  locationErrors2,
3
3
  sessionInfo2
4
- } from "./fetch-50bbk3b2.js";
4
+ } from "./api-50bbk3b2.js";
5
5
 
6
6
  // src/middleware/session-location.ts
7
7
  import { Instance } from "@opencode/core/instance/service";
@@ -1,18 +1,18 @@
1
1
  import {
2
2
  Api2
3
- } from "./fetch-j87xz9bt.js";
3
+ } from "./api-j87xz9bt.js";
4
4
  import {
5
5
  SESSION_TTL_SECONDS2,
6
6
  Config2,
7
7
  issueSession2,
8
8
  sessionCookieName2
9
- } from "./fetch-j4at0y5c.js";
9
+ } from "./api-j4at0y5c.js";
10
10
  import {
11
11
  Service2
12
- } from "./fetch-z3e7v67k.js";
12
+ } from "./api-z3e7v67k.js";
13
13
  import {
14
14
  Service4
15
- } from "./fetch-mzs0n5xz.js";
15
+ } from "./api-mzs0n5xz.js";
16
16
 
17
17
  // src/handlers/server.ts
18
18
  import { hostname } from "node:os";
@@ -1,14 +1,14 @@
1
1
  import {
2
2
  missingSession2
3
- } from "./fetch-smaf4a18.js";
3
+ } from "./api-smaf4a18.js";
4
4
  import {
5
5
  locationErrors2,
6
6
  response2,
7
7
  sessionInfo2
8
- } from "./fetch-50bbk3b2.js";
8
+ } from "./api-50bbk3b2.js";
9
9
  import {
10
10
  Api2
11
- } from "./fetch-j87xz9bt.js";
11
+ } from "./api-j87xz9bt.js";
12
12
 
13
13
  // src/handlers/permission.ts
14
14
  import { Instance } from "@opencode/core/instance/service";
@@ -1,18 +1,18 @@
1
1
  import {
2
2
  isAllowedCorsOrigin2
3
- } from "./fetch-q4bn6dy8.js";
3
+ } from "./api-q4bn6dy8.js";
4
4
  import {
5
5
  middleware2
6
- } from "./fetch-myqk22k5.js";
6
+ } from "./api-myqk22k5.js";
7
7
  import {
8
8
  withoutParentSpan2
9
- } from "./fetch-yc7nft6q.js";
9
+ } from "./api-yc7nft6q.js";
10
10
  import {
11
11
  createRoutes2
12
- } from "./fetch-tnqtz466.js";
12
+ } from "./api-v8013z1z.js";
13
13
  import {
14
14
  __export
15
- } from "./fetch-9rqn6x4v.js";
15
+ } from "./api-9rqn6x4v.js";
16
16
 
17
17
  // src/fetch.ts
18
18
  var exports_fetch = {};
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  Api2
3
- } from "./fetch-j87xz9bt.js";
3
+ } from "./api-j87xz9bt.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 "./fetch-50bbk3b2.js";
4
+ } from "./api-50bbk3b2.js";
5
5
  import {
6
6
  Api2
7
- } from "./fetch-j87xz9bt.js";
7
+ } from "./api-j87xz9bt.js";
8
8
 
9
9
  // src/handlers/voice.ts
10
10
  import { Location } from "@opencode/core/location";
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  CONTENT_SECURITY_POLICY2,
3
3
  disposition2
4
- } from "./fetch-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,25 +1,28 @@
1
1
  import {
2
2
  Api2
3
- } from "./fetch-j87xz9bt.js";
3
+ } from "./api-j87xz9bt.js";
4
4
  import {
5
5
  CorsConfig2,
6
6
  isAllowedRequestOrigin2
7
- } from "./fetch-q4bn6dy8.js";
7
+ } from "./api-q4bn6dy8.js";
8
8
  import {
9
9
  makeArtifact2
10
- } from "./fetch-p86kew8c.js";
10
+ } from "./api-p86kew8c.js";
11
+ import {
12
+ makeBlobGet2
13
+ } from "./api-sy2e93cn.js";
11
14
  import {
12
15
  makeJob2
13
- } from "./fetch-78rcgzsr.js";
16
+ } from "./api-78rcgzsr.js";
14
17
  import {
15
18
  makeMediaGet2
16
- } from "./fetch-djr0jy89.js";
19
+ } from "./api-djr0jy89.js";
17
20
  import {
18
21
  runPtySocket2
19
- } from "./fetch-q187pxxd.js";
22
+ } from "./api-q187pxxd.js";
20
23
  import {
21
24
  makeSchedule2
22
- } from "./fetch-059rbh9c.js";
25
+ } from "./api-059rbh9c.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;
52
+ const blobGet = yield* makeBlobGet2;
49
53
  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) {
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("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) {
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,6 +1,6 @@
1
1
  import {
2
2
  __export
3
- } from "./fetch-9rqn6x4v.js";
3
+ } from "./api-9rqn6x4v.js";
4
4
 
5
5
  // src/service-status.ts
6
6
  var exports_service_status = {};
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  Api2
3
- } from "./fetch-j87xz9bt.js";
3
+ } from "./api-j87xz9bt.js";
4
4
 
5
5
  // src/handlers/worktree.ts
6
6
  import { Git } from "@opencode/core/git";
@@ -1,12 +1,15 @@
1
1
  import {
2
2
  response2
3
- } from "./fetch-50bbk3b2.js";
3
+ } from "./api-50bbk3b2.js";
4
4
  import {
5
5
  Api2
6
- } from "./fetch-j87xz9bt.js";
6
+ } from "./api-j87xz9bt.js";
7
7
  import {
8
8
  download2
9
- } from "./fetch-t32e1bbt.js";
9
+ } from "./api-t32e1bbt.js";
10
+ import {
11
+ parse2
12
+ } from "./api-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 };
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  response2
3
- } from "./fetch-50bbk3b2.js";
3
+ } from "./api-50bbk3b2.js";
4
4
  import {
5
5
  Api2
6
- } from "./fetch-j87xz9bt.js";
6
+ } from "./api-j87xz9bt.js";
7
7
 
8
8
  // src/handlers/form.ts
9
9
  import { Form } from "@opencode/core/form";
@@ -2,7 +2,7 @@ import {
2
2
  locationErrors2,
3
3
  sessionInfo2,
4
4
  requestRef2
5
- } from "./fetch-50bbk3b2.js";
5
+ } from "./api-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
  __export
3
- } from "./fetch-9rqn6x4v.js";
3
+ } from "./api-9rqn6x4v.js";
4
4
 
5
5
  // src/auth.ts
6
6
  var exports_auth = {};
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  LocationMiddleware2
3
- } from "./fetch-50bbk3b2.js";
3
+ } from "./api-50bbk3b2.js";
4
4
  import {
5
5
  FormLocationMiddleware2
6
- } from "./fetch-htyf2qs7.js";
6
+ } from "./api-htyf2qs7.js";
7
7
  import {
8
8
  SessionLocationMiddleware2
9
- } from "./fetch-b3bmdkga.js";
9
+ } from "./api-b3bmdkga.js";
10
10
 
11
11
  // src/api.ts
12
12
  import { makeDefaultApi } from "@opencode/protocol/api";
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  awaitPlugins2,
3
3
  response2
4
- } from "./fetch-50bbk3b2.js";
4
+ } from "./api-50bbk3b2.js";
5
5
  import {
6
6
  Api2
7
- } from "./fetch-j87xz9bt.js";
7
+ } from "./api-j87xz9bt.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
  isAllowedRequestOrigin2
3
- } from "./fetch-q4bn6dy8.js";
3
+ } from "./api-q4bn6dy8.js";
4
4
  import {
5
5
  __export
6
- } from "./fetch-9rqn6x4v.js";
6
+ } from "./api-9rqn6x4v.js";
7
7
 
8
8
  // src/request-site.ts
9
9
  var exports_request_site = {};
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  __export
3
- } from "./fetch-9rqn6x4v.js";
3
+ } from "./api-9rqn6x4v.js";
4
4
 
5
5
  // src/pairing.ts
6
6
  var exports_pairing = {};
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  response2
3
- } from "./fetch-50bbk3b2.js";
3
+ } from "./api-50bbk3b2.js";
4
4
  import {
5
5
  Api2
6
- } from "./fetch-j87xz9bt.js";
6
+ } from "./api-j87xz9bt.js";
7
7
 
8
8
  // src/handlers/skill.ts
9
9
  import { Skill } from "@opencode/core/skill";