@opencode/server 0.0.0-dev-56 → 0.0.0-dev-57
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 +2 -2
- package/dist/chunks/{options-a8jcac9a.js → options-05c5061t.js} +1 -1
- package/dist/chunks/{options-2h6qktqa.js → options-0ey2b45p.js} +1 -1
- package/dist/chunks/{options-s282vggx.js → options-0n4tjm17.js} +1 -1
- package/dist/chunks/{options-zd7h3c1z.js → options-1qsaq6yn.js} +1 -1
- package/dist/chunks/{options-h29xjj1e.js → options-28ztppy1.js} +1 -1
- package/dist/chunks/{options-yjbzmfhm.js → options-3te71694.js} +4 -4
- package/dist/chunks/{options-2mzs8tn8.js → options-4m3ck1cn.js} +1 -1
- package/dist/chunks/{options-rha2aq18.js → options-4p2y0qs3.js} +1 -1
- package/dist/chunks/{options-b105zy65.js → options-89egwzf3.js} +1 -1
- package/dist/chunks/{options-az0609r6.js → options-9grnt8dc.js} +1 -1
- package/dist/chunks/{options-4q6e7fh8.js → options-b4mqtccx.js} +1 -1
- package/dist/chunks/{options-c36yv9q3.js → options-bqv643t2.js} +4 -4
- package/dist/chunks/{options-fbe1g88z.js → options-brwhzv0g.js} +4 -4
- package/dist/chunks/{options-5b42hxrf.js → options-djj5asqw.js} +1 -1
- package/dist/chunks/{options-kkdkqt8j.js → options-dx89xydc.js} +1 -1
- package/dist/chunks/{options-39nnfjx1.js → options-e6e4kz0w.js} +3 -3
- package/dist/chunks/{options-d0edqfxx.js → options-et00mhwf.js} +1 -1
- package/dist/chunks/{options-qd0r787n.js → options-f8r9p2vr.js} +1 -1
- package/dist/chunks/{options-e5dc5tv0.js → options-fmgbtszc.js} +1 -1
- package/dist/chunks/{options-qcg3sqtb.js → options-h1thjy6x.js} +1 -1
- package/dist/chunks/{options-cezwbsk5.js → options-hx8bsq9d.js} +1 -1
- package/dist/chunks/{options-btahnm2b.js → options-kg0ybx4v.js} +1 -1
- package/dist/chunks/{options-58psf7ej.js → options-m119esdv.js} +1 -1
- package/dist/chunks/{options-w9jcwh65.js → options-mzs0n5xz.js} +6 -6
- package/dist/chunks/{options-5s6gh8sx.js → options-nz17qv97.js} +1 -1
- package/dist/chunks/{options-wd7hxrwh.js → options-pprz9xer.js} +1 -1
- package/dist/chunks/{options-ny1j968n.js → options-q44yktpv.js} +1 -1
- package/dist/chunks/{options-4fy84009.js → options-r6xkfcdx.js} +1 -1
- package/dist/chunks/{options-0c5s68vs.js → options-rfdwk27n.js} +1 -1
- package/dist/chunks/{options-1v577ncx.js → options-s62wjkvx.js} +1 -1
- package/dist/chunks/{options-te8jwba1.js → options-s9tkswmw.js} +1 -1
- package/dist/chunks/{options-f559fakr.js → options-v8aqacn3.js} +1 -1
- package/dist/chunks/{options-2eaky32g.js → options-vbgqk0mr.js} +1 -1
- package/dist/chunks/{options-s0qhkr43.js → options-ws8y8588.js} +32 -32
- package/dist/chunks/{options-vxzqjhkq.js → options-wv8xnah8.js} +7 -7
- package/dist/chunks/{options-6z9pvq7p.js → options-x4b2rtcb.js} +1 -1
- package/dist/chunks/{options-zcvan105.js → options-zbe9jfhy.js} +1 -1
- package/dist/chunks/{options-htj50t1a.js → options-zvbhqxt5.js} +1 -1
- package/dist/fetch.js +46 -46
- package/dist/handlers/agent.js +3 -3
- package/dist/handlers/command.js +3 -3
- package/dist/handlers/config.js +3 -3
- package/dist/handlers/credential.js +3 -3
- package/dist/handlers/debug.js +3 -3
- package/dist/handlers/event.js +4 -4
- package/dist/handlers/form.js +3 -3
- package/dist/handlers/fs.js +3 -3
- package/dist/handlers/generate.js +3 -3
- package/dist/handlers/integration.js +3 -3
- package/dist/handlers/location.js +3 -3
- package/dist/handlers/mcp.js +4 -4
- package/dist/handlers/message.js +4 -4
- package/dist/handlers/migration.js +3 -3
- package/dist/handlers/model.js +3 -3
- package/dist/handlers/permission.js +3 -3
- package/dist/handlers/persistent-pty.js +5 -5
- package/dist/handlers/plugin.js +3 -3
- package/dist/handlers/project.js +3 -3
- package/dist/handlers/provider.js +3 -3
- package/dist/handlers/pty.js +4 -4
- package/dist/handlers/reference.js +3 -3
- package/dist/handlers/rpc.js +3 -3
- package/dist/handlers/server.js +6 -6
- package/dist/handlers/session.js +4 -4
- package/dist/handlers/shell.js +3 -3
- package/dist/handlers/skill.js +3 -3
- package/dist/handlers/usage.js +3 -3
- package/dist/handlers/vcs.js +3 -3
- package/dist/handlers/voice.js +3 -3
- package/dist/handlers/websearch.js +3 -3
- package/dist/handlers/worktree.js +3 -3
- package/dist/handlers.js +41 -41
- package/dist/pairing.js +3 -3
- package/dist/process.js +40 -40
- package/dist/routes.js +43 -43
- package/dist/server-info.js +3 -3
- package/dist/service-status.js +3 -3
- package/dist/workerd.js +40 -40
- package/package.json +8 -8
- /package/dist/chunks/{options-j87xz9bt.js → options-0e81et3m.js} +0 -0
package/dist/api.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Api2
|
|
3
|
-
} from "./chunks/options-
|
|
4
|
-
import"./chunks/options-htyf2qs7.js";
|
|
3
|
+
} from "./chunks/options-0e81et3m.js";
|
|
5
4
|
import"./chunks/options-b3bmdkga.js";
|
|
5
|
+
import"./chunks/options-htyf2qs7.js";
|
|
6
6
|
import"./chunks/options-50bbk3b2.js";
|
|
7
7
|
import"./chunks/options-smaf4a18.js";
|
|
8
8
|
export {
|
|
@@ -6,17 +6,17 @@ import {
|
|
|
6
6
|
var exports_server_info = {};
|
|
7
7
|
__export(exports_server_info, {
|
|
8
8
|
ServerInfo: () => exports_server_info,
|
|
9
|
-
Service: () =>
|
|
9
|
+
Service: () => Service3,
|
|
10
10
|
connectionURLs: () => connectionURLs2,
|
|
11
11
|
layer: () => layer3
|
|
12
12
|
});
|
|
13
13
|
import { Context, Layer } from "effect";
|
|
14
14
|
import { networkInterfaces } from "node:os";
|
|
15
15
|
|
|
16
|
-
class
|
|
16
|
+
class Service3 extends Context.Service()("@opencode/server/ServerInfo") {
|
|
17
17
|
}
|
|
18
18
|
function layer3(urls, tmp, app = {}) {
|
|
19
|
-
return Layer.succeed(
|
|
19
|
+
return Layer.succeed(Service3, Service3.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 { Service3, layer3, connectionURLs2, exports_server_info };
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
} from "./options-b3bmdkga.js";
|
|
10
10
|
import {
|
|
11
11
|
Api2
|
|
12
|
-
} from "./options-
|
|
12
|
+
} from "./options-0e81et3m.js";
|
|
13
13
|
import {
|
|
14
14
|
Config2
|
|
15
15
|
} from "./options-j4at0y5c.js";
|
|
@@ -18,13 +18,13 @@ import {
|
|
|
18
18
|
} from "./options-q4bn6dy8.js";
|
|
19
19
|
import {
|
|
20
20
|
layer3
|
|
21
|
-
} from "./options-
|
|
21
|
+
} from "./options-3te71694.js";
|
|
22
22
|
import {
|
|
23
23
|
node2
|
|
24
|
-
} from "./options-
|
|
24
|
+
} from "./options-mzs0n5xz.js";
|
|
25
25
|
import {
|
|
26
26
|
handlers2
|
|
27
|
-
} from "./options-
|
|
27
|
+
} from "./options-ws8y8588.js";
|
|
28
28
|
import {
|
|
29
29
|
authorizationLayer2
|
|
30
30
|
} from "./options-7b9xm1qg.js";
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
} from "./options-q4bn6dy8.js";
|
|
4
4
|
import {
|
|
5
5
|
createRoutes2
|
|
6
|
-
} from "./options-
|
|
6
|
+
} from "./options-bqv643t2.js";
|
|
7
7
|
import {
|
|
8
8
|
__export
|
|
9
9
|
} from "./options-9rqn6x4v.js";
|
|
@@ -12,15 +12,15 @@ import {
|
|
|
12
12
|
var exports_fetch = {};
|
|
13
13
|
__export(exports_fetch, {
|
|
14
14
|
ServerFetch: () => exports_fetch,
|
|
15
|
-
make: () =>
|
|
15
|
+
make: () => make2
|
|
16
16
|
});
|
|
17
17
|
import { Context, Effect, Layer } from "effect";
|
|
18
18
|
import { HttpEffect, HttpMiddleware, HttpRouter, HttpServer } from "effect/http";
|
|
19
19
|
import { SessionRestart } from "@opencode/core/session/execution/restart";
|
|
20
|
-
var
|
|
20
|
+
var make2 = Effect.fn("ServerFetch.make")(function* (options = {}, boot = {}) {
|
|
21
21
|
const context = yield* Layer.build(createRoutes2(options, () => [], boot.overrides ?? []).pipe(Layer.provide(HttpServer.layerServices)));
|
|
22
22
|
yield* Effect.forkDetach(Context.get(context, SessionRestart.Service).resumeSuspendedSessions);
|
|
23
23
|
return Context.get(context, HttpRouter.HttpRouter).asHttpEffect().pipe(HttpMiddleware.cors({ allowedOrigins: (origin) => isAllowedCorsOrigin2(origin, options), maxAge: 86400 }), HttpEffect.toWebHandlerWith(context));
|
|
24
24
|
});
|
|
25
25
|
|
|
26
|
-
export {
|
|
26
|
+
export { make2, exports_fetch };
|
|
@@ -6,10 +6,10 @@ import {
|
|
|
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 };
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
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 };
|
|
@@ -1,102 +1,102 @@
|
|
|
1
1
|
import {
|
|
2
2
|
GenerateHandler2
|
|
3
|
-
} from "./options-
|
|
3
|
+
} from "./options-rfdwk27n.js";
|
|
4
4
|
import {
|
|
5
5
|
VoiceHandler2
|
|
6
|
-
} from "./options-
|
|
6
|
+
} from "./options-et00mhwf.js";
|
|
7
7
|
import {
|
|
8
8
|
MessageHandler2
|
|
9
|
-
} from "./options-
|
|
9
|
+
} from "./options-m119esdv.js";
|
|
10
10
|
import {
|
|
11
11
|
ModelHandler2
|
|
12
|
-
} from "./options-
|
|
12
|
+
} from "./options-4p2y0qs3.js";
|
|
13
13
|
import {
|
|
14
14
|
ProviderHandler2
|
|
15
|
-
} from "./options-
|
|
15
|
+
} from "./options-9grnt8dc.js";
|
|
16
16
|
import {
|
|
17
17
|
SessionHandler2
|
|
18
|
-
} from "./options-
|
|
18
|
+
} from "./options-zvbhqxt5.js";
|
|
19
19
|
import {
|
|
20
20
|
PermissionHandler2
|
|
21
|
-
} from "./options-
|
|
21
|
+
} from "./options-kg0ybx4v.js";
|
|
22
22
|
import {
|
|
23
23
|
FileSystemHandler2
|
|
24
|
-
} from "./options-
|
|
24
|
+
} from "./options-0ey2b45p.js";
|
|
25
25
|
import {
|
|
26
26
|
FormHandler2
|
|
27
|
-
} from "./options-
|
|
27
|
+
} from "./options-v8aqacn3.js";
|
|
28
28
|
import {
|
|
29
29
|
CommandHandler2
|
|
30
|
-
} from "./options-
|
|
30
|
+
} from "./options-b4mqtccx.js";
|
|
31
31
|
import {
|
|
32
32
|
SkillHandler2
|
|
33
|
-
} from "./options-
|
|
33
|
+
} from "./options-q44yktpv.js";
|
|
34
34
|
import {
|
|
35
35
|
RpcHandler2
|
|
36
|
-
} from "./options-
|
|
36
|
+
} from "./options-0n4tjm17.js";
|
|
37
37
|
import {
|
|
38
38
|
layer2
|
|
39
39
|
} from "./options-fvpjvjpp.js";
|
|
40
40
|
import {
|
|
41
41
|
EventHandler2
|
|
42
|
-
} from "./options-
|
|
42
|
+
} from "./options-1qsaq6yn.js";
|
|
43
43
|
import {
|
|
44
44
|
AgentHandler2
|
|
45
|
-
} from "./options-
|
|
45
|
+
} from "./options-s62wjkvx.js";
|
|
46
46
|
import {
|
|
47
47
|
PluginHandler2
|
|
48
|
-
} from "./options-
|
|
48
|
+
} from "./options-vbgqk0mr.js";
|
|
49
49
|
import {
|
|
50
50
|
ServerHandler2
|
|
51
|
-
} from "./options-
|
|
51
|
+
} from "./options-wv8xnah8.js";
|
|
52
52
|
import {
|
|
53
53
|
DebugHandler2
|
|
54
|
-
} from "./options-
|
|
54
|
+
} from "./options-h1thjy6x.js";
|
|
55
55
|
import {
|
|
56
56
|
PtyHandler2
|
|
57
|
-
} from "./options-
|
|
57
|
+
} from "./options-fmgbtszc.js";
|
|
58
58
|
import {
|
|
59
59
|
PersistentPtyHandler2
|
|
60
|
-
} from "./options-
|
|
60
|
+
} from "./options-4m3ck1cn.js";
|
|
61
61
|
import {
|
|
62
62
|
ShellHandler2
|
|
63
|
-
} from "./options-
|
|
63
|
+
} from "./options-f8r9p2vr.js";
|
|
64
64
|
import {
|
|
65
65
|
ReferenceHandler2
|
|
66
|
-
} from "./options-
|
|
66
|
+
} from "./options-s9tkswmw.js";
|
|
67
67
|
import {
|
|
68
68
|
LocationHandler2
|
|
69
|
-
} from "./options-
|
|
69
|
+
} from "./options-zbe9jfhy.js";
|
|
70
70
|
import {
|
|
71
71
|
IntegrationHandler2
|
|
72
|
-
} from "./options-
|
|
72
|
+
} from "./options-28ztppy1.js";
|
|
73
73
|
import {
|
|
74
74
|
WebSearchHandler2
|
|
75
|
-
} from "./options-
|
|
75
|
+
} from "./options-dx89xydc.js";
|
|
76
76
|
import {
|
|
77
77
|
UsageHandler2
|
|
78
|
-
} from "./options-
|
|
78
|
+
} from "./options-89egwzf3.js";
|
|
79
79
|
import {
|
|
80
80
|
McpHandler2
|
|
81
|
-
} from "./options-
|
|
81
|
+
} from "./options-pprz9xer.js";
|
|
82
82
|
import {
|
|
83
83
|
CredentialHandler2
|
|
84
|
-
} from "./options-
|
|
84
|
+
} from "./options-djj5asqw.js";
|
|
85
85
|
import {
|
|
86
86
|
ProjectHandler2
|
|
87
|
-
} from "./options-
|
|
87
|
+
} from "./options-05c5061t.js";
|
|
88
88
|
import {
|
|
89
89
|
WorktreeHandler2
|
|
90
|
-
} from "./options-
|
|
90
|
+
} from "./options-r6xkfcdx.js";
|
|
91
91
|
import {
|
|
92
92
|
VcsHandler2
|
|
93
|
-
} from "./options-
|
|
93
|
+
} from "./options-nz17qv97.js";
|
|
94
94
|
import {
|
|
95
95
|
MigrationHandler2
|
|
96
|
-
} from "./options-
|
|
96
|
+
} from "./options-x4b2rtcb.js";
|
|
97
97
|
import {
|
|
98
98
|
ConfigHandler2
|
|
99
|
-
} from "./options-
|
|
99
|
+
} from "./options-hx8bsq9d.js";
|
|
100
100
|
|
|
101
101
|
// src/handlers.ts
|
|
102
102
|
import { Layer } from "effect";
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Api2
|
|
3
|
-
} from "./options-
|
|
3
|
+
} from "./options-0e81et3m.js";
|
|
4
4
|
import {
|
|
5
5
|
SESSION_TTL_SECONDS2,
|
|
6
6
|
Config2,
|
|
7
7
|
issueSession2,
|
|
8
8
|
sessionCookieName2
|
|
9
9
|
} from "./options-j4at0y5c.js";
|
|
10
|
-
import {
|
|
11
|
-
Service4
|
|
12
|
-
} from "./options-yjbzmfhm.js";
|
|
13
10
|
import {
|
|
14
11
|
Service3
|
|
15
|
-
} from "./options-
|
|
12
|
+
} from "./options-3te71694.js";
|
|
13
|
+
import {
|
|
14
|
+
Service4
|
|
15
|
+
} from "./options-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* Service3;
|
|
29
29
|
return {
|
|
30
30
|
version: info.app.version ?? "unknown",
|
|
31
31
|
pid: process.pid ?? 0,
|