@opencode/server 0.0.0-dev-1074 → 0.0.0-dev-1111
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/{options-059rbh9c.js → cors-059rbh9c.js} +1 -1
- package/dist/chunks/{options-jr0zs68z.js → cors-07m4906f.js} +6 -3
- package/dist/chunks/{options-7p3x2xdt.js → cors-0tg0yqad.js} +1 -1
- package/dist/chunks/{options-39nnfjx1.js → cors-39nnfjx1.js} +1 -1
- package/dist/chunks/{options-n0a33cnc.js → cors-3j7dhvn1.js} +3 -3
- package/dist/chunks/{options-j2hee7a4.js → cors-4786896v.js} +1 -1
- package/dist/chunks/{options-6kxghskv.js → cors-4jn53ynt.js} +4 -2
- package/dist/chunks/{options-9qbtnftt.js → cors-5rj5qfk5.js} +2 -2
- package/dist/chunks/{options-pmr95crm.js → cors-6h0nmx1z.js} +2 -2
- package/dist/chunks/{options-qqjx7zqw.js → cors-721peyt0.js} +2 -2
- package/dist/chunks/{options-78rcgzsr.js → cors-78rcgzsr.js} +1 -1
- package/dist/chunks/{options-7b9xm1qg.js → cors-7b9xm1qg.js} +1 -1
- package/dist/chunks/{options-5pdfedjd.js → cors-7dtbad8d.js} +7 -7
- package/dist/chunks/{options-8g1x5cgg.js → cors-8jrvh9sp.js} +2 -2
- package/dist/chunks/{options-7w7s37ab.js → cors-9ch4v3hj.js} +2 -2
- package/dist/chunks/{options-42tqx64k.js → cors-9w99npj6.js} +1 -1
- package/dist/chunks/{options-xa0sy2cm.js → cors-a91x6bkq.js} +4 -4
- package/dist/chunks/{options-qt7zz6ga.js → cors-ad5yqrsh.js} +8 -8
- package/dist/chunks/{options-wecgp61r.js → cors-arzv3fj6.js} +7 -7
- package/dist/chunks/{options-myj773za.js → cors-bqty8v0p.js} +7 -7
- package/dist/chunks/{options-12zwgdzg.js → cors-bstqs6fb.js} +2 -2
- package/dist/chunks/{options-9k8e9m39.js → cors-cf1faf48.js} +15 -15
- package/dist/chunks/{options-n6ypjnhz.js → cors-ddnay6e1.js} +1 -1
- package/dist/chunks/{options-h8savpc9.js → cors-dewwmefa.js} +1 -1
- package/dist/chunks/{options-djr0jy89.js → cors-djr0jy89.js} +1 -1
- package/dist/chunks/{options-8yrm3yp0.js → cors-dpm5c7yf.js} +1 -1
- package/dist/chunks/{options-tze85g2y.js → cors-fcmc7w0e.js} +2 -2
- package/dist/chunks/{options-aaddmdw5.js → cors-fd0s08ee.js} +3 -3
- package/dist/chunks/{options-z3gjns4k.js → cors-g3qjtfrt.js} +1 -1
- package/dist/chunks/{options-jgbj3f80.js → cors-gbwh38sh.js} +4 -4
- package/dist/chunks/{options-j80tzjj3.js → cors-gymtz25n.js} +12 -4
- package/dist/chunks/{options-j4at0y5c.js → cors-j4at0y5c.js} +1 -1
- package/dist/chunks/{options-3n3ecqk9.js → cors-jmt6cpx4.js} +5 -5
- package/dist/chunks/{options-b315n07t.js → cors-jyk0ayfs.js} +2 -2
- package/dist/chunks/{options-pk035j5m.js → cors-km83wzq4.js} +4 -4
- package/dist/chunks/{options-myqk22k5.js → cors-myqk22k5.js} +2 -2
- package/dist/chunks/{options-qdrpva4m.js → cors-p8g34x4v.js} +2 -2
- package/dist/chunks/{options-t62b1gmw.js → cors-qmz7pscb.js} +2 -2
- package/dist/chunks/{options-v1nm30fe.js → cors-rhyt0p0x.js} +4 -2
- package/dist/chunks/{options-b1sd4cv4.js → cors-rqgfrarq.js} +35 -35
- package/dist/chunks/{options-t32e1bbt.js → cors-t32e1bbt.js} +1 -1
- package/dist/chunks/{options-pcsx5fe9.js → cors-txb93cxt.js} +2 -2
- package/dist/chunks/{options-xtx0rz3e.js → cors-w3zqyffx.js} +5 -2
- package/dist/chunks/{options-fepz0ta2.js → cors-w841zcb3.js} +3 -3
- package/dist/chunks/{options-kqr36gas.js → cors-w9jcwh65.js} +7 -7
- package/dist/chunks/{options-wnw6k7m6.js → cors-wrt9gvm9.js} +3 -3
- package/dist/chunks/{options-qahj7606.js → cors-x74w7e1f.js} +1 -1
- package/dist/chunks/{options-b6cxph1w.js → cors-xp2nc168.js} +4 -4
- package/dist/chunks/{options-mzw3xmnn.js → cors-y088ynta.js} +7 -3
- package/dist/chunks/{options-7nstrb2v.js → cors-yb56m0yw.js} +2 -2
- package/dist/chunks/{options-4zne1sdj.js → cors-yqy45vey.js} +2 -2
- package/dist/content-headers.js +1 -1
- package/dist/cors.js +1 -1
- package/dist/event-feed.js +5 -5
- package/dist/fetch.js +56 -56
- package/dist/handlers/agent.js +6 -6
- package/dist/handlers/artifact.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 +7 -7
- 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/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.js +13 -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/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.js +50 -50
- package/dist/location.d.ts +3 -1
- package/dist/location.js +6 -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 +57 -57
- package/dist/request-site.js +2 -2
- package/dist/request-tracing.js +1 -1
- package/dist/routes.js +53 -53
- package/dist/server-info.js +5 -5
- package/dist/service-status.js +1 -1
- package/dist/workerd.js +57 -57
- package/package.json +8 -8
- /package/dist/chunks/{options-9rqn6x4v.js → cors-9rqn6x4v.js} +0 -0
- /package/dist/chunks/{options-bd8755ek.js → cors-bd8755ek.js} +0 -0
- /package/dist/chunks/{options-q187pxxd.js → cors-q187pxxd.js} +0 -0
- /package/dist/chunks/{options-q4bn6dy8.js → cors-q4bn6dy8.js} +0 -0
- /package/dist/chunks/{options-smaf4a18.js → cors-smaf4a18.js} +0 -0
- /package/dist/chunks/{options-xthc02cw.js → cors-xthc02cw.js} +0 -0
- /package/dist/chunks/{options-yc7nft6q.js → cors-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/cors-3j7dhvn1.js";
|
|
4
|
+
import"./chunks/cors-x74w7e1f.js";
|
|
5
|
+
import"./chunks/cors-ddnay6e1.js";
|
|
6
|
+
import"./chunks/cors-gymtz25n.js";
|
|
7
|
+
import"./chunks/cors-smaf4a18.js";
|
|
8
8
|
export {
|
|
9
9
|
Api2 as Api
|
|
10
10
|
};
|
package/dist/auth.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
|
-
locationErrors2
|
|
3
|
-
|
|
2
|
+
locationErrors2,
|
|
3
|
+
awaitPlugins2
|
|
4
|
+
} from "./cors-gymtz25n.js";
|
|
4
5
|
import {
|
|
5
6
|
Api2
|
|
6
|
-
} from "./
|
|
7
|
+
} from "./cors-3j7dhvn1.js";
|
|
7
8
|
|
|
8
9
|
// src/handlers/voice.ts
|
|
9
10
|
import { Location } from "@opencode/core/location";
|
|
@@ -19,9 +20,11 @@ var VoiceHandler2 = HttpApiBuilder.group(Api2, "server.voice", (handlers) => Eff
|
|
|
19
20
|
const locations = yield* LocationServiceMap.Service;
|
|
20
21
|
const services = locations.get(Location.Ref.make({ directory: AbsolutePath.make(global.config) }));
|
|
21
22
|
return handlers.handle("voice.models", Effect.fn("server.voice.models")(function* () {
|
|
23
|
+
yield* awaitPlugins2;
|
|
22
24
|
const voice = yield* Voice.Service;
|
|
23
25
|
return { data: yield* voice.models() };
|
|
24
26
|
}, Effect.provide(services), locationErrors2)).handle("voice.session", Effect.fn("server.voice.session")(function* (request) {
|
|
27
|
+
yield* awaitPlugins2;
|
|
25
28
|
const voice = yield* Voice.Service;
|
|
26
29
|
const transport = yield* voice.session(request.payload).pipe(Effect.mapError((error) => error._tag === "Voice.InvalidRequestError" ? new InvalidRequestError({ message: error.message }) : new ServiceUnavailableError({ message: error.message, service: error.service })));
|
|
27
30
|
return { data: { transport } };
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
LocationMiddleware2
|
|
3
|
-
} from "./
|
|
3
|
+
} from "./cors-gymtz25n.js";
|
|
4
4
|
import {
|
|
5
5
|
FormLocationMiddleware2
|
|
6
|
-
} from "./
|
|
6
|
+
} from "./cors-ddnay6e1.js";
|
|
7
7
|
import {
|
|
8
8
|
SessionLocationMiddleware2
|
|
9
|
-
} from "./
|
|
9
|
+
} from "./cors-x74w7e1f.js";
|
|
10
10
|
|
|
11
11
|
// src/api.ts
|
|
12
12
|
import { makeDefaultApi } from "@opencode/protocol/api";
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
|
+
awaitPlugins2,
|
|
2
3
|
response2
|
|
3
|
-
} from "./
|
|
4
|
+
} from "./cors-gymtz25n.js";
|
|
4
5
|
import {
|
|
5
6
|
Api2
|
|
6
|
-
} from "./
|
|
7
|
+
} from "./cors-3j7dhvn1.js";
|
|
7
8
|
|
|
8
9
|
// src/handlers/websearch.ts
|
|
9
10
|
import { WebSearch } from "@opencode/core/websearch";
|
|
@@ -15,6 +16,7 @@ var WebSearchHandler2 = HttpApiBuilder.group(Api2, "server.websearch", (handlers
|
|
|
15
16
|
const websearch = yield* WebSearch.Service;
|
|
16
17
|
return yield* response2(websearch.providers());
|
|
17
18
|
})).handle("websearch.query", Effect.fn("server.websearch.query")(function* (request) {
|
|
19
|
+
yield* awaitPlugins2;
|
|
18
20
|
const websearch = yield* WebSearch.Service;
|
|
19
21
|
return yield* response2(websearch.query(request.payload).pipe(Effect.catchTags({
|
|
20
22
|
"WebSearch.ProviderRequired": () => new InvalidRequestError({
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Api2
|
|
3
|
-
} from "./
|
|
3
|
+
} from "./cors-3j7dhvn1.js";
|
|
4
4
|
import {
|
|
5
5
|
requireConnectable2
|
|
6
|
-
} from "./
|
|
6
|
+
} from "./cors-fcmc7w0e.js";
|
|
7
7
|
|
|
8
8
|
// src/handlers/credential.ts
|
|
9
9
|
import { Credential } from "@opencode/core/credential";
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import {
|
|
2
2
|
__export
|
|
3
|
-
} from "./
|
|
3
|
+
} from "./cors-9rqn6x4v.js";
|
|
4
4
|
|
|
5
5
|
// src/server-info.ts
|
|
6
6
|
var exports_server_info = {};
|
|
7
7
|
__export(exports_server_info, {
|
|
8
8
|
ServerInfo: () => exports_server_info,
|
|
9
|
-
Service: () =>
|
|
9
|
+
Service: () => Service4,
|
|
10
10
|
connectionURLs: () => connectionURLs2,
|
|
11
|
-
layer: () =>
|
|
11
|
+
layer: () => layer4
|
|
12
12
|
});
|
|
13
13
|
import { Context, Layer } from "effect";
|
|
14
14
|
import { networkInterfaces } from "node:os";
|
|
15
15
|
|
|
16
|
-
class
|
|
16
|
+
class Service4 extends Context.Service()("@opencode/server/ServerInfo") {
|
|
17
17
|
}
|
|
18
|
-
function
|
|
19
|
-
return Layer.succeed(
|
|
18
|
+
function layer4(urls, tmp, app = {}) {
|
|
19
|
+
return Layer.succeed(Service4, Service4.of({ urls, app, paths: { tmp } }));
|
|
20
20
|
}
|
|
21
21
|
function connectionURLs2(value, requestedHostname) {
|
|
22
22
|
const url = new URL(value);
|
|
@@ -38,4 +38,4 @@ function connectionURLs2(value, requestedHostname) {
|
|
|
38
38
|
];
|
|
39
39
|
}
|
|
40
40
|
|
|
41
|
-
export {
|
|
41
|
+
export { Service4, layer4, connectionURLs2, exports_server_info };
|
|
@@ -2,18 +2,18 @@ import {
|
|
|
2
2
|
locationErrors2,
|
|
3
3
|
response2,
|
|
4
4
|
requestRef2
|
|
5
|
-
} from "./
|
|
5
|
+
} from "./cors-gymtz25n.js";
|
|
6
6
|
import {
|
|
7
7
|
Api2
|
|
8
|
-
} from "./
|
|
8
|
+
} from "./cors-3j7dhvn1.js";
|
|
9
9
|
import {
|
|
10
10
|
CorsConfig2,
|
|
11
11
|
isAllowedRequestOrigin2
|
|
12
|
-
} from "./
|
|
12
|
+
} from "./cors-q4bn6dy8.js";
|
|
13
13
|
import {
|
|
14
14
|
runPtySocket2,
|
|
15
15
|
holdLocation2
|
|
16
|
-
} from "./
|
|
16
|
+
} from "./cors-q187pxxd.js";
|
|
17
17
|
|
|
18
18
|
// src/handlers/pty.ts
|
|
19
19
|
import { Pty } from "@opencode/core/pty";
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Api2
|
|
3
|
-
} from "./
|
|
3
|
+
} from "./cors-3j7dhvn1.js";
|
|
4
4
|
import {
|
|
5
5
|
SESSION_TTL_SECONDS2,
|
|
6
6
|
Config2,
|
|
7
7
|
issueSession2,
|
|
8
8
|
sessionCookieName2
|
|
9
|
-
} from "./
|
|
9
|
+
} from "./cors-j4at0y5c.js";
|
|
10
10
|
import {
|
|
11
|
-
|
|
12
|
-
} from "./
|
|
11
|
+
Service4
|
|
12
|
+
} from "./cors-7dtbad8d.js";
|
|
13
13
|
import {
|
|
14
|
-
|
|
15
|
-
} from "./
|
|
14
|
+
Service3
|
|
15
|
+
} from "./cors-w9jcwh65.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* Service3;
|
|
26
26
|
const auth = yield* Config2;
|
|
27
27
|
return handlers.handle("server.info", () => Effect.gen(function* () {
|
|
28
|
-
const info = yield*
|
|
28
|
+
const info = yield* Service4;
|
|
29
29
|
return {
|
|
30
30
|
version: info.app.version ?? "unknown",
|
|
31
31
|
pid: process.pid ?? 0,
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import {
|
|
2
2
|
__export
|
|
3
|
-
} from "./
|
|
3
|
+
} from "./cors-9rqn6x4v.js";
|
|
4
4
|
|
|
5
5
|
// src/event-feed.ts
|
|
6
6
|
var exports_event_feed = {};
|
|
7
7
|
__export(exports_event_feed, {
|
|
8
8
|
EncodingError: () => EncodingError2,
|
|
9
9
|
EventFeed: () => exports_event_feed,
|
|
10
|
-
Service: () =>
|
|
10
|
+
Service: () => Service2,
|
|
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";
|
|
@@ -30,7 +30,7 @@ class EncodingError2 extends Schema.TaggedError()("EventFeed.EncodingError", {
|
|
|
30
30
|
}) {
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
-
class
|
|
33
|
+
class Service2 extends Context.Service()("@opencode/server/EventFeed") {
|
|
34
34
|
}
|
|
35
35
|
function frame2(event) {
|
|
36
36
|
return `data: ${JSON.stringify(event)}
|
|
@@ -72,13 +72,13 @@ var make4 = Effect.fn("EventFeed.make")(function* (observe, options) {
|
|
|
72
72
|
});
|
|
73
73
|
const unsubscribe = yield* observe(publish);
|
|
74
74
|
yield* Effect.addFinalizer(() => unsubscribe);
|
|
75
|
-
return
|
|
75
|
+
return Service2.of({
|
|
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(Service2, 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,
|
|
84
|
+
export { SubscriberCapacity2, SubscriberOverflowError2, EncodingError2, Service2, frame2, make4, layer3, exports_event_feed };
|
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Api2
|
|
3
|
-
} from "./
|
|
3
|
+
} from "./cors-3j7dhvn1.js";
|
|
4
4
|
import {
|
|
5
5
|
CorsConfig2,
|
|
6
6
|
isAllowedRequestOrigin2
|
|
7
|
-
} from "./
|
|
7
|
+
} from "./cors-q4bn6dy8.js";
|
|
8
8
|
import {
|
|
9
9
|
makeArtifact2
|
|
10
|
-
} from "./
|
|
10
|
+
} from "./cors-qmz7pscb.js";
|
|
11
11
|
import {
|
|
12
12
|
makeJob2
|
|
13
|
-
} from "./
|
|
13
|
+
} from "./cors-78rcgzsr.js";
|
|
14
14
|
import {
|
|
15
15
|
makeMediaGet2
|
|
16
|
-
} from "./
|
|
16
|
+
} from "./cors-djr0jy89.js";
|
|
17
17
|
import {
|
|
18
18
|
runPtySocket2
|
|
19
|
-
} from "./
|
|
19
|
+
} from "./cors-q187pxxd.js";
|
|
20
20
|
import {
|
|
21
21
|
makeSchedule2
|
|
22
|
-
} from "./
|
|
22
|
+
} from "./cors-059rbh9c.js";
|
|
23
23
|
|
|
24
24
|
// src/handlers/persistent-pty.ts
|
|
25
25
|
import { PersistentPty } from "@opencode/core/persistent-pty";
|
|
@@ -1,36 +1,36 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
} from "./
|
|
2
|
+
layer2
|
|
3
|
+
} from "./cors-gymtz25n.js";
|
|
4
4
|
import {
|
|
5
5
|
formLocationLayer2
|
|
6
|
-
} from "./
|
|
6
|
+
} from "./cors-ddnay6e1.js";
|
|
7
7
|
import {
|
|
8
8
|
sessionLocationLayer2
|
|
9
|
-
} from "./
|
|
9
|
+
} from "./cors-x74w7e1f.js";
|
|
10
10
|
import {
|
|
11
11
|
Api2
|
|
12
|
-
} from "./
|
|
12
|
+
} from "./cors-3j7dhvn1.js";
|
|
13
13
|
import {
|
|
14
14
|
Config2
|
|
15
|
-
} from "./
|
|
15
|
+
} from "./cors-j4at0y5c.js";
|
|
16
16
|
import {
|
|
17
17
|
CorsConfig2
|
|
18
|
-
} from "./
|
|
18
|
+
} from "./cors-q4bn6dy8.js";
|
|
19
19
|
import {
|
|
20
|
-
|
|
21
|
-
} from "./
|
|
20
|
+
layer4
|
|
21
|
+
} from "./cors-7dtbad8d.js";
|
|
22
22
|
import {
|
|
23
23
|
node2
|
|
24
|
-
} from "./
|
|
24
|
+
} from "./cors-w9jcwh65.js";
|
|
25
25
|
import {
|
|
26
26
|
handlers2
|
|
27
|
-
} from "./
|
|
27
|
+
} from "./cors-rqgfrarq.js";
|
|
28
28
|
import {
|
|
29
29
|
authorizationLayer2
|
|
30
|
-
} from "./
|
|
30
|
+
} from "./cors-7b9xm1qg.js";
|
|
31
31
|
import {
|
|
32
32
|
schemaErrorLayer2
|
|
33
|
-
} from "./
|
|
33
|
+
} from "./cors-bd8755ek.js";
|
|
34
34
|
|
|
35
35
|
// src/routes.ts
|
|
36
36
|
import { Database } from "@opencode/core/database/database";
|
|
@@ -155,8 +155,8 @@ function makeRoutes(auth, options, serviceURLs, overrides, instances) {
|
|
|
155
155
|
})) : build(overrides);
|
|
156
156
|
return serviceLayer.pipe(Layer.flatMap((context) => {
|
|
157
157
|
const services = Layer.succeedContext(context);
|
|
158
|
-
const requestServices = Layer.merge(Layer.succeedContext(Context.pick(Database.Service, Credential.Service, PermissionSaved.Service, PluginUpdate.Service, Project.Service, WellKnown.Service)(context)),
|
|
159
|
-
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(
|
|
158
|
+
const requestServices = Layer.merge(Layer.succeedContext(Context.pick(Database.Service, Credential.Service, PermissionSaved.Service, PluginUpdate.Service, Project.Service, WellKnown.Service)(context)), layer4(serviceURLs, Context.get(context, Global.Service).tmp, options.app));
|
|
159
|
+
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(layer2), Layer.provide(authorizationLayer2), Layer.provide(schemaErrorLayer2), Layer.provide(auth), HttpRouter.provideRequest(requestServices), Layer.provideMerge(services), Layer.provideMerge(HttpRouter.layer));
|
|
160
160
|
return Layer.merge(api, V1Migration.layer.pipe(Layer.provide(services)));
|
|
161
161
|
}));
|
|
162
162
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
response2
|
|
3
|
-
} from "./
|
|
3
|
+
} from "./cors-gymtz25n.js";
|
|
4
4
|
import {
|
|
5
5
|
Api2
|
|
6
|
-
} from "./
|
|
6
|
+
} from "./cors-3j7dhvn1.js";
|
|
7
7
|
|
|
8
8
|
// src/handlers/integration.ts
|
|
9
9
|
import { Integration } from "@opencode/core/integration";
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
response2
|
|
3
|
-
} from "./
|
|
3
|
+
} from "./cors-gymtz25n.js";
|
|
4
4
|
import {
|
|
5
5
|
Api2
|
|
6
|
-
} from "./
|
|
6
|
+
} from "./cors-3j7dhvn1.js";
|
|
7
7
|
import {
|
|
8
8
|
download2
|
|
9
|
-
} from "./
|
|
9
|
+
} from "./cors-t32e1bbt.js";
|
|
10
10
|
|
|
11
11
|
// src/handlers/fs.ts
|
|
12
12
|
import { FileSystem } from "@opencode/core/filesystem";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Api2
|
|
3
|
-
} from "./
|
|
3
|
+
} from "./cors-3j7dhvn1.js";
|
|
4
4
|
import {
|
|
5
|
-
|
|
5
|
+
Service2,
|
|
6
6
|
frame2
|
|
7
|
-
} from "./
|
|
7
|
+
} from "./cors-arzv3fj6.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* Service2;
|
|
16
16
|
return handlers.handleRaw("event.subscribe", (ctx) => Effect.gen(function* () {
|
|
17
17
|
const connected = {
|
|
18
18
|
id: Event.ID.create(),
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
2
|
missingSession2
|
|
3
|
-
} from "./
|
|
3
|
+
} from "./cors-smaf4a18.js";
|
|
4
4
|
|
|
5
5
|
// src/location.ts
|
|
6
6
|
import { FileSystem } from "@opencode/core/filesystem";
|
|
7
7
|
import { Location } from "@opencode/core/location";
|
|
8
|
+
import { Plugin } from "@opencode/core/plugin";
|
|
8
9
|
import { LocationServiceMap } from "@opencode/core/location-services";
|
|
9
10
|
import { AbsolutePath } from "@opencode/core/schema";
|
|
10
11
|
import { Session } from "@opencode/core/session";
|
|
11
|
-
import { LocationNotFoundError, InvalidRequestError } from "@opencode/protocol/errors";
|
|
12
|
+
import { LocationNotFoundError, InvalidRequestError, ServiceUnavailableError } from "@opencode/protocol/errors";
|
|
12
13
|
import { Effect, Layer, Schema } from "effect";
|
|
13
14
|
import { HttpServerRequest } from "effect/http";
|
|
14
15
|
import { HttpApiMiddleware } from "effect/http-api";
|
|
@@ -20,6 +21,13 @@ function locationErrors2(effect) {
|
|
|
20
21
|
message: `Location not found: ${error.directory}`
|
|
21
22
|
}))));
|
|
22
23
|
}
|
|
24
|
+
var awaitPlugins2 = Plugin.awaitActivation.pipe(Effect.timeoutOrElse({
|
|
25
|
+
duration: "5 seconds",
|
|
26
|
+
orElse: () => Effect.fail(new ServiceUnavailableError({
|
|
27
|
+
message: "Location plugins did not finish activating",
|
|
28
|
+
service: "plugin"
|
|
29
|
+
}))
|
|
30
|
+
}));
|
|
23
31
|
function response2(data) {
|
|
24
32
|
return Effect.gen(function* () {
|
|
25
33
|
const location = yield* Location.Service;
|
|
@@ -51,7 +59,7 @@ function decode(input) {
|
|
|
51
59
|
return input;
|
|
52
60
|
}
|
|
53
61
|
}
|
|
54
|
-
var
|
|
62
|
+
var layer2 = Layer.effect(LocationMiddleware2, Effect.gen(function* () {
|
|
55
63
|
const locations = yield* LocationServiceMap.Service;
|
|
56
64
|
return LocationMiddleware2.of((effect) => Effect.gen(function* () {
|
|
57
65
|
const request = yield* HttpServerRequest.HttpServerRequest;
|
|
@@ -59,4 +67,4 @@ var layer3 = Layer.effect(LocationMiddleware2, Effect.gen(function* () {
|
|
|
59
67
|
}));
|
|
60
68
|
}));
|
|
61
69
|
|
|
62
|
-
export { LocationMiddleware2, locationErrors2, response2, sessionInfo2, requestRef2,
|
|
70
|
+
export { LocationMiddleware2, locationErrors2, awaitPlugins2, response2, sessionInfo2, requestRef2, layer2 };
|