@opencode/server 2.4.0 → 2.4.2

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 (140) hide show
  1. package/dist/api.d.ts +45 -1
  2. package/dist/api.js +5 -5
  3. package/dist/auth.js +1 -1
  4. package/dist/chunks/{content-headers-0rzj25w4.js → range-017ycvbx.js} +1 -1
  5. package/dist/chunks/{content-headers-9t07vtvz.js → range-0x6anvwr.js} +2 -2
  6. package/dist/chunks/{content-headers-39nnfjx1.js → range-39nnfjx1.js} +1 -1
  7. package/dist/chunks/{content-headers-801prsqk.js → range-3rtm8r3z.js} +2 -2
  8. package/dist/chunks/{content-headers-z3e7v67k.js → range-3te71694.js} +7 -7
  9. package/dist/chunks/{content-headers-jhbndf2d.js → range-5pef2nys.js} +4 -4
  10. package/dist/chunks/range-6pm6ek88.js +48 -0
  11. package/dist/chunks/{content-headers-r40v995e.js → range-78jk0pbb.js} +2 -2
  12. package/dist/chunks/{content-headers-hnbeyfax.js → range-79t5cra8.js} +14 -10
  13. package/dist/chunks/{content-headers-8ja97vv6.js → range-7zz6jxhb.js} +2 -2
  14. package/dist/chunks/{content-headers-8sb6qqpn.js → range-8sb6qqpn.js} +1 -1
  15. package/dist/chunks/{content-headers-hk9crnsa.js → range-9agv2b4c.js} +2 -2
  16. package/dist/chunks/{content-headers-vw0q3knq.js → range-aexh791j.js} +1 -1
  17. package/dist/chunks/{content-headers-2cm4dfcc.js → range-amxj52x5.js} +2 -2
  18. package/dist/chunks/{content-headers-zjmacp9c.js → range-ay32z58n.js} +3 -3
  19. package/dist/chunks/{content-headers-2dzr03as.js → range-b3sk57wg.js} +1 -1
  20. package/dist/chunks/{content-headers-y60jfeab.js → range-c6kzfg4f.js} +2 -2
  21. package/dist/chunks/{content-headers-2rb1ee6g.js → range-cddawxec.js} +3 -3
  22. package/dist/chunks/{content-headers-djr0jy89.js → range-djr0jy89.js} +1 -1
  23. package/dist/chunks/range-dnyhqccw.js +27 -0
  24. package/dist/chunks/{content-headers-100nc7c0.js → range-f93zkajm.js} +2 -2
  25. package/dist/chunks/{content-headers-g23ffrnz.js → range-g23ffrnz.js} +2 -2
  26. package/dist/chunks/{content-headers-prn0chz2.js → range-gwtm9cga.js} +1 -1
  27. package/dist/chunks/{content-headers-s3zgwc17.js → range-heqw7kpr.js} +2 -2
  28. package/dist/chunks/{content-headers-p83m65n5.js → range-hgd5b6k8.js} +2 -2
  29. package/dist/chunks/{content-headers-j4at0y5c.js → range-j4at0y5c.js} +1 -1
  30. package/dist/chunks/{content-headers-b03d5rht.js → range-jrjpfy36.js} +2 -2
  31. package/dist/chunks/{content-headers-ah2sj2pr.js → range-jy2ammbg.js} +1 -1
  32. package/dist/chunks/{content-headers-d20xfnpc.js → range-k2bx5n4e.js} +1 -1
  33. package/dist/chunks/{content-headers-wka57cdm.js → range-k518ftvz.js} +2 -2
  34. package/dist/chunks/{content-headers-4zkx9wb3.js → range-k58xpxwn.js} +1 -1
  35. package/dist/chunks/{content-headers-mzs0n5xz.js → range-kqr36gas.js} +7 -7
  36. package/dist/chunks/{content-headers-gq4jwh93.js → range-mjhh6jvz.js} +3 -3
  37. package/dist/chunks/{content-headers-hmwn16zp.js → range-myqk22k5.js} +2 -2
  38. package/dist/chunks/{content-headers-7jm4dc4a.js → range-n8nthg9q.js} +4 -4
  39. package/dist/chunks/{content-headers-5jm9kajg.js → range-pa4xtt5h.js} +2 -2
  40. package/dist/chunks/range-qpnw2qd1.js +58 -0
  41. package/dist/chunks/{content-headers-rktygpea.js → range-rktygpea.js} +1 -1
  42. package/dist/chunks/{content-headers-4fc68szf.js → range-rn83nvae.js} +2 -2
  43. package/dist/chunks/{content-headers-smaf4a18.js → range-rqgv9x42.js} +6 -2
  44. package/dist/chunks/{content-headers-fjcqsaaz.js → range-s3d15g1k.js} +23 -17
  45. package/dist/chunks/{content-headers-ddrpmftb.js → range-s557cdqw.js} +14 -4
  46. package/dist/chunks/{content-headers-1r438we2.js → range-s6q3ch5r.js} +8 -8
  47. package/dist/chunks/{content-headers-7qpea5x7.js → range-sqfq92mf.js} +2 -2
  48. package/dist/chunks/{content-headers-ywn523ee.js → range-stx1bw5w.js} +3 -3
  49. package/dist/chunks/{content-headers-t32e1bbt.js → range-t32e1bbt.js} +1 -1
  50. package/dist/chunks/{content-headers-w3xmknp7.js → range-tmb89r25.js} +2 -2
  51. package/dist/chunks/{content-headers-mvp6540g.js → range-tmbyzr8c.js} +35 -35
  52. package/dist/chunks/{content-headers-ykk3p1r3.js → range-vkj8vbyf.js} +2 -2
  53. package/dist/chunks/{content-headers-yty6dk04.js → range-vnpm7f9y.js} +1 -1
  54. package/dist/chunks/{content-headers-0r476wkb.js → range-wa6vk4hf.js} +14 -9
  55. package/dist/chunks/{content-headers-hf3kgjhr.js → range-wazndna9.js} +4 -4
  56. package/dist/chunks/{content-headers-qfyg9gb7.js → range-wecgp61r.js} +7 -7
  57. package/dist/chunks/{content-headers-7ydfwv45.js → range-x2qy7jg1.js} +1 -1
  58. package/dist/chunks/{content-headers-ky9xhfwk.js → range-zs3ssmns.js} +26 -21
  59. package/dist/chunks/{content-headers-rmfb1myj.js → range-zx60pg73.js} +1 -1
  60. package/dist/content-headers.js +1 -1
  61. package/dist/cors.js +1 -1
  62. package/dist/event-feed.js +5 -5
  63. package/dist/fetch.d.ts +57 -0
  64. package/dist/fetch.js +64 -61
  65. package/dist/handlers/agent.js +6 -6
  66. package/dist/handlers/artifact.js +3 -3
  67. package/dist/handlers/automation.d.ts +1 -3
  68. package/dist/handlers/automation.js +2 -2
  69. package/dist/handlers/blob.js +3 -3
  70. package/dist/handlers/command.js +6 -6
  71. package/dist/handlers/config.js +6 -6
  72. package/dist/handlers/credential.js +7 -7
  73. package/dist/handlers/debug.js +6 -6
  74. package/dist/handlers/event.js +7 -7
  75. package/dist/handlers/form.js +6 -6
  76. package/dist/handlers/fs.js +8 -8
  77. package/dist/handlers/generate.js +6 -6
  78. package/dist/handlers/integration.js +6 -6
  79. package/dist/handlers/job.js +2 -2
  80. package/dist/handlers/location.js +6 -6
  81. package/dist/handlers/machine.js +1 -1
  82. package/dist/handlers/mcp.js +8 -8
  83. package/dist/handlers/media.js +2 -2
  84. package/dist/handlers/message.js +7 -7
  85. package/dist/handlers/migration.js +6 -6
  86. package/dist/handlers/model.js +6 -6
  87. package/dist/handlers/permission.js +6 -6
  88. package/dist/handlers/persistent-pty.d.ts +1 -1
  89. package/dist/handlers/persistent-pty.js +17 -16
  90. package/dist/handlers/plugin.js +6 -6
  91. package/dist/handlers/project.js +6 -6
  92. package/dist/handlers/provider.js +6 -6
  93. package/dist/handlers/pty-socket.js +1 -1
  94. package/dist/handlers/pty.js +8 -8
  95. package/dist/handlers/push.d.ts +28 -0
  96. package/dist/handlers/push.js +6 -0
  97. package/dist/handlers/reference.js +6 -6
  98. package/dist/handlers/rpc.js +6 -6
  99. package/dist/handlers/server.js +9 -9
  100. package/dist/handlers/session-error.d.ts +3 -1
  101. package/dist/handlers/session-error.js +4 -2
  102. package/dist/handlers/session.js +7 -7
  103. package/dist/handlers/shell.js +6 -6
  104. package/dist/handlers/skill.js +6 -6
  105. package/dist/handlers/usage.js +6 -6
  106. package/dist/handlers/vcs.js +6 -6
  107. package/dist/handlers/voice.js +6 -6
  108. package/dist/handlers/websearch.js +6 -6
  109. package/dist/handlers/worktree.js +6 -6
  110. package/dist/handlers.d.ts +1 -1
  111. package/dist/handlers.js +54 -53
  112. package/dist/location.js +4 -4
  113. package/dist/media-uri.js +1 -1
  114. package/dist/middleware/authorization.js +2 -2
  115. package/dist/middleware/defect-response.js +1 -1
  116. package/dist/middleware/form-location.js +3 -3
  117. package/dist/middleware/schema-error.js +1 -1
  118. package/dist/middleware/session-location.js +3 -3
  119. package/dist/pairing.d.ts +1 -1
  120. package/dist/pairing.js +3 -3
  121. package/dist/process.js +62 -61
  122. package/dist/range.js +1 -1
  123. package/dist/request-site.js +2 -2
  124. package/dist/request-tracing.js +1 -1
  125. package/dist/routes.d.ts +4 -2
  126. package/dist/routes.js +58 -57
  127. package/dist/server-info.js +5 -5
  128. package/dist/service-status.js +1 -1
  129. package/dist/workerd.d.ts +20 -6
  130. package/dist/workerd.js +87 -81
  131. package/package.json +9 -9
  132. package/dist/chunks/content-headers-9cd3a4b8.js +0 -69
  133. package/dist/chunks/content-headers-jmmhprac.js +0 -13
  134. /package/dist/chunks/{content-headers-9rqn6x4v.js → range-9rqn6x4v.js} +0 -0
  135. /package/dist/chunks/{content-headers-bd8755ek.js → range-bd8755ek.js} +0 -0
  136. /package/dist/chunks/{content-headers-n26yr6pw.js → range-n26yr6pw.js} +0 -0
  137. /package/dist/chunks/{content-headers-q187pxxd.js → range-q187pxxd.js} +0 -0
  138. /package/dist/chunks/{content-headers-q4bn6dy8.js → range-q4bn6dy8.js} +0 -0
  139. /package/dist/chunks/{content-headers-xthc02cw.js → range-xthc02cw.js} +0 -0
  140. /package/dist/chunks/{content-headers-yc7nft6q.js → range-yc7nft6q.js} +0 -0
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  __export
3
- } from "./content-headers-9rqn6x4v.js";
3
+ } from "./range-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: () => Service4,
9
+ Service: () => Service2,
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 Service4 extends Context.Service()("@opencode/ServerPairing") {
17
+ class Service2 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(Service4, Effect.gen(function* () {
20
+ var layer = Layer.effect(Service2, Effect.gen(function* () {
21
21
  const cache = yield* Cache.make({ capacity: 1000, lookup: noLookup, timeToLive: TTL });
22
- return Service4.of({
22
+ return Service2.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(Service4, Effect.gen(function* () {
30
30
  })
31
31
  });
32
32
  }));
33
- var node2 = makeGlobalNode({ service: Service4, layer, deps: [] });
33
+ var node2 = makeGlobalNode({ service: Service2, layer, deps: [] });
34
34
 
35
- export { Service4, node2, exports_pairing };
35
+ export { Service2, node2, exports_pairing };
@@ -1,14 +1,14 @@
1
1
  import {
2
2
  missingSession2
3
- } from "./content-headers-smaf4a18.js";
3
+ } from "./range-rqgv9x42.js";
4
4
  import {
5
5
  locationErrors2,
6
6
  response2,
7
7
  sessionInfo2
8
- } from "./content-headers-ywn523ee.js";
8
+ } from "./range-stx1bw5w.js";
9
9
  import {
10
10
  Api2
11
- } from "./content-headers-zjmacp9c.js";
11
+ } from "./range-ay32z58n.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 "./content-headers-q4bn6dy8.js";
3
+ } from "./range-q4bn6dy8.js";
4
4
  import {
5
5
  __export
6
- } from "./content-headers-9rqn6x4v.js";
6
+ } from "./range-9rqn6x4v.js";
7
7
 
8
8
  // src/request-site.ts
9
9
  var exports_request_site = {};
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  Api2
3
- } from "./content-headers-zjmacp9c.js";
3
+ } from "./range-ay32z58n.js";
4
4
  import {
5
- Service3,
5
+ Service4,
6
6
  frame2
7
- } from "./content-headers-qfyg9gb7.js";
7
+ } from "./range-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,9 +1,9 @@
1
1
  import {
2
2
  response2
3
- } from "./content-headers-ywn523ee.js";
3
+ } from "./range-stx1bw5w.js";
4
4
  import {
5
5
  Api2
6
- } from "./content-headers-zjmacp9c.js";
6
+ } from "./range-ay32z58n.js";
7
7
 
8
8
  // src/handlers/command.ts
9
9
  import { Command } from "@opencode/core/command";
@@ -0,0 +1,58 @@
1
+ // src/handlers/push.ts
2
+ import { Effect, Option } from "effect";
3
+ import { HttpApiSchema } from "effect/http-api";
4
+ import { PushList } from "@opencode/core/push/list";
5
+ import { InvalidRequestError, PushDeviceNotFoundError } from "@opencode/protocol/errors";
6
+ import { Session } from "@opencode/core/session";
7
+ var makePush2 = Effect.gen(function* () {
8
+ const list = yield* PushList.Service;
9
+ const sessions = yield* Session.Service;
10
+ const invalid = (error) => new InvalidRequestError({ message: error.reason });
11
+ const notFound = (error) => new PushDeviceNotFoundError({ deviceID: error.id, message: error.message });
12
+ const rejectSubagent = Effect.fnUntraced(function* (sessionID) {
13
+ const session = Option.getOrUndefined(yield* sessions.get(sessionID).pipe(Effect.option));
14
+ if (session?.parentID)
15
+ return yield* new InvalidRequestError({ message: "Set the bell on the top-level session, not on a subagent" });
16
+ });
17
+ return {
18
+ get: Effect.fn("PushHandler.get")(function* () {
19
+ return { data: yield* list.info() };
20
+ }),
21
+ register: Effect.fn("PushHandler.register")(function* (id, payload) {
22
+ return { data: yield* list.register(id, payload).pipe(Effect.mapError(invalid)) };
23
+ }),
24
+ remove: Effect.fn("PushHandler.remove")(function* (id) {
25
+ yield* list.remove(id);
26
+ return HttpApiSchema.NoContent.make();
27
+ }),
28
+ update: Effect.fn("PushHandler.update")(function* (id, payload) {
29
+ return { data: yield* list.update(id, payload).pipe(Effect.mapError(notFound)) };
30
+ }),
31
+ setDeviceBell: Effect.fn("PushHandler.setDeviceBell")(function* (id, sessionID, bell) {
32
+ yield* rejectSubagent(sessionID);
33
+ return {
34
+ data: yield* list.setDeviceBell(id, sessionID, bell).pipe(Effect.catchTags({
35
+ "PushList.InvalidError": (error) => Effect.fail(invalid(error)),
36
+ "PushList.NotFoundError": (error) => Effect.fail(notFound(error))
37
+ }))
38
+ };
39
+ }),
40
+ removeDeviceBell: Effect.fn("PushHandler.removeDeviceBell")(function* (id, sessionID) {
41
+ yield* list.removeDeviceBell(id, sessionID).pipe(Effect.mapError(notFound));
42
+ return HttpApiSchema.NoContent.make();
43
+ }),
44
+ setSessionBell: Effect.fn("PushHandler.setSessionBell")(function* (sessionID, bell) {
45
+ yield* rejectSubagent(sessionID);
46
+ return { data: yield* list.setSessionBell(sessionID, bell).pipe(Effect.mapError(invalid)) };
47
+ }),
48
+ removeSessionBell: Effect.fn("PushHandler.removeSessionBell")(function* (sessionID) {
49
+ yield* list.removeSessionBell(sessionID);
50
+ return HttpApiSchema.NoContent.make();
51
+ }),
52
+ setSettings: Effect.fn("PushHandler.setSettings")(function* (settings) {
53
+ return { data: yield* list.setSettings(settings).pipe(Effect.mapError(invalid)) };
54
+ })
55
+ };
56
+ });
57
+
58
+ export { makePush2 };
@@ -4,7 +4,7 @@ import {
4
4
  authorized2,
5
5
  verifySession2,
6
6
  sessionCookieName2
7
- } from "./content-headers-j4at0y5c.js";
7
+ } from "./range-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 "./content-headers-ywn523ee.js";
3
+ } from "./range-stx1bw5w.js";
4
4
  import {
5
5
  Api2
6
- } from "./content-headers-zjmacp9c.js";
6
+ } from "./range-ay32z58n.js";
7
7
 
8
8
  // src/handlers/agent.ts
9
9
  import { Agent } from "@opencode/core/agent";
@@ -1,5 +1,6 @@
1
1
  // src/handlers/session-error.ts
2
- import { MessageNotFoundError, SessionNotFoundError, UnknownError } from "@opencode/protocol/errors";
2
+ import { Skill } from "@opencode/core/skill";
3
+ import { MessageNotFoundError, SessionNotFoundError, SkillLoadError, UnknownError } from "@opencode/protocol/errors";
3
4
  import { Effect } from "effect";
4
5
  function missingSession2(error) {
5
6
  return new SessionNotFoundError({
@@ -7,6 +8,9 @@ function missingSession2(error) {
7
8
  message: `Session not found: ${error.sessionID}`
8
9
  });
9
10
  }
11
+ function skillLoadFailed2(error) {
12
+ return new SkillLoadError({ skill: Skill.ID.make(error.skill), message: error.message });
13
+ }
10
14
  function missingMessage2(error) {
11
15
  return new MessageNotFoundError({
12
16
  sessionID: error.sessionID,
@@ -25,4 +29,4 @@ function failedSnapshot2(operation, sessionID) {
25
29
  };
26
30
  }
27
31
 
28
- export { missingSession2, missingMessage2, failedMessageDecode2, failedSnapshot2 };
32
+ export { missingSession2, skillLoadFailed2, missingMessage2, failedMessageDecode2, failedSnapshot2 };
@@ -1,39 +1,39 @@
1
1
  import {
2
- layer4
3
- } from "./content-headers-ywn523ee.js";
2
+ layer2
3
+ } from "./range-stx1bw5w.js";
4
4
  import {
5
5
  formLocationLayer2
6
- } from "./content-headers-ah2sj2pr.js";
6
+ } from "./range-jy2ammbg.js";
7
7
  import {
8
8
  sessionLocationLayer2
9
- } from "./content-headers-vw0q3knq.js";
9
+ } from "./range-aexh791j.js";
10
10
  import {
11
11
  Api2
12
- } from "./content-headers-zjmacp9c.js";
12
+ } from "./range-ay32z58n.js";
13
13
  import {
14
14
  Config2
15
- } from "./content-headers-j4at0y5c.js";
15
+ } from "./range-j4at0y5c.js";
16
16
  import {
17
17
  CorsConfig2
18
- } from "./content-headers-q4bn6dy8.js";
18
+ } from "./range-q4bn6dy8.js";
19
19
  import {
20
- layer2
21
- } from "./content-headers-z3e7v67k.js";
20
+ layer3
21
+ } from "./range-3te71694.js";
22
22
  import {
23
23
  node2
24
- } from "./content-headers-mzs0n5xz.js";
24
+ } from "./range-kqr36gas.js";
25
25
  import {
26
26
  handlers2
27
- } from "./content-headers-mvp6540g.js";
27
+ } from "./range-tmbyzr8c.js";
28
28
  import {
29
29
  authorizationLayer2
30
- } from "./content-headers-rktygpea.js";
30
+ } from "./range-rktygpea.js";
31
31
  import {
32
32
  schemaErrorLayer2
33
- } from "./content-headers-bd8755ek.js";
33
+ } from "./range-bd8755ek.js";
34
34
  import {
35
35
  defectResponseLayer2
36
- } from "./content-headers-n26yr6pw.js";
36
+ } from "./range-n26yr6pw.js";
37
37
 
38
38
  // src/routes.ts
39
39
  import { Database } from "@opencode/core/database/database";
@@ -78,6 +78,9 @@ import { Automation } from "@opencode/core/automation";
78
78
  import { PluginUpdate } from "@opencode/core/plugin/update";
79
79
  import { SdkPlugins } from "@opencode/core/plugin/sdk";
80
80
  import { WellKnown } from "@opencode/core/wellknown";
81
+ import { PushList } from "@opencode/core/push/list";
82
+ import { PushSender } from "@opencode/core/push/sender";
83
+ import { PushWatcher } from "@opencode/core/push/watcher";
81
84
  import { Workspace } from "@opencode/core/workspace";
82
85
  import { Watcher } from "@opencode/core/filesystem/watcher";
83
86
  import { FileWatch } from "@opencode/core/filesystem/file-watch";
@@ -122,7 +125,10 @@ var applicationServiceNodes = [
122
125
  Workspace.node,
123
126
  Machines.node,
124
127
  Identity.node,
125
- FileWatch.node
128
+ FileWatch.node,
129
+ PushList.node,
130
+ PushSender.node,
131
+ PushWatcher.node
126
132
  ];
127
133
  var applicationServices = LayerNode.group(applicationServiceNodes);
128
134
  function createRoutes2(options = {}, serviceURLs = () => [], overrides = []) {
@@ -192,8 +198,8 @@ function makeRoutes(password, options, serviceURLs, overrides, instances) {
192
198
  })) : build(overrides);
193
199
  return serviceLayer.pipe(Layer.flatMap((context) => {
194
200
  const services = Layer.succeedContext(context);
195
- const requestServices = Layer.merge(Layer.succeedContext(Context.pick(Database.Service, Credential.Service, PermissionSaved.Service, PluginUpdate.Service, Project.Service, WellKnown.Service)(context)), layer2(serviceURLs, Context.get(context, Global.Service).tmp, options.app));
196
- 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), Layer.tap((context) => Effect.sync(() => {
201
+ 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));
202
+ 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.merge(defectResponseLayer2), Layer.provideMerge(services), Layer.provideMerge(HttpRouter.layer), Layer.tap((context) => Effect.sync(() => {
197
203
  internal = Context.get(context, HttpRouter.HttpRouter).asHttpEffect().pipe(HttpEffect.toWebHandlerWith(context));
198
204
  })));
199
205
  return Layer.merge(api, V1Migration.layer.pipe(Layer.provide(services)));
@@ -1,17 +1,18 @@
1
1
  import {
2
2
  response2
3
- } from "./content-headers-ywn523ee.js";
3
+ } from "./range-stx1bw5w.js";
4
4
  import {
5
5
  Api2
6
- } from "./content-headers-zjmacp9c.js";
6
+ } from "./range-ay32z58n.js";
7
7
  import {
8
8
  download2
9
- } from "./content-headers-t32e1bbt.js";
9
+ } from "./range-t32e1bbt.js";
10
10
  import {
11
11
  parse2
12
- } from "./content-headers-8sb6qqpn.js";
12
+ } from "./range-8sb6qqpn.js";
13
13
 
14
14
  // src/handlers/fs.ts
15
+ import { Environment } from "@opencode/core/environment/index";
15
16
  import { FileSystem } from "@opencode/core/filesystem";
16
17
  import { FileWatch } from "@opencode/core/filesystem/file-watch";
17
18
  import { Location } from "@opencode/core/location";
@@ -38,6 +39,12 @@ var FileSystemHandler2 = HttpApiBuilder.group(Api2, "server.fs", (handlers) => E
38
39
  const fs = yield* FileSystem.Service;
39
40
  return yield* fs.write({ path: ctx.query.path, data: ctx.payload });
40
41
  }))).handle("fs.watch", (ctx) => Effect.gen(function* () {
42
+ const environment = yield* Environment.Service;
43
+ if (!environment.local)
44
+ return yield* new ServiceUnavailableError({
45
+ service: "filewatcher",
46
+ message: "File watching is not available for this location"
47
+ });
41
48
  const fs = yield* FileSystem.Service;
42
49
  const location = yield* Location.Service;
43
50
  yield* fs.read({ path: RelativePath.make(ctx.payload.path) }).pipe(Effect.mapError((error) => new FileNotFoundError({ path: error.path, message: `File not found: ${error.path}` })));
@@ -46,6 +53,9 @@ var FileSystemHandler2 = HttpApiBuilder.group(Api2, "server.fs", (handlers) => E
46
53
  file: path.resolve(location.directory, ctx.payload.path)
47
54
  }).pipe(Effect.mapError((error) => new ServiceUnavailableError({ message: error.message, service: "filewatcher" })));
48
55
  })).handle("fs.unwatch", (ctx) => Effect.gen(function* () {
56
+ const environment = yield* Environment.Service;
57
+ if (!environment.local)
58
+ return;
49
59
  const location = yield* Location.Service;
50
60
  yield* fileWatch.unwatch({
51
61
  location: { directory: location.directory, workspaceID: location.workspaceID },
@@ -1,18 +1,18 @@
1
1
  import {
2
2
  Api2
3
- } from "./content-headers-zjmacp9c.js";
3
+ } from "./range-ay32z58n.js";
4
4
  import {
5
5
  SESSION_TTL_SECONDS2,
6
6
  Config2,
7
7
  issueSession2,
8
8
  sessionCookieName2
9
- } from "./content-headers-j4at0y5c.js";
9
+ } from "./range-j4at0y5c.js";
10
10
  import {
11
- Service2
12
- } from "./content-headers-z3e7v67k.js";
11
+ Service3
12
+ } from "./range-3te71694.js";
13
13
  import {
14
- Service4
15
- } from "./content-headers-mzs0n5xz.js";
14
+ Service2
15
+ } from "./range-kqr36gas.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* Service2;
26
26
  const auth = yield* Config2;
27
27
  return handlers.handle("server.info", () => Effect.gen(function* () {
28
- const info = yield* Service2;
28
+ const info = yield* Service3;
29
29
  return {
30
30
  version: info.app.version ?? "unknown",
31
31
  pid: process.pid ?? 0,
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  missingSession2
3
- } from "./content-headers-smaf4a18.js";
3
+ } from "./range-rqgv9x42.js";
4
4
  import {
5
5
  locationErrors2,
6
6
  response2,
7
7
  requestRef2
8
- } from "./content-headers-ywn523ee.js";
8
+ } from "./range-stx1bw5w.js";
9
9
 
10
10
  // src/handlers/artifact.ts
11
11
  import { Artifact } from "@opencode/core/artifact";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  missingSession2
3
- } from "./content-headers-smaf4a18.js";
3
+ } from "./range-rqgv9x42.js";
4
4
 
5
5
  // src/location.ts
6
6
  import { FileSystem } from "@opencode/core/filesystem";
@@ -51,7 +51,7 @@ function decode(input) {
51
51
  return input;
52
52
  }
53
53
  }
54
- var layer4 = Layer.effect(LocationMiddleware2, Effect.gen(function* () {
54
+ var layer2 = Layer.effect(LocationMiddleware2, Effect.gen(function* () {
55
55
  const locations = yield* LocationServiceMap.Service;
56
56
  return LocationMiddleware2.of((effect) => Effect.gen(function* () {
57
57
  const request = yield* HttpServerRequest.HttpServerRequest;
@@ -59,4 +59,4 @@ var layer4 = Layer.effect(LocationMiddleware2, Effect.gen(function* () {
59
59
  }));
60
60
  }));
61
61
 
62
- export { LocationMiddleware2, locationErrors2, response2, sessionInfo2, requestRef2, layer4 };
62
+ export { LocationMiddleware2, locationErrors2, response2, sessionInfo2, requestRef2, layer2 };
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  __export
3
- } from "./content-headers-9rqn6x4v.js";
3
+ } from "./range-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
  response2
3
- } from "./content-headers-ywn523ee.js";
3
+ } from "./range-stx1bw5w.js";
4
4
  import {
5
5
  Api2
6
- } from "./content-headers-zjmacp9c.js";
6
+ } from "./range-ay32z58n.js";
7
7
 
8
8
  // src/handlers/vcs.ts
9
9
  import { Vcs } from "@opencode/core/vcs";
@@ -1,105 +1,105 @@
1
1
  import {
2
2
  GenerateHandler2
3
- } from "./content-headers-b03d5rht.js";
3
+ } from "./range-jrjpfy36.js";
4
4
  import {
5
5
  VoiceHandler2
6
- } from "./content-headers-s3zgwc17.js";
6
+ } from "./range-heqw7kpr.js";
7
7
  import {
8
8
  MessageHandler2
9
- } from "./content-headers-2rb1ee6g.js";
9
+ } from "./range-cddawxec.js";
10
10
  import {
11
11
  ModelHandler2
12
- } from "./content-headers-100nc7c0.js";
12
+ } from "./range-f93zkajm.js";
13
13
  import {
14
14
  ProviderHandler2
15
- } from "./content-headers-p83m65n5.js";
15
+ } from "./range-hgd5b6k8.js";
16
16
  import {
17
17
  SessionHandler2
18
- } from "./content-headers-ky9xhfwk.js";
18
+ } from "./range-zs3ssmns.js";
19
19
  import {
20
20
  PermissionHandler2
21
- } from "./content-headers-gq4jwh93.js";
21
+ } from "./range-mjhh6jvz.js";
22
22
  import {
23
23
  FileSystemHandler2
24
- } from "./content-headers-ddrpmftb.js";
24
+ } from "./range-s557cdqw.js";
25
25
  import {
26
26
  FormHandler2
27
- } from "./content-headers-2cm4dfcc.js";
27
+ } from "./range-amxj52x5.js";
28
28
  import {
29
29
  CommandHandler2
30
- } from "./content-headers-5jm9kajg.js";
30
+ } from "./range-pa4xtt5h.js";
31
31
  import {
32
32
  SkillHandler2
33
- } from "./content-headers-jmmhprac.js";
33
+ } from "./range-dnyhqccw.js";
34
34
  import {
35
35
  RpcHandler2
36
- } from "./content-headers-rmfb1myj.js";
36
+ } from "./range-zx60pg73.js";
37
37
  import {
38
- layer3
39
- } from "./content-headers-qfyg9gb7.js";
38
+ layer4
39
+ } from "./range-wecgp61r.js";
40
40
  import {
41
41
  EventHandler2
42
- } from "./content-headers-7jm4dc4a.js";
42
+ } from "./range-n8nthg9q.js";
43
43
  import {
44
44
  AgentHandler2
45
- } from "./content-headers-4fc68szf.js";
45
+ } from "./range-rn83nvae.js";
46
46
  import {
47
47
  PluginHandler2
48
- } from "./content-headers-r40v995e.js";
48
+ } from "./range-78jk0pbb.js";
49
49
  import {
50
50
  ServerHandler2
51
- } from "./content-headers-1r438we2.js";
51
+ } from "./range-s6q3ch5r.js";
52
52
  import {
53
53
  DebugHandler2
54
- } from "./content-headers-y60jfeab.js";
54
+ } from "./range-c6kzfg4f.js";
55
55
  import {
56
56
  PtyHandler2
57
- } from "./content-headers-jhbndf2d.js";
57
+ } from "./range-5pef2nys.js";
58
58
  import {
59
59
  PersistentPtyHandler2
60
- } from "./content-headers-hnbeyfax.js";
60
+ } from "./range-79t5cra8.js";
61
61
  import {
62
62
  ShellHandler2
63
- } from "./content-headers-801prsqk.js";
63
+ } from "./range-3rtm8r3z.js";
64
64
  import {
65
65
  ReferenceHandler2
66
- } from "./content-headers-wka57cdm.js";
66
+ } from "./range-k518ftvz.js";
67
67
  import {
68
68
  LocationHandler2
69
- } from "./content-headers-prn0chz2.js";
69
+ } from "./range-gwtm9cga.js";
70
70
  import {
71
71
  IntegrationHandler2
72
- } from "./content-headers-hk9crnsa.js";
72
+ } from "./range-9agv2b4c.js";
73
73
  import {
74
74
  WebSearchHandler2
75
- } from "./content-headers-8ja97vv6.js";
75
+ } from "./range-7zz6jxhb.js";
76
76
  import {
77
77
  UsageHandler2
78
- } from "./content-headers-ykk3p1r3.js";
78
+ } from "./range-vkj8vbyf.js";
79
79
  import {
80
80
  McpHandler2
81
- } from "./content-headers-hf3kgjhr.js";
81
+ } from "./range-wazndna9.js";
82
82
  import {
83
83
  CredentialHandler2
84
- } from "./content-headers-9t07vtvz.js";
84
+ } from "./range-0x6anvwr.js";
85
85
  import {
86
86
  ProjectHandler2
87
- } from "./content-headers-4zkx9wb3.js";
87
+ } from "./range-k58xpxwn.js";
88
88
  import {
89
89
  WorktreeHandler2
90
- } from "./content-headers-yty6dk04.js";
90
+ } from "./range-vnpm7f9y.js";
91
91
  import {
92
92
  VcsHandler2
93
- } from "./content-headers-w3xmknp7.js";
93
+ } from "./range-tmb89r25.js";
94
94
  import {
95
95
  MigrationHandler2
96
- } from "./content-headers-2dzr03as.js";
96
+ } from "./range-b3sk57wg.js";
97
97
  import {
98
98
  ConfigHandler2
99
- } from "./content-headers-d20xfnpc.js";
99
+ } from "./range-k2bx5n4e.js";
100
100
 
101
101
  // src/handlers.ts
102
102
  import { Layer } from "effect";
103
- var handlers2 = Layer.mergeAll(ServerHandler2, DebugHandler2, MigrationHandler2, LocationHandler2, AgentHandler2, PluginHandler2, SessionHandler2, MessageHandler2, ModelHandler2, GenerateHandler2, VoiceHandler2, ProviderHandler2, IntegrationHandler2, WebSearchHandler2, UsageHandler2, McpHandler2, CredentialHandler2, ProjectHandler2, FormHandler2, PermissionHandler2, FileSystemHandler2, CommandHandler2, SkillHandler2, RpcHandler2, EventHandler2.pipe(Layer.provide(layer3)), PtyHandler2, PersistentPtyHandler2, ShellHandler2, ReferenceHandler2, WorktreeHandler2, VcsHandler2, ConfigHandler2);
103
+ var handlers2 = Layer.mergeAll(ServerHandler2, DebugHandler2, MigrationHandler2, LocationHandler2, AgentHandler2, PluginHandler2, SessionHandler2, MessageHandler2, ModelHandler2, GenerateHandler2, VoiceHandler2, ProviderHandler2, IntegrationHandler2, WebSearchHandler2, UsageHandler2, McpHandler2, CredentialHandler2, ProjectHandler2, FormHandler2, PermissionHandler2, FileSystemHandler2, CommandHandler2, SkillHandler2, RpcHandler2, EventHandler2.pipe(Layer.provide(layer4)), PtyHandler2, PersistentPtyHandler2, ShellHandler2, ReferenceHandler2, WorktreeHandler2, VcsHandler2, ConfigHandler2);
104
104
 
105
105
  export { handlers2 };
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  response2
3
- } from "./content-headers-ywn523ee.js";
3
+ } from "./range-stx1bw5w.js";
4
4
  import {
5
5
  Api2
6
- } from "./content-headers-zjmacp9c.js";
6
+ } from "./range-ay32z58n.js";
7
7
 
8
8
  // src/handlers/usage.ts
9
9
  import { UsageLimits } from "@opencode/core/usage-limits";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  Api2
3
- } from "./content-headers-zjmacp9c.js";
3
+ } from "./range-ay32z58n.js";
4
4
 
5
5
  // src/handlers/worktree.ts
6
6
  import { Git } from "@opencode/core/git";