@opencode/server 0.0.0-dev-1338 → 0.0.0-dev-1343
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api.js +5 -5
- package/dist/auth.js +1 -1
- package/dist/chunks/{request-site-4apj6a8e.js → request-tracing-12zwgdzg.js} +2 -2
- package/dist/chunks/{request-site-p8bw27eh.js → request-tracing-1xf02gcb.js} +38 -17
- package/dist/chunks/{request-site-1bx0qbf8.js → request-tracing-2qpg9hy1.js} +4 -4
- package/dist/chunks/{request-site-p0dbcmm0.js → request-tracing-42gz2497.js} +8 -8
- package/dist/chunks/{request-site-pv4dnzzq.js → request-tracing-42tqx64k.js} +1 -1
- package/dist/chunks/{request-site-b87bs0cf.js → request-tracing-4zne1sdj.js} +2 -2
- package/dist/chunks/{request-site-8mfdzabk.js → request-tracing-52x44xqp.js} +2 -2
- package/dist/chunks/{request-site-7x6cg3xs.js → request-tracing-6kxghskv.js} +2 -2
- package/dist/chunks/{request-site-g80pvn6e.js → request-tracing-7nstrb2v.js} +2 -2
- package/dist/chunks/{request-site-edwk6ehd.js → request-tracing-7p3x2xdt.js} +1 -1
- package/dist/chunks/{request-site-k26h7zjg.js → request-tracing-7w7s37ab.js} +2 -2
- package/dist/chunks/{request-site-7ydfwv45.js → request-tracing-7ydfwv45.js} +1 -1
- package/dist/chunks/{request-site-20wvj9q6.js → request-tracing-8g1x5cgg.js} +2 -2
- package/dist/chunks/{request-site-8sb6qqpn.js → request-tracing-8sb6qqpn.js} +1 -1
- package/dist/chunks/{request-site-wh07bcjv.js → request-tracing-8yrm3yp0.js} +1 -1
- package/dist/chunks/{request-site-b1x3j2e8.js → request-tracing-9qbtnftt.js} +2 -2
- package/dist/chunks/{request-site-zrptb2x8.js → request-tracing-b315n07t.js} +2 -2
- package/dist/chunks/{request-site-q8jgva1w.js → request-tracing-b6cxph1w.js} +4 -4
- package/dist/chunks/{request-site-djr0jy89.js → request-tracing-djr0jy89.js} +1 -1
- package/dist/chunks/{request-site-39nnfjx1.js → request-tracing-e6e4kz0w.js} +4 -4
- package/dist/chunks/{request-site-amzpv526.js → request-tracing-fqfqd37z.js} +9 -9
- package/dist/chunks/{request-site-g23ffrnz.js → request-tracing-g23ffrnz.js} +2 -2
- package/dist/chunks/{request-site-p9wp66hf.js → request-tracing-h8savpc9.js} +1 -1
- package/dist/chunks/request-tracing-hgrkvk6s.js +48 -0
- package/dist/chunks/{request-site-myqk22k5.js → request-tracing-hmwn16zp.js} +2 -2
- package/dist/chunks/{request-site-p4zkxzv7.js → request-tracing-j2hee7a4.js} +1 -1
- package/dist/chunks/{request-site-j4at0y5c.js → request-tracing-j4at0y5c.js} +1 -1
- package/dist/chunks/{request-site-j80tzjj3.js → request-tracing-j80tzjj3.js} +1 -1
- package/dist/chunks/{request-site-v0z8pce5.js → request-tracing-jr0zs68z.js} +2 -2
- package/dist/chunks/{request-site-w9jcwh65.js → request-tracing-mzs0n5xz.js} +7 -7
- package/dist/chunks/{request-site-s8t5gq7c.js → request-tracing-n0a33cnc.js} +3 -3
- package/dist/chunks/{request-site-n6ypjnhz.js → request-tracing-n6ypjnhz.js} +1 -1
- package/dist/chunks/{request-site-b7yt2ykh.js → request-tracing-pcsx5fe9.js} +2 -2
- package/dist/chunks/{request-site-t8azv5ge.js → request-tracing-pmr95crm.js} +2 -2
- package/dist/chunks/{request-site-qahj7606.js → request-tracing-qahj7606.js} +1 -1
- package/dist/chunks/{request-site-wecgp61r.js → request-tracing-qd05162x.js} +6 -6
- package/dist/chunks/{request-site-4gbck4qg.js → request-tracing-qdrpva4m.js} +2 -2
- package/dist/chunks/{request-site-rktygpea.js → request-tracing-rktygpea.js} +1 -1
- package/dist/chunks/{request-site-86dz2n4m.js → request-tracing-s4qxpf1p.js} +2 -2
- package/dist/chunks/{request-site-t32e1bbt.js → request-tracing-t32e1bbt.js} +1 -1
- package/dist/chunks/{request-site-t62b1gmw.js → request-tracing-t62b1gmw.js} +2 -2
- package/dist/chunks/{request-site-7t0tq67e.js → request-tracing-ta6eh4bd.js} +3 -3
- package/dist/chunks/{request-site-ze9p165g.js → request-tracing-tybmb1m6.js} +33 -33
- package/dist/chunks/{request-site-4r2ye500.js → request-tracing-tze85g2y.js} +2 -2
- package/dist/chunks/{request-site-6t6fd9bq.js → request-tracing-v1nm30fe.js} +2 -2
- package/dist/chunks/{request-site-19kn6hvf.js → request-tracing-vq9qd4v4.js} +4 -4
- package/dist/chunks/{request-site-8n1ypg70.js → request-tracing-wnw6k7m6.js} +3 -3
- package/dist/chunks/{request-site-hvn8tnxr.js → request-tracing-xa0sy2cm.js} +4 -4
- package/dist/chunks/{request-site-tdx0cx27.js → request-tracing-xtk9sf9r.js} +6 -6
- package/dist/chunks/{request-site-d0advawr.js → request-tracing-xtx0rz3e.js} +2 -2
- package/dist/chunks/{request-site-6s1v5h8n.js → request-tracing-xzvqye02.js} +4 -4
- package/dist/chunks/{request-site-z3e7v67k.js → request-tracing-z3e7v67k.js} +1 -1
- package/dist/chunks/{request-site-g97h7k0s.js → request-tracing-z3gjns4k.js} +1 -1
- package/dist/content-headers.js +1 -1
- package/dist/cors.js +1 -1
- package/dist/event-feed.js +3 -3
- package/dist/fetch.js +62 -62
- package/dist/handlers/agent.js +6 -6
- package/dist/handlers/artifact.js +3 -3
- package/dist/handlers/automation.d.ts +1 -3
- package/dist/handlers/automation.js +2 -2
- package/dist/handlers/blob.js +3 -3
- 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 +8 -8
- package/dist/handlers/generate.js +6 -6
- package/dist/handlers/integration.js +6 -6
- package/dist/handlers/job.js +2 -2
- package/dist/handlers/location.js +6 -6
- package/dist/handlers/machine.js +1 -1
- package/dist/handlers/mcp.js +8 -8
- package/dist/handlers/media.js +2 -2
- 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 +16 -16
- 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/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 +53 -53
- package/dist/location.js +2 -2
- package/dist/media-uri.js +1 -1
- package/dist/middleware/authorization.js +2 -2
- package/dist/middleware/defect-response.js +1 -1
- 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 +63 -63
- package/dist/range.js +1 -1
- package/dist/request-site.js +2 -2
- package/dist/request-tracing.js +1 -1
- package/dist/routes.d.ts +3 -2
- package/dist/routes.js +57 -57
- package/dist/server-info.js +1 -1
- package/dist/service-status.js +3 -3
- package/dist/workerd.js +63 -63
- package/package.json +8 -8
- package/dist/chunks/request-site-9cd3a4b8.js +0 -69
- /package/dist/chunks/{request-site-0rzj25w4.js → request-tracing-0rzj25w4.js} +0 -0
- /package/dist/chunks/{request-site-9rqn6x4v.js → request-tracing-9rqn6x4v.js} +0 -0
- /package/dist/chunks/{request-site-bd8755ek.js → request-tracing-bd8755ek.js} +0 -0
- /package/dist/chunks/{request-site-n26yr6pw.js → request-tracing-n26yr6pw.js} +0 -0
- /package/dist/chunks/{request-site-q187pxxd.js → request-tracing-q187pxxd.js} +0 -0
- /package/dist/chunks/{request-site-q4bn6dy8.js → request-tracing-q4bn6dy8.js} +0 -0
- /package/dist/chunks/{request-site-smaf4a18.js → request-tracing-smaf4a18.js} +0 -0
- /package/dist/chunks/{request-site-xthc02cw.js → request-tracing-xthc02cw.js} +0 -0
- /package/dist/chunks/{request-site-yc7nft6q.js → request-tracing-yc7nft6q.js} +0 -0
package/dist/api.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Api2
|
|
3
|
-
} from "./chunks/request-
|
|
4
|
-
import"./chunks/request-
|
|
5
|
-
import"./chunks/request-
|
|
6
|
-
import"./chunks/request-
|
|
7
|
-
import"./chunks/request-
|
|
3
|
+
} from "./chunks/request-tracing-n0a33cnc.js";
|
|
4
|
+
import"./chunks/request-tracing-n6ypjnhz.js";
|
|
5
|
+
import"./chunks/request-tracing-qahj7606.js";
|
|
6
|
+
import"./chunks/request-tracing-j80tzjj3.js";
|
|
7
|
+
import"./chunks/request-tracing-smaf4a18.js";
|
|
8
8
|
export {
|
|
9
9
|
Api2 as Api
|
|
10
10
|
};
|
package/dist/auth.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
response2
|
|
3
|
-
} from "./request-
|
|
3
|
+
} from "./request-tracing-j80tzjj3.js";
|
|
4
4
|
import {
|
|
5
5
|
Api2
|
|
6
|
-
} from "./request-
|
|
6
|
+
} from "./request-tracing-n0a33cnc.js";
|
|
7
7
|
|
|
8
8
|
// src/handlers/skill.ts
|
|
9
9
|
import { Skill } from "@opencode/core/skill";
|
|
@@ -1,44 +1,45 @@
|
|
|
1
1
|
import {
|
|
2
2
|
layer3
|
|
3
|
-
} from "./request-
|
|
3
|
+
} from "./request-tracing-j80tzjj3.js";
|
|
4
4
|
import {
|
|
5
5
|
formLocationLayer2
|
|
6
|
-
} from "./request-
|
|
6
|
+
} from "./request-tracing-n6ypjnhz.js";
|
|
7
7
|
import {
|
|
8
8
|
sessionLocationLayer2
|
|
9
|
-
} from "./request-
|
|
9
|
+
} from "./request-tracing-qahj7606.js";
|
|
10
10
|
import {
|
|
11
11
|
Api2
|
|
12
|
-
} from "./request-
|
|
12
|
+
} from "./request-tracing-n0a33cnc.js";
|
|
13
13
|
import {
|
|
14
14
|
Config2
|
|
15
|
-
} from "./request-
|
|
15
|
+
} from "./request-tracing-j4at0y5c.js";
|
|
16
16
|
import {
|
|
17
17
|
CorsConfig2
|
|
18
|
-
} from "./request-
|
|
18
|
+
} from "./request-tracing-q4bn6dy8.js";
|
|
19
19
|
import {
|
|
20
20
|
layer2
|
|
21
|
-
} from "./request-
|
|
21
|
+
} from "./request-tracing-z3e7v67k.js";
|
|
22
22
|
import {
|
|
23
23
|
node2
|
|
24
|
-
} from "./request-
|
|
24
|
+
} from "./request-tracing-mzs0n5xz.js";
|
|
25
25
|
import {
|
|
26
26
|
handlers2
|
|
27
|
-
} from "./request-
|
|
27
|
+
} from "./request-tracing-tybmb1m6.js";
|
|
28
28
|
import {
|
|
29
29
|
authorizationLayer2
|
|
30
|
-
} from "./request-
|
|
30
|
+
} from "./request-tracing-rktygpea.js";
|
|
31
31
|
import {
|
|
32
32
|
schemaErrorLayer2
|
|
33
|
-
} from "./request-
|
|
33
|
+
} from "./request-tracing-bd8755ek.js";
|
|
34
34
|
import {
|
|
35
35
|
defectResponseLayer2
|
|
36
|
-
} from "./request-
|
|
36
|
+
} from "./request-tracing-n26yr6pw.js";
|
|
37
37
|
|
|
38
38
|
// src/routes.ts
|
|
39
39
|
import { Database } from "@opencode/core/database/database";
|
|
40
40
|
import { V1Migration } from "@opencode/core/database/v1-migration";
|
|
41
41
|
import { App } from "@opencode/core/app";
|
|
42
|
+
import { CodeModeApi } from "@opencode/core/codemode/api";
|
|
42
43
|
import { LayerNode } from "@opencode/util/effect/layer-node";
|
|
43
44
|
import { fetchLayer, httpClient, httpFetch } from "@opencode/util/effect/app-node-platform";
|
|
44
45
|
import { AppNodeBuilder } from "@opencode/core/effect/app-node-builder";
|
|
@@ -80,11 +81,13 @@ import { WellKnown } from "@opencode/core/wellknown";
|
|
|
80
81
|
import { Workspace } from "@opencode/core/workspace";
|
|
81
82
|
import { Watcher } from "@opencode/core/filesystem/watcher";
|
|
82
83
|
import { FileWatch } from "@opencode/core/filesystem/file-watch";
|
|
83
|
-
import { HttpRouter } from "effect/http";
|
|
84
|
+
import { HttpEffect, HttpRouter } from "effect/http";
|
|
84
85
|
import { HttpApiBuilder } from "effect/http-api";
|
|
85
86
|
import { Context, Effect, Layer, Option } from "effect";
|
|
87
|
+
import { Base64 } from "effect/encoding";
|
|
86
88
|
var applicationServiceNodes = [
|
|
87
89
|
App.node,
|
|
90
|
+
CodeModeApi.node,
|
|
88
91
|
Global.node,
|
|
89
92
|
FSUtil.node,
|
|
90
93
|
Database.node,
|
|
@@ -123,13 +126,29 @@ var applicationServiceNodes = [
|
|
|
123
126
|
];
|
|
124
127
|
var applicationServices = LayerNode.group(applicationServiceNodes);
|
|
125
128
|
function createRoutes2(options = {}, serviceURLs = () => [], overrides = []) {
|
|
126
|
-
return makeRoutes(options.password ?
|
|
129
|
+
return makeRoutes(options.password ? Option.some(options.password) : Option.none(), options, serviceURLs, overrides);
|
|
127
130
|
}
|
|
128
131
|
function createEmbeddedRoutes2(options = {}, overrides = [], instances) {
|
|
129
|
-
return makeRoutes(
|
|
132
|
+
return makeRoutes(Option.none(), options, () => [], overrides, instances);
|
|
130
133
|
}
|
|
131
|
-
function makeRoutes(
|
|
134
|
+
function makeRoutes(password, options, serviceURLs, overrides, instances) {
|
|
135
|
+
const auth = Config2.configLayer({ password });
|
|
136
|
+
const credential = Option.map(password, (value) => `Basic ${Base64.encode(`opencode:${value}`)}`);
|
|
137
|
+
let internal;
|
|
132
138
|
const standard = [
|
|
139
|
+
CodeModeApi.node.replace(Layer.succeed(CodeModeApi.Service, CodeModeApi.Service.of({
|
|
140
|
+
fetch: (request) => Effect.suspend(() => {
|
|
141
|
+
const handle = internal;
|
|
142
|
+
if (!handle)
|
|
143
|
+
return Effect.fail(new Error("The OpenCode API is not ready yet."));
|
|
144
|
+
if (Option.isSome(credential))
|
|
145
|
+
request.headers.set("authorization", credential.value);
|
|
146
|
+
return Effect.tryPromise({
|
|
147
|
+
try: () => handle(request),
|
|
148
|
+
catch: (error) => error instanceof Error ? error : new Error(String(error))
|
|
149
|
+
});
|
|
150
|
+
})
|
|
151
|
+
}))),
|
|
133
152
|
Database.node.replace(Database.configured(options.database)),
|
|
134
153
|
PersistentPty.node.replace(PersistentPty.configured(options.pty)),
|
|
135
154
|
Bus.node.replace(Bus.configured({ persist: options.events?.persist })),
|
|
@@ -174,7 +193,9 @@ function makeRoutes(auth, options, serviceURLs, overrides, instances) {
|
|
|
174
193
|
return serviceLayer.pipe(Layer.flatMap((context) => {
|
|
175
194
|
const services = Layer.succeedContext(context);
|
|
176
195
|
const requestServices = Layer.merge(Layer.succeedContext(Context.pick(Database.Service, Credential.Service, PermissionSaved.Service, PluginUpdate.Service, Project.Service, WellKnown.Service)(context)), layer2(serviceURLs, Context.get(context, Global.Service).tmp, options.app));
|
|
177
|
-
const api = HttpApiBuilder.layer(Api2, { openapiPath: "/openapi.json" }).pipe(Layer.provide(handlers2.pipe(Layer.provide(services), Layer.provide(Layer.succeed(CorsConfig2, options)))), Layer.provide(formLocationLayer2), Layer.provide(sessionLocationLayer2), Layer.provide(layer3), Layer.provide(authorizationLayer2), Layer.provide(schemaErrorLayer2), Layer.provide(auth), HttpRouter.provideRequest(requestServices), Layer.merge(defectResponseLayer2), Layer.provideMerge(services), Layer.provideMerge(HttpRouter.layer))
|
|
196
|
+
const api = HttpApiBuilder.layer(Api2, { openapiPath: "/openapi.json" }).pipe(Layer.provide(handlers2.pipe(Layer.provide(services), Layer.provide(Layer.succeed(CorsConfig2, options)))), Layer.provide(formLocationLayer2), Layer.provide(sessionLocationLayer2), Layer.provide(layer3), Layer.provide(authorizationLayer2), Layer.provide(schemaErrorLayer2), Layer.provide(auth), HttpRouter.provideRequest(requestServices), Layer.merge(defectResponseLayer2), Layer.provideMerge(services), Layer.provideMerge(HttpRouter.layer), Layer.tap((context) => Effect.sync(() => {
|
|
197
|
+
internal = Context.get(context, HttpRouter.HttpRouter).asHttpEffect().pipe(HttpEffect.toWebHandlerWith(context));
|
|
198
|
+
})));
|
|
178
199
|
return Layer.merge(api, V1Migration.layer.pipe(Layer.provide(services)));
|
|
179
200
|
}));
|
|
180
201
|
}
|
|
@@ -3,16 +3,16 @@ import {
|
|
|
3
3
|
missingMessage2,
|
|
4
4
|
failedMessageDecode2,
|
|
5
5
|
failedSnapshot2
|
|
6
|
-
} from "./request-
|
|
6
|
+
} from "./request-tracing-smaf4a18.js";
|
|
7
7
|
import {
|
|
8
8
|
locationErrors2
|
|
9
|
-
} from "./request-
|
|
9
|
+
} from "./request-tracing-j80tzjj3.js";
|
|
10
10
|
import {
|
|
11
11
|
Api2
|
|
12
|
-
} from "./request-
|
|
12
|
+
} from "./request-tracing-n0a33cnc.js";
|
|
13
13
|
import {
|
|
14
14
|
wantsMediaRefs2
|
|
15
|
-
} from "./request-
|
|
15
|
+
} from "./request-tracing-xthc02cw.js";
|
|
16
16
|
|
|
17
17
|
// src/handlers/session.ts
|
|
18
18
|
import { Instance } from "@opencode/core/instance/service";
|
|
@@ -1,32 +1,32 @@
|
|
|
1
1
|
import {
|
|
2
2
|
isAllowedCorsOrigin2
|
|
3
|
-
} from "./request-
|
|
3
|
+
} from "./request-tracing-q4bn6dy8.js";
|
|
4
4
|
import {
|
|
5
5
|
middleware2
|
|
6
|
-
} from "./request-
|
|
6
|
+
} from "./request-tracing-hmwn16zp.js";
|
|
7
7
|
import {
|
|
8
8
|
withoutParentSpan2
|
|
9
|
-
} from "./request-
|
|
9
|
+
} from "./request-tracing-yc7nft6q.js";
|
|
10
10
|
import {
|
|
11
11
|
createRoutes2
|
|
12
|
-
} from "./request-
|
|
12
|
+
} from "./request-tracing-1xf02gcb.js";
|
|
13
13
|
import {
|
|
14
14
|
__export
|
|
15
|
-
} from "./request-
|
|
15
|
+
} from "./request-tracing-9rqn6x4v.js";
|
|
16
16
|
|
|
17
17
|
// src/fetch.ts
|
|
18
18
|
var exports_fetch = {};
|
|
19
19
|
__export(exports_fetch, {
|
|
20
20
|
ServerFetch: () => exports_fetch,
|
|
21
|
-
make: () =>
|
|
21
|
+
make: () => make2
|
|
22
22
|
});
|
|
23
23
|
import { Context, Effect, Layer } from "effect";
|
|
24
24
|
import { HttpEffect, HttpMiddleware, HttpRouter, HttpServer } from "effect/http";
|
|
25
25
|
import { SessionRestart } from "@opencode/core/session/execution/restart";
|
|
26
|
-
var
|
|
26
|
+
var make2 = Effect.fn("ServerFetch.make")(function* (options = {}, boot = {}) {
|
|
27
27
|
const context = yield* Layer.build(createRoutes2(options, () => [], boot.overrides ?? []).pipe(Layer.provide(HttpServer.layerServices))).pipe(withoutParentSpan2);
|
|
28
28
|
yield* Effect.forkDetach(Context.get(context, SessionRestart.Service).resumeSuspendedSessions);
|
|
29
29
|
return Context.get(context, HttpRouter.HttpRouter).asHttpEffect().pipe(middleware2(options), HttpMiddleware.cors({ allowedOrigins: (origin) => isAllowedCorsOrigin2(origin, options), maxAge: 86400 }), HttpEffect.toWebHandlerWith(context));
|
|
30
30
|
});
|
|
31
31
|
|
|
32
|
-
export {
|
|
32
|
+
export { make2, exports_fetch };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
response2
|
|
3
|
-
} from "./request-
|
|
3
|
+
} from "./request-tracing-j80tzjj3.js";
|
|
4
4
|
import {
|
|
5
5
|
Api2
|
|
6
|
-
} from "./request-
|
|
6
|
+
} from "./request-tracing-n0a33cnc.js";
|
|
7
7
|
|
|
8
8
|
// src/handlers/command.ts
|
|
9
9
|
import { Command } from "@opencode/core/command";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
locationErrors2
|
|
3
|
-
} from "./request-
|
|
3
|
+
} from "./request-tracing-j80tzjj3.js";
|
|
4
4
|
import {
|
|
5
5
|
Api2
|
|
6
|
-
} from "./request-
|
|
6
|
+
} from "./request-tracing-n0a33cnc.js";
|
|
7
7
|
|
|
8
8
|
// src/handlers/generate.ts
|
|
9
9
|
import { Generate } from "@opencode/core/generate";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
response2
|
|
3
|
-
} from "./request-
|
|
3
|
+
} from "./request-tracing-j80tzjj3.js";
|
|
4
4
|
import {
|
|
5
5
|
Api2
|
|
6
|
-
} from "./request-
|
|
6
|
+
} from "./request-tracing-n0a33cnc.js";
|
|
7
7
|
|
|
8
8
|
// src/handlers/websearch.ts
|
|
9
9
|
import { WebSearch } from "@opencode/core/websearch";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
response2
|
|
3
|
-
} from "./request-
|
|
3
|
+
} from "./request-tracing-j80tzjj3.js";
|
|
4
4
|
import {
|
|
5
5
|
Api2
|
|
6
|
-
} from "./request-
|
|
6
|
+
} from "./request-tracing-n0a33cnc.js";
|
|
7
7
|
|
|
8
8
|
// src/handlers/vcs.ts
|
|
9
9
|
import { Vcs } from "@opencode/core/vcs";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
response2
|
|
3
|
-
} from "./request-
|
|
3
|
+
} from "./request-tracing-j80tzjj3.js";
|
|
4
4
|
import {
|
|
5
5
|
Api2
|
|
6
|
-
} from "./request-
|
|
6
|
+
} from "./request-tracing-n0a33cnc.js";
|
|
7
7
|
|
|
8
8
|
// src/handlers/agent.ts
|
|
9
9
|
import { Agent } from "@opencode/core/agent";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
response2
|
|
3
|
-
} from "./request-
|
|
3
|
+
} from "./request-tracing-j80tzjj3.js";
|
|
4
4
|
import {
|
|
5
5
|
Api2
|
|
6
|
-
} from "./request-
|
|
6
|
+
} from "./request-tracing-n0a33cnc.js";
|
|
7
7
|
|
|
8
8
|
// src/handlers/plugin.ts
|
|
9
9
|
import { Plugin } from "@opencode/core/plugin";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
response2
|
|
3
|
-
} from "./request-
|
|
3
|
+
} from "./request-tracing-j80tzjj3.js";
|
|
4
4
|
import {
|
|
5
5
|
Api2
|
|
6
|
-
} from "./request-
|
|
6
|
+
} from "./request-tracing-n0a33cnc.js";
|
|
7
7
|
|
|
8
8
|
// src/handlers/shell.ts
|
|
9
9
|
import { Shell } from "@opencode/core/shell";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
response2
|
|
3
|
-
} from "./request-
|
|
3
|
+
} from "./request-tracing-j80tzjj3.js";
|
|
4
4
|
import {
|
|
5
5
|
Api2
|
|
6
|
-
} from "./request-
|
|
6
|
+
} from "./request-tracing-n0a33cnc.js";
|
|
7
7
|
|
|
8
8
|
// src/handlers/form.ts
|
|
9
9
|
import { Form } from "@opencode/core/form";
|
|
@@ -2,18 +2,18 @@ import {
|
|
|
2
2
|
locationErrors2,
|
|
3
3
|
response2,
|
|
4
4
|
requestRef2
|
|
5
|
-
} from "./request-
|
|
5
|
+
} from "./request-tracing-j80tzjj3.js";
|
|
6
6
|
import {
|
|
7
7
|
Api2
|
|
8
|
-
} from "./request-
|
|
8
|
+
} from "./request-tracing-n0a33cnc.js";
|
|
9
9
|
import {
|
|
10
10
|
CorsConfig2,
|
|
11
11
|
isAllowedRequestOrigin2
|
|
12
|
-
} from "./request-
|
|
12
|
+
} from "./request-tracing-q4bn6dy8.js";
|
|
13
13
|
import {
|
|
14
14
|
runPtySocket2,
|
|
15
15
|
holdLocation2
|
|
16
|
-
} from "./request-
|
|
16
|
+
} from "./request-tracing-q187pxxd.js";
|
|
17
17
|
|
|
18
18
|
// src/handlers/mcp.ts
|
|
19
19
|
import { Location } from "@opencode/core/location";
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
2
|
__export
|
|
3
|
-
} from "./request-
|
|
3
|
+
} from "./request-tracing-9rqn6x4v.js";
|
|
4
4
|
|
|
5
5
|
// src/service-status.ts
|
|
6
6
|
var exports_service_status = {};
|
|
7
7
|
__export(exports_service_status, {
|
|
8
8
|
Status: () => exports_service_status,
|
|
9
|
-
make: () =>
|
|
9
|
+
make: () => make3
|
|
10
10
|
});
|
|
11
11
|
import { Effect, Ref } from "effect";
|
|
12
|
-
var
|
|
12
|
+
var make3 = Effect.fnUntraced(function* (options = {}) {
|
|
13
13
|
const current = yield* Ref.make(options.initial ?? { type: "starting" });
|
|
14
14
|
const beginStopping = Ref.update(current, (status) => status.type === "stopping" ? status : { type: "stopping" });
|
|
15
15
|
return {
|
|
@@ -20,4 +20,4 @@ var make2 = Effect.fnUntraced(function* (options = {}) {
|
|
|
20
20
|
};
|
|
21
21
|
});
|
|
22
22
|
|
|
23
|
-
export {
|
|
23
|
+
export { make3, exports_service_status };
|
|
@@ -1,32 +1,32 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Api2
|
|
3
|
-
} from "./request-
|
|
3
|
+
} from "./request-tracing-n0a33cnc.js";
|
|
4
4
|
import {
|
|
5
5
|
CorsConfig2,
|
|
6
6
|
isAllowedRequestOrigin2
|
|
7
|
-
} from "./request-
|
|
7
|
+
} from "./request-tracing-q4bn6dy8.js";
|
|
8
8
|
import {
|
|
9
9
|
makeArtifact2
|
|
10
|
-
} from "./request-
|
|
10
|
+
} from "./request-tracing-t62b1gmw.js";
|
|
11
11
|
import {
|
|
12
12
|
makeBlobGet2
|
|
13
|
-
} from "./request-
|
|
13
|
+
} from "./request-tracing-g23ffrnz.js";
|
|
14
14
|
import {
|
|
15
15
|
makeAutomation2
|
|
16
|
-
} from "./request-
|
|
16
|
+
} from "./request-tracing-hgrkvk6s.js";
|
|
17
17
|
import {
|
|
18
18
|
makeJob2
|
|
19
|
-
} from "./request-
|
|
19
|
+
} from "./request-tracing-7ydfwv45.js";
|
|
20
20
|
import {
|
|
21
21
|
makeMachineLink2,
|
|
22
22
|
makeMachine2
|
|
23
|
-
} from "./request-
|
|
23
|
+
} from "./request-tracing-0rzj25w4.js";
|
|
24
24
|
import {
|
|
25
25
|
makeMediaGet2
|
|
26
|
-
} from "./request-
|
|
26
|
+
} from "./request-tracing-djr0jy89.js";
|
|
27
27
|
import {
|
|
28
28
|
runPtySocket2
|
|
29
|
-
} from "./request-
|
|
29
|
+
} from "./request-tracing-q187pxxd.js";
|
|
30
30
|
|
|
31
31
|
// src/handlers/persistent-pty.ts
|
|
32
32
|
import { PersistentPty } from "@opencode/core/persistent-pty";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
download2
|
|
3
|
-
} from "./request-
|
|
3
|
+
} from "./request-tracing-t32e1bbt.js";
|
|
4
4
|
import {
|
|
5
5
|
parse2
|
|
6
|
-
} from "./request-
|
|
6
|
+
} from "./request-tracing-8sb6qqpn.js";
|
|
7
7
|
|
|
8
8
|
// src/handlers/blob.ts
|
|
9
9
|
import { BlobStore } from "@opencode/core/blob-store";
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import {
|
|
2
|
+
missingSession2
|
|
3
|
+
} from "./request-tracing-smaf4a18.js";
|
|
4
|
+
|
|
5
|
+
// src/handlers/automation.ts
|
|
6
|
+
import { Automation } from "@opencode/core/automation";
|
|
7
|
+
import { Permission } from "@opencode/core/permission";
|
|
8
|
+
import { AutomationNotFoundError, ForbiddenError, InvalidRequestError } from "@opencode/protocol/errors";
|
|
9
|
+
import { Effect } from "effect";
|
|
10
|
+
import { HttpApiSchema } from "effect/http-api";
|
|
11
|
+
var makeAutomation2 = Effect.gen(function* () {
|
|
12
|
+
const automations = yield* Automation.Service;
|
|
13
|
+
return {
|
|
14
|
+
create: (payload) => automations.create(payload).pipe(Effect.provideService(Permission.Unattended, []), Effect.map((data) => ({ data })), Effect.catchTags({
|
|
15
|
+
"Automation.InvalidError": (error) => Effect.fail(new InvalidRequestError({ message: error.message, kind: "automation" })),
|
|
16
|
+
"Automation.DisabledError": () => Effect.fail(disabled()),
|
|
17
|
+
"Permission.BlockedError": (error) => Effect.fail(new ForbiddenError({ message: error.message })),
|
|
18
|
+
"Permission.CorrectedError": (error) => Effect.fail(new ForbiddenError({ message: error.feedback })),
|
|
19
|
+
"Session.NotFoundError": (error) => Effect.fail(missingSession2(error))
|
|
20
|
+
})),
|
|
21
|
+
list: (query) => automations.list(query).pipe(Effect.map((data) => ({ data })), Effect.catchTags({
|
|
22
|
+
"Automation.InvalidError": (error) => Effect.fail(new InvalidRequestError({ message: error.message, kind: "automation" })),
|
|
23
|
+
"Automation.DisabledError": () => Effect.fail(disabled()),
|
|
24
|
+
"Session.NotFoundError": (error) => Effect.fail(missingSession2(error))
|
|
25
|
+
})),
|
|
26
|
+
get: (id) => managed(automations.get(id).pipe(Effect.map((data) => ({ data })))),
|
|
27
|
+
pause: (id) => managed(automations.pause(id).pipe(Effect.map((data) => ({ data })))),
|
|
28
|
+
resume: (id) => managed(automations.resume(id).pipe(Effect.map((data) => ({ data })))),
|
|
29
|
+
remove: (id) => managed(automations.remove(id).pipe(Effect.as(HttpApiSchema.NoContent.make())))
|
|
30
|
+
};
|
|
31
|
+
});
|
|
32
|
+
function managed(effect) {
|
|
33
|
+
return effect.pipe(Effect.catchTags({
|
|
34
|
+
"Automation.NotFoundError": (error) => Effect.fail(missingAutomation(error)),
|
|
35
|
+
"Automation.DisabledError": () => Effect.fail(disabled())
|
|
36
|
+
}));
|
|
37
|
+
}
|
|
38
|
+
function missingAutomation(error) {
|
|
39
|
+
return new AutomationNotFoundError({
|
|
40
|
+
automationID: error.automationID,
|
|
41
|
+
message: `Automation not found: ${error.automationID}`
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
function disabled() {
|
|
45
|
+
return new ForbiddenError({ message: new Automation.DisabledError().message });
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export { makeAutomation2 };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
isAllowedRequestOrigin2
|
|
3
|
-
} from "./request-
|
|
3
|
+
} from "./request-tracing-q4bn6dy8.js";
|
|
4
4
|
import {
|
|
5
5
|
__export
|
|
6
|
-
} from "./request-
|
|
6
|
+
} from "./request-tracing-9rqn6x4v.js";
|
|
7
7
|
|
|
8
8
|
// src/request-site.ts
|
|
9
9
|
var exports_request_site = {};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
locationErrors2
|
|
3
|
-
} from "./request-
|
|
3
|
+
} from "./request-tracing-j80tzjj3.js";
|
|
4
4
|
import {
|
|
5
5
|
Api2
|
|
6
|
-
} from "./request-
|
|
6
|
+
} from "./request-tracing-n0a33cnc.js";
|
|
7
7
|
|
|
8
8
|
// src/handlers/voice.ts
|
|
9
9
|
import { Location } from "@opencode/core/location";
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
__export
|
|
3
|
-
} from "./request-
|
|
3
|
+
} from "./request-tracing-9rqn6x4v.js";
|
|
4
4
|
|
|
5
5
|
// src/pairing.ts
|
|
6
6
|
var exports_pairing = {};
|
|
7
7
|
__export(exports_pairing, {
|
|
8
8
|
ServerPairing: () => exports_pairing,
|
|
9
|
-
Service: () =>
|
|
9
|
+
Service: () => Service4,
|
|
10
10
|
node: () => node2
|
|
11
11
|
});
|
|
12
12
|
import { Cache, Context, Duration, Effect, Layer } from "effect";
|
|
@@ -14,12 +14,12 @@ import { makeGlobalNode } from "@opencode/util/effect/app-node";
|
|
|
14
14
|
import { randomBytes } from "node:crypto";
|
|
15
15
|
var TTL = Duration.minutes(5);
|
|
16
16
|
|
|
17
|
-
class
|
|
17
|
+
class Service4 extends Context.Service()("@opencode/ServerPairing") {
|
|
18
18
|
}
|
|
19
19
|
var noLookup = () => Effect.die(new Error("ServerPairing cache must be used via set/invalidateWhen, never get"));
|
|
20
|
-
var layer = Layer.effect(
|
|
20
|
+
var layer = Layer.effect(Service4, Effect.gen(function* () {
|
|
21
21
|
const cache = yield* Cache.make({ capacity: 1000, lookup: noLookup, timeToLive: TTL });
|
|
22
|
-
return
|
|
22
|
+
return Service4.of({
|
|
23
23
|
issue: Effect.fn("ServerPairing.issue")(function* () {
|
|
24
24
|
const code = randomBytes(16).toString("base64url");
|
|
25
25
|
yield* Cache.set(cache, code, true);
|
|
@@ -30,6 +30,6 @@ var layer = Layer.effect(Service3, Effect.gen(function* () {
|
|
|
30
30
|
})
|
|
31
31
|
});
|
|
32
32
|
}));
|
|
33
|
-
var node2 = makeGlobalNode({ service:
|
|
33
|
+
var node2 = makeGlobalNode({ service: Service4, layer, deps: [] });
|
|
34
34
|
|
|
35
|
-
export {
|
|
35
|
+
export { Service4, node2, exports_pairing };
|