@opencode/server 0.0.0-dev-1338 → 0.0.0-dev-1343

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 (131) hide show
  1. package/dist/api.js +5 -5
  2. package/dist/auth.js +1 -1
  3. package/dist/chunks/{request-site-4apj6a8e.js → request-tracing-12zwgdzg.js} +2 -2
  4. package/dist/chunks/{request-site-p8bw27eh.js → request-tracing-1xf02gcb.js} +38 -17
  5. package/dist/chunks/{request-site-1bx0qbf8.js → request-tracing-2qpg9hy1.js} +4 -4
  6. package/dist/chunks/{request-site-p0dbcmm0.js → request-tracing-42gz2497.js} +8 -8
  7. package/dist/chunks/{request-site-pv4dnzzq.js → request-tracing-42tqx64k.js} +1 -1
  8. package/dist/chunks/{request-site-b87bs0cf.js → request-tracing-4zne1sdj.js} +2 -2
  9. package/dist/chunks/{request-site-8mfdzabk.js → request-tracing-52x44xqp.js} +2 -2
  10. package/dist/chunks/{request-site-7x6cg3xs.js → request-tracing-6kxghskv.js} +2 -2
  11. package/dist/chunks/{request-site-g80pvn6e.js → request-tracing-7nstrb2v.js} +2 -2
  12. package/dist/chunks/{request-site-edwk6ehd.js → request-tracing-7p3x2xdt.js} +1 -1
  13. package/dist/chunks/{request-site-k26h7zjg.js → request-tracing-7w7s37ab.js} +2 -2
  14. package/dist/chunks/{request-site-7ydfwv45.js → request-tracing-7ydfwv45.js} +1 -1
  15. package/dist/chunks/{request-site-20wvj9q6.js → request-tracing-8g1x5cgg.js} +2 -2
  16. package/dist/chunks/{request-site-8sb6qqpn.js → request-tracing-8sb6qqpn.js} +1 -1
  17. package/dist/chunks/{request-site-wh07bcjv.js → request-tracing-8yrm3yp0.js} +1 -1
  18. package/dist/chunks/{request-site-b1x3j2e8.js → request-tracing-9qbtnftt.js} +2 -2
  19. package/dist/chunks/{request-site-zrptb2x8.js → request-tracing-b315n07t.js} +2 -2
  20. package/dist/chunks/{request-site-q8jgva1w.js → request-tracing-b6cxph1w.js} +4 -4
  21. package/dist/chunks/{request-site-djr0jy89.js → request-tracing-djr0jy89.js} +1 -1
  22. package/dist/chunks/{request-site-39nnfjx1.js → request-tracing-e6e4kz0w.js} +4 -4
  23. package/dist/chunks/{request-site-amzpv526.js → request-tracing-fqfqd37z.js} +9 -9
  24. package/dist/chunks/{request-site-g23ffrnz.js → request-tracing-g23ffrnz.js} +2 -2
  25. package/dist/chunks/{request-site-p9wp66hf.js → request-tracing-h8savpc9.js} +1 -1
  26. package/dist/chunks/request-tracing-hgrkvk6s.js +48 -0
  27. package/dist/chunks/{request-site-myqk22k5.js → request-tracing-hmwn16zp.js} +2 -2
  28. package/dist/chunks/{request-site-p4zkxzv7.js → request-tracing-j2hee7a4.js} +1 -1
  29. package/dist/chunks/{request-site-j4at0y5c.js → request-tracing-j4at0y5c.js} +1 -1
  30. package/dist/chunks/{request-site-j80tzjj3.js → request-tracing-j80tzjj3.js} +1 -1
  31. package/dist/chunks/{request-site-v0z8pce5.js → request-tracing-jr0zs68z.js} +2 -2
  32. package/dist/chunks/{request-site-w9jcwh65.js → request-tracing-mzs0n5xz.js} +7 -7
  33. package/dist/chunks/{request-site-s8t5gq7c.js → request-tracing-n0a33cnc.js} +3 -3
  34. package/dist/chunks/{request-site-n6ypjnhz.js → request-tracing-n6ypjnhz.js} +1 -1
  35. package/dist/chunks/{request-site-b7yt2ykh.js → request-tracing-pcsx5fe9.js} +2 -2
  36. package/dist/chunks/{request-site-t8azv5ge.js → request-tracing-pmr95crm.js} +2 -2
  37. package/dist/chunks/{request-site-qahj7606.js → request-tracing-qahj7606.js} +1 -1
  38. package/dist/chunks/{request-site-wecgp61r.js → request-tracing-qd05162x.js} +6 -6
  39. package/dist/chunks/{request-site-4gbck4qg.js → request-tracing-qdrpva4m.js} +2 -2
  40. package/dist/chunks/{request-site-rktygpea.js → request-tracing-rktygpea.js} +1 -1
  41. package/dist/chunks/{request-site-86dz2n4m.js → request-tracing-s4qxpf1p.js} +2 -2
  42. package/dist/chunks/{request-site-t32e1bbt.js → request-tracing-t32e1bbt.js} +1 -1
  43. package/dist/chunks/{request-site-t62b1gmw.js → request-tracing-t62b1gmw.js} +2 -2
  44. package/dist/chunks/{request-site-7t0tq67e.js → request-tracing-ta6eh4bd.js} +3 -3
  45. package/dist/chunks/{request-site-ze9p165g.js → request-tracing-tybmb1m6.js} +33 -33
  46. package/dist/chunks/{request-site-4r2ye500.js → request-tracing-tze85g2y.js} +2 -2
  47. package/dist/chunks/{request-site-6t6fd9bq.js → request-tracing-v1nm30fe.js} +2 -2
  48. package/dist/chunks/{request-site-19kn6hvf.js → request-tracing-vq9qd4v4.js} +4 -4
  49. package/dist/chunks/{request-site-8n1ypg70.js → request-tracing-wnw6k7m6.js} +3 -3
  50. package/dist/chunks/{request-site-hvn8tnxr.js → request-tracing-xa0sy2cm.js} +4 -4
  51. package/dist/chunks/{request-site-tdx0cx27.js → request-tracing-xtk9sf9r.js} +6 -6
  52. package/dist/chunks/{request-site-d0advawr.js → request-tracing-xtx0rz3e.js} +2 -2
  53. package/dist/chunks/{request-site-6s1v5h8n.js → request-tracing-xzvqye02.js} +4 -4
  54. package/dist/chunks/{request-site-z3e7v67k.js → request-tracing-z3e7v67k.js} +1 -1
  55. package/dist/chunks/{request-site-g97h7k0s.js → request-tracing-z3gjns4k.js} +1 -1
  56. package/dist/content-headers.js +1 -1
  57. package/dist/cors.js +1 -1
  58. package/dist/event-feed.js +3 -3
  59. package/dist/fetch.js +62 -62
  60. package/dist/handlers/agent.js +6 -6
  61. package/dist/handlers/artifact.js +3 -3
  62. package/dist/handlers/automation.d.ts +1 -3
  63. package/dist/handlers/automation.js +2 -2
  64. package/dist/handlers/blob.js +3 -3
  65. package/dist/handlers/command.js +6 -6
  66. package/dist/handlers/config.js +6 -6
  67. package/dist/handlers/credential.js +7 -7
  68. package/dist/handlers/debug.js +6 -6
  69. package/dist/handlers/event.js +7 -7
  70. package/dist/handlers/form.js +6 -6
  71. package/dist/handlers/fs.js +8 -8
  72. package/dist/handlers/generate.js +6 -6
  73. package/dist/handlers/integration.js +6 -6
  74. package/dist/handlers/job.js +2 -2
  75. package/dist/handlers/location.js +6 -6
  76. package/dist/handlers/machine.js +1 -1
  77. package/dist/handlers/mcp.js +8 -8
  78. package/dist/handlers/media.js +2 -2
  79. package/dist/handlers/message.js +7 -7
  80. package/dist/handlers/migration.js +6 -6
  81. package/dist/handlers/model.js +6 -6
  82. package/dist/handlers/permission.js +6 -6
  83. package/dist/handlers/persistent-pty.d.ts +1 -1
  84. package/dist/handlers/persistent-pty.js +16 -16
  85. package/dist/handlers/plugin.js +6 -6
  86. package/dist/handlers/project.js +6 -6
  87. package/dist/handlers/provider.js +6 -6
  88. package/dist/handlers/pty-socket.js +1 -1
  89. package/dist/handlers/pty.js +8 -8
  90. package/dist/handlers/reference.js +6 -6
  91. package/dist/handlers/rpc.js +6 -6
  92. package/dist/handlers/server.js +9 -9
  93. package/dist/handlers/session-error.js +1 -1
  94. package/dist/handlers/session.js +7 -7
  95. package/dist/handlers/shell.js +6 -6
  96. package/dist/handlers/skill.js +6 -6
  97. package/dist/handlers/usage.js +6 -6
  98. package/dist/handlers/vcs.js +6 -6
  99. package/dist/handlers/voice.js +6 -6
  100. package/dist/handlers/websearch.js +6 -6
  101. package/dist/handlers/worktree.js +6 -6
  102. package/dist/handlers.d.ts +1 -1
  103. package/dist/handlers.js +53 -53
  104. package/dist/location.js +2 -2
  105. package/dist/media-uri.js +1 -1
  106. package/dist/middleware/authorization.js +2 -2
  107. package/dist/middleware/defect-response.js +1 -1
  108. package/dist/middleware/form-location.js +3 -3
  109. package/dist/middleware/schema-error.js +1 -1
  110. package/dist/middleware/session-location.js +3 -3
  111. package/dist/pairing.js +3 -3
  112. package/dist/process.js +63 -63
  113. package/dist/range.js +1 -1
  114. package/dist/request-site.js +2 -2
  115. package/dist/request-tracing.js +1 -1
  116. package/dist/routes.d.ts +3 -2
  117. package/dist/routes.js +57 -57
  118. package/dist/server-info.js +1 -1
  119. package/dist/service-status.js +3 -3
  120. package/dist/workerd.js +63 -63
  121. package/package.json +8 -8
  122. package/dist/chunks/request-site-9cd3a4b8.js +0 -69
  123. /package/dist/chunks/{request-site-0rzj25w4.js → request-tracing-0rzj25w4.js} +0 -0
  124. /package/dist/chunks/{request-site-9rqn6x4v.js → request-tracing-9rqn6x4v.js} +0 -0
  125. /package/dist/chunks/{request-site-bd8755ek.js → request-tracing-bd8755ek.js} +0 -0
  126. /package/dist/chunks/{request-site-n26yr6pw.js → request-tracing-n26yr6pw.js} +0 -0
  127. /package/dist/chunks/{request-site-q187pxxd.js → request-tracing-q187pxxd.js} +0 -0
  128. /package/dist/chunks/{request-site-q4bn6dy8.js → request-tracing-q4bn6dy8.js} +0 -0
  129. /package/dist/chunks/{request-site-smaf4a18.js → request-tracing-smaf4a18.js} +0 -0
  130. /package/dist/chunks/{request-site-xthc02cw.js → request-tracing-xthc02cw.js} +0 -0
  131. /package/dist/chunks/{request-site-yc7nft6q.js → request-tracing-yc7nft6q.js} +0 -0
package/dist/api.js CHANGED
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  Api2
3
- } from "./chunks/request-site-s8t5gq7c.js";
4
- import"./chunks/request-site-qahj7606.js";
5
- import"./chunks/request-site-n6ypjnhz.js";
6
- import"./chunks/request-site-j80tzjj3.js";
7
- import"./chunks/request-site-smaf4a18.js";
3
+ } from "./chunks/request-tracing-n0a33cnc.js";
4
+ import"./chunks/request-tracing-n6ypjnhz.js";
5
+ import"./chunks/request-tracing-qahj7606.js";
6
+ import"./chunks/request-tracing-j80tzjj3.js";
7
+ import"./chunks/request-tracing-smaf4a18.js";
8
8
  export {
9
9
  Api2 as Api
10
10
  };
package/dist/auth.js CHANGED
@@ -7,7 +7,7 @@ import {
7
7
  verifySession2,
8
8
  sessionCookieName2,
9
9
  exports_auth
10
- } from "./chunks/request-site-j4at0y5c.js";
10
+ } from "./chunks/request-tracing-j4at0y5c.js";
11
11
  export {
12
12
  Config2 as Config,
13
13
  SESSION_TTL_SECONDS2 as SESSION_TTL_SECONDS,
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  response2
3
- } from "./request-site-j80tzjj3.js";
3
+ } from "./request-tracing-j80tzjj3.js";
4
4
  import {
5
5
  Api2
6
- } from "./request-site-s8t5gq7c.js";
6
+ } from "./request-tracing-n0a33cnc.js";
7
7
 
8
8
  // src/handlers/skill.ts
9
9
  import { Skill } from "@opencode/core/skill";
@@ -1,44 +1,45 @@
1
1
  import {
2
2
  layer3
3
- } from "./request-site-j80tzjj3.js";
3
+ } from "./request-tracing-j80tzjj3.js";
4
4
  import {
5
5
  formLocationLayer2
6
- } from "./request-site-n6ypjnhz.js";
6
+ } from "./request-tracing-n6ypjnhz.js";
7
7
  import {
8
8
  sessionLocationLayer2
9
- } from "./request-site-qahj7606.js";
9
+ } from "./request-tracing-qahj7606.js";
10
10
  import {
11
11
  Api2
12
- } from "./request-site-s8t5gq7c.js";
12
+ } from "./request-tracing-n0a33cnc.js";
13
13
  import {
14
14
  Config2
15
- } from "./request-site-j4at0y5c.js";
15
+ } from "./request-tracing-j4at0y5c.js";
16
16
  import {
17
17
  CorsConfig2
18
- } from "./request-site-q4bn6dy8.js";
18
+ } from "./request-tracing-q4bn6dy8.js";
19
19
  import {
20
20
  layer2
21
- } from "./request-site-z3e7v67k.js";
21
+ } from "./request-tracing-z3e7v67k.js";
22
22
  import {
23
23
  node2
24
- } from "./request-site-w9jcwh65.js";
24
+ } from "./request-tracing-mzs0n5xz.js";
25
25
  import {
26
26
  handlers2
27
- } from "./request-site-ze9p165g.js";
27
+ } from "./request-tracing-tybmb1m6.js";
28
28
  import {
29
29
  authorizationLayer2
30
- } from "./request-site-rktygpea.js";
30
+ } from "./request-tracing-rktygpea.js";
31
31
  import {
32
32
  schemaErrorLayer2
33
- } from "./request-site-bd8755ek.js";
33
+ } from "./request-tracing-bd8755ek.js";
34
34
  import {
35
35
  defectResponseLayer2
36
- } from "./request-site-n26yr6pw.js";
36
+ } from "./request-tracing-n26yr6pw.js";
37
37
 
38
38
  // src/routes.ts
39
39
  import { Database } from "@opencode/core/database/database";
40
40
  import { V1Migration } from "@opencode/core/database/v1-migration";
41
41
  import { App } from "@opencode/core/app";
42
+ import { CodeModeApi } from "@opencode/core/codemode/api";
42
43
  import { LayerNode } from "@opencode/util/effect/layer-node";
43
44
  import { fetchLayer, httpClient, httpFetch } from "@opencode/util/effect/app-node-platform";
44
45
  import { AppNodeBuilder } from "@opencode/core/effect/app-node-builder";
@@ -80,11 +81,13 @@ import { WellKnown } from "@opencode/core/wellknown";
80
81
  import { Workspace } from "@opencode/core/workspace";
81
82
  import { Watcher } from "@opencode/core/filesystem/watcher";
82
83
  import { FileWatch } from "@opencode/core/filesystem/file-watch";
83
- import { HttpRouter } from "effect/http";
84
+ import { HttpEffect, HttpRouter } from "effect/http";
84
85
  import { HttpApiBuilder } from "effect/http-api";
85
86
  import { Context, Effect, Layer, Option } from "effect";
87
+ import { Base64 } from "effect/encoding";
86
88
  var applicationServiceNodes = [
87
89
  App.node,
90
+ CodeModeApi.node,
88
91
  Global.node,
89
92
  FSUtil.node,
90
93
  Database.node,
@@ -123,13 +126,29 @@ var applicationServiceNodes = [
123
126
  ];
124
127
  var applicationServices = LayerNode.group(applicationServiceNodes);
125
128
  function createRoutes2(options = {}, serviceURLs = () => [], overrides = []) {
126
- return makeRoutes(options.password ? Config2.configLayer({ password: Option.some(options.password) }) : Config2.layer, options, serviceURLs, overrides);
129
+ return makeRoutes(options.password ? Option.some(options.password) : Option.none(), options, serviceURLs, overrides);
127
130
  }
128
131
  function createEmbeddedRoutes2(options = {}, overrides = [], instances) {
129
- return makeRoutes(Config2.configLayer({ password: Option.none() }), options, () => [], overrides, instances);
132
+ return makeRoutes(Option.none(), options, () => [], overrides, instances);
130
133
  }
131
- function makeRoutes(auth, options, serviceURLs, overrides, instances) {
134
+ function makeRoutes(password, options, serviceURLs, overrides, instances) {
135
+ const auth = Config2.configLayer({ password });
136
+ const credential = Option.map(password, (value) => `Basic ${Base64.encode(`opencode:${value}`)}`);
137
+ let internal;
132
138
  const standard = [
139
+ CodeModeApi.node.replace(Layer.succeed(CodeModeApi.Service, CodeModeApi.Service.of({
140
+ fetch: (request) => Effect.suspend(() => {
141
+ const handle = internal;
142
+ if (!handle)
143
+ return Effect.fail(new Error("The OpenCode API is not ready yet."));
144
+ if (Option.isSome(credential))
145
+ request.headers.set("authorization", credential.value);
146
+ return Effect.tryPromise({
147
+ try: () => handle(request),
148
+ catch: (error) => error instanceof Error ? error : new Error(String(error))
149
+ });
150
+ })
151
+ }))),
133
152
  Database.node.replace(Database.configured(options.database)),
134
153
  PersistentPty.node.replace(PersistentPty.configured(options.pty)),
135
154
  Bus.node.replace(Bus.configured({ persist: options.events?.persist })),
@@ -174,7 +193,9 @@ function makeRoutes(auth, options, serviceURLs, overrides, instances) {
174
193
  return serviceLayer.pipe(Layer.flatMap((context) => {
175
194
  const services = Layer.succeedContext(context);
176
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));
177
- 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.merge(defectResponseLayer2), Layer.provideMerge(services), Layer.provideMerge(HttpRouter.layer));
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(layer3), 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
+ internal = Context.get(context, HttpRouter.HttpRouter).asHttpEffect().pipe(HttpEffect.toWebHandlerWith(context));
198
+ })));
178
199
  return Layer.merge(api, V1Migration.layer.pipe(Layer.provide(services)));
179
200
  }));
180
201
  }
@@ -3,16 +3,16 @@ import {
3
3
  missingMessage2,
4
4
  failedMessageDecode2,
5
5
  failedSnapshot2
6
- } from "./request-site-smaf4a18.js";
6
+ } from "./request-tracing-smaf4a18.js";
7
7
  import {
8
8
  locationErrors2
9
- } from "./request-site-j80tzjj3.js";
9
+ } from "./request-tracing-j80tzjj3.js";
10
10
  import {
11
11
  Api2
12
- } from "./request-site-s8t5gq7c.js";
12
+ } from "./request-tracing-n0a33cnc.js";
13
13
  import {
14
14
  wantsMediaRefs2
15
- } from "./request-site-xthc02cw.js";
15
+ } from "./request-tracing-xthc02cw.js";
16
16
 
17
17
  // src/handlers/session.ts
18
18
  import { Instance } from "@opencode/core/instance/service";
@@ -1,32 +1,32 @@
1
1
  import {
2
2
  isAllowedCorsOrigin2
3
- } from "./request-site-q4bn6dy8.js";
3
+ } from "./request-tracing-q4bn6dy8.js";
4
4
  import {
5
5
  middleware2
6
- } from "./request-site-myqk22k5.js";
6
+ } from "./request-tracing-hmwn16zp.js";
7
7
  import {
8
8
  withoutParentSpan2
9
- } from "./request-site-yc7nft6q.js";
9
+ } from "./request-tracing-yc7nft6q.js";
10
10
  import {
11
11
  createRoutes2
12
- } from "./request-site-p8bw27eh.js";
12
+ } from "./request-tracing-1xf02gcb.js";
13
13
  import {
14
14
  __export
15
- } from "./request-site-9rqn6x4v.js";
15
+ } from "./request-tracing-9rqn6x4v.js";
16
16
 
17
17
  // src/fetch.ts
18
18
  var exports_fetch = {};
19
19
  __export(exports_fetch, {
20
20
  ServerFetch: () => exports_fetch,
21
- make: () => make3
21
+ make: () => make2
22
22
  });
23
23
  import { Context, Effect, Layer } from "effect";
24
24
  import { HttpEffect, HttpMiddleware, HttpRouter, HttpServer } from "effect/http";
25
25
  import { SessionRestart } from "@opencode/core/session/execution/restart";
26
- var make3 = Effect.fn("ServerFetch.make")(function* (options = {}, boot = {}) {
26
+ var make2 = Effect.fn("ServerFetch.make")(function* (options = {}, boot = {}) {
27
27
  const context = yield* Layer.build(createRoutes2(options, () => [], boot.overrides ?? []).pipe(Layer.provide(HttpServer.layerServices))).pipe(withoutParentSpan2);
28
28
  yield* Effect.forkDetach(Context.get(context, SessionRestart.Service).resumeSuspendedSessions);
29
29
  return Context.get(context, HttpRouter.HttpRouter).asHttpEffect().pipe(middleware2(options), HttpMiddleware.cors({ allowedOrigins: (origin) => isAllowedCorsOrigin2(origin, options), maxAge: 86400 }), HttpEffect.toWebHandlerWith(context));
30
30
  });
31
31
 
32
- export { make3, exports_fetch };
32
+ export { make2, exports_fetch };
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  Api2
3
- } from "./request-site-s8t5gq7c.js";
3
+ } from "./request-tracing-n0a33cnc.js";
4
4
 
5
5
  // src/handlers/migration.ts
6
6
  import { V1Migration } from "@opencode/core/database/v1-migration";
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  response2
3
- } from "./request-site-j80tzjj3.js";
3
+ } from "./request-tracing-j80tzjj3.js";
4
4
  import {
5
5
  Api2
6
- } from "./request-site-s8t5gq7c.js";
6
+ } from "./request-tracing-n0a33cnc.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
  locationErrors2
3
- } from "./request-site-j80tzjj3.js";
3
+ } from "./request-tracing-j80tzjj3.js";
4
4
  import {
5
5
  Api2
6
- } from "./request-site-s8t5gq7c.js";
6
+ } from "./request-tracing-n0a33cnc.js";
7
7
 
8
8
  // src/handlers/generate.ts
9
9
  import { Generate } from "@opencode/core/generate";
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  response2
3
- } from "./request-site-j80tzjj3.js";
3
+ } from "./request-tracing-j80tzjj3.js";
4
4
  import {
5
5
  Api2
6
- } from "./request-site-s8t5gq7c.js";
6
+ } from "./request-tracing-n0a33cnc.js";
7
7
 
8
8
  // src/handlers/websearch.ts
9
9
  import { WebSearch } from "@opencode/core/websearch";
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  response2
3
- } from "./request-site-j80tzjj3.js";
3
+ } from "./request-tracing-j80tzjj3.js";
4
4
  import {
5
5
  Api2
6
- } from "./request-site-s8t5gq7c.js";
6
+ } from "./request-tracing-n0a33cnc.js";
7
7
 
8
8
  // src/handlers/vcs.ts
9
9
  import { Vcs } from "@opencode/core/vcs";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  Api2
3
- } from "./request-site-s8t5gq7c.js";
3
+ } from "./request-tracing-n0a33cnc.js";
4
4
 
5
5
  // src/handlers/project.ts
6
6
  import { Project } from "@opencode/core/project";
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  response2
3
- } from "./request-site-j80tzjj3.js";
3
+ } from "./request-tracing-j80tzjj3.js";
4
4
  import {
5
5
  Api2
6
- } from "./request-site-s8t5gq7c.js";
6
+ } from "./request-tracing-n0a33cnc.js";
7
7
 
8
8
  // src/handlers/agent.ts
9
9
  import { Agent } from "@opencode/core/agent";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  missingSession2
3
- } from "./request-site-smaf4a18.js";
3
+ } from "./request-tracing-smaf4a18.js";
4
4
 
5
5
  // src/handlers/job.ts
6
6
  import { Job } from "@opencode/core/job";
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  response2
3
- } from "./request-site-j80tzjj3.js";
3
+ } from "./request-tracing-j80tzjj3.js";
4
4
  import {
5
5
  Api2
6
- } from "./request-site-s8t5gq7c.js";
6
+ } from "./request-tracing-n0a33cnc.js";
7
7
 
8
8
  // src/handlers/plugin.ts
9
9
  import { Plugin } from "@opencode/core/plugin";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  __export
3
- } from "./request-site-9rqn6x4v.js";
3
+ } from "./request-tracing-9rqn6x4v.js";
4
4
 
5
5
  // src/range.ts
6
6
  var exports_range = {};
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  Api2
3
- } from "./request-site-s8t5gq7c.js";
3
+ } from "./request-tracing-n0a33cnc.js";
4
4
 
5
5
  // src/handlers/location.ts
6
6
  import { Location } from "@opencode/core/location";
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  response2
3
- } from "./request-site-j80tzjj3.js";
3
+ } from "./request-tracing-j80tzjj3.js";
4
4
  import {
5
5
  Api2
6
- } from "./request-site-s8t5gq7c.js";
6
+ } from "./request-tracing-n0a33cnc.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 "./request-site-j80tzjj3.js";
3
+ } from "./request-tracing-j80tzjj3.js";
4
4
  import {
5
5
  Api2
6
- } from "./request-site-s8t5gq7c.js";
6
+ } from "./request-tracing-n0a33cnc.js";
7
7
 
8
8
  // src/handlers/form.ts
9
9
  import { Form } from "@opencode/core/form";
@@ -2,18 +2,18 @@ import {
2
2
  locationErrors2,
3
3
  response2,
4
4
  requestRef2
5
- } from "./request-site-j80tzjj3.js";
5
+ } from "./request-tracing-j80tzjj3.js";
6
6
  import {
7
7
  Api2
8
- } from "./request-site-s8t5gq7c.js";
8
+ } from "./request-tracing-n0a33cnc.js";
9
9
  import {
10
10
  CorsConfig2,
11
11
  isAllowedRequestOrigin2
12
- } from "./request-site-q4bn6dy8.js";
12
+ } from "./request-tracing-q4bn6dy8.js";
13
13
  import {
14
14
  runPtySocket2,
15
15
  holdLocation2
16
- } from "./request-site-q187pxxd.js";
16
+ } from "./request-tracing-q187pxxd.js";
17
17
 
18
18
  // src/handlers/mcp.ts
19
19
  import { Location } from "@opencode/core/location";
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  CONTENT_SECURITY_POLICY2,
3
3
  disposition2
4
- } from "./request-site-t32e1bbt.js";
4
+ } from "./request-tracing-t32e1bbt.js";
5
5
 
6
6
  // src/handlers/media.ts
7
7
  import { Database } from "@opencode/core/database/database";
@@ -1,15 +1,15 @@
1
1
  import {
2
2
  __export
3
- } from "./request-site-9rqn6x4v.js";
3
+ } from "./request-tracing-9rqn6x4v.js";
4
4
 
5
5
  // src/service-status.ts
6
6
  var exports_service_status = {};
7
7
  __export(exports_service_status, {
8
8
  Status: () => exports_service_status,
9
- make: () => make2
9
+ make: () => make3
10
10
  });
11
11
  import { Effect, Ref } from "effect";
12
- var make2 = Effect.fnUntraced(function* (options = {}) {
12
+ var make3 = Effect.fnUntraced(function* (options = {}) {
13
13
  const current = yield* Ref.make(options.initial ?? { type: "starting" });
14
14
  const beginStopping = Ref.update(current, (status) => status.type === "stopping" ? status : { type: "stopping" });
15
15
  return {
@@ -20,4 +20,4 @@ var make2 = Effect.fnUntraced(function* (options = {}) {
20
20
  };
21
21
  });
22
22
 
23
- export { make2, exports_service_status };
23
+ export { make3, exports_service_status };
@@ -1,32 +1,32 @@
1
1
  import {
2
2
  Api2
3
- } from "./request-site-s8t5gq7c.js";
3
+ } from "./request-tracing-n0a33cnc.js";
4
4
  import {
5
5
  CorsConfig2,
6
6
  isAllowedRequestOrigin2
7
- } from "./request-site-q4bn6dy8.js";
7
+ } from "./request-tracing-q4bn6dy8.js";
8
8
  import {
9
9
  makeArtifact2
10
- } from "./request-site-t62b1gmw.js";
10
+ } from "./request-tracing-t62b1gmw.js";
11
11
  import {
12
12
  makeBlobGet2
13
- } from "./request-site-g23ffrnz.js";
13
+ } from "./request-tracing-g23ffrnz.js";
14
14
  import {
15
15
  makeAutomation2
16
- } from "./request-site-9cd3a4b8.js";
16
+ } from "./request-tracing-hgrkvk6s.js";
17
17
  import {
18
18
  makeJob2
19
- } from "./request-site-7ydfwv45.js";
19
+ } from "./request-tracing-7ydfwv45.js";
20
20
  import {
21
21
  makeMachineLink2,
22
22
  makeMachine2
23
- } from "./request-site-0rzj25w4.js";
23
+ } from "./request-tracing-0rzj25w4.js";
24
24
  import {
25
25
  makeMediaGet2
26
- } from "./request-site-djr0jy89.js";
26
+ } from "./request-tracing-djr0jy89.js";
27
27
  import {
28
28
  runPtySocket2
29
- } from "./request-site-q187pxxd.js";
29
+ } from "./request-tracing-q187pxxd.js";
30
30
 
31
31
  // src/handlers/persistent-pty.ts
32
32
  import { PersistentPty } from "@opencode/core/persistent-pty";
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  download2
3
- } from "./request-site-t32e1bbt.js";
3
+ } from "./request-tracing-t32e1bbt.js";
4
4
  import {
5
5
  parse2
6
- } from "./request-site-8sb6qqpn.js";
6
+ } from "./request-tracing-8sb6qqpn.js";
7
7
 
8
8
  // src/handlers/blob.ts
9
9
  import { BlobStore } from "@opencode/core/blob-store";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  Api2
3
- } from "./request-site-s8t5gq7c.js";
3
+ } from "./request-tracing-n0a33cnc.js";
4
4
 
5
5
  // src/handlers/worktree.ts
6
6
  import { Git } from "@opencode/core/git";
@@ -0,0 +1,48 @@
1
+ import {
2
+ missingSession2
3
+ } from "./request-tracing-smaf4a18.js";
4
+
5
+ // src/handlers/automation.ts
6
+ import { Automation } from "@opencode/core/automation";
7
+ import { Permission } from "@opencode/core/permission";
8
+ import { AutomationNotFoundError, ForbiddenError, InvalidRequestError } from "@opencode/protocol/errors";
9
+ import { Effect } from "effect";
10
+ import { HttpApiSchema } from "effect/http-api";
11
+ var makeAutomation2 = Effect.gen(function* () {
12
+ const automations = yield* Automation.Service;
13
+ return {
14
+ create: (payload) => automations.create(payload).pipe(Effect.provideService(Permission.Unattended, []), Effect.map((data) => ({ data })), Effect.catchTags({
15
+ "Automation.InvalidError": (error) => Effect.fail(new InvalidRequestError({ message: error.message, kind: "automation" })),
16
+ "Automation.DisabledError": () => Effect.fail(disabled()),
17
+ "Permission.BlockedError": (error) => Effect.fail(new ForbiddenError({ message: error.message })),
18
+ "Permission.CorrectedError": (error) => Effect.fail(new ForbiddenError({ message: error.feedback })),
19
+ "Session.NotFoundError": (error) => Effect.fail(missingSession2(error))
20
+ })),
21
+ list: (query) => automations.list(query).pipe(Effect.map((data) => ({ data })), Effect.catchTags({
22
+ "Automation.InvalidError": (error) => Effect.fail(new InvalidRequestError({ message: error.message, kind: "automation" })),
23
+ "Automation.DisabledError": () => Effect.fail(disabled()),
24
+ "Session.NotFoundError": (error) => Effect.fail(missingSession2(error))
25
+ })),
26
+ get: (id) => managed(automations.get(id).pipe(Effect.map((data) => ({ data })))),
27
+ pause: (id) => managed(automations.pause(id).pipe(Effect.map((data) => ({ data })))),
28
+ resume: (id) => managed(automations.resume(id).pipe(Effect.map((data) => ({ data })))),
29
+ remove: (id) => managed(automations.remove(id).pipe(Effect.as(HttpApiSchema.NoContent.make())))
30
+ };
31
+ });
32
+ function managed(effect) {
33
+ return effect.pipe(Effect.catchTags({
34
+ "Automation.NotFoundError": (error) => Effect.fail(missingAutomation(error)),
35
+ "Automation.DisabledError": () => Effect.fail(disabled())
36
+ }));
37
+ }
38
+ function missingAutomation(error) {
39
+ return new AutomationNotFoundError({
40
+ automationID: error.automationID,
41
+ message: `Automation not found: ${error.automationID}`
42
+ });
43
+ }
44
+ function disabled() {
45
+ return new ForbiddenError({ message: new Automation.DisabledError().message });
46
+ }
47
+
48
+ export { makeAutomation2 };
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  isAllowedRequestOrigin2
3
- } from "./request-site-q4bn6dy8.js";
3
+ } from "./request-tracing-q4bn6dy8.js";
4
4
  import {
5
5
  __export
6
- } from "./request-site-9rqn6x4v.js";
6
+ } from "./request-tracing-9rqn6x4v.js";
7
7
 
8
8
  // src/request-site.ts
9
9
  var exports_request_site = {};
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  Api2
3
- } from "./request-site-s8t5gq7c.js";
3
+ } from "./request-tracing-n0a33cnc.js";
4
4
 
5
5
  // src/handlers/rpc.ts
6
6
  import { Rpc } from "@opencode/core/rpc";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  __export
3
- } from "./request-site-9rqn6x4v.js";
3
+ } from "./request-tracing-9rqn6x4v.js";
4
4
 
5
5
  // src/auth.ts
6
6
  var exports_auth = {};
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  missingSession2
3
- } from "./request-site-smaf4a18.js";
3
+ } from "./request-tracing-smaf4a18.js";
4
4
 
5
5
  // src/location.ts
6
6
  import { FileSystem } from "@opencode/core/filesystem";
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  locationErrors2
3
- } from "./request-site-j80tzjj3.js";
3
+ } from "./request-tracing-j80tzjj3.js";
4
4
  import {
5
5
  Api2
6
- } from "./request-site-s8t5gq7c.js";
6
+ } from "./request-tracing-n0a33cnc.js";
7
7
 
8
8
  // src/handlers/voice.ts
9
9
  import { Location } from "@opencode/core/location";
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  __export
3
- } from "./request-site-9rqn6x4v.js";
3
+ } from "./request-tracing-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: () => Service3,
9
+ Service: () => Service4,
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 Service3 extends Context.Service()("@opencode/ServerPairing") {
17
+ class Service4 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(Service3, Effect.gen(function* () {
20
+ var layer = Layer.effect(Service4, Effect.gen(function* () {
21
21
  const cache = yield* Cache.make({ capacity: 1000, lookup: noLookup, timeToLive: TTL });
22
- return Service3.of({
22
+ return Service4.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(Service3, Effect.gen(function* () {
30
30
  })
31
31
  });
32
32
  }));
33
- var node2 = makeGlobalNode({ service: Service3, layer, deps: [] });
33
+ var node2 = makeGlobalNode({ service: Service4, layer, deps: [] });
34
34
 
35
- export { Service3, node2, exports_pairing };
35
+ export { Service4, node2, exports_pairing };