@opencode/server 2.4.0 → 2.4.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (140) hide show
  1. package/dist/api.d.ts +45 -1
  2. package/dist/api.js +5 -5
  3. package/dist/auth.js +1 -1
  4. package/dist/chunks/{content-headers-0rzj25w4.js → range-017ycvbx.js} +1 -1
  5. package/dist/chunks/{content-headers-9t07vtvz.js → range-0x6anvwr.js} +2 -2
  6. package/dist/chunks/{content-headers-39nnfjx1.js → range-39nnfjx1.js} +1 -1
  7. package/dist/chunks/{content-headers-801prsqk.js → range-3rtm8r3z.js} +2 -2
  8. package/dist/chunks/{content-headers-z3e7v67k.js → range-3te71694.js} +7 -7
  9. package/dist/chunks/{content-headers-jhbndf2d.js → range-5pef2nys.js} +4 -4
  10. package/dist/chunks/range-6pm6ek88.js +48 -0
  11. package/dist/chunks/{content-headers-r40v995e.js → range-78jk0pbb.js} +2 -2
  12. package/dist/chunks/{content-headers-hnbeyfax.js → range-79t5cra8.js} +14 -10
  13. package/dist/chunks/{content-headers-8ja97vv6.js → range-7zz6jxhb.js} +2 -2
  14. package/dist/chunks/{content-headers-8sb6qqpn.js → range-8sb6qqpn.js} +1 -1
  15. package/dist/chunks/{content-headers-hk9crnsa.js → range-9agv2b4c.js} +2 -2
  16. package/dist/chunks/{content-headers-vw0q3knq.js → range-aexh791j.js} +1 -1
  17. package/dist/chunks/{content-headers-2cm4dfcc.js → range-amxj52x5.js} +2 -2
  18. package/dist/chunks/{content-headers-zjmacp9c.js → range-ay32z58n.js} +3 -3
  19. package/dist/chunks/{content-headers-2dzr03as.js → range-b3sk57wg.js} +1 -1
  20. package/dist/chunks/{content-headers-y60jfeab.js → range-c6kzfg4f.js} +2 -2
  21. package/dist/chunks/{content-headers-2rb1ee6g.js → range-cddawxec.js} +3 -3
  22. package/dist/chunks/{content-headers-djr0jy89.js → range-djr0jy89.js} +1 -1
  23. package/dist/chunks/range-dnyhqccw.js +27 -0
  24. package/dist/chunks/{content-headers-100nc7c0.js → range-f93zkajm.js} +2 -2
  25. package/dist/chunks/{content-headers-g23ffrnz.js → range-g23ffrnz.js} +2 -2
  26. package/dist/chunks/{content-headers-prn0chz2.js → range-gwtm9cga.js} +1 -1
  27. package/dist/chunks/{content-headers-s3zgwc17.js → range-heqw7kpr.js} +2 -2
  28. package/dist/chunks/{content-headers-p83m65n5.js → range-hgd5b6k8.js} +2 -2
  29. package/dist/chunks/{content-headers-j4at0y5c.js → range-j4at0y5c.js} +1 -1
  30. package/dist/chunks/{content-headers-b03d5rht.js → range-jrjpfy36.js} +2 -2
  31. package/dist/chunks/{content-headers-ah2sj2pr.js → range-jy2ammbg.js} +1 -1
  32. package/dist/chunks/{content-headers-d20xfnpc.js → range-k2bx5n4e.js} +1 -1
  33. package/dist/chunks/{content-headers-wka57cdm.js → range-k518ftvz.js} +2 -2
  34. package/dist/chunks/{content-headers-4zkx9wb3.js → range-k58xpxwn.js} +1 -1
  35. package/dist/chunks/{content-headers-mzs0n5xz.js → range-kqr36gas.js} +7 -7
  36. package/dist/chunks/{content-headers-gq4jwh93.js → range-mjhh6jvz.js} +3 -3
  37. package/dist/chunks/{content-headers-hmwn16zp.js → range-myqk22k5.js} +2 -2
  38. package/dist/chunks/{content-headers-7jm4dc4a.js → range-n8nthg9q.js} +4 -4
  39. package/dist/chunks/{content-headers-5jm9kajg.js → range-pa4xtt5h.js} +2 -2
  40. package/dist/chunks/range-qpnw2qd1.js +58 -0
  41. package/dist/chunks/{content-headers-rktygpea.js → range-rktygpea.js} +1 -1
  42. package/dist/chunks/{content-headers-4fc68szf.js → range-rn83nvae.js} +2 -2
  43. package/dist/chunks/{content-headers-smaf4a18.js → range-rqgv9x42.js} +6 -2
  44. package/dist/chunks/{content-headers-fjcqsaaz.js → range-s3d15g1k.js} +23 -17
  45. package/dist/chunks/{content-headers-ddrpmftb.js → range-s557cdqw.js} +14 -4
  46. package/dist/chunks/{content-headers-1r438we2.js → range-s6q3ch5r.js} +8 -8
  47. package/dist/chunks/{content-headers-7qpea5x7.js → range-sqfq92mf.js} +2 -2
  48. package/dist/chunks/{content-headers-ywn523ee.js → range-stx1bw5w.js} +3 -3
  49. package/dist/chunks/{content-headers-t32e1bbt.js → range-t32e1bbt.js} +1 -1
  50. package/dist/chunks/{content-headers-w3xmknp7.js → range-tmb89r25.js} +2 -2
  51. package/dist/chunks/{content-headers-mvp6540g.js → range-tmbyzr8c.js} +35 -35
  52. package/dist/chunks/{content-headers-ykk3p1r3.js → range-vkj8vbyf.js} +2 -2
  53. package/dist/chunks/{content-headers-yty6dk04.js → range-vnpm7f9y.js} +1 -1
  54. package/dist/chunks/{content-headers-0r476wkb.js → range-wa6vk4hf.js} +14 -9
  55. package/dist/chunks/{content-headers-hf3kgjhr.js → range-wazndna9.js} +4 -4
  56. package/dist/chunks/{content-headers-qfyg9gb7.js → range-wecgp61r.js} +7 -7
  57. package/dist/chunks/{content-headers-7ydfwv45.js → range-x2qy7jg1.js} +1 -1
  58. package/dist/chunks/{content-headers-ky9xhfwk.js → range-zs3ssmns.js} +26 -21
  59. package/dist/chunks/{content-headers-rmfb1myj.js → range-zx60pg73.js} +1 -1
  60. package/dist/content-headers.js +1 -1
  61. package/dist/cors.js +1 -1
  62. package/dist/event-feed.js +5 -5
  63. package/dist/fetch.d.ts +57 -0
  64. package/dist/fetch.js +64 -61
  65. package/dist/handlers/agent.js +6 -6
  66. package/dist/handlers/artifact.js +3 -3
  67. package/dist/handlers/automation.d.ts +1 -3
  68. package/dist/handlers/automation.js +2 -2
  69. package/dist/handlers/blob.js +3 -3
  70. package/dist/handlers/command.js +6 -6
  71. package/dist/handlers/config.js +6 -6
  72. package/dist/handlers/credential.js +7 -7
  73. package/dist/handlers/debug.js +6 -6
  74. package/dist/handlers/event.js +7 -7
  75. package/dist/handlers/form.js +6 -6
  76. package/dist/handlers/fs.js +8 -8
  77. package/dist/handlers/generate.js +6 -6
  78. package/dist/handlers/integration.js +6 -6
  79. package/dist/handlers/job.js +2 -2
  80. package/dist/handlers/location.js +6 -6
  81. package/dist/handlers/machine.js +1 -1
  82. package/dist/handlers/mcp.js +8 -8
  83. package/dist/handlers/media.js +2 -2
  84. package/dist/handlers/message.js +7 -7
  85. package/dist/handlers/migration.js +6 -6
  86. package/dist/handlers/model.js +6 -6
  87. package/dist/handlers/permission.js +6 -6
  88. package/dist/handlers/persistent-pty.d.ts +1 -1
  89. package/dist/handlers/persistent-pty.js +17 -16
  90. package/dist/handlers/plugin.js +6 -6
  91. package/dist/handlers/project.js +6 -6
  92. package/dist/handlers/provider.js +6 -6
  93. package/dist/handlers/pty-socket.js +1 -1
  94. package/dist/handlers/pty.js +8 -8
  95. package/dist/handlers/push.d.ts +28 -0
  96. package/dist/handlers/push.js +6 -0
  97. package/dist/handlers/reference.js +6 -6
  98. package/dist/handlers/rpc.js +6 -6
  99. package/dist/handlers/server.js +9 -9
  100. package/dist/handlers/session-error.d.ts +3 -1
  101. package/dist/handlers/session-error.js +4 -2
  102. package/dist/handlers/session.js +7 -7
  103. package/dist/handlers/shell.js +6 -6
  104. package/dist/handlers/skill.js +6 -6
  105. package/dist/handlers/usage.js +6 -6
  106. package/dist/handlers/vcs.js +6 -6
  107. package/dist/handlers/voice.js +6 -6
  108. package/dist/handlers/websearch.js +6 -6
  109. package/dist/handlers/worktree.js +6 -6
  110. package/dist/handlers.d.ts +1 -1
  111. package/dist/handlers.js +54 -53
  112. package/dist/location.js +4 -4
  113. package/dist/media-uri.js +1 -1
  114. package/dist/middleware/authorization.js +2 -2
  115. package/dist/middleware/defect-response.js +1 -1
  116. package/dist/middleware/form-location.js +3 -3
  117. package/dist/middleware/schema-error.js +1 -1
  118. package/dist/middleware/session-location.js +3 -3
  119. package/dist/pairing.d.ts +1 -1
  120. package/dist/pairing.js +3 -3
  121. package/dist/process.js +62 -61
  122. package/dist/range.js +1 -1
  123. package/dist/request-site.js +2 -2
  124. package/dist/request-tracing.js +1 -1
  125. package/dist/routes.d.ts +4 -2
  126. package/dist/routes.js +58 -57
  127. package/dist/server-info.js +5 -5
  128. package/dist/service-status.js +1 -1
  129. package/dist/workerd.d.ts +20 -6
  130. package/dist/workerd.js +87 -81
  131. package/package.json +9 -9
  132. package/dist/chunks/content-headers-9cd3a4b8.js +0 -69
  133. package/dist/chunks/content-headers-jmmhprac.js +0 -13
  134. /package/dist/chunks/{content-headers-9rqn6x4v.js → range-9rqn6x4v.js} +0 -0
  135. /package/dist/chunks/{content-headers-bd8755ek.js → range-bd8755ek.js} +0 -0
  136. /package/dist/chunks/{content-headers-n26yr6pw.js → range-n26yr6pw.js} +0 -0
  137. /package/dist/chunks/{content-headers-q187pxxd.js → range-q187pxxd.js} +0 -0
  138. /package/dist/chunks/{content-headers-q4bn6dy8.js → range-q4bn6dy8.js} +0 -0
  139. /package/dist/chunks/{content-headers-xthc02cw.js → range-xthc02cw.js} +0 -0
  140. /package/dist/chunks/{content-headers-yc7nft6q.js → range-yc7nft6q.js} +0 -0
package/dist/api.d.ts CHANGED
@@ -2,7 +2,7 @@ import { LocationMiddleware } from "./location";
2
2
  import { FormLocationMiddleware } from "./middleware/form-location";
3
3
  import { SessionLocationMiddleware } from "./middleware/session-location";
4
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, import("effect/Schema").toCodecStringTree<import("effect/Schema").Struct<{
5
- readonly types: import("effect/Schema").optional<import("effect/Schema").ArrayEnsure<import("effect/Schema").Union<readonly [import("effect/Schema").Literals<readonly ("agent.updated" | "artifact.updated" | "command.updated" | "config.updated" | "credential.switched" | "credential.updated" | "experimental.job.updated" | "experimental.mcp.event" | "filesystem.changed" | "form.cancelled" | "form.created" | "form.replied" | "installation.update-available" | "installation.updated" | "integration.updated" | "location.shutdown" | "mcp.resources.changed" | "mcp.status.changed" | "model.updated" | "models-dev.refreshed" | "permission.asked" | "permission.replied" | "persistent-pty.added" | "persistent-pty.removed" | "persistent-pty.updated" | "plugin.updated" | "project.updated" | "provider.updated" | "pty.created" | "pty.deleted" | "pty.exited" | "pty.updated" | "reference.updated" | "session.agent.selected" | "session.archived" | "session.compaction.delta" | "session.compaction.ended" | "session.compaction.failed" | "session.compaction.started" | "session.created" | "session.deleted" | "session.execution.failed" | "session.execution.interrupted" | "session.execution.started" | "session.execution.succeeded" | "session.forked" | "session.idle" | "session.inbox.cancelled" | "session.inbox.delivered" | "session.inbox.delivery.changed" | "session.inbox.enqueued" | "session.instructions.updated" | "session.metadata.updated" | "session.model.selected" | "session.moved" | "session.permissions" | "session.reasoning.delta" | "session.reasoning.ended" | "session.reasoning.started" | "session.renamed" | "session.retry.scheduled" | "session.revert.cleared" | "session.revert.committed" | "session.revert.staged" | "session.shell.ended" | "session.shell.started" | "session.skill.activated" | "session.status" | "session.step.ended" | "session.step.failed" | "session.step.first-token" | "session.step.started" | "session.step.streamed" | "session.synthetic" | "session.text.delta" | "session.text.ended" | "session.text.started" | "session.tool.called" | "session.tool.failed" | "session.tool.input.delta" | "session.tool.input.ended" | "session.tool.input.started" | "session.tool.progress" | "session.tool.success" | "session.unarchived" | "session.usage.updated" | "session.viewed" | "shell.created" | "shell.deleted" | "shell.exited" | "skill.updated" | "tui.command.execute" | "tui.prompt.append" | "tui.session.select" | "tui.toast.show" | "vcs.branch.updated" | "websearch.updated" | "worktree.resolved" | "worktree.updated")[]>, import("effect/Schema").TemplateLiteral<readonly ["rpc.", import("effect/Schema").String]>]>>>;
5
+ readonly types: import("effect/Schema").optional<import("effect/Schema").ArrayEnsure<import("effect/Schema").Union<readonly [import("effect/Schema").Literals<readonly ("agent.updated" | "artifact.updated" | "command.updated" | "config.updated" | "credential.switched" | "credential.updated" | "experimental.job.updated" | "experimental.mcp.event" | "experimental.push.updated" | "filesystem.changed" | "form.cancelled" | "form.created" | "form.replied" | "installation.update-available" | "installation.updated" | "integration.updated" | "location.shutdown" | "mcp.resources.changed" | "mcp.status.changed" | "model.updated" | "models-dev.refreshed" | "permission.asked" | "permission.replied" | "persistent-pty.added" | "persistent-pty.removed" | "persistent-pty.updated" | "plugin.updated" | "project.updated" | "provider.updated" | "pty.created" | "pty.deleted" | "pty.exited" | "pty.updated" | "reference.updated" | "session.agent.selected" | "session.archived" | "session.compaction.delta" | "session.compaction.ended" | "session.compaction.failed" | "session.compaction.started" | "session.created" | "session.deleted" | "session.execution.failed" | "session.execution.interrupted" | "session.execution.started" | "session.execution.succeeded" | "session.forked" | "session.idle" | "session.inbox.cancelled" | "session.inbox.delivered" | "session.inbox.delivery.changed" | "session.inbox.enqueued" | "session.instructions.updated" | "session.metadata.updated" | "session.model.selected" | "session.moved" | "session.permissions" | "session.reasoning.delta" | "session.reasoning.ended" | "session.reasoning.started" | "session.renamed" | "session.retry.scheduled" | "session.revert.cleared" | "session.revert.committed" | "session.revert.staged" | "session.shell.ended" | "session.shell.started" | "session.skill.activated" | "session.status" | "session.step.ended" | "session.step.failed" | "session.step.first-token" | "session.step.started" | "session.step.streamed" | "session.synthetic" | "session.text.delta" | "session.text.ended" | "session.text.started" | "session.tool.called" | "session.tool.failed" | "session.tool.input.delta" | "session.tool.input.ended" | "session.tool.input.started" | "session.tool.progress" | "session.tool.success" | "session.unarchived" | "session.usage.updated" | "session.viewed" | "shell.created" | "shell.deleted" | "shell.exited" | "skill.updated" | "tui.command.execute" | "tui.prompt.append" | "tui.session.select" | "tui.toast.show" | "vcs.branch.updated" | "websearch.updated" | "worktree.resolved" | "worktree.updated")[]>, import("effect/Schema").TemplateLiteral<readonly ["rpc.", import("effect/Schema").String]>]>>>;
6
6
  }>>, never, never, import("effect/http-api/HttpApiSchema").StreamSse<import("effect/http-api/HttpApiSchema").SseEventFromData<import("effect/Schema").Union<readonly [import("effect/Schema").Struct<{
7
7
  readonly id: import("effect/Schema").brand<import("effect/Schema").String, "Event.ID"> & {
8
8
  create: () => string & import("effect/Brand").Brand<"Event.ID">;
@@ -6121,6 +6121,38 @@ export declare const Api: import("@opencode/protocol/api").Api<LocationMiddlewar
6121
6121
  durability: "ephemeral";
6122
6122
  durable: undefined;
6123
6123
  data: import("effect/Schema").Struct<{}>;
6124
+ }, import("effect/Schema").Struct<{
6125
+ readonly id: import("effect/Schema").brand<import("effect/Schema").String, "Event.ID"> & {
6126
+ create: () => string & import("effect/Brand").Brand<"Event.ID">;
6127
+ };
6128
+ readonly created: import("effect/Schema").Finite;
6129
+ readonly metadata: import("effect/Schema").decodeTo<import("effect/Schema").optional<import("effect/Schema").toType<import("effect/Schema").$Record<import("effect/Schema").String, import("effect/Schema").Unknown>>>, import("effect/Schema").optionalKey<import("effect/Schema").$Record<import("effect/Schema").String, import("effect/Schema").Unknown>>, never, never>;
6130
+ readonly type: import("effect/Schema").Literal<"experimental.push.updated">;
6131
+ readonly location: import("effect/Schema").decodeTo<import("effect/Schema").optional<import("effect/Schema").toType<import("effect/Schema").Struct<{
6132
+ readonly directory: import("effect/Schema").brand<import("effect/Schema").String, "AbsolutePath">;
6133
+ readonly workspaceID: import("effect/Schema").decodeTo<import("effect/Schema").optional<import("effect/Schema").toType<import("effect/Schema").brand<import("effect/Schema").String, "Workspace.ID"> & {
6134
+ ascending: (id?: string) => string & import("effect/Brand").Brand<"Workspace.ID">;
6135
+ create: () => string & import("effect/Brand").Brand<"Workspace.ID">;
6136
+ }>>, import("effect/Schema").optionalKey<import("effect/Schema").brand<import("effect/Schema").String, "Workspace.ID"> & {
6137
+ ascending: (id?: string) => string & import("effect/Brand").Brand<"Workspace.ID">;
6138
+ create: () => string & import("effect/Brand").Brand<"Workspace.ID">;
6139
+ }>, never, never>;
6140
+ }>>>, import("effect/Schema").optionalKey<import("effect/Schema").Struct<{
6141
+ readonly directory: import("effect/Schema").brand<import("effect/Schema").String, "AbsolutePath">;
6142
+ readonly workspaceID: import("effect/Schema").decodeTo<import("effect/Schema").optional<import("effect/Schema").toType<import("effect/Schema").brand<import("effect/Schema").String, "Workspace.ID"> & {
6143
+ ascending: (id?: string) => string & import("effect/Brand").Brand<"Workspace.ID">;
6144
+ create: () => string & import("effect/Brand").Brand<"Workspace.ID">;
6145
+ }>>, import("effect/Schema").optionalKey<import("effect/Schema").brand<import("effect/Schema").String, "Workspace.ID"> & {
6146
+ ascending: (id?: string) => string & import("effect/Brand").Brand<"Workspace.ID">;
6147
+ create: () => string & import("effect/Brand").Brand<"Workspace.ID">;
6148
+ }>, never, never>;
6149
+ }>>, never, never>;
6150
+ readonly data: import("effect/Schema").Struct<{}>;
6151
+ }> & {
6152
+ type: "experimental.push.updated";
6153
+ durability: "ephemeral";
6154
+ durable: undefined;
6155
+ data: import("effect/Schema").Struct<{}>;
6124
6156
  }, import("effect/Schema").Struct<{
6125
6157
  readonly id: import("effect/Schema").brand<import("effect/Schema").String, "Event.ID"> & {
6126
6158
  create: () => string & import("effect/Brand").Brand<"Event.ID">;
@@ -8178,6 +8210,18 @@ export declare const Api: import("@opencode/protocol/api").Api<LocationMiddlewar
8178
8210
  readonly cursor: string | null;
8179
8211
  readonly truncated?: boolean | undefined;
8180
8212
  };
8213
+ } | {
8214
+ readonly id: string & import("effect/Brand").Brand<"Event.ID">;
8215
+ readonly created: number;
8216
+ readonly metadata?: {
8217
+ readonly [x: string]: unknown;
8218
+ } | undefined;
8219
+ readonly type: "experimental.push.updated";
8220
+ readonly location?: {
8221
+ readonly directory: string & import("effect/Brand").Brand<"AbsolutePath">;
8222
+ readonly workspaceID?: (string & import("effect/Brand").Brand<"Workspace.ID">) | undefined;
8223
+ } | undefined;
8224
+ readonly data: {};
8181
8225
  } | {
8182
8226
  readonly id: string & import("effect/Brand").Brand<"Event.ID">;
8183
8227
  readonly created: number;
package/dist/api.js CHANGED
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  Api2
3
- } from "./chunks/content-headers-zjmacp9c.js";
4
- import"./chunks/content-headers-vw0q3knq.js";
5
- import"./chunks/content-headers-ah2sj2pr.js";
6
- import"./chunks/content-headers-ywn523ee.js";
7
- import"./chunks/content-headers-smaf4a18.js";
3
+ } from "./chunks/range-ay32z58n.js";
4
+ import"./chunks/range-aexh791j.js";
5
+ import"./chunks/range-jy2ammbg.js";
6
+ import"./chunks/range-stx1bw5w.js";
7
+ import"./chunks/range-rqgv9x42.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/content-headers-j4at0y5c.js";
10
+ } from "./chunks/range-j4at0y5c.js";
11
11
  export {
12
12
  Config2 as Config,
13
13
  SESSION_TTL_SECONDS2 as SESSION_TTL_SECONDS,
@@ -171,7 +171,7 @@ var makeMachine2 = Effect.gen(function* () {
171
171
  add: Effect.fn("MachineHandler.add")(function* (payload) {
172
172
  yield* requireEnabled;
173
173
  const id = yield* machines.add(payload.name).pipe(Effect.catchTag("Machines.AlreadyExists", (error) => Effect.succeed(error.machine)), Effect.catchTag("Machines.InvalidName", (error) => Effect.fail(new InvalidRequestError({ message: error.message, kind: "invalid_name", field: "name" }))));
174
- const reach = Option.isSome(yield* iroh) ? [...payload.reach, { type: "iroh" }] : payload.reach;
174
+ const reach = Option.isSome(yield* iroh) ? [{ type: "iroh" }, ...payload.reach] : payload.reach;
175
175
  const join = yield* machines.invite(id, { reach, replace: payload.replace }).pipe(Effect.catchTags({
176
176
  "Machines.AlreadyPaired": (error) => Effect.fail(new ConflictError({ message: error.message, resource: error.machine })),
177
177
  "Machines.NotFound": (error) => Effect.fail(new MachineNotFoundError({ machine: error.machine, message: error.message })),
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  Api2
3
- } from "./content-headers-zjmacp9c.js";
3
+ } from "./range-ay32z58n.js";
4
4
  import {
5
5
  requireConnectable2
6
- } from "./content-headers-hk9crnsa.js";
6
+ } from "./range-9agv2b4c.js";
7
7
 
8
8
  // src/handlers/credential.ts
9
9
  import { Credential } from "@opencode/core/credential";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  __export
3
- } from "./content-headers-9rqn6x4v.js";
3
+ } from "./range-9rqn6x4v.js";
4
4
 
5
5
  // src/service-status.ts
6
6
  var exports_service_status = {};
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  response2
3
- } from "./content-headers-ywn523ee.js";
3
+ } from "./range-stx1bw5w.js";
4
4
  import {
5
5
  Api2
6
- } from "./content-headers-zjmacp9c.js";
6
+ } from "./range-ay32z58n.js";
7
7
 
8
8
  // src/handlers/shell.ts
9
9
  import { Shell } from "@opencode/core/shell";
@@ -1,22 +1,22 @@
1
1
  import {
2
2
  __export
3
- } from "./content-headers-9rqn6x4v.js";
3
+ } from "./range-9rqn6x4v.js";
4
4
 
5
5
  // src/server-info.ts
6
6
  var exports_server_info = {};
7
7
  __export(exports_server_info, {
8
8
  ServerInfo: () => exports_server_info,
9
- Service: () => Service2,
9
+ Service: () => Service3,
10
10
  connectionURLs: () => connectionURLs2,
11
- layer: () => layer2
11
+ layer: () => layer3
12
12
  });
13
13
  import { Context, Layer } from "effect";
14
14
  import { networkInterfaces } from "node:os";
15
15
 
16
- class Service2 extends Context.Service()("@opencode/server/ServerInfo") {
16
+ class Service3 extends Context.Service()("@opencode/server/ServerInfo") {
17
17
  }
18
- function layer2(urls, tmp, app = {}) {
19
- return Layer.succeed(Service2, Service2.of({ urls, app, paths: { tmp } }));
18
+ function layer3(urls, tmp, app = {}) {
19
+ return Layer.succeed(Service3, Service3.of({ urls, app, paths: { tmp } }));
20
20
  }
21
21
  function connectionURLs2(value, requestedHostname) {
22
22
  const url = new URL(value);
@@ -38,4 +38,4 @@ function connectionURLs2(value, requestedHostname) {
38
38
  ];
39
39
  }
40
40
 
41
- export { Service2, layer2, connectionURLs2, exports_server_info };
41
+ export { Service3, layer3, connectionURLs2, exports_server_info };
@@ -2,18 +2,18 @@ import {
2
2
  locationErrors2,
3
3
  response2,
4
4
  requestRef2
5
- } from "./content-headers-ywn523ee.js";
5
+ } from "./range-stx1bw5w.js";
6
6
  import {
7
7
  Api2
8
- } from "./content-headers-zjmacp9c.js";
8
+ } from "./range-ay32z58n.js";
9
9
  import {
10
10
  CorsConfig2,
11
11
  isAllowedRequestOrigin2
12
- } from "./content-headers-q4bn6dy8.js";
12
+ } from "./range-q4bn6dy8.js";
13
13
  import {
14
14
  runPtySocket2,
15
15
  holdLocation2
16
- } from "./content-headers-q187pxxd.js";
16
+ } from "./range-q187pxxd.js";
17
17
 
18
18
  // src/handlers/pty.ts
19
19
  import { Pty } from "@opencode/core/pty";
@@ -0,0 +1,48 @@
1
+ import {
2
+ missingSession2
3
+ } from "./range-rqgv9x42.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
  response2
3
- } from "./content-headers-ywn523ee.js";
3
+ } from "./range-stx1bw5w.js";
4
4
  import {
5
5
  Api2
6
- } from "./content-headers-zjmacp9c.js";
6
+ } from "./range-ay32z58n.js";
7
7
 
8
8
  // src/handlers/plugin.ts
9
9
  import { Plugin } from "@opencode/core/plugin";
@@ -1,32 +1,35 @@
1
1
  import {
2
2
  Api2
3
- } from "./content-headers-zjmacp9c.js";
3
+ } from "./range-ay32z58n.js";
4
4
  import {
5
5
  CorsConfig2,
6
6
  isAllowedRequestOrigin2
7
- } from "./content-headers-q4bn6dy8.js";
7
+ } from "./range-q4bn6dy8.js";
8
8
  import {
9
9
  makeArtifact2
10
- } from "./content-headers-7qpea5x7.js";
10
+ } from "./range-sqfq92mf.js";
11
11
  import {
12
12
  makeBlobGet2
13
- } from "./content-headers-g23ffrnz.js";
13
+ } from "./range-g23ffrnz.js";
14
14
  import {
15
15
  makeAutomation2
16
- } from "./content-headers-9cd3a4b8.js";
16
+ } from "./range-6pm6ek88.js";
17
17
  import {
18
18
  makeJob2
19
- } from "./content-headers-7ydfwv45.js";
19
+ } from "./range-x2qy7jg1.js";
20
20
  import {
21
21
  makeMachineLink2,
22
22
  makeMachine2
23
- } from "./content-headers-0rzj25w4.js";
23
+ } from "./range-017ycvbx.js";
24
24
  import {
25
25
  makeMediaGet2
26
- } from "./content-headers-djr0jy89.js";
26
+ } from "./range-djr0jy89.js";
27
+ import {
28
+ makePush2
29
+ } from "./range-qpnw2qd1.js";
27
30
  import {
28
31
  runPtySocket2
29
- } from "./content-headers-q187pxxd.js";
32
+ } from "./range-q187pxxd.js";
30
33
 
31
34
  // src/handlers/persistent-pty.ts
32
35
  import { PersistentPty } from "@opencode/core/persistent-pty";
@@ -57,7 +60,8 @@ var PersistentPtyHandler2 = HttpApiBuilder.group(Api2, "server.experimental", (h
57
60
  const automation = yield* makeAutomation2;
58
61
  const machine = yield* makeMachine2;
59
62
  const machineLink = yield* makeMachineLink2;
60
- return handlers.handleRaw("media.get", (ctx) => mediaGet(ctx.params.hash, ctx.request)).handleRaw("blob.get", (ctx) => blobGet(ctx.params.id, ctx.request)).handle("job.list", (ctx) => job.list(ctx.query)).handle("job.cancel", (ctx) => job.cancel(ctx.params.id)).handleRaw("machine.link", (ctx) => machineLink(ctx.request)).handle("machine.list", () => machine.list()).handle("machine.add", (ctx) => machine.add(ctx.payload)).handle("machine.remove", (ctx) => machine.remove(ctx.params.name)).handle("artifacts.providers", (ctx) => artifact.providers(ctx.query, ctx.request)).handle("artifacts.list", (ctx) => artifact.list(ctx.query, ctx.request)).handle("artifacts.create", (ctx) => artifact.create(ctx.query, ctx.payload, ctx.request)).handle("artifacts.get", (ctx) => artifact.get(ctx.params.artifactID, ctx.query, ctx.request)).handle("artifacts.update", (ctx) => artifact.update(ctx.params.artifactID, ctx.query, ctx.payload, ctx.request)).handle("artifacts.delete", (ctx) => artifact.remove(ctx.params.artifactID, ctx.query, ctx.request)).handleRaw("artifacts.view", (ctx) => artifact.view(ctx.params.artifactID, ctx.query, ctx.request)).handle("automation.create", (ctx) => automation.create(ctx.payload)).handle("automation.list", (ctx) => automation.list(ctx.query)).handle("automation.get", (ctx) => automation.get(ctx.params.automationID)).handle("automation.pause", (ctx) => automation.pause(ctx.params.automationID)).handle("automation.resume", (ctx) => automation.resume(ctx.params.automationID)).handle("automation.delete", (ctx) => automation.remove(ctx.params.automationID)).handle("persistentPty.read", Effect.fn(function* (ctx) {
63
+ const push = yield* makePush2;
64
+ return handlers.handleRaw("media.get", (ctx) => mediaGet(ctx.params.hash, ctx.request)).handleRaw("blob.get", (ctx) => blobGet(ctx.params.id, ctx.request)).handle("job.list", (ctx) => job.list(ctx.query)).handle("job.cancel", (ctx) => job.cancel(ctx.params.id)).handleRaw("machine.link", (ctx) => machineLink(ctx.request)).handle("machine.list", () => machine.list()).handle("machine.add", (ctx) => machine.add(ctx.payload)).handle("machine.remove", (ctx) => machine.remove(ctx.params.name)).handle("push.get", () => push.get()).handle("push.device.register", (ctx) => push.register(ctx.params.deviceID, ctx.payload)).handle("push.device.remove", (ctx) => push.remove(ctx.params.deviceID)).handle("push.device.update", (ctx) => push.update(ctx.params.deviceID, ctx.payload)).handle("push.device.session.set", (ctx) => push.setDeviceBell(ctx.params.deviceID, ctx.params.sessionID, ctx.payload)).handle("push.device.session.remove", (ctx) => push.removeDeviceBell(ctx.params.deviceID, ctx.params.sessionID)).handle("push.session.set", (ctx) => push.setSessionBell(ctx.params.sessionID, ctx.payload)).handle("push.session.remove", (ctx) => push.removeSessionBell(ctx.params.sessionID)).handle("push.settings.set", (ctx) => push.setSettings(ctx.payload)).handle("artifacts.providers", (ctx) => artifact.providers(ctx.query, ctx.request)).handle("artifacts.list", (ctx) => artifact.list(ctx.query, ctx.request)).handle("artifacts.create", (ctx) => artifact.create(ctx.query, ctx.payload, ctx.request)).handle("artifacts.get", (ctx) => artifact.get(ctx.params.artifactID, ctx.query, ctx.request)).handle("artifacts.update", (ctx) => artifact.update(ctx.params.artifactID, ctx.query, ctx.payload, ctx.request)).handle("artifacts.delete", (ctx) => artifact.remove(ctx.params.artifactID, ctx.query, ctx.request)).handleRaw("artifacts.view", (ctx) => artifact.view(ctx.params.artifactID, ctx.query, ctx.request)).handle("automation.create", (ctx) => automation.create(ctx.payload)).handle("automation.list", (ctx) => automation.list(ctx.query)).handle("automation.get", (ctx) => automation.get(ctx.params.automationID)).handle("automation.pause", (ctx) => automation.pause(ctx.params.automationID)).handle("automation.resume", (ctx) => automation.resume(ctx.params.automationID)).handle("automation.delete", (ctx) => automation.remove(ctx.params.automationID)).handle("persistentPty.read", Effect.fn(function* (ctx) {
61
65
  return { data: yield* pty.read(ctx.params.sessionID, ctx.query.lines).pipe(mapUnavailable) };
62
66
  })).handle("persistentPty.list", Effect.fn(function* (ctx) {
63
67
  return { data: yield* pty.list(ctx.params.sessionID).pipe(mapUnavailable) };
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  response2
3
- } from "./content-headers-ywn523ee.js";
3
+ } from "./range-stx1bw5w.js";
4
4
  import {
5
5
  Api2
6
- } from "./content-headers-zjmacp9c.js";
6
+ } from "./range-ay32z58n.js";
7
7
 
8
8
  // src/handlers/websearch.ts
9
9
  import { WebSearch } from "@opencode/core/websearch";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  __export
3
- } from "./content-headers-9rqn6x4v.js";
3
+ } from "./range-9rqn6x4v.js";
4
4
 
5
5
  // src/range.ts
6
6
  var exports_range = {};
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  response2
3
- } from "./content-headers-ywn523ee.js";
3
+ } from "./range-stx1bw5w.js";
4
4
  import {
5
5
  Api2
6
- } from "./content-headers-zjmacp9c.js";
6
+ } from "./range-ay32z58n.js";
7
7
 
8
8
  // src/handlers/integration.ts
9
9
  import { Integration } from "@opencode/core/integration";
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  locationErrors2,
3
3
  sessionInfo2
4
- } from "./content-headers-ywn523ee.js";
4
+ } from "./range-stx1bw5w.js";
5
5
 
6
6
  // src/middleware/session-location.ts
7
7
  import { Instance } from "@opencode/core/instance/service";
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  response2
3
- } from "./content-headers-ywn523ee.js";
3
+ } from "./range-stx1bw5w.js";
4
4
  import {
5
5
  Api2
6
- } from "./content-headers-zjmacp9c.js";
6
+ } from "./range-ay32z58n.js";
7
7
 
8
8
  // src/handlers/form.ts
9
9
  import { Form } from "@opencode/core/form";
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  LocationMiddleware2
3
- } from "./content-headers-ywn523ee.js";
3
+ } from "./range-stx1bw5w.js";
4
4
  import {
5
5
  FormLocationMiddleware2
6
- } from "./content-headers-ah2sj2pr.js";
6
+ } from "./range-jy2ammbg.js";
7
7
  import {
8
8
  SessionLocationMiddleware2
9
- } from "./content-headers-vw0q3knq.js";
9
+ } from "./range-aexh791j.js";
10
10
 
11
11
  // src/api.ts
12
12
  import { makeDefaultApi } from "@opencode/protocol/api";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  Api2
3
- } from "./content-headers-zjmacp9c.js";
3
+ } from "./range-ay32z58n.js";
4
4
 
5
5
  // src/handlers/migration.ts
6
6
  import { V1Migration } from "@opencode/core/database/v1-migration";
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  requestRef2
3
- } from "./content-headers-ywn523ee.js";
3
+ } from "./range-stx1bw5w.js";
4
4
  import {
5
5
  Api2
6
- } from "./content-headers-zjmacp9c.js";
6
+ } from "./range-ay32z58n.js";
7
7
 
8
8
  // src/handlers/debug.ts
9
9
  import { LocationServiceMap } from "@opencode/core/location-service-map";
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  missingSession2,
3
3
  failedMessageDecode2
4
- } from "./content-headers-smaf4a18.js";
4
+ } from "./range-rqgv9x42.js";
5
5
  import {
6
6
  Api2
7
- } from "./content-headers-zjmacp9c.js";
7
+ } from "./range-ay32z58n.js";
8
8
  import {
9
9
  wantsMediaRefs2
10
- } from "./content-headers-xthc02cw.js";
10
+ } from "./range-xthc02cw.js";
11
11
 
12
12
  // src/handlers/message.ts
13
13
  import { SessionMessage } from "@opencode/core/session/message";
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  CONTENT_SECURITY_POLICY2,
3
3
  disposition2
4
- } from "./content-headers-t32e1bbt.js";
4
+ } from "./range-t32e1bbt.js";
5
5
 
6
6
  // src/handlers/media.ts
7
7
  import { Database } from "@opencode/core/database/database";
@@ -0,0 +1,27 @@
1
+ import {
2
+ response2
3
+ } from "./range-stx1bw5w.js";
4
+ import {
5
+ Api2
6
+ } from "./range-ay32z58n.js";
7
+
8
+ // src/handlers/skill.ts
9
+ import { Skill } from "@opencode/core/skill";
10
+ import { FileNotFoundError, SkillLoadError, SkillNotFoundError } from "@opencode/protocol/errors";
11
+ import { Effect } from "effect";
12
+ import { HttpApiBuilder } from "effect/http-api";
13
+ var SkillHandler2 = HttpApiBuilder.group(Api2, "server.skill", (handlers) => handlers.handle("skill.list", () => response2(Skill.Service.use((skill) => skill.list()))).handle("skill.file", (ctx) => Effect.gen(function* () {
14
+ const skills = yield* Skill.Service;
15
+ const raw = new URL(ctx.request.url, "http://localhost").pathname.split("/").slice(6).join("/");
16
+ const file = yield* Effect.try({
17
+ try: () => decodeURIComponent(raw),
18
+ catch: () => new FileNotFoundError({ path: raw, message: `File not found: ${raw}` })
19
+ });
20
+ return yield* skills.read(ctx.params.skillID, file).pipe(Effect.catchTags({
21
+ "Skill.NotFoundError": (error) => Effect.fail(new SkillNotFoundError({ skill: ctx.params.skillID, message: `Skill not found: ${error.skill}` })),
22
+ "Skill.FileNotFoundError": (error) => Effect.fail(new FileNotFoundError({ path: error.file, message: `File not found: ${error.file}` })),
23
+ "Skill.LoadError": (error) => Effect.fail(new SkillLoadError({ skill: ctx.params.skillID, message: error.message }))
24
+ }));
25
+ })));
26
+
27
+ export { SkillHandler2 };
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  response2
3
- } from "./content-headers-ywn523ee.js";
3
+ } from "./range-stx1bw5w.js";
4
4
  import {
5
5
  Api2
6
- } from "./content-headers-zjmacp9c.js";
6
+ } from "./range-ay32z58n.js";
7
7
 
8
8
  // src/handlers/model.ts
9
9
  import { Model } from "@opencode/core/model";
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  download2
3
- } from "./content-headers-t32e1bbt.js";
3
+ } from "./range-t32e1bbt.js";
4
4
  import {
5
5
  parse2
6
- } from "./content-headers-8sb6qqpn.js";
6
+ } from "./range-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 "./content-headers-zjmacp9c.js";
3
+ } from "./range-ay32z58n.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
  locationErrors2
3
- } from "./content-headers-ywn523ee.js";
3
+ } from "./range-stx1bw5w.js";
4
4
  import {
5
5
  Api2
6
- } from "./content-headers-zjmacp9c.js";
6
+ } from "./range-ay32z58n.js";
7
7
 
8
8
  // src/handlers/voice.ts
9
9
  import { Location } from "@opencode/core/location";
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  response2
3
- } from "./content-headers-ywn523ee.js";
3
+ } from "./range-stx1bw5w.js";
4
4
  import {
5
5
  Api2
6
- } from "./content-headers-zjmacp9c.js";
6
+ } from "./range-ay32z58n.js";
7
7
 
8
8
  // src/handlers/provider.ts
9
9
  import { Provider } from "@opencode/core/provider";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  __export
3
- } from "./content-headers-9rqn6x4v.js";
3
+ } from "./range-9rqn6x4v.js";
4
4
 
5
5
  // src/auth.ts
6
6
  var exports_auth = {};
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  locationErrors2
3
- } from "./content-headers-ywn523ee.js";
3
+ } from "./range-stx1bw5w.js";
4
4
  import {
5
5
  Api2
6
- } from "./content-headers-zjmacp9c.js";
6
+ } from "./range-ay32z58n.js";
7
7
 
8
8
  // src/handlers/generate.ts
9
9
  import { Generate } from "@opencode/core/generate";
@@ -2,7 +2,7 @@ import {
2
2
  locationErrors2,
3
3
  sessionInfo2,
4
4
  requestRef2
5
- } from "./content-headers-ywn523ee.js";
5
+ } from "./range-stx1bw5w.js";
6
6
 
7
7
  // src/middleware/form-location.ts
8
8
  import { Instance } from "@opencode/core/instance/service";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  Api2
3
- } from "./content-headers-zjmacp9c.js";
3
+ } from "./range-ay32z58n.js";
4
4
 
5
5
  // src/handlers/config.ts
6
6
  import { Config } from "@opencode/core/config";
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  response2
3
- } from "./content-headers-ywn523ee.js";
3
+ } from "./range-stx1bw5w.js";
4
4
  import {
5
5
  Api2
6
- } from "./content-headers-zjmacp9c.js";
6
+ } from "./range-ay32z58n.js";
7
7
 
8
8
  // src/handlers/reference.ts
9
9
  import { Reference } from "@opencode/core/reference";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  Api2
3
- } from "./content-headers-zjmacp9c.js";
3
+ } from "./range-ay32z58n.js";
4
4
 
5
5
  // src/handlers/project.ts
6
6
  import { Project } from "@opencode/core/project";