@opencode/server 0.0.0-dev-368 → 0.0.0-dev-377

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 (117) hide show
  1. package/dist/api.d.ts +175 -1
  2. package/dist/api.js +5 -5
  3. package/dist/auth.js +1 -1
  4. package/dist/chunks/{cors-059rbh9c.js → options-059rbh9c.js} +1 -1
  5. package/dist/chunks/{cors-dk68ymtv.js → options-05c5061t.js} +1 -1
  6. package/dist/chunks/{cors-9c4eyh8m.js → options-0e81et3m.js} +3 -3
  7. package/dist/chunks/{cors-r6vmgwff.js → options-0ey2b45p.js} +2 -2
  8. package/dist/chunks/{cors-prdak4hd.js → options-0fggwqem.js} +2 -2
  9. package/dist/chunks/options-0fv515j7.js +144 -0
  10. package/dist/chunks/{cors-c6sjpm0r.js → options-0j6zxxn8.js} +2 -2
  11. package/dist/chunks/{cors-2xcc0x05.js → options-0n4tjm17.js} +1 -1
  12. package/dist/chunks/{cors-e6e4kz0w.js → options-0q7s66m2.js} +4 -4
  13. package/dist/chunks/{cors-b5vdqx3g.js → options-2wexxjwf.js} +2 -2
  14. package/dist/chunks/{cors-b1prsepx.js → options-3te71694.js} +4 -4
  15. package/dist/chunks/{cors-r6xthn22.js → options-3vkp0p8t.js} +17 -15
  16. package/dist/chunks/{cors-0a5jm2na.js → options-4p2y0qs3.js} +2 -2
  17. package/dist/chunks/{cors-gqq6kfhc.js → options-50bbk3b2.js} +3 -3
  18. package/dist/chunks/{cors-7b9xm1qg.js → options-7b9xm1qg.js} +1 -1
  19. package/dist/chunks/{cors-j9gxd9me.js → options-89egwzf3.js} +2 -2
  20. package/dist/chunks/{cors-hax1v4bv.js → options-9grnt8dc.js} +2 -2
  21. package/dist/chunks/{cors-xm1s9q2w.js → options-abb7amja.js} +3 -3
  22. package/dist/chunks/{cors-zgt2tacv.js → options-ap1t95t8.js} +3 -3
  23. package/dist/chunks/{cors-yet0vexm.js → options-b3bmdkga.js} +1 -1
  24. package/dist/chunks/{cors-z59gyc0x.js → options-b4mqtccx.js} +2 -2
  25. package/dist/chunks/{cors-e46y0tfd.js → options-dx89xydc.js} +2 -2
  26. package/dist/chunks/{cors-fvpjvjpp.js → options-e0ppd0jy.js} +5 -5
  27. package/dist/chunks/{cors-wxj3d9av.js → options-et00mhwf.js} +2 -2
  28. package/dist/chunks/{cors-rztv1fyf.js → options-f2m3ds36.js} +4 -4
  29. package/dist/chunks/{cors-22wspztn.js → options-f8r9p2vr.js} +2 -2
  30. package/dist/chunks/{cors-x8dgc261.js → options-h1thjy6x.js} +2 -2
  31. package/dist/chunks/{cors-gk0yxcp6.js → options-htyf2qs7.js} +1 -1
  32. package/dist/chunks/{cors-b2k9041j.js → options-hx8bsq9d.js} +1 -1
  33. package/dist/chunks/{cors-j4at0y5c.js → options-j4at0y5c.js} +1 -1
  34. package/dist/chunks/{cors-kffvskmv.js → options-jydxnq20.js} +4 -4
  35. package/dist/chunks/{cors-ppma8fcc.js → options-kg0ybx4v.js} +3 -3
  36. package/dist/chunks/{cors-mzs0n5xz.js → options-mzs0n5xz.js} +1 -1
  37. package/dist/chunks/{cors-zrprg5z5.js → options-n1zdbfv7.js} +2 -2
  38. package/dist/chunks/{cors-xe9t9xr4.js → options-nz17qv97.js} +2 -2
  39. package/dist/chunks/{cors-6vs5sqy6.js → options-q44yktpv.js} +2 -2
  40. package/dist/chunks/{cors-h9rcwvg0.js → options-r6xkfcdx.js} +1 -1
  41. package/dist/chunks/{cors-hnheq3hv.js → options-s62wjkvx.js} +2 -2
  42. package/dist/chunks/{cors-yr4wsvrw.js → options-s9tkswmw.js} +2 -2
  43. package/dist/chunks/{cors-ckkpcd9y.js → options-t7vhq1fh.js} +4 -4
  44. package/dist/chunks/{cors-m5rae7m4.js → options-v8aqacn3.js} +2 -2
  45. package/dist/chunks/{cors-qn8kkfq6.js → options-vbgqk0mr.js} +2 -2
  46. package/dist/chunks/{cors-gsyfxrkq.js → options-x2df6xnx.js} +27 -9
  47. package/dist/chunks/{cors-1je14sn4.js → options-x4b2rtcb.js} +1 -1
  48. package/dist/chunks/{cors-5hx85a1p.js → options-z2dy5af2.js} +4 -4
  49. package/dist/chunks/{cors-mfe5g848.js → options-z4ww4dje.js} +33 -33
  50. package/dist/chunks/{cors-h072q2hm.js → options-zbe9jfhy.js} +1 -1
  51. package/dist/cors.js +1 -1
  52. package/dist/event-feed.js +3 -3
  53. package/dist/fetch.js +52 -51
  54. package/dist/handlers/agent.js +6 -6
  55. package/dist/handlers/artifact.d.ts +62 -0
  56. package/dist/handlers/artifact.js +8 -0
  57. package/dist/handlers/command.js +6 -6
  58. package/dist/handlers/config.js +6 -6
  59. package/dist/handlers/credential.js +7 -7
  60. package/dist/handlers/debug.js +6 -6
  61. package/dist/handlers/event.js +7 -7
  62. package/dist/handlers/form.js +6 -6
  63. package/dist/handlers/fs.js +6 -6
  64. package/dist/handlers/generate.js +6 -6
  65. package/dist/handlers/integration.js +6 -6
  66. package/dist/handlers/location.js +6 -6
  67. package/dist/handlers/mcp.js +8 -8
  68. package/dist/handlers/media.js +1 -1
  69. package/dist/handlers/message.js +7 -7
  70. package/dist/handlers/migration.js +6 -6
  71. package/dist/handlers/model.js +6 -6
  72. package/dist/handlers/permission.js +6 -6
  73. package/dist/handlers/persistent-pty.d.ts +1 -1
  74. package/dist/handlers/persistent-pty.js +11 -10
  75. package/dist/handlers/plugin.js +6 -6
  76. package/dist/handlers/project.js +6 -6
  77. package/dist/handlers/provider.js +6 -6
  78. package/dist/handlers/pty-socket.js +1 -1
  79. package/dist/handlers/pty.js +8 -8
  80. package/dist/handlers/reference.js +6 -6
  81. package/dist/handlers/rpc.js +6 -6
  82. package/dist/handlers/schedule.js +2 -2
  83. package/dist/handlers/server.js +9 -9
  84. package/dist/handlers/session-error.js +1 -1
  85. package/dist/handlers/session.js +7 -7
  86. package/dist/handlers/shell.js +6 -6
  87. package/dist/handlers/skill.js +6 -6
  88. package/dist/handlers/usage.js +6 -6
  89. package/dist/handlers/vcs.js +6 -6
  90. package/dist/handlers/voice.js +6 -6
  91. package/dist/handlers/websearch.js +6 -6
  92. package/dist/handlers/worktree.js +6 -6
  93. package/dist/handlers.d.ts +1 -1
  94. package/dist/handlers.js +48 -47
  95. package/dist/location.js +4 -4
  96. package/dist/media-uri.js +1 -1
  97. package/dist/middleware/authorization.js +2 -2
  98. package/dist/middleware/form-location.js +3 -3
  99. package/dist/middleware/schema-error.js +1 -1
  100. package/dist/middleware/session-location.js +3 -3
  101. package/dist/pairing.js +1 -1
  102. package/dist/process.js +57 -56
  103. package/dist/request-tracing.js +1 -1
  104. package/dist/routes.d.ts +3 -2
  105. package/dist/routes.js +51 -50
  106. package/dist/server-info.js +3 -3
  107. package/dist/service-status.js +3 -3
  108. package/dist/workerd.js +53 -52
  109. package/package.json +9 -9
  110. /package/dist/chunks/{cors-9rqn6x4v.js → options-9rqn6x4v.js} +0 -0
  111. /package/dist/chunks/{cors-bd8755ek.js → options-bd8755ek.js} +0 -0
  112. /package/dist/chunks/{cors-h6rt5k9s.js → options-h6rt5k9s.js} +0 -0
  113. /package/dist/chunks/{cors-n321d8vm.js → options-n321d8vm.js} +0 -0
  114. /package/dist/chunks/{cors-q4bn6dy8.js → options-q4bn6dy8.js} +0 -0
  115. /package/dist/chunks/{cors-smaf4a18.js → options-smaf4a18.js} +0 -0
  116. /package/dist/chunks/{cors-xthc02cw.js → options-xthc02cw.js} +0 -0
  117. /package/dist/chunks/{cors-yc7nft6q.js → options-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" | "command.updated" | "config.updated" | "credential.switched" | "credential.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" | "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.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" | "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.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">;
@@ -5126,6 +5126,7 @@ export declare const Api: import("@opencode/protocol/api").Api<LocationMiddlewar
5126
5126
  readonly sessionID: import("effect/Schema").brand<import("effect/Schema").String, "SessionID"> & {
5127
5127
  create: () => string & import("effect/Brand").Brand<"SessionID">;
5128
5128
  };
5129
+ readonly userTitle: import("effect/Schema").NullOr<import("effect/Schema").String>;
5129
5130
  readonly foregroundProcess: import("effect/Schema").NullOr<import("effect/Schema").String>;
5130
5131
  readonly size: import("effect/Schema").Struct<{
5131
5132
  readonly cols: import("effect/Schema").Int;
@@ -5160,6 +5161,7 @@ export declare const Api: import("@opencode/protocol/api").Api<LocationMiddlewar
5160
5161
  readonly sessionID: import("effect/Schema").brand<import("effect/Schema").String, "SessionID"> & {
5161
5162
  create: () => string & import("effect/Brand").Brand<"SessionID">;
5162
5163
  };
5164
+ readonly userTitle: import("effect/Schema").NullOr<import("effect/Schema").String>;
5163
5165
  readonly foregroundProcess: import("effect/Schema").NullOr<import("effect/Schema").String>;
5164
5166
  readonly size: import("effect/Schema").Struct<{
5165
5167
  readonly cols: import("effect/Schema").Int;
@@ -5219,6 +5221,98 @@ export declare const Api: import("@opencode/protocol/api").Api<LocationMiddlewar
5219
5221
  ascending: (id?: string) => string & import("effect/Brand").Brand<"PtyID">;
5220
5222
  };
5221
5223
  }>;
5224
+ }, import("effect/Schema").Struct<{
5225
+ readonly id: import("effect/Schema").brand<import("effect/Schema").String, "Event.ID"> & {
5226
+ create: () => string & import("effect/Brand").Brand<"Event.ID">;
5227
+ };
5228
+ readonly created: import("effect/Schema").Finite;
5229
+ 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>;
5230
+ readonly type: import("effect/Schema").Literal<"persistent-pty.updated">;
5231
+ readonly location: import("effect/Schema").decodeTo<import("effect/Schema").optional<import("effect/Schema").toType<import("effect/Schema").Struct<{
5232
+ readonly directory: import("effect/Schema").brand<import("effect/Schema").String, "AbsolutePath">;
5233
+ readonly workspaceID: import("effect/Schema").decodeTo<import("effect/Schema").optional<import("effect/Schema").toType<import("effect/Schema").brand<import("effect/Schema").String, "Workspace.ID"> & {
5234
+ ascending: (id?: string) => string & import("effect/Brand").Brand<"Workspace.ID">;
5235
+ create: () => string & import("effect/Brand").Brand<"Workspace.ID">;
5236
+ }>>, import("effect/Schema").optionalKey<import("effect/Schema").brand<import("effect/Schema").String, "Workspace.ID"> & {
5237
+ ascending: (id?: string) => string & import("effect/Brand").Brand<"Workspace.ID">;
5238
+ create: () => string & import("effect/Brand").Brand<"Workspace.ID">;
5239
+ }>, never, never>;
5240
+ }>>>, import("effect/Schema").optionalKey<import("effect/Schema").Struct<{
5241
+ readonly directory: import("effect/Schema").brand<import("effect/Schema").String, "AbsolutePath">;
5242
+ readonly workspaceID: import("effect/Schema").decodeTo<import("effect/Schema").optional<import("effect/Schema").toType<import("effect/Schema").brand<import("effect/Schema").String, "Workspace.ID"> & {
5243
+ ascending: (id?: string) => string & import("effect/Brand").Brand<"Workspace.ID">;
5244
+ create: () => string & import("effect/Brand").Brand<"Workspace.ID">;
5245
+ }>>, import("effect/Schema").optionalKey<import("effect/Schema").brand<import("effect/Schema").String, "Workspace.ID"> & {
5246
+ ascending: (id?: string) => string & import("effect/Brand").Brand<"Workspace.ID">;
5247
+ create: () => string & import("effect/Brand").Brand<"Workspace.ID">;
5248
+ }>, never, never>;
5249
+ }>>, never, never>;
5250
+ readonly data: import("effect/Schema").Struct<{
5251
+ readonly sessionID: import("effect/Schema").brand<import("effect/Schema").String, "SessionID"> & {
5252
+ create: () => string & import("effect/Brand").Brand<"SessionID">;
5253
+ };
5254
+ readonly terminal: import("effect/Schema").Struct<{
5255
+ readonly id: import("effect/Schema").brand<import("effect/Schema").String, "PtyID"> & {
5256
+ create: () => string & import("effect/Brand").Brand<"PtyID">;
5257
+ ascending: (id?: string) => string & import("effect/Brand").Brand<"PtyID">;
5258
+ };
5259
+ readonly title: import("effect/Schema").String;
5260
+ readonly command: import("effect/Schema").String;
5261
+ readonly args: import("effect/Schema").$Array<import("effect/Schema").String>;
5262
+ readonly cwd: import("effect/Schema").String;
5263
+ readonly status: import("effect/Schema").Literals<readonly ["running", "exited"]>;
5264
+ readonly pid: import("effect/Schema").Int;
5265
+ readonly exitCode: 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>;
5266
+ readonly sessionID: import("effect/Schema").brand<import("effect/Schema").String, "SessionID"> & {
5267
+ create: () => string & import("effect/Brand").Brand<"SessionID">;
5268
+ };
5269
+ readonly userTitle: import("effect/Schema").NullOr<import("effect/Schema").String>;
5270
+ readonly foregroundProcess: import("effect/Schema").NullOr<import("effect/Schema").String>;
5271
+ readonly size: import("effect/Schema").Struct<{
5272
+ readonly cols: import("effect/Schema").Int;
5273
+ readonly rows: import("effect/Schema").Int;
5274
+ }>;
5275
+ readonly output: import("effect/Schema").Struct<{
5276
+ readonly head: import("effect/Schema").Int;
5277
+ readonly tail: import("effect/Schema").Int;
5278
+ }>;
5279
+ }>;
5280
+ }>;
5281
+ }> & {
5282
+ type: "persistent-pty.updated";
5283
+ durability: "ephemeral";
5284
+ durable: undefined;
5285
+ data: import("effect/Schema").Struct<{
5286
+ readonly sessionID: import("effect/Schema").brand<import("effect/Schema").String, "SessionID"> & {
5287
+ create: () => string & import("effect/Brand").Brand<"SessionID">;
5288
+ };
5289
+ readonly terminal: import("effect/Schema").Struct<{
5290
+ readonly id: import("effect/Schema").brand<import("effect/Schema").String, "PtyID"> & {
5291
+ create: () => string & import("effect/Brand").Brand<"PtyID">;
5292
+ ascending: (id?: string) => string & import("effect/Brand").Brand<"PtyID">;
5293
+ };
5294
+ readonly title: import("effect/Schema").String;
5295
+ readonly command: import("effect/Schema").String;
5296
+ readonly args: import("effect/Schema").$Array<import("effect/Schema").String>;
5297
+ readonly cwd: import("effect/Schema").String;
5298
+ readonly status: import("effect/Schema").Literals<readonly ["running", "exited"]>;
5299
+ readonly pid: import("effect/Schema").Int;
5300
+ readonly exitCode: 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>;
5301
+ readonly sessionID: import("effect/Schema").brand<import("effect/Schema").String, "SessionID"> & {
5302
+ create: () => string & import("effect/Brand").Brand<"SessionID">;
5303
+ };
5304
+ readonly userTitle: import("effect/Schema").NullOr<import("effect/Schema").String>;
5305
+ readonly foregroundProcess: import("effect/Schema").NullOr<import("effect/Schema").String>;
5306
+ readonly size: import("effect/Schema").Struct<{
5307
+ readonly cols: import("effect/Schema").Int;
5308
+ readonly rows: import("effect/Schema").Int;
5309
+ }>;
5310
+ readonly output: import("effect/Schema").Struct<{
5311
+ readonly head: import("effect/Schema").Int;
5312
+ readonly tail: import("effect/Schema").Int;
5313
+ }>;
5314
+ }>;
5315
+ }>;
5222
5316
  }, import("effect/Schema").Struct<{
5223
5317
  readonly id: import("effect/Schema").brand<import("effect/Schema").String, "Event.ID"> & {
5224
5318
  create: () => string & import("effect/Brand").Brand<"Event.ID">;
@@ -5785,6 +5879,38 @@ export declare const Api: import("@opencode/protocol/api").Api<LocationMiddlewar
5785
5879
  durability: "ephemeral";
5786
5880
  durable: undefined;
5787
5881
  data: import("effect/Schema").Struct<{}>;
5882
+ }, import("effect/Schema").Struct<{
5883
+ readonly id: import("effect/Schema").brand<import("effect/Schema").String, "Event.ID"> & {
5884
+ create: () => string & import("effect/Brand").Brand<"Event.ID">;
5885
+ };
5886
+ readonly created: import("effect/Schema").Finite;
5887
+ 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>;
5888
+ readonly type: import("effect/Schema").Literal<"artifact.updated">;
5889
+ readonly location: import("effect/Schema").decodeTo<import("effect/Schema").optional<import("effect/Schema").toType<import("effect/Schema").Struct<{
5890
+ readonly directory: import("effect/Schema").brand<import("effect/Schema").String, "AbsolutePath">;
5891
+ readonly workspaceID: import("effect/Schema").decodeTo<import("effect/Schema").optional<import("effect/Schema").toType<import("effect/Schema").brand<import("effect/Schema").String, "Workspace.ID"> & {
5892
+ ascending: (id?: string) => string & import("effect/Brand").Brand<"Workspace.ID">;
5893
+ create: () => string & import("effect/Brand").Brand<"Workspace.ID">;
5894
+ }>>, import("effect/Schema").optionalKey<import("effect/Schema").brand<import("effect/Schema").String, "Workspace.ID"> & {
5895
+ ascending: (id?: string) => string & import("effect/Brand").Brand<"Workspace.ID">;
5896
+ create: () => string & import("effect/Brand").Brand<"Workspace.ID">;
5897
+ }>, never, never>;
5898
+ }>>>, import("effect/Schema").optionalKey<import("effect/Schema").Struct<{
5899
+ readonly directory: import("effect/Schema").brand<import("effect/Schema").String, "AbsolutePath">;
5900
+ readonly workspaceID: import("effect/Schema").decodeTo<import("effect/Schema").optional<import("effect/Schema").toType<import("effect/Schema").brand<import("effect/Schema").String, "Workspace.ID"> & {
5901
+ ascending: (id?: string) => string & import("effect/Brand").Brand<"Workspace.ID">;
5902
+ create: () => string & import("effect/Brand").Brand<"Workspace.ID">;
5903
+ }>>, import("effect/Schema").optionalKey<import("effect/Schema").brand<import("effect/Schema").String, "Workspace.ID"> & {
5904
+ ascending: (id?: string) => string & import("effect/Brand").Brand<"Workspace.ID">;
5905
+ create: () => string & import("effect/Brand").Brand<"Workspace.ID">;
5906
+ }>, never, never>;
5907
+ }>>, never, never>;
5908
+ readonly data: import("effect/Schema").Struct<{}>;
5909
+ }> & {
5910
+ type: "artifact.updated";
5911
+ durability: "ephemeral";
5912
+ durable: undefined;
5913
+ data: import("effect/Schema").Struct<{}>;
5788
5914
  }, import("effect/Schema").Struct<{
5789
5915
  readonly id: import("effect/Schema").brand<import("effect/Schema").String, "Event.ID"> & {
5790
5916
  create: () => string & import("effect/Brand").Brand<"Event.ID">;
@@ -7581,6 +7707,18 @@ export declare const Api: import("@opencode/protocol/api").Api<LocationMiddlewar
7581
7707
  readonly workspaceID?: (string & import("effect/Brand").Brand<"Workspace.ID">) | undefined;
7582
7708
  } | undefined;
7583
7709
  readonly data: {};
7710
+ } | {
7711
+ readonly id: string & import("effect/Brand").Brand<"Event.ID">;
7712
+ readonly created: number;
7713
+ readonly metadata?: {
7714
+ readonly [x: string]: unknown;
7715
+ } | undefined;
7716
+ readonly type: "artifact.updated";
7717
+ readonly location?: {
7718
+ readonly directory: string & import("effect/Brand").Brand<"AbsolutePath">;
7719
+ readonly workspaceID?: (string & import("effect/Brand").Brand<"Workspace.ID">) | undefined;
7720
+ } | undefined;
7721
+ readonly data: {};
7584
7722
  } | {
7585
7723
  readonly id: string & import("effect/Brand").Brand<"Event.ID">;
7586
7724
  readonly created: number;
@@ -8060,6 +8198,7 @@ export declare const Api: import("@opencode/protocol/api").Api<LocationMiddlewar
8060
8198
  readonly pid: number;
8061
8199
  readonly exitCode?: number | undefined;
8062
8200
  readonly sessionID: string & import("effect/Brand").Brand<"SessionID">;
8201
+ readonly userTitle: string | null;
8063
8202
  readonly foregroundProcess: string | null;
8064
8203
  readonly size: {
8065
8204
  readonly cols: number;
@@ -8086,6 +8225,41 @@ export declare const Api: import("@opencode/protocol/api").Api<LocationMiddlewar
8086
8225
  readonly sessionID: string & import("effect/Brand").Brand<"SessionID">;
8087
8226
  readonly ptyID: string & import("effect/Brand").Brand<"PtyID">;
8088
8227
  };
8228
+ } | {
8229
+ readonly id: string & import("effect/Brand").Brand<"Event.ID">;
8230
+ readonly created: number;
8231
+ readonly metadata?: {
8232
+ readonly [x: string]: unknown;
8233
+ } | undefined;
8234
+ readonly type: "persistent-pty.updated";
8235
+ readonly location?: {
8236
+ readonly directory: string & import("effect/Brand").Brand<"AbsolutePath">;
8237
+ readonly workspaceID?: (string & import("effect/Brand").Brand<"Workspace.ID">) | undefined;
8238
+ } | undefined;
8239
+ readonly data: {
8240
+ readonly sessionID: string & import("effect/Brand").Brand<"SessionID">;
8241
+ readonly terminal: {
8242
+ readonly id: string & import("effect/Brand").Brand<"PtyID">;
8243
+ readonly title: string;
8244
+ readonly command: string;
8245
+ readonly args: readonly string[];
8246
+ readonly cwd: string;
8247
+ readonly status: "exited" | "running";
8248
+ readonly pid: number;
8249
+ readonly exitCode?: number | undefined;
8250
+ readonly sessionID: string & import("effect/Brand").Brand<"SessionID">;
8251
+ readonly userTitle: string | null;
8252
+ readonly foregroundProcess: string | null;
8253
+ readonly size: {
8254
+ readonly cols: number;
8255
+ readonly rows: number;
8256
+ };
8257
+ readonly output: {
8258
+ readonly head: number;
8259
+ readonly tail: number;
8260
+ };
8261
+ };
8262
+ };
8089
8263
  } | {
8090
8264
  readonly id: string & import("effect/Brand").Brand<"Event.ID">;
8091
8265
  readonly created: number;
package/dist/api.js CHANGED
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  Api2
3
- } from "./chunks/cors-9c4eyh8m.js";
4
- import"./chunks/cors-yet0vexm.js";
5
- import"./chunks/cors-gk0yxcp6.js";
6
- import"./chunks/cors-gqq6kfhc.js";
7
- import"./chunks/cors-smaf4a18.js";
3
+ } from "./chunks/options-0e81et3m.js";
4
+ import"./chunks/options-b3bmdkga.js";
5
+ import"./chunks/options-htyf2qs7.js";
6
+ import"./chunks/options-50bbk3b2.js";
7
+ import"./chunks/options-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/cors-j4at0y5c.js";
10
+ } from "./chunks/options-j4at0y5c.js";
11
11
  export {
12
12
  Config2 as Config,
13
13
  SESSION_TTL_SECONDS2 as SESSION_TTL_SECONDS,
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  missingSession2
3
- } from "./cors-smaf4a18.js";
3
+ } from "./options-smaf4a18.js";
4
4
 
5
5
  // src/handlers/schedule.ts
6
6
  import { Permission } from "@opencode/core/permission";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  Api2
3
- } from "./cors-9c4eyh8m.js";
3
+ } from "./options-0e81et3m.js";
4
4
 
5
5
  // src/handlers/project.ts
6
6
  import { Project } from "@opencode/core/project";
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  LocationMiddleware2
3
- } from "./cors-gqq6kfhc.js";
3
+ } from "./options-50bbk3b2.js";
4
4
  import {
5
5
  FormLocationMiddleware2
6
- } from "./cors-gk0yxcp6.js";
6
+ } from "./options-htyf2qs7.js";
7
7
  import {
8
8
  SessionLocationMiddleware2
9
- } from "./cors-yet0vexm.js";
9
+ } from "./options-b3bmdkga.js";
10
10
 
11
11
  // src/api.ts
12
12
  import { makeDefaultApi } from "@opencode/protocol/api";
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  response2
3
- } from "./cors-gqq6kfhc.js";
3
+ } from "./options-50bbk3b2.js";
4
4
  import {
5
5
  Api2
6
- } from "./cors-9c4eyh8m.js";
6
+ } from "./options-0e81et3m.js";
7
7
 
8
8
  // src/handlers/fs.ts
9
9
  import { FileSystem } from "@opencode/core/filesystem";
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  Api2
3
- } from "./cors-9c4eyh8m.js";
3
+ } from "./options-0e81et3m.js";
4
4
  import {
5
5
  Service2,
6
6
  frame2
7
- } from "./cors-fvpjvjpp.js";
7
+ } from "./options-e0ppd0jy.js";
8
8
 
9
9
  // src/handlers/event.ts
10
10
  import { Event } from "@opencode/schema/event";
@@ -0,0 +1,144 @@
1
+ import {
2
+ missingSession2
3
+ } from "./options-smaf4a18.js";
4
+ import {
5
+ locationErrors2,
6
+ awaitPlugins2,
7
+ response2,
8
+ requestRef2
9
+ } from "./options-50bbk3b2.js";
10
+
11
+ // src/handlers/artifact.ts
12
+ import { Artifact } from "@opencode/core/artifact";
13
+ import { KV } from "@opencode/core/kv";
14
+ import { Location } from "@opencode/core/location";
15
+ import { LocationServiceMap } from "@opencode/core/location-service-map";
16
+ import { AbsolutePath } from "@opencode/core/schema";
17
+ import { Session } from "@opencode/core/session";
18
+ import {
19
+ ArtifactNotFoundError,
20
+ FileNotFoundError,
21
+ ForbiddenError,
22
+ InvalidRequestError,
23
+ ProviderNotFoundError,
24
+ ServiceUnavailableError
25
+ } from "@opencode/protocol/errors";
26
+ import { Effect } from "effect";
27
+ import { HttpServerResponse } from "effect/http";
28
+ import { HttpApiSchema } from "effect/http-api";
29
+ var makeArtifact2 = Effect.gen(function* () {
30
+ const locations = yield* LocationServiceMap.Service;
31
+ const sessions = yield* Session.Service;
32
+ const kv = yield* KV.Service;
33
+ const explicitDirectory = (request, location) => {
34
+ if (location?.directory !== undefined)
35
+ return location.directory;
36
+ const query = new URL(request.url, "http://localhost").searchParams.get("location[directory]");
37
+ if (query)
38
+ return query;
39
+ const header = request.headers["x-opencode-directory"];
40
+ if (!header)
41
+ return;
42
+ try {
43
+ return decodeURIComponent(header);
44
+ } catch {
45
+ return header;
46
+ }
47
+ };
48
+ const resolveLocation = (request, options) => Effect.gen(function* () {
49
+ const requestedDir = explicitDirectory(request, options.location);
50
+ if (requestedDir !== undefined) {
51
+ return Location.Ref.make({ directory: AbsolutePath.make(requestedDir) });
52
+ }
53
+ if (options.sessionID !== undefined) {
54
+ const session = yield* sessions.get(options.sessionID).pipe(Effect.mapError(missingSession2));
55
+ return session.location;
56
+ }
57
+ if (options.artifactID !== undefined) {
58
+ const directory = yield* Artifact.locate(kv, options.artifactID);
59
+ if (directory !== undefined) {
60
+ return Location.Ref.make({ directory: AbsolutePath.make(directory) });
61
+ }
62
+ }
63
+ return requestRef2(request);
64
+ });
65
+ const inLocation = (request, options, effect) => Effect.gen(function* () {
66
+ const ref = yield* resolveLocation(request, options);
67
+ return yield* awaitPlugins2.pipe(Effect.andThen(effect), Effect.provide(locations.get(ref)), locationErrors2);
68
+ });
69
+ const mapCommon = (effect) => effect.pipe(Effect.catchTags({
70
+ "Artifact.DisabledError": (error) => Effect.fail(new ForbiddenError({ message: error.message })),
71
+ "Artifact.NotFoundError": (error) => Effect.fail(new ArtifactNotFoundError({ artifactID: error.artifactID, message: error.message })),
72
+ "Artifact.ProviderNotFoundError": (error) => Effect.fail(new ProviderNotFoundError({ providerID: error.providerID, message: error.message })),
73
+ "Artifact.InvalidError": (error) => Effect.fail(new InvalidRequestError({ message: error.message, kind: "artifact_invalid", field: error.field })),
74
+ "Artifact.ProviderError": (error) => Effect.fail(new ServiceUnavailableError({ message: error.message, service: error.providerID })),
75
+ "Session.NotFoundError": (error) => Effect.fail(missingSession2(error))
76
+ }));
77
+ return {
78
+ providers: (query, request) => inLocation(request, { location: query.location }, Effect.gen(function* () {
79
+ const artifacts = yield* Artifact.Service;
80
+ return yield* response2(artifacts.providers());
81
+ })).pipe(mapCommon),
82
+ list: (query, request) => inLocation(request, { location: query.location, sessionID: query.sessionID }, Effect.gen(function* () {
83
+ const artifacts = yield* Artifact.Service;
84
+ return yield* response2(artifacts.list({ sessionID: query.sessionID, provider: query.provider }));
85
+ })).pipe(mapCommon),
86
+ create: (query, payload, request) => inLocation(request, { location: query.location, sessionID: payload.sessionID }, Effect.gen(function* () {
87
+ const artifacts = yield* Artifact.Service;
88
+ return yield* response2(artifacts.create(payload));
89
+ })).pipe(mapCommon),
90
+ get: (artifactID, query, request) => inLocation(request, { location: query.location, artifactID }, Effect.gen(function* () {
91
+ const artifacts = yield* Artifact.Service;
92
+ return yield* response2(artifacts.get(artifactID));
93
+ })).pipe(mapCommon),
94
+ update: (artifactID, query, payload, request) => inLocation(request, { location: query.location, sessionID: payload.sessionID, artifactID }, Effect.gen(function* () {
95
+ const artifacts = yield* Artifact.Service;
96
+ return yield* response2(artifacts.update(artifactID, payload));
97
+ })).pipe(mapCommon),
98
+ remove: (artifactID, query, request) => inLocation(request, { location: query.location, artifactID }, Effect.gen(function* () {
99
+ const artifacts = yield* Artifact.Service;
100
+ yield* artifacts.remove(artifactID);
101
+ return HttpApiSchema.NoContent.make();
102
+ })).pipe(mapCommon),
103
+ view: (artifactID, query, request) => inLocation(request, { location: query.location, artifactID }, Effect.gen(function* () {
104
+ const artifacts = yield* Artifact.Service;
105
+ const parsed = new URL(request.url, "http://localhost");
106
+ const prefix = `/api/experimental/artifacts/${encodeURIComponent(artifactID)}/view`;
107
+ if (parsed.pathname === prefix) {
108
+ yield* artifacts.info(artifactID);
109
+ return HttpServerResponse.empty({
110
+ status: 308,
111
+ headers: { location: `${prefix}/${parsed.search}` }
112
+ });
113
+ }
114
+ const subpath = extractViewSubpath(request.url, artifactID);
115
+ const file = yield* artifacts.readLocalFile(artifactID, subpath).pipe(Effect.catchTag("Artifact.FileMissingError", (error) => Effect.fail(new FileNotFoundError({ path: error.path, message: error.message }))));
116
+ return HttpServerResponse.uint8Array(file.bytes, {
117
+ status: 200,
118
+ contentType: file.mime,
119
+ headers: {
120
+ "access-control-allow-origin": "*",
121
+ "cache-control": "private, no-cache",
122
+ "content-security-policy": "sandbox allow-scripts",
123
+ "x-content-type-options": "nosniff"
124
+ }
125
+ });
126
+ })).pipe(mapCommon)
127
+ };
128
+ });
129
+ function extractViewSubpath(url, artifactID) {
130
+ const pathname = new URL(url, "http://localhost").pathname;
131
+ const prefix = `/api/experimental/artifacts/${encodeURIComponent(artifactID)}/view/`;
132
+ if (!pathname.startsWith(prefix))
133
+ return;
134
+ const raw = pathname.slice(prefix.length);
135
+ if (!raw)
136
+ return;
137
+ try {
138
+ return decodeURIComponent(raw);
139
+ } catch {
140
+ return raw;
141
+ }
142
+ }
143
+
144
+ export { makeArtifact2 };
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  locationErrors2,
3
3
  awaitPlugins2
4
- } from "./cors-gqq6kfhc.js";
4
+ } from "./options-50bbk3b2.js";
5
5
  import {
6
6
  Api2
7
- } from "./cors-9c4eyh8m.js";
7
+ } from "./options-0e81et3m.js";
8
8
 
9
9
  // src/handlers/generate.ts
10
10
  import { Generate } from "@opencode/core/generate";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  Api2
3
- } from "./cors-9c4eyh8m.js";
3
+ } from "./options-0e81et3m.js";
4
4
 
5
5
  // src/handlers/rpc.ts
6
6
  import { Rpc } from "@opencode/core/rpc";
@@ -1,15 +1,15 @@
1
1
  import {
2
2
  __export
3
- } from "./cors-9rqn6x4v.js";
3
+ } from "./options-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: () => make3
9
+ make: () => make4
10
10
  });
11
11
  import { Effect, Ref } from "effect";
12
- var make3 = Effect.fnUntraced(function* (options = {}) {
12
+ var make4 = 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 make3 = Effect.fnUntraced(function* (options = {}) {
20
20
  };
21
21
  });
22
22
 
23
- export { make3, exports_service_status };
23
+ export { make4, exports_service_status };
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  Api2
3
- } from "./cors-9c4eyh8m.js";
3
+ } from "./options-0e81et3m.js";
4
4
  import {
5
5
  requireConnectable2
6
- } from "./cors-zrprg5z5.js";
6
+ } from "./options-n1zdbfv7.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 "./cors-9rqn6x4v.js";
3
+ } from "./options-9rqn6x4v.js";
4
4
 
5
5
  // src/server-info.ts
6
6
  var exports_server_info = {};
@@ -8,14 +8,14 @@ __export(exports_server_info, {
8
8
  ServerInfo: () => exports_server_info,
9
9
  Service: () => Service3,
10
10
  connectionURLs: () => connectionURLs2,
11
- layer: () => layer4
11
+ layer: () => layer3
12
12
  });
13
13
  import { Context, Layer } from "effect";
14
14
  import { networkInterfaces } from "node:os";
15
15
 
16
16
  class Service3 extends Context.Service()("@opencode/server/ServerInfo") {
17
17
  }
18
- function layer4(urls, tmp, app = {}) {
18
+ function layer3(urls, tmp, app = {}) {
19
19
  return Layer.succeed(Service3, Service3.of({ urls, app, paths: { tmp } }));
20
20
  }
21
21
  function connectionURLs2(value, requestedHostname) {
@@ -38,4 +38,4 @@ function connectionURLs2(value, requestedHostname) {
38
38
  ];
39
39
  }
40
40
 
41
- export { Service3, layer4, connectionURLs2, exports_server_info };
41
+ export { Service3, layer3, connectionURLs2, exports_server_info };