@opencode/server 2.0.25 → 2.0.27

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 (144) hide show
  1. package/dist/api.d.ts +17 -14
  2. package/dist/api.js +5 -5
  3. package/dist/auth.js +1 -1
  4. package/dist/chunks/{location-1nwce8pe.js → pty-environment-08x9tjee.js} +2 -2
  5. package/dist/chunks/{location-sstsrjtg.js → pty-environment-0chp8crd.js} +8 -8
  6. package/dist/chunks/pty-environment-0d864bga.js +15 -0
  7. package/dist/chunks/{location-c7mfxxxb.js → pty-environment-1k1cts14.js} +6 -6
  8. package/dist/chunks/{location-0d9kah4z.js → pty-environment-383t61pr.js} +7 -7
  9. package/dist/chunks/{location-v9pcqbqn.js → pty-environment-43r48nqn.js} +3 -3
  10. package/dist/chunks/{location-7gfv664k.js → pty-environment-4d1eemzq.js} +6 -4
  11. package/dist/chunks/{location-krn4521r.js → pty-environment-4dv9a668.js} +3 -3
  12. package/dist/chunks/{location-w070c2h2.js → pty-environment-4hhhes7w.js} +3 -3
  13. package/dist/chunks/{location-f7sjppyz.js → pty-environment-4yg61rns.js} +32 -31
  14. package/dist/chunks/{location-gtkdacvk.js → pty-environment-5ytyqf1q.js} +5 -4
  15. package/dist/chunks/{location-7rxakzjh.js → pty-environment-5zsr2h86.js} +2 -2
  16. package/dist/chunks/{location-hvft24jv.js → pty-environment-7vd5668a.js} +2 -2
  17. package/dist/chunks/{location-weqhmjbd.js → pty-environment-8137b89p.js} +3 -3
  18. package/dist/chunks/{location-m9xs9t19.js → pty-environment-8ad8dwnf.js} +7 -7
  19. package/dist/chunks/{location-0vyswjsz.js → pty-environment-97eb2r3v.js} +3 -3
  20. package/dist/chunks/{location-9cw9axw5.js → pty-environment-9snwnvf8.js} +3 -3
  21. package/dist/chunks/{location-x2by5wsf.js → pty-environment-aey6dvfz.js} +30 -34
  22. package/dist/chunks/{location-anm12x33.js → pty-environment-anm12x33.js} +1 -1
  23. package/dist/chunks/{location-f2c3fmpg.js → pty-environment-b56hqv74.js} +13 -5
  24. package/dist/chunks/{location-dqsr2g0t.js → pty-environment-bx47k33v.js} +3 -3
  25. package/dist/chunks/{location-93wjydnn.js → pty-environment-c6kb7fmf.js} +7 -7
  26. package/dist/chunks/{location-t8yzmczr.js → pty-environment-erzfdgke.js} +1 -1
  27. package/dist/chunks/{location-td9k2nw3.js → pty-environment-ewe1fzkk.js} +6 -3
  28. package/dist/chunks/{location-934cmkaf.js → pty-environment-ftaz8n62.js} +3 -3
  29. package/dist/chunks/pty-environment-h6rt5k9s.js +24 -0
  30. package/dist/chunks/{location-4znne276.js → pty-environment-h8ws5ssa.js} +2 -2
  31. package/dist/chunks/{location-ap5bajez.js → pty-environment-hkm2snxm.js} +33 -33
  32. package/dist/chunks/{location-796j10e5.js → pty-environment-j4zqsxgy.js} +3 -3
  33. package/dist/chunks/{location-16qfdx6b.js → pty-environment-nn6dbt3f.js} +3 -3
  34. package/dist/chunks/{location-ceje7ncg.js → pty-environment-pfs7tp5t.js} +20 -19
  35. package/dist/chunks/{location-1xva44q8.js → pty-environment-ptey1p5v.js} +3 -3
  36. package/dist/chunks/{location-g85r3kcp.js → pty-environment-qbh90c1d.js} +3 -3
  37. package/dist/chunks/{location-jzqzrtw5.js → pty-environment-rf01ee6q.js} +2 -2
  38. package/dist/chunks/{location-yybdkkb6.js → pty-environment-rntbwr87.js} +3 -3
  39. package/dist/chunks/{location-cqdj4ap7.js → pty-environment-ssyxw8nc.js} +5 -5
  40. package/dist/chunks/{location-9gvk307e.js → pty-environment-sxyyq1rb.js} +10 -10
  41. package/dist/chunks/{location-gny2k2ap.js → pty-environment-tqspcwns.js} +4 -4
  42. package/dist/chunks/{location-4rww2e47.js → pty-environment-vb5yx5r0.js} +3 -3
  43. package/dist/chunks/{location-n52yc5x0.js → pty-environment-vbzm2jgm.js} +3 -3
  44. package/dist/chunks/{location-2sy3c7de.js → pty-environment-vghchchj.js} +10 -10
  45. package/dist/chunks/{location-xsrtpxyd.js → pty-environment-vpz7f20y.js} +4 -4
  46. package/dist/chunks/{location-ym27c8rr.js → pty-environment-y1gfy88d.js} +4 -4
  47. package/dist/chunks/{location-ajzgetf8.js → pty-environment-yehasrps.js} +3 -3
  48. package/dist/chunks/{location-y1grnrmm.js → pty-environment-z6sxg6td.js} +2 -2
  49. package/dist/chunks/{location-ca257yb3.js → pty-environment-zessacar.js} +3 -3
  50. package/dist/cors.js +1 -1
  51. package/dist/event-feed.js +7 -7
  52. package/dist/fetch.d.ts +1 -1
  53. package/dist/fetch.js +49 -49
  54. package/dist/handlers/agent.d.ts +1 -1
  55. package/dist/handlers/agent.js +6 -6
  56. package/dist/handlers/command.d.ts +1 -1
  57. package/dist/handlers/command.js +6 -6
  58. package/dist/handlers/config.d.ts +1 -1
  59. package/dist/handlers/config.js +6 -6
  60. package/dist/handlers/credential.d.ts +1 -1
  61. package/dist/handlers/credential.js +6 -6
  62. package/dist/handlers/debug.d.ts +1 -1
  63. package/dist/handlers/debug.js +6 -6
  64. package/dist/handlers/event.d.ts +1 -1
  65. package/dist/handlers/event.js +7 -7
  66. package/dist/handlers/form.d.ts +1 -1
  67. package/dist/handlers/form.js +6 -6
  68. package/dist/handlers/fs.d.ts +1 -1
  69. package/dist/handlers/fs.js +6 -6
  70. package/dist/handlers/generate.d.ts +1 -1
  71. package/dist/handlers/generate.js +6 -6
  72. package/dist/handlers/integration.d.ts +1 -1
  73. package/dist/handlers/integration.js +6 -6
  74. package/dist/handlers/location.d.ts +1 -1
  75. package/dist/handlers/location.js +6 -6
  76. package/dist/handlers/mcp.d.ts +1 -1
  77. package/dist/handlers/mcp.js +6 -6
  78. package/dist/handlers/message.d.ts +1 -1
  79. package/dist/handlers/message.js +6 -6
  80. package/dist/handlers/migration.d.ts +1 -1
  81. package/dist/handlers/migration.js +6 -6
  82. package/dist/handlers/model.d.ts +1 -1
  83. package/dist/handlers/model.js +6 -6
  84. package/dist/handlers/permission.d.ts +1 -1
  85. package/dist/handlers/permission.js +6 -6
  86. package/dist/handlers/persistent-pty.d.ts +1 -1
  87. package/dist/handlers/persistent-pty.js +8 -8
  88. package/dist/handlers/plugin.d.ts +1 -1
  89. package/dist/handlers/plugin.js +6 -6
  90. package/dist/handlers/project.d.ts +1 -1
  91. package/dist/handlers/project.js +6 -6
  92. package/dist/handlers/provider.d.ts +1 -1
  93. package/dist/handlers/provider.js +6 -6
  94. package/dist/handlers/pty-socket.d.ts +10 -2
  95. package/dist/handlers/pty-socket.js +1 -1
  96. package/dist/handlers/pty.d.ts +1 -1
  97. package/dist/handlers/pty.js +9 -9
  98. package/dist/handlers/reference.d.ts +1 -1
  99. package/dist/handlers/reference.js +6 -6
  100. package/dist/handlers/rpc.d.ts +1 -1
  101. package/dist/handlers/rpc.js +6 -6
  102. package/dist/handlers/server.d.ts +1 -1
  103. package/dist/handlers/server.js +9 -9
  104. package/dist/handlers/session-error.js +1 -1
  105. package/dist/handlers/session.d.ts +1 -1
  106. package/dist/handlers/session.js +6 -6
  107. package/dist/handlers/shell.d.ts +1 -1
  108. package/dist/handlers/shell.js +6 -6
  109. package/dist/handlers/skill.d.ts +1 -1
  110. package/dist/handlers/skill.js +6 -6
  111. package/dist/handlers/vcs.d.ts +1 -1
  112. package/dist/handlers/vcs.js +6 -6
  113. package/dist/handlers/websearch.d.ts +1 -1
  114. package/dist/handlers/websearch.js +6 -6
  115. package/dist/handlers/worktree.d.ts +1 -1
  116. package/dist/handlers/worktree.js +6 -6
  117. package/dist/handlers.d.ts +1 -1
  118. package/dist/handlers.js +43 -43
  119. package/dist/location.d.ts +5 -3
  120. package/dist/location.js +4 -2
  121. package/dist/middleware/authorization.d.ts +1 -1
  122. package/dist/middleware/authorization.js +2 -2
  123. package/dist/middleware/form-location.d.ts +2 -2
  124. package/dist/middleware/form-location.js +3 -3
  125. package/dist/middleware/schema-error.js +1 -1
  126. package/dist/middleware/session-location.d.ts +1 -1
  127. package/dist/middleware/session-location.js +3 -3
  128. package/dist/pairing.js +5 -5
  129. package/dist/process.d.ts +5 -4
  130. package/dist/process.js +52 -52
  131. package/dist/pty-environment.js +5 -5
  132. package/dist/request-tracing.js +1 -1
  133. package/dist/routes.d.ts +3 -3
  134. package/dist/routes.js +46 -46
  135. package/dist/server-info.js +5 -5
  136. package/dist/service-status.js +3 -3
  137. package/dist/workerd.js +50 -50
  138. package/package.json +14 -12
  139. package/dist/chunks/location-hezj1jdf.js +0 -7
  140. package/dist/chunks/location-vb9atgxj.js +0 -15
  141. /package/dist/chunks/{location-9rqn6x4v.js → pty-environment-9rqn6x4v.js} +0 -0
  142. /package/dist/chunks/{location-q4bn6dy8.js → pty-environment-q4bn6dy8.js} +0 -0
  143. /package/dist/chunks/{location-smaf4a18.js → pty-environment-smaf4a18.js} +0 -0
  144. /package/dist/chunks/{location-yc7nft6q.js → pty-environment-yc7nft6q.js} +0 -0
package/dist/api.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { LocationMiddleware } from "./location";
2
2
  import { FormLocationMiddleware } from "./middleware/form-location";
3
3
  import { SessionLocationMiddleware } from "./middleware/session-location";
4
- export declare const Api: import("@opencode/protocol/api").Api<LocationMiddleware, import("effect/unstable/httpapi/HttpApiMiddleware").HttpApiMiddleware<import("@opencode/core/instance").Services, readonly [typeof import("@opencode/protocol/errors").LocationNotFoundError], never>, FormLocationMiddleware, import("effect/unstable/httpapi/HttpApiMiddleware").HttpApiMiddleware<import("@opencode/core/instance").Services, readonly [typeof import("@opencode/protocol/errors").InvalidRequestError, typeof import("@opencode/protocol/errors").SessionNotFoundError, typeof import("@opencode/protocol/errors").LocationNotFoundError], never>, SessionLocationMiddleware, import("effect/unstable/httpapi/HttpApiMiddleware").HttpApiMiddleware<import("@opencode/core/instance").Services, readonly [typeof import("@opencode/protocol/errors").InvalidRequestError, typeof import("@opencode/protocol/errors").SessionNotFoundError, typeof import("@opencode/protocol/errors").LocationNotFoundError], never>, import("effect/unstable/httpapi/HttpApiGroup").HttpApiGroup<"server.event", import("effect/unstable/httpapi/HttpApiEndpoint").HttpApiEndpoint<"event.subscribe", "GET", "/api/event", never, never, never, never, import("effect/unstable/httpapi/HttpApiSchema").StreamSse<import("effect/unstable/httpapi/HttpApiSchema").SseEventFromData<import("effect/Schema").Union<readonly [import("effect/Schema").Struct<{
4
+ export declare const Api: import("@opencode/protocol/api").Api<LocationMiddleware, import("effect/http-api/HttpApiMiddleware").HttpApiMiddleware<import("@opencode/core/instance").Services, readonly [typeof import("@opencode/protocol/errors").LocationNotFoundError], never>, FormLocationMiddleware, import("effect/http-api/HttpApiMiddleware").HttpApiMiddleware<import("@opencode/core/instance").Services, readonly [typeof import("@opencode/protocol/errors").InvalidRequestError, typeof import("@opencode/protocol/errors").SessionNotFoundError, typeof import("@opencode/protocol/errors").LocationNotFoundError], never>, SessionLocationMiddleware, import("effect/http-api/HttpApiMiddleware").HttpApiMiddleware<import("@opencode/core/instance").Services, readonly [typeof import("@opencode/protocol/errors").InvalidRequestError, typeof import("@opencode/protocol/errors").SessionNotFoundError, typeof import("@opencode/protocol/errors").LocationNotFoundError], never>, import("effect/http-api/HttpApiGroup").HttpApiGroup<"server.event", import("effect/http-api/HttpApiEndpoint").HttpApiEndpoint<"event.subscribe", "GET", "/api/event", never, never, never, never, import("effect/http-api/HttpApiSchema").StreamSse<import("effect/http-api/HttpApiSchema").SseEventFromData<import("effect/Schema").Union<readonly [import("effect/Schema").Struct<{
5
5
  readonly id: import("effect/Schema").brand<import("effect/Schema").String, "Event.ID"> & {
6
6
  create: () => string & import("effect/Brand").Brand<"Event.ID">;
7
7
  };
@@ -4714,6 +4714,7 @@ export declare const Api: import("@opencode/protocol/api").Api<LocationMiddlewar
4714
4714
  readonly created: import("effect/Schema").Int;
4715
4715
  readonly updated: import("effect/Schema").Int;
4716
4716
  readonly active: import("effect/Schema").Int;
4717
+ readonly archived: import("effect/Schema").decodeTo<import("effect/Schema").optional<import("effect/Schema").toType<import("effect/Schema").Int>>, import("effect/Schema").optionalKey<import("effect/Schema").Int>, never, never>;
4717
4718
  }>;
4718
4719
  readonly sandboxes: import("effect/Schema").$Array<import("effect/Schema").String>;
4719
4720
  }>;
@@ -4746,6 +4747,7 @@ export declare const Api: import("@opencode/protocol/api").Api<LocationMiddlewar
4746
4747
  readonly created: import("effect/Schema").Int;
4747
4748
  readonly updated: import("effect/Schema").Int;
4748
4749
  readonly active: import("effect/Schema").Int;
4750
+ readonly archived: import("effect/Schema").decodeTo<import("effect/Schema").optional<import("effect/Schema").toType<import("effect/Schema").Int>>, import("effect/Schema").optionalKey<import("effect/Schema").Int>, never, never>;
4749
4751
  }>;
4750
4752
  readonly sandboxes: import("effect/Schema").$Array<import("effect/Schema").String>;
4751
4753
  }>;
@@ -6373,6 +6375,11 @@ export declare const Api: import("@opencode/protocol/api").Api<LocationMiddlewar
6373
6375
  readonly type: "string";
6374
6376
  readonly key: string;
6375
6377
  readonly required?: boolean | undefined;
6378
+ readonly options?: readonly {
6379
+ readonly value: string;
6380
+ readonly label: string;
6381
+ readonly description?: string | undefined;
6382
+ }[] | undefined;
6376
6383
  readonly description?: string | undefined;
6377
6384
  readonly format?: "email" | "uri" | "date" | "date-time" | undefined;
6378
6385
  readonly minLength?: number | undefined;
@@ -6380,11 +6387,6 @@ export declare const Api: import("@opencode/protocol/api").Api<LocationMiddlewar
6380
6387
  readonly pattern?: string | undefined;
6381
6388
  readonly placeholder?: string | undefined;
6382
6389
  readonly default?: string | undefined;
6383
- readonly options?: readonly {
6384
- readonly value: string;
6385
- readonly label: string;
6386
- readonly description?: string | undefined;
6387
- }[] | undefined;
6388
6390
  readonly custom?: boolean | undefined;
6389
6391
  readonly title?: string | undefined;
6390
6392
  readonly hidden?: boolean | undefined;
@@ -6438,12 +6440,12 @@ export declare const Api: import("@opencode/protocol/api").Api<LocationMiddlewar
6438
6440
  }[] | undefined;
6439
6441
  } | {
6440
6442
  readonly type: "multiselect";
6441
- readonly key: string;
6442
6443
  readonly options: readonly {
6443
6444
  readonly value: string;
6444
6445
  readonly label: string;
6445
6446
  readonly description?: string | undefined;
6446
6447
  }[];
6448
+ readonly key: string;
6447
6449
  readonly required?: boolean | undefined;
6448
6450
  readonly description?: string | undefined;
6449
6451
  readonly default?: readonly string[] | undefined;
@@ -6467,6 +6469,11 @@ export declare const Api: import("@opencode/protocol/api").Api<LocationMiddlewar
6467
6469
  readonly type: "string";
6468
6470
  readonly key: string;
6469
6471
  readonly required?: boolean | undefined;
6472
+ readonly options?: readonly {
6473
+ readonly value: string;
6474
+ readonly label: string;
6475
+ readonly description?: string | undefined;
6476
+ }[] | undefined;
6470
6477
  readonly description?: string | undefined;
6471
6478
  readonly format?: "email" | "uri" | "date" | "date-time" | undefined;
6472
6479
  readonly minLength?: number | undefined;
@@ -6474,11 +6481,6 @@ export declare const Api: import("@opencode/protocol/api").Api<LocationMiddlewar
6474
6481
  readonly pattern?: string | undefined;
6475
6482
  readonly placeholder?: string | undefined;
6476
6483
  readonly default?: string | undefined;
6477
- readonly options?: readonly {
6478
- readonly value: string;
6479
- readonly label: string;
6480
- readonly description?: string | undefined;
6481
- }[] | undefined;
6482
6484
  readonly custom?: boolean | undefined;
6483
6485
  readonly title?: string | undefined;
6484
6486
  readonly hidden?: boolean | undefined;
@@ -6532,12 +6534,12 @@ export declare const Api: import("@opencode/protocol/api").Api<LocationMiddlewar
6532
6534
  }[] | undefined;
6533
6535
  } | {
6534
6536
  readonly type: "multiselect";
6535
- readonly key: string;
6536
6537
  readonly options: readonly {
6537
6538
  readonly value: string;
6538
6539
  readonly label: string;
6539
6540
  readonly description?: string | undefined;
6540
6541
  }[];
6542
+ readonly key: string;
6541
6543
  readonly required?: boolean | undefined;
6542
6544
  readonly description?: string | undefined;
6543
6545
  readonly default?: readonly string[] | undefined;
@@ -6732,8 +6734,9 @@ export declare const Api: import("@opencode/protocol/api").Api<LocationMiddlewar
6732
6734
  readonly canonical: string & import("effect/Brand").Brand<"AbsolutePath">;
6733
6735
  readonly time: {
6734
6736
  readonly created: number;
6735
- readonly updated: number;
6736
6737
  readonly active: number;
6738
+ readonly updated: number;
6739
+ readonly archived?: number | undefined;
6737
6740
  };
6738
6741
  readonly sandboxes: readonly string[];
6739
6742
  readonly name?: string | undefined;
package/dist/api.js CHANGED
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  Api2
3
- } from "./chunks/location-9cw9axw5.js";
4
- import"./chunks/location-w070c2h2.js";
5
- import"./chunks/location-796j10e5.js";
6
- import"./chunks/location-f2c3fmpg.js";
7
- import"./chunks/location-smaf4a18.js";
3
+ } from "./chunks/pty-environment-9snwnvf8.js";
4
+ import"./chunks/pty-environment-j4zqsxgy.js";
5
+ import"./chunks/pty-environment-4hhhes7w.js";
6
+ import"./chunks/pty-environment-b56hqv74.js";
7
+ import"./chunks/pty-environment-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-anm12x33.js";
10
+ } from "./chunks/pty-environment-anm12x33.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
  Api2
3
- } from "./location-9cw9axw5.js";
3
+ } from "./pty-environment-9snwnvf8.js";
4
4
 
5
5
  // src/handlers/credential.ts
6
6
  import { Credential } from "@opencode/core/credential";
7
7
  import { ConflictError } from "@opencode/protocol/errors";
8
8
  import { Effect } from "effect";
9
- import { HttpApiBuilder, HttpApiSchema } from "effect/unstable/httpapi";
9
+ import { HttpApiBuilder, HttpApiSchema } from "effect/http-api";
10
10
  var CredentialHandler2 = HttpApiBuilder.group(Api2, "server.credential", (handlers) => handlers.handle("credential.list", Effect.fn(function* () {
11
11
  const credential = yield* Credential.Service;
12
12
  return { data: entries(yield* credential.all()) };
@@ -1,25 +1,25 @@
1
1
  import {
2
2
  __export
3
- } from "./location-9rqn6x4v.js";
3
+ } from "./pty-environment-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: () => Service5,
10
- node: () => node3
9
+ Service: () => Service3,
10
+ node: () => node2
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 Service5 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(Service5, 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 Service5.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(Service5, Effect.gen(function* () {
30
30
  })
31
31
  });
32
32
  }));
33
- var node3 = makeGlobalNode({ service: Service5, layer, deps: [] });
33
+ var node2 = makeGlobalNode({ service: Service3, layer, deps: [] });
34
34
 
35
- export { Service5, node3, exports_pairing };
35
+ export { Service3, node2, exports_pairing };
@@ -0,0 +1,15 @@
1
+ import {
2
+ Api2
3
+ } from "./pty-environment-9snwnvf8.js";
4
+
5
+ // src/handlers/project.ts
6
+ import { Project } from "@opencode/core/project";
7
+ import { Effect } from "effect";
8
+ import { HttpApiBuilder } from "effect/http-api";
9
+ import { ProjectNotFoundError } from "@opencode/protocol/errors";
10
+ var ProjectHandler2 = HttpApiBuilder.group(Api2, "server.project", (handlers) => handlers.handle("project.list", (ctx) => Project.Service.use((project) => project.list(ctx.query))).handle("project.update", (ctx) => Project.Service.use((project) => project.update({ ...ctx.payload, projectID: ctx.params.projectID }).pipe(Effect.mapError(() => new ProjectNotFoundError({
11
+ projectID: ctx.params.projectID,
12
+ message: `Project not found: ${ctx.params.projectID}`
13
+ }))))));
14
+
15
+ export { ProjectHandler2 };
@@ -1,18 +1,18 @@
1
1
  import {
2
2
  Api2
3
- } from "./location-9cw9axw5.js";
3
+ } from "./pty-environment-9snwnvf8.js";
4
4
  import {
5
- Service2,
5
+ Service5,
6
6
  frame2
7
- } from "./location-2sy3c7de.js";
7
+ } from "./pty-environment-vghchchj.js";
8
8
 
9
9
  // src/handlers/event.ts
10
10
  import { Event } from "@opencode/schema/event";
11
11
  import { Effect, Stream } from "effect";
12
- import { HttpServerResponse } from "effect/unstable/http";
13
- import { HttpApiBuilder } from "effect/unstable/httpapi";
12
+ import { HttpServerResponse } from "effect/http";
13
+ import { HttpApiBuilder } from "effect/http-api";
14
14
  var EventHandler2 = HttpApiBuilder.group(Api2, "server.event", (handlers) => Effect.gen(function* () {
15
- const feed = yield* Service2;
15
+ const feed = yield* Service5;
16
16
  return handlers.handleRaw("event.subscribe", () => Effect.gen(function* () {
17
17
  const connected = {
18
18
  id: Event.ID.create(),
@@ -1,23 +1,23 @@
1
1
  import {
2
2
  __export
3
- } from "./location-9rqn6x4v.js";
3
+ } from "./pty-environment-9rqn6x4v.js";
4
4
 
5
5
  // src/pty-environment.ts
6
6
  var exports_pty_environment = {};
7
7
  __export(exports_pty_environment, {
8
8
  PtyEnvironment: () => exports_pty_environment,
9
- Service: () => Service3,
9
+ Service: () => Service4,
10
10
  layer: () => layer3,
11
- node: () => node2
11
+ node: () => node3
12
12
  });
13
13
  import { Context, Effect, Layer } from "effect";
14
14
  import { makeGlobalNode } from "@opencode/util/effect/app-node";
15
15
 
16
- class Service3 extends Context.Service()("@opencode/ServerPtyEnvironment") {
16
+ class Service4 extends Context.Service()("@opencode/ServerPtyEnvironment") {
17
17
  }
18
- var layer3 = Layer.succeed(Service3, Service3.of({
18
+ var layer3 = Layer.succeed(Service4, Service4.of({
19
19
  get: () => Effect.succeed({})
20
20
  }));
21
- var node2 = makeGlobalNode({ service: Service3, layer: layer3, deps: [] });
21
+ var node3 = makeGlobalNode({ service: Service4, layer: layer3, deps: [] });
22
22
 
23
- export { Service3, layer3, node2, exports_pty_environment };
23
+ export { Service4, layer3, node3, exports_pty_environment };
@@ -1,14 +1,14 @@
1
1
  import {
2
2
  response2
3
- } from "./location-f2c3fmpg.js";
3
+ } from "./pty-environment-b56hqv74.js";
4
4
  import {
5
5
  Api2
6
- } from "./location-9cw9axw5.js";
6
+ } from "./pty-environment-9snwnvf8.js";
7
7
 
8
8
  // src/handlers/form.ts
9
9
  import { Form } from "@opencode/core/form";
10
10
  import { Effect } from "effect";
11
- import { HttpApiBuilder } from "effect/unstable/httpapi";
11
+ import { HttpApiBuilder } from "effect/http-api";
12
12
  var FormHandler2 = HttpApiBuilder.group(Api2, "server.form", (handlers) => handlers.handle("form.list", Effect.fn(function* () {
13
13
  const form = yield* Form.Service;
14
14
  return yield* response2(form.list());
@@ -1,9 +1,10 @@
1
1
  import {
2
- locationErrors2
3
- } from "./location-f2c3fmpg.js";
2
+ locationErrors2,
3
+ awaitPlugins2
4
+ } from "./pty-environment-b56hqv74.js";
4
5
  import {
5
6
  Api2
6
- } from "./location-9cw9axw5.js";
7
+ } from "./pty-environment-9snwnvf8.js";
7
8
 
8
9
  // src/handlers/generate.ts
9
10
  import { Generate } from "@opencode/core/generate";
@@ -13,12 +14,13 @@ import { AbsolutePath } from "@opencode/core/schema";
13
14
  import { InvalidRequestError, ServiceUnavailableError } from "@opencode/protocol/errors";
14
15
  import { Global } from "@opencode/util/global";
15
16
  import { Effect } from "effect";
16
- import { HttpApiBuilder } from "effect/unstable/httpapi";
17
+ import { HttpApiBuilder } from "effect/http-api";
17
18
  var GenerateHandler2 = HttpApiBuilder.group(Api2, "server.generate", (handlers) => Effect.gen(function* () {
18
19
  const global = yield* Global.Service;
19
20
  const locations = yield* LocationServiceMap.Service;
20
21
  const services = locations.get(Location.Ref.make({ directory: AbsolutePath.make(global.config) }));
21
22
  return handlers.handle("generate.text", Effect.fn("server.generate.text")(function* (request) {
23
+ yield* awaitPlugins2;
22
24
  const generate = yield* Generate.Service;
23
25
  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 })));
24
26
  return { data: { text } };
@@ -1,15 +1,15 @@
1
1
  import {
2
2
  response2
3
- } from "./location-f2c3fmpg.js";
3
+ } from "./pty-environment-b56hqv74.js";
4
4
  import {
5
5
  Api2
6
- } from "./location-9cw9axw5.js";
6
+ } from "./pty-environment-9snwnvf8.js";
7
7
 
8
8
  // src/handlers/shell.ts
9
9
  import { Shell } from "@opencode/core/shell";
10
10
  import { Location } from "@opencode/core/location";
11
11
  import { Effect } from "effect";
12
- import { HttpApiBuilder, HttpApiSchema } from "effect/unstable/httpapi";
12
+ import { HttpApiBuilder, HttpApiSchema } from "effect/http-api";
13
13
  import { ShellNotFoundError } from "@opencode/protocol/errors";
14
14
  var ShellHandler2 = HttpApiBuilder.group(Api2, "server.shell", (handlers) => Effect.gen(function* () {
15
15
  return handlers.handle("shell.list", Effect.fn(function* () {
@@ -2,7 +2,7 @@ import {
2
2
  locationErrors2,
3
3
  sessionInfo2,
4
4
  requestRef2
5
- } from "./location-f2c3fmpg.js";
5
+ } from "./pty-environment-b56hqv74.js";
6
6
 
7
7
  // src/middleware/form-location.ts
8
8
  import { Instance } from "@opencode/core/instance/service";
@@ -10,8 +10,8 @@ import { LocationServiceMap } from "@opencode/core/location-services";
10
10
  import { Session } from "@opencode/core/session";
11
11
  import { LocationNotFoundError, InvalidRequestError, SessionNotFoundError } from "@opencode/protocol/errors";
12
12
  import { Effect, Layer } from "effect";
13
- import { HttpRouter, HttpServerRequest } from "effect/unstable/http";
14
- import { HttpApiMiddleware } from "effect/unstable/httpapi";
13
+ import { HttpRouter, HttpServerRequest } from "effect/http";
14
+ import { HttpApiMiddleware } from "effect/http-api";
15
15
  class FormLocationMiddleware2 extends HttpApiMiddleware.Service()("@opencode/HttpApiFormLocation", {
16
16
  error: [InvalidRequestError, SessionNotFoundError, LocationNotFoundError]
17
17
  }) {
@@ -2,20 +2,20 @@ import {
2
2
  locationErrors2,
3
3
  response2,
4
4
  requestRef2
5
- } from "./location-f2c3fmpg.js";
5
+ } from "./pty-environment-b56hqv74.js";
6
6
  import {
7
7
  Api2
8
- } from "./location-9cw9axw5.js";
8
+ } from "./pty-environment-9snwnvf8.js";
9
9
  import {
10
10
  CorsConfig2,
11
11
  isAllowedRequestOrigin2
12
- } from "./location-q4bn6dy8.js";
12
+ } from "./pty-environment-q4bn6dy8.js";
13
13
  import {
14
- Service3
15
- } from "./location-0d9kah4z.js";
14
+ Service4
15
+ } from "./pty-environment-383t61pr.js";
16
16
  import {
17
17
  runPtySocket2
18
- } from "./location-hezj1jdf.js";
18
+ } from "./pty-environment-h6rt5k9s.js";
19
19
 
20
20
  // src/handlers/pty.ts
21
21
  import { Pty } from "@opencode/core/pty";
@@ -24,9 +24,9 @@ import { PtyTicket } from "@opencode/core/pty/ticket";
24
24
  import { Location } from "@opencode/core/location";
25
25
  import { LocationServiceMap } from "@opencode/core/location-service-map";
26
26
  import { Effect, Queue } from "effect";
27
- import { HttpServerRequest, HttpServerResponse } from "effect/unstable/http";
28
- import { HttpApiBuilder, HttpApiSchema } from "effect/unstable/httpapi";
29
- import { Socket } from "effect/unstable/socket";
27
+ import { HttpServerRequest, HttpServerResponse } from "effect/http";
28
+ import { HttpApiBuilder, HttpApiSchema } from "effect/http-api";
29
+ import { Socket } from "effect/socket";
30
30
  import { ForbiddenError, PtyNotFoundError } from "@opencode/protocol/errors";
31
31
  import {
32
32
  PTY_CONNECT_TICKET_QUERY,
@@ -41,7 +41,7 @@ var PtyHandler2 = HttpApiBuilder.group(Api2, "server.pty", (handlers) => Effect.
41
41
  const locations = yield* LocationServiceMap.Service;
42
42
  const tickets = yield* PtyTicket.Service;
43
43
  const cors = yield* CorsConfig2;
44
- const environment = yield* Service3;
44
+ const environment = yield* Service4;
45
45
  return handlers.handle("pty.list", Effect.fn(function* () {
46
46
  const pty = yield* Pty.Service;
47
47
  return yield* response2(pty.list());
@@ -112,36 +112,37 @@ var PtyHandler2 = HttpApiBuilder.group(Api2, "server.pty", (handlers) => Effect.
112
112
  const cursorNumber = parsedCursor === null ? undefined : Number(parsedCursor);
113
113
  const cursor = cursorNumber !== undefined && Number.isSafeInteger(cursorNumber) && cursorNumber >= -1 ? cursorNumber : undefined;
114
114
  const socket = yield* Effect.orDie(ctx.request.upgrade);
115
- const write = yield* socket.writer;
116
- const closeAccepted = (event) => socket.runRaw(() => Effect.void, { onOpen: write(event).pipe(Effect.catch(() => Effect.void)) }).pipe(Effect.timeout("1 second"), Effect.catchReason("SocketError", "SocketCloseError", () => Effect.void), Effect.catch(() => Effect.void));
117
115
  const outbox = yield* Queue.unbounded();
118
116
  const attachment = yield* pty.attach(ctx.params.ptyID, {
119
117
  cursor,
120
118
  onData: (chunk) => Queue.offerUnsafe(outbox, chunk),
121
119
  onEnd: () => Queue.offerUnsafe(outbox, new Socket.CloseEvent(1000))
122
120
  }).pipe(Effect.catchTags({
123
- "Pty.NotFoundError": () => closeAccepted(new Socket.CloseEvent(4404, "session not found")).pipe(Effect.as(undefined)),
124
- "Pty.ExitedError": () => closeAccepted(new Socket.CloseEvent(4404, "session exited")).pipe(Effect.as(undefined))
121
+ "Pty.NotFoundError": () => Effect.sync(() => {
122
+ Queue.offerUnsafe(outbox, new Socket.CloseEvent(4404, "session not found"));
123
+ }),
124
+ "Pty.ExitedError": () => Effect.sync(() => {
125
+ Queue.offerUnsafe(outbox, new Socket.CloseEvent(4404, "session exited"));
126
+ })
125
127
  }));
126
- if (!attachment)
127
- return HttpServerResponse.empty();
128
- for (const chunk of PtyProtocol.chunks(attachment.replay))
129
- Queue.offerUnsafe(outbox, chunk);
130
- Queue.offerUnsafe(outbox, PtyProtocol.metaFrame(attachment.cursor));
131
- attachment.activate();
132
- const drain = Effect.gen(function* () {
133
- while (true) {
134
- const item = yield* Queue.take(outbox);
135
- yield* write(item);
136
- if (item instanceof Socket.CloseEvent)
128
+ if (attachment) {
129
+ for (const chunk of PtyProtocol.chunks(attachment.replay))
130
+ Queue.offerUnsafe(outbox, chunk);
131
+ Queue.offerUnsafe(outbox, PtyProtocol.metaFrame(attachment.cursor));
132
+ attachment.activate();
133
+ }
134
+ yield* runPtySocket2({
135
+ socket,
136
+ outbox,
137
+ onMessage: (message) => Effect.sync(() => {
138
+ if (!attachment)
137
139
  return;
138
- }
140
+ const decoded = PtyProtocol.decodeInput(message);
141
+ if (decoded !== undefined)
142
+ attachment.write(decoded);
143
+ }),
144
+ detach: () => attachment?.detach()
139
145
  });
140
- yield* runPtySocket2(drain, socket.runRaw((message) => {
141
- const decoded = PtyProtocol.decodeInput(message);
142
- if (decoded !== undefined)
143
- attachment.write(decoded);
144
- }), attachment.detach).pipe(Effect.catchReason("SocketError", "SocketCloseError", () => Effect.void), Effect.orDie);
145
146
  return HttpServerResponse.empty();
146
147
  }).pipe(Effect.provide(locations.get(ref)), locationErrors2);
147
148
  }));
@@ -4,7 +4,7 @@ import {
4
4
  authorized2,
5
5
  verifySession2,
6
6
  sessionCookieName2
7
- } from "./location-anm12x33.js";
7
+ } from "./pty-environment-anm12x33.js";
8
8
 
9
9
  // src/middleware/authorization.ts
10
10
  import { UnauthorizedError } from "@opencode/protocol/errors";
@@ -13,15 +13,16 @@ import { Authorization as Authorization2 } from "@opencode/protocol/middleware/a
13
13
  import { hasPtyConnectTicketURL } from "@opencode/protocol/groups/pty";
14
14
  import { hasPersistentPtyConnectTicketURL } from "@opencode/protocol/groups/persistent-pty";
15
15
  import { isPairingConnectURL } from "@opencode/protocol/groups/server";
16
- import { Effect, Encoding, Layer, Redacted } from "effect";
17
- import { HttpEffect, HttpServerRequest, HttpServerResponse } from "effect/unstable/http";
16
+ import { Effect, Layer, Redacted } from "effect";
17
+ import { Base64 } from "effect/encoding";
18
+ import { HttpEffect, HttpServerRequest, HttpServerResponse } from "effect/http";
18
19
  var AUTH_TOKEN_QUERY = "auth_token";
19
20
  var WWW_AUTHENTICATE = 'Basic realm="Secure Area"';
20
21
  function emptyCredential() {
21
22
  return { username: "", password: Redacted.make("") };
22
23
  }
23
24
  function decodeCredential(input) {
24
- return Effect.fromResult(Encoding.decodeBase64String(input)).pipe(Effect.match({
25
+ return Effect.fromResult(Base64.decodeString(input)).pipe(Effect.match({
25
26
  onFailure: emptyCredential,
26
27
  onSuccess: (header) => {
27
28
  const separator = header.indexOf(":");
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  Api2
3
- } from "./location-9cw9axw5.js";
3
+ } from "./pty-environment-9snwnvf8.js";
4
4
 
5
5
  // src/handlers/config.ts
6
6
  import { Config } from "@opencode/core/config";
7
7
  import { ShellSelect } from "@opencode/core/shell/select";
8
8
  import { Effect } from "effect";
9
- import { HttpApiBuilder } from "effect/unstable/httpapi";
9
+ import { HttpApiBuilder } from "effect/http-api";
10
10
  var ConfigHandler2 = HttpApiBuilder.group(Api2, "server.config", (handlers) => handlers.handle("config.get", () => Config.Service.use((config) => config.entries())).handle("config.update", Effect.fn(function* (ctx) {
11
11
  const config = yield* Config.Service;
12
12
  if (!config.update)
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  Api2
3
- } from "./location-9cw9axw5.js";
3
+ } from "./pty-environment-9snwnvf8.js";
4
4
 
5
5
  // src/handlers/worktree.ts
6
6
  import { Git } from "@opencode/core/git";
@@ -8,7 +8,7 @@ import { Worktree } from "@opencode/core/worktree";
8
8
  import { ProjectNotFoundError } from "@opencode/protocol/errors";
9
9
  import { WorktreeError } from "@opencode/protocol/groups/worktree";
10
10
  import { Effect } from "effect";
11
- import { HttpApiBuilder, HttpApiSchema } from "effect/unstable/httpapi";
11
+ import { HttpApiBuilder, HttpApiSchema } from "effect/http-api";
12
12
  var WorktreeHandler2 = HttpApiBuilder.group(Api2, "server.worktree", (handlers) => Effect.gen(function* () {
13
13
  const worktrees = yield* Worktree.Service;
14
14
  return handlers.handle("worktree.list", (ctx) => worktrees.list(ctx.query).pipe(Effect.catchTag("Project.NotFoundError", missingProject))).handle("worktree.create", (ctx) => worktrees.create(ctx.payload).pipe(badRequest)).handle("worktree.remove", (ctx) => worktrees.remove(ctx.payload).pipe(badRequest, Effect.as(HttpApiSchema.NoContent.make()))).handle("worktree.refresh", (ctx) => worktrees.refresh(ctx.payload).pipe(badRequest, Effect.as(HttpApiSchema.NoContent.make())));
@@ -1,16 +1,16 @@
1
1
  import {
2
2
  response2
3
- } from "./location-f2c3fmpg.js";
3
+ } from "./pty-environment-b56hqv74.js";
4
4
  import {
5
5
  Api2
6
- } from "./location-9cw9axw5.js";
6
+ } from "./pty-environment-9snwnvf8.js";
7
7
 
8
8
  // src/handlers/plugin.ts
9
9
  import { Plugin } from "@opencode/core/plugin";
10
10
  import { PluginUpdate } from "@opencode/core/plugin/update";
11
11
  import { InvalidRequestError, ServiceUnavailableError } from "@opencode/protocol/errors";
12
12
  import { Cause, Effect, Exit } from "effect";
13
- import { HttpApiBuilder } from "effect/unstable/httpapi";
13
+ import { HttpApiBuilder } from "effect/http-api";
14
14
  var PluginHandler2 = HttpApiBuilder.group(Api2, "server.plugin", (handlers) => handlers.handle("plugin.list", () => Effect.gen(function* () {
15
15
  return yield* response2(Plugin.Service.use((plugin) => plugin.list()));
16
16
  })).handle("plugin.check", (ctx) => Effect.gen(function* () {
@@ -1,26 +1,26 @@
1
1
  import {
2
2
  isAllowedCorsOrigin2
3
- } from "./location-q4bn6dy8.js";
3
+ } from "./pty-environment-q4bn6dy8.js";
4
4
  import {
5
5
  createRoutes2
6
- } from "./location-ceje7ncg.js";
6
+ } from "./pty-environment-pfs7tp5t.js";
7
7
  import {
8
8
  __export
9
- } from "./location-9rqn6x4v.js";
9
+ } from "./pty-environment-9rqn6x4v.js";
10
10
 
11
11
  // src/fetch.ts
12
12
  var exports_fetch = {};
13
13
  __export(exports_fetch, {
14
14
  ServerFetch: () => exports_fetch,
15
- make: () => make3
15
+ make: () => make2
16
16
  });
17
17
  import { Context, Effect, Layer } from "effect";
18
- import { HttpEffect, HttpMiddleware, HttpRouter, HttpServer } from "effect/unstable/http";
18
+ import { HttpEffect, HttpMiddleware, HttpRouter, HttpServer } from "effect/http";
19
19
  import { SessionRestart } from "@opencode/core/session/execution/restart";
20
- var make3 = Effect.fn("ServerFetch.make")(function* (options = {}, boot = {}) {
20
+ var make2 = Effect.fn("ServerFetch.make")(function* (options = {}, boot = {}) {
21
21
  const context = yield* Layer.build(createRoutes2(options, () => [], boot.overrides ?? []).pipe(Layer.provide(HttpServer.layerServices)));
22
22
  yield* Effect.forkDetach(Context.get(context, SessionRestart.Service).resumeSuspendedSessions);
23
23
  return Context.get(context, HttpRouter.HttpRouter).asHttpEffect().pipe(HttpMiddleware.cors({ allowedOrigins: (origin) => isAllowedCorsOrigin2(origin, options), maxAge: 86400 }), HttpEffect.toWebHandlerWith(context));
24
24
  });
25
25
 
26
- export { make3, exports_fetch };
26
+ export { make2, exports_fetch };
@@ -1,15 +1,15 @@
1
1
  import {
2
2
  response2
3
- } from "./location-f2c3fmpg.js";
3
+ } from "./pty-environment-b56hqv74.js";
4
4
  import {
5
5
  Api2
6
- } from "./location-9cw9axw5.js";
6
+ } from "./pty-environment-9snwnvf8.js";
7
7
 
8
8
  // src/handlers/provider.ts
9
9
  import { Provider } from "@opencode/core/provider";
10
10
  import { ProviderNotFoundError } from "@opencode/protocol/errors";
11
11
  import { Effect } from "effect";
12
- import { HttpApiBuilder } from "effect/unstable/httpapi";
12
+ import { HttpApiBuilder } from "effect/http-api";
13
13
  var ProviderHandler2 = HttpApiBuilder.group(Api2, "server.provider", (handlers) => Effect.gen(function* () {
14
14
  return handlers.handle("provider.list", Effect.fn(function* () {
15
15
  const providers = yield* Provider.Service;
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  LocationMiddleware2
3
- } from "./location-f2c3fmpg.js";
3
+ } from "./pty-environment-b56hqv74.js";
4
4
  import {
5
5
  FormLocationMiddleware2
6
- } from "./location-w070c2h2.js";
6
+ } from "./pty-environment-4hhhes7w.js";
7
7
  import {
8
8
  SessionLocationMiddleware2
9
- } from "./location-796j10e5.js";
9
+ } from "./pty-environment-j4zqsxgy.js";
10
10
 
11
11
  // src/api.ts
12
12
  import { makeDefaultApi } from "@opencode/protocol/api";