@opencode/server 2.0.22 → 2.0.23

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 +1 -1
  2. package/dist/api.js +5 -5
  3. package/dist/auth.js +1 -1
  4. package/dist/chunks/{auth-kqk7gaza.js → options-0b1t2b2s.js} +2 -2
  5. package/dist/chunks/{auth-w5qev33e.js → options-2vy10eeh.js} +2 -2
  6. package/dist/chunks/{auth-vak2mhq3.js → options-30gqa6y8.js} +11 -8
  7. package/dist/chunks/{auth-2nzbqq6w.js → options-387sf4vs.js} +1 -1
  8. package/dist/chunks/{auth-rrt24jy6.js → options-3c937re8.js} +2 -2
  9. package/dist/chunks/{auth-5ybpxcad.js → options-54sczv30.js} +7 -7
  10. package/dist/chunks/{auth-39fhjz78.js → options-5fmydwgy.js} +1 -1
  11. package/dist/chunks/{auth-t9jkrcq1.js → options-5p62ed52.js} +5 -5
  12. package/dist/chunks/{auth-xsrtpxyd.js → options-5w24ch67.js} +4 -4
  13. package/dist/chunks/{auth-pz0jzgeb.js → options-62qjgyra.js} +2 -2
  14. package/dist/chunks/{auth-rg7j7cph.js → options-6sgwm4gr.js} +2 -2
  15. package/dist/chunks/{auth-p2pbe694.js → options-7nkw7zmw.js} +6 -6
  16. package/dist/chunks/{auth-0ar9gf7q.js → options-acgs9zzk.js} +13 -6
  17. package/dist/chunks/{auth-anm12x33.js → options-anm12x33.js} +1 -1
  18. package/dist/chunks/{auth-1w959dsa.js → options-aqzs83qc.js} +4 -4
  19. package/dist/chunks/{auth-vvagfka3.js → options-bkk2wfbz.js} +7 -7
  20. package/dist/chunks/{auth-2b206wcs.js → options-bptmkrac.js} +2 -2
  21. package/dist/chunks/{auth-scvg88rk.js → options-ccfecbt4.js} +1 -1
  22. package/dist/chunks/{auth-frv6gfy7.js → options-d00srfh1.js} +6 -5
  23. package/dist/chunks/{auth-9aabh8fh.js → options-da5stqtt.js} +2 -2
  24. package/dist/chunks/{auth-wtp56sjr.js → options-dvemjn3r.js} +11 -9
  25. package/dist/chunks/{auth-ar2c062s.js → options-ep84ha6r.js} +3 -3
  26. package/dist/chunks/{auth-vjmrn89t.js → options-fsrvj92d.js} +2 -2
  27. package/dist/chunks/{auth-5gkna4pv.js → options-gdqqe6m4.js} +33 -33
  28. package/dist/chunks/{auth-gtkdacvk.js → options-gtkdacvk.js} +1 -1
  29. package/dist/chunks/{auth-g404tgwp.js → options-j54drd5e.js} +1 -1
  30. package/dist/chunks/{auth-96sfj8c0.js → options-jhsx8jtg.js} +2 -2
  31. package/dist/chunks/{auth-0h6q40e6.js → options-jskw5q1g.js} +1 -1
  32. package/dist/chunks/{auth-35z95kj0.js → options-k4rfktze.js} +3 -3
  33. package/dist/chunks/{auth-rbn15j6z.js → options-kr61w04k.js} +8 -8
  34. package/dist/chunks/{auth-j4tb0vx8.js → options-m9wzfeff.js} +2 -2
  35. package/dist/chunks/{auth-jk9mr6vp.js → options-mpbfcr4e.js} +5 -2
  36. package/dist/chunks/{auth-11g6bym3.js → options-n7kafg5g.js} +2 -2
  37. package/dist/chunks/options-nvmdgpqv.js +71 -0
  38. package/dist/chunks/{auth-23w8t84j.js → options-nxdx74sv.js} +5 -4
  39. package/dist/chunks/{auth-a7ke583f.js → options-pg3sqc69.js} +5 -4
  40. package/dist/chunks/{auth-zhw07218.js → options-q4y3mw2d.js} +2 -2
  41. package/dist/chunks/{auth-0658f5hp.js → options-qcy0p5fz.js} +2 -2
  42. package/dist/chunks/{auth-sryvrekq.js → options-srcrrwjk.js} +2 -2
  43. package/dist/chunks/{auth-rn5anws3.js → options-swb5yrqf.js} +2 -2
  44. package/dist/chunks/{auth-b0kafjgg.js → options-vkrn1g9x.js} +17 -17
  45. package/dist/chunks/{auth-7cv7ehbj.js → options-w8db1rkr.js} +2 -2
  46. package/dist/chunks/{auth-wym6bqm8.js → options-wzq8v6r1.js} +7 -7
  47. package/dist/chunks/{auth-trr1emsb.js → options-zhqf1t9m.js} +1 -1
  48. package/dist/cors.js +1 -1
  49. package/dist/event-feed.js +5 -5
  50. package/dist/fetch.d.ts +2 -1
  51. package/dist/fetch.js +49 -49
  52. package/dist/handlers/agent.js +6 -6
  53. package/dist/handlers/command.js +6 -6
  54. package/dist/handlers/config.js +6 -6
  55. package/dist/handlers/credential.js +6 -6
  56. package/dist/handlers/debug.js +6 -6
  57. package/dist/handlers/event.js +7 -7
  58. package/dist/handlers/form.js +6 -6
  59. package/dist/handlers/fs.js +6 -6
  60. package/dist/handlers/generate.js +6 -6
  61. package/dist/handlers/integration.js +6 -6
  62. package/dist/handlers/location.js +6 -6
  63. package/dist/handlers/mcp.js +6 -6
  64. package/dist/handlers/message.js +6 -6
  65. package/dist/handlers/migration.js +6 -6
  66. package/dist/handlers/model.js +6 -6
  67. package/dist/handlers/permission.js +6 -6
  68. package/dist/handlers/persistent-pty.js +8 -8
  69. package/dist/handlers/plugin.js +6 -6
  70. package/dist/handlers/project.js +6 -6
  71. package/dist/handlers/provider.js +6 -6
  72. package/dist/handlers/pty-socket.js +1 -1
  73. package/dist/handlers/pty.js +9 -9
  74. package/dist/handlers/reference.js +6 -6
  75. package/dist/handlers/rpc.js +6 -6
  76. package/dist/handlers/server.js +9 -9
  77. package/dist/handlers/session-error.js +1 -1
  78. package/dist/handlers/session.js +6 -6
  79. package/dist/handlers/shell.js +6 -6
  80. package/dist/handlers/skill.js +6 -6
  81. package/dist/handlers/vcs.d.ts +4 -1
  82. package/dist/handlers/vcs.js +6 -6
  83. package/dist/handlers/websearch.js +6 -6
  84. package/dist/handlers/worktree.js +6 -6
  85. package/dist/handlers.d.ts +1 -1
  86. package/dist/handlers.js +43 -43
  87. package/dist/location.d.ts +5 -3
  88. package/dist/location.js +6 -4
  89. package/dist/middleware/authorization.js +2 -2
  90. package/dist/middleware/form-location.d.ts +3 -3
  91. package/dist/middleware/form-location.js +3 -3
  92. package/dist/middleware/schema-error.js +1 -1
  93. package/dist/middleware/session-location.d.ts +3 -3
  94. package/dist/middleware/session-location.js +3 -3
  95. package/dist/options.d.ts +1 -0
  96. package/dist/pairing.js +5 -5
  97. package/dist/process.d.ts +2 -1
  98. package/dist/process.js +51 -51
  99. package/dist/pty-environment.js +5 -5
  100. package/dist/request-tracing.js +1 -1
  101. package/dist/routes.d.ts +2 -2
  102. package/dist/routes.js +46 -46
  103. package/dist/server-info.js +3 -3
  104. package/dist/service-status.js +3 -3
  105. package/dist/workerd.js +51 -50
  106. package/package.json +8 -8
  107. package/dist/chunks/auth-k9ssaf54.js +0 -32
  108. /package/dist/chunks/{auth-9rqn6x4v.js → options-9rqn6x4v.js} +0 -0
  109. /package/dist/chunks/{auth-hezj1jdf.js → options-hezj1jdf.js} +0 -0
  110. /package/dist/chunks/{auth-q4bn6dy8.js → options-q4bn6dy8.js} +0 -0
  111. /package/dist/chunks/{auth-smaf4a18.js → options-smaf4a18.js} +0 -0
  112. /package/dist/chunks/{auth-t8yzmczr.js → options-t8yzmczr.js} +0 -0
  113. /package/dist/chunks/{auth-yc7nft6q.js → options-yc7nft6q.js} +0 -0
@@ -1,99 +1,99 @@
1
1
  import {
2
2
  GenerateHandler2
3
- } from "./auth-jk9mr6vp.js";
3
+ } from "./options-mpbfcr4e.js";
4
4
  import {
5
5
  MessageHandler2
6
- } from "./auth-kqk7gaza.js";
6
+ } from "./options-0b1t2b2s.js";
7
7
  import {
8
8
  ModelHandler2
9
- } from "./auth-vjmrn89t.js";
9
+ } from "./options-fsrvj92d.js";
10
10
  import {
11
11
  ProviderHandler2
12
- } from "./auth-rn5anws3.js";
12
+ } from "./options-swb5yrqf.js";
13
13
  import {
14
14
  SessionHandler2
15
- } from "./auth-vak2mhq3.js";
15
+ } from "./options-30gqa6y8.js";
16
16
  import {
17
17
  PermissionHandler2
18
- } from "./auth-a7ke583f.js";
18
+ } from "./options-pg3sqc69.js";
19
19
  import {
20
20
  FileSystemHandler2
21
- } from "./auth-96sfj8c0.js";
21
+ } from "./options-jhsx8jtg.js";
22
22
  import {
23
23
  FormHandler2
24
- } from "./auth-w5qev33e.js";
24
+ } from "./options-2vy10eeh.js";
25
25
  import {
26
26
  CommandHandler2
27
- } from "./auth-zhw07218.js";
27
+ } from "./options-q4y3mw2d.js";
28
28
  import {
29
29
  SkillHandler2
30
- } from "./auth-j4tb0vx8.js";
30
+ } from "./options-m9wzfeff.js";
31
31
  import {
32
32
  RpcHandler2
33
- } from "./auth-trr1emsb.js";
33
+ } from "./options-zhqf1t9m.js";
34
34
  import {
35
- layer3
36
- } from "./auth-5ybpxcad.js";
35
+ layer5
36
+ } from "./options-54sczv30.js";
37
37
  import {
38
38
  EventHandler2
39
- } from "./auth-1w959dsa.js";
39
+ } from "./options-aqzs83qc.js";
40
40
  import {
41
41
  AgentHandler2
42
- } from "./auth-0658f5hp.js";
42
+ } from "./options-qcy0p5fz.js";
43
43
  import {
44
44
  PluginHandler2
45
- } from "./auth-pz0jzgeb.js";
45
+ } from "./options-62qjgyra.js";
46
46
  import {
47
47
  ServerHandler2
48
- } from "./auth-wtp56sjr.js";
48
+ } from "./options-dvemjn3r.js";
49
49
  import {
50
50
  DebugHandler2
51
- } from "./auth-7cv7ehbj.js";
51
+ } from "./options-w8db1rkr.js";
52
52
  import {
53
53
  PtyHandler2
54
- } from "./auth-wym6bqm8.js";
54
+ } from "./options-wzq8v6r1.js";
55
55
  import {
56
56
  PersistentPtyHandler2
57
- } from "./auth-35z95kj0.js";
57
+ } from "./options-k4rfktze.js";
58
58
  import {
59
59
  ShellHandler2
60
- } from "./auth-sryvrekq.js";
60
+ } from "./options-srcrrwjk.js";
61
61
  import {
62
62
  ReferenceHandler2
63
- } from "./auth-11g6bym3.js";
63
+ } from "./options-n7kafg5g.js";
64
64
  import {
65
65
  LocationHandler2
66
- } from "./auth-9aabh8fh.js";
66
+ } from "./options-da5stqtt.js";
67
67
  import {
68
68
  IntegrationHandler2
69
- } from "./auth-rg7j7cph.js";
69
+ } from "./options-6sgwm4gr.js";
70
70
  import {
71
71
  WebSearchHandler2
72
- } from "./auth-2b206wcs.js";
72
+ } from "./options-bptmkrac.js";
73
73
  import {
74
74
  McpHandler2
75
- } from "./auth-rrt24jy6.js";
75
+ } from "./options-3c937re8.js";
76
76
  import {
77
77
  CredentialHandler2
78
- } from "./auth-g404tgwp.js";
78
+ } from "./options-j54drd5e.js";
79
79
  import {
80
80
  ProjectHandler2
81
- } from "./auth-39fhjz78.js";
81
+ } from "./options-5fmydwgy.js";
82
82
  import {
83
83
  WorktreeHandler2
84
- } from "./auth-scvg88rk.js";
84
+ } from "./options-ccfecbt4.js";
85
85
  import {
86
86
  VcsHandler2
87
- } from "./auth-k9ssaf54.js";
87
+ } from "./options-nvmdgpqv.js";
88
88
  import {
89
89
  MigrationHandler2
90
- } from "./auth-2nzbqq6w.js";
90
+ } from "./options-387sf4vs.js";
91
91
  import {
92
92
  ConfigHandler2
93
- } from "./auth-0h6q40e6.js";
93
+ } from "./options-jskw5q1g.js";
94
94
 
95
95
  // src/handlers.ts
96
96
  import { Layer } from "effect";
97
- var handlers2 = Layer.mergeAll(ServerHandler2, DebugHandler2, MigrationHandler2, LocationHandler2, AgentHandler2, PluginHandler2, SessionHandler2, MessageHandler2, ModelHandler2, GenerateHandler2, ProviderHandler2, IntegrationHandler2, WebSearchHandler2, McpHandler2, CredentialHandler2, ProjectHandler2, FormHandler2, PermissionHandler2, FileSystemHandler2, CommandHandler2, SkillHandler2, RpcHandler2, EventHandler2.pipe(Layer.provide(layer3)), PtyHandler2, PersistentPtyHandler2, ShellHandler2, ReferenceHandler2, WorktreeHandler2, VcsHandler2, ConfigHandler2);
97
+ var handlers2 = Layer.mergeAll(ServerHandler2, DebugHandler2, MigrationHandler2, LocationHandler2, AgentHandler2, PluginHandler2, SessionHandler2, MessageHandler2, ModelHandler2, GenerateHandler2, ProviderHandler2, IntegrationHandler2, WebSearchHandler2, McpHandler2, CredentialHandler2, ProjectHandler2, FormHandler2, PermissionHandler2, FileSystemHandler2, CommandHandler2, SkillHandler2, RpcHandler2, EventHandler2.pipe(Layer.provide(layer5)), PtyHandler2, PersistentPtyHandler2, ShellHandler2, ReferenceHandler2, WorktreeHandler2, VcsHandler2, ConfigHandler2);
98
98
 
99
99
  export { handlers2 };
@@ -4,7 +4,7 @@ import {
4
4
  authorized2,
5
5
  verifySession2,
6
6
  sessionCookieName2
7
- } from "./auth-anm12x33.js";
7
+ } from "./options-anm12x33.js";
8
8
 
9
9
  // src/middleware/authorization.ts
10
10
  import { UnauthorizedError } from "@opencode/protocol/errors";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  Api2
3
- } from "./auth-ar2c062s.js";
3
+ } from "./options-ep84ha6r.js";
4
4
 
5
5
  // src/handlers/credential.ts
6
6
  import { Credential } from "@opencode/core/credential";
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  response2
3
- } from "./auth-0ar9gf7q.js";
3
+ } from "./options-acgs9zzk.js";
4
4
  import {
5
5
  Api2
6
- } from "./auth-ar2c062s.js";
6
+ } from "./options-ep84ha6r.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 "./auth-ar2c062s.js";
3
+ } from "./options-ep84ha6r.js";
4
4
 
5
5
  // src/handlers/config.ts
6
6
  import { Config } from "@opencode/core/config";
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  Api2
3
- } from "./auth-ar2c062s.js";
3
+ } from "./options-ep84ha6r.js";
4
4
  import {
5
5
  CorsConfig2,
6
6
  isAllowedRequestOrigin2
7
- } from "./auth-q4bn6dy8.js";
7
+ } from "./options-q4bn6dy8.js";
8
8
  import {
9
9
  runPtySocket2
10
- } from "./auth-hezj1jdf.js";
10
+ } from "./options-hezj1jdf.js";
11
11
 
12
12
  // src/handlers/persistent-pty.ts
13
13
  import { PersistentPty } from "@opencode/core/persistent-pty";
@@ -1,25 +1,25 @@
1
1
  import {
2
2
  __export
3
- } from "./auth-9rqn6x4v.js";
3
+ } from "./options-9rqn6x4v.js";
4
4
 
5
5
  // src/pairing.ts
6
6
  var exports_pairing = {};
7
7
  __export(exports_pairing, {
8
8
  ServerPairing: () => exports_pairing,
9
- Service: () => Service2,
10
- node: () => node2
9
+ Service: () => Service3,
10
+ node: () => node3
11
11
  });
12
12
  import { Cache, Context, Duration, Effect, Layer } from "effect";
13
13
  import { makeGlobalNode } from "@opencode/util/effect/app-node";
14
14
  import { randomBytes } from "node:crypto";
15
15
  var TTL = Duration.minutes(5);
16
16
 
17
- class Service2 extends Context.Service()("@opencode/ServerPairing") {
17
+ class Service3 extends Context.Service()("@opencode/ServerPairing") {
18
18
  }
19
19
  var noLookup = () => Effect.die(new Error("ServerPairing cache must be used via set/invalidateWhen, never get"));
20
- var layer = Layer.effect(Service2, Effect.gen(function* () {
20
+ var layer = Layer.effect(Service3, Effect.gen(function* () {
21
21
  const cache = yield* Cache.make({ capacity: 1000, lookup: noLookup, timeToLive: TTL });
22
- return Service2.of({
22
+ return Service3.of({
23
23
  issue: Effect.fn("ServerPairing.issue")(function* () {
24
24
  const code = randomBytes(16).toString("base64url");
25
25
  yield* Cache.set(cache, code, true);
@@ -30,6 +30,6 @@ var layer = Layer.effect(Service2, Effect.gen(function* () {
30
30
  })
31
31
  });
32
32
  }));
33
- var node2 = makeGlobalNode({ service: Service2, layer, deps: [] });
33
+ var node3 = makeGlobalNode({ service: Service3, layer, deps: [] });
34
34
 
35
- export { Service2, node2, exports_pairing };
35
+ export { Service3, node3, exports_pairing };
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  response2
3
- } from "./auth-0ar9gf7q.js";
3
+ } from "./options-acgs9zzk.js";
4
4
  import {
5
5
  Api2
6
- } from "./auth-ar2c062s.js";
6
+ } from "./options-ep84ha6r.js";
7
7
 
8
8
  // src/handlers/skill.ts
9
9
  import { Skill } from "@opencode/core/skill";
@@ -1,6 +1,9 @@
1
+ import {
2
+ locationErrors2
3
+ } from "./options-acgs9zzk.js";
1
4
  import {
2
5
  Api2
3
- } from "./auth-ar2c062s.js";
6
+ } from "./options-ep84ha6r.js";
4
7
 
5
8
  // src/handlers/generate.ts
6
9
  import { Generate } from "@opencode/core/generate";
@@ -19,7 +22,7 @@ var GenerateHandler2 = HttpApiBuilder.group(Api2, "server.generate", (handlers)
19
22
  const generate = yield* Generate.Service;
20
23
  const text = yield* generate.text(request.payload).pipe(Effect.mapError((error) => error._tag === "Generate.ModelSelectionError" ? new InvalidRequestError({ message: error.message }) : new ServiceUnavailableError({ message: error.message, service: error.service })));
21
24
  return { data: { text } };
22
- }, Effect.provide(services)));
25
+ }, Effect.provide(services), locationErrors2));
23
26
  }));
24
27
 
25
28
  export { GenerateHandler2 };
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  response2
3
- } from "./auth-0ar9gf7q.js";
3
+ } from "./options-acgs9zzk.js";
4
4
  import {
5
5
  Api2
6
- } from "./auth-ar2c062s.js";
6
+ } from "./options-ep84ha6r.js";
7
7
 
8
8
  // src/handlers/reference.ts
9
9
  import { Reference } from "@opencode/core/reference";
@@ -0,0 +1,71 @@
1
+ import {
2
+ response2
3
+ } from "./options-acgs9zzk.js";
4
+ import {
5
+ Api2
6
+ } from "./options-ep84ha6r.js";
7
+
8
+ // src/handlers/vcs.ts
9
+ import { Vcs } from "@opencode/core/vcs";
10
+ import { Project } from "@opencode/core/project";
11
+ import { Worktree } from "@opencode/core/worktree";
12
+ import { Bus } from "@opencode/core/bus";
13
+ import { Plugin } from "@opencode/core/plugin";
14
+ import { Location } from "@opencode/core/location";
15
+ import { LocationServiceMap } from "@opencode/core/location-services";
16
+ import { ConflictError, InvalidRequestError, ServiceUnavailableError } from "@opencode/protocol/errors";
17
+ import { VcsInitNotSupportedError } from "@opencode/protocol/groups/vcs";
18
+ import { Effect } from "effect";
19
+ import { HttpApiBuilder, HttpApiSchema } from "effect/unstable/httpapi";
20
+ var VcsHandler2 = HttpApiBuilder.group(Api2, "server.vcs", (handlers) => Effect.gen(function* () {
21
+ const project = yield* Project.Service;
22
+ const bus = yield* Bus.Service;
23
+ const locations = yield* LocationServiceMap.Service;
24
+ return handlers.handle("vcs.init", (ctx) => Effect.gen(function* () {
25
+ const location = yield* Location.Service;
26
+ const directory = location.project.directory;
27
+ const providerID = ctx.query.provider ?? "git";
28
+ yield* Plugin.awaitActivation;
29
+ const vcs = yield* Vcs.Service;
30
+ yield* vcs.initialize(providerID).pipe(Effect.mapError((error) => {
31
+ if (error.kind === "missing")
32
+ return new InvalidRequestError({ message: "Project directory does not exist", field: "location" });
33
+ if (error.kind === "conflict")
34
+ return new ConflictError({ message: "Project already has version control", resource: directory });
35
+ if (error.kind === "unknown")
36
+ return new InvalidRequestError({
37
+ message: "Unknown VCS provider",
38
+ field: "provider"
39
+ });
40
+ if (error.kind === "unsupported")
41
+ return new VcsInitNotSupportedError({
42
+ providerID,
43
+ message: "VCS provider does not support initialization"
44
+ });
45
+ return new ServiceUnavailableError({ service: providerID, message: "VCS initialization failed" });
46
+ }));
47
+ const resolved = yield* project.resolve(directory);
48
+ if (!resolved.vcs)
49
+ return yield* new ServiceUnavailableError({ service: providerID, message: "VCS initialization failed" });
50
+ yield* locations.invalidate(Location.Ref.make({ directory: location.directory, workspaceID: location.workspaceID }));
51
+ yield* bus.publish(Worktree.Event.Updated, { projectID: resolved.id });
52
+ return HttpApiSchema.NoContent.make();
53
+ })).handle("vcs.get", () => response2(Effect.gen(function* () {
54
+ const vcs = yield* Vcs.Service;
55
+ return yield* vcs.info();
56
+ }))).handle("vcs.base", () => response2(Effect.gen(function* () {
57
+ const vcs = yield* Vcs.Service;
58
+ return yield* vcs.base().pipe(Effect.mapError((error) => new ServiceUnavailableError({ service: "vcs", message: error.message })));
59
+ }))).handle("vcs.status", () => response2(Effect.gen(function* () {
60
+ const vcs = yield* Vcs.Service;
61
+ return yield* vcs.status();
62
+ }))).handle("vcs.branch.list", (ctx) => response2(Effect.gen(function* () {
63
+ const vcs = yield* Vcs.Service;
64
+ return yield* vcs.branches({ search: ctx.query.search, limit: Math.min(ctx.query.limit ?? 50, 100) });
65
+ }))).handle("vcs.diff", (ctx) => response2(Effect.gen(function* () {
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 })));
68
+ })));
69
+ }));
70
+
71
+ export { VcsHandler2 };
@@ -1,6 +1,7 @@
1
1
  import {
2
+ locationErrors2,
2
3
  sessionInfo2
3
- } from "./auth-0ar9gf7q.js";
4
+ } from "./options-acgs9zzk.js";
4
5
 
5
6
  // src/middleware/session-location.ts
6
7
  import { Instance } from "@opencode/core/instance/service";
@@ -8,9 +9,9 @@ import { Session } from "@opencode/core/session";
8
9
  import { Effect, Layer } from "effect";
9
10
  import { HttpRouter } from "effect/unstable/http";
10
11
  import { HttpApiMiddleware } from "effect/unstable/httpapi";
11
- import { InvalidRequestError, SessionNotFoundError } from "@opencode/protocol/errors";
12
+ import { LocationNotFoundError, InvalidRequestError, SessionNotFoundError } from "@opencode/protocol/errors";
12
13
  class SessionLocationMiddleware2 extends HttpApiMiddleware.Service()("@opencode/HttpApiSessionLocation", {
13
- error: [InvalidRequestError, SessionNotFoundError]
14
+ error: [InvalidRequestError, SessionNotFoundError, LocationNotFoundError]
14
15
  }) {
15
16
  }
16
17
  var sessionLocationLayer2 = Layer.effect(SessionLocationMiddleware2, Effect.gen(function* () {
@@ -19,7 +20,7 @@ var sessionLocationLayer2 = Layer.effect(SessionLocationMiddleware2, Effect.gen(
19
20
  return SessionLocationMiddleware2.of((effect) => Effect.gen(function* () {
20
21
  const route = yield* HttpRouter.RouteContext;
21
22
  const session = yield* sessionInfo2(sessions, route.params.sessionID);
22
- return yield* effect.pipe(instances.provide(session));
23
+ return yield* effect.pipe(instances.provide(session), locationErrors2);
23
24
  }));
24
25
  }));
25
26
 
@@ -1,13 +1,14 @@
1
1
  import {
2
2
  missingSession2
3
- } from "./auth-smaf4a18.js";
3
+ } from "./options-smaf4a18.js";
4
4
  import {
5
+ locationErrors2,
5
6
  response2,
6
7
  sessionInfo2
7
- } from "./auth-0ar9gf7q.js";
8
+ } from "./options-acgs9zzk.js";
8
9
  import {
9
10
  Api2
10
- } from "./auth-ar2c062s.js";
11
+ } from "./options-ep84ha6r.js";
11
12
 
12
13
  // src/handlers/permission.ts
13
14
  import { Instance } from "@opencode/core/instance/service";
@@ -50,7 +51,7 @@ var PermissionHandler2 = HttpApiBuilder.group(Api2, "server.permission", (handle
50
51
  };
51
52
  })).handle("session.permission.list", Effect.fn(function* (ctx) {
52
53
  const session = yield* sessionInfo2(sessions, ctx.params.sessionID);
53
- const requests = yield* Permission.Service.use((permission) => permission.forSession(ctx.params.sessionID)).pipe(instances.provide(session));
54
+ const requests = yield* Permission.Service.use((permission) => permission.forSession(ctx.params.sessionID)).pipe(instances.provide(session), locationErrors2);
54
55
  return { data: requests };
55
56
  })).handle("session.permission.get", Effect.fn(function* (ctx) {
56
57
  const owned = yield* requireOwnedRequest(ctx.params.sessionID, ctx.params.requestID);
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  response2
3
- } from "./auth-0ar9gf7q.js";
3
+ } from "./options-acgs9zzk.js";
4
4
  import {
5
5
  Api2
6
- } from "./auth-ar2c062s.js";
6
+ } from "./options-ep84ha6r.js";
7
7
 
8
8
  // src/handlers/command.ts
9
9
  import { Command } from "@opencode/core/command";
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  response2
3
- } from "./auth-0ar9gf7q.js";
3
+ } from "./options-acgs9zzk.js";
4
4
  import {
5
5
  Api2
6
- } from "./auth-ar2c062s.js";
6
+ } from "./options-ep84ha6r.js";
7
7
 
8
8
  // src/handlers/agent.ts
9
9
  import { Agent } from "@opencode/core/agent";
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  response2
3
- } from "./auth-0ar9gf7q.js";
3
+ } from "./options-acgs9zzk.js";
4
4
  import {
5
5
  Api2
6
- } from "./auth-ar2c062s.js";
6
+ } from "./options-ep84ha6r.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
  response2
3
- } from "./auth-0ar9gf7q.js";
3
+ } from "./options-acgs9zzk.js";
4
4
  import {
5
5
  Api2
6
- } from "./auth-ar2c062s.js";
6
+ } from "./options-ep84ha6r.js";
7
7
 
8
8
  // src/handlers/provider.ts
9
9
  import { Provider } from "@opencode/core/provider";
@@ -1,39 +1,39 @@
1
1
  import {
2
- layer5
3
- } from "./auth-0ar9gf7q.js";
2
+ layer3
3
+ } from "./options-acgs9zzk.js";
4
4
  import {
5
5
  formLocationLayer2
6
- } from "./auth-frv6gfy7.js";
6
+ } from "./options-d00srfh1.js";
7
7
  import {
8
8
  sessionLocationLayer2
9
- } from "./auth-23w8t84j.js";
9
+ } from "./options-nxdx74sv.js";
10
10
  import {
11
11
  Api2
12
- } from "./auth-ar2c062s.js";
12
+ } from "./options-ep84ha6r.js";
13
13
  import {
14
14
  Config2
15
- } from "./auth-anm12x33.js";
15
+ } from "./options-anm12x33.js";
16
16
  import {
17
17
  CorsConfig2
18
- } from "./auth-q4bn6dy8.js";
18
+ } from "./options-q4bn6dy8.js";
19
19
  import {
20
20
  layer4
21
- } from "./auth-t9jkrcq1.js";
22
- import {
23
- node2
24
- } from "./auth-rbn15j6z.js";
21
+ } from "./options-5p62ed52.js";
25
22
  import {
26
23
  node3
27
- } from "./auth-vvagfka3.js";
24
+ } from "./options-kr61w04k.js";
25
+ import {
26
+ node2
27
+ } from "./options-bkk2wfbz.js";
28
28
  import {
29
29
  handlers2
30
- } from "./auth-5gkna4pv.js";
30
+ } from "./options-gdqqe6m4.js";
31
31
  import {
32
32
  authorizationLayer2
33
- } from "./auth-gtkdacvk.js";
33
+ } from "./options-gtkdacvk.js";
34
34
  import {
35
35
  schemaErrorLayer2
36
- } from "./auth-t8yzmczr.js";
36
+ } from "./options-t8yzmczr.js";
37
37
 
38
38
  // src/routes.ts
39
39
  import { Database } from "@opencode/core/database/database";
@@ -91,8 +91,8 @@ var applicationServiceNodes = [
91
91
  PersistentPty.node,
92
92
  Credential.node,
93
93
  WellKnown.node,
94
- node3,
95
94
  node2,
95
+ node3,
96
96
  LocationServiceMap.node,
97
97
  LocationActivity.node,
98
98
  SessionRestart.node,
@@ -145,7 +145,7 @@ function makeRoutes(auth, options, serviceURLs, overrides, instances) {
145
145
  return serviceLayer.pipe(Layer.flatMap((context) => {
146
146
  const services = Layer.succeedContext(context);
147
147
  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));
148
- 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(layer5), Layer.provide(authorizationLayer2), Layer.provide(schemaErrorLayer2), Layer.provide(auth), HttpRouter.provideRequest(requestServices), Layer.provideMerge(services), Layer.provideMerge(HttpRouter.layer));
148
+ 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(layer3), Layer.provide(authorizationLayer2), Layer.provide(schemaErrorLayer2), Layer.provide(auth), HttpRouter.provideRequest(requestServices), Layer.provideMerge(services), Layer.provideMerge(HttpRouter.layer));
149
149
  return Layer.merge(api, V1Migration.layer.pipe(Layer.provide(services)));
150
150
  }));
151
151
  }
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  requestRef2
3
- } from "./auth-0ar9gf7q.js";
3
+ } from "./options-acgs9zzk.js";
4
4
  import {
5
5
  Api2
6
- } from "./auth-ar2c062s.js";
6
+ } from "./options-ep84ha6r.js";
7
7
 
8
8
  // src/handlers/debug.ts
9
9
  import { LocationServiceMap } from "@opencode/core/location-service-map";
@@ -1,19 +1,19 @@
1
1
  import {
2
2
  response2
3
- } from "./auth-0ar9gf7q.js";
3
+ } from "./options-acgs9zzk.js";
4
4
  import {
5
5
  Api2
6
- } from "./auth-ar2c062s.js";
6
+ } from "./options-ep84ha6r.js";
7
7
  import {
8
8
  CorsConfig2,
9
9
  isAllowedRequestOrigin2
10
- } from "./auth-q4bn6dy8.js";
10
+ } from "./options-q4bn6dy8.js";
11
11
  import {
12
- Service3
13
- } from "./auth-vvagfka3.js";
12
+ Service2
13
+ } from "./options-bkk2wfbz.js";
14
14
  import {
15
15
  runPtySocket2
16
- } from "./auth-hezj1jdf.js";
16
+ } from "./options-hezj1jdf.js";
17
17
 
18
18
  // src/handlers/pty.ts
19
19
  import { Pty } from "@opencode/core/pty";
@@ -37,7 +37,7 @@ var ticketScope = Effect.gen(function* () {
37
37
  var PtyHandler2 = HttpApiBuilder.group(Api2, "server.pty", (handlers) => Effect.gen(function* () {
38
38
  const tickets = yield* PtyTicket.Service;
39
39
  const cors = yield* CorsConfig2;
40
- const environment = yield* Service3;
40
+ const environment = yield* Service2;
41
41
  return handlers.handle("pty.list", Effect.fn(function* () {
42
42
  const pty = yield* Pty.Service;
43
43
  return yield* response2(pty.list());
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  Api2
3
- } from "./auth-ar2c062s.js";
3
+ } from "./options-ep84ha6r.js";
4
4
 
5
5
  // src/handlers/rpc.ts
6
6
  import { Rpc } from "@opencode/core/rpc";
package/dist/cors.js CHANGED
@@ -2,7 +2,7 @@ import {
2
2
  CorsConfig2,
3
3
  isAllowedCorsOrigin2,
4
4
  isAllowedRequestOrigin2
5
- } from "./chunks/auth-q4bn6dy8.js";
5
+ } from "./chunks/options-q4bn6dy8.js";
6
6
  export {
7
7
  CorsConfig2 as CorsConfig,
8
8
  isAllowedCorsOrigin2 as isAllowedCorsOrigin,
@@ -2,19 +2,19 @@ import {
2
2
  SubscriberCapacity2,
3
3
  SubscriberOverflowError2,
4
4
  EncodingError2,
5
- Service4,
5
+ Service5,
6
6
  frame2,
7
7
  make4,
8
- layer3,
8
+ layer5,
9
9
  exports_event_feed
10
- } from "./chunks/auth-5ybpxcad.js";
10
+ } from "./chunks/options-54sczv30.js";
11
11
  export {
12
12
  EncodingError2 as EncodingError,
13
13
  exports_event_feed as EventFeed,
14
- Service4 as Service,
14
+ Service5 as Service,
15
15
  SubscriberCapacity2 as SubscriberCapacity,
16
16
  SubscriberOverflowError2 as SubscriberOverflowError,
17
17
  frame2 as frame,
18
- layer3 as layer,
18
+ layer5 as layer,
19
19
  make4 as make
20
20
  };
package/dist/fetch.d.ts CHANGED
@@ -41,6 +41,7 @@ export declare const make: (options?: {
41
41
  readonly persist?: boolean | undefined;
42
42
  } | undefined;
43
43
  readonly pty?: {
44
+ readonly root?: string | undefined;
44
45
  readonly handoff?: {
45
46
  readonly directory: string;
46
47
  readonly instanceID: string;
@@ -59,8 +60,8 @@ export declare const make: (options?: {
59
60
  readonly windows?: {
60
61
  readonly gitbash?: string | undefined;
61
62
  } | undefined;
62
- readonly port?: number | undefined;
63
63
  readonly password?: string | undefined;
64
+ readonly port?: number | undefined;
64
65
  readonly app?: {
65
66
  readonly version?: string | undefined;
66
67
  readonly name?: string | undefined;