@opencode/server 0.0.0-dev-21876 → 0.0.0-dev-21894
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 +4 -4
- package/dist/chunks/{location-e7pctymn.js → location-0e4fm4yw.js} +1 -1
- package/dist/chunks/{location-x9vr2ttf.js → location-0pbbhyf6.js} +24 -6
- package/dist/chunks/{location-67a2g9pf.js → location-1q9bkvt1.js} +4 -4
- package/dist/chunks/{location-9me4q8wt.js → location-1s3664te.js} +2 -2
- package/dist/chunks/{location-8xct6vg3.js → location-2835150m.js} +2 -2
- package/dist/chunks/{location-4qjw9nya.js → location-2qjvs0kv.js} +2 -2
- package/dist/chunks/{location-xbzhzjwx.js → location-3kjp2hst.js} +1 -1
- package/dist/chunks/{location-e4x9285j.js → location-3mffapg0.js} +2 -2
- package/dist/chunks/{location-pmjbkszz.js → location-3yw6ah7d.js} +2 -2
- package/dist/chunks/{location-72ygafj3.js → location-4gk9fc6f.js} +2 -2
- package/dist/chunks/{location-qrx561yc.js → location-4y0588xc.js} +35 -35
- package/dist/chunks/{location-6xea6nhh.js → location-50xc6x42.js} +2 -2
- package/dist/chunks/{location-06hvtkr9.js → location-5z5anmwp.js} +2 -2
- package/dist/chunks/{location-cfhthk6z.js → location-74kxthdf.js} +1 -1
- package/dist/chunks/{location-kcjd09wg.js → location-7cd61xtm.js} +2 -2
- package/dist/chunks/{location-91mt6ewz.js → location-7x1re4zg.js} +2 -2
- package/dist/chunks/{location-ga3m49sz.js → location-f4exzdsf.js} +4 -2
- package/dist/chunks/{location-3154e7fk.js → location-gk0yxcp6.js} +5 -3
- package/dist/chunks/{location-gymtz25n.js → location-gqq6kfhc.js} +2 -2
- package/dist/chunks/{location-f4b2q3tn.js → location-hdwd22w5.js} +1 -1
- package/dist/chunks/{location-q69f22pd.js → location-jc2vwkyw.js} +2 -2
- package/dist/chunks/{location-c8a27nas.js → location-k6dz4enc.js} +6 -6
- package/dist/chunks/{location-v5889nsk.js → location-nhmzdcst.js} +2 -2
- package/dist/chunks/{location-31acg4hb.js → location-np6gr6g7.js} +2 -2
- package/dist/chunks/{location-0dncng21.js → location-qfvz5xpd.js} +1 -1
- package/dist/chunks/{location-t3j5ftv1.js → location-r5696se6.js} +3 -3
- package/dist/chunks/{location-2yr2dq97.js → location-rxyx8sa0.js} +2 -2
- package/dist/chunks/{location-kd6vzpgq.js → location-skcryrty.js} +2 -2
- package/dist/chunks/{location-2b2wekgg.js → location-vfkjeyp3.js} +1 -1
- package/dist/chunks/{location-swdgbzpj.js → location-vtfzy3at.js} +4 -2
- package/dist/chunks/{location-x0608mvx.js → location-vvp99hc9.js} +1 -1
- package/dist/chunks/{location-kqr36gas.js → location-w9jcwh65.js} +6 -6
- package/dist/chunks/{location-4b0899hb.js → location-xbqm7mpj.js} +2 -2
- package/dist/chunks/{location-49c878v9.js → location-xckd9f88.js} +2 -2
- package/dist/chunks/{location-xmwystkq.js → location-xpg37vzc.js} +2 -2
- package/dist/chunks/{location-g176v691.js → location-y6e7cs8e.js} +9 -7
- package/dist/chunks/{location-x74w7e1f.js → location-yet0vexm.js} +1 -1
- package/dist/chunks/{location-a6kxe6a7.js → location-yr80hdrp.js} +1 -1
- package/dist/chunks/{location-7dtbad8d.js → location-z3e7v67k.js} +6 -6
- package/dist/chunks/{location-j5aeaa16.js → location-zmgfywqd.js} +1 -1
- package/dist/chunks/{location-860evz0a.js → location-ztrvqkd5.js} +15 -12
- package/dist/chunks/{location-5w10ccet.js → location-zyntahe8.js} +1 -1
- package/dist/event-feed.js +5 -5
- package/dist/fetch.js +44 -44
- package/dist/handlers/agent.js +5 -5
- package/dist/handlers/command.js +5 -5
- package/dist/handlers/config.js +5 -5
- package/dist/handlers/credential.js +5 -5
- package/dist/handlers/debug.js +5 -5
- package/dist/handlers/event.js +6 -6
- package/dist/handlers/form.js +5 -5
- package/dist/handlers/fs.d.ts +2 -1
- package/dist/handlers/fs.js +5 -5
- package/dist/handlers/generate.js +5 -5
- package/dist/handlers/integration.js +5 -5
- package/dist/handlers/location.js +5 -5
- package/dist/handlers/mcp.js +6 -6
- package/dist/handlers/message.js +5 -5
- package/dist/handlers/migration.js +5 -5
- package/dist/handlers/model.js +5 -5
- package/dist/handlers/permission.js +5 -5
- package/dist/handlers/persistent-pty.js +6 -6
- package/dist/handlers/plugin.js +5 -5
- package/dist/handlers/project.js +5 -5
- package/dist/handlers/provider.js +5 -5
- package/dist/handlers/pty.js +6 -6
- package/dist/handlers/reference.js +5 -5
- package/dist/handlers/rpc.js +5 -5
- package/dist/handlers/server.js +7 -7
- package/dist/handlers/session.js +5 -5
- package/dist/handlers/shell.js +5 -5
- package/dist/handlers/skill.js +5 -5
- package/dist/handlers/usage.js +5 -5
- package/dist/handlers/vcs.js +5 -5
- package/dist/handlers/voice.js +5 -5
- package/dist/handlers/websearch.js +5 -5
- package/dist/handlers/worktree.js +5 -5
- package/dist/handlers.d.ts +1 -1
- package/dist/handlers.js +41 -41
- package/dist/location.js +3 -3
- package/dist/middleware/form-location.js +2 -2
- package/dist/middleware/session-location.js +2 -2
- package/dist/pairing.js +3 -3
- package/dist/process.js +41 -41
- package/dist/routes.d.ts +3 -2
- package/dist/routes.js +43 -43
- package/dist/server-info.js +5 -5
- package/dist/workerd.js +42 -42
- package/package.json +8 -8
package/dist/api.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Api2
|
|
3
|
-
} from "./chunks/location-
|
|
4
|
-
import"./chunks/location-
|
|
5
|
-
import"./chunks/location-
|
|
6
|
-
import"./chunks/location-
|
|
3
|
+
} from "./chunks/location-r5696se6.js";
|
|
4
|
+
import"./chunks/location-gk0yxcp6.js";
|
|
5
|
+
import"./chunks/location-yet0vexm.js";
|
|
6
|
+
import"./chunks/location-gqq6kfhc.js";
|
|
7
7
|
import"./chunks/location-smaf4a18.js";
|
|
8
8
|
export {
|
|
9
9
|
Api2 as Api
|
|
@@ -1,22 +1,26 @@
|
|
|
1
1
|
import {
|
|
2
2
|
response2
|
|
3
|
-
} from "./location-
|
|
3
|
+
} from "./location-gqq6kfhc.js";
|
|
4
4
|
import {
|
|
5
5
|
Api2
|
|
6
|
-
} from "./location-
|
|
6
|
+
} from "./location-r5696se6.js";
|
|
7
7
|
|
|
8
8
|
// src/handlers/fs.ts
|
|
9
9
|
import { FileSystem } from "@opencode/core/filesystem";
|
|
10
|
+
import { FileWatch } from "@opencode/core/filesystem/file-watch";
|
|
11
|
+
import { Location } from "@opencode/core/location";
|
|
10
12
|
import { RelativePath } from "@opencode/core/schema";
|
|
11
|
-
import { FileNotFoundError } from "@opencode/protocol/errors";
|
|
13
|
+
import { FileNotFoundError, ServiceUnavailableError } from "@opencode/protocol/errors";
|
|
12
14
|
import { Effect, Option, Stream } from "effect";
|
|
13
15
|
import { HttpServerResponse } from "effect/http";
|
|
14
16
|
import { HttpApiBuilder } from "effect/http-api";
|
|
17
|
+
import path from "path";
|
|
15
18
|
var FileSystemHandler2 = HttpApiBuilder.group(Api2, "server.fs", (handlers) => Effect.gen(function* () {
|
|
19
|
+
const fileWatch = yield* FileWatch.Service;
|
|
16
20
|
return handlers.handleRaw("fs.read", (ctx) => Effect.gen(function* () {
|
|
17
|
-
const
|
|
21
|
+
const path2 = yield* decodeRequestPath(ctx.request.url);
|
|
18
22
|
const fs = yield* FileSystem.Service;
|
|
19
|
-
const file = yield* fs.read({ path }).pipe(Effect.mapError((error) => new FileNotFoundError({ path: error.path, message: `File not found: ${error.path}` })));
|
|
23
|
+
const file = yield* fs.read({ path: path2 }).pipe(Effect.mapError((error) => new FileNotFoundError({ path: error.path, message: `File not found: ${error.path}` })));
|
|
20
24
|
return serveFile(ctx.request, file);
|
|
21
25
|
})).handle("fs.list", (ctx) => response2(Effect.gen(function* () {
|
|
22
26
|
const fs = yield* FileSystem.Service;
|
|
@@ -27,7 +31,21 @@ var FileSystemHandler2 = HttpApiBuilder.group(Api2, "server.fs", (handlers) => E
|
|
|
27
31
|
}))).handle("fs.write", (ctx) => response2(Effect.gen(function* () {
|
|
28
32
|
const fs = yield* FileSystem.Service;
|
|
29
33
|
return yield* fs.write({ path: ctx.query.path, data: ctx.payload });
|
|
30
|
-
})))
|
|
34
|
+
}))).handle("fs.watch", (ctx) => Effect.gen(function* () {
|
|
35
|
+
const fs = yield* FileSystem.Service;
|
|
36
|
+
const location = yield* Location.Service;
|
|
37
|
+
yield* fs.read({ path: RelativePath.make(ctx.payload.path) }).pipe(Effect.mapError((error) => new FileNotFoundError({ path: error.path, message: `File not found: ${error.path}` })));
|
|
38
|
+
yield* fileWatch.watch({
|
|
39
|
+
location: { directory: location.directory, workspaceID: location.workspaceID },
|
|
40
|
+
file: path.resolve(location.directory, ctx.payload.path)
|
|
41
|
+
}).pipe(Effect.mapError((error) => new ServiceUnavailableError({ message: error.message, service: "filewatcher" })));
|
|
42
|
+
})).handle("fs.unwatch", (ctx) => Effect.gen(function* () {
|
|
43
|
+
const location = yield* Location.Service;
|
|
44
|
+
yield* fileWatch.unwatch({
|
|
45
|
+
location: { directory: location.directory, workspaceID: location.workspaceID },
|
|
46
|
+
file: path.resolve(location.directory, ctx.payload.path)
|
|
47
|
+
});
|
|
48
|
+
}));
|
|
31
49
|
}));
|
|
32
50
|
function decodeRequestPath(url) {
|
|
33
51
|
const raw = new URL(url, "http://localhost").pathname.slice(13);
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Api2
|
|
3
|
-
} from "./location-
|
|
3
|
+
} from "./location-r5696se6.js";
|
|
4
4
|
import {
|
|
5
|
-
|
|
5
|
+
Service4,
|
|
6
6
|
frame2
|
|
7
|
-
} from "./location-
|
|
7
|
+
} from "./location-k6dz4enc.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", () => Effect.gen(function* () {
|
|
17
17
|
const connected = {
|
|
18
18
|
id: Event.ID.create(),
|
|
@@ -2,10 +2,10 @@ import {
|
|
|
2
2
|
locationErrors2,
|
|
3
3
|
response2,
|
|
4
4
|
requestRef2
|
|
5
|
-
} from "./location-
|
|
5
|
+
} from "./location-gqq6kfhc.js";
|
|
6
6
|
import {
|
|
7
7
|
Api2
|
|
8
|
-
} from "./location-
|
|
8
|
+
} from "./location-r5696se6.js";
|
|
9
9
|
import {
|
|
10
10
|
CorsConfig2,
|
|
11
11
|
isAllowedRequestOrigin2
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
locationErrors2,
|
|
3
3
|
awaitPlugins2
|
|
4
|
-
} from "./location-
|
|
4
|
+
} from "./location-gqq6kfhc.js";
|
|
5
5
|
import {
|
|
6
6
|
Api2
|
|
7
|
-
} from "./location-
|
|
7
|
+
} from "./location-r5696se6.js";
|
|
8
8
|
|
|
9
9
|
// src/handlers/voice.ts
|
|
10
10
|
import { Location } from "@opencode/core/location";
|
|
@@ -2,10 +2,10 @@ import {
|
|
|
2
2
|
locationErrors2,
|
|
3
3
|
response2,
|
|
4
4
|
requestRef2
|
|
5
|
-
} from "./location-
|
|
5
|
+
} from "./location-gqq6kfhc.js";
|
|
6
6
|
import {
|
|
7
7
|
Api2
|
|
8
|
-
} from "./location-
|
|
8
|
+
} from "./location-r5696se6.js";
|
|
9
9
|
import {
|
|
10
10
|
CorsConfig2,
|
|
11
11
|
isAllowedRequestOrigin2
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
awaitPlugins2,
|
|
3
3
|
response2
|
|
4
|
-
} from "./location-
|
|
4
|
+
} from "./location-gqq6kfhc.js";
|
|
5
5
|
import {
|
|
6
6
|
Api2
|
|
7
|
-
} from "./location-
|
|
7
|
+
} from "./location-r5696se6.js";
|
|
8
8
|
|
|
9
9
|
// src/handlers/model.ts
|
|
10
10
|
import { Model } from "@opencode/core/model";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
locationErrors2,
|
|
3
3
|
awaitPlugins2
|
|
4
|
-
} from "./location-
|
|
4
|
+
} from "./location-gqq6kfhc.js";
|
|
5
5
|
import {
|
|
6
6
|
Api2
|
|
7
|
-
} from "./location-
|
|
7
|
+
} from "./location-r5696se6.js";
|
|
8
8
|
|
|
9
9
|
// src/handlers/generate.ts
|
|
10
10
|
import { Generate } from "@opencode/core/generate";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
response2
|
|
3
|
-
} from "./location-
|
|
3
|
+
} from "./location-gqq6kfhc.js";
|
|
4
4
|
import {
|
|
5
5
|
Api2
|
|
6
|
-
} from "./location-
|
|
6
|
+
} from "./location-r5696se6.js";
|
|
7
7
|
|
|
8
8
|
// src/handlers/integration.ts
|
|
9
9
|
import { Integration } from "@opencode/core/integration";
|
|
@@ -1,105 +1,105 @@
|
|
|
1
1
|
import {
|
|
2
2
|
GenerateHandler2
|
|
3
|
-
} from "./location-
|
|
3
|
+
} from "./location-3yw6ah7d.js";
|
|
4
4
|
import {
|
|
5
5
|
VoiceHandler2
|
|
6
|
-
} from "./location-
|
|
6
|
+
} from "./location-2835150m.js";
|
|
7
7
|
import {
|
|
8
8
|
MessageHandler2
|
|
9
|
-
} from "./location-
|
|
9
|
+
} from "./location-qfvz5xpd.js";
|
|
10
10
|
import {
|
|
11
11
|
ModelHandler2
|
|
12
|
-
} from "./location-
|
|
12
|
+
} from "./location-3mffapg0.js";
|
|
13
13
|
import {
|
|
14
14
|
ProviderHandler2
|
|
15
|
-
} from "./location-
|
|
15
|
+
} from "./location-vtfzy3at.js";
|
|
16
16
|
import {
|
|
17
17
|
SessionHandler2
|
|
18
|
-
} from "./location-
|
|
18
|
+
} from "./location-nhmzdcst.js";
|
|
19
19
|
import {
|
|
20
20
|
PermissionHandler2
|
|
21
|
-
} from "./location-
|
|
21
|
+
} from "./location-50xc6x42.js";
|
|
22
22
|
import {
|
|
23
23
|
FileSystemHandler2
|
|
24
|
-
} from "./location-
|
|
24
|
+
} from "./location-0pbbhyf6.js";
|
|
25
25
|
import {
|
|
26
26
|
FormHandler2
|
|
27
|
-
} from "./location-
|
|
27
|
+
} from "./location-7x1re4zg.js";
|
|
28
28
|
import {
|
|
29
29
|
CommandHandler2
|
|
30
|
-
} from "./location-
|
|
30
|
+
} from "./location-xpg37vzc.js";
|
|
31
31
|
import {
|
|
32
32
|
SkillHandler2
|
|
33
|
-
} from "./location-
|
|
33
|
+
} from "./location-xbqm7mpj.js";
|
|
34
34
|
import {
|
|
35
35
|
RpcHandler2
|
|
36
|
-
} from "./location-
|
|
36
|
+
} from "./location-zyntahe8.js";
|
|
37
37
|
import {
|
|
38
|
-
|
|
39
|
-
} from "./location-
|
|
38
|
+
layer4
|
|
39
|
+
} from "./location-k6dz4enc.js";
|
|
40
40
|
import {
|
|
41
41
|
EventHandler2
|
|
42
|
-
} from "./location-
|
|
42
|
+
} from "./location-1q9bkvt1.js";
|
|
43
43
|
import {
|
|
44
44
|
AgentHandler2
|
|
45
|
-
} from "./location-
|
|
45
|
+
} from "./location-f4exzdsf.js";
|
|
46
46
|
import {
|
|
47
47
|
PluginHandler2
|
|
48
|
-
} from "./location-
|
|
48
|
+
} from "./location-xckd9f88.js";
|
|
49
49
|
import {
|
|
50
50
|
ServerHandler2
|
|
51
|
-
} from "./location-
|
|
51
|
+
} from "./location-y6e7cs8e.js";
|
|
52
52
|
import {
|
|
53
53
|
DebugHandler2
|
|
54
|
-
} from "./location-
|
|
54
|
+
} from "./location-jc2vwkyw.js";
|
|
55
55
|
import {
|
|
56
56
|
PtyHandler2
|
|
57
|
-
} from "./location-
|
|
57
|
+
} from "./location-2qjvs0kv.js";
|
|
58
58
|
import {
|
|
59
59
|
PersistentPtyHandler2
|
|
60
|
-
} from "./location-
|
|
60
|
+
} from "./location-yr80hdrp.js";
|
|
61
61
|
import {
|
|
62
62
|
ShellHandler2
|
|
63
|
-
} from "./location-
|
|
63
|
+
} from "./location-rxyx8sa0.js";
|
|
64
64
|
import {
|
|
65
65
|
ReferenceHandler2
|
|
66
|
-
} from "./location-
|
|
66
|
+
} from "./location-skcryrty.js";
|
|
67
67
|
import {
|
|
68
68
|
LocationHandler2
|
|
69
|
-
} from "./location-
|
|
69
|
+
} from "./location-74kxthdf.js";
|
|
70
70
|
import {
|
|
71
71
|
IntegrationHandler2
|
|
72
|
-
} from "./location-
|
|
72
|
+
} from "./location-4gk9fc6f.js";
|
|
73
73
|
import {
|
|
74
74
|
WebSearchHandler2
|
|
75
|
-
} from "./location-
|
|
75
|
+
} from "./location-7cd61xtm.js";
|
|
76
76
|
import {
|
|
77
77
|
UsageHandler2
|
|
78
|
-
} from "./location-
|
|
78
|
+
} from "./location-5z5anmwp.js";
|
|
79
79
|
import {
|
|
80
80
|
McpHandler2
|
|
81
|
-
} from "./location-
|
|
81
|
+
} from "./location-1s3664te.js";
|
|
82
82
|
import {
|
|
83
83
|
CredentialHandler2
|
|
84
|
-
} from "./location-
|
|
84
|
+
} from "./location-hdwd22w5.js";
|
|
85
85
|
import {
|
|
86
86
|
ProjectHandler2
|
|
87
|
-
} from "./location-
|
|
87
|
+
} from "./location-zmgfywqd.js";
|
|
88
88
|
import {
|
|
89
89
|
WorktreeHandler2
|
|
90
|
-
} from "./location-
|
|
90
|
+
} from "./location-vfkjeyp3.js";
|
|
91
91
|
import {
|
|
92
92
|
VcsHandler2
|
|
93
|
-
} from "./location-
|
|
93
|
+
} from "./location-np6gr6g7.js";
|
|
94
94
|
import {
|
|
95
95
|
MigrationHandler2
|
|
96
|
-
} from "./location-
|
|
96
|
+
} from "./location-vvp99hc9.js";
|
|
97
97
|
import {
|
|
98
98
|
ConfigHandler2
|
|
99
|
-
} from "./location-
|
|
99
|
+
} from "./location-0e4fm4yw.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(layer4)), PtyHandler2, PersistentPtyHandler2, ShellHandler2, ReferenceHandler2, WorktreeHandler2, VcsHandler2, ConfigHandler2);
|
|
104
104
|
|
|
105
105
|
export { handlers2 };
|
|
@@ -5,10 +5,10 @@ import {
|
|
|
5
5
|
locationErrors2,
|
|
6
6
|
response2,
|
|
7
7
|
sessionInfo2
|
|
8
|
-
} from "./location-
|
|
8
|
+
} from "./location-gqq6kfhc.js";
|
|
9
9
|
import {
|
|
10
10
|
Api2
|
|
11
|
-
} from "./location-
|
|
11
|
+
} from "./location-r5696se6.js";
|
|
12
12
|
|
|
13
13
|
// src/handlers/permission.ts
|
|
14
14
|
import { Instance } from "@opencode/core/instance/service";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
awaitPlugins2,
|
|
3
3
|
response2
|
|
4
|
-
} from "./location-
|
|
4
|
+
} from "./location-gqq6kfhc.js";
|
|
5
5
|
import {
|
|
6
6
|
Api2
|
|
7
|
-
} from "./location-
|
|
7
|
+
} from "./location-r5696se6.js";
|
|
8
8
|
|
|
9
9
|
// src/handlers/usage.ts
|
|
10
10
|
import { UsageLimits } from "@opencode/core/usage-limits";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
awaitPlugins2,
|
|
3
3
|
response2
|
|
4
|
-
} from "./location-
|
|
4
|
+
} from "./location-gqq6kfhc.js";
|
|
5
5
|
import {
|
|
6
6
|
Api2
|
|
7
|
-
} from "./location-
|
|
7
|
+
} from "./location-r5696se6.js";
|
|
8
8
|
|
|
9
9
|
// src/handlers/websearch.ts
|
|
10
10
|
import { WebSearch } from "@opencode/core/websearch";
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
|
+
awaitPlugins2,
|
|
2
3
|
response2
|
|
3
|
-
} from "./location-
|
|
4
|
+
} from "./location-gqq6kfhc.js";
|
|
4
5
|
import {
|
|
5
6
|
Api2
|
|
6
|
-
} from "./location-
|
|
7
|
+
} from "./location-r5696se6.js";
|
|
7
8
|
|
|
8
9
|
// src/handlers/agent.ts
|
|
9
10
|
import { Agent } from "@opencode/core/agent";
|
|
@@ -11,6 +12,7 @@ import { Effect } from "effect";
|
|
|
11
12
|
import { HttpApiBuilder } from "effect/http-api";
|
|
12
13
|
import { AgentNotFoundError } from "@opencode/protocol/errors";
|
|
13
14
|
var AgentHandler2 = HttpApiBuilder.group(Api2, "server.agent", (handlers) => handlers.handle("agent.list", () => Effect.gen(function* () {
|
|
15
|
+
yield* awaitPlugins2;
|
|
14
16
|
return yield* response2(Agent.Service.use((agent) => agent.list()));
|
|
15
17
|
})).handle("agent.get", Effect.fn(function* (ctx) {
|
|
16
18
|
const agent = yield* Agent.Service.use((service) => service.get(ctx.params.agentID));
|
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
locationErrors2,
|
|
3
3
|
sessionInfo2,
|
|
4
4
|
requestRef2
|
|
5
|
-
} from "./location-
|
|
5
|
+
} from "./location-gqq6kfhc.js";
|
|
6
6
|
|
|
7
7
|
// src/middleware/form-location.ts
|
|
8
8
|
import { Instance } from "@opencode/core/instance/service";
|
|
@@ -10,7 +10,7 @@ import { LocationServiceMap } from "@opencode/core/location-services";
|
|
|
10
10
|
import { Session } from "@opencode/core/session";
|
|
11
11
|
import { LocationNotFoundError, InvalidRequestError, SessionNotFoundError } from "@opencode/protocol/errors";
|
|
12
12
|
import { Effect, Layer } from "effect";
|
|
13
|
-
import { HttpRouter, HttpServerRequest } from "effect/http";
|
|
13
|
+
import { HttpRouter, HttpServerRequest, HttpServerResponse } from "effect/http";
|
|
14
14
|
import { HttpApiMiddleware } from "effect/http-api";
|
|
15
15
|
class FormLocationMiddleware2 extends HttpApiMiddleware.Service()("@opencode/HttpApiFormLocation", {
|
|
16
16
|
error: [InvalidRequestError, SessionNotFoundError, LocationNotFoundError]
|
|
@@ -20,13 +20,15 @@ var formLocationLayer2 = Layer.effect(FormLocationMiddleware2, Effect.gen(functi
|
|
|
20
20
|
const sessions = yield* Session.Service;
|
|
21
21
|
const instances = yield* Instance.Service;
|
|
22
22
|
const locations = yield* LocationServiceMap.Service;
|
|
23
|
-
return FormLocationMiddleware2.of((effect) => Effect.gen(function* () {
|
|
23
|
+
return FormLocationMiddleware2.of((effect, options) => Effect.gen(function* () {
|
|
24
24
|
const route = yield* HttpRouter.RouteContext;
|
|
25
25
|
if (route.params.sessionID === "global") {
|
|
26
26
|
const request = yield* HttpServerRequest.HttpServerRequest;
|
|
27
27
|
return yield* effect.pipe(Effect.provide(locations.get(requestRef2(request))), locationErrors2);
|
|
28
28
|
}
|
|
29
29
|
const session = yield* sessionInfo2(sessions, route.params.sessionID);
|
|
30
|
+
if (options.endpoint.identifier === "session.form.list" && instances.live && !(yield* instances.live(session)))
|
|
31
|
+
return HttpServerResponse.jsonUnsafe({ data: [] });
|
|
30
32
|
return yield* effect.pipe(instances.provide(session), locationErrors2);
|
|
31
33
|
}));
|
|
32
34
|
}));
|
|
@@ -59,7 +59,7 @@ function decode(input) {
|
|
|
59
59
|
return input;
|
|
60
60
|
}
|
|
61
61
|
}
|
|
62
|
-
var
|
|
62
|
+
var layer3 = Layer.effect(LocationMiddleware2, Effect.gen(function* () {
|
|
63
63
|
const locations = yield* LocationServiceMap.Service;
|
|
64
64
|
return LocationMiddleware2.of((effect) => Effect.gen(function* () {
|
|
65
65
|
const request = yield* HttpServerRequest.HttpServerRequest;
|
|
@@ -67,4 +67,4 @@ var layer2 = Layer.effect(LocationMiddleware2, Effect.gen(function* () {
|
|
|
67
67
|
}));
|
|
68
68
|
}));
|
|
69
69
|
|
|
70
|
-
export { LocationMiddleware2, locationErrors2, awaitPlugins2, response2, sessionInfo2, requestRef2,
|
|
70
|
+
export { LocationMiddleware2, locationErrors2, awaitPlugins2, response2, sessionInfo2, requestRef2, layer3 };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
requestRef2
|
|
3
|
-
} from "./location-
|
|
3
|
+
} from "./location-gqq6kfhc.js";
|
|
4
4
|
import {
|
|
5
5
|
Api2
|
|
6
|
-
} from "./location-
|
|
6
|
+
} from "./location-r5696se6.js";
|
|
7
7
|
|
|
8
8
|
// src/handlers/debug.ts
|
|
9
9
|
import { LocationServiceMap } from "@opencode/core/location-service-map";
|
|
@@ -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: () => layer4,
|
|
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)}
|
|
@@ -71,13 +71,13 @@ var make4 = Effect.fn("EventFeed.make")(function* (observe, options) {
|
|
|
71
71
|
});
|
|
72
72
|
const unsubscribe = yield* observe(publish);
|
|
73
73
|
yield* Effect.addFinalizer(() => unsubscribe);
|
|
74
|
-
return
|
|
74
|
+
return Service4.of({
|
|
75
75
|
subscribe: Effect.acquireRelease(Queue.dropping(capacity).pipe(Effect.tap((queue) => Effect.sync(() => subscribers.add(queue)))), (queue) => Effect.sync(() => subscribers.delete(queue)).pipe(Effect.andThen(Queue.shutdown(queue)), Effect.asVoid)).pipe(Effect.map(Stream.fromQueue))
|
|
76
76
|
});
|
|
77
77
|
});
|
|
78
|
-
var
|
|
78
|
+
var layer4 = Layer.effect(Service4, Effect.gen(function* () {
|
|
79
79
|
const bus = yield* Bus.Service;
|
|
80
80
|
return yield* make4(bus.listen);
|
|
81
81
|
}));
|
|
82
82
|
|
|
83
|
-
export { SubscriberCapacity2, SubscriberOverflowError2, EncodingError2,
|
|
83
|
+
export { SubscriberCapacity2, SubscriberOverflowError2, EncodingError2, Service4, frame2, make4, layer4, exports_event_feed };
|
|
@@ -6,10 +6,10 @@ import {
|
|
|
6
6
|
} from "./location-smaf4a18.js";
|
|
7
7
|
import {
|
|
8
8
|
locationErrors2
|
|
9
|
-
} from "./location-
|
|
9
|
+
} from "./location-gqq6kfhc.js";
|
|
10
10
|
import {
|
|
11
11
|
Api2
|
|
12
|
-
} from "./location-
|
|
12
|
+
} from "./location-r5696se6.js";
|
|
13
13
|
|
|
14
14
|
// src/handlers/session.ts
|
|
15
15
|
import { Instance } from "@opencode/core/instance/service";
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
LocationMiddleware2
|
|
3
|
-
} from "./location-
|
|
3
|
+
} from "./location-gqq6kfhc.js";
|
|
4
4
|
import {
|
|
5
5
|
FormLocationMiddleware2
|
|
6
|
-
} from "./location-
|
|
6
|
+
} from "./location-gk0yxcp6.js";
|
|
7
7
|
import {
|
|
8
8
|
SessionLocationMiddleware2
|
|
9
|
-
} from "./location-
|
|
9
|
+
} from "./location-yet0vexm.js";
|
|
10
10
|
|
|
11
11
|
// src/api.ts
|
|
12
12
|
import { makeDefaultApi } from "@opencode/protocol/api";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
response2
|
|
3
|
-
} from "./location-
|
|
3
|
+
} from "./location-gqq6kfhc.js";
|
|
4
4
|
import {
|
|
5
5
|
Api2
|
|
6
|
-
} from "./location-
|
|
6
|
+
} from "./location-r5696se6.js";
|
|
7
7
|
|
|
8
8
|
// src/handlers/reference.ts
|
|
9
9
|
import { Reference } from "@opencode/core/reference";
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
|
+
awaitPlugins2,
|
|
2
3
|
response2
|
|
3
|
-
} from "./location-
|
|
4
|
+
} from "./location-gqq6kfhc.js";
|
|
4
5
|
import {
|
|
5
6
|
Api2
|
|
6
|
-
} from "./location-
|
|
7
|
+
} from "./location-r5696se6.js";
|
|
7
8
|
|
|
8
9
|
// src/handlers/provider.ts
|
|
9
10
|
import { Provider } from "@opencode/core/provider";
|
|
@@ -12,6 +13,7 @@ import { Effect } from "effect";
|
|
|
12
13
|
import { HttpApiBuilder } from "effect/http-api";
|
|
13
14
|
var ProviderHandler2 = HttpApiBuilder.group(Api2, "server.provider", (handlers) => Effect.gen(function* () {
|
|
14
15
|
return handlers.handle("provider.list", Effect.fn(function* () {
|
|
16
|
+
yield* awaitPlugins2;
|
|
15
17
|
const providers = yield* Provider.Service;
|
|
16
18
|
return yield* response2(providers.available());
|
|
17
19
|
})).handle("provider.get", Effect.fn(function* (ctx) {
|