@opencode/server 2.2.3 → 2.2.4
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.
- package/dist/api.d.ts +175 -1
- package/dist/api.js +5 -5
- package/dist/auth.js +1 -1
- package/dist/chunks/{service-status-39fj7rnq.js → event-feed-04phqjtk.js} +17 -15
- package/dist/chunks/{service-status-059rbh9c.js → event-feed-059rbh9c.js} +1 -1
- package/dist/chunks/{service-status-zmgfywqd.js → event-feed-05c5061t.js} +1 -1
- package/dist/chunks/{service-status-r5696se6.js → event-feed-0e81et3m.js} +3 -3
- package/dist/chunks/{service-status-0pbbhyf6.js → event-feed-0ey2b45p.js} +2 -2
- package/dist/chunks/event-feed-0fv515j7.js +144 -0
- package/dist/chunks/{service-status-wqv43pj9.js → event-feed-0j6zxxn8.js} +2 -2
- package/dist/chunks/{service-status-zyntahe8.js → event-feed-0n4tjm17.js} +1 -1
- package/dist/chunks/{service-status-1t8ee1b5.js → event-feed-2wexxjwf.js} +2 -2
- package/dist/chunks/{service-status-39nnfjx1.js → event-feed-39nnfjx1.js} +1 -1
- package/dist/chunks/{service-status-370cpmna.js → event-feed-4p2y0qs3.js} +2 -2
- package/dist/chunks/{service-status-gqq6kfhc.js → event-feed-50bbk3b2.js} +3 -3
- package/dist/chunks/{service-status-9jpfpdce.js → event-feed-5dbnrgeg.js} +4 -4
- package/dist/chunks/{service-status-7b9xm1qg.js → event-feed-7b9xm1qg.js} +1 -1
- package/dist/chunks/{service-status-5z5anmwp.js → event-feed-89egwzf3.js} +2 -2
- package/dist/chunks/{service-status-2qjvs0kv.js → event-feed-8wqj6mpn.js} +4 -4
- package/dist/chunks/{service-status-vtfzy3at.js → event-feed-9grnt8dc.js} +2 -2
- package/dist/chunks/{service-status-fvqb5t8b.js → event-feed-axe8xgk8.js} +27 -9
- package/dist/chunks/{service-status-yet0vexm.js → event-feed-b3bmdkga.js} +1 -1
- package/dist/chunks/{service-status-xpg37vzc.js → event-feed-b4mqtccx.js} +2 -2
- package/dist/chunks/{service-status-7cd61xtm.js → event-feed-dx89xydc.js} +2 -2
- package/dist/chunks/{service-status-2835150m.js → event-feed-et00mhwf.js} +2 -2
- package/dist/chunks/{service-status-rxyx8sa0.js → event-feed-f8r9p2vr.js} +2 -2
- package/dist/chunks/{service-status-dm74gm07.js → event-feed-g2961dtz.js} +8 -8
- package/dist/chunks/{service-status-jc2vwkyw.js → event-feed-h1thjy6x.js} +2 -2
- package/dist/chunks/{service-status-gk0yxcp6.js → event-feed-htyf2qs7.js} +1 -1
- package/dist/chunks/{service-status-0e4fm4yw.js → event-feed-hx8bsq9d.js} +1 -1
- package/dist/chunks/{service-status-j4at0y5c.js → event-feed-j4at0y5c.js} +1 -1
- package/dist/chunks/{service-status-50xc6x42.js → event-feed-kg0ybx4v.js} +3 -3
- package/dist/chunks/{service-status-ac10qb5k.js → event-feed-m119esdv.js} +3 -3
- package/dist/chunks/{service-status-0mnp9wde.js → event-feed-m9ezm2eq.js} +3 -3
- package/dist/chunks/{service-status-1s3664te.js → event-feed-mzqcpmk1.js} +4 -4
- package/dist/chunks/{service-status-w9jcwh65.js → event-feed-mzs0n5xz.js} +7 -7
- package/dist/chunks/{service-status-bv5jg9y6.js → event-feed-n1zdbfv7.js} +2 -2
- package/dist/chunks/{service-status-6211mtn3.js → event-feed-ndcq61v8.js} +35 -35
- package/dist/chunks/{service-status-7tewdwsb.js → event-feed-nz17qv97.js} +2 -2
- package/dist/chunks/{service-status-xbqm7mpj.js → event-feed-q44yktpv.js} +2 -2
- package/dist/chunks/{service-status-fvpjvjpp.js → event-feed-qfyg9gb7.js} +7 -7
- package/dist/chunks/{service-status-vfkjeyp3.js → event-feed-r6xkfcdx.js} +1 -1
- package/dist/chunks/{service-status-f4exzdsf.js → event-feed-s62wjkvx.js} +2 -2
- package/dist/chunks/{service-status-skcryrty.js → event-feed-s9tkswmw.js} +2 -2
- package/dist/chunks/{service-status-7x1re4zg.js → event-feed-v8aqacn3.js} +2 -2
- package/dist/chunks/{service-status-sqxx1p54.js → event-feed-vbgqk0mr.js} +2 -2
- package/dist/chunks/{service-status-vvp99hc9.js → event-feed-x4b2rtcb.js} +1 -1
- package/dist/chunks/{service-status-7dtbad8d.js → event-feed-z3e7v67k.js} +7 -7
- package/dist/chunks/{service-status-74kxthdf.js → event-feed-zbe9jfhy.js} +1 -1
- package/dist/chunks/{service-status-zkg10e14.js → event-feed-zvbhqxt5.js} +4 -4
- package/dist/cors.js +1 -1
- package/dist/event-feed.js +5 -5
- package/dist/fetch.js +52 -51
- package/dist/handlers/agent.js +6 -6
- package/dist/handlers/artifact.d.ts +62 -0
- package/dist/handlers/artifact.js +8 -0
- package/dist/handlers/command.js +6 -6
- package/dist/handlers/config.js +6 -6
- package/dist/handlers/credential.js +7 -7
- package/dist/handlers/debug.js +6 -6
- package/dist/handlers/event.js +7 -7
- package/dist/handlers/form.js +6 -6
- package/dist/handlers/fs.js +6 -6
- package/dist/handlers/generate.js +6 -6
- package/dist/handlers/integration.js +6 -6
- package/dist/handlers/location.js +6 -6
- package/dist/handlers/mcp.js +8 -8
- package/dist/handlers/media.js +1 -1
- package/dist/handlers/message.js +7 -7
- package/dist/handlers/migration.js +6 -6
- package/dist/handlers/model.js +6 -6
- package/dist/handlers/permission.js +6 -6
- package/dist/handlers/persistent-pty.d.ts +1 -1
- package/dist/handlers/persistent-pty.js +11 -10
- package/dist/handlers/plugin.js +6 -6
- package/dist/handlers/project.js +6 -6
- package/dist/handlers/provider.js +6 -6
- package/dist/handlers/pty-socket.js +1 -1
- package/dist/handlers/pty.js +8 -8
- package/dist/handlers/reference.js +6 -6
- package/dist/handlers/rpc.js +6 -6
- package/dist/handlers/schedule.js +2 -2
- package/dist/handlers/server.js +9 -9
- package/dist/handlers/session-error.js +1 -1
- package/dist/handlers/session.js +7 -7
- package/dist/handlers/shell.js +6 -6
- package/dist/handlers/skill.js +6 -6
- package/dist/handlers/usage.js +6 -6
- package/dist/handlers/vcs.js +6 -6
- package/dist/handlers/voice.js +6 -6
- package/dist/handlers/websearch.js +6 -6
- package/dist/handlers/worktree.js +6 -6
- package/dist/handlers.d.ts +1 -1
- package/dist/handlers.js +48 -47
- package/dist/location.js +4 -4
- package/dist/media-uri.js +1 -1
- package/dist/middleware/authorization.js +2 -2
- package/dist/middleware/form-location.js +3 -3
- package/dist/middleware/schema-error.js +1 -1
- package/dist/middleware/session-location.js +3 -3
- package/dist/pairing.js +3 -3
- package/dist/process.js +55 -54
- package/dist/request-tracing.js +1 -1
- package/dist/routes.d.ts +3 -2
- package/dist/routes.js +51 -50
- package/dist/server-info.js +5 -5
- package/dist/service-status.js +1 -1
- package/dist/workerd.js +53 -52
- package/package.json +9 -9
- /package/dist/chunks/{service-status-9rqn6x4v.js → event-feed-9rqn6x4v.js} +0 -0
- /package/dist/chunks/{service-status-bd8755ek.js → event-feed-bd8755ek.js} +0 -0
- /package/dist/chunks/{service-status-h6rt5k9s.js → event-feed-h6rt5k9s.js} +0 -0
- /package/dist/chunks/{service-status-n321d8vm.js → event-feed-n321d8vm.js} +0 -0
- /package/dist/chunks/{service-status-q4bn6dy8.js → event-feed-q4bn6dy8.js} +0 -0
- /package/dist/chunks/{service-status-smaf4a18.js → event-feed-smaf4a18.js} +0 -0
- /package/dist/chunks/{service-status-xthc02cw.js → event-feed-xthc02cw.js} +0 -0
- /package/dist/chunks/{service-status-yc7nft6q.js → event-feed-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/
|
|
4
|
-
import"./chunks/
|
|
5
|
-
import"./chunks/
|
|
6
|
-
import"./chunks/
|
|
7
|
-
import"./chunks/
|
|
3
|
+
} from "./chunks/event-feed-0e81et3m.js";
|
|
4
|
+
import"./chunks/event-feed-b3bmdkga.js";
|
|
5
|
+
import"./chunks/event-feed-htyf2qs7.js";
|
|
6
|
+
import"./chunks/event-feed-50bbk3b2.js";
|
|
7
|
+
import"./chunks/event-feed-smaf4a18.js";
|
|
8
8
|
export {
|
|
9
9
|
Api2 as Api
|
|
10
10
|
};
|
package/dist/auth.js
CHANGED
|
@@ -1,36 +1,36 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
} from "./
|
|
2
|
+
layer4
|
|
3
|
+
} from "./event-feed-50bbk3b2.js";
|
|
4
4
|
import {
|
|
5
5
|
formLocationLayer2
|
|
6
|
-
} from "./
|
|
6
|
+
} from "./event-feed-htyf2qs7.js";
|
|
7
7
|
import {
|
|
8
8
|
sessionLocationLayer2
|
|
9
|
-
} from "./
|
|
9
|
+
} from "./event-feed-b3bmdkga.js";
|
|
10
10
|
import {
|
|
11
11
|
Api2
|
|
12
|
-
} from "./
|
|
12
|
+
} from "./event-feed-0e81et3m.js";
|
|
13
13
|
import {
|
|
14
14
|
Config2
|
|
15
|
-
} from "./
|
|
15
|
+
} from "./event-feed-j4at0y5c.js";
|
|
16
16
|
import {
|
|
17
17
|
CorsConfig2
|
|
18
|
-
} from "./
|
|
18
|
+
} from "./event-feed-q4bn6dy8.js";
|
|
19
19
|
import {
|
|
20
|
-
|
|
21
|
-
} from "./
|
|
20
|
+
layer2
|
|
21
|
+
} from "./event-feed-z3e7v67k.js";
|
|
22
22
|
import {
|
|
23
23
|
node2
|
|
24
|
-
} from "./
|
|
24
|
+
} from "./event-feed-mzs0n5xz.js";
|
|
25
25
|
import {
|
|
26
26
|
handlers2
|
|
27
|
-
} from "./
|
|
27
|
+
} from "./event-feed-ndcq61v8.js";
|
|
28
28
|
import {
|
|
29
29
|
authorizationLayer2
|
|
30
|
-
} from "./
|
|
30
|
+
} from "./event-feed-7b9xm1qg.js";
|
|
31
31
|
import {
|
|
32
32
|
schemaErrorLayer2
|
|
33
|
-
} from "./
|
|
33
|
+
} from "./event-feed-bd8755ek.js";
|
|
34
34
|
|
|
35
35
|
// src/routes.ts
|
|
36
36
|
import { Database } from "@opencode/core/database/database";
|
|
@@ -55,6 +55,7 @@ import { SessionTransfer } from "@opencode/core/session/transfer";
|
|
|
55
55
|
import { InstructionEntry } from "@opencode/core/session/instruction-entry";
|
|
56
56
|
import { ShellSelect } from "@opencode/core/shell/select";
|
|
57
57
|
import { Job } from "@opencode/core/job";
|
|
58
|
+
import { KV } from "@opencode/core/kv";
|
|
58
59
|
import { Mcp } from "@opencode/core/mcp/index";
|
|
59
60
|
import { Global } from "@opencode/util/global";
|
|
60
61
|
import { FSUtil } from "@opencode/util/fs-util";
|
|
@@ -77,6 +78,7 @@ var applicationServiceNodes = [
|
|
|
77
78
|
Global.node,
|
|
78
79
|
FSUtil.node,
|
|
79
80
|
Database.node,
|
|
81
|
+
KV.node,
|
|
80
82
|
Bus.node,
|
|
81
83
|
EventLogger.node,
|
|
82
84
|
httpClient,
|
|
@@ -151,8 +153,8 @@ function makeRoutes(auth, options, serviceURLs, overrides, instances) {
|
|
|
151
153
|
})) : build(overrides);
|
|
152
154
|
return serviceLayer.pipe(Layer.flatMap((context) => {
|
|
153
155
|
const services = Layer.succeedContext(context);
|
|
154
|
-
const requestServices = Layer.merge(Layer.succeedContext(Context.pick(Database.Service, Credential.Service, PermissionSaved.Service, PluginUpdate.Service, Project.Service, WellKnown.Service)(context)),
|
|
155
|
-
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(
|
|
156
|
+
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));
|
|
157
|
+
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(layer4), Layer.provide(authorizationLayer2), Layer.provide(schemaErrorLayer2), Layer.provide(auth), HttpRouter.provideRequest(requestServices), Layer.provideMerge(services), Layer.provideMerge(HttpRouter.layer));
|
|
156
158
|
return Layer.merge(api, V1Migration.layer.pipe(Layer.provide(services)));
|
|
157
159
|
}));
|
|
158
160
|
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
LocationMiddleware2
|
|
3
|
-
} from "./
|
|
3
|
+
} from "./event-feed-50bbk3b2.js";
|
|
4
4
|
import {
|
|
5
5
|
FormLocationMiddleware2
|
|
6
|
-
} from "./
|
|
6
|
+
} from "./event-feed-htyf2qs7.js";
|
|
7
7
|
import {
|
|
8
8
|
SessionLocationMiddleware2
|
|
9
|
-
} from "./
|
|
9
|
+
} from "./event-feed-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 "./
|
|
3
|
+
} from "./event-feed-50bbk3b2.js";
|
|
4
4
|
import {
|
|
5
5
|
Api2
|
|
6
|
-
} from "./
|
|
6
|
+
} from "./event-feed-0e81et3m.js";
|
|
7
7
|
|
|
8
8
|
// src/handlers/fs.ts
|
|
9
9
|
import { FileSystem } from "@opencode/core/filesystem";
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
import {
|
|
2
|
+
missingSession2
|
|
3
|
+
} from "./event-feed-smaf4a18.js";
|
|
4
|
+
import {
|
|
5
|
+
locationErrors2,
|
|
6
|
+
awaitPlugins2,
|
|
7
|
+
response2,
|
|
8
|
+
requestRef2
|
|
9
|
+
} from "./event-feed-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 "./
|
|
4
|
+
} from "./event-feed-50bbk3b2.js";
|
|
5
5
|
import {
|
|
6
6
|
Api2
|
|
7
|
-
} from "./
|
|
7
|
+
} from "./event-feed-0e81et3m.js";
|
|
8
8
|
|
|
9
9
|
// src/handlers/generate.ts
|
|
10
10
|
import { Generate } from "@opencode/core/generate";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Api2
|
|
3
|
-
} from "./
|
|
3
|
+
} from "./event-feed-0e81et3m.js";
|
|
4
4
|
import {
|
|
5
5
|
requireConnectable2
|
|
6
|
-
} from "./
|
|
6
|
+
} from "./event-feed-n1zdbfv7.js";
|
|
7
7
|
|
|
8
8
|
// src/handlers/credential.ts
|
|
9
9
|
import { Credential } from "@opencode/core/credential";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
awaitPlugins2,
|
|
3
3
|
response2
|
|
4
|
-
} from "./
|
|
4
|
+
} from "./event-feed-50bbk3b2.js";
|
|
5
5
|
import {
|
|
6
6
|
Api2
|
|
7
|
-
} from "./
|
|
7
|
+
} from "./event-feed-0e81et3m.js";
|
|
8
8
|
|
|
9
9
|
// src/handlers/model.ts
|
|
10
10
|
import { Model } from "@opencode/core/model";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
missingSession2
|
|
3
|
-
} from "./
|
|
3
|
+
} from "./event-feed-smaf4a18.js";
|
|
4
4
|
|
|
5
5
|
// src/location.ts
|
|
6
6
|
import { FileSystem } from "@opencode/core/filesystem";
|
|
@@ -59,7 +59,7 @@ function decode(input) {
|
|
|
59
59
|
return input;
|
|
60
60
|
}
|
|
61
61
|
}
|
|
62
|
-
var
|
|
62
|
+
var layer4 = Layer.effect(LocationMiddleware2, Effect.gen(function* () {
|
|
63
63
|
const locations = yield* LocationServiceMap.Service;
|
|
64
64
|
return LocationMiddleware2.of((effect) => Effect.gen(function* () {
|
|
65
65
|
const request = yield* HttpServerRequest.HttpServerRequest;
|
|
@@ -67,4 +67,4 @@ var layer3 = Layer.effect(LocationMiddleware2, Effect.gen(function* () {
|
|
|
67
67
|
}));
|
|
68
68
|
}));
|
|
69
69
|
|
|
70
|
-
export { LocationMiddleware2, locationErrors2, awaitPlugins2, response2, sessionInfo2, requestRef2,
|
|
70
|
+
export { LocationMiddleware2, locationErrors2, awaitPlugins2, response2, sessionInfo2, requestRef2, layer4 };
|