@opencode/server 0.0.0-dev-1326 → 0.0.0-dev-1328
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/{event-feed-9d8cvn0j.js → service-status-065pppgn.js} +2 -2
- package/dist/chunks/{event-feed-dx59hhqy.js → service-status-0tp9bckc.js} +1 -1
- package/dist/chunks/{event-feed-d6gdrha6.js → service-status-11f90p14.js} +4 -4
- package/dist/chunks/{event-feed-8q8t4r9z.js → service-status-27f8nny0.js} +2 -2
- package/dist/chunks/{event-feed-4vbpeb73.js → service-status-2b13xzyt.js} +2 -2
- package/dist/chunks/{event-feed-y50v5y23.js → service-status-2mxtghfa.js} +4 -4
- package/dist/chunks/{event-feed-harnzwyx.js → service-status-2q06e3dd.js} +1 -1
- package/dist/chunks/{event-feed-jdn2h5zy.js → service-status-500wz90y.js} +2 -2
- package/dist/chunks/{event-feed-b1prsepx.js → service-status-5pdfedjd.js} +4 -4
- package/dist/chunks/{event-feed-cha5bc7v.js → service-status-669rq3zn.js} +3 -3
- package/dist/chunks/{event-feed-aw6r5m46.js → service-status-7qpea5x7.js} +2 -2
- package/dist/chunks/{event-feed-7ydfwv45.js → service-status-7ydfwv45.js} +1 -1
- package/dist/chunks/{event-feed-a9m1qywq.js → service-status-8pn9ceqg.js} +3 -3
- package/dist/chunks/{event-feed-8sb6qqpn.js → service-status-8sb6qqpn.js} +1 -1
- package/dist/chunks/{event-feed-9cd3a4b8.js → service-status-9cd3a4b8.js} +1 -1
- package/dist/chunks/{event-feed-tphz28p0.js → service-status-9m7aaymn.js} +6 -6
- package/dist/chunks/{event-feed-kstarh2s.js → service-status-ah2sj2pr.js} +1 -1
- package/dist/chunks/{event-feed-mnk4yp0a.js → service-status-ahhjt1wh.js} +2 -2
- package/dist/chunks/{event-feed-735y9bwf.js → service-status-c0pd5awd.js} +2 -2
- package/dist/chunks/{event-feed-6jmqkv3t.js → service-status-c2jea2a4.js} +33 -33
- package/dist/chunks/{event-feed-55yh37zc.js → service-status-cx7az6y7.js} +2 -2
- package/dist/chunks/{event-feed-vxnq9y72.js → service-status-czwdbrx9.js} +8 -8
- package/dist/chunks/{event-feed-5z0ssrt9.js → service-status-ddhwaz88.js} +16 -16
- package/dist/chunks/{event-feed-syfzpkey.js → service-status-dea17tr1.js} +38 -1
- package/dist/chunks/{event-feed-djr0jy89.js → service-status-djr0jy89.js} +1 -1
- package/dist/chunks/{event-feed-39nnfjx1.js → service-status-e6e4kz0w.js} +4 -4
- package/dist/chunks/{event-feed-p4hr7w7j.js → service-status-fhb2ewd9.js} +2 -2
- package/dist/chunks/{event-feed-g23ffrnz.js → service-status-g23ffrnz.js} +2 -2
- package/dist/chunks/{event-feed-2d18d1yn.js → service-status-ghcy4ddk.js} +1 -1
- package/dist/chunks/{event-feed-j4at0y5c.js → service-status-j4at0y5c.js} +1 -1
- package/dist/chunks/{event-feed-0bzgr4rt.js → service-status-j9bm09j4.js} +1 -1
- package/dist/chunks/{event-feed-rxp97434.js → service-status-jefwk804.js} +4 -4
- package/dist/chunks/{event-feed-mbf5t0tq.js → service-status-k3qt4jsw.js} +1 -1
- package/dist/chunks/{event-feed-mzs0n5xz.js → service-status-kqr36gas.js} +7 -7
- package/dist/chunks/{event-feed-knscys1g.js → service-status-kzdsh5dh.js} +4 -4
- package/dist/chunks/{event-feed-myqk22k5.js → service-status-myqk22k5.js} +2 -2
- package/dist/chunks/{event-feed-6f7nn4kk.js → service-status-n7n1k6t0.js} +2 -2
- package/dist/chunks/{event-feed-5b1w9hwr.js → service-status-nezkqcz0.js} +2 -2
- package/dist/chunks/{event-feed-rktygpea.js → service-status-rktygpea.js} +1 -1
- package/dist/chunks/{event-feed-ye16b3jy.js → service-status-ryf8gt7t.js} +2 -2
- package/dist/chunks/{event-feed-arzv3fj6.js → service-status-s802fzg1.js} +6 -6
- package/dist/chunks/{event-feed-tb37vts4.js → service-status-sy5t2m60.js} +13 -11
- package/dist/chunks/{event-feed-t32e1bbt.js → service-status-t32e1bbt.js} +1 -1
- package/dist/chunks/{event-feed-ytyf0yt4.js → service-status-vw0q3knq.js} +1 -1
- package/dist/chunks/{event-feed-6ptjjp36.js → service-status-w7qv5azt.js} +2 -2
- package/dist/chunks/{event-feed-1pw2nrsx.js → service-status-wtrkk6n8.js} +1 -1
- package/dist/chunks/{event-feed-p7f8d9ed.js → service-status-xbjz2dvd.js} +4 -4
- package/dist/chunks/{event-feed-e4amrgg0.js → service-status-xhsknm82.js} +2 -2
- package/dist/chunks/{event-feed-8ptkdkh0.js → service-status-xygx09yd.js} +2 -2
- package/dist/chunks/{event-feed-vjj7wrqn.js → service-status-yr4jk19s.js} +2 -2
- package/dist/chunks/{event-feed-tdwf54y9.js → service-status-ywn523ee.js} +3 -3
- package/dist/chunks/{event-feed-3cp4agan.js → service-status-yyxv56x7.js} +3 -3
- package/dist/chunks/{event-feed-0d9m1wm4.js → service-status-z030czn6.js} +2 -2
- package/dist/chunks/{event-feed-a5hb5213.js → service-status-z4znncxg.js} +2 -2
- 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.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.d.ts +22 -0
- package/dist/handlers/machine.js +4 -2
- 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.js +53 -53
- package/dist/location.js +4 -4
- 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.js +57 -57
- package/dist/server-info.js +3 -3
- package/dist/service-status.js +3 -3
- package/dist/workerd.js +63 -63
- package/package.json +8 -8
- /package/dist/chunks/{event-feed-9rqn6x4v.js → service-status-9rqn6x4v.js} +0 -0
- /package/dist/chunks/{event-feed-bd8755ek.js → service-status-bd8755ek.js} +0 -0
- /package/dist/chunks/{event-feed-n26yr6pw.js → service-status-n26yr6pw.js} +0 -0
- /package/dist/chunks/{event-feed-q187pxxd.js → service-status-q187pxxd.js} +0 -0
- /package/dist/chunks/{event-feed-q4bn6dy8.js → service-status-q4bn6dy8.js} +0 -0
- /package/dist/chunks/{event-feed-smaf4a18.js → service-status-smaf4a18.js} +0 -0
- /package/dist/chunks/{event-feed-xthc02cw.js → service-status-xthc02cw.js} +0 -0
- /package/dist/chunks/{event-feed-yc7nft6q.js → service-status-yc7nft6q.js} +0 -0
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/service-status-8pn9ceqg.js";
|
|
4
|
+
import"./chunks/service-status-ah2sj2pr.js";
|
|
5
|
+
import"./chunks/service-status-vw0q3knq.js";
|
|
6
|
+
import"./chunks/service-status-ywn523ee.js";
|
|
7
|
+
import"./chunks/service-status-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 "./
|
|
3
|
+
} from "./service-status-ywn523ee.js";
|
|
4
4
|
import {
|
|
5
5
|
Api2
|
|
6
|
-
} from "./
|
|
6
|
+
} from "./service-status-8pn9ceqg.js";
|
|
7
7
|
|
|
8
8
|
// src/handlers/provider.ts
|
|
9
9
|
import { Provider } from "@opencode/core/provider";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Api2
|
|
3
|
-
} from "./
|
|
3
|
+
} from "./service-status-8pn9ceqg.js";
|
|
4
4
|
import {
|
|
5
|
-
|
|
5
|
+
Service4,
|
|
6
6
|
frame2
|
|
7
|
-
} from "./
|
|
7
|
+
} from "./service-status-s802fzg1.js";
|
|
8
8
|
|
|
9
9
|
// src/handlers/event.ts
|
|
10
10
|
import { Event } from "@opencode/schema/event";
|
|
@@ -12,7 +12,7 @@ import { Effect, Stream } from "effect";
|
|
|
12
12
|
import { HttpServerResponse } from "effect/http";
|
|
13
13
|
import { HttpApiBuilder } from "effect/http-api";
|
|
14
14
|
var EventHandler2 = HttpApiBuilder.group(Api2, "server.event", (handlers) => Effect.gen(function* () {
|
|
15
|
-
const feed = yield*
|
|
15
|
+
const feed = yield* Service4;
|
|
16
16
|
return handlers.handleRaw("event.subscribe", (ctx) => Effect.gen(function* () {
|
|
17
17
|
const connected = {
|
|
18
18
|
id: Event.ID.create(),
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
response2
|
|
3
|
-
} from "./
|
|
3
|
+
} from "./service-status-ywn523ee.js";
|
|
4
4
|
import {
|
|
5
5
|
Api2
|
|
6
|
-
} from "./
|
|
6
|
+
} from "./service-status-8pn9ceqg.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
|
response2
|
|
3
|
-
} from "./
|
|
3
|
+
} from "./service-status-ywn523ee.js";
|
|
4
4
|
import {
|
|
5
5
|
Api2
|
|
6
|
-
} from "./
|
|
6
|
+
} from "./service-status-8pn9ceqg.js";
|
|
7
7
|
|
|
8
8
|
// src/handlers/integration.ts
|
|
9
9
|
import { Integration } from "@opencode/core/integration";
|
|
@@ -2,18 +2,18 @@ import {
|
|
|
2
2
|
locationErrors2,
|
|
3
3
|
response2,
|
|
4
4
|
requestRef2
|
|
5
|
-
} from "./
|
|
5
|
+
} from "./service-status-ywn523ee.js";
|
|
6
6
|
import {
|
|
7
7
|
Api2
|
|
8
|
-
} from "./
|
|
8
|
+
} from "./service-status-8pn9ceqg.js";
|
|
9
9
|
import {
|
|
10
10
|
CorsConfig2,
|
|
11
11
|
isAllowedRequestOrigin2
|
|
12
|
-
} from "./
|
|
12
|
+
} from "./service-status-q4bn6dy8.js";
|
|
13
13
|
import {
|
|
14
14
|
runPtySocket2,
|
|
15
15
|
holdLocation2
|
|
16
|
-
} from "./
|
|
16
|
+
} from "./service-status-q187pxxd.js";
|
|
17
17
|
|
|
18
18
|
// src/handlers/pty.ts
|
|
19
19
|
import { Pty } from "@opencode/core/pty";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
requestRef2
|
|
3
|
-
} from "./
|
|
3
|
+
} from "./service-status-ywn523ee.js";
|
|
4
4
|
import {
|
|
5
5
|
Api2
|
|
6
|
-
} from "./
|
|
6
|
+
} from "./service-status-8pn9ceqg.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 "./service-status-9rqn6x4v.js";
|
|
4
4
|
|
|
5
5
|
// src/server-info.ts
|
|
6
6
|
var exports_server_info = {};
|
|
@@ -8,14 +8,14 @@ __export(exports_server_info, {
|
|
|
8
8
|
ServerInfo: () => exports_server_info,
|
|
9
9
|
Service: () => Service3,
|
|
10
10
|
connectionURLs: () => connectionURLs2,
|
|
11
|
-
layer: () =>
|
|
11
|
+
layer: () => layer2
|
|
12
12
|
});
|
|
13
13
|
import { Context, Layer } from "effect";
|
|
14
14
|
import { networkInterfaces } from "node:os";
|
|
15
15
|
|
|
16
16
|
class Service3 extends Context.Service()("@opencode/server/ServerInfo") {
|
|
17
17
|
}
|
|
18
|
-
function
|
|
18
|
+
function layer2(urls, tmp, app = {}) {
|
|
19
19
|
return Layer.succeed(Service3, Service3.of({ urls, app, paths: { tmp } }));
|
|
20
20
|
}
|
|
21
21
|
function connectionURLs2(value, requestedHostname) {
|
|
@@ -38,4 +38,4 @@ function connectionURLs2(value, requestedHostname) {
|
|
|
38
38
|
];
|
|
39
39
|
}
|
|
40
40
|
|
|
41
|
-
export { Service3,
|
|
41
|
+
export { Service3, layer2, connectionURLs2, exports_server_info };
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import {
|
|
2
2
|
missingSession2
|
|
3
|
-
} from "./
|
|
3
|
+
} from "./service-status-smaf4a18.js";
|
|
4
4
|
import {
|
|
5
5
|
locationErrors2,
|
|
6
6
|
response2,
|
|
7
7
|
sessionInfo2
|
|
8
|
-
} from "./
|
|
8
|
+
} from "./service-status-ywn523ee.js";
|
|
9
9
|
import {
|
|
10
10
|
Api2
|
|
11
|
-
} from "./
|
|
11
|
+
} from "./service-status-8pn9ceqg.js";
|
|
12
12
|
|
|
13
13
|
// src/handlers/permission.ts
|
|
14
14
|
import { Instance } from "@opencode/core/instance/service";
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
missingSession2
|
|
3
|
-
} from "./
|
|
3
|
+
} from "./service-status-smaf4a18.js";
|
|
4
4
|
import {
|
|
5
5
|
locationErrors2,
|
|
6
6
|
response2,
|
|
7
7
|
requestRef2
|
|
8
|
-
} from "./
|
|
8
|
+
} from "./service-status-ywn523ee.js";
|
|
9
9
|
|
|
10
10
|
// src/handlers/artifact.ts
|
|
11
11
|
import { Artifact } from "@opencode/core/artifact";
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
LocationMiddleware2
|
|
3
|
-
} from "./
|
|
3
|
+
} from "./service-status-ywn523ee.js";
|
|
4
4
|
import {
|
|
5
5
|
FormLocationMiddleware2
|
|
6
|
-
} from "./
|
|
6
|
+
} from "./service-status-ah2sj2pr.js";
|
|
7
7
|
import {
|
|
8
8
|
SessionLocationMiddleware2
|
|
9
|
-
} from "./
|
|
9
|
+
} from "./service-status-vw0q3knq.js";
|
|
10
10
|
|
|
11
11
|
// src/api.ts
|
|
12
12
|
import { makeDefaultApi } from "@opencode/protocol/api";
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Api2
|
|
3
|
-
} from "./
|
|
3
|
+
} from "./service-status-8pn9ceqg.js";
|
|
4
4
|
import {
|
|
5
5
|
SESSION_TTL_SECONDS2,
|
|
6
6
|
Config2,
|
|
7
7
|
issueSession2,
|
|
8
8
|
sessionCookieName2
|
|
9
|
-
} from "./
|
|
9
|
+
} from "./service-status-j4at0y5c.js";
|
|
10
10
|
import {
|
|
11
11
|
Service3
|
|
12
|
-
} from "./
|
|
12
|
+
} from "./service-status-5pdfedjd.js";
|
|
13
13
|
import {
|
|
14
|
-
|
|
15
|
-
} from "./
|
|
14
|
+
Service2
|
|
15
|
+
} from "./service-status-kqr36gas.js";
|
|
16
16
|
|
|
17
17
|
// src/handlers/server.ts
|
|
18
18
|
import { hostname } from "node:os";
|
|
@@ -22,7 +22,7 @@ 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* Service2;
|
|
26
26
|
const auth = yield* Config2;
|
|
27
27
|
return handlers.handle("server.info", () => Effect.gen(function* () {
|
|
28
28
|
const info = yield* Service3;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
response2
|
|
3
|
-
} from "./
|
|
3
|
+
} from "./service-status-ywn523ee.js";
|
|
4
4
|
import {
|
|
5
5
|
Api2
|
|
6
|
-
} from "./
|
|
6
|
+
} from "./service-status-8pn9ceqg.js";
|
|
7
7
|
|
|
8
8
|
// src/handlers/model.ts
|
|
9
9
|
import { Model } from "@opencode/core/model";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
response2
|
|
3
|
-
} from "./
|
|
3
|
+
} from "./service-status-ywn523ee.js";
|
|
4
4
|
import {
|
|
5
5
|
Api2
|
|
6
|
-
} from "./
|
|
6
|
+
} from "./service-status-8pn9ceqg.js";
|
|
7
7
|
|
|
8
8
|
// src/handlers/skill.ts
|
|
9
9
|
import { Skill } from "@opencode/core/skill";
|
|
@@ -1,102 +1,102 @@
|
|
|
1
1
|
import {
|
|
2
2
|
GenerateHandler2
|
|
3
|
-
} from "./
|
|
3
|
+
} from "./service-status-w7qv5azt.js";
|
|
4
4
|
import {
|
|
5
5
|
VoiceHandler2
|
|
6
|
-
} from "./
|
|
6
|
+
} from "./service-status-xygx09yd.js";
|
|
7
7
|
import {
|
|
8
8
|
MessageHandler2
|
|
9
|
-
} from "./
|
|
9
|
+
} from "./service-status-yyxv56x7.js";
|
|
10
10
|
import {
|
|
11
11
|
ModelHandler2
|
|
12
|
-
} from "./
|
|
12
|
+
} from "./service-status-ahhjt1wh.js";
|
|
13
13
|
import {
|
|
14
14
|
ProviderHandler2
|
|
15
|
-
} from "./
|
|
15
|
+
} from "./service-status-065pppgn.js";
|
|
16
16
|
import {
|
|
17
17
|
SessionHandler2
|
|
18
|
-
} from "./
|
|
18
|
+
} from "./service-status-kzdsh5dh.js";
|
|
19
19
|
import {
|
|
20
20
|
PermissionHandler2
|
|
21
|
-
} from "./
|
|
21
|
+
} from "./service-status-669rq3zn.js";
|
|
22
22
|
import {
|
|
23
23
|
FileSystemHandler2
|
|
24
|
-
} from "./
|
|
24
|
+
} from "./service-status-xbjz2dvd.js";
|
|
25
25
|
import {
|
|
26
26
|
FormHandler2
|
|
27
|
-
} from "./
|
|
27
|
+
} from "./service-status-cx7az6y7.js";
|
|
28
28
|
import {
|
|
29
29
|
CommandHandler2
|
|
30
|
-
} from "./
|
|
30
|
+
} from "./service-status-27f8nny0.js";
|
|
31
31
|
import {
|
|
32
32
|
SkillHandler2
|
|
33
|
-
} from "./
|
|
33
|
+
} from "./service-status-c0pd5awd.js";
|
|
34
34
|
import {
|
|
35
35
|
RpcHandler2
|
|
36
|
-
} from "./
|
|
36
|
+
} from "./service-status-k3qt4jsw.js";
|
|
37
37
|
import {
|
|
38
38
|
layer3
|
|
39
|
-
} from "./
|
|
39
|
+
} from "./service-status-s802fzg1.js";
|
|
40
40
|
import {
|
|
41
41
|
EventHandler2
|
|
42
|
-
} from "./
|
|
42
|
+
} from "./service-status-11f90p14.js";
|
|
43
43
|
import {
|
|
44
44
|
AgentHandler2
|
|
45
|
-
} from "./
|
|
45
|
+
} from "./service-status-nezkqcz0.js";
|
|
46
46
|
import {
|
|
47
47
|
PluginHandler2
|
|
48
|
-
} from "./
|
|
48
|
+
} from "./service-status-ryf8gt7t.js";
|
|
49
49
|
import {
|
|
50
50
|
ServerHandler2
|
|
51
|
-
} from "./
|
|
51
|
+
} from "./service-status-9m7aaymn.js";
|
|
52
52
|
import {
|
|
53
53
|
DebugHandler2
|
|
54
|
-
} from "./
|
|
54
|
+
} from "./service-status-500wz90y.js";
|
|
55
55
|
import {
|
|
56
56
|
PtyHandler2
|
|
57
|
-
} from "./
|
|
57
|
+
} from "./service-status-2mxtghfa.js";
|
|
58
58
|
import {
|
|
59
59
|
PersistentPtyHandler2
|
|
60
|
-
} from "./
|
|
60
|
+
} from "./service-status-sy5t2m60.js";
|
|
61
61
|
import {
|
|
62
62
|
ShellHandler2
|
|
63
|
-
} from "./
|
|
63
|
+
} from "./service-status-xhsknm82.js";
|
|
64
64
|
import {
|
|
65
65
|
ReferenceHandler2
|
|
66
|
-
} from "./
|
|
66
|
+
} from "./service-status-yr4jk19s.js";
|
|
67
67
|
import {
|
|
68
68
|
LocationHandler2
|
|
69
|
-
} from "./
|
|
69
|
+
} from "./service-status-wtrkk6n8.js";
|
|
70
70
|
import {
|
|
71
71
|
IntegrationHandler2
|
|
72
|
-
} from "./
|
|
72
|
+
} from "./service-status-2b13xzyt.js";
|
|
73
73
|
import {
|
|
74
74
|
WebSearchHandler2
|
|
75
|
-
} from "./
|
|
75
|
+
} from "./service-status-fhb2ewd9.js";
|
|
76
76
|
import {
|
|
77
77
|
UsageHandler2
|
|
78
|
-
} from "./
|
|
78
|
+
} from "./service-status-n7n1k6t0.js";
|
|
79
79
|
import {
|
|
80
80
|
McpHandler2
|
|
81
|
-
} from "./
|
|
81
|
+
} from "./service-status-jefwk804.js";
|
|
82
82
|
import {
|
|
83
83
|
CredentialHandler2
|
|
84
|
-
} from "./
|
|
84
|
+
} from "./service-status-z4znncxg.js";
|
|
85
85
|
import {
|
|
86
86
|
ProjectHandler2
|
|
87
|
-
} from "./
|
|
87
|
+
} from "./service-status-0tp9bckc.js";
|
|
88
88
|
import {
|
|
89
89
|
WorktreeHandler2
|
|
90
|
-
} from "./
|
|
90
|
+
} from "./service-status-2q06e3dd.js";
|
|
91
91
|
import {
|
|
92
92
|
VcsHandler2
|
|
93
|
-
} from "./
|
|
93
|
+
} from "./service-status-z030czn6.js";
|
|
94
94
|
import {
|
|
95
95
|
MigrationHandler2
|
|
96
|
-
} from "./
|
|
96
|
+
} from "./service-status-ghcy4ddk.js";
|
|
97
97
|
import {
|
|
98
98
|
ConfigHandler2
|
|
99
|
-
} from "./
|
|
99
|
+
} from "./service-status-j9bm09j4.js";
|
|
100
100
|
|
|
101
101
|
// src/handlers.ts
|
|
102
102
|
import { Layer } from "effect";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
response2
|
|
3
|
-
} from "./
|
|
3
|
+
} from "./service-status-ywn523ee.js";
|
|
4
4
|
import {
|
|
5
5
|
Api2
|
|
6
|
-
} from "./
|
|
6
|
+
} from "./service-status-8pn9ceqg.js";
|
|
7
7
|
|
|
8
8
|
// src/handlers/form.ts
|
|
9
9
|
import { Form } from "@opencode/core/form";
|
|
@@ -1,32 +1,32 @@
|
|
|
1
1
|
import {
|
|
2
2
|
isAllowedCorsOrigin2
|
|
3
|
-
} from "./
|
|
3
|
+
} from "./service-status-q4bn6dy8.js";
|
|
4
4
|
import {
|
|
5
5
|
middleware2
|
|
6
|
-
} from "./
|
|
6
|
+
} from "./service-status-myqk22k5.js";
|
|
7
7
|
import {
|
|
8
8
|
withoutParentSpan2
|
|
9
|
-
} from "./
|
|
9
|
+
} from "./service-status-yc7nft6q.js";
|
|
10
10
|
import {
|
|
11
11
|
createRoutes2
|
|
12
|
-
} from "./
|
|
12
|
+
} from "./service-status-ddhwaz88.js";
|
|
13
13
|
import {
|
|
14
14
|
__export
|
|
15
|
-
} from "./
|
|
15
|
+
} from "./service-status-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,39 +1,39 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
} from "./
|
|
2
|
+
layer4
|
|
3
|
+
} from "./service-status-ywn523ee.js";
|
|
4
4
|
import {
|
|
5
5
|
formLocationLayer2
|
|
6
|
-
} from "./
|
|
6
|
+
} from "./service-status-ah2sj2pr.js";
|
|
7
7
|
import {
|
|
8
8
|
sessionLocationLayer2
|
|
9
|
-
} from "./
|
|
9
|
+
} from "./service-status-vw0q3knq.js";
|
|
10
10
|
import {
|
|
11
11
|
Api2
|
|
12
|
-
} from "./
|
|
12
|
+
} from "./service-status-8pn9ceqg.js";
|
|
13
13
|
import {
|
|
14
14
|
Config2
|
|
15
|
-
} from "./
|
|
15
|
+
} from "./service-status-j4at0y5c.js";
|
|
16
16
|
import {
|
|
17
17
|
CorsConfig2
|
|
18
|
-
} from "./
|
|
18
|
+
} from "./service-status-q4bn6dy8.js";
|
|
19
19
|
import {
|
|
20
|
-
|
|
21
|
-
} from "./
|
|
20
|
+
layer2
|
|
21
|
+
} from "./service-status-5pdfedjd.js";
|
|
22
22
|
import {
|
|
23
23
|
node2
|
|
24
|
-
} from "./
|
|
24
|
+
} from "./service-status-kqr36gas.js";
|
|
25
25
|
import {
|
|
26
26
|
handlers2
|
|
27
|
-
} from "./
|
|
27
|
+
} from "./service-status-c2jea2a4.js";
|
|
28
28
|
import {
|
|
29
29
|
authorizationLayer2
|
|
30
|
-
} from "./
|
|
30
|
+
} from "./service-status-rktygpea.js";
|
|
31
31
|
import {
|
|
32
32
|
schemaErrorLayer2
|
|
33
|
-
} from "./
|
|
33
|
+
} from "./service-status-bd8755ek.js";
|
|
34
34
|
import {
|
|
35
35
|
defectResponseLayer2
|
|
36
|
-
} from "./
|
|
36
|
+
} from "./service-status-n26yr6pw.js";
|
|
37
37
|
|
|
38
38
|
// src/routes.ts
|
|
39
39
|
import { Database } from "@opencode/core/database/database";
|
|
@@ -173,8 +173,8 @@ function makeRoutes(auth, options, serviceURLs, overrides, instances) {
|
|
|
173
173
|
})) : build(overrides);
|
|
174
174
|
return serviceLayer.pipe(Layer.flatMap((context) => {
|
|
175
175
|
const services = Layer.succeedContext(context);
|
|
176
|
-
const requestServices = Layer.merge(Layer.succeedContext(Context.pick(Database.Service, Credential.Service, PermissionSaved.Service, PluginUpdate.Service, Project.Service, WellKnown.Service)(context)),
|
|
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(
|
|
176
|
+
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(layer4), Layer.provide(authorizationLayer2), Layer.provide(schemaErrorLayer2), Layer.provide(auth), HttpRouter.provideRequest(requestServices), Layer.merge(defectResponseLayer2), Layer.provideMerge(services), Layer.provideMerge(HttpRouter.layer));
|
|
178
178
|
return Layer.merge(api, V1Migration.layer.pipe(Layer.provide(services)));
|
|
179
179
|
}));
|
|
180
180
|
}
|
|
@@ -1,17 +1,21 @@
|
|
|
1
1
|
// src/handlers/machine.ts
|
|
2
2
|
import { NodeHttpServerRequest } from "@effect/platform-node";
|
|
3
3
|
import { WebSocketServer } from "@effect/platform-node-shared/NodeWS";
|
|
4
|
+
import { Environment } from "@opencode/core/environment/index";
|
|
4
5
|
import { Flag } from "@opencode/core/flag";
|
|
5
6
|
import { Location } from "@opencode/core/location";
|
|
6
7
|
import { LocationServiceMap } from "@opencode/core/location-services";
|
|
7
8
|
import { Frames } from "@opencode/core/machine/frames";
|
|
9
|
+
import { Join } from "@opencode/core/machine/join";
|
|
8
10
|
import { Link } from "@opencode/core/machine/link";
|
|
9
11
|
import { Machines } from "@opencode/core/machine/machines";
|
|
10
12
|
import { AbsolutePath } from "@opencode/core/schema";
|
|
13
|
+
import { ConflictError, ForbiddenError, InvalidRequestError, MachineNotFoundError } from "@opencode/protocol/errors";
|
|
11
14
|
import { isWebSocketUpgrade } from "@opencode/protocol/groups/machine";
|
|
12
15
|
import { Global } from "@opencode/util/global";
|
|
13
16
|
import { Context, Effect, Latch, Option, Scope, Semaphore } from "effect";
|
|
14
17
|
import { HttpMiddleware, HttpServerResponse } from "effect/http";
|
|
18
|
+
import { HttpApiSchema } from "effect/http-api";
|
|
15
19
|
import { Socket } from "effect/socket";
|
|
16
20
|
import { IncomingMessage } from "node:http";
|
|
17
21
|
var MAX_HANDSHAKES = 32;
|
|
@@ -140,5 +144,38 @@ var makeMachineLink2 = Effect.gen(function* () {
|
|
|
140
144
|
}).pipe(Effect.scoped, Effect.orElseSucceed(() => HttpServerResponse.empty()), Effect.provide(services));
|
|
141
145
|
});
|
|
142
146
|
});
|
|
147
|
+
var makeMachine2 = Effect.gen(function* () {
|
|
148
|
+
const enabled = yield* machinesEnabled2;
|
|
149
|
+
const machines = yield* Machines.Service;
|
|
150
|
+
const requireEnabled = Effect.gen(function* () {
|
|
151
|
+
if (yield* enabled)
|
|
152
|
+
return;
|
|
153
|
+
return yield* new ForbiddenError({ message: "Machines are disabled; enable experimental.machines" });
|
|
154
|
+
});
|
|
155
|
+
return {
|
|
156
|
+
list: Effect.fn("MachineHandler.list")(function* () {
|
|
157
|
+
yield* requireEnabled;
|
|
158
|
+
return { data: yield* machines.list() };
|
|
159
|
+
}),
|
|
160
|
+
add: Effect.fn("MachineHandler.add")(function* (payload) {
|
|
161
|
+
yield* requireEnabled;
|
|
162
|
+
const id = yield* machines.add(payload.name).pipe(Effect.catchTag("Machines.AlreadyExists", (error) => Effect.succeed(error.machine)), Effect.catchTag("Machines.InvalidName", (error) => Effect.fail(new InvalidRequestError({ message: error.message, kind: "invalid_name", field: "name" }))));
|
|
163
|
+
const join = yield* machines.invite(id, { reach: payload.reach, replace: payload.replace }).pipe(Effect.catchTags({
|
|
164
|
+
"Machines.AlreadyPaired": (error) => Effect.fail(new ConflictError({ message: error.message, resource: error.machine })),
|
|
165
|
+
"Machines.NotFound": (error) => Effect.fail(new MachineNotFoundError({ machine: error.machine, message: error.message })),
|
|
166
|
+
"Identity.InvalidKey": (error) => Effect.die(error)
|
|
167
|
+
}));
|
|
168
|
+
const decoded = Option.getOrUndefined(Join.decode(join));
|
|
169
|
+
if (!decoded)
|
|
170
|
+
return yield* Effect.die(new Error("Server produced an unreadable join string"));
|
|
171
|
+
return { data: { name: id, join, expires: decoded.expires } };
|
|
172
|
+
}),
|
|
173
|
+
remove: Effect.fn("MachineHandler.remove")(function* (name) {
|
|
174
|
+
yield* requireEnabled;
|
|
175
|
+
yield* machines.remove(Environment.ID.make(name));
|
|
176
|
+
return HttpApiSchema.NoContent.make();
|
|
177
|
+
})
|
|
178
|
+
};
|
|
179
|
+
});
|
|
143
180
|
|
|
144
|
-
export { Watch2, machinesEnabled2, upgrade2, carrier2, keepalive2, makeMachineLink2 };
|
|
181
|
+
export { Watch2, machinesEnabled2, upgrade2, carrier2, keepalive2, makeMachineLink2, makeMachine2 };
|