@opencode/server 0.0.0-dev-21907 → 0.0.0-dev-21915

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 (113) hide show
  1. package/dist/api.d.ts +5 -0
  2. package/dist/api.js +5 -5
  3. package/dist/auth.js +1 -1
  4. package/dist/chunks/{request-tracing-a8jcac9a.js → auth-05c5061t.js} +1 -1
  5. package/dist/chunks/{request-tracing-j87xz9bt.js → auth-0e81et3m.js} +3 -3
  6. package/dist/chunks/{request-tracing-2h6qktqa.js → auth-0ey2b45p.js} +2 -2
  7. package/dist/chunks/{request-tracing-s282vggx.js → auth-0n4tjm17.js} +1 -1
  8. package/dist/chunks/{request-tracing-h29xjj1e.js → auth-28ztppy1.js} +2 -2
  9. package/dist/chunks/{request-tracing-e6e4kz0w.js → auth-39nnfjx1.js} +4 -4
  10. package/dist/chunks/{request-tracing-0jvr2pw6.js → auth-3cea0hzg.js} +6 -6
  11. package/dist/chunks/{request-tracing-fx4r675h.js → auth-4953j2kd.js} +8 -4
  12. package/dist/chunks/{request-tracing-50bbk3b2.js → auth-50bbk3b2.js} +1 -1
  13. package/dist/chunks/{request-tracing-7b9xm1qg.js → auth-7b9xm1qg.js} +1 -1
  14. package/dist/chunks/{request-tracing-b105zy65.js → auth-89egwzf3.js} +2 -2
  15. package/dist/chunks/{request-tracing-e5dc5tv0.js → auth-8wqj6mpn.js} +4 -4
  16. package/dist/chunks/{request-tracing-az0609r6.js → auth-9grnt8dc.js} +2 -2
  17. package/dist/chunks/{request-tracing-b3bmdkga.js → auth-b3bmdkga.js} +1 -1
  18. package/dist/chunks/{request-tracing-4q6e7fh8.js → auth-b4mqtccx.js} +2 -2
  19. package/dist/chunks/{request-tracing-5b42hxrf.js → auth-djj5asqw.js} +1 -1
  20. package/dist/chunks/{request-tracing-dnwg64ce.js → auth-dnwg64ce.js} +1 -1
  21. package/dist/chunks/{request-tracing-kkdkqt8j.js → auth-dx89xydc.js} +2 -2
  22. package/dist/chunks/{request-tracing-d0edqfxx.js → auth-et00mhwf.js} +2 -2
  23. package/dist/chunks/{request-tracing-qd0r787n.js → auth-f8r9p2vr.js} +2 -2
  24. package/dist/chunks/{request-tracing-qcg3sqtb.js → auth-h1thjy6x.js} +2 -2
  25. package/dist/chunks/{request-tracing-m9aapr88.js → auth-hjes926v.js} +8 -8
  26. package/dist/chunks/{request-tracing-htyf2qs7.js → auth-htyf2qs7.js} +1 -1
  27. package/dist/chunks/{request-tracing-cezwbsk5.js → auth-hx8bsq9d.js} +1 -1
  28. package/dist/chunks/{request-tracing-j4at0y5c.js → auth-j4at0y5c.js} +1 -1
  29. package/dist/chunks/{request-tracing-5xzbpdv4.js → auth-kafd488q.js} +2 -2
  30. package/dist/chunks/{request-tracing-btahnm2b.js → auth-kg0ybx4v.js} +3 -3
  31. package/dist/chunks/{request-tracing-4q6twprv.js → auth-m119esdv.js} +25 -12
  32. package/dist/chunks/{request-tracing-wd7hxrwh.js → auth-mzqcpmk1.js} +4 -4
  33. package/dist/chunks/auth-n321d8vm.js +46 -0
  34. package/dist/chunks/{request-tracing-dhcmfdv7.js → auth-nz17qv97.js} +7 -3
  35. package/dist/chunks/{request-tracing-05qm07w5.js → auth-pg3y39tj.js} +2 -2
  36. package/dist/chunks/{request-tracing-b2acc4mg.js → auth-q1mbf0ed.js} +2 -2
  37. package/dist/chunks/{request-tracing-ny1j968n.js → auth-q44yktpv.js} +2 -2
  38. package/dist/chunks/{request-tracing-4fy84009.js → auth-r6xkfcdx.js} +1 -1
  39. package/dist/chunks/{request-tracing-0c5s68vs.js → auth-rfdwk27n.js} +2 -2
  40. package/dist/chunks/{request-tracing-npg11btk.js → auth-rjz2az0g.js} +11 -11
  41. package/dist/chunks/{request-tracing-1v577ncx.js → auth-s62wjkvx.js} +2 -2
  42. package/dist/chunks/{request-tracing-te8jwba1.js → auth-s9tkswmw.js} +2 -2
  43. package/dist/chunks/{request-tracing-9z9c38b9.js → auth-sxtrrcma.js} +33 -33
  44. package/dist/chunks/{request-tracing-f559fakr.js → auth-v8aqacn3.js} +2 -2
  45. package/dist/chunks/{request-tracing-mzs0n5xz.js → auth-w9jcwh65.js} +7 -7
  46. package/dist/chunks/{request-tracing-6z9pvq7p.js → auth-x4b2rtcb.js} +1 -1
  47. package/dist/chunks/auth-xthc02cw.js +6 -0
  48. package/dist/chunks/{request-tracing-3te71694.js → auth-yjbzmfhm.js} +5 -5
  49. package/dist/chunks/{request-tracing-zcvan105.js → auth-zbe9jfhy.js} +1 -1
  50. package/dist/chunks/{request-tracing-4t612tqm.js → auth-zvbhqxt5.js} +22 -6
  51. package/dist/cors.js +1 -1
  52. package/dist/event-feed.js +1 -1
  53. package/dist/fetch.js +52 -50
  54. package/dist/handlers/agent.js +6 -6
  55. package/dist/handlers/command.js +6 -6
  56. package/dist/handlers/config.js +6 -6
  57. package/dist/handlers/credential.js +6 -6
  58. package/dist/handlers/debug.js +6 -6
  59. package/dist/handlers/event.js +7 -7
  60. package/dist/handlers/form.js +6 -6
  61. package/dist/handlers/fs.js +6 -6
  62. package/dist/handlers/generate.js +6 -6
  63. package/dist/handlers/integration.js +6 -6
  64. package/dist/handlers/location.js +6 -6
  65. package/dist/handlers/mcp.js +8 -8
  66. package/dist/handlers/media.d.ts +6 -0
  67. package/dist/handlers/media.js +6 -0
  68. package/dist/handlers/message.js +7 -6
  69. package/dist/handlers/migration.js +6 -6
  70. package/dist/handlers/model.js +6 -6
  71. package/dist/handlers/permission.js +6 -6
  72. package/dist/handlers/persistent-pty.d.ts +1 -1
  73. package/dist/handlers/persistent-pty.js +9 -8
  74. package/dist/handlers/plugin.js +6 -6
  75. package/dist/handlers/project.js +6 -6
  76. package/dist/handlers/provider.js +6 -6
  77. package/dist/handlers/pty-socket.js +1 -1
  78. package/dist/handlers/pty.js +8 -8
  79. package/dist/handlers/reference.js +6 -6
  80. package/dist/handlers/rpc.js +6 -6
  81. package/dist/handlers/server.js +9 -9
  82. package/dist/handlers/session-error.js +1 -1
  83. package/dist/handlers/session.js +7 -6
  84. package/dist/handlers/shell.js +6 -6
  85. package/dist/handlers/skill.js +6 -6
  86. package/dist/handlers/usage.js +6 -6
  87. package/dist/handlers/vcs.js +6 -6
  88. package/dist/handlers/voice.js +6 -6
  89. package/dist/handlers/websearch.js +6 -6
  90. package/dist/handlers/worktree.js +6 -6
  91. package/dist/handlers.d.ts +1 -1
  92. package/dist/handlers.js +46 -44
  93. package/dist/location.js +2 -2
  94. package/dist/media-uri.d.ts +6 -0
  95. package/dist/media-uri.js +6 -0
  96. package/dist/middleware/authorization.js +2 -2
  97. package/dist/middleware/form-location.js +3 -3
  98. package/dist/middleware/schema-error.js +1 -1
  99. package/dist/middleware/session-location.js +3 -3
  100. package/dist/pairing.js +3 -3
  101. package/dist/process.js +54 -52
  102. package/dist/request-tracing.js +1 -1
  103. package/dist/routes.js +49 -47
  104. package/dist/server-info.js +3 -3
  105. package/dist/service-status.js +3 -3
  106. package/dist/workerd.js +53 -51
  107. package/package.json +8 -8
  108. /package/dist/chunks/{request-tracing-9rqn6x4v.js → auth-9rqn6x4v.js} +0 -0
  109. /package/dist/chunks/{request-tracing-erzfdgke.js → auth-erzfdgke.js} +0 -0
  110. /package/dist/chunks/{request-tracing-h6rt5k9s.js → auth-h6rt5k9s.js} +0 -0
  111. /package/dist/chunks/{request-tracing-q4bn6dy8.js → auth-q4bn6dy8.js} +0 -0
  112. /package/dist/chunks/{request-tracing-smaf4a18.js → auth-smaf4a18.js} +0 -0
  113. /package/dist/chunks/{request-tracing-yc7nft6q.js → auth-yc7nft6q.js} +0 -0
package/dist/api.d.ts CHANGED
@@ -4193,12 +4193,14 @@ export declare const Api: import("@opencode/protocol/api").Api<LocationMiddlewar
4193
4193
  readonly additions: import("effect/Schema").Int;
4194
4194
  readonly deletions: import("effect/Schema").Int;
4195
4195
  readonly status: import("effect/Schema").Literals<readonly ["added", "deleted", "modified"]>;
4196
+ readonly more: import("effect/Schema").decodeTo<import("effect/Schema").optional<import("effect/Schema").toType<import("effect/Schema").Literal<true>>>, import("effect/Schema").optionalKey<import("effect/Schema").Literal<true>>, never, never>;
4196
4197
  }>>>>, import("effect/Schema").optionalKey<import("effect/Schema").$Array<import("effect/Schema").Struct<{
4197
4198
  readonly file: import("effect/Schema").String;
4198
4199
  readonly patch: import("effect/Schema").String;
4199
4200
  readonly additions: import("effect/Schema").Int;
4200
4201
  readonly deletions: import("effect/Schema").Int;
4201
4202
  readonly status: import("effect/Schema").Literals<readonly ["added", "deleted", "modified"]>;
4203
+ readonly more: import("effect/Schema").decodeTo<import("effect/Schema").optional<import("effect/Schema").toType<import("effect/Schema").Literal<true>>>, import("effect/Schema").optionalKey<import("effect/Schema").Literal<true>>, never, never>;
4202
4204
  }>>>, never, never>;
4203
4205
  }>;
4204
4206
  }>;
@@ -4226,12 +4228,14 @@ export declare const Api: import("@opencode/protocol/api").Api<LocationMiddlewar
4226
4228
  readonly additions: import("effect/Schema").Int;
4227
4229
  readonly deletions: import("effect/Schema").Int;
4228
4230
  readonly status: import("effect/Schema").Literals<readonly ["added", "deleted", "modified"]>;
4231
+ readonly more: import("effect/Schema").decodeTo<import("effect/Schema").optional<import("effect/Schema").toType<import("effect/Schema").Literal<true>>>, import("effect/Schema").optionalKey<import("effect/Schema").Literal<true>>, never, never>;
4229
4232
  }>>>>, import("effect/Schema").optionalKey<import("effect/Schema").$Array<import("effect/Schema").Struct<{
4230
4233
  readonly file: import("effect/Schema").String;
4231
4234
  readonly patch: import("effect/Schema").String;
4232
4235
  readonly additions: import("effect/Schema").Int;
4233
4236
  readonly deletions: import("effect/Schema").Int;
4234
4237
  readonly status: import("effect/Schema").Literals<readonly ["added", "deleted", "modified"]>;
4238
+ readonly more: import("effect/Schema").decodeTo<import("effect/Schema").optional<import("effect/Schema").toType<import("effect/Schema").Literal<true>>>, import("effect/Schema").optionalKey<import("effect/Schema").Literal<true>>, never, never>;
4235
4239
  }>>>, never, never>;
4236
4240
  }>;
4237
4241
  }>;
@@ -7008,6 +7012,7 @@ export declare const Api: import("@opencode/protocol/api").Api<LocationMiddlewar
7008
7012
  readonly additions: number;
7009
7013
  readonly deletions: number;
7010
7014
  readonly status: "added" | "deleted" | "modified";
7015
+ readonly more?: true | undefined;
7011
7016
  }[] | undefined;
7012
7017
  };
7013
7018
  };
package/dist/api.js CHANGED
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  Api2
3
- } from "./chunks/request-tracing-j87xz9bt.js";
4
- import"./chunks/request-tracing-htyf2qs7.js";
5
- import"./chunks/request-tracing-b3bmdkga.js";
6
- import"./chunks/request-tracing-50bbk3b2.js";
7
- import"./chunks/request-tracing-smaf4a18.js";
3
+ } from "./chunks/auth-0e81et3m.js";
4
+ import"./chunks/auth-b3bmdkga.js";
5
+ import"./chunks/auth-htyf2qs7.js";
6
+ import"./chunks/auth-50bbk3b2.js";
7
+ import"./chunks/auth-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/request-tracing-j4at0y5c.js";
10
+ } from "./chunks/auth-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
  Api2
3
- } from "./request-tracing-j87xz9bt.js";
3
+ } from "./auth-0e81et3m.js";
4
4
 
5
5
  // src/handlers/project.ts
6
6
  import { Project } from "@opencode/core/project";
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  LocationMiddleware2
3
- } from "./request-tracing-50bbk3b2.js";
3
+ } from "./auth-50bbk3b2.js";
4
4
  import {
5
5
  FormLocationMiddleware2
6
- } from "./request-tracing-htyf2qs7.js";
6
+ } from "./auth-htyf2qs7.js";
7
7
  import {
8
8
  SessionLocationMiddleware2
9
- } from "./request-tracing-b3bmdkga.js";
9
+ } from "./auth-b3bmdkga.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 "./request-tracing-50bbk3b2.js";
3
+ } from "./auth-50bbk3b2.js";
4
4
  import {
5
5
  Api2
6
- } from "./request-tracing-j87xz9bt.js";
6
+ } from "./auth-0e81et3m.js";
7
7
 
8
8
  // src/handlers/fs.ts
9
9
  import { FileSystem } from "@opencode/core/filesystem";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  Api2
3
- } from "./request-tracing-j87xz9bt.js";
3
+ } from "./auth-0e81et3m.js";
4
4
 
5
5
  // src/handlers/rpc.ts
6
6
  import { Rpc } from "@opencode/core/rpc";
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  response2
3
- } from "./request-tracing-50bbk3b2.js";
3
+ } from "./auth-50bbk3b2.js";
4
4
  import {
5
5
  Api2
6
- } from "./request-tracing-j87xz9bt.js";
6
+ } from "./auth-0e81et3m.js";
7
7
 
8
8
  // src/handlers/integration.ts
9
9
  import { Integration } from "@opencode/core/integration";
@@ -1,15 +1,15 @@
1
1
  import {
2
2
  __export
3
- } from "./request-tracing-9rqn6x4v.js";
3
+ } from "./auth-9rqn6x4v.js";
4
4
 
5
5
  // src/service-status.ts
6
6
  var exports_service_status = {};
7
7
  __export(exports_service_status, {
8
8
  Status: () => exports_service_status,
9
- make: () => make3
9
+ make: () => make2
10
10
  });
11
11
  import { Effect, Ref } from "effect";
12
- var make3 = Effect.fnUntraced(function* (options = {}) {
12
+ var make2 = Effect.fnUntraced(function* (options = {}) {
13
13
  const current = yield* Ref.make(options.initial ?? { type: "starting" });
14
14
  const beginStopping = Ref.update(current, (status) => status.type === "stopping" ? status : { type: "stopping" });
15
15
  return {
@@ -20,4 +20,4 @@ var make3 = Effect.fnUntraced(function* (options = {}) {
20
20
  };
21
21
  });
22
22
 
23
- export { make3, exports_service_status };
23
+ export { make2, exports_service_status };
@@ -1,26 +1,26 @@
1
1
  import {
2
2
  isAllowedCorsOrigin2
3
- } from "./request-tracing-q4bn6dy8.js";
3
+ } from "./auth-q4bn6dy8.js";
4
4
  import {
5
5
  createRoutes2
6
- } from "./request-tracing-npg11btk.js";
6
+ } from "./auth-rjz2az0g.js";
7
7
  import {
8
8
  __export
9
- } from "./request-tracing-9rqn6x4v.js";
9
+ } from "./auth-9rqn6x4v.js";
10
10
 
11
11
  // src/fetch.ts
12
12
  var exports_fetch = {};
13
13
  __export(exports_fetch, {
14
14
  ServerFetch: () => exports_fetch,
15
- make: () => make2
15
+ make: () => make3
16
16
  });
17
17
  import { Context, Effect, Layer } from "effect";
18
18
  import { HttpEffect, HttpMiddleware, HttpRouter, HttpServer } from "effect/http";
19
19
  import { SessionRestart } from "@opencode/core/session/execution/restart";
20
- var make2 = Effect.fn("ServerFetch.make")(function* (options = {}, boot = {}) {
20
+ var make3 = Effect.fn("ServerFetch.make")(function* (options = {}, boot = {}) {
21
21
  const context = yield* Layer.build(createRoutes2(options, () => [], boot.overrides ?? []).pipe(Layer.provide(HttpServer.layerServices)));
22
22
  yield* Effect.forkDetach(Context.get(context, SessionRestart.Service).resumeSuspendedSessions);
23
23
  return Context.get(context, HttpRouter.HttpRouter).asHttpEffect().pipe(HttpMiddleware.cors({ allowedOrigins: (origin) => isAllowedCorsOrigin2(origin, options), maxAge: 86400 }), HttpEffect.toWebHandlerWith(context));
24
24
  });
25
25
 
26
- export { make2, exports_fetch };
26
+ export { make3, exports_fetch };
@@ -1,13 +1,16 @@
1
1
  import {
2
2
  Api2
3
- } from "./request-tracing-j87xz9bt.js";
3
+ } from "./auth-0e81et3m.js";
4
4
  import {
5
5
  CorsConfig2,
6
6
  isAllowedRequestOrigin2
7
- } from "./request-tracing-q4bn6dy8.js";
7
+ } from "./auth-q4bn6dy8.js";
8
+ import {
9
+ makeMediaGet2
10
+ } from "./auth-n321d8vm.js";
8
11
  import {
9
12
  runPtySocket2
10
- } from "./request-tracing-h6rt5k9s.js";
13
+ } from "./auth-h6rt5k9s.js";
11
14
 
12
15
  // src/handlers/persistent-pty.ts
13
16
  import { PersistentPty } from "@opencode/core/persistent-pty";
@@ -26,7 +29,8 @@ var PersistentPtyHandler2 = HttpApiBuilder.group(Api2, "server.experimental", (h
26
29
  const tickets = yield* PtyTicket.Service;
27
30
  const cors = yield* CorsConfig2;
28
31
  const pty = yield* PersistentPty.Service;
29
- return handlers.handle("persistentPty.read", Effect.fn(function* (ctx) {
32
+ const mediaGet = yield* makeMediaGet2;
33
+ return handlers.handleRaw("media.get", (ctx) => mediaGet(ctx.params.hash, ctx.request)).handle("persistentPty.read", Effect.fn(function* (ctx) {
30
34
  return { data: yield* pty.read(ctx.params.sessionID, ctx.query.lines).pipe(mapUnavailable) };
31
35
  })).handle("persistentPty.list", Effect.fn(function* (ctx) {
32
36
  return { data: yield* pty.list(ctx.params.sessionID).pipe(mapUnavailable) };
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  missingSession2
3
- } from "./request-tracing-smaf4a18.js";
3
+ } from "./auth-smaf4a18.js";
4
4
 
5
5
  // src/location.ts
6
6
  import { FileSystem } from "@opencode/core/filesystem";
@@ -4,7 +4,7 @@ import {
4
4
  authorized2,
5
5
  verifySession2,
6
6
  sessionCookieName2
7
- } from "./request-tracing-j4at0y5c.js";
7
+ } from "./auth-j4at0y5c.js";
8
8
 
9
9
  // src/middleware/authorization.ts
10
10
  import { UnauthorizedError } from "@opencode/protocol/errors";
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  awaitPlugins2,
3
3
  response2
4
- } from "./request-tracing-50bbk3b2.js";
4
+ } from "./auth-50bbk3b2.js";
5
5
  import {
6
6
  Api2
7
- } from "./request-tracing-j87xz9bt.js";
7
+ } from "./auth-0e81et3m.js";
8
8
 
9
9
  // src/handlers/usage.ts
10
10
  import { UsageLimits } from "@opencode/core/usage-limits";
@@ -2,17 +2,17 @@ import {
2
2
  locationErrors2,
3
3
  response2,
4
4
  requestRef2
5
- } from "./request-tracing-50bbk3b2.js";
5
+ } from "./auth-50bbk3b2.js";
6
6
  import {
7
7
  Api2
8
- } from "./request-tracing-j87xz9bt.js";
8
+ } from "./auth-0e81et3m.js";
9
9
  import {
10
10
  CorsConfig2,
11
11
  isAllowedRequestOrigin2
12
- } from "./request-tracing-q4bn6dy8.js";
12
+ } from "./auth-q4bn6dy8.js";
13
13
  import {
14
14
  runPtySocket2
15
- } from "./request-tracing-h6rt5k9s.js";
15
+ } from "./auth-h6rt5k9s.js";
16
16
 
17
17
  // src/handlers/pty.ts
18
18
  import { Pty } from "@opencode/core/pty";
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  awaitPlugins2,
3
3
  response2
4
- } from "./request-tracing-50bbk3b2.js";
4
+ } from "./auth-50bbk3b2.js";
5
5
  import {
6
6
  Api2
7
- } from "./request-tracing-j87xz9bt.js";
7
+ } from "./auth-0e81et3m.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 "./request-tracing-50bbk3b2.js";
4
+ } from "./auth-50bbk3b2.js";
5
5
 
6
6
  // src/middleware/session-location.ts
7
7
  import { Instance } from "@opencode/core/instance/service";
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  response2
3
- } from "./request-tracing-50bbk3b2.js";
3
+ } from "./auth-50bbk3b2.js";
4
4
  import {
5
5
  Api2
6
- } from "./request-tracing-j87xz9bt.js";
6
+ } from "./auth-0e81et3m.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
  Api2
3
- } from "./request-tracing-j87xz9bt.js";
3
+ } from "./auth-0e81et3m.js";
4
4
 
5
5
  // src/handlers/credential.ts
6
6
  import { Credential } from "@opencode/core/credential";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  __export
3
- } from "./request-tracing-9rqn6x4v.js";
3
+ } from "./auth-9rqn6x4v.js";
4
4
 
5
5
  // src/event-feed.ts
6
6
  var exports_event_feed = {};
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  awaitPlugins2,
3
3
  response2
4
- } from "./request-tracing-50bbk3b2.js";
4
+ } from "./auth-50bbk3b2.js";
5
5
  import {
6
6
  Api2
7
- } from "./request-tracing-j87xz9bt.js";
7
+ } from "./auth-0e81et3m.js";
8
8
 
9
9
  // src/handlers/websearch.ts
10
10
  import { WebSearch } from "@opencode/core/websearch";
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  locationErrors2,
3
3
  awaitPlugins2
4
- } from "./request-tracing-50bbk3b2.js";
4
+ } from "./auth-50bbk3b2.js";
5
5
  import {
6
6
  Api2
7
- } from "./request-tracing-j87xz9bt.js";
7
+ } from "./auth-0e81et3m.js";
8
8
 
9
9
  // src/handlers/voice.ts
10
10
  import { Location } from "@opencode/core/location";
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  response2
3
- } from "./request-tracing-50bbk3b2.js";
3
+ } from "./auth-50bbk3b2.js";
4
4
  import {
5
5
  Api2
6
- } from "./request-tracing-j87xz9bt.js";
6
+ } from "./auth-0e81et3m.js";
7
7
 
8
8
  // src/handlers/shell.ts
9
9
  import { Shell } from "@opencode/core/shell";
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  requestRef2
3
- } from "./request-tracing-50bbk3b2.js";
3
+ } from "./auth-50bbk3b2.js";
4
4
  import {
5
5
  Api2
6
- } from "./request-tracing-j87xz9bt.js";
6
+ } from "./auth-0e81et3m.js";
7
7
 
8
8
  // src/handlers/debug.ts
9
9
  import { LocationServiceMap } from "@opencode/core/location-service-map";
@@ -1,18 +1,18 @@
1
1
  import {
2
2
  Api2
3
- } from "./request-tracing-j87xz9bt.js";
3
+ } from "./auth-0e81et3m.js";
4
4
  import {
5
5
  SESSION_TTL_SECONDS2,
6
6
  Config2,
7
7
  issueSession2,
8
8
  sessionCookieName2
9
- } from "./request-tracing-j4at0y5c.js";
10
- import {
11
- Service3
12
- } from "./request-tracing-3te71694.js";
9
+ } from "./auth-j4at0y5c.js";
13
10
  import {
14
11
  Service4
15
- } from "./request-tracing-mzs0n5xz.js";
12
+ } from "./auth-yjbzmfhm.js";
13
+ import {
14
+ Service3
15
+ } from "./auth-w9jcwh65.js";
16
16
 
17
17
  // src/handlers/server.ts
18
18
  import { hostname } from "node:os";
@@ -22,10 +22,10 @@ import { HttpApiBuilder } from "effect/http-api";
22
22
  import { PersistentPty } from "@opencode/core/persistent-pty";
23
23
  import { UnauthorizedError } from "@opencode/protocol/errors";
24
24
  var ServerHandler2 = HttpApiBuilder.group(Api2, "server.server", (handlers) => Effect.gen(function* () {
25
- const pairing = yield* Service4;
25
+ const pairing = yield* Service3;
26
26
  const auth = yield* Config2;
27
27
  return handlers.handle("server.info", () => Effect.gen(function* () {
28
- const info = yield* Service3;
28
+ const info = yield* Service4;
29
29
  return {
30
30
  version: info.app.version ?? "unknown",
31
31
  pid: process.pid ?? 0,
@@ -2,7 +2,7 @@ import {
2
2
  locationErrors2,
3
3
  sessionInfo2,
4
4
  requestRef2
5
- } from "./request-tracing-50bbk3b2.js";
5
+ } from "./auth-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 "./request-tracing-j87xz9bt.js";
3
+ } from "./auth-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 "./request-tracing-9rqn6x4v.js";
3
+ } from "./auth-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 "./request-tracing-50bbk3b2.js";
3
+ } from "./auth-50bbk3b2.js";
4
4
  import {
5
5
  Api2
6
- } from "./request-tracing-j87xz9bt.js";
6
+ } from "./auth-0e81et3m.js";
7
7
 
8
8
  // src/handlers/plugin.ts
9
9
  import { Plugin } from "@opencode/core/plugin";
@@ -1,14 +1,14 @@
1
1
  import {
2
2
  missingSession2
3
- } from "./request-tracing-smaf4a18.js";
3
+ } from "./auth-smaf4a18.js";
4
4
  import {
5
5
  locationErrors2,
6
6
  response2,
7
7
  sessionInfo2
8
- } from "./request-tracing-50bbk3b2.js";
8
+ } from "./auth-50bbk3b2.js";
9
9
  import {
10
10
  Api2
11
- } from "./request-tracing-j87xz9bt.js";
11
+ } from "./auth-0e81et3m.js";
12
12
 
13
13
  // src/handlers/permission.ts
14
14
  import { Instance } from "@opencode/core/instance/service";
@@ -1,17 +1,22 @@
1
1
  import {
2
2
  missingSession2,
3
3
  failedMessageDecode2
4
- } from "./request-tracing-smaf4a18.js";
4
+ } from "./auth-smaf4a18.js";
5
5
  import {
6
6
  Api2
7
- } from "./request-tracing-j87xz9bt.js";
7
+ } from "./auth-0e81et3m.js";
8
+ import {
9
+ wantsMediaRefs2
10
+ } from "./auth-xthc02cw.js";
8
11
 
9
12
  // src/handlers/message.ts
10
13
  import { SessionMessage } from "@opencode/core/session/message";
11
14
  import { Session } from "@opencode/core/session";
12
15
  import { Effect, Option, Schema } from "effect";
16
+ import { HttpServerResponse } from "effect/http";
13
17
  import { HttpApiBuilder } from "effect/http-api";
14
18
  import { InvalidCursorError } from "@opencode/protocol/errors";
19
+ import { SessionMediaMessagesResponse } from "@opencode/protocol/groups/message";
15
20
  var DefaultMessagesLimit = 50;
16
21
  var Cursor = Schema.Struct({
17
22
  id: SessionMessage.ID,
@@ -34,22 +39,30 @@ var MessageHandler2 = HttpApiBuilder.group(Api2, "server.message", (handlers) =>
34
39
  return yield* new InvalidCursorError({ message: "Cursor cannot be combined with order" });
35
40
  const decoded = ctx.query.cursor ? Option.getOrUndefined(cursor.decode(ctx.query.cursor)) ?? (yield* new InvalidCursorError({ message: "Invalid cursor" })) : undefined;
36
41
  const order = decoded?.order ?? ctx.query.order ?? "desc";
37
- const messages = yield* session.messages({
42
+ const input = {
38
43
  sessionID: ctx.params.sessionID,
39
44
  limit: ctx.query.limit ?? DefaultMessagesLimit,
40
45
  order,
41
46
  type: ctx.query.type,
42
47
  cursor: decoded ? { id: decoded.id, direction: decoded.direction } : undefined
43
- }).pipe(Effect.catchTag("Session.NotFoundError", missingSession2), Effect.catchTag("Session.MessageDecodeError", failedMessageDecode2));
44
- const first = messages[0];
45
- const last = messages.at(-1);
46
- return {
47
- data: messages,
48
- cursor: {
49
- previous: first ? cursor.encode(first, order, "previous") : undefined,
50
- next: last ? cursor.encode(last, order, "next") : undefined
51
- }
52
48
  };
49
+ const page = (messages) => {
50
+ const first = messages[0];
51
+ const last = messages.at(-1);
52
+ return {
53
+ data: messages,
54
+ cursor: {
55
+ previous: first ? cursor.encode(first, order, "previous") : undefined,
56
+ next: last ? cursor.encode(last, order, "next") : undefined
57
+ }
58
+ };
59
+ };
60
+ if (wantsMediaRefs2(ctx.request)) {
61
+ const messages = yield* session.messagesWithRefs(input).pipe(Effect.catchTag("Session.NotFoundError", missingSession2), Effect.catchTag("Session.MessageDecodeError", failedMessageDecode2));
62
+ return yield* HttpServerResponse.schemaJson(SessionMediaMessagesResponse)(page(messages)).pipe(Effect.orDie);
63
+ }
64
+ const messages = yield* session.messages(input).pipe(Effect.catchTag("Session.NotFoundError", missingSession2), Effect.catchTag("Session.MessageDecodeError", failedMessageDecode2));
65
+ return page(messages);
53
66
  }));
54
67
  }));
55
68
 
@@ -2,17 +2,17 @@ import {
2
2
  locationErrors2,
3
3
  response2,
4
4
  requestRef2
5
- } from "./request-tracing-50bbk3b2.js";
5
+ } from "./auth-50bbk3b2.js";
6
6
  import {
7
7
  Api2
8
- } from "./request-tracing-j87xz9bt.js";
8
+ } from "./auth-0e81et3m.js";
9
9
  import {
10
10
  CorsConfig2,
11
11
  isAllowedRequestOrigin2
12
- } from "./request-tracing-q4bn6dy8.js";
12
+ } from "./auth-q4bn6dy8.js";
13
13
  import {
14
14
  runPtySocket2
15
- } from "./request-tracing-h6rt5k9s.js";
15
+ } from "./auth-h6rt5k9s.js";
16
16
 
17
17
  // src/handlers/mcp.ts
18
18
  import { Location } from "@opencode/core/location";
@@ -0,0 +1,46 @@
1
+ // src/handlers/media.ts
2
+ import { Database } from "@opencode/core/database/database";
3
+ import { SessionBlob } from "@opencode/core/session/blob";
4
+ import { FileNotFoundError } from "@opencode/protocol/errors";
5
+ import { Effect } from "effect";
6
+ import { HttpServerResponse } from "effect/http";
7
+ var INLINE_IMAGE_MIMES = new Set(["image/png", "image/jpeg", "image/gif", "image/webp"]);
8
+ var CACHE_CONTROL = "private, max-age=31536000, immutable";
9
+ var SECURITY_HEADERS = {
10
+ "x-content-type-options": "nosniff",
11
+ "content-security-policy": "default-src 'none'; sandbox"
12
+ };
13
+ var makeMediaGet2 = Effect.gen(function* () {
14
+ const { db } = yield* Database.Service;
15
+ return (hash, request) => Effect.gen(function* () {
16
+ const path = `/api/experimental/media/${hash}`;
17
+ const blob = yield* SessionBlob.read(db, hash);
18
+ if (!blob)
19
+ return yield* new FileNotFoundError({ path, message: `Media blob not found: ${hash}` });
20
+ const etag = `"${hash}"`;
21
+ const inline = INLINE_IMAGE_MIMES.has(blob.mime);
22
+ const headers = {
23
+ "cache-control": CACHE_CONTROL,
24
+ etag,
25
+ ...SECURITY_HEADERS,
26
+ ...inline ? {} : { "content-disposition": "attachment" }
27
+ };
28
+ if (matchesIfNoneMatch(request.headers["if-none-match"], etag))
29
+ return HttpServerResponse.empty({ status: 304, headers });
30
+ return HttpServerResponse.uint8Array(blob.data, {
31
+ status: 200,
32
+ contentType: inline ? blob.mime : "application/octet-stream",
33
+ headers
34
+ });
35
+ });
36
+ });
37
+ function matchesIfNoneMatch(ifNoneMatch, etag) {
38
+ if (ifNoneMatch === undefined)
39
+ return false;
40
+ return ifNoneMatch.split(",").some((tag) => {
41
+ const trimmed = tag.trim();
42
+ return trimmed === "*" || trimmed.replace(/^w\//i, "") === etag;
43
+ });
44
+ }
45
+
46
+ export { makeMediaGet2 };
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  response2
3
- } from "./request-tracing-50bbk3b2.js";
3
+ } from "./auth-50bbk3b2.js";
4
4
  import {
5
5
  Api2
6
- } from "./request-tracing-j87xz9bt.js";
6
+ } from "./auth-0e81et3m.js";
7
7
 
8
8
  // src/handlers/vcs.ts
9
9
  import { Vcs } from "@opencode/core/vcs";
@@ -64,7 +64,11 @@ var VcsHandler2 = HttpApiBuilder.group(Api2, "server.vcs", (handlers) => Effect.
64
64
  return yield* vcs.branches({ search: ctx.query.search, limit: Math.min(ctx.query.limit ?? 50, 100) });
65
65
  }))).handle("vcs.diff", (ctx) => response2(Effect.gen(function* () {
66
66
  const vcs = yield* Vcs.Service;
67
- return yield* vcs.diff(ctx.query.mode, { context: ctx.query.context, base: ctx.query.base }).pipe(Effect.mapError((error) => new ServiceUnavailableError({ service: "vcs", message: error.message })));
67
+ return yield* vcs.diff(ctx.query.mode, {
68
+ context: ctx.query.context,
69
+ base: ctx.query.base,
70
+ untracked: ctx.query.untracked
71
+ }).pipe(Effect.mapError((error) => new ServiceUnavailableError({ service: "vcs", message: error.message })));
68
72
  })));
69
73
  }));
70
74