@opencode/server 2.2.5 → 2.2.6

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 (130) hide show
  1. package/dist/api.js +5 -5
  2. package/dist/auth.js +1 -1
  3. package/dist/chunks/{location-02a60aws.js → options-02a60aws.js} +2 -2
  4. package/dist/chunks/{location-059rbh9c.js → options-059rbh9c.js} +1 -1
  5. package/dist/chunks/{location-0r9ve3h3.js → options-0r9ve3h3.js} +2 -2
  6. package/dist/chunks/{location-ja97ph8b.js → options-32zxn73z.js} +4 -4
  7. package/dist/chunks/{location-c48av16v.js → options-3k93sd3m.js} +15 -14
  8. package/dist/chunks/{location-7dtbad8d.js → options-3te71694.js} +7 -7
  9. package/dist/chunks/{location-4xzps9pr.js → options-4xzps9pr.js} +2 -2
  10. package/dist/chunks/{location-pbxe02h0.js → options-5km4ra1j.js} +8 -6
  11. package/dist/chunks/{location-62bfwtjc.js → options-62bfwtjc.js} +2 -2
  12. package/dist/chunks/options-78rcgzsr.js +28 -0
  13. package/dist/chunks/{location-7b9xm1qg.js → options-7b9xm1qg.js} +1 -1
  14. package/dist/chunks/{location-g6bmzkma.js → options-7jx462hf.js} +11 -7
  15. package/dist/chunks/{location-bknbvq67.js → options-82vbxjqd.js} +7 -5
  16. package/dist/chunks/{location-85kbrn7y.js → options-85kbrn7y.js} +2 -2
  17. package/dist/chunks/{location-5n22zpzy.js → options-9f2aybte.js} +6 -6
  18. package/dist/chunks/{location-9q55v56g.js → options-9q55v56g.js} +2 -2
  19. package/dist/chunks/{location-axx4wwen.js → options-axx4wwen.js} +2 -2
  20. package/dist/chunks/{location-ey9m07rx.js → options-b5crh3ce.js} +3 -3
  21. package/dist/chunks/{location-dczgzh3x.js → options-dczgzh3x.js} +2 -2
  22. package/dist/chunks/{location-ddnay6e1.js → options-ddnay6e1.js} +1 -1
  23. package/dist/chunks/{location-n321d8vm.js → options-djr0jy89.js} +8 -6
  24. package/dist/chunks/{location-tgb4pddq.js → options-dx07zb36.js} +9 -6
  25. package/dist/chunks/{location-e0z6mnzj.js → options-e0z6mnzj.js} +1 -1
  26. package/dist/chunks/{location-e6e4kz0w.js → options-e6e4kz0w.js} +1 -1
  27. package/dist/chunks/{location-f0kpaq89.js → options-f0kpaq89.js} +1 -1
  28. package/dist/chunks/{location-f96zeczf.js → options-f96zeczf.js} +2 -2
  29. package/dist/chunks/{location-gymtz25n.js → options-gymtz25n.js} +1 -1
  30. package/dist/chunks/options-hmwn16zp.js +39 -0
  31. package/dist/chunks/{location-hr24310e.js → options-hr24310e.js} +1 -1
  32. package/dist/chunks/{location-1jtv083t.js → options-j1bh82b8.js} +2 -2
  33. package/dist/chunks/{location-j4at0y5c.js → options-j4at0y5c.js} +1 -1
  34. package/dist/chunks/{location-j6d0mxrp.js → options-j6d0mxrp.js} +2 -2
  35. package/dist/chunks/{location-f1ds1268.js → options-j77vxdbh.js} +9 -4
  36. package/dist/chunks/{location-1kj4am0h.js → options-kgr24bct.js} +11 -5
  37. package/dist/chunks/{location-kqr36gas.js → options-kqr36gas.js} +1 -1
  38. package/dist/chunks/{location-mam5ppd3.js → options-mam5ppd3.js} +1 -1
  39. package/dist/chunks/{location-h6rt5k9s.js → options-q187pxxd.js} +7 -1
  40. package/dist/chunks/{location-wy3c18g3.js → options-q59gseq4.js} +35 -35
  41. package/dist/chunks/{location-q7gnt7ra.js → options-q7gnt7ra.js} +3 -3
  42. package/dist/chunks/{location-z48nkxh0.js → options-rbck9dgd.js} +2 -2
  43. package/dist/chunks/{location-nzrkt0f5.js → options-s9jd931e.js} +4 -4
  44. package/dist/chunks/options-t32e1bbt.js +32 -0
  45. package/dist/chunks/{location-v7p1kzzd.js → options-v7p1kzzd.js} +3 -3
  46. package/dist/chunks/{location-va7wgp70.js → options-va7wgp70.js} +2 -2
  47. package/dist/chunks/{location-vyzvby0b.js → options-vyzvby0b.js} +2 -2
  48. package/dist/chunks/{location-qfyg9gb7.js → options-wecgp61r.js} +7 -7
  49. package/dist/chunks/{location-x74w7e1f.js → options-x74w7e1f.js} +1 -1
  50. package/dist/chunks/{location-xad49dn3.js → options-xad49dn3.js} +2 -2
  51. package/dist/chunks/{location-xfynz25m.js → options-xfynz25m.js} +2 -2
  52. package/dist/chunks/{location-xwy6frfd.js → options-xwy6frfd.js} +1 -1
  53. package/dist/chunks/{location-y56ann6c.js → options-y56ann6c.js} +2 -2
  54. package/dist/chunks/{location-zzxz7279.js → options-zzxz7279.js} +2 -2
  55. package/dist/content-headers.d.ts +13 -0
  56. package/dist/content-headers.js +12 -0
  57. package/dist/cors.js +1 -1
  58. package/dist/event-feed.js +5 -5
  59. package/dist/fetch.d.ts +1 -0
  60. package/dist/fetch.js +56 -52
  61. package/dist/handlers/agent.js +6 -6
  62. package/dist/handlers/artifact.js +3 -3
  63. package/dist/handlers/command.js +6 -6
  64. package/dist/handlers/config.js +6 -6
  65. package/dist/handlers/credential.js +7 -7
  66. package/dist/handlers/debug.js +6 -6
  67. package/dist/handlers/event.js +7 -7
  68. package/dist/handlers/form.js +6 -6
  69. package/dist/handlers/fs.js +7 -6
  70. package/dist/handlers/generate.js +6 -6
  71. package/dist/handlers/integration.js +6 -6
  72. package/dist/handlers/job.d.ts +51 -0
  73. package/dist/handlers/job.js +7 -0
  74. package/dist/handlers/location.js +6 -6
  75. package/dist/handlers/mcp.js +8 -8
  76. package/dist/handlers/media.js +2 -1
  77. package/dist/handlers/message.js +7 -7
  78. package/dist/handlers/migration.js +6 -6
  79. package/dist/handlers/model.js +6 -6
  80. package/dist/handlers/permission.js +6 -6
  81. package/dist/handlers/persistent-pty.d.ts +1 -1
  82. package/dist/handlers/persistent-pty.js +13 -11
  83. package/dist/handlers/plugin.js +6 -6
  84. package/dist/handlers/project.js +6 -6
  85. package/dist/handlers/provider.js +6 -6
  86. package/dist/handlers/pty-socket.d.ts +2 -0
  87. package/dist/handlers/pty-socket.js +4 -2
  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 +50 -48
  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/form-location.js +3 -3
  108. package/dist/middleware/schema-error.js +1 -1
  109. package/dist/middleware/session-location.js +3 -3
  110. package/dist/options.d.ts +7 -0
  111. package/dist/options.js +1 -0
  112. package/dist/pairing.js +1 -1
  113. package/dist/process.d.ts +1 -0
  114. package/dist/process.js +61 -56
  115. package/dist/request-site.d.ts +11 -0
  116. package/dist/request-site.js +11 -0
  117. package/dist/request-tracing.d.ts +2 -2
  118. package/dist/request-tracing.js +1 -1
  119. package/dist/routes.js +53 -51
  120. package/dist/server-info.js +5 -5
  121. package/dist/service-status.js +1 -1
  122. package/dist/workerd.d.ts +2 -0
  123. package/dist/workerd.js +59 -54
  124. package/package.json +11 -11
  125. /package/dist/chunks/{location-9rqn6x4v.js → options-9rqn6x4v.js} +0 -0
  126. /package/dist/chunks/{location-bd8755ek.js → options-bd8755ek.js} +0 -0
  127. /package/dist/chunks/{location-q4bn6dy8.js → options-q4bn6dy8.js} +0 -0
  128. /package/dist/chunks/{location-smaf4a18.js → options-smaf4a18.js} +0 -0
  129. /package/dist/chunks/{location-xthc02cw.js → options-xthc02cw.js} +0 -0
  130. /package/dist/chunks/{location-yc7nft6q.js → options-yc7nft6q.js} +0 -0
package/dist/api.js CHANGED
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  Api2
3
- } from "./chunks/location-v7p1kzzd.js";
4
- import"./chunks/location-ddnay6e1.js";
5
- import"./chunks/location-x74w7e1f.js";
6
- import"./chunks/location-gymtz25n.js";
7
- import"./chunks/location-smaf4a18.js";
3
+ } from "./chunks/options-v7p1kzzd.js";
4
+ import"./chunks/options-ddnay6e1.js";
5
+ import"./chunks/options-x74w7e1f.js";
6
+ import"./chunks/options-gymtz25n.js";
7
+ import"./chunks/options-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/location-j4at0y5c.js";
10
+ } from "./chunks/options-j4at0y5c.js";
11
11
  export {
12
12
  Config2 as Config,
13
13
  SESSION_TTL_SECONDS2 as SESSION_TTL_SECONDS,
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  missingSession2
3
- } from "./location-smaf4a18.js";
3
+ } from "./options-smaf4a18.js";
4
4
  import {
5
5
  locationErrors2,
6
6
  awaitPlugins2,
7
7
  response2,
8
8
  requestRef2
9
- } from "./location-gymtz25n.js";
9
+ } from "./options-gymtz25n.js";
10
10
 
11
11
  // src/handlers/artifact.ts
12
12
  import { Artifact } from "@opencode/core/artifact";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  missingSession2
3
- } from "./location-smaf4a18.js";
3
+ } from "./options-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 "./location-gymtz25n.js";
3
+ } from "./options-gymtz25n.js";
4
4
  import {
5
5
  Api2
6
- } from "./location-v7p1kzzd.js";
6
+ } from "./options-v7p1kzzd.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 "./location-v7p1kzzd.js";
3
+ } from "./options-v7p1kzzd.js";
4
4
  import {
5
- Service3,
5
+ Service4,
6
6
  frame2
7
- } from "./location-qfyg9gb7.js";
7
+ } from "./options-wecgp61r.js";
8
8
 
9
9
  // src/handlers/event.ts
10
10
  import { Event } from "@opencode/schema/event";
@@ -12,7 +12,7 @@ import { Effect, Stream } from "effect";
12
12
  import { HttpServerResponse } from "effect/http";
13
13
  import { HttpApiBuilder } from "effect/http-api";
14
14
  var EventHandler2 = HttpApiBuilder.group(Api2, "server.event", (handlers) => Effect.gen(function* () {
15
- const feed = yield* Service3;
15
+ const feed = yield* Service4;
16
16
  return handlers.handleRaw("event.subscribe", (ctx) => Effect.gen(function* () {
17
17
  const connected = {
18
18
  id: Event.ID.create(),
@@ -1,43 +1,43 @@
1
1
  import {
2
2
  layer2
3
- } from "./location-gymtz25n.js";
3
+ } from "./options-gymtz25n.js";
4
4
  import {
5
5
  formLocationLayer2
6
- } from "./location-ddnay6e1.js";
6
+ } from "./options-ddnay6e1.js";
7
7
  import {
8
8
  sessionLocationLayer2
9
- } from "./location-x74w7e1f.js";
9
+ } from "./options-x74w7e1f.js";
10
10
  import {
11
11
  Api2
12
- } from "./location-v7p1kzzd.js";
12
+ } from "./options-v7p1kzzd.js";
13
13
  import {
14
14
  Config2
15
- } from "./location-j4at0y5c.js";
15
+ } from "./options-j4at0y5c.js";
16
16
  import {
17
17
  CorsConfig2
18
- } from "./location-q4bn6dy8.js";
18
+ } from "./options-q4bn6dy8.js";
19
19
  import {
20
- layer4
21
- } from "./location-7dtbad8d.js";
20
+ layer3
21
+ } from "./options-3te71694.js";
22
22
  import {
23
23
  node2
24
- } from "./location-kqr36gas.js";
24
+ } from "./options-kqr36gas.js";
25
25
  import {
26
26
  handlers2
27
- } from "./location-wy3c18g3.js";
27
+ } from "./options-q59gseq4.js";
28
28
  import {
29
29
  authorizationLayer2
30
- } from "./location-7b9xm1qg.js";
30
+ } from "./options-7b9xm1qg.js";
31
31
  import {
32
32
  schemaErrorLayer2
33
- } from "./location-bd8755ek.js";
33
+ } from "./options-bd8755ek.js";
34
34
 
35
35
  // src/routes.ts
36
36
  import { Database } from "@opencode/core/database/database";
37
37
  import { V1Migration } from "@opencode/core/database/v1-migration";
38
38
  import { App } from "@opencode/core/app";
39
39
  import { LayerNode } from "@opencode/util/effect/layer-node";
40
- import { httpClient } from "@opencode/util/effect/app-node-platform";
40
+ import { fetchLayer, httpClient, httpFetch } from "@opencode/util/effect/app-node-platform";
41
41
  import { AppNodeBuilder } from "@opencode/core/effect/app-node-builder";
42
42
  import { Bus } from "@opencode/core/bus";
43
43
  import { EventLogger } from "@opencode/core/event-logger";
@@ -119,6 +119,7 @@ function makeRoutes(auth, options, serviceURLs, overrides, instances) {
119
119
  Bus.node.replace(Bus.configured({ persist: options.events?.persist })),
120
120
  App.node.replace(App.configured(options.app)),
121
121
  ModelsDev.node.replace(ModelsDev.configured(options.models)),
122
+ httpFetch.replace(fetchLayer(options.fetch)),
122
123
  Watcher.node.replace(Watcher.configured({ enabled: options.fs?.filewatcher })),
123
124
  FileWatch.node.replace(FileWatch.configured({ enabled: options.fs?.filewatcher })),
124
125
  FileSystemSearch.node.replace(FileSystemSearch.configured({ fff: options.fs?.fff })),
@@ -153,7 +154,7 @@ function makeRoutes(auth, options, serviceURLs, overrides, instances) {
153
154
  })) : build(overrides);
154
155
  return serviceLayer.pipe(Layer.flatMap((context) => {
155
156
  const services = Layer.succeedContext(context);
156
- const requestServices = Layer.merge(Layer.succeedContext(Context.pick(Database.Service, Credential.Service, PermissionSaved.Service, PluginUpdate.Service, Project.Service, WellKnown.Service)(context)), layer4(serviceURLs, Context.get(context, Global.Service).tmp, options.app));
157
+ 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));
157
158
  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(layer2), Layer.provide(authorizationLayer2), Layer.provide(schemaErrorLayer2), Layer.provide(auth), HttpRouter.provideRequest(requestServices), Layer.provideMerge(services), Layer.provideMerge(HttpRouter.layer));
158
159
  return Layer.merge(api, V1Migration.layer.pipe(Layer.provide(services)));
159
160
  }));
@@ -1,22 +1,22 @@
1
1
  import {
2
2
  __export
3
- } from "./location-9rqn6x4v.js";
3
+ } from "./options-9rqn6x4v.js";
4
4
 
5
5
  // src/server-info.ts
6
6
  var exports_server_info = {};
7
7
  __export(exports_server_info, {
8
8
  ServerInfo: () => exports_server_info,
9
- Service: () => Service4,
9
+ Service: () => Service3,
10
10
  connectionURLs: () => connectionURLs2,
11
- layer: () => layer4
11
+ layer: () => layer3
12
12
  });
13
13
  import { Context, Layer } from "effect";
14
14
  import { networkInterfaces } from "node:os";
15
15
 
16
- class Service4 extends Context.Service()("@opencode/server/ServerInfo") {
16
+ class Service3 extends Context.Service()("@opencode/server/ServerInfo") {
17
17
  }
18
- function layer4(urls, tmp, app = {}) {
19
- return Layer.succeed(Service4, Service4.of({ urls, app, paths: { tmp } }));
18
+ function layer3(urls, tmp, app = {}) {
19
+ return Layer.succeed(Service3, Service3.of({ urls, app, paths: { tmp } }));
20
20
  }
21
21
  function connectionURLs2(value, requestedHostname) {
22
22
  const url = new URL(value);
@@ -38,4 +38,4 @@ function connectionURLs2(value, requestedHostname) {
38
38
  ];
39
39
  }
40
40
 
41
- export { Service4, layer4, connectionURLs2, exports_server_info };
41
+ export { Service3, layer3, connectionURLs2, exports_server_info };
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  response2
3
- } from "./location-gymtz25n.js";
3
+ } from "./options-gymtz25n.js";
4
4
  import {
5
5
  Api2
6
- } from "./location-v7p1kzzd.js";
6
+ } from "./options-v7p1kzzd.js";
7
7
 
8
8
  // src/handlers/shell.ts
9
9
  import { Shell } from "@opencode/core/shell";
@@ -2,17 +2,18 @@ import {
2
2
  locationErrors2,
3
3
  response2,
4
4
  requestRef2
5
- } from "./location-gymtz25n.js";
5
+ } from "./options-gymtz25n.js";
6
6
  import {
7
7
  Api2
8
- } from "./location-v7p1kzzd.js";
8
+ } from "./options-v7p1kzzd.js";
9
9
  import {
10
10
  CorsConfig2,
11
11
  isAllowedRequestOrigin2
12
- } from "./location-q4bn6dy8.js";
12
+ } from "./options-q4bn6dy8.js";
13
13
  import {
14
- runPtySocket2
15
- } from "./location-h6rt5k9s.js";
14
+ runPtySocket2,
15
+ holdLocation2
16
+ } from "./options-q187pxxd.js";
16
17
 
17
18
  // src/handlers/pty.ts
18
19
  import { Pty } from "@opencode/core/pty";
@@ -90,6 +91,7 @@ var PtyHandler2 = HttpApiBuilder.group(Api2, "server.pty", (handlers) => Effect.
90
91
  const cursor = cursorNumber !== undefined && Number.isSafeInteger(cursorNumber) && cursorNumber >= -1 ? cursorNumber : undefined;
91
92
  const socket = yield* Effect.orDie(ctx.request.upgrade);
92
93
  const outbox = yield* Queue.unbounded();
94
+ yield* holdLocation2(outbox);
93
95
  const attachment = yield* pty.attach(ctx.params.ptyID, {
94
96
  cursor,
95
97
  onData: (chunk) => Queue.offerUnsafe(outbox, chunk),
@@ -121,7 +123,7 @@ var PtyHandler2 = HttpApiBuilder.group(Api2, "server.pty", (handlers) => Effect.
121
123
  detach: () => attachment?.detach()
122
124
  });
123
125
  return HttpServerResponse.empty();
124
- }).pipe(Effect.provide(locations.get(ref)), locationErrors2);
126
+ }).pipe(Effect.scoped, Effect.provide(locations.get(ref)), locationErrors2);
125
127
  }));
126
128
  }));
127
129
 
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  awaitPlugins2,
3
3
  response2
4
- } from "./location-gymtz25n.js";
4
+ } from "./options-gymtz25n.js";
5
5
  import {
6
6
  Api2
7
- } from "./location-v7p1kzzd.js";
7
+ } from "./options-v7p1kzzd.js";
8
8
 
9
9
  // src/handlers/provider.ts
10
10
  import { Provider } from "@opencode/core/provider";
@@ -0,0 +1,28 @@
1
+ import {
2
+ missingSession2
3
+ } from "./options-smaf4a18.js";
4
+
5
+ // src/handlers/job.ts
6
+ import { Job } from "@opencode/core/job";
7
+ import { Session } from "@opencode/core/session";
8
+ import { SessionBackground } from "@opencode/core/session/background";
9
+ import { Effect, Option } from "effect";
10
+ var makeJob2 = Effect.gen(function* () {
11
+ const jobs = yield* Job.Service;
12
+ const sessions = yield* Session.Service;
13
+ const lookup = {
14
+ get: (sessionID) => sessions.get(sessionID).pipe(Effect.option, Effect.map(Option.getOrUndefined))
15
+ };
16
+ return {
17
+ list: Effect.fn("JobHandler.list")(function* (query) {
18
+ if (query.sessionID !== undefined) {
19
+ yield* sessions.get(query.sessionID).pipe(Effect.catchTag("Session.NotFoundError", missingSession2));
20
+ }
21
+ return {
22
+ data: yield* SessionBackground.list(jobs, lookup, query)
23
+ };
24
+ })
25
+ };
26
+ });
27
+
28
+ export { makeJob2 };
@@ -4,7 +4,7 @@ import {
4
4
  authorized2,
5
5
  verifySession2,
6
6
  sessionCookieName2
7
- } from "./location-j4at0y5c.js";
7
+ } from "./options-j4at0y5c.js";
8
8
 
9
9
  // src/middleware/authorization.ts
10
10
  import { UnauthorizedError } from "@opencode/protocol/errors";
@@ -1,22 +1,25 @@
1
1
  import {
2
2
  Api2
3
- } from "./location-v7p1kzzd.js";
3
+ } from "./options-v7p1kzzd.js";
4
4
  import {
5
5
  CorsConfig2,
6
6
  isAllowedRequestOrigin2
7
- } from "./location-q4bn6dy8.js";
7
+ } from "./options-q4bn6dy8.js";
8
8
  import {
9
9
  makeArtifact2
10
- } from "./location-02a60aws.js";
10
+ } from "./options-02a60aws.js";
11
+ import {
12
+ makeJob2
13
+ } from "./options-78rcgzsr.js";
11
14
  import {
12
15
  makeMediaGet2
13
- } from "./location-n321d8vm.js";
16
+ } from "./options-djr0jy89.js";
14
17
  import {
15
18
  runPtySocket2
16
- } from "./location-h6rt5k9s.js";
19
+ } from "./options-q187pxxd.js";
17
20
  import {
18
21
  makeSchedule2
19
- } from "./location-059rbh9c.js";
22
+ } from "./options-059rbh9c.js";
20
23
 
21
24
  // src/handlers/persistent-pty.ts
22
25
  import { PersistentPty } from "@opencode/core/persistent-pty";
@@ -42,9 +45,10 @@ var PersistentPtyHandler2 = HttpApiBuilder.group(Api2, "server.experimental", (h
42
45
  const cors = yield* CorsConfig2;
43
46
  const pty = yield* PersistentPty.Service;
44
47
  const artifact = yield* makeArtifact2;
48
+ const job = yield* makeJob2;
45
49
  const mediaGet = yield* makeMediaGet2;
46
50
  const schedule = yield* makeSchedule2;
47
- return handlers.handleRaw("media.get", (ctx) => mediaGet(ctx.params.hash, ctx.request)).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
+ 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) {
48
52
  return { data: yield* pty.read(ctx.params.sessionID, ctx.query.lines).pipe(mapUnavailable) };
49
53
  })).handle("persistentPty.list", Effect.fn(function* (ctx) {
50
54
  return { data: yield* pty.list(ctx.params.sessionID).pipe(mapUnavailable) };
@@ -2,17 +2,18 @@ import {
2
2
  locationErrors2,
3
3
  response2,
4
4
  requestRef2
5
- } from "./location-gymtz25n.js";
5
+ } from "./options-gymtz25n.js";
6
6
  import {
7
7
  Api2
8
- } from "./location-v7p1kzzd.js";
8
+ } from "./options-v7p1kzzd.js";
9
9
  import {
10
10
  CorsConfig2,
11
11
  isAllowedRequestOrigin2
12
- } from "./location-q4bn6dy8.js";
12
+ } from "./options-q4bn6dy8.js";
13
13
  import {
14
- runPtySocket2
15
- } from "./location-h6rt5k9s.js";
14
+ runPtySocket2,
15
+ holdLocation2
16
+ } from "./options-q187pxxd.js";
16
17
 
17
18
  // src/handlers/mcp.ts
18
19
  import { Location } from "@opencode/core/location";
@@ -78,6 +79,7 @@ var McpHandler2 = HttpApiBuilder.group(Api2, "server.mcp", (handlers) => Effect.
78
79
  const { McpSocketClient } = yield* Effect.promise(() => import("@opencode/core/mcp/socket-client"));
79
80
  const socket = yield* Effect.orDie(ctx.request.upgrade);
80
81
  const outbox = yield* Queue.unbounded();
82
+ yield* holdLocation2(outbox);
81
83
  const state = { attached: false, disconnected: false };
82
84
  const transport = McpSocketClient.make({
83
85
  send: (text) => Queue.offerUnsafe(outbox, text),
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  response2
3
- } from "./location-gymtz25n.js";
3
+ } from "./options-gymtz25n.js";
4
4
  import {
5
5
  Api2
6
- } from "./location-v7p1kzzd.js";
6
+ } from "./options-v7p1kzzd.js";
7
7
 
8
8
  // src/handlers/vcs.ts
9
9
  import { Vcs } from "@opencode/core/vcs";
@@ -1,18 +1,18 @@
1
1
  import {
2
2
  Api2
3
- } from "./location-v7p1kzzd.js";
3
+ } from "./options-v7p1kzzd.js";
4
4
  import {
5
5
  SESSION_TTL_SECONDS2,
6
6
  Config2,
7
7
  issueSession2,
8
8
  sessionCookieName2
9
- } from "./location-j4at0y5c.js";
9
+ } from "./options-j4at0y5c.js";
10
10
  import {
11
- Service4
12
- } from "./location-7dtbad8d.js";
11
+ Service3
12
+ } from "./options-3te71694.js";
13
13
  import {
14
14
  Service2
15
- } from "./location-kqr36gas.js";
15
+ } from "./options-kqr36gas.js";
16
16
 
17
17
  // src/handlers/server.ts
18
18
  import { hostname } from "node:os";
@@ -25,7 +25,7 @@ var ServerHandler2 = HttpApiBuilder.group(Api2, "server.server", (handlers) => E
25
25
  const pairing = yield* Service2;
26
26
  const auth = yield* Config2;
27
27
  return handlers.handle("server.info", () => Effect.gen(function* () {
28
- const info = yield* Service4;
28
+ const info = yield* Service3;
29
29
  return {
30
30
  version: info.app.version ?? "unknown",
31
31
  pid: process.pid ?? 0,
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  response2
3
- } from "./location-gymtz25n.js";
3
+ } from "./options-gymtz25n.js";
4
4
  import {
5
5
  Api2
6
- } from "./location-v7p1kzzd.js";
6
+ } from "./options-v7p1kzzd.js";
7
7
 
8
8
  // src/handlers/skill.ts
9
9
  import { Skill } from "@opencode/core/skill";
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  awaitPlugins2,
3
3
  response2
4
- } from "./location-gymtz25n.js";
4
+ } from "./options-gymtz25n.js";
5
5
  import {
6
6
  Api2
7
- } from "./location-v7p1kzzd.js";
7
+ } from "./options-v7p1kzzd.js";
8
8
 
9
9
  // src/handlers/websearch.ts
10
10
  import { WebSearch } from "@opencode/core/websearch";
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  missingSession2,
3
3
  failedMessageDecode2
4
- } from "./location-smaf4a18.js";
4
+ } from "./options-smaf4a18.js";
5
5
  import {
6
6
  Api2
7
- } from "./location-v7p1kzzd.js";
7
+ } from "./options-v7p1kzzd.js";
8
8
  import {
9
9
  wantsMediaRefs2
10
- } from "./location-xthc02cw.js";
10
+ } from "./options-xthc02cw.js";
11
11
 
12
12
  // src/handlers/message.ts
13
13
  import { SessionMessage } from "@opencode/core/session/message";
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  locationErrors2,
3
3
  awaitPlugins2
4
- } from "./location-gymtz25n.js";
4
+ } from "./options-gymtz25n.js";
5
5
  import {
6
6
  Api2
7
- } from "./location-v7p1kzzd.js";
7
+ } from "./options-v7p1kzzd.js";
8
8
 
9
9
  // src/handlers/generate.ts
10
10
  import { Generate } from "@opencode/core/generate";
@@ -2,7 +2,7 @@ import {
2
2
  locationErrors2,
3
3
  sessionInfo2,
4
4
  requestRef2
5
- } from "./location-gymtz25n.js";
5
+ } from "./options-gymtz25n.js";
6
6
 
7
7
  // src/middleware/form-location.ts
8
8
  import { Instance } from "@opencode/core/instance/service";
@@ -1,3 +1,8 @@
1
+ import {
2
+ CONTENT_SECURITY_POLICY2,
3
+ disposition2
4
+ } from "./options-t32e1bbt.js";
5
+
1
6
  // src/handlers/media.ts
2
7
  import { Database } from "@opencode/core/database/database";
3
8
  import { SessionBlob } from "@opencode/core/session/blob";
@@ -6,10 +11,6 @@ import { Effect } from "effect";
6
11
  import { HttpServerResponse } from "effect/http";
7
12
  var INLINE_IMAGE_MIMES = new Set(["image/png", "image/jpeg", "image/gif", "image/webp"]);
8
13
  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
14
  var makeMediaGet2 = Effect.gen(function* () {
14
15
  const { db } = yield* Database.Service;
15
16
  return (hash, request) => Effect.gen(function* () {
@@ -22,8 +23,9 @@ var makeMediaGet2 = Effect.gen(function* () {
22
23
  const headers = {
23
24
  "cache-control": CACHE_CONTROL,
24
25
  etag,
25
- ...SECURITY_HEADERS,
26
- ...inline ? {} : { "content-disposition": "attachment" }
26
+ "content-disposition": disposition2(""),
27
+ "content-security-policy": CONTENT_SECURITY_POLICY2,
28
+ "x-content-type-options": "nosniff"
27
29
  };
28
30
  if (matchesIfNoneMatch(request.headers["if-none-match"], etag))
29
31
  return HttpServerResponse.empty({ status: 304, headers });
@@ -1,9 +1,12 @@
1
1
  import {
2
2
  response2
3
- } from "./location-gymtz25n.js";
3
+ } from "./options-gymtz25n.js";
4
4
  import {
5
5
  Api2
6
- } from "./location-v7p1kzzd.js";
6
+ } from "./options-v7p1kzzd.js";
7
+ import {
8
+ download2
9
+ } from "./options-t32e1bbt.js";
7
10
 
8
11
  // src/handlers/fs.ts
9
12
  import { FileSystem } from "@opencode/core/filesystem";
@@ -21,7 +24,7 @@ var FileSystemHandler2 = HttpApiBuilder.group(Api2, "server.fs", (handlers) => E
21
24
  const path2 = yield* decodeRequestPath(ctx.request.url);
22
25
  const fs = yield* FileSystem.Service;
23
26
  const file = yield* fs.read({ path: path2 }).pipe(Effect.mapError((error) => new FileNotFoundError({ path: error.path, message: `File not found: ${error.path}` })));
24
- return serveFile(ctx.request, file);
27
+ return serveFile(ctx.request, file, download2({ path: path2, mime: file.mime }));
25
28
  })).handle("fs.list", (ctx) => response2(Effect.gen(function* () {
26
29
  const fs = yield* FileSystem.Service;
27
30
  return yield* fs.list(ctx.query).pipe(Effect.mapError((error) => new FileNotFoundError({ path: error.path, message: `Directory not found: ${error.path}` })));
@@ -54,7 +57,7 @@ function decodeRequestPath(url) {
54
57
  catch: () => new FileNotFoundError({ path: raw, message: `File not found: ${raw}` })
55
58
  });
56
59
  }
57
- function serveFile(request, file) {
60
+ function serveFile(request, file, content) {
58
61
  const etag = `W/"${file.size.toString(16)}-${Option.match(file.mtime, {
59
62
  onNone: () => "0",
60
63
  onSome: (mtime) => mtime.getTime().toString(16)
@@ -66,7 +69,7 @@ function serveFile(request, file) {
66
69
  ...lastModified === undefined ? {} : { "last-modified": lastModified }
67
70
  };
68
71
  if (isNotModified(request, etag, lastModified))
69
- return HttpServerResponse.empty({ status: 304, headers: validators });
72
+ return HttpServerResponse.empty({ status: 304, headers: { ...validators, ...content } });
70
73
  const rangeHeader = request.method === "GET" ? request.headers["range"] : undefined;
71
74
  const range = rangeHeader !== undefined && matchesIfRange(request.headers["if-range"], etag, lastModified) ? parseRange(rangeHeader, file.size) : undefined;
72
75
  if (range === "unsatisfiable")
@@ -81,8 +84,8 @@ function serveFile(request, file) {
81
84
  contentLength: length,
82
85
  headers: {
83
86
  ...validators,
87
+ ...content,
84
88
  "accept-ranges": "bytes",
85
- "content-type": file.mime,
86
89
  ...range === undefined ? {} : { "content-range": `bytes ${range.start}-${range.end}/${file.size}` }
87
90
  }
88
91
  });
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  Api2
3
- } from "./location-v7p1kzzd.js";
3
+ } from "./options-v7p1kzzd.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 "./location-9rqn6x4v.js";
3
+ } from "./options-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 "./location-v7p1kzzd.js";
3
+ } from "./options-v7p1kzzd.js";
4
4
 
5
5
  // src/handlers/location.ts
6
6
  import { Location } from "@opencode/core/location";
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  response2
3
- } from "./location-gymtz25n.js";
3
+ } from "./options-gymtz25n.js";
4
4
  import {
5
5
  Api2
6
- } from "./location-v7p1kzzd.js";
6
+ } from "./options-v7p1kzzd.js";
7
7
 
8
8
  // src/handlers/reference.ts
9
9
  import { Reference } from "@opencode/core/reference";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  missingSession2
3
- } from "./location-smaf4a18.js";
3
+ } from "./options-smaf4a18.js";
4
4
 
5
5
  // src/location.ts
6
6
  import { FileSystem } from "@opencode/core/filesystem";