@opencode/server 0.0.0-dev-997 → 0.0.0-dev-1000
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-wxz0ndy0.js → options-15ftw0kt.js} +1 -1
- package/dist/chunks/{options-d4534456.js → options-1ndv3m9h.js} +1 -1
- package/dist/chunks/{options-s62wjkvx.js → options-1v577ncx.js} +1 -1
- package/dist/chunks/{options-vbgqk0mr.js → options-2eaky32g.js} +1 -1
- package/dist/chunks/{options-b4mqtccx.js → options-4q6e7fh8.js} +1 -1
- package/dist/chunks/{options-m119esdv.js → options-5s0wnsg4.js} +1 -1
- package/dist/chunks/{options-nz17qv97.js → options-5s6gh8sx.js} +1 -1
- package/dist/chunks/{options-x4b2rtcb.js → options-6z9pvq7p.js} +1 -1
- package/dist/chunks/{options-05c5061t.js → options-a8jcac9a.js} +1 -1
- package/dist/chunks/{options-9grnt8dc.js → options-az0609r6.js} +1 -1
- package/dist/chunks/{options-89egwzf3.js → options-b105zy65.js} +1 -1
- package/dist/chunks/{options-kg0ybx4v.js → options-btahnm2b.js} +1 -1
- package/dist/chunks/{options-hx8bsq9d.js → options-cezwbsk5.js} +1 -1
- package/dist/chunks/{options-et00mhwf.js → options-d0edqfxx.js} +1 -1
- package/dist/chunks/{options-n4mv44n8.js → options-dqnkmz2m.js} +1 -1
- package/dist/chunks/{options-861wfsmy.js → options-enp1bp7r.js} +1 -1
- package/dist/chunks/{options-v8aqacn3.js → options-f559fakr.js} +1 -1
- package/dist/chunks/{options-zvbhqxt5.js → options-k3txyteh.js} +1 -1
- package/dist/chunks/{options-x2580v0z.js → options-k5thrxbp.js} +2 -2
- package/dist/chunks/{options-dx89xydc.js → options-kkdkqt8j.js} +1 -1
- package/dist/chunks/{options-cdhjn32v.js → options-mpvvr0mh.js} +1 -1
- package/dist/chunks/{options-jjvpqmx6.js → options-psw29prz.js} +1 -1
- package/dist/chunks/{options-z2ndp6vh.js → options-q6e9831s.js} +7 -7
- package/dist/chunks/{options-h1thjy6x.js → options-qcg3sqtb.js} +1 -1
- package/dist/chunks/{options-f8r9p2vr.js → options-qd0r787n.js} +1 -1
- package/dist/chunks/{options-qkcfdn84.js → options-qnrjgbyc.js} +1 -1
- package/dist/chunks/{options-4p2y0qs3.js → options-rha2aq18.js} +1 -1
- package/dist/chunks/{options-0n4tjm17.js → options-s282vggx.js} +1 -1
- package/dist/chunks/{options-fvpjvjpp.js → options-s802fzg1.js} +6 -6
- package/dist/chunks/{options-tvg9pks9.js → options-s9gdp469.js} +1 -1
- package/dist/chunks/{options-s9tkswmw.js → options-te8jwba1.js} +1 -1
- package/dist/chunks/{options-mzs0n5xz.js → options-w9jcwh65.js} +6 -6
- package/dist/chunks/{options-7nb2rv11.js → options-wwhkfaz3.js} +4 -4
- package/dist/chunks/{options-fn2e5d71.js → options-y1d4ht7v.js} +35 -35
- package/dist/chunks/{options-0j6zxxn8.js → options-yqhefp4s.js} +1 -1
- package/dist/chunks/{options-3te71694.js → options-z3e7v67k.js} +6 -6
- package/dist/chunks/{options-zbe9jfhy.js → options-zcvan105.js} +1 -1
- package/dist/chunks/{options-pmrh8xzx.js → options-zrx7cbjs.js} +6 -6
- package/dist/event-feed.js +5 -5
- 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 +4 -4
- 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 +3 -3
- package/dist/handlers/message.js +3 -3
- 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 +6 -6
- 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 +3 -3
- 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 +3 -3
- 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 +42 -42
- package/dist/pairing.js +3 -3
- package/dist/process.js +38 -38
- package/dist/routes.js +43 -43
- package/dist/server-info.js +5 -5
- package/dist/workerd.js +39 -39
- package/package.json +8 -8
- /package/dist/chunks/{options-0e81et3m.js → options-j87xz9bt.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-b3bmdkga.js";
|
|
3
|
+
} from "./chunks/options-j87xz9bt.js";
|
|
5
4
|
import"./chunks/options-htyf2qs7.js";
|
|
5
|
+
import"./chunks/options-b3bmdkga.js";
|
|
6
6
|
import"./chunks/options-50bbk3b2.js";
|
|
7
7
|
import"./chunks/options-smaf4a18.js";
|
|
8
8
|
export {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Api2
|
|
3
|
-
} from "./options-
|
|
3
|
+
} from "./options-j87xz9bt.js";
|
|
4
4
|
import {
|
|
5
5
|
requireConnectable2
|
|
6
|
-
} from "./options-
|
|
6
|
+
} from "./options-mpvvr0mh.js";
|
|
7
7
|
|
|
8
8
|
// src/handlers/credential.ts
|
|
9
9
|
import { Credential } from "@opencode/core/credential";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Api2
|
|
3
|
-
} from "./options-
|
|
3
|
+
} from "./options-j87xz9bt.js";
|
|
4
4
|
import {
|
|
5
5
|
SESSION_TTL_SECONDS2,
|
|
6
6
|
Config2,
|
|
@@ -8,11 +8,11 @@ import {
|
|
|
8
8
|
sessionCookieName2
|
|
9
9
|
} from "./options-j4at0y5c.js";
|
|
10
10
|
import {
|
|
11
|
-
|
|
12
|
-
} from "./options-
|
|
11
|
+
Service2
|
|
12
|
+
} from "./options-z3e7v67k.js";
|
|
13
13
|
import {
|
|
14
|
-
|
|
15
|
-
} from "./options-
|
|
14
|
+
Service3
|
|
15
|
+
} from "./options-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* Service2;
|
|
29
29
|
return {
|
|
30
30
|
version: info.app.version ?? "unknown",
|
|
31
31
|
pid: process.pid ?? 0,
|
|
@@ -7,11 +7,11 @@ var exports_event_feed = {};
|
|
|
7
7
|
__export(exports_event_feed, {
|
|
8
8
|
EncodingError: () => EncodingError2,
|
|
9
9
|
EventFeed: () => exports_event_feed,
|
|
10
|
-
Service: () =>
|
|
10
|
+
Service: () => Service4,
|
|
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 Service4 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 Service4.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(Service4, 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, Service4, frame2, make4, layer3, exports_event_feed };
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
var exports_pairing = {};
|
|
7
7
|
__export(exports_pairing, {
|
|
8
8
|
ServerPairing: () => exports_pairing,
|
|
9
|
-
Service: () =>
|
|
9
|
+
Service: () => Service3,
|
|
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 Service3 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(Service3, Effect.gen(function* () {
|
|
21
21
|
const cache = yield* Cache.make({ capacity: 1000, lookup: noLookup, timeToLive: TTL });
|
|
22
|
-
return
|
|
22
|
+
return Service3.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(Service4, Effect.gen(function* () {
|
|
|
30
30
|
})
|
|
31
31
|
});
|
|
32
32
|
}));
|
|
33
|
-
var node2 = makeGlobalNode({ service:
|
|
33
|
+
var node2 = makeGlobalNode({ service: Service3, layer, deps: [] });
|
|
34
34
|
|
|
35
|
-
export {
|
|
35
|
+
export { Service3, node2, exports_pairing };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Api2
|
|
3
|
-
} from "./options-
|
|
3
|
+
} from "./options-j87xz9bt.js";
|
|
4
4
|
import {
|
|
5
|
-
|
|
5
|
+
Service4,
|
|
6
6
|
frame2
|
|
7
|
-
} from "./options-
|
|
7
|
+
} from "./options-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,105 +1,105 @@
|
|
|
1
1
|
import {
|
|
2
2
|
GenerateHandler2
|
|
3
|
-
} from "./options-
|
|
3
|
+
} from "./options-yqhefp4s.js";
|
|
4
4
|
import {
|
|
5
5
|
VoiceHandler2
|
|
6
|
-
} from "./options-
|
|
6
|
+
} from "./options-d0edqfxx.js";
|
|
7
7
|
import {
|
|
8
8
|
MessageHandler2
|
|
9
|
-
} from "./options-
|
|
9
|
+
} from "./options-5s0wnsg4.js";
|
|
10
10
|
import {
|
|
11
11
|
ModelHandler2
|
|
12
|
-
} from "./options-
|
|
12
|
+
} from "./options-rha2aq18.js";
|
|
13
13
|
import {
|
|
14
14
|
ProviderHandler2
|
|
15
|
-
} from "./options-
|
|
15
|
+
} from "./options-az0609r6.js";
|
|
16
16
|
import {
|
|
17
17
|
SessionHandler2
|
|
18
|
-
} from "./options-
|
|
18
|
+
} from "./options-k3txyteh.js";
|
|
19
19
|
import {
|
|
20
20
|
PermissionHandler2
|
|
21
|
-
} from "./options-
|
|
21
|
+
} from "./options-btahnm2b.js";
|
|
22
22
|
import {
|
|
23
23
|
FileSystemHandler2
|
|
24
|
-
} from "./options-
|
|
24
|
+
} from "./options-15ftw0kt.js";
|
|
25
25
|
import {
|
|
26
26
|
FormHandler2
|
|
27
|
-
} from "./options-
|
|
27
|
+
} from "./options-f559fakr.js";
|
|
28
28
|
import {
|
|
29
29
|
CommandHandler2
|
|
30
|
-
} from "./options-
|
|
30
|
+
} from "./options-4q6e7fh8.js";
|
|
31
31
|
import {
|
|
32
32
|
SkillHandler2
|
|
33
|
-
} from "./options-
|
|
33
|
+
} from "./options-qnrjgbyc.js";
|
|
34
34
|
import {
|
|
35
35
|
RpcHandler2
|
|
36
|
-
} from "./options-
|
|
36
|
+
} from "./options-s282vggx.js";
|
|
37
37
|
import {
|
|
38
|
-
|
|
39
|
-
} from "./options-
|
|
38
|
+
layer3
|
|
39
|
+
} from "./options-s802fzg1.js";
|
|
40
40
|
import {
|
|
41
41
|
EventHandler2
|
|
42
|
-
} from "./options-
|
|
42
|
+
} from "./options-wwhkfaz3.js";
|
|
43
43
|
import {
|
|
44
44
|
AgentHandler2
|
|
45
|
-
} from "./options-
|
|
45
|
+
} from "./options-1v577ncx.js";
|
|
46
46
|
import {
|
|
47
47
|
PluginHandler2
|
|
48
|
-
} from "./options-
|
|
48
|
+
} from "./options-2eaky32g.js";
|
|
49
49
|
import {
|
|
50
50
|
ServerHandler2
|
|
51
|
-
} from "./options-
|
|
51
|
+
} from "./options-q6e9831s.js";
|
|
52
52
|
import {
|
|
53
53
|
DebugHandler2
|
|
54
|
-
} from "./options-
|
|
54
|
+
} from "./options-qcg3sqtb.js";
|
|
55
55
|
import {
|
|
56
56
|
PtyHandler2
|
|
57
|
-
} from "./options-
|
|
57
|
+
} from "./options-psw29prz.js";
|
|
58
58
|
import {
|
|
59
59
|
PersistentPtyHandler2
|
|
60
|
-
} from "./options-
|
|
60
|
+
} from "./options-s9gdp469.js";
|
|
61
61
|
import {
|
|
62
62
|
ShellHandler2
|
|
63
|
-
} from "./options-
|
|
63
|
+
} from "./options-qd0r787n.js";
|
|
64
64
|
import {
|
|
65
65
|
ReferenceHandler2
|
|
66
|
-
} from "./options-
|
|
66
|
+
} from "./options-te8jwba1.js";
|
|
67
67
|
import {
|
|
68
68
|
LocationHandler2
|
|
69
|
-
} from "./options-
|
|
69
|
+
} from "./options-zcvan105.js";
|
|
70
70
|
import {
|
|
71
71
|
IntegrationHandler2
|
|
72
|
-
} from "./options-
|
|
72
|
+
} from "./options-mpvvr0mh.js";
|
|
73
73
|
import {
|
|
74
74
|
WebSearchHandler2
|
|
75
|
-
} from "./options-
|
|
75
|
+
} from "./options-kkdkqt8j.js";
|
|
76
76
|
import {
|
|
77
77
|
UsageHandler2
|
|
78
|
-
} from "./options-
|
|
78
|
+
} from "./options-b105zy65.js";
|
|
79
79
|
import {
|
|
80
80
|
McpHandler2
|
|
81
|
-
} from "./options-
|
|
81
|
+
} from "./options-1ndv3m9h.js";
|
|
82
82
|
import {
|
|
83
83
|
CredentialHandler2
|
|
84
|
-
} from "./options-
|
|
84
|
+
} from "./options-k5thrxbp.js";
|
|
85
85
|
import {
|
|
86
86
|
ProjectHandler2
|
|
87
|
-
} from "./options-
|
|
87
|
+
} from "./options-a8jcac9a.js";
|
|
88
88
|
import {
|
|
89
89
|
WorktreeHandler2
|
|
90
|
-
} from "./options-
|
|
90
|
+
} from "./options-enp1bp7r.js";
|
|
91
91
|
import {
|
|
92
92
|
VcsHandler2
|
|
93
|
-
} from "./options-
|
|
93
|
+
} from "./options-5s6gh8sx.js";
|
|
94
94
|
import {
|
|
95
95
|
MigrationHandler2
|
|
96
|
-
} from "./options-
|
|
96
|
+
} from "./options-6z9pvq7p.js";
|
|
97
97
|
import {
|
|
98
98
|
ConfigHandler2
|
|
99
|
-
} from "./options-
|
|
99
|
+
} from "./options-cezwbsk5.js";
|
|
100
100
|
|
|
101
101
|
// src/handlers.ts
|
|
102
102
|
import { Layer } from "effect";
|
|
103
|
-
var handlers2 = Layer.mergeAll(ServerHandler2, DebugHandler2, MigrationHandler2, LocationHandler2, AgentHandler2, PluginHandler2, SessionHandler2, MessageHandler2, ModelHandler2, GenerateHandler2, VoiceHandler2, ProviderHandler2, IntegrationHandler2, WebSearchHandler2, UsageHandler2, McpHandler2, CredentialHandler2, ProjectHandler2, FormHandler2, PermissionHandler2, FileSystemHandler2, CommandHandler2, SkillHandler2, RpcHandler2, EventHandler2.pipe(Layer.provide(
|
|
103
|
+
var handlers2 = Layer.mergeAll(ServerHandler2, DebugHandler2, MigrationHandler2, LocationHandler2, AgentHandler2, PluginHandler2, SessionHandler2, MessageHandler2, ModelHandler2, GenerateHandler2, VoiceHandler2, ProviderHandler2, IntegrationHandler2, WebSearchHandler2, UsageHandler2, McpHandler2, CredentialHandler2, ProjectHandler2, FormHandler2, PermissionHandler2, FileSystemHandler2, CommandHandler2, SkillHandler2, RpcHandler2, EventHandler2.pipe(Layer.provide(layer3)), PtyHandler2, PersistentPtyHandler2, ShellHandler2, ReferenceHandler2, WorktreeHandler2, VcsHandler2, ConfigHandler2);
|
|
104
104
|
|
|
105
105
|
export { handlers2 };
|
|
@@ -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: () => Service2,
|
|
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
|
-
class
|
|
16
|
+
class Service2 extends Context.Service()("@opencode/server/ServerInfo") {
|
|
17
17
|
}
|
|
18
|
-
function
|
|
19
|
-
return Layer.succeed(
|
|
18
|
+
function layer2(urls, tmp, app = {}) {
|
|
19
|
+
return Layer.succeed(Service2, Service2.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 { Service2, layer2, connectionURLs2, exports_server_info };
|