@opencode/server 2.0.26 → 2.0.28
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 +17 -14
- package/dist/api.js +5 -5
- package/dist/auth.js +1 -1
- package/dist/chunks/{fetch-6fr0a7bp.js → server-info-1fx5fmdj.js} +22 -21
- package/dist/chunks/{fetch-80mhd8t7.js → server-info-2nsepnqy.js} +3 -3
- package/dist/chunks/{fetch-zhympcbw.js → server-info-2yr2dq97.js} +3 -3
- package/dist/chunks/{fetch-d00srfh1.js → server-info-3154e7fk.js} +3 -3
- package/dist/chunks/{fetch-g9rgg5ys.js → server-info-31acg4hb.js} +3 -3
- package/dist/chunks/{fetch-w1fepcwh.js → server-info-49c878v9.js} +3 -3
- package/dist/chunks/{fetch-cm271yqe.js → server-info-4b0899hb.js} +3 -3
- package/dist/chunks/{fetch-8c9kbrtm.js → server-info-5w10ccet.js} +2 -2
- package/dist/chunks/{fetch-gtkdacvk.js → server-info-5ytyqf1q.js} +5 -4
- package/dist/chunks/{fetch-hajt4q09.js → server-info-72ygafj3.js} +3 -3
- package/dist/chunks/{fetch-n1svm92q.js → server-info-75c938bc.js} +6 -6
- package/dist/chunks/{fetch-agftk6b6.js → server-info-91mt6ewz.js} +3 -3
- package/dist/chunks/{fetch-t1n0m4wb.js → server-info-a6kxe6a7.js} +30 -34
- package/dist/chunks/{fetch-1kbkbftd.js → server-info-agw55v2c.js} +4 -4
- package/dist/chunks/{fetch-anm12x33.js → server-info-anm12x33.js} +1 -1
- package/dist/chunks/{fetch-mjepr257.js → server-info-cfhthk6z.js} +2 -2
- package/dist/chunks/{fetch-j3pdvhe2.js → server-info-cx1d1bht.js} +3 -3
- package/dist/chunks/{fetch-gj6tv0s4.js → server-info-e4x9285j.js} +6 -3
- package/dist/chunks/{fetch-r5bb0n1s.js → server-info-e7pctymn.js} +2 -2
- package/dist/chunks/{fetch-t8yzmczr.js → server-info-erzfdgke.js} +1 -1
- package/dist/chunks/{fetch-eekrj6qv.js → server-info-f4b2q3tn.js} +2 -2
- package/dist/chunks/{fetch-cy7y42ks.js → server-info-f6n7ws9b.js} +4 -4
- package/dist/chunks/{fetch-78n975k2.js → server-info-fzcjf2mc.js} +10 -10
- package/dist/chunks/{fetch-1w9kp1gg.js → server-info-ga3m49sz.js} +3 -3
- package/dist/chunks/{fetch-kzj5eept.js → server-info-gat934pw.js} +33 -33
- package/dist/chunks/{fetch-acgs9zzk.js → server-info-gymtz25n.js} +14 -6
- package/dist/chunks/server-info-h6rt5k9s.js +24 -0
- package/dist/chunks/{fetch-54sczv30.js → server-info-hg93khqa.js} +7 -7
- package/dist/chunks/server-info-j5aeaa16.js +15 -0
- package/dist/chunks/{fetch-bvp1r88z.js → server-info-jabz3c4v.js} +3 -3
- package/dist/chunks/{fetch-t70dy8sr.js → server-info-kd6vzpgq.js} +3 -3
- package/dist/chunks/{fetch-rwwc81rq.js → server-info-pf9p09ew.js} +2 -2
- package/dist/chunks/{fetch-wb43dd8f.js → server-info-pmjbkszz.js} +6 -4
- package/dist/chunks/{fetch-c6kb7fmf.js → server-info-s07e4y6n.js} +7 -7
- package/dist/chunks/{fetch-0chp8crd.js → server-info-sstsrjtg.js} +8 -8
- package/dist/chunks/{fetch-4qyjttng.js → server-info-swdgbzpj.js} +3 -3
- package/dist/chunks/{fetch-jxc39wgw.js → server-info-t3j5ftv1.js} +3 -3
- package/dist/chunks/{fetch-053p7hbt.js → server-info-v1czxanb.js} +7 -7
- package/dist/chunks/{fetch-b44t4qeg.js → server-info-wys7phx0.js} +30 -29
- package/dist/chunks/{fetch-rhnwnf76.js → server-info-x0608mvx.js} +2 -2
- package/dist/chunks/{fetch-nxdx74sv.js → server-info-x74w7e1f.js} +3 -3
- package/dist/chunks/{fetch-q9rkrfm7.js → server-info-x9vr2ttf.js} +5 -5
- package/dist/chunks/{fetch-0y03q8mn.js → server-info-xmwystkq.js} +3 -3
- package/dist/chunks/{fetch-5w24ch67.js → server-info-xsrtpxyd.js} +4 -4
- package/dist/chunks/{fetch-m4fq9qce.js → server-info-y9mzegx1.js} +6 -6
- package/dist/chunks/{fetch-m6xk774d.js → server-info-zs542hzz.js} +3 -3
- package/dist/cors.js +1 -1
- package/dist/event-feed.js +5 -5
- package/dist/fetch.d.ts +5 -5
- package/dist/fetch.js +49 -49
- package/dist/handlers/agent.d.ts +1 -1
- package/dist/handlers/agent.js +6 -6
- package/dist/handlers/command.d.ts +1 -1
- package/dist/handlers/command.js +6 -6
- package/dist/handlers/config.d.ts +1 -1
- package/dist/handlers/config.js +6 -6
- package/dist/handlers/credential.d.ts +1 -1
- package/dist/handlers/credential.js +6 -6
- package/dist/handlers/debug.d.ts +1 -1
- package/dist/handlers/debug.js +6 -6
- package/dist/handlers/event.d.ts +1 -1
- package/dist/handlers/event.js +7 -7
- package/dist/handlers/form.d.ts +1 -1
- package/dist/handlers/form.js +6 -6
- package/dist/handlers/fs.d.ts +1 -1
- package/dist/handlers/fs.js +6 -6
- package/dist/handlers/generate.d.ts +1 -1
- package/dist/handlers/generate.js +6 -6
- package/dist/handlers/integration.d.ts +1 -1
- package/dist/handlers/integration.js +6 -6
- package/dist/handlers/location.d.ts +1 -1
- package/dist/handlers/location.js +6 -6
- package/dist/handlers/mcp.d.ts +1 -1
- package/dist/handlers/mcp.js +6 -6
- package/dist/handlers/message.d.ts +1 -1
- package/dist/handlers/message.js +6 -6
- package/dist/handlers/migration.d.ts +1 -1
- package/dist/handlers/migration.js +6 -6
- package/dist/handlers/model.d.ts +1 -1
- package/dist/handlers/model.js +6 -6
- package/dist/handlers/permission.d.ts +1 -1
- package/dist/handlers/permission.js +6 -6
- package/dist/handlers/persistent-pty.d.ts +1 -1
- package/dist/handlers/persistent-pty.js +8 -8
- package/dist/handlers/plugin.d.ts +1 -1
- package/dist/handlers/plugin.js +6 -6
- package/dist/handlers/project.d.ts +1 -1
- package/dist/handlers/project.js +6 -6
- package/dist/handlers/provider.d.ts +1 -1
- package/dist/handlers/provider.js +6 -6
- package/dist/handlers/pty-socket.d.ts +10 -2
- package/dist/handlers/pty-socket.js +1 -1
- package/dist/handlers/pty.d.ts +1 -1
- package/dist/handlers/pty.js +9 -9
- package/dist/handlers/reference.d.ts +1 -1
- package/dist/handlers/reference.js +6 -6
- package/dist/handlers/rpc.d.ts +1 -1
- package/dist/handlers/rpc.js +6 -6
- package/dist/handlers/server.d.ts +1 -1
- package/dist/handlers/server.js +9 -9
- package/dist/handlers/session-error.js +1 -1
- package/dist/handlers/session.d.ts +1 -1
- package/dist/handlers/session.js +6 -6
- package/dist/handlers/shell.d.ts +1 -1
- package/dist/handlers/shell.js +6 -6
- package/dist/handlers/skill.d.ts +1 -1
- package/dist/handlers/skill.js +6 -6
- package/dist/handlers/vcs.d.ts +1 -1
- package/dist/handlers/vcs.js +6 -6
- package/dist/handlers/websearch.d.ts +1 -1
- package/dist/handlers/websearch.js +6 -6
- package/dist/handlers/worktree.d.ts +1 -1
- package/dist/handlers/worktree.js +6 -6
- package/dist/handlers.d.ts +1 -1
- package/dist/handlers.js +43 -43
- package/dist/location.d.ts +5 -3
- package/dist/location.js +6 -4
- package/dist/middleware/authorization.d.ts +1 -1
- package/dist/middleware/authorization.js +2 -2
- package/dist/middleware/form-location.d.ts +2 -2
- package/dist/middleware/form-location.js +3 -3
- package/dist/middleware/schema-error.js +1 -1
- package/dist/middleware/session-location.d.ts +1 -1
- package/dist/middleware/session-location.js +3 -3
- package/dist/pairing.js +5 -5
- package/dist/process.d.ts +9 -8
- package/dist/process.js +52 -52
- package/dist/pty-environment.js +5 -5
- package/dist/request-tracing.js +1 -1
- package/dist/routes.d.ts +3 -3
- package/dist/routes.js +46 -46
- package/dist/server-info.js +5 -5
- package/dist/service-status.js +3 -3
- package/dist/workerd.js +50 -50
- package/package.json +14 -12
- package/dist/chunks/fetch-dy0yben3.js +0 -15
- package/dist/chunks/fetch-hezj1jdf.js +0 -7
- /package/dist/chunks/{fetch-9rqn6x4v.js → server-info-9rqn6x4v.js} +0 -0
- /package/dist/chunks/{fetch-q4bn6dy8.js → server-info-q4bn6dy8.js} +0 -0
- /package/dist/chunks/{fetch-smaf4a18.js → server-info-smaf4a18.js} +0 -0
- /package/dist/chunks/{fetch-yc7nft6q.js → server-info-yc7nft6q.js} +0 -0
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
2
|
response2
|
|
3
|
-
} from "./
|
|
3
|
+
} from "./server-info-gymtz25n.js";
|
|
4
4
|
import {
|
|
5
5
|
Api2
|
|
6
|
-
} from "./
|
|
6
|
+
} from "./server-info-t3j5ftv1.js";
|
|
7
7
|
|
|
8
8
|
// src/handlers/mcp.ts
|
|
9
9
|
import { Mcp } from "@opencode/core/mcp/index";
|
|
10
10
|
import { McpServerNotFoundError } from "@opencode/protocol/errors";
|
|
11
11
|
import { Effect } from "effect";
|
|
12
|
-
import { HttpApiBuilder, HttpApiSchema } from "effect/
|
|
12
|
+
import { HttpApiBuilder, HttpApiSchema } from "effect/http-api";
|
|
13
13
|
var notFound = (effect) => effect.pipe(Effect.mapError((error) => new McpServerNotFoundError({ server: error.server, message: error.message })));
|
|
14
14
|
var McpHandler2 = HttpApiBuilder.group(Api2, "server.mcp", (handlers) => Effect.gen(function* () {
|
|
15
15
|
return handlers.handle("mcp.list", Effect.fn(function* () {
|
|
@@ -1,19 +1,22 @@
|
|
|
1
1
|
import {
|
|
2
|
+
awaitPlugins2,
|
|
2
3
|
response2
|
|
3
|
-
} from "./
|
|
4
|
+
} from "./server-info-gymtz25n.js";
|
|
4
5
|
import {
|
|
5
6
|
Api2
|
|
6
|
-
} from "./
|
|
7
|
+
} from "./server-info-t3j5ftv1.js";
|
|
7
8
|
|
|
8
9
|
// src/handlers/model.ts
|
|
9
10
|
import { Model } from "@opencode/core/model";
|
|
10
11
|
import { Effect } from "effect";
|
|
11
|
-
import { HttpApiBuilder } from "effect/
|
|
12
|
+
import { HttpApiBuilder } from "effect/http-api";
|
|
12
13
|
var ModelHandler2 = HttpApiBuilder.group(Api2, "server.model", (handlers) => Effect.gen(function* () {
|
|
13
14
|
return handlers.handle("model.list", Effect.fn(function* () {
|
|
15
|
+
yield* awaitPlugins2;
|
|
14
16
|
const models = yield* Model.Service;
|
|
15
17
|
return yield* response2(models.available());
|
|
16
18
|
})).handle("model.default", Effect.fn(function* () {
|
|
19
|
+
yield* awaitPlugins2;
|
|
17
20
|
const models = yield* Model.Service;
|
|
18
21
|
return yield* response2(models.default());
|
|
19
22
|
}));
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Api2
|
|
3
|
-
} from "./
|
|
3
|
+
} from "./server-info-t3j5ftv1.js";
|
|
4
4
|
|
|
5
5
|
// src/handlers/config.ts
|
|
6
6
|
import { Config } from "@opencode/core/config";
|
|
7
7
|
import { ShellSelect } from "@opencode/core/shell/select";
|
|
8
8
|
import { Effect } from "effect";
|
|
9
|
-
import { HttpApiBuilder } from "effect/
|
|
9
|
+
import { HttpApiBuilder } from "effect/http-api";
|
|
10
10
|
var ConfigHandler2 = HttpApiBuilder.group(Api2, "server.config", (handlers) => handlers.handle("config.get", () => Config.Service.use((config) => config.entries())).handle("config.update", Effect.fn(function* (ctx) {
|
|
11
11
|
const config = yield* Config.Service;
|
|
12
12
|
if (!config.update)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// src/middleware/schema-error.ts
|
|
2
2
|
import { Effect } from "effect";
|
|
3
|
-
import { HttpApiMiddleware } from "effect/
|
|
3
|
+
import { HttpApiMiddleware } from "effect/http-api";
|
|
4
4
|
import { InvalidRequestError } from "@opencode/protocol/errors";
|
|
5
5
|
import { SchemaErrorMiddleware } from "@opencode/protocol/middleware/schema-error";
|
|
6
6
|
import { SchemaErrorMiddleware as SchemaErrorMiddleware2 } from "@opencode/protocol/middleware/schema-error";
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Api2
|
|
3
|
-
} from "./
|
|
3
|
+
} from "./server-info-t3j5ftv1.js";
|
|
4
4
|
|
|
5
5
|
// src/handlers/credential.ts
|
|
6
6
|
import { Credential } from "@opencode/core/credential";
|
|
7
7
|
import { ConflictError } from "@opencode/protocol/errors";
|
|
8
8
|
import { Effect } from "effect";
|
|
9
|
-
import { HttpApiBuilder, HttpApiSchema } from "effect/
|
|
9
|
+
import { HttpApiBuilder, HttpApiSchema } from "effect/http-api";
|
|
10
10
|
var CredentialHandler2 = HttpApiBuilder.group(Api2, "server.credential", (handlers) => handlers.handle("credential.list", Effect.fn(function* () {
|
|
11
11
|
const credential = yield* Credential.Service;
|
|
12
12
|
return { data: entries(yield* credential.all()) };
|
|
@@ -3,13 +3,13 @@ import {
|
|
|
3
3
|
missingMessage2,
|
|
4
4
|
failedMessageDecode2,
|
|
5
5
|
failedSnapshot2
|
|
6
|
-
} from "./
|
|
6
|
+
} from "./server-info-smaf4a18.js";
|
|
7
7
|
import {
|
|
8
8
|
locationErrors2
|
|
9
|
-
} from "./
|
|
9
|
+
} from "./server-info-gymtz25n.js";
|
|
10
10
|
import {
|
|
11
11
|
Api2
|
|
12
|
-
} from "./
|
|
12
|
+
} from "./server-info-t3j5ftv1.js";
|
|
13
13
|
|
|
14
14
|
// src/handlers/session.ts
|
|
15
15
|
import { Session } from "@opencode/core/session";
|
|
@@ -19,7 +19,7 @@ import { SessionTransfer } from "@opencode/core/session/transfer";
|
|
|
19
19
|
import { InstructionEntry } from "@opencode/core/session/instruction-entry";
|
|
20
20
|
import { Form } from "@opencode/core/form";
|
|
21
21
|
import { DateTime, Effect, Stream } from "effect";
|
|
22
|
-
import { HttpApiBuilder, HttpApiSchema } from "effect/
|
|
22
|
+
import { HttpApiBuilder, HttpApiSchema } from "effect/http-api";
|
|
23
23
|
import { SessionsCursor } from "@opencode/protocol/groups/session";
|
|
24
24
|
import {
|
|
25
25
|
ConflictError,
|
|
@@ -1,30 +1,30 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Api2
|
|
3
|
-
} from "./
|
|
3
|
+
} from "./server-info-t3j5ftv1.js";
|
|
4
4
|
import {
|
|
5
5
|
SESSION_TTL_SECONDS2,
|
|
6
6
|
Config2,
|
|
7
7
|
issueSession2,
|
|
8
8
|
sessionCookieName2
|
|
9
|
-
} from "./
|
|
10
|
-
import {
|
|
11
|
-
Service2
|
|
12
|
-
} from "./fetch-c6kb7fmf.js";
|
|
9
|
+
} from "./server-info-anm12x33.js";
|
|
13
10
|
import {
|
|
14
11
|
Service3
|
|
15
|
-
} from "./
|
|
12
|
+
} from "./server-info-s07e4y6n.js";
|
|
13
|
+
import {
|
|
14
|
+
Service5
|
|
15
|
+
} from "./server-info-sstsrjtg.js";
|
|
16
16
|
|
|
17
17
|
// src/handlers/server.ts
|
|
18
18
|
import { Duration, Effect } from "effect";
|
|
19
|
-
import { HttpServerRequest, HttpServerResponse } from "effect/
|
|
20
|
-
import { HttpApiBuilder } from "effect/
|
|
19
|
+
import { HttpServerRequest, HttpServerResponse } from "effect/http";
|
|
20
|
+
import { HttpApiBuilder } from "effect/http-api";
|
|
21
21
|
import { PersistentPty } from "@opencode/core/persistent-pty";
|
|
22
22
|
import { UnauthorizedError } from "@opencode/protocol/errors";
|
|
23
23
|
var ServerHandler2 = HttpApiBuilder.group(Api2, "server.server", (handlers) => Effect.gen(function* () {
|
|
24
|
-
const pairing = yield*
|
|
24
|
+
const pairing = yield* Service5;
|
|
25
25
|
const auth = yield* Config2;
|
|
26
26
|
return handlers.handle("server.info", () => Effect.gen(function* () {
|
|
27
|
-
const info = yield*
|
|
27
|
+
const info = yield* Service3;
|
|
28
28
|
return {
|
|
29
29
|
version: info.app.version ?? "unknown",
|
|
30
30
|
pid: process.pid ?? 0,
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import {
|
|
2
2
|
response2
|
|
3
|
-
} from "./
|
|
3
|
+
} from "./server-info-gymtz25n.js";
|
|
4
4
|
import {
|
|
5
5
|
Api2
|
|
6
|
-
} from "./
|
|
6
|
+
} from "./server-info-t3j5ftv1.js";
|
|
7
7
|
|
|
8
8
|
// src/handlers/agent.ts
|
|
9
9
|
import { Agent } from "@opencode/core/agent";
|
|
10
10
|
import { Effect } from "effect";
|
|
11
|
-
import { HttpApiBuilder } from "effect/
|
|
11
|
+
import { HttpApiBuilder } from "effect/http-api";
|
|
12
12
|
import { AgentNotFoundError } from "@opencode/protocol/errors";
|
|
13
13
|
var AgentHandler2 = HttpApiBuilder.group(Api2, "server.agent", (handlers) => handlers.handle("agent.list", () => Effect.gen(function* () {
|
|
14
14
|
return yield* response2(Agent.Service.use((agent) => agent.list()));
|
|
@@ -1,99 +1,99 @@
|
|
|
1
1
|
import {
|
|
2
2
|
GenerateHandler2
|
|
3
|
-
} from "./
|
|
3
|
+
} from "./server-info-pmjbkszz.js";
|
|
4
4
|
import {
|
|
5
5
|
MessageHandler2
|
|
6
|
-
} from "./
|
|
6
|
+
} from "./server-info-jabz3c4v.js";
|
|
7
7
|
import {
|
|
8
8
|
ModelHandler2
|
|
9
|
-
} from "./
|
|
9
|
+
} from "./server-info-e4x9285j.js";
|
|
10
10
|
import {
|
|
11
11
|
ProviderHandler2
|
|
12
|
-
} from "./
|
|
12
|
+
} from "./server-info-swdgbzpj.js";
|
|
13
13
|
import {
|
|
14
14
|
SessionHandler2
|
|
15
|
-
} from "./
|
|
15
|
+
} from "./server-info-f6n7ws9b.js";
|
|
16
16
|
import {
|
|
17
17
|
PermissionHandler2
|
|
18
|
-
} from "./
|
|
18
|
+
} from "./server-info-agw55v2c.js";
|
|
19
19
|
import {
|
|
20
20
|
FileSystemHandler2
|
|
21
|
-
} from "./
|
|
21
|
+
} from "./server-info-x9vr2ttf.js";
|
|
22
22
|
import {
|
|
23
23
|
FormHandler2
|
|
24
|
-
} from "./
|
|
24
|
+
} from "./server-info-91mt6ewz.js";
|
|
25
25
|
import {
|
|
26
26
|
CommandHandler2
|
|
27
|
-
} from "./
|
|
27
|
+
} from "./server-info-xmwystkq.js";
|
|
28
28
|
import {
|
|
29
29
|
SkillHandler2
|
|
30
|
-
} from "./
|
|
30
|
+
} from "./server-info-4b0899hb.js";
|
|
31
31
|
import {
|
|
32
32
|
RpcHandler2
|
|
33
|
-
} from "./
|
|
33
|
+
} from "./server-info-5w10ccet.js";
|
|
34
34
|
import {
|
|
35
|
-
|
|
36
|
-
} from "./
|
|
35
|
+
layer3
|
|
36
|
+
} from "./server-info-hg93khqa.js";
|
|
37
37
|
import {
|
|
38
38
|
EventHandler2
|
|
39
|
-
} from "./
|
|
39
|
+
} from "./server-info-y9mzegx1.js";
|
|
40
40
|
import {
|
|
41
41
|
AgentHandler2
|
|
42
|
-
} from "./
|
|
42
|
+
} from "./server-info-ga3m49sz.js";
|
|
43
43
|
import {
|
|
44
44
|
PluginHandler2
|
|
45
|
-
} from "./
|
|
45
|
+
} from "./server-info-49c878v9.js";
|
|
46
46
|
import {
|
|
47
47
|
ServerHandler2
|
|
48
|
-
} from "./
|
|
48
|
+
} from "./server-info-fzcjf2mc.js";
|
|
49
49
|
import {
|
|
50
50
|
DebugHandler2
|
|
51
|
-
} from "./
|
|
51
|
+
} from "./server-info-zs542hzz.js";
|
|
52
52
|
import {
|
|
53
53
|
PtyHandler2
|
|
54
|
-
} from "./
|
|
54
|
+
} from "./server-info-wys7phx0.js";
|
|
55
55
|
import {
|
|
56
56
|
PersistentPtyHandler2
|
|
57
|
-
} from "./
|
|
57
|
+
} from "./server-info-a6kxe6a7.js";
|
|
58
58
|
import {
|
|
59
59
|
ShellHandler2
|
|
60
|
-
} from "./
|
|
60
|
+
} from "./server-info-2yr2dq97.js";
|
|
61
61
|
import {
|
|
62
62
|
ReferenceHandler2
|
|
63
|
-
} from "./
|
|
63
|
+
} from "./server-info-kd6vzpgq.js";
|
|
64
64
|
import {
|
|
65
65
|
LocationHandler2
|
|
66
|
-
} from "./
|
|
66
|
+
} from "./server-info-cfhthk6z.js";
|
|
67
67
|
import {
|
|
68
68
|
IntegrationHandler2
|
|
69
|
-
} from "./
|
|
69
|
+
} from "./server-info-72ygafj3.js";
|
|
70
70
|
import {
|
|
71
71
|
WebSearchHandler2
|
|
72
|
-
} from "./
|
|
72
|
+
} from "./server-info-2nsepnqy.js";
|
|
73
73
|
import {
|
|
74
74
|
McpHandler2
|
|
75
|
-
} from "./
|
|
75
|
+
} from "./server-info-cx1d1bht.js";
|
|
76
76
|
import {
|
|
77
77
|
CredentialHandler2
|
|
78
|
-
} from "./
|
|
78
|
+
} from "./server-info-f4b2q3tn.js";
|
|
79
79
|
import {
|
|
80
80
|
ProjectHandler2
|
|
81
|
-
} from "./
|
|
81
|
+
} from "./server-info-j5aeaa16.js";
|
|
82
82
|
import {
|
|
83
83
|
WorktreeHandler2
|
|
84
|
-
} from "./
|
|
84
|
+
} from "./server-info-pf9p09ew.js";
|
|
85
85
|
import {
|
|
86
86
|
VcsHandler2
|
|
87
|
-
} from "./
|
|
87
|
+
} from "./server-info-31acg4hb.js";
|
|
88
88
|
import {
|
|
89
89
|
MigrationHandler2
|
|
90
|
-
} from "./
|
|
90
|
+
} from "./server-info-x0608mvx.js";
|
|
91
91
|
import {
|
|
92
92
|
ConfigHandler2
|
|
93
|
-
} from "./
|
|
93
|
+
} from "./server-info-e7pctymn.js";
|
|
94
94
|
|
|
95
95
|
// src/handlers.ts
|
|
96
96
|
import { Layer } from "effect";
|
|
97
|
-
var handlers2 = Layer.mergeAll(ServerHandler2, DebugHandler2, MigrationHandler2, LocationHandler2, AgentHandler2, PluginHandler2, SessionHandler2, MessageHandler2, ModelHandler2, GenerateHandler2, ProviderHandler2, IntegrationHandler2, WebSearchHandler2, McpHandler2, CredentialHandler2, ProjectHandler2, FormHandler2, PermissionHandler2, FileSystemHandler2, CommandHandler2, SkillHandler2, RpcHandler2, EventHandler2.pipe(Layer.provide(
|
|
97
|
+
var handlers2 = Layer.mergeAll(ServerHandler2, DebugHandler2, MigrationHandler2, LocationHandler2, AgentHandler2, PluginHandler2, SessionHandler2, MessageHandler2, ModelHandler2, GenerateHandler2, ProviderHandler2, IntegrationHandler2, WebSearchHandler2, McpHandler2, CredentialHandler2, ProjectHandler2, FormHandler2, PermissionHandler2, FileSystemHandler2, CommandHandler2, SkillHandler2, RpcHandler2, EventHandler2.pipe(Layer.provide(layer3)), PtyHandler2, PersistentPtyHandler2, ShellHandler2, ReferenceHandler2, WorktreeHandler2, VcsHandler2, ConfigHandler2);
|
|
98
98
|
|
|
99
99
|
export { handlers2 };
|
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
import {
|
|
2
2
|
missingSession2
|
|
3
|
-
} from "./
|
|
3
|
+
} from "./server-info-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";
|
|
8
9
|
import { LocationServiceMap } from "@opencode/core/location-services";
|
|
9
10
|
import { AbsolutePath } from "@opencode/core/schema";
|
|
10
11
|
import { Session } from "@opencode/core/session";
|
|
11
|
-
import { LocationNotFoundError, InvalidRequestError } from "@opencode/protocol/errors";
|
|
12
|
+
import { LocationNotFoundError, InvalidRequestError, ServiceUnavailableError } from "@opencode/protocol/errors";
|
|
12
13
|
import { Effect, Layer, Schema } from "effect";
|
|
13
|
-
import { HttpServerRequest } from "effect/
|
|
14
|
-
import { HttpApiMiddleware } from "effect/
|
|
14
|
+
import { HttpServerRequest } from "effect/http";
|
|
15
|
+
import { HttpApiMiddleware } from "effect/http-api";
|
|
15
16
|
class LocationMiddleware2 extends HttpApiMiddleware.Service()("@opencode/HttpApiLocation", { error: [LocationNotFoundError] }) {
|
|
16
17
|
}
|
|
17
18
|
function locationErrors2(effect) {
|
|
@@ -20,6 +21,13 @@ function locationErrors2(effect) {
|
|
|
20
21
|
message: `Location not found: ${error.directory}`
|
|
21
22
|
}))));
|
|
22
23
|
}
|
|
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
|
+
}));
|
|
23
31
|
function response2(data) {
|
|
24
32
|
return Effect.gen(function* () {
|
|
25
33
|
const location = yield* Location.Service;
|
|
@@ -51,7 +59,7 @@ function decode(input) {
|
|
|
51
59
|
return input;
|
|
52
60
|
}
|
|
53
61
|
}
|
|
54
|
-
var
|
|
62
|
+
var layer2 = Layer.effect(LocationMiddleware2, Effect.gen(function* () {
|
|
55
63
|
const locations = yield* LocationServiceMap.Service;
|
|
56
64
|
return LocationMiddleware2.of((effect) => Effect.gen(function* () {
|
|
57
65
|
const request = yield* HttpServerRequest.HttpServerRequest;
|
|
@@ -59,4 +67,4 @@ var layer3 = Layer.effect(LocationMiddleware2, Effect.gen(function* () {
|
|
|
59
67
|
}));
|
|
60
68
|
}));
|
|
61
69
|
|
|
62
|
-
export { LocationMiddleware2, locationErrors2, response2, sessionInfo2, requestRef2,
|
|
70
|
+
export { LocationMiddleware2, locationErrors2, awaitPlugins2, response2, sessionInfo2, requestRef2, layer2 };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
// src/handlers/pty-socket.ts
|
|
2
|
+
import { Effect, Queue } from "effect";
|
|
3
|
+
import { Socket } from "effect/socket";
|
|
4
|
+
function runPtySocket2(input) {
|
|
5
|
+
const drain = Effect.gen(function* () {
|
|
6
|
+
const writer = yield* input.socket.writer;
|
|
7
|
+
while (true) {
|
|
8
|
+
const item = yield* Queue.take(input.outbox);
|
|
9
|
+
yield* writer.write(item);
|
|
10
|
+
if (item instanceof Socket.CloseEvent)
|
|
11
|
+
return;
|
|
12
|
+
}
|
|
13
|
+
});
|
|
14
|
+
const read = Effect.gen(function* () {
|
|
15
|
+
const reader = yield* input.socket.reader;
|
|
16
|
+
if (input.onOpen)
|
|
17
|
+
yield* input.onOpen;
|
|
18
|
+
while (true)
|
|
19
|
+
yield* Effect.forEach(yield* reader.pull, input.onMessage, { discard: true });
|
|
20
|
+
});
|
|
21
|
+
return Effect.raceFirst(drain, read).pipe(Effect.ensuring(Effect.sync(input.detach)), Effect.catchReason("SocketError", "SocketCloseError", () => Effect.void), Effect.orDie);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export { runPtySocket2 };
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import {
|
|
2
2
|
__export
|
|
3
|
-
} from "./
|
|
3
|
+
} from "./server-info-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: () => Service2,
|
|
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 Service2 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 Service2.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 layer3 = Layer.effect(Service2, 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, Service2, frame2, make4, layer3, exports_event_feed };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Api2
|
|
3
|
+
} from "./server-info-t3j5ftv1.js";
|
|
4
|
+
|
|
5
|
+
// src/handlers/project.ts
|
|
6
|
+
import { Project } from "@opencode/core/project";
|
|
7
|
+
import { Effect } from "effect";
|
|
8
|
+
import { HttpApiBuilder } from "effect/http-api";
|
|
9
|
+
import { ProjectNotFoundError } from "@opencode/protocol/errors";
|
|
10
|
+
var ProjectHandler2 = HttpApiBuilder.group(Api2, "server.project", (handlers) => handlers.handle("project.list", (ctx) => Project.Service.use((project) => project.list(ctx.query))).handle("project.update", (ctx) => Project.Service.use((project) => project.update({ ...ctx.payload, projectID: ctx.params.projectID }).pipe(Effect.mapError(() => new ProjectNotFoundError({
|
|
11
|
+
projectID: ctx.params.projectID,
|
|
12
|
+
message: `Project not found: ${ctx.params.projectID}`
|
|
13
|
+
}))))));
|
|
14
|
+
|
|
15
|
+
export { ProjectHandler2 };
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import {
|
|
2
2
|
missingSession2,
|
|
3
3
|
failedMessageDecode2
|
|
4
|
-
} from "./
|
|
4
|
+
} from "./server-info-smaf4a18.js";
|
|
5
5
|
import {
|
|
6
6
|
Api2
|
|
7
|
-
} from "./
|
|
7
|
+
} from "./server-info-t3j5ftv1.js";
|
|
8
8
|
|
|
9
9
|
// src/handlers/message.ts
|
|
10
10
|
import { SessionMessage } from "@opencode/core/session/message";
|
|
11
11
|
import { Session } from "@opencode/core/session";
|
|
12
12
|
import { Effect, Schema } from "effect";
|
|
13
|
-
import { HttpApiBuilder } from "effect/
|
|
13
|
+
import { HttpApiBuilder } from "effect/http-api";
|
|
14
14
|
import { InvalidCursorError } from "@opencode/protocol/errors";
|
|
15
15
|
var DefaultMessagesLimit = 50;
|
|
16
16
|
var Cursor = Schema.Struct({
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
response2
|
|
3
|
-
} from "./
|
|
3
|
+
} from "./server-info-gymtz25n.js";
|
|
4
4
|
import {
|
|
5
5
|
Api2
|
|
6
|
-
} from "./
|
|
6
|
+
} from "./server-info-t3j5ftv1.js";
|
|
7
7
|
|
|
8
8
|
// src/handlers/reference.ts
|
|
9
9
|
import { Reference } from "@opencode/core/reference";
|
|
10
|
-
import { HttpApiBuilder } from "effect/
|
|
10
|
+
import { HttpApiBuilder } from "effect/http-api";
|
|
11
11
|
var ReferenceHandler2 = HttpApiBuilder.group(Api2, "server.reference", (handlers) => handlers.handle("reference.list", () => response2(Reference.Service.use((reference) => reference.list()))));
|
|
12
12
|
|
|
13
13
|
export { ReferenceHandler2 };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Api2
|
|
3
|
-
} from "./
|
|
3
|
+
} from "./server-info-t3j5ftv1.js";
|
|
4
4
|
|
|
5
5
|
// src/handlers/worktree.ts
|
|
6
6
|
import { Git } from "@opencode/core/git";
|
|
@@ -8,7 +8,7 @@ import { Worktree } from "@opencode/core/worktree";
|
|
|
8
8
|
import { ProjectNotFoundError } from "@opencode/protocol/errors";
|
|
9
9
|
import { WorktreeError } from "@opencode/protocol/groups/worktree";
|
|
10
10
|
import { Effect } from "effect";
|
|
11
|
-
import { HttpApiBuilder, HttpApiSchema } from "effect/
|
|
11
|
+
import { HttpApiBuilder, HttpApiSchema } from "effect/http-api";
|
|
12
12
|
var WorktreeHandler2 = HttpApiBuilder.group(Api2, "server.worktree", (handlers) => Effect.gen(function* () {
|
|
13
13
|
const worktrees = yield* Worktree.Service;
|
|
14
14
|
return handlers.handle("worktree.list", (ctx) => worktrees.list(ctx.query).pipe(Effect.catchTag("Project.NotFoundError", missingProject))).handle("worktree.create", (ctx) => worktrees.create(ctx.payload).pipe(badRequest)).handle("worktree.remove", (ctx) => worktrees.remove(ctx.payload).pipe(badRequest, Effect.as(HttpApiSchema.NoContent.make()))).handle("worktree.refresh", (ctx) => worktrees.refresh(ctx.payload).pipe(badRequest, Effect.as(HttpApiSchema.NoContent.make())));
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
|
-
locationErrors2
|
|
3
|
-
|
|
2
|
+
locationErrors2,
|
|
3
|
+
awaitPlugins2
|
|
4
|
+
} from "./server-info-gymtz25n.js";
|
|
4
5
|
import {
|
|
5
6
|
Api2
|
|
6
|
-
} from "./
|
|
7
|
+
} from "./server-info-t3j5ftv1.js";
|
|
7
8
|
|
|
8
9
|
// src/handlers/generate.ts
|
|
9
10
|
import { Generate } from "@opencode/core/generate";
|
|
@@ -13,12 +14,13 @@ import { AbsolutePath } from "@opencode/core/schema";
|
|
|
13
14
|
import { InvalidRequestError, ServiceUnavailableError } from "@opencode/protocol/errors";
|
|
14
15
|
import { Global } from "@opencode/util/global";
|
|
15
16
|
import { Effect } from "effect";
|
|
16
|
-
import { HttpApiBuilder } from "effect/
|
|
17
|
+
import { HttpApiBuilder } from "effect/http-api";
|
|
17
18
|
var GenerateHandler2 = HttpApiBuilder.group(Api2, "server.generate", (handlers) => Effect.gen(function* () {
|
|
18
19
|
const global = yield* Global.Service;
|
|
19
20
|
const locations = yield* LocationServiceMap.Service;
|
|
20
21
|
const services = locations.get(Location.Ref.make({ directory: AbsolutePath.make(global.config) }));
|
|
21
22
|
return handlers.handle("generate.text", Effect.fn("server.generate.text")(function* (request) {
|
|
23
|
+
yield* awaitPlugins2;
|
|
22
24
|
const generate = yield* Generate.Service;
|
|
23
25
|
const text = yield* generate.text(request.payload).pipe(Effect.mapError((error) => error._tag === "Generate.ModelSelectionError" ? new InvalidRequestError({ message: error.message }) : new ServiceUnavailableError({ message: error.message, service: error.service })));
|
|
24
26
|
return { data: { text } };
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import {
|
|
2
2
|
__export
|
|
3
|
-
} from "./
|
|
3
|
+
} from "./server-info-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: () => Service3,
|
|
10
10
|
connectionURLs: () => connectionURLs2,
|
|
11
|
-
layer: () =>
|
|
11
|
+
layer: () => layer4
|
|
12
12
|
});
|
|
13
13
|
import { Context, Layer } from "effect";
|
|
14
14
|
import { networkInterfaces } from "node:os";
|
|
15
15
|
|
|
16
|
-
class
|
|
16
|
+
class Service3 extends Context.Service()("@opencode/server/ServerInfo") {
|
|
17
17
|
}
|
|
18
|
-
function
|
|
19
|
-
return Layer.succeed(
|
|
18
|
+
function layer4(urls, tmp, app = {}) {
|
|
19
|
+
return Layer.succeed(Service3, Service3.of({ urls, app, paths: { tmp } }));
|
|
20
20
|
}
|
|
21
21
|
function connectionURLs2(value, requestedHostname) {
|
|
22
22
|
const url = new URL(value);
|
|
@@ -38,4 +38,4 @@ function connectionURLs2(value, requestedHostname) {
|
|
|
38
38
|
];
|
|
39
39
|
}
|
|
40
40
|
|
|
41
|
-
export {
|
|
41
|
+
export { Service3, layer4, connectionURLs2, exports_server_info };
|
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
import {
|
|
2
2
|
__export
|
|
3
|
-
} from "./
|
|
3
|
+
} from "./server-info-9rqn6x4v.js";
|
|
4
4
|
|
|
5
5
|
// src/pairing.ts
|
|
6
6
|
var exports_pairing = {};
|
|
7
7
|
__export(exports_pairing, {
|
|
8
8
|
ServerPairing: () => exports_pairing,
|
|
9
|
-
Service: () =>
|
|
10
|
-
node: () =>
|
|
9
|
+
Service: () => Service5,
|
|
10
|
+
node: () => node3
|
|
11
11
|
});
|
|
12
12
|
import { Cache, Context, Duration, Effect, Layer } from "effect";
|
|
13
13
|
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 Service5 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(Service5, Effect.gen(function* () {
|
|
21
21
|
const cache = yield* Cache.make({ capacity: 1000, lookup: noLookup, timeToLive: TTL });
|
|
22
|
-
return
|
|
22
|
+
return Service5.of({
|
|
23
23
|
issue: Effect.fn("ServerPairing.issue")(function* () {
|
|
24
24
|
const code = randomBytes(16).toString("base64url");
|
|
25
25
|
yield* Cache.set(cache, code, true);
|
|
@@ -30,6 +30,6 @@ var layer = Layer.effect(Service3, Effect.gen(function* () {
|
|
|
30
30
|
})
|
|
31
31
|
});
|
|
32
32
|
}));
|
|
33
|
-
var
|
|
33
|
+
var node3 = makeGlobalNode({ service: Service5, layer, deps: [] });
|
|
34
34
|
|
|
35
|
-
export {
|
|
35
|
+
export { Service5, node3, exports_pairing };
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
2
|
response2
|
|
3
|
-
} from "./
|
|
3
|
+
} from "./server-info-gymtz25n.js";
|
|
4
4
|
import {
|
|
5
5
|
Api2
|
|
6
|
-
} from "./
|
|
6
|
+
} from "./server-info-t3j5ftv1.js";
|
|
7
7
|
|
|
8
8
|
// src/handlers/provider.ts
|
|
9
9
|
import { Provider } from "@opencode/core/provider";
|
|
10
10
|
import { ProviderNotFoundError } from "@opencode/protocol/errors";
|
|
11
11
|
import { Effect } from "effect";
|
|
12
|
-
import { HttpApiBuilder } from "effect/
|
|
12
|
+
import { HttpApiBuilder } from "effect/http-api";
|
|
13
13
|
var ProviderHandler2 = HttpApiBuilder.group(Api2, "server.provider", (handlers) => Effect.gen(function* () {
|
|
14
14
|
return handlers.handle("provider.list", Effect.fn(function* () {
|
|
15
15
|
const providers = yield* Provider.Service;
|