@opencode/server 2.3.1 → 2.4.0
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.d.ts +249 -1
- package/dist/api.js +5 -5
- package/dist/auth.js +1 -1
- package/dist/chunks/{request-tracing-n5et0xgm.js → content-headers-0r476wkb.js} +5 -5
- package/dist/chunks/content-headers-0rzj25w4.js +194 -0
- package/dist/chunks/{request-tracing-4p2y0qs3.js → content-headers-100nc7c0.js} +2 -5
- package/dist/chunks/{request-tracing-z2ndp6vh.js → content-headers-1r438we2.js} +6 -6
- package/dist/chunks/{request-tracing-v8aqacn3.js → content-headers-2cm4dfcc.js} +2 -2
- package/dist/chunks/{request-tracing-x4b2rtcb.js → content-headers-2dzr03as.js} +1 -1
- package/dist/chunks/{request-tracing-ap1t95t8.js → content-headers-2rb1ee6g.js} +3 -3
- package/dist/chunks/{request-tracing-39nnfjx1.js → content-headers-39nnfjx1.js} +1 -1
- package/dist/chunks/{request-tracing-dezpcckc.js → content-headers-4fc68szf.js} +2 -2
- package/dist/chunks/{request-tracing-05c5061t.js → content-headers-4zkx9wb3.js} +1 -1
- package/dist/chunks/{request-tracing-b4mqtccx.js → content-headers-5jm9kajg.js} +2 -2
- package/dist/chunks/{request-tracing-7nb2rv11.js → content-headers-7jm4dc4a.js} +4 -4
- package/dist/chunks/{request-tracing-p86kew8c.js → content-headers-7qpea5x7.js} +2 -2
- package/dist/chunks/{request-tracing-78rcgzsr.js → content-headers-7ydfwv45.js} +4 -1
- package/dist/chunks/{request-tracing-f8r9p2vr.js → content-headers-801prsqk.js} +2 -2
- package/dist/chunks/{request-tracing-dx89xydc.js → content-headers-8ja97vv6.js} +2 -4
- package/dist/chunks/{request-tracing-8sb6qqpn.js → content-headers-8sb6qqpn.js} +1 -1
- package/dist/chunks/{request-tracing-9cd3a4b8.js → content-headers-9cd3a4b8.js} +1 -1
- package/dist/chunks/{request-tracing-tk56ffsq.js → content-headers-9t07vtvz.js} +5 -4
- package/dist/chunks/{request-tracing-htyf2qs7.js → content-headers-ah2sj2pr.js} +1 -1
- package/dist/chunks/{request-tracing-ayveq98d.js → content-headers-b03d5rht.js} +6 -18
- package/dist/chunks/{request-tracing-hx8bsq9d.js → content-headers-d20xfnpc.js} +1 -1
- package/dist/chunks/{request-tracing-r7knxm63.js → content-headers-ddrpmftb.js} +4 -4
- package/dist/chunks/{request-tracing-djr0jy89.js → content-headers-djr0jy89.js} +1 -1
- package/dist/chunks/{request-tracing-v0r38a4t.js → content-headers-fjcqsaaz.js} +46 -19
- package/dist/chunks/{request-tracing-sy2e93cn.js → content-headers-g23ffrnz.js} +3 -3
- package/dist/chunks/{request-tracing-kg0ybx4v.js → content-headers-gq4jwh93.js} +3 -3
- package/dist/chunks/{request-tracing-d4534456.js → content-headers-hf3kgjhr.js} +4 -4
- package/dist/chunks/{request-tracing-2pbbrzpp.js → content-headers-hk9crnsa.js} +2 -2
- package/dist/chunks/{request-tracing-myqk22k5.js → content-headers-hmwn16zp.js} +2 -2
- package/dist/chunks/{request-tracing-g6yhb3a8.js → content-headers-hnbeyfax.js} +15 -9
- package/dist/chunks/{request-tracing-j4at0y5c.js → content-headers-j4at0y5c.js} +1 -1
- package/dist/chunks/{request-tracing-jjvpqmx6.js → content-headers-jhbndf2d.js} +4 -4
- package/dist/chunks/{request-tracing-q44yktpv.js → content-headers-jmmhprac.js} +2 -2
- package/dist/chunks/{request-tracing-rd9e3qfx.js → content-headers-ky9xhfwk.js} +4 -4
- package/dist/chunks/{request-tracing-0gf4dfn8.js → content-headers-mvp6540g.js} +35 -35
- package/dist/chunks/{request-tracing-mzs0n5xz.js → content-headers-mzs0n5xz.js} +1 -1
- package/dist/chunks/{request-tracing-9grnt8dc.js → content-headers-p83m65n5.js} +2 -4
- package/dist/chunks/{request-tracing-zbe9jfhy.js → content-headers-prn0chz2.js} +1 -1
- package/dist/chunks/{request-tracing-fvpjvjpp.js → content-headers-qfyg9gb7.js} +7 -7
- package/dist/chunks/{request-tracing-vbgqk0mr.js → content-headers-r40v995e.js} +2 -2
- package/dist/chunks/{request-tracing-7b9xm1qg.js → content-headers-rktygpea.js} +4 -1
- package/dist/chunks/{request-tracing-d8b9pm2q.js → content-headers-rmfb1myj.js} +1 -1
- package/dist/chunks/{request-tracing-et00mhwf.js → content-headers-s3zgwc17.js} +3 -6
- package/dist/chunks/{request-tracing-t32e1bbt.js → content-headers-t32e1bbt.js} +1 -1
- package/dist/chunks/{request-tracing-b3bmdkga.js → content-headers-vw0q3knq.js} +1 -1
- package/dist/chunks/{request-tracing-h286a6py.js → content-headers-w3xmknp7.js} +2 -2
- package/dist/chunks/{request-tracing-s9tkswmw.js → content-headers-wka57cdm.js} +2 -2
- package/dist/chunks/{request-tracing-h1thjy6x.js → content-headers-y60jfeab.js} +2 -2
- package/dist/chunks/{request-tracing-4ed680xg.js → content-headers-ykk3p1r3.js} +2 -2
- package/dist/chunks/{request-tracing-861wfsmy.js → content-headers-yty6dk04.js} +1 -1
- package/dist/chunks/{request-tracing-50bbk3b2.js → content-headers-ywn523ee.js} +3 -11
- package/dist/chunks/{request-tracing-3te71694.js → content-headers-z3e7v67k.js} +7 -7
- package/dist/chunks/{request-tracing-0e81et3m.js → content-headers-zjmacp9c.js} +3 -3
- package/dist/content-headers.js +1 -1
- package/dist/cors.js +1 -1
- package/dist/event-feed.js +5 -5
- package/dist/fetch.js +60 -59
- package/dist/handlers/agent.js +6 -6
- package/dist/handlers/artifact.js +3 -3
- package/dist/handlers/automation.d.ts +1 -1
- 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.d.ts +1 -1
- 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.d.ts +13 -1
- package/dist/handlers/job.js +2 -2
- package/dist/handlers/location.js +6 -6
- package/dist/handlers/machine.d.ts +95 -0
- package/dist/handlers/machine.js +18 -0
- 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 -15
- 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 +53 -52
- package/dist/location.d.ts +1 -3
- package/dist/location.js +2 -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 +1 -1
- package/dist/process.js +72 -63
- package/dist/range.js +1 -1
- package/dist/request-site.js +2 -2
- package/dist/request-tracing.js +1 -1
- package/dist/routes.d.ts +6 -2
- package/dist/routes.js +57 -56
- package/dist/server-info.js +5 -5
- package/dist/service-status.js +1 -1
- package/dist/workerd.js +63 -60
- package/package.json +8 -8
- /package/dist/chunks/{request-tracing-9rqn6x4v.js → content-headers-9rqn6x4v.js} +0 -0
- /package/dist/chunks/{request-tracing-bd8755ek.js → content-headers-bd8755ek.js} +0 -0
- /package/dist/chunks/{request-tracing-n26yr6pw.js → content-headers-n26yr6pw.js} +0 -0
- /package/dist/chunks/{request-tracing-q187pxxd.js → content-headers-q187pxxd.js} +0 -0
- /package/dist/chunks/{request-tracing-q4bn6dy8.js → content-headers-q4bn6dy8.js} +0 -0
- /package/dist/chunks/{request-tracing-smaf4a18.js → content-headers-smaf4a18.js} +0 -0
- /package/dist/chunks/{request-tracing-xthc02cw.js → content-headers-xthc02cw.js} +0 -0
- /package/dist/chunks/{request-tracing-yc7nft6q.js → content-headers-yc7nft6q.js} +0 -0
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
response2
|
|
3
|
-
} from "./
|
|
3
|
+
} from "./content-headers-ywn523ee.js";
|
|
4
4
|
import {
|
|
5
5
|
Api2
|
|
6
|
-
} from "./
|
|
6
|
+
} from "./content-headers-zjmacp9c.js";
|
|
7
7
|
|
|
8
8
|
// src/handlers/skill.ts
|
|
9
9
|
import { Skill } from "@opencode/core/skill";
|
|
@@ -3,16 +3,16 @@ import {
|
|
|
3
3
|
missingMessage2,
|
|
4
4
|
failedMessageDecode2,
|
|
5
5
|
failedSnapshot2
|
|
6
|
-
} from "./
|
|
6
|
+
} from "./content-headers-smaf4a18.js";
|
|
7
7
|
import {
|
|
8
8
|
locationErrors2
|
|
9
|
-
} from "./
|
|
9
|
+
} from "./content-headers-ywn523ee.js";
|
|
10
10
|
import {
|
|
11
11
|
Api2
|
|
12
|
-
} from "./
|
|
12
|
+
} from "./content-headers-zjmacp9c.js";
|
|
13
13
|
import {
|
|
14
14
|
wantsMediaRefs2
|
|
15
|
-
} from "./
|
|
15
|
+
} from "./content-headers-xthc02cw.js";
|
|
16
16
|
|
|
17
17
|
// src/handlers/session.ts
|
|
18
18
|
import { Instance } from "@opencode/core/instance/service";
|
|
@@ -1,105 +1,105 @@
|
|
|
1
1
|
import {
|
|
2
2
|
GenerateHandler2
|
|
3
|
-
} from "./
|
|
3
|
+
} from "./content-headers-b03d5rht.js";
|
|
4
4
|
import {
|
|
5
5
|
VoiceHandler2
|
|
6
|
-
} from "./
|
|
6
|
+
} from "./content-headers-s3zgwc17.js";
|
|
7
7
|
import {
|
|
8
8
|
MessageHandler2
|
|
9
|
-
} from "./
|
|
9
|
+
} from "./content-headers-2rb1ee6g.js";
|
|
10
10
|
import {
|
|
11
11
|
ModelHandler2
|
|
12
|
-
} from "./
|
|
12
|
+
} from "./content-headers-100nc7c0.js";
|
|
13
13
|
import {
|
|
14
14
|
ProviderHandler2
|
|
15
|
-
} from "./
|
|
15
|
+
} from "./content-headers-p83m65n5.js";
|
|
16
16
|
import {
|
|
17
17
|
SessionHandler2
|
|
18
|
-
} from "./
|
|
18
|
+
} from "./content-headers-ky9xhfwk.js";
|
|
19
19
|
import {
|
|
20
20
|
PermissionHandler2
|
|
21
|
-
} from "./
|
|
21
|
+
} from "./content-headers-gq4jwh93.js";
|
|
22
22
|
import {
|
|
23
23
|
FileSystemHandler2
|
|
24
|
-
} from "./
|
|
24
|
+
} from "./content-headers-ddrpmftb.js";
|
|
25
25
|
import {
|
|
26
26
|
FormHandler2
|
|
27
|
-
} from "./
|
|
27
|
+
} from "./content-headers-2cm4dfcc.js";
|
|
28
28
|
import {
|
|
29
29
|
CommandHandler2
|
|
30
|
-
} from "./
|
|
30
|
+
} from "./content-headers-5jm9kajg.js";
|
|
31
31
|
import {
|
|
32
32
|
SkillHandler2
|
|
33
|
-
} from "./
|
|
33
|
+
} from "./content-headers-jmmhprac.js";
|
|
34
34
|
import {
|
|
35
35
|
RpcHandler2
|
|
36
|
-
} from "./
|
|
36
|
+
} from "./content-headers-rmfb1myj.js";
|
|
37
37
|
import {
|
|
38
|
-
|
|
39
|
-
} from "./
|
|
38
|
+
layer3
|
|
39
|
+
} from "./content-headers-qfyg9gb7.js";
|
|
40
40
|
import {
|
|
41
41
|
EventHandler2
|
|
42
|
-
} from "./
|
|
42
|
+
} from "./content-headers-7jm4dc4a.js";
|
|
43
43
|
import {
|
|
44
44
|
AgentHandler2
|
|
45
|
-
} from "./
|
|
45
|
+
} from "./content-headers-4fc68szf.js";
|
|
46
46
|
import {
|
|
47
47
|
PluginHandler2
|
|
48
|
-
} from "./
|
|
48
|
+
} from "./content-headers-r40v995e.js";
|
|
49
49
|
import {
|
|
50
50
|
ServerHandler2
|
|
51
|
-
} from "./
|
|
51
|
+
} from "./content-headers-1r438we2.js";
|
|
52
52
|
import {
|
|
53
53
|
DebugHandler2
|
|
54
|
-
} from "./
|
|
54
|
+
} from "./content-headers-y60jfeab.js";
|
|
55
55
|
import {
|
|
56
56
|
PtyHandler2
|
|
57
|
-
} from "./
|
|
57
|
+
} from "./content-headers-jhbndf2d.js";
|
|
58
58
|
import {
|
|
59
59
|
PersistentPtyHandler2
|
|
60
|
-
} from "./
|
|
60
|
+
} from "./content-headers-hnbeyfax.js";
|
|
61
61
|
import {
|
|
62
62
|
ShellHandler2
|
|
63
|
-
} from "./
|
|
63
|
+
} from "./content-headers-801prsqk.js";
|
|
64
64
|
import {
|
|
65
65
|
ReferenceHandler2
|
|
66
|
-
} from "./
|
|
66
|
+
} from "./content-headers-wka57cdm.js";
|
|
67
67
|
import {
|
|
68
68
|
LocationHandler2
|
|
69
|
-
} from "./
|
|
69
|
+
} from "./content-headers-prn0chz2.js";
|
|
70
70
|
import {
|
|
71
71
|
IntegrationHandler2
|
|
72
|
-
} from "./
|
|
72
|
+
} from "./content-headers-hk9crnsa.js";
|
|
73
73
|
import {
|
|
74
74
|
WebSearchHandler2
|
|
75
|
-
} from "./
|
|
75
|
+
} from "./content-headers-8ja97vv6.js";
|
|
76
76
|
import {
|
|
77
77
|
UsageHandler2
|
|
78
|
-
} from "./
|
|
78
|
+
} from "./content-headers-ykk3p1r3.js";
|
|
79
79
|
import {
|
|
80
80
|
McpHandler2
|
|
81
|
-
} from "./
|
|
81
|
+
} from "./content-headers-hf3kgjhr.js";
|
|
82
82
|
import {
|
|
83
83
|
CredentialHandler2
|
|
84
|
-
} from "./
|
|
84
|
+
} from "./content-headers-9t07vtvz.js";
|
|
85
85
|
import {
|
|
86
86
|
ProjectHandler2
|
|
87
|
-
} from "./
|
|
87
|
+
} from "./content-headers-4zkx9wb3.js";
|
|
88
88
|
import {
|
|
89
89
|
WorktreeHandler2
|
|
90
|
-
} from "./
|
|
90
|
+
} from "./content-headers-yty6dk04.js";
|
|
91
91
|
import {
|
|
92
92
|
VcsHandler2
|
|
93
|
-
} from "./
|
|
93
|
+
} from "./content-headers-w3xmknp7.js";
|
|
94
94
|
import {
|
|
95
95
|
MigrationHandler2
|
|
96
|
-
} from "./
|
|
96
|
+
} from "./content-headers-2dzr03as.js";
|
|
97
97
|
import {
|
|
98
98
|
ConfigHandler2
|
|
99
|
-
} from "./
|
|
99
|
+
} from "./content-headers-d20xfnpc.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 };
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
|
-
awaitPlugins2,
|
|
3
2
|
response2
|
|
4
|
-
} from "./
|
|
3
|
+
} from "./content-headers-ywn523ee.js";
|
|
5
4
|
import {
|
|
6
5
|
Api2
|
|
7
|
-
} from "./
|
|
6
|
+
} from "./content-headers-zjmacp9c.js";
|
|
8
7
|
|
|
9
8
|
// src/handlers/provider.ts
|
|
10
9
|
import { Provider } from "@opencode/core/provider";
|
|
@@ -13,7 +12,6 @@ import { Effect } from "effect";
|
|
|
13
12
|
import { HttpApiBuilder } from "effect/http-api";
|
|
14
13
|
var ProviderHandler2 = HttpApiBuilder.group(Api2, "server.provider", (handlers) => Effect.gen(function* () {
|
|
15
14
|
return handlers.handle("provider.list", Effect.fn(function* () {
|
|
16
|
-
yield* awaitPlugins2;
|
|
17
15
|
const providers = yield* Provider.Service;
|
|
18
16
|
return yield* response2(providers.available());
|
|
19
17
|
})).handle("provider.get", Effect.fn(function* (ctx) {
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import {
|
|
2
2
|
__export
|
|
3
|
-
} from "./
|
|
3
|
+
} from "./content-headers-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: () => Service3,
|
|
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 Service3 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 Service3.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(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,
|
|
84
|
+
export { SubscriberCapacity2, SubscriberOverflowError2, EncodingError2, Service3, frame2, make4, layer3, exports_event_feed };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
response2
|
|
3
|
-
} from "./
|
|
3
|
+
} from "./content-headers-ywn523ee.js";
|
|
4
4
|
import {
|
|
5
5
|
Api2
|
|
6
|
-
} from "./
|
|
6
|
+
} from "./content-headers-zjmacp9c.js";
|
|
7
7
|
|
|
8
8
|
// src/handlers/plugin.ts
|
|
9
9
|
import { Plugin } from "@opencode/core/plugin";
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
authorized2,
|
|
5
5
|
verifySession2,
|
|
6
6
|
sessionCookieName2
|
|
7
|
-
} from "./
|
|
7
|
+
} from "./content-headers-j4at0y5c.js";
|
|
8
8
|
|
|
9
9
|
// src/middleware/authorization.ts
|
|
10
10
|
import { UnauthorizedError } from "@opencode/protocol/errors";
|
|
@@ -13,6 +13,7 @@ import { Authorization as Authorization2 } from "@opencode/protocol/middleware/a
|
|
|
13
13
|
import { PTY_CONNECT_PATH, PTY_CONNECT_TICKET_QUERY } from "@opencode/protocol/groups/pty";
|
|
14
14
|
import { PERSISTENT_PTY_CONNECT_PATH } from "@opencode/protocol/groups/persistent-pty";
|
|
15
15
|
import { MCP_CLIENT_PATH } from "@opencode/protocol/groups/mcp";
|
|
16
|
+
import { isWebSocketUpgrade, MACHINE_LINK_PATH } from "@opencode/protocol/groups/machine";
|
|
16
17
|
import { PAIRING_CONNECT_PATH } from "@opencode/protocol/groups/server";
|
|
17
18
|
import { Effect, Layer, Redacted } from "effect";
|
|
18
19
|
import { Base64 } from "effect/encoding";
|
|
@@ -73,6 +74,8 @@ var authorizationLayer2 = Layer.effect(Authorization, Effect.gen(function* () {
|
|
|
73
74
|
const url = new URL(request.url, "http://localhost");
|
|
74
75
|
if ((route.route.path === PTY_CONNECT_PATH || route.route.path === PERSISTENT_PTY_CONNECT_PATH || route.route.path === MCP_CLIENT_PATH) && !!url.searchParams.get(PTY_CONNECT_TICKET_QUERY) || route.route.path === PAIRING_CONNECT_PATH)
|
|
75
76
|
return yield* effect;
|
|
77
|
+
if (route.route.path === MACHINE_LINK_PATH && isWebSocketUpgrade(request))
|
|
78
|
+
return yield* effect;
|
|
76
79
|
if (yield* authorizedRequest2(request, config))
|
|
77
80
|
return yield* effect;
|
|
78
81
|
if (challengeRequest(request))
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
|
-
locationErrors2
|
|
3
|
-
|
|
4
|
-
} from "./request-tracing-50bbk3b2.js";
|
|
2
|
+
locationErrors2
|
|
3
|
+
} from "./content-headers-ywn523ee.js";
|
|
5
4
|
import {
|
|
6
5
|
Api2
|
|
7
|
-
} from "./
|
|
6
|
+
} from "./content-headers-zjmacp9c.js";
|
|
8
7
|
|
|
9
8
|
// src/handlers/voice.ts
|
|
10
9
|
import { Location } from "@opencode/core/location";
|
|
@@ -20,11 +19,9 @@ var VoiceHandler2 = HttpApiBuilder.group(Api2, "server.voice", (handlers) => Eff
|
|
|
20
19
|
const locations = yield* LocationServiceMap.Service;
|
|
21
20
|
const services = locations.get(Location.Ref.make({ directory: AbsolutePath.make(global.config) }));
|
|
22
21
|
return handlers.handle("voice.models", Effect.fn("server.voice.models")(function* () {
|
|
23
|
-
yield* awaitPlugins2;
|
|
24
22
|
const voice = yield* Voice.Service;
|
|
25
23
|
return { data: yield* voice.models() };
|
|
26
24
|
}, Effect.provide(services), locationErrors2)).handle("voice.session", Effect.fn("server.voice.session")(function* (request) {
|
|
27
|
-
yield* awaitPlugins2;
|
|
28
25
|
const voice = yield* Voice.Service;
|
|
29
26
|
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 })));
|
|
30
27
|
return { data: { transport } };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
response2
|
|
3
|
-
} from "./
|
|
3
|
+
} from "./content-headers-ywn523ee.js";
|
|
4
4
|
import {
|
|
5
5
|
Api2
|
|
6
|
-
} from "./
|
|
6
|
+
} from "./content-headers-zjmacp9c.js";
|
|
7
7
|
|
|
8
8
|
// src/handlers/vcs.ts
|
|
9
9
|
import { Vcs } from "@opencode/core/vcs";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
response2
|
|
3
|
-
} from "./
|
|
3
|
+
} from "./content-headers-ywn523ee.js";
|
|
4
4
|
import {
|
|
5
5
|
Api2
|
|
6
|
-
} from "./
|
|
6
|
+
} from "./content-headers-zjmacp9c.js";
|
|
7
7
|
|
|
8
8
|
// src/handlers/reference.ts
|
|
9
9
|
import { Reference } from "@opencode/core/reference";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
requestRef2
|
|
3
|
-
} from "./
|
|
3
|
+
} from "./content-headers-ywn523ee.js";
|
|
4
4
|
import {
|
|
5
5
|
Api2
|
|
6
|
-
} from "./
|
|
6
|
+
} from "./content-headers-zjmacp9c.js";
|
|
7
7
|
|
|
8
8
|
// src/handlers/debug.ts
|
|
9
9
|
import { LocationServiceMap } from "@opencode/core/location-service-map";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
response2
|
|
3
|
-
} from "./
|
|
3
|
+
} from "./content-headers-ywn523ee.js";
|
|
4
4
|
import {
|
|
5
5
|
Api2
|
|
6
|
-
} from "./
|
|
6
|
+
} from "./content-headers-zjmacp9c.js";
|
|
7
7
|
|
|
8
8
|
// src/handlers/usage.ts
|
|
9
9
|
import { UsageLimits } from "@opencode/core/usage-limits";
|
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
import {
|
|
2
2
|
missingSession2
|
|
3
|
-
} from "./
|
|
3
|
+
} from "./content-headers-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";
|
|
9
8
|
import { LocationServiceMap } from "@opencode/core/location-services";
|
|
10
9
|
import { AbsolutePath } from "@opencode/core/schema";
|
|
11
10
|
import { Session } from "@opencode/core/session";
|
|
12
|
-
import { LocationNotFoundError, InvalidRequestError
|
|
11
|
+
import { LocationNotFoundError, InvalidRequestError } from "@opencode/protocol/errors";
|
|
13
12
|
import { Effect, Layer, Schema } from "effect";
|
|
14
13
|
import { HttpServerRequest } from "effect/http";
|
|
15
14
|
import { HttpApiMiddleware } from "effect/http-api";
|
|
@@ -21,13 +20,6 @@ function locationErrors2(effect) {
|
|
|
21
20
|
message: `Location not found: ${error.directory}`
|
|
22
21
|
}))));
|
|
23
22
|
}
|
|
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
|
-
}));
|
|
31
23
|
function response2(data) {
|
|
32
24
|
return Effect.gen(function* () {
|
|
33
25
|
const location = yield* Location.Service;
|
|
@@ -67,4 +59,4 @@ var layer4 = Layer.effect(LocationMiddleware2, Effect.gen(function* () {
|
|
|
67
59
|
}));
|
|
68
60
|
}));
|
|
69
61
|
|
|
70
|
-
export { LocationMiddleware2, locationErrors2,
|
|
62
|
+
export { LocationMiddleware2, locationErrors2, response2, sessionInfo2, requestRef2, layer4 };
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import {
|
|
2
2
|
__export
|
|
3
|
-
} from "./
|
|
3
|
+
} from "./content-headers-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: () => 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 };
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
LocationMiddleware2
|
|
3
|
-
} from "./
|
|
3
|
+
} from "./content-headers-ywn523ee.js";
|
|
4
4
|
import {
|
|
5
5
|
FormLocationMiddleware2
|
|
6
|
-
} from "./
|
|
6
|
+
} from "./content-headers-ah2sj2pr.js";
|
|
7
7
|
import {
|
|
8
8
|
SessionLocationMiddleware2
|
|
9
|
-
} from "./
|
|
9
|
+
} from "./content-headers-vw0q3knq.js";
|
|
10
10
|
|
|
11
11
|
// src/api.ts
|
|
12
12
|
import { makeDefaultApi } from "@opencode/protocol/api";
|
package/dist/content-headers.js
CHANGED
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
download2,
|
|
4
4
|
disposition2,
|
|
5
5
|
exports_content_headers
|
|
6
|
-
} from "./chunks/
|
|
6
|
+
} from "./chunks/content-headers-t32e1bbt.js";
|
|
7
7
|
export {
|
|
8
8
|
CONTENT_SECURITY_POLICY2 as CONTENT_SECURITY_POLICY,
|
|
9
9
|
exports_content_headers as ContentHeaders,
|
package/dist/cors.js
CHANGED
package/dist/event-feed.js
CHANGED
|
@@ -2,19 +2,19 @@ import {
|
|
|
2
2
|
SubscriberCapacity2,
|
|
3
3
|
SubscriberOverflowError2,
|
|
4
4
|
EncodingError2,
|
|
5
|
-
|
|
5
|
+
Service3,
|
|
6
6
|
frame2,
|
|
7
7
|
make4,
|
|
8
|
-
|
|
8
|
+
layer3,
|
|
9
9
|
exports_event_feed
|
|
10
|
-
} from "./chunks/
|
|
10
|
+
} from "./chunks/content-headers-qfyg9gb7.js";
|
|
11
11
|
export {
|
|
12
12
|
EncodingError2 as EncodingError,
|
|
13
13
|
exports_event_feed as EventFeed,
|
|
14
|
-
|
|
14
|
+
Service3 as Service,
|
|
15
15
|
SubscriberCapacity2 as SubscriberCapacity,
|
|
16
16
|
SubscriberOverflowError2 as SubscriberOverflowError,
|
|
17
17
|
frame2 as frame,
|
|
18
|
-
|
|
18
|
+
layer3 as layer,
|
|
19
19
|
make4 as make
|
|
20
20
|
};
|