@opencode/server 2.2.6 → 2.3.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 +164 -4
- package/dist/api.js +5 -5
- package/dist/auth.js +1 -1
- package/dist/chunks/{options-059rbh9c.js → auth-059rbh9c.js} +1 -1
- package/dist/chunks/{options-va7wgp70.js → auth-09kw3a77.js} +2 -4
- package/dist/chunks/{options-0r9ve3h3.js → auth-2eaky32g.js} +2 -2
- package/dist/chunks/{options-wecgp61r.js → auth-3p9jwgak.js} +7 -7
- package/dist/chunks/{options-zzxz7279.js → auth-4q6e7fh8.js} +2 -2
- package/dist/chunks/{options-gymtz25n.js → auth-50bbk3b2.js} +3 -3
- package/dist/chunks/{options-hr24310e.js → auth-5cpb32hf.js} +1 -3
- package/dist/chunks/{options-b5crh3ce.js → auth-5s0wnsg4.js} +3 -3
- package/dist/chunks/{options-q59gseq4.js → auth-6jfbq4sw.js} +35 -35
- package/dist/chunks/{options-5km4ra1j.js → auth-6kawhtwy.js} +4 -4
- package/dist/chunks/{options-xwy6frfd.js → auth-6z9pvq7p.js} +1 -1
- package/dist/chunks/{options-78rcgzsr.js → auth-78rcgzsr.js} +1 -1
- package/dist/chunks/{options-7b9xm1qg.js → auth-7b9xm1qg.js} +1 -1
- package/dist/chunks/{options-xad49dn3.js → auth-8mj7kvhm.js} +3 -7
- package/dist/chunks/{options-j77vxdbh.js → auth-91858wp1.js} +2 -4
- package/dist/chunks/{options-7jx462hf.js → auth-a4mwssda.js} +8 -18
- package/dist/chunks/{options-mam5ppd3.js → auth-a8jcac9a.js} +1 -1
- package/dist/chunks/{options-62bfwtjc.js → auth-az0609r6.js} +2 -2
- package/dist/chunks/{options-x74w7e1f.js → auth-b3bmdkga.js} +1 -1
- package/dist/chunks/{options-dx07zb36.js → auth-bm3bken1.js} +3 -3
- package/dist/chunks/{options-q7gnt7ra.js → auth-btahnm2b.js} +3 -3
- package/dist/chunks/{options-e0z6mnzj.js → auth-cezwbsk5.js} +1 -1
- package/dist/chunks/{options-xfynz25m.js → auth-d0edqfxx.js} +2 -2
- package/dist/chunks/{options-djr0jy89.js → auth-djr0jy89.js} +1 -1
- package/dist/chunks/{options-e6e4kz0w.js → auth-e6e4kz0w.js} +1 -1
- package/dist/chunks/{options-rbck9dgd.js → auth-enp1bp7r.js} +1 -1
- package/dist/chunks/{options-3k93sd3m.js → auth-etdgpyr8.js} +17 -14
- package/dist/chunks/{options-vyzvby0b.js → auth-f559fakr.js} +2 -2
- package/dist/chunks/{options-s9jd931e.js → auth-gyryr0mf.js} +6 -6
- package/dist/chunks/{options-ddnay6e1.js → auth-htyf2qs7.js} +1 -1
- package/dist/chunks/{options-j4at0y5c.js → auth-j4at0y5c.js} +1 -1
- package/dist/chunks/{options-v7p1kzzd.js → auth-j87xz9bt.js} +3 -3
- package/dist/chunks/{options-axx4wwen.js → auth-kkdkqt8j.js} +2 -2
- package/dist/chunks/{options-kqr36gas.js → auth-kqr36gas.js} +1 -1
- package/dist/chunks/{options-hmwn16zp.js → auth-myqk22k5.js} +2 -2
- package/dist/chunks/{options-32zxn73z.js → auth-n1423xpw.js} +4 -4
- package/dist/chunks/{options-9q55v56g.js → auth-ny1j968n.js} +2 -2
- package/dist/chunks/{options-02a60aws.js → auth-p86kew8c.js} +3 -4
- package/dist/chunks/{options-kgr24bct.js → auth-pab2cyby.js} +5 -5
- package/dist/chunks/{options-j6d0mxrp.js → auth-qcg3sqtb.js} +2 -2
- package/dist/chunks/{options-4xzps9pr.js → auth-qd0r787n.js} +2 -2
- package/dist/chunks/{options-y56ann6c.js → auth-rha2aq18.js} +2 -2
- package/dist/chunks/{options-85kbrn7y.js → auth-rs3v36hp.js} +2 -4
- package/dist/chunks/{options-t32e1bbt.js → auth-t32e1bbt.js} +1 -1
- package/dist/chunks/{options-f96zeczf.js → auth-te8jwba1.js} +2 -2
- package/dist/chunks/{options-3te71694.js → auth-yjbzmfhm.js} +5 -5
- package/dist/chunks/{options-j1bh82b8.js → auth-yk755swr.js} +2 -2
- package/dist/chunks/{options-dczgzh3x.js → auth-yqhefp4s.js} +2 -2
- package/dist/chunks/{options-82vbxjqd.js → auth-z9zyd4qg.js} +4 -4
- package/dist/chunks/{options-f0kpaq89.js → auth-zcvan105.js} +1 -1
- package/dist/chunks/{options-9f2aybte.js → auth-zkya65ny.js} +6 -6
- 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.d.ts +1 -1
- 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.d.ts +1 -1
- package/dist/handlers.js +50 -50
- package/dist/location.js +4 -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 +1 -1
- package/dist/process.js +57 -57
- package/dist/request-site.js +2 -2
- package/dist/request-tracing.js +1 -1
- package/dist/routes.d.ts +4 -2
- package/dist/routes.js +53 -53
- package/dist/server-info.js +3 -3
- package/dist/service-status.js +1 -1
- package/dist/workerd.js +57 -57
- package/package.json +11 -11
- /package/dist/chunks/{options-9rqn6x4v.js → auth-9rqn6x4v.js} +0 -0
- /package/dist/chunks/{options-bd8755ek.js → auth-bd8755ek.js} +0 -0
- /package/dist/chunks/{options-q187pxxd.js → auth-q187pxxd.js} +0 -0
- /package/dist/chunks/{options-q4bn6dy8.js → auth-q4bn6dy8.js} +0 -0
- /package/dist/chunks/{options-smaf4a18.js → auth-smaf4a18.js} +0 -0
- /package/dist/chunks/{options-xthc02cw.js → auth-xthc02cw.js} +0 -0
- /package/dist/chunks/{options-yc7nft6q.js → auth-yc7nft6q.js} +0 -0
|
@@ -1,20 +1,16 @@
|
|
|
1
1
|
import {
|
|
2
|
-
awaitPlugins2,
|
|
3
2
|
response2
|
|
4
|
-
} from "./
|
|
3
|
+
} from "./auth-50bbk3b2.js";
|
|
5
4
|
import {
|
|
6
5
|
Api2
|
|
7
|
-
} from "./
|
|
6
|
+
} from "./auth-j87xz9bt.js";
|
|
8
7
|
|
|
9
8
|
// src/handlers/agent.ts
|
|
10
9
|
import { Agent } from "@opencode/core/agent";
|
|
11
10
|
import { Effect } from "effect";
|
|
12
11
|
import { HttpApiBuilder } from "effect/http-api";
|
|
13
12
|
import { AgentNotFoundError } from "@opencode/protocol/errors";
|
|
14
|
-
var AgentHandler2 = HttpApiBuilder.group(Api2, "server.agent", (handlers) => handlers.handle("agent.list", () => Effect.
|
|
15
|
-
yield* awaitPlugins2;
|
|
16
|
-
return yield* response2(Agent.Service.use((agent) => agent.list()));
|
|
17
|
-
})).handle("agent.get", Effect.fn(function* (ctx) {
|
|
13
|
+
var AgentHandler2 = HttpApiBuilder.group(Api2, "server.agent", (handlers) => handlers.handle("agent.list", () => response2(Agent.Service.use((agent) => agent.list()))).handle("agent.get", Effect.fn(function* (ctx) {
|
|
18
14
|
const agent = yield* Agent.Service.use((service) => service.get(ctx.params.agentID));
|
|
19
15
|
if (!agent)
|
|
20
16
|
return yield* new AgentNotFoundError({
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
response2
|
|
3
|
-
} from "./
|
|
3
|
+
} from "./auth-50bbk3b2.js";
|
|
4
4
|
import {
|
|
5
5
|
Api2
|
|
6
|
-
} from "./
|
|
6
|
+
} from "./auth-j87xz9bt.js";
|
|
7
7
|
|
|
8
8
|
// src/handlers/integration.ts
|
|
9
9
|
import { Integration } from "@opencode/core/integration";
|
|
10
|
-
import { Plugin } from "@opencode/core/plugin";
|
|
11
10
|
import { Effect } from "effect";
|
|
12
11
|
import { HttpApiBuilder, HttpApiSchema } from "effect/http-api";
|
|
13
12
|
import {
|
|
@@ -42,7 +41,6 @@ var authorize = (effect) => effect.pipe(Effect.mapError((error) => new InvalidRe
|
|
|
42
41
|
})));
|
|
43
42
|
var IntegrationHandler2 = HttpApiBuilder.group(Api2, "server.integration", (handlers) => Effect.gen(function* () {
|
|
44
43
|
return handlers.handle("integration.list", Effect.fn(function* () {
|
|
45
|
-
yield* Plugin.awaitActivation;
|
|
46
44
|
const service = yield* Integration.Service;
|
|
47
45
|
const current = yield* statements();
|
|
48
46
|
return yield* response2(service.list().pipe(Effect.map((integrations) => integrations.filter((integration) => isMcp(integration) || ManagedPolicy.decision(current, "integration.connect", integration.id) !== "deny"))));
|
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Api2
|
|
3
|
-
} from "./
|
|
3
|
+
} from "./auth-j87xz9bt.js";
|
|
4
4
|
import {
|
|
5
5
|
CorsConfig2,
|
|
6
6
|
isAllowedRequestOrigin2
|
|
7
|
-
} from "./
|
|
7
|
+
} from "./auth-q4bn6dy8.js";
|
|
8
8
|
import {
|
|
9
9
|
makeArtifact2
|
|
10
|
-
} from "./
|
|
10
|
+
} from "./auth-p86kew8c.js";
|
|
11
11
|
import {
|
|
12
12
|
makeJob2
|
|
13
|
-
} from "./
|
|
13
|
+
} from "./auth-78rcgzsr.js";
|
|
14
14
|
import {
|
|
15
15
|
makeMediaGet2
|
|
16
|
-
} from "./
|
|
16
|
+
} from "./auth-djr0jy89.js";
|
|
17
17
|
import {
|
|
18
18
|
runPtySocket2
|
|
19
|
-
} from "./
|
|
19
|
+
} from "./auth-q187pxxd.js";
|
|
20
20
|
import {
|
|
21
21
|
makeSchedule2
|
|
22
|
-
} from "./
|
|
22
|
+
} from "./auth-059rbh9c.js";
|
|
23
23
|
|
|
24
24
|
// src/handlers/persistent-pty.ts
|
|
25
25
|
import { PersistentPty } from "@opencode/core/persistent-pty";
|
|
@@ -27,7 +27,6 @@ import { PtyTicket } from "@opencode/core/pty/ticket";
|
|
|
27
27
|
import {
|
|
28
28
|
ForbiddenError,
|
|
29
29
|
InvalidRequestError,
|
|
30
|
-
PtyFeatureUnsupportedError,
|
|
31
30
|
PtyNotFoundError,
|
|
32
31
|
ServiceUnavailableError
|
|
33
32
|
} from "@opencode/protocol/errors";
|
|
@@ -79,16 +78,7 @@ var PersistentPtyHandler2 = HttpApiBuilder.group(Api2, "server.experimental", (h
|
|
|
79
78
|
yield* pty.resize(ctx.params.ptyID, ctx.payload.size.cols, ctx.payload.size.rows, ctx.payload.attachmentID).pipe(mapTerminalError);
|
|
80
79
|
if (ctx.payload.title === undefined)
|
|
81
80
|
return { data: yield* pty.get(ctx.params.ptyID).pipe(mapTerminalError) };
|
|
82
|
-
return {
|
|
83
|
-
data: yield* pty.rename(ctx.params.ptyID, ctx.payload.title).pipe(Effect.catchTags({
|
|
84
|
-
"PersistentPty.NotFoundError": notFound,
|
|
85
|
-
"PersistentPty.UnsupportedError": (error) => new PtyFeatureUnsupportedError({
|
|
86
|
-
feature: error.feature,
|
|
87
|
-
message: "Terminal renaming will be available after OpenCode's terminal service restarts"
|
|
88
|
-
}),
|
|
89
|
-
"PersistentPty.UnavailableError": unavailable
|
|
90
|
-
}))
|
|
91
|
-
};
|
|
81
|
+
return { data: yield* pty.rename(ctx.params.ptyID, ctx.payload.title).pipe(mapTerminalError) };
|
|
92
82
|
})).handle("persistentPty.snapshot", Effect.fn(function* (ctx) {
|
|
93
83
|
return { data: yield* pty.snapshot(ctx.params.ptyID).pipe(mapTerminalError) };
|
|
94
84
|
})).handle("persistentPty.remove", Effect.fn(function* (ctx) {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
awaitPlugins2,
|
|
3
3
|
response2
|
|
4
|
-
} from "./
|
|
4
|
+
} from "./auth-50bbk3b2.js";
|
|
5
5
|
import {
|
|
6
6
|
Api2
|
|
7
|
-
} from "./
|
|
7
|
+
} from "./auth-j87xz9bt.js";
|
|
8
8
|
|
|
9
9
|
// src/handlers/provider.ts
|
|
10
10
|
import { Provider } from "@opencode/core/provider";
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
response2
|
|
3
|
-
} from "./
|
|
3
|
+
} from "./auth-50bbk3b2.js";
|
|
4
4
|
import {
|
|
5
5
|
Api2
|
|
6
|
-
} from "./
|
|
6
|
+
} from "./auth-j87xz9bt.js";
|
|
7
7
|
import {
|
|
8
8
|
download2
|
|
9
|
-
} from "./
|
|
9
|
+
} from "./auth-t32e1bbt.js";
|
|
10
10
|
|
|
11
11
|
// src/handlers/fs.ts
|
|
12
12
|
import { FileSystem } from "@opencode/core/filesystem";
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import {
|
|
2
2
|
missingSession2
|
|
3
|
-
} from "./
|
|
3
|
+
} from "./auth-smaf4a18.js";
|
|
4
4
|
import {
|
|
5
5
|
locationErrors2,
|
|
6
6
|
response2,
|
|
7
7
|
sessionInfo2
|
|
8
|
-
} from "./
|
|
8
|
+
} from "./auth-50bbk3b2.js";
|
|
9
9
|
import {
|
|
10
10
|
Api2
|
|
11
|
-
} from "./
|
|
11
|
+
} from "./auth-j87xz9bt.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
|
locationErrors2,
|
|
3
3
|
awaitPlugins2
|
|
4
|
-
} from "./
|
|
4
|
+
} from "./auth-50bbk3b2.js";
|
|
5
5
|
import {
|
|
6
6
|
Api2
|
|
7
|
-
} from "./
|
|
7
|
+
} from "./auth-j87xz9bt.js";
|
|
8
8
|
|
|
9
9
|
// src/handlers/voice.ts
|
|
10
10
|
import { Location } from "@opencode/core/location";
|
|
@@ -1,36 +1,36 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
} from "./
|
|
2
|
+
layer4
|
|
3
|
+
} from "./auth-50bbk3b2.js";
|
|
4
4
|
import {
|
|
5
5
|
formLocationLayer2
|
|
6
|
-
} from "./
|
|
6
|
+
} from "./auth-htyf2qs7.js";
|
|
7
7
|
import {
|
|
8
8
|
sessionLocationLayer2
|
|
9
|
-
} from "./
|
|
9
|
+
} from "./auth-b3bmdkga.js";
|
|
10
10
|
import {
|
|
11
11
|
Api2
|
|
12
|
-
} from "./
|
|
12
|
+
} from "./auth-j87xz9bt.js";
|
|
13
13
|
import {
|
|
14
14
|
Config2
|
|
15
|
-
} from "./
|
|
15
|
+
} from "./auth-j4at0y5c.js";
|
|
16
16
|
import {
|
|
17
17
|
CorsConfig2
|
|
18
|
-
} from "./
|
|
18
|
+
} from "./auth-q4bn6dy8.js";
|
|
19
19
|
import {
|
|
20
20
|
layer3
|
|
21
|
-
} from "./
|
|
21
|
+
} from "./auth-yjbzmfhm.js";
|
|
22
22
|
import {
|
|
23
23
|
node2
|
|
24
|
-
} from "./
|
|
24
|
+
} from "./auth-kqr36gas.js";
|
|
25
25
|
import {
|
|
26
26
|
handlers2
|
|
27
|
-
} from "./
|
|
27
|
+
} from "./auth-6jfbq4sw.js";
|
|
28
28
|
import {
|
|
29
29
|
authorizationLayer2
|
|
30
|
-
} from "./
|
|
30
|
+
} from "./auth-7b9xm1qg.js";
|
|
31
31
|
import {
|
|
32
32
|
schemaErrorLayer2
|
|
33
|
-
} from "./
|
|
33
|
+
} from "./auth-bd8755ek.js";
|
|
34
34
|
|
|
35
35
|
// src/routes.ts
|
|
36
36
|
import { Database } from "@opencode/core/database/database";
|
|
@@ -54,6 +54,7 @@ import { Instance } from "@opencode/core/instance/service";
|
|
|
54
54
|
import { SessionTransfer } from "@opencode/core/session/transfer";
|
|
55
55
|
import { InstructionEntry } from "@opencode/core/session/instruction-entry";
|
|
56
56
|
import { ShellSelect } from "@opencode/core/shell/select";
|
|
57
|
+
import { Shell } from "@opencode/core/shell";
|
|
57
58
|
import { Job } from "@opencode/core/job";
|
|
58
59
|
import { KV } from "@opencode/core/kv";
|
|
59
60
|
import { Mcp } from "@opencode/core/mcp/index";
|
|
@@ -75,11 +76,14 @@ import { HttpRouter } from "effect/http";
|
|
|
75
76
|
import { HttpApiBuilder } from "effect/http-api";
|
|
76
77
|
import { Context, Effect, Layer, Option } from "effect";
|
|
77
78
|
var applicationServiceNodes = [
|
|
79
|
+
App.node,
|
|
78
80
|
Global.node,
|
|
79
81
|
FSUtil.node,
|
|
80
82
|
Database.node,
|
|
81
83
|
KV.node,
|
|
82
84
|
Bus.node,
|
|
85
|
+
PersistentPty.node,
|
|
86
|
+
Shell.daemonNode,
|
|
83
87
|
EventLogger.node,
|
|
84
88
|
httpClient,
|
|
85
89
|
Job.node,
|
|
@@ -94,7 +98,6 @@ var applicationServiceNodes = [
|
|
|
94
98
|
PluginUpdate.node,
|
|
95
99
|
PermissionSaved.node,
|
|
96
100
|
PtyTicket.node,
|
|
97
|
-
PersistentPty.node,
|
|
98
101
|
Credential.node,
|
|
99
102
|
WellKnown.node,
|
|
100
103
|
node2,
|
|
@@ -155,7 +158,7 @@ function makeRoutes(auth, options, serviceURLs, overrides, instances) {
|
|
|
155
158
|
return serviceLayer.pipe(Layer.flatMap((context) => {
|
|
156
159
|
const services = Layer.succeedContext(context);
|
|
157
160
|
const requestServices = Layer.merge(Layer.succeedContext(Context.pick(Database.Service, Credential.Service, PermissionSaved.Service, PluginUpdate.Service, Project.Service, WellKnown.Service)(context)), layer3(serviceURLs, Context.get(context, Global.Service).tmp, options.app));
|
|
158
|
-
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(
|
|
161
|
+
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(layer4), Layer.provide(authorizationLayer2), Layer.provide(schemaErrorLayer2), Layer.provide(auth), HttpRouter.provideRequest(requestServices), Layer.provideMerge(services), Layer.provideMerge(HttpRouter.layer));
|
|
159
162
|
return Layer.merge(api, V1Migration.layer.pipe(Layer.provide(services)));
|
|
160
163
|
}));
|
|
161
164
|
}
|
|
@@ -3,16 +3,16 @@ import {
|
|
|
3
3
|
missingMessage2,
|
|
4
4
|
failedMessageDecode2,
|
|
5
5
|
failedSnapshot2
|
|
6
|
-
} from "./
|
|
6
|
+
} from "./auth-smaf4a18.js";
|
|
7
7
|
import {
|
|
8
8
|
locationErrors2
|
|
9
|
-
} from "./
|
|
9
|
+
} from "./auth-50bbk3b2.js";
|
|
10
10
|
import {
|
|
11
11
|
Api2
|
|
12
|
-
} from "./
|
|
12
|
+
} from "./auth-j87xz9bt.js";
|
|
13
13
|
import {
|
|
14
14
|
wantsMediaRefs2
|
|
15
|
-
} from "./
|
|
15
|
+
} from "./auth-xthc02cw.js";
|
|
16
16
|
|
|
17
17
|
// src/handlers/session.ts
|
|
18
18
|
import { Instance } from "@opencode/core/instance/service";
|
|
@@ -275,8 +275,8 @@ var SessionHandler2 = HttpApiBuilder.group(Api2, "server.session", (handlers) =>
|
|
|
275
275
|
yield* instructions.remove({ sessionID: ctx.params.sessionID, key: ctx.params.key });
|
|
276
276
|
return HttpApiSchema.NoContent.make();
|
|
277
277
|
})).handle("session.generate", Effect.fn(function* (ctx) {
|
|
278
|
-
const
|
|
279
|
-
return { data:
|
|
278
|
+
const result = yield* session.generate({ sessionID: ctx.params.sessionID, prompt: ctx.payload.prompt }).pipe(Effect.mapError((error) => error._tag === "Session.NotFoundError" ? missingSession2(error) : new ServiceUnavailableError({ message: error.message, service: "session generation" })));
|
|
279
|
+
return { data: result };
|
|
280
280
|
})).handle("session.log", Effect.fn(function* (ctx) {
|
|
281
281
|
yield* session.get(ctx.params.sessionID).pipe(Effect.catchTag("Session.NotFoundError", missingSession2));
|
|
282
282
|
return session.log({ sessionID: ctx.params.sessionID, after: ctx.query.after, follow: ctx.query.follow }).pipe(Stream.orDie);
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
LocationMiddleware2
|
|
3
|
-
} from "./
|
|
3
|
+
} from "./auth-50bbk3b2.js";
|
|
4
4
|
import {
|
|
5
5
|
FormLocationMiddleware2
|
|
6
|
-
} from "./
|
|
6
|
+
} from "./auth-htyf2qs7.js";
|
|
7
7
|
import {
|
|
8
8
|
SessionLocationMiddleware2
|
|
9
|
-
} from "./
|
|
9
|
+
} from "./auth-b3bmdkga.js";
|
|
10
10
|
|
|
11
11
|
// src/api.ts
|
|
12
12
|
import { makeDefaultApi } from "@opencode/protocol/api";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
awaitPlugins2,
|
|
3
3
|
response2
|
|
4
|
-
} from "./
|
|
4
|
+
} from "./auth-50bbk3b2.js";
|
|
5
5
|
import {
|
|
6
6
|
Api2
|
|
7
|
-
} from "./
|
|
7
|
+
} from "./auth-j87xz9bt.js";
|
|
8
8
|
|
|
9
9
|
// src/handlers/websearch.ts
|
|
10
10
|
import { WebSearch } from "@opencode/core/websearch";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Api2
|
|
3
|
-
} from "./
|
|
3
|
+
} from "./auth-j87xz9bt.js";
|
|
4
4
|
import {
|
|
5
|
-
|
|
5
|
+
Service3,
|
|
6
6
|
frame2
|
|
7
|
-
} from "./
|
|
7
|
+
} from "./auth-3p9jwgak.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* Service3;
|
|
16
16
|
return handlers.handleRaw("event.subscribe", (ctx) => Effect.gen(function* () {
|
|
17
17
|
const connected = {
|
|
18
18
|
id: Event.ID.create(),
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
missingSession2
|
|
3
|
-
} from "./
|
|
3
|
+
} from "./auth-smaf4a18.js";
|
|
4
4
|
import {
|
|
5
5
|
locationErrors2,
|
|
6
|
-
awaitPlugins2,
|
|
7
6
|
response2,
|
|
8
7
|
requestRef2
|
|
9
|
-
} from "./
|
|
8
|
+
} from "./auth-50bbk3b2.js";
|
|
10
9
|
|
|
11
10
|
// src/handlers/artifact.ts
|
|
12
11
|
import { Artifact } from "@opencode/core/artifact";
|
|
@@ -64,7 +63,7 @@ var makeArtifact2 = Effect.gen(function* () {
|
|
|
64
63
|
});
|
|
65
64
|
const inLocation = (request, options, effect) => Effect.gen(function* () {
|
|
66
65
|
const ref = yield* resolveLocation(request, options);
|
|
67
|
-
return yield*
|
|
66
|
+
return yield* effect.pipe(Effect.provide(locations.get(ref)), locationErrors2);
|
|
68
67
|
});
|
|
69
68
|
const mapCommon = (effect) => effect.pipe(Effect.catchTags({
|
|
70
69
|
"Artifact.DisabledError": (error) => Effect.fail(new ForbiddenError({ message: error.message })),
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import {
|
|
2
2
|
isAllowedCorsOrigin2
|
|
3
|
-
} from "./
|
|
3
|
+
} from "./auth-q4bn6dy8.js";
|
|
4
4
|
import {
|
|
5
5
|
middleware2
|
|
6
|
-
} from "./
|
|
6
|
+
} from "./auth-myqk22k5.js";
|
|
7
7
|
import {
|
|
8
8
|
withoutParentSpan2
|
|
9
|
-
} from "./
|
|
9
|
+
} from "./auth-yc7nft6q.js";
|
|
10
10
|
import {
|
|
11
11
|
createRoutes2
|
|
12
|
-
} from "./
|
|
12
|
+
} from "./auth-etdgpyr8.js";
|
|
13
13
|
import {
|
|
14
14
|
__export
|
|
15
|
-
} from "./
|
|
15
|
+
} from "./auth-9rqn6x4v.js";
|
|
16
16
|
|
|
17
17
|
// src/fetch.ts
|
|
18
18
|
var exports_fetch = {};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
requestRef2
|
|
3
|
-
} from "./
|
|
3
|
+
} from "./auth-50bbk3b2.js";
|
|
4
4
|
import {
|
|
5
5
|
Api2
|
|
6
|
-
} from "./
|
|
6
|
+
} from "./auth-j87xz9bt.js";
|
|
7
7
|
|
|
8
8
|
// src/handlers/debug.ts
|
|
9
9
|
import { LocationServiceMap } from "@opencode/core/location-service-map";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
awaitPlugins2,
|
|
3
3
|
response2
|
|
4
|
-
} from "./
|
|
4
|
+
} from "./auth-50bbk3b2.js";
|
|
5
5
|
import {
|
|
6
6
|
Api2
|
|
7
|
-
} from "./
|
|
7
|
+
} from "./auth-j87xz9bt.js";
|
|
8
8
|
|
|
9
9
|
// src/handlers/model.ts
|
|
10
10
|
import { Model } from "@opencode/core/model";
|
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
2
|
response2
|
|
3
|
-
} from "./
|
|
3
|
+
} from "./auth-50bbk3b2.js";
|
|
4
4
|
import {
|
|
5
5
|
Api2
|
|
6
|
-
} from "./
|
|
6
|
+
} from "./auth-j87xz9bt.js";
|
|
7
7
|
|
|
8
8
|
// src/handlers/vcs.ts
|
|
9
9
|
import { Vcs } from "@opencode/core/vcs";
|
|
10
10
|
import { Project } from "@opencode/core/project";
|
|
11
11
|
import { Worktree } from "@opencode/core/worktree";
|
|
12
12
|
import { Bus } from "@opencode/core/bus";
|
|
13
|
-
import { Plugin } from "@opencode/core/plugin";
|
|
14
13
|
import { Location } from "@opencode/core/location";
|
|
15
14
|
import { LocationServiceMap } from "@opencode/core/location-services";
|
|
16
15
|
import { ConflictError, InvalidRequestError, ServiceUnavailableError } from "@opencode/protocol/errors";
|
|
@@ -25,7 +24,6 @@ var VcsHandler2 = HttpApiBuilder.group(Api2, "server.vcs", (handlers) => Effect.
|
|
|
25
24
|
const location = yield* Location.Service;
|
|
26
25
|
const directory = location.project.directory;
|
|
27
26
|
const providerID = ctx.query.provider ?? "git";
|
|
28
|
-
yield* Plugin.awaitActivation;
|
|
29
27
|
const vcs = yield* Vcs.Service;
|
|
30
28
|
yield* vcs.initialize(providerID).pipe(Effect.mapError((error) => {
|
|
31
29
|
if (error.kind === "missing")
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import {
|
|
2
2
|
__export
|
|
3
|
-
} from "./
|
|
3
|
+
} from "./auth-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
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 Service4 extends Context.Service()("@opencode/server/ServerInfo") {
|
|
17
17
|
}
|
|
18
18
|
function layer3(urls, tmp, app = {}) {
|
|
19
|
-
return Layer.succeed(
|
|
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, layer3, connectionURLs2, exports_server_info };
|