@opencode/server 2.3.0 → 2.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api.js +5 -5
- package/dist/auth.js +1 -1
- package/dist/chunks/{auth-09kw3a77.js → media-uri-09kw3a77.js} +2 -2
- package/dist/chunks/{auth-5s0wnsg4.js → media-uri-1gwc8nvb.js} +3 -3
- package/dist/chunks/{auth-yqhefp4s.js → media-uri-1h6b4sc5.js} +23 -3
- package/dist/chunks/{auth-2eaky32g.js → media-uri-2eaky32g.js} +2 -2
- package/dist/chunks/{auth-e6e4kz0w.js → media-uri-39nnfjx1.js} +4 -4
- package/dist/chunks/{auth-6jfbq4sw.js → media-uri-3pb3n73h.js} +35 -35
- package/dist/chunks/{auth-4q6e7fh8.js → media-uri-4q6e7fh8.js} +2 -2
- package/dist/chunks/{auth-50bbk3b2.js → media-uri-50bbk3b2.js} +1 -1
- package/dist/chunks/{auth-5cpb32hf.js → media-uri-5cpb32hf.js} +1 -1
- package/dist/chunks/{auth-6kawhtwy.js → media-uri-6kawhtwy.js} +4 -4
- package/dist/chunks/{auth-6z9pvq7p.js → media-uri-6z9pvq7p.js} +1 -1
- package/dist/chunks/{auth-78rcgzsr.js → media-uri-78rcgzsr.js} +1 -1
- package/dist/chunks/{auth-7b9xm1qg.js → media-uri-7b9xm1qg.js} +1 -1
- package/dist/chunks/{auth-8mj7kvhm.js → media-uri-8mj7kvhm.js} +2 -2
- package/dist/chunks/media-uri-8sb6qqpn.js +28 -0
- package/dist/chunks/{auth-91858wp1.js → media-uri-91858wp1.js} +2 -2
- package/dist/chunks/media-uri-9cd3a4b8.js +69 -0
- package/dist/chunks/{auth-a8jcac9a.js → media-uri-a8jcac9a.js} +1 -1
- package/dist/chunks/{auth-az0609r6.js → media-uri-az0609r6.js} +2 -2
- package/dist/chunks/{auth-b3bmdkga.js → media-uri-b3bmdkga.js} +1 -1
- package/dist/chunks/{auth-a4mwssda.js → media-uri-b4rhnd07.js} +15 -11
- package/dist/chunks/{auth-btahnm2b.js → media-uri-btahnm2b.js} +3 -3
- package/dist/chunks/{auth-cezwbsk5.js → media-uri-cezwbsk5.js} +1 -1
- package/dist/chunks/{auth-n1423xpw.js → media-uri-cmnrxx36.js} +2 -2
- package/dist/chunks/media-uri-cr5sd8bz.js +46 -0
- package/dist/chunks/{auth-d0edqfxx.js → media-uri-d0edqfxx.js} +2 -2
- package/dist/chunks/{auth-djr0jy89.js → media-uri-djr0jy89.js} +1 -1
- package/dist/chunks/{auth-enp1bp7r.js → media-uri-enp1bp7r.js} +1 -1
- package/dist/chunks/{auth-f559fakr.js → media-uri-f559fakr.js} +2 -2
- package/dist/chunks/{auth-htyf2qs7.js → media-uri-htyf2qs7.js} +1 -1
- package/dist/chunks/{auth-j4at0y5c.js → media-uri-j4at0y5c.js} +1 -1
- package/dist/chunks/{auth-j87xz9bt.js → media-uri-j87xz9bt.js} +3 -3
- package/dist/chunks/{auth-kkdkqt8j.js → media-uri-kkdkqt8j.js} +2 -2
- package/dist/chunks/{auth-myqk22k5.js → media-uri-myqk22k5.js} +2 -2
- package/dist/chunks/{auth-kqr36gas.js → media-uri-mzs0n5xz.js} +7 -7
- package/dist/chunks/{auth-bm3bken1.js → media-uri-n0chxnkn.js} +7 -20
- package/dist/chunks/media-uri-n26yr6pw.js +21 -0
- package/dist/chunks/{auth-ny1j968n.js → media-uri-ny1j968n.js} +2 -2
- package/dist/chunks/{auth-p86kew8c.js → media-uri-p86kew8c.js} +2 -2
- package/dist/chunks/{auth-qcg3sqtb.js → media-uri-qcg3sqtb.js} +2 -2
- package/dist/chunks/{auth-qd0r787n.js → media-uri-qd0r787n.js} +2 -2
- package/dist/chunks/{auth-3p9jwgak.js → media-uri-qfyg9gb7.js} +4 -4
- package/dist/chunks/{auth-rha2aq18.js → media-uri-rha2aq18.js} +2 -2
- package/dist/chunks/{auth-rs3v36hp.js → media-uri-rs3v36hp.js} +2 -2
- package/dist/chunks/{auth-etdgpyr8.js → media-uri-sssj0qa5.js} +27 -17
- package/dist/chunks/{auth-gyryr0mf.js → media-uri-ssxxka7j.js} +4 -4
- package/dist/chunks/{auth-t32e1bbt.js → media-uri-t32e1bbt.js} +1 -1
- package/dist/chunks/{auth-pab2cyby.js → media-uri-tbqv89f6.js} +8 -8
- package/dist/chunks/{auth-te8jwba1.js → media-uri-te8jwba1.js} +2 -2
- package/dist/chunks/{auth-zkya65ny.js → media-uri-wmep189j.js} +8 -8
- package/dist/chunks/{auth-yk755swr.js → media-uri-yk755swr.js} +2 -2
- package/dist/chunks/{auth-yjbzmfhm.js → media-uri-z3e7v67k.js} +7 -7
- package/dist/chunks/{auth-z9zyd4qg.js → media-uri-z9zyd4qg.js} +4 -4
- package/dist/chunks/{auth-zcvan105.js → media-uri-zcvan105.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.d.ts +3 -0
- package/dist/fetch.js +61 -58
- package/dist/handlers/agent.js +6 -6
- package/dist/handlers/artifact.js +3 -3
- package/dist/handlers/automation.d.ts +25 -0
- package/dist/handlers/automation.js +7 -0
- package/dist/handlers/blob.d.ts +7 -0
- package/dist/handlers/blob.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 +8 -7
- package/dist/handlers/generate.d.ts +2 -1
- package/dist/handlers/generate.js +6 -6
- package/dist/handlers/integration.js +6 -6
- package/dist/handlers/job.d.ts +11 -1
- package/dist/handlers/job.js +2 -2
- package/dist/handlers/location.js +6 -6
- 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 +15 -13
- 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 +52 -50
- 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.d.ts +2 -0
- package/dist/middleware/defect-response.js +6 -0
- 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/options.d.ts +3 -0
- package/dist/options.js +3 -0
- package/dist/pairing.js +3 -3
- package/dist/process.d.ts +3 -0
- package/dist/process.js +64 -61
- package/dist/range.d.ts +6 -0
- package/dist/range.js +8 -0
- package/dist/request-site.js +2 -2
- package/dist/request-tracing.js +1 -1
- package/dist/routes.d.ts +5 -3
- package/dist/routes.js +56 -53
- package/dist/server-info.js +5 -5
- package/dist/service-status.js +3 -3
- package/dist/workerd.d.ts +1 -0
- package/dist/workerd.js +66 -59
- package/package.json +9 -9
- package/dist/chunks/auth-059rbh9c.js +0 -43
- package/dist/handlers/schedule.d.ts +0 -314
- package/dist/handlers/schedule.js +0 -7
- /package/dist/chunks/{auth-9rqn6x4v.js → media-uri-9rqn6x4v.js} +0 -0
- /package/dist/chunks/{auth-bd8755ek.js → media-uri-bd8755ek.js} +0 -0
- /package/dist/chunks/{auth-q187pxxd.js → media-uri-q187pxxd.js} +0 -0
- /package/dist/chunks/{auth-q4bn6dy8.js → media-uri-q4bn6dy8.js} +0 -0
- /package/dist/chunks/{auth-smaf4a18.js → media-uri-smaf4a18.js} +0 -0
- /package/dist/chunks/{auth-xthc02cw.js → media-uri-xthc02cw.js} +0 -0
- /package/dist/chunks/{auth-yc7nft6q.js → media-uri-yc7nft6q.js} +0 -0
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import {
|
|
2
|
+
download2
|
|
3
|
+
} from "./media-uri-t32e1bbt.js";
|
|
4
|
+
import {
|
|
5
|
+
parse2
|
|
6
|
+
} from "./media-uri-8sb6qqpn.js";
|
|
7
|
+
|
|
8
|
+
// src/handlers/blob.ts
|
|
9
|
+
import { BlobStore } from "@opencode/core/blob-store";
|
|
10
|
+
import { BlobNotFoundError } from "@opencode/protocol/errors";
|
|
11
|
+
import { FSUtil } from "@opencode/util/fs-util";
|
|
12
|
+
import { Effect } from "effect";
|
|
13
|
+
import { HttpServerResponse } from "effect/http";
|
|
14
|
+
var makeBlobGet2 = Effect.gen(function* () {
|
|
15
|
+
const blobs = yield* BlobStore.Service;
|
|
16
|
+
const fs = yield* FSUtil.Service;
|
|
17
|
+
return (id, request) => Effect.gen(function* () {
|
|
18
|
+
const blob = yield* blobs.read(id).pipe(Effect.mapError((error) => new BlobNotFoundError({ blobID: error.id, message: error.message })));
|
|
19
|
+
const etag = `"${id}"`;
|
|
20
|
+
const headers = {
|
|
21
|
+
...download2({ mime: blob.mime }),
|
|
22
|
+
"cache-control": "private, max-age=604800, immutable",
|
|
23
|
+
etag,
|
|
24
|
+
"accept-ranges": "bytes"
|
|
25
|
+
};
|
|
26
|
+
if (request.headers["if-none-match"]?.split(",").some((tag) => tag.trim() === "*" || tag.trim().replace(/^w\//i, "") === etag))
|
|
27
|
+
return HttpServerResponse.empty({ status: 304, headers });
|
|
28
|
+
const ifRange = request.headers["if-range"];
|
|
29
|
+
const range = ifRange === undefined || ifRange.trim() === etag ? parse2(request.headers["range"], blob.bytes) : undefined;
|
|
30
|
+
if (range === "unsatisfiable")
|
|
31
|
+
return HttpServerResponse.empty({
|
|
32
|
+
status: 416,
|
|
33
|
+
headers: { ...headers, "content-range": `bytes */${blob.bytes}` }
|
|
34
|
+
});
|
|
35
|
+
const offset = range?.start ?? 0;
|
|
36
|
+
const length = range === undefined ? blob.bytes : range.end - range.start + 1;
|
|
37
|
+
return HttpServerResponse.stream(fs.stream(blob.path, { offset, bytesToRead: length }), {
|
|
38
|
+
status: range === undefined ? 200 : 206,
|
|
39
|
+
contentType: headers["content-type"],
|
|
40
|
+
contentLength: length,
|
|
41
|
+
headers: range === undefined ? headers : { ...headers, "content-range": `bytes ${range.start}-${range.end}/${blob.bytes}` }
|
|
42
|
+
});
|
|
43
|
+
});
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
export { makeBlobGet2 };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
locationErrors2,
|
|
3
3
|
awaitPlugins2
|
|
4
|
-
} from "./
|
|
4
|
+
} from "./media-uri-50bbk3b2.js";
|
|
5
5
|
import {
|
|
6
6
|
Api2
|
|
7
|
-
} from "./
|
|
7
|
+
} from "./media-uri-j87xz9bt.js";
|
|
8
8
|
|
|
9
9
|
// src/handlers/voice.ts
|
|
10
10
|
import { Location } from "@opencode/core/location";
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
LocationMiddleware2
|
|
3
|
-
} from "./
|
|
3
|
+
} from "./media-uri-50bbk3b2.js";
|
|
4
4
|
import {
|
|
5
5
|
FormLocationMiddleware2
|
|
6
|
-
} from "./
|
|
6
|
+
} from "./media-uri-htyf2qs7.js";
|
|
7
7
|
import {
|
|
8
8
|
SessionLocationMiddleware2
|
|
9
|
-
} from "./
|
|
9
|
+
} from "./media-uri-b3bmdkga.js";
|
|
10
10
|
|
|
11
11
|
// src/api.ts
|
|
12
12
|
import { makeDefaultApi } from "@opencode/protocol/api";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
awaitPlugins2,
|
|
3
3
|
response2
|
|
4
|
-
} from "./
|
|
4
|
+
} from "./media-uri-50bbk3b2.js";
|
|
5
5
|
import {
|
|
6
6
|
Api2
|
|
7
|
-
} from "./
|
|
7
|
+
} from "./media-uri-j87xz9bt.js";
|
|
8
8
|
|
|
9
9
|
// src/handlers/websearch.ts
|
|
10
10
|
import { WebSearch } from "@opencode/core/websearch";
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
__export
|
|
3
|
-
} from "./
|
|
3
|
+
} from "./media-uri-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(Service2, 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 };
|
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
2
|
response2
|
|
3
|
-
} from "./
|
|
3
|
+
} from "./media-uri-50bbk3b2.js";
|
|
4
4
|
import {
|
|
5
5
|
Api2
|
|
6
|
-
} from "./
|
|
6
|
+
} from "./media-uri-j87xz9bt.js";
|
|
7
7
|
import {
|
|
8
8
|
download2
|
|
9
|
-
} from "./
|
|
9
|
+
} from "./media-uri-t32e1bbt.js";
|
|
10
|
+
import {
|
|
11
|
+
parse2
|
|
12
|
+
} from "./media-uri-8sb6qqpn.js";
|
|
10
13
|
|
|
11
14
|
// src/handlers/fs.ts
|
|
12
15
|
import { FileSystem } from "@opencode/core/filesystem";
|
|
@@ -71,7 +74,7 @@ function serveFile(request, file, content) {
|
|
|
71
74
|
if (isNotModified(request, etag, lastModified))
|
|
72
75
|
return HttpServerResponse.empty({ status: 304, headers: { ...validators, ...content } });
|
|
73
76
|
const rangeHeader = request.method === "GET" ? request.headers["range"] : undefined;
|
|
74
|
-
const range = rangeHeader !== undefined && matchesIfRange(request.headers["if-range"], etag, lastModified) ?
|
|
77
|
+
const range = rangeHeader !== undefined && matchesIfRange(request.headers["if-range"], etag, lastModified) ? parse2(rangeHeader, file.size) : undefined;
|
|
75
78
|
if (range === "unsatisfiable")
|
|
76
79
|
return HttpServerResponse.empty({
|
|
77
80
|
status: 416,
|
|
@@ -107,21 +110,5 @@ function matchesIfRange(ifRange, etag, lastModified) {
|
|
|
107
110
|
function stripWeak(etag) {
|
|
108
111
|
return etag.trim().replace(/^w\//i, "");
|
|
109
112
|
}
|
|
110
|
-
function parseRange(header, size) {
|
|
111
|
-
const match = /^bytes=\s*(\d*)\s*-\s*(\d*)\s*$/i.exec(header.trim());
|
|
112
|
-
if (match === null || match[1] === "" && match[2] === "")
|
|
113
|
-
return;
|
|
114
|
-
if (match[1] === "") {
|
|
115
|
-
const suffix = Number(match[2]);
|
|
116
|
-
if (suffix === 0 || size === 0)
|
|
117
|
-
return "unsatisfiable";
|
|
118
|
-
return { start: Math.max(size - suffix, 0), end: size - 1 };
|
|
119
|
-
}
|
|
120
|
-
const start = Number(match[1]);
|
|
121
|
-
const end = match[2] === "" ? size - 1 : Number(match[2]);
|
|
122
|
-
if (start > end || start >= size)
|
|
123
|
-
return "unsatisfiable";
|
|
124
|
-
return { start, end: Math.min(end, size - 1) };
|
|
125
|
-
}
|
|
126
113
|
|
|
127
114
|
export { FileSystemHandler2 };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
// src/middleware/defect-response.ts
|
|
2
|
+
import { StorageFailure } from "@opencode/core/database/storage-failure";
|
|
3
|
+
import { UnknownError } from "@opencode/protocol/errors";
|
|
4
|
+
import { Cause, Effect } from "effect";
|
|
5
|
+
import { HttpRouter, HttpServerError, HttpServerRequest, HttpServerResponse } from "effect/http";
|
|
6
|
+
var respond = HttpServerResponse.schemaJson(UnknownError);
|
|
7
|
+
var defectResponseLayer2 = HttpRouter.middleware((effect) => effect.pipe(Effect.catchCause((cause) => Effect.gen(function* () {
|
|
8
|
+
const [response] = yield* HttpServerError.causeResponse(cause);
|
|
9
|
+
if (response.status !== 500 || response.body._tag !== "Empty")
|
|
10
|
+
return yield* Effect.failCause(cause);
|
|
11
|
+
const request = yield* HttpServerRequest.HttpServerRequest;
|
|
12
|
+
const ref = `err_${crypto.randomUUID().slice(0, 8)}`;
|
|
13
|
+
yield* Effect.logError("request failed", cause).pipe(Effect.annotateLogs({ ref, route: `${request.method} ${request.url}` }));
|
|
14
|
+
const body = yield* respond(new UnknownError({
|
|
15
|
+
message: StorageFailure.message(cause) ?? "Server failed to handle the request. Check server logs for details.",
|
|
16
|
+
ref
|
|
17
|
+
}), { status: 500 }).pipe(Effect.orDie);
|
|
18
|
+
return yield* Effect.failCause(Cause.combine(cause, Cause.die(body)));
|
|
19
|
+
}))), { global: true });
|
|
20
|
+
|
|
21
|
+
export { defectResponseLayer2 };
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
missingSession2
|
|
3
|
-
} from "./
|
|
3
|
+
} from "./media-uri-smaf4a18.js";
|
|
4
4
|
import {
|
|
5
5
|
locationErrors2,
|
|
6
6
|
response2,
|
|
7
7
|
requestRef2
|
|
8
|
-
} from "./
|
|
8
|
+
} from "./media-uri-50bbk3b2.js";
|
|
9
9
|
|
|
10
10
|
// src/handlers/artifact.ts
|
|
11
11
|
import { Artifact } from "@opencode/core/artifact";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
requestRef2
|
|
3
|
-
} from "./
|
|
3
|
+
} from "./media-uri-50bbk3b2.js";
|
|
4
4
|
import {
|
|
5
5
|
Api2
|
|
6
|
-
} from "./
|
|
6
|
+
} from "./media-uri-j87xz9bt.js";
|
|
7
7
|
|
|
8
8
|
// src/handlers/debug.ts
|
|
9
9
|
import { LocationServiceMap } from "@opencode/core/location-service-map";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
__export
|
|
3
|
-
} from "./
|
|
3
|
+
} from "./media-uri-9rqn6x4v.js";
|
|
4
4
|
|
|
5
5
|
// src/event-feed.ts
|
|
6
6
|
var exports_event_feed = {};
|
|
@@ -11,7 +11,7 @@ __export(exports_event_feed, {
|
|
|
11
11
|
SubscriberCapacity: () => SubscriberCapacity2,
|
|
12
12
|
SubscriberOverflowError: () => SubscriberOverflowError2,
|
|
13
13
|
frame: () => frame2,
|
|
14
|
-
layer: () =>
|
|
14
|
+
layer: () => layer3,
|
|
15
15
|
make: () => make4
|
|
16
16
|
});
|
|
17
17
|
import { Bus } from "@opencode/core/bus";
|
|
@@ -76,9 +76,9 @@ var make4 = Effect.fn("EventFeed.make")(function* (observe, options) {
|
|
|
76
76
|
subscribe: (types) => Effect.acquireRelease(Queue.dropping(capacity).pipe(Effect.tap((queue) => Effect.sync(() => subscribers.set(queue, types?.length ? new Set(types) : undefined)))), (queue) => Effect.sync(() => subscribers.delete(queue)).pipe(Effect.andThen(Queue.shutdown(queue)), Effect.asVoid)).pipe(Effect.map(Stream.fromQueue))
|
|
77
77
|
});
|
|
78
78
|
});
|
|
79
|
-
var
|
|
79
|
+
var layer3 = Layer.effect(Service3, Effect.gen(function* () {
|
|
80
80
|
const bus = yield* Bus.Service;
|
|
81
81
|
return yield* make4(bus.listen);
|
|
82
82
|
}));
|
|
83
83
|
|
|
84
|
-
export { SubscriberCapacity2, SubscriberOverflowError2, EncodingError2, Service3, frame2, make4,
|
|
84
|
+
export { SubscriberCapacity2, SubscriberOverflowError2, EncodingError2, Service3, frame2, make4, layer3, exports_event_feed };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
awaitPlugins2,
|
|
3
3
|
response2
|
|
4
|
-
} from "./
|
|
4
|
+
} from "./media-uri-50bbk3b2.js";
|
|
5
5
|
import {
|
|
6
6
|
Api2
|
|
7
|
-
} from "./
|
|
7
|
+
} from "./media-uri-j87xz9bt.js";
|
|
8
8
|
|
|
9
9
|
// src/handlers/model.ts
|
|
10
10
|
import { Model } from "@opencode/core/model";
|
|
@@ -1,36 +1,39 @@
|
|
|
1
1
|
import {
|
|
2
2
|
layer4
|
|
3
|
-
} from "./
|
|
3
|
+
} from "./media-uri-50bbk3b2.js";
|
|
4
4
|
import {
|
|
5
5
|
formLocationLayer2
|
|
6
|
-
} from "./
|
|
6
|
+
} from "./media-uri-htyf2qs7.js";
|
|
7
7
|
import {
|
|
8
8
|
sessionLocationLayer2
|
|
9
|
-
} from "./
|
|
9
|
+
} from "./media-uri-b3bmdkga.js";
|
|
10
10
|
import {
|
|
11
11
|
Api2
|
|
12
|
-
} from "./
|
|
12
|
+
} from "./media-uri-j87xz9bt.js";
|
|
13
13
|
import {
|
|
14
14
|
Config2
|
|
15
|
-
} from "./
|
|
15
|
+
} from "./media-uri-j4at0y5c.js";
|
|
16
16
|
import {
|
|
17
17
|
CorsConfig2
|
|
18
|
-
} from "./
|
|
18
|
+
} from "./media-uri-q4bn6dy8.js";
|
|
19
19
|
import {
|
|
20
|
-
|
|
21
|
-
} from "./
|
|
20
|
+
layer2
|
|
21
|
+
} from "./media-uri-z3e7v67k.js";
|
|
22
22
|
import {
|
|
23
23
|
node2
|
|
24
|
-
} from "./
|
|
24
|
+
} from "./media-uri-mzs0n5xz.js";
|
|
25
25
|
import {
|
|
26
26
|
handlers2
|
|
27
|
-
} from "./
|
|
27
|
+
} from "./media-uri-3pb3n73h.js";
|
|
28
28
|
import {
|
|
29
29
|
authorizationLayer2
|
|
30
|
-
} from "./
|
|
30
|
+
} from "./media-uri-7b9xm1qg.js";
|
|
31
31
|
import {
|
|
32
32
|
schemaErrorLayer2
|
|
33
|
-
} from "./
|
|
33
|
+
} from "./media-uri-bd8755ek.js";
|
|
34
|
+
import {
|
|
35
|
+
defectResponseLayer2
|
|
36
|
+
} from "./media-uri-n26yr6pw.js";
|
|
34
37
|
|
|
35
38
|
// src/routes.ts
|
|
36
39
|
import { Database } from "@opencode/core/database/database";
|
|
@@ -48,6 +51,8 @@ import { PermissionSaved } from "@opencode/core/permission/saved";
|
|
|
48
51
|
import { PtyTicket } from "@opencode/core/pty/ticket";
|
|
49
52
|
import { PersistentPty } from "@opencode/core/persistent-pty";
|
|
50
53
|
import { Project } from "@opencode/core/project";
|
|
54
|
+
import { BlobStore } from "@opencode/core/blob-store";
|
|
55
|
+
import { VideoGeneration } from "@opencode/core/video-generation";
|
|
51
56
|
import { Worktree } from "@opencode/core/worktree";
|
|
52
57
|
import { Session } from "@opencode/core/session";
|
|
53
58
|
import { Instance } from "@opencode/core/instance/service";
|
|
@@ -65,7 +70,7 @@ import { LocationServiceMap } from "@opencode/core/location-service-map";
|
|
|
65
70
|
import { LocationActivity } from "@opencode/core/location-activity";
|
|
66
71
|
import { ModelsDev } from "@opencode/core/models-dev";
|
|
67
72
|
import { SessionRestart } from "@opencode/core/session/execution/restart";
|
|
68
|
-
import {
|
|
73
|
+
import { Automation } from "@opencode/core/automation";
|
|
69
74
|
import { PluginUpdate } from "@opencode/core/plugin/update";
|
|
70
75
|
import { SdkPlugins } from "@opencode/core/plugin/sdk";
|
|
71
76
|
import { WellKnown } from "@opencode/core/wellknown";
|
|
@@ -104,7 +109,9 @@ var applicationServiceNodes = [
|
|
|
104
109
|
LocationServiceMap.node,
|
|
105
110
|
LocationActivity.node,
|
|
106
111
|
SessionRestart.node,
|
|
107
|
-
|
|
112
|
+
Automation.node,
|
|
113
|
+
BlobStore.node,
|
|
114
|
+
VideoGeneration.node,
|
|
108
115
|
Workspace.node,
|
|
109
116
|
FileWatch.node
|
|
110
117
|
];
|
|
@@ -133,7 +140,10 @@ function makeRoutes(auth, options, serviceURLs, overrides, instances) {
|
|
|
133
140
|
file: options.config?.file,
|
|
134
141
|
content: options.config?.content
|
|
135
142
|
})),
|
|
136
|
-
InstructionDiscovery.node.replace(InstructionDiscovery.configured({
|
|
143
|
+
InstructionDiscovery.node.replace(InstructionDiscovery.configured({
|
|
144
|
+
project: options.config?.project,
|
|
145
|
+
claude: options.instructions?.claude
|
|
146
|
+
})),
|
|
137
147
|
ShellSelect.node.replace(ShellSelect.configured({ gitbash: options.windows?.gitbash })),
|
|
138
148
|
Mcp.node.replace(Mcp.configured({
|
|
139
149
|
clientInfo: {
|
|
@@ -157,8 +167,8 @@ function makeRoutes(auth, options, serviceURLs, overrides, instances) {
|
|
|
157
167
|
})) : build(overrides);
|
|
158
168
|
return serviceLayer.pipe(Layer.flatMap((context) => {
|
|
159
169
|
const services = Layer.succeedContext(context);
|
|
160
|
-
const requestServices = Layer.merge(Layer.succeedContext(Context.pick(Database.Service, Credential.Service, PermissionSaved.Service, PluginUpdate.Service, Project.Service, WellKnown.Service)(context)),
|
|
161
|
-
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));
|
|
170
|
+
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));
|
|
171
|
+
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.merge(defectResponseLayer2), Layer.provideMerge(services), Layer.provideMerge(HttpRouter.layer));
|
|
162
172
|
return Layer.merge(api, V1Migration.layer.pipe(Layer.provide(services)));
|
|
163
173
|
}));
|
|
164
174
|
}
|
|
@@ -3,16 +3,16 @@ import {
|
|
|
3
3
|
missingMessage2,
|
|
4
4
|
failedMessageDecode2,
|
|
5
5
|
failedSnapshot2
|
|
6
|
-
} from "./
|
|
6
|
+
} from "./media-uri-smaf4a18.js";
|
|
7
7
|
import {
|
|
8
8
|
locationErrors2
|
|
9
|
-
} from "./
|
|
9
|
+
} from "./media-uri-50bbk3b2.js";
|
|
10
10
|
import {
|
|
11
11
|
Api2
|
|
12
|
-
} from "./
|
|
12
|
+
} from "./media-uri-j87xz9bt.js";
|
|
13
13
|
import {
|
|
14
14
|
wantsMediaRefs2
|
|
15
|
-
} from "./
|
|
15
|
+
} from "./media-uri-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 "./
|
|
3
|
+
} from "./media-uri-q4bn6dy8.js";
|
|
4
4
|
import {
|
|
5
5
|
middleware2
|
|
6
|
-
} from "./
|
|
6
|
+
} from "./media-uri-myqk22k5.js";
|
|
7
7
|
import {
|
|
8
8
|
withoutParentSpan2
|
|
9
|
-
} from "./
|
|
9
|
+
} from "./media-uri-yc7nft6q.js";
|
|
10
10
|
import {
|
|
11
11
|
createRoutes2
|
|
12
|
-
} from "./
|
|
12
|
+
} from "./media-uri-sssj0qa5.js";
|
|
13
13
|
import {
|
|
14
14
|
__export
|
|
15
|
-
} from "./
|
|
15
|
+
} from "./media-uri-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: () => make3
|
|
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 make3 = 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 { make3, exports_fetch };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
response2
|
|
3
|
-
} from "./
|
|
3
|
+
} from "./media-uri-50bbk3b2.js";
|
|
4
4
|
import {
|
|
5
5
|
Api2
|
|
6
|
-
} from "./
|
|
6
|
+
} from "./media-uri-j87xz9bt.js";
|
|
7
7
|
|
|
8
8
|
// src/handlers/reference.ts
|
|
9
9
|
import { Reference } from "@opencode/core/reference";
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Api2
|
|
3
|
-
} from "./
|
|
3
|
+
} from "./media-uri-j87xz9bt.js";
|
|
4
4
|
import {
|
|
5
5
|
SESSION_TTL_SECONDS2,
|
|
6
6
|
Config2,
|
|
7
7
|
issueSession2,
|
|
8
8
|
sessionCookieName2
|
|
9
|
-
} from "./
|
|
10
|
-
import {
|
|
11
|
-
Service4
|
|
12
|
-
} from "./auth-yjbzmfhm.js";
|
|
9
|
+
} from "./media-uri-j4at0y5c.js";
|
|
13
10
|
import {
|
|
14
11
|
Service2
|
|
15
|
-
} from "./
|
|
12
|
+
} from "./media-uri-z3e7v67k.js";
|
|
13
|
+
import {
|
|
14
|
+
Service4
|
|
15
|
+
} from "./media-uri-mzs0n5xz.js";
|
|
16
16
|
|
|
17
17
|
// src/handlers/server.ts
|
|
18
18
|
import { hostname } from "node:os";
|
|
@@ -22,10 +22,10 @@ import { HttpApiBuilder } from "effect/http-api";
|
|
|
22
22
|
import { PersistentPty } from "@opencode/core/persistent-pty";
|
|
23
23
|
import { UnauthorizedError } from "@opencode/protocol/errors";
|
|
24
24
|
var ServerHandler2 = HttpApiBuilder.group(Api2, "server.server", (handlers) => Effect.gen(function* () {
|
|
25
|
-
const pairing = yield*
|
|
25
|
+
const pairing = yield* Service4;
|
|
26
26
|
const auth = yield* Config2;
|
|
27
27
|
return handlers.handle("server.info", () => Effect.gen(function* () {
|
|
28
|
-
const info = yield*
|
|
28
|
+
const info = yield* Service2;
|
|
29
29
|
return {
|
|
30
30
|
version: info.app.version ?? "unknown",
|
|
31
31
|
pid: process.pid ?? 0,
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Api2
|
|
3
|
-
} from "./
|
|
3
|
+
} from "./media-uri-j87xz9bt.js";
|
|
4
4
|
import {
|
|
5
5
|
requireConnectable2
|
|
6
|
-
} from "./
|
|
6
|
+
} from "./media-uri-91858wp1.js";
|
|
7
7
|
|
|
8
8
|
// src/handlers/credential.ts
|
|
9
9
|
import { Credential } from "@opencode/core/credential";
|