@opencode/server 2.2.5 → 2.2.7
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 +16 -3
- package/dist/api.js +5 -5
- package/dist/auth.js +1 -1
- package/dist/chunks/{location-059rbh9c.js → process-059rbh9c.js} +1 -1
- package/dist/chunks/{location-e0z6mnzj.js → process-0e4fm4yw.js} +1 -1
- package/dist/chunks/{location-1jtv083t.js → process-1vxxxmgg.js} +2 -2
- package/dist/chunks/{location-xfynz25m.js → process-2835150m.js} +2 -2
- package/dist/chunks/{location-y56ann6c.js → process-370cpmna.js} +2 -2
- package/dist/chunks/{location-bknbvq67.js → process-4z8yg1dv.js} +7 -5
- package/dist/chunks/{location-q7gnt7ra.js → process-50xc6x42.js} +3 -3
- package/dist/chunks/{location-ey9m07rx.js → process-5553qfcy.js} +3 -3
- package/dist/chunks/{location-1kj4am0h.js → process-5kr30cfc.js} +11 -5
- package/dist/chunks/{location-7dtbad8d.js → process-5pdfedjd.js} +7 -7
- package/dist/chunks/{location-f0kpaq89.js → process-74kxthdf.js} +1 -1
- package/dist/chunks/process-78rcgzsr.js +28 -0
- package/dist/chunks/{location-7b9xm1qg.js → process-7b9xm1qg.js} +1 -1
- package/dist/chunks/{location-axx4wwen.js → process-7cd61xtm.js} +2 -2
- package/dist/chunks/{location-vyzvby0b.js → process-7x1re4zg.js} +2 -2
- package/dist/chunks/{location-85kbrn7y.js → process-agenqygg.js} +2 -4
- package/dist/chunks/{location-f1ds1268.js → process-amndpc82.js} +9 -6
- package/dist/chunks/{location-nzrkt0f5.js → process-dfxfd950.js} +6 -6
- package/dist/chunks/{location-n321d8vm.js → process-djr0jy89.js} +8 -6
- package/dist/chunks/{location-e6e4kz0w.js → process-e6e4kz0w.js} +1 -1
- package/dist/chunks/{location-5n22zpzy.js → process-f3xrm535.js} +6 -6
- package/dist/chunks/{location-ja97ph8b.js → process-fszbw5sk.js} +4 -4
- package/dist/chunks/{location-ddnay6e1.js → process-gk0yxcp6.js} +1 -1
- package/dist/chunks/{location-gymtz25n.js → process-gqq6kfhc.js} +3 -3
- package/dist/chunks/{location-j4at0y5c.js → process-j4at0y5c.js} +1 -1
- package/dist/chunks/{location-j6d0mxrp.js → process-jc2vwkyw.js} +2 -2
- package/dist/chunks/{location-va7wgp70.js → process-jqvq1ywe.js} +2 -4
- package/dist/chunks/{location-kqr36gas.js → process-kqr36gas.js} +1 -1
- package/dist/chunks/{location-wy3c18g3.js → process-mx6chrwy.js} +35 -35
- package/dist/chunks/process-myqk22k5.js +39 -0
- package/dist/chunks/{location-xad49dn3.js → process-p3f060n2.js} +3 -7
- package/dist/chunks/{location-h6rt5k9s.js → process-q187pxxd.js} +7 -1
- package/dist/chunks/{location-pbxe02h0.js → process-r2veymj8.js} +8 -6
- package/dist/chunks/{location-v7p1kzzd.js → process-r5696se6.js} +3 -3
- package/dist/chunks/{location-hr24310e.js → process-rcmctvp9.js} +1 -3
- package/dist/chunks/{location-4xzps9pr.js → process-rxyx8sa0.js} +2 -2
- package/dist/chunks/{location-f96zeczf.js → process-skcryrty.js} +2 -2
- package/dist/chunks/{location-0r9ve3h3.js → process-sqxx1p54.js} +2 -2
- package/dist/chunks/process-t32e1bbt.js +32 -0
- package/dist/chunks/{location-62bfwtjc.js → process-vtfzy3at.js} +2 -2
- package/dist/chunks/{location-xwy6frfd.js → process-vvp99hc9.js} +1 -1
- package/dist/chunks/{location-02a60aws.js → process-w5yp0ga8.js} +3 -4
- package/dist/chunks/{location-qfyg9gb7.js → process-wecgp61r.js} +7 -7
- package/dist/chunks/{location-dczgzh3x.js → process-wqv43pj9.js} +2 -2
- package/dist/chunks/{location-9q55v56g.js → process-xbqm7mpj.js} +2 -2
- package/dist/chunks/{location-c48av16v.js → process-xjbee3xk.js} +18 -16
- package/dist/chunks/{location-zzxz7279.js → process-xpg37vzc.js} +2 -2
- package/dist/chunks/{location-x74w7e1f.js → process-yet0vexm.js} +1 -1
- package/dist/chunks/{location-z48nkxh0.js → process-zds85vps.js} +2 -2
- package/dist/chunks/{location-tgb4pddq.js → process-zgvwy66h.js} +9 -6
- package/dist/chunks/{location-g6bmzkma.js → process-zgw0abca.js} +11 -7
- package/dist/chunks/{location-mam5ppd3.js → process-zmgfywqd.js} +1 -1
- package/dist/content-headers.d.ts +13 -0
- package/dist/content-headers.js +12 -0
- package/dist/cors.js +1 -1
- package/dist/event-feed.js +5 -5
- package/dist/fetch.d.ts +1 -0
- package/dist/fetch.js +56 -52
- 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 -6
- package/dist/handlers/generate.js +6 -6
- package/dist/handlers/integration.js +6 -6
- package/dist/handlers/job.d.ts +51 -0
- package/dist/handlers/job.js +7 -0
- package/dist/handlers/location.js +6 -6
- package/dist/handlers/mcp.js +8 -8
- package/dist/handlers/media.js +2 -1
- 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 -11
- 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.d.ts +2 -0
- package/dist/handlers/pty-socket.js +4 -2
- 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 -48
- 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/options.d.ts +7 -0
- package/dist/options.js +1 -0
- package/dist/pairing.js +1 -1
- package/dist/process.d.ts +1 -0
- package/dist/process.js +61 -56
- package/dist/request-site.d.ts +11 -0
- package/dist/request-site.js +11 -0
- package/dist/request-tracing.d.ts +2 -2
- package/dist/request-tracing.js +1 -1
- package/dist/routes.d.ts +3 -2
- package/dist/routes.js +53 -51
- package/dist/server-info.js +5 -5
- package/dist/service-status.js +1 -1
- package/dist/workerd.d.ts +2 -0
- package/dist/workerd.js +59 -54
- package/package.json +13 -13
- /package/dist/chunks/{location-9rqn6x4v.js → process-9rqn6x4v.js} +0 -0
- /package/dist/chunks/{location-bd8755ek.js → process-bd8755ek.js} +0 -0
- /package/dist/chunks/{location-q4bn6dy8.js → process-q4bn6dy8.js} +0 -0
- /package/dist/chunks/{location-smaf4a18.js → process-smaf4a18.js} +0 -0
- /package/dist/chunks/{location-xthc02cw.js → process-xthc02cw.js} +0 -0
- /package/dist/chunks/{location-yc7nft6q.js → process-yc7nft6q.js} +0 -0
package/dist/api.d.ts
CHANGED
|
@@ -93,12 +93,22 @@ export declare const Api: import("@opencode/protocol/api").Api<LocationMiddlewar
|
|
|
93
93
|
create: () => string & import("effect/Brand").Brand<"Workspace.ID">;
|
|
94
94
|
}>, never, never>;
|
|
95
95
|
}>>, never, never>;
|
|
96
|
-
readonly data: import("effect/Schema").Struct<{
|
|
96
|
+
readonly data: import("effect/Schema").Struct<{
|
|
97
|
+
readonly integrationID: import("effect/Schema").brand<import("effect/Schema").String, "Integration.ID">;
|
|
98
|
+
readonly credentialID: import("effect/Schema").brand<import("effect/Schema").String, "Credential.ID"> & {
|
|
99
|
+
create: () => string & import("effect/Brand").Brand<"Credential.ID">;
|
|
100
|
+
};
|
|
101
|
+
}>;
|
|
97
102
|
}> & {
|
|
98
103
|
type: "credential.updated";
|
|
99
104
|
durability: "ephemeral";
|
|
100
105
|
durable: undefined;
|
|
101
|
-
data: import("effect/Schema").Struct<{
|
|
106
|
+
data: import("effect/Schema").Struct<{
|
|
107
|
+
readonly integrationID: import("effect/Schema").brand<import("effect/Schema").String, "Integration.ID">;
|
|
108
|
+
readonly credentialID: import("effect/Schema").brand<import("effect/Schema").String, "Credential.ID"> & {
|
|
109
|
+
create: () => string & import("effect/Brand").Brand<"Credential.ID">;
|
|
110
|
+
};
|
|
111
|
+
}>;
|
|
102
112
|
}, import("effect/Schema").Struct<{
|
|
103
113
|
readonly id: import("effect/Schema").brand<import("effect/Schema").String, "Event.ID"> & {
|
|
104
114
|
create: () => string & import("effect/Brand").Brand<"Event.ID">;
|
|
@@ -7769,7 +7779,10 @@ export declare const Api: import("@opencode/protocol/api").Api<LocationMiddlewar
|
|
|
7769
7779
|
readonly directory: string & import("effect/Brand").Brand<"AbsolutePath">;
|
|
7770
7780
|
readonly workspaceID?: (string & import("effect/Brand").Brand<"Workspace.ID">) | undefined;
|
|
7771
7781
|
} | undefined;
|
|
7772
|
-
readonly data: {
|
|
7782
|
+
readonly data: {
|
|
7783
|
+
readonly integrationID: string & import("effect/Brand").Brand<"Integration.ID">;
|
|
7784
|
+
readonly credentialID: string & import("effect/Brand").Brand<"Credential.ID">;
|
|
7785
|
+
};
|
|
7773
7786
|
} | {
|
|
7774
7787
|
readonly id: string & import("effect/Brand").Brand<"Event.ID">;
|
|
7775
7788
|
readonly created: number;
|
package/dist/api.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Api2
|
|
3
|
-
} from "./chunks/
|
|
4
|
-
import"./chunks/
|
|
5
|
-
import"./chunks/
|
|
6
|
-
import"./chunks/
|
|
7
|
-
import"./chunks/
|
|
3
|
+
} from "./chunks/process-r5696se6.js";
|
|
4
|
+
import"./chunks/process-gk0yxcp6.js";
|
|
5
|
+
import"./chunks/process-yet0vexm.js";
|
|
6
|
+
import"./chunks/process-gqq6kfhc.js";
|
|
7
|
+
import"./chunks/process-smaf4a18.js";
|
|
8
8
|
export {
|
|
9
9
|
Api2 as Api
|
|
10
10
|
};
|
package/dist/auth.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Api2
|
|
3
|
-
} from "./
|
|
3
|
+
} from "./process-r5696se6.js";
|
|
4
4
|
import {
|
|
5
5
|
requireConnectable2
|
|
6
|
-
} from "./
|
|
6
|
+
} from "./process-amndpc82.js";
|
|
7
7
|
|
|
8
8
|
// src/handlers/credential.ts
|
|
9
9
|
import { Credential } from "@opencode/core/credential";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
locationErrors2,
|
|
3
3
|
awaitPlugins2
|
|
4
|
-
} from "./
|
|
4
|
+
} from "./process-gqq6kfhc.js";
|
|
5
5
|
import {
|
|
6
6
|
Api2
|
|
7
|
-
} from "./
|
|
7
|
+
} from "./process-r5696se6.js";
|
|
8
8
|
|
|
9
9
|
// src/handlers/voice.ts
|
|
10
10
|
import { Location } from "@opencode/core/location";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
awaitPlugins2,
|
|
3
3
|
response2
|
|
4
|
-
} from "./
|
|
4
|
+
} from "./process-gqq6kfhc.js";
|
|
5
5
|
import {
|
|
6
6
|
Api2
|
|
7
|
-
} from "./
|
|
7
|
+
} from "./process-r5696se6.js";
|
|
8
8
|
|
|
9
9
|
// src/handlers/model.ts
|
|
10
10
|
import { Model } from "@opencode/core/model";
|
|
@@ -2,17 +2,18 @@ import {
|
|
|
2
2
|
locationErrors2,
|
|
3
3
|
response2,
|
|
4
4
|
requestRef2
|
|
5
|
-
} from "./
|
|
5
|
+
} from "./process-gqq6kfhc.js";
|
|
6
6
|
import {
|
|
7
7
|
Api2
|
|
8
|
-
} from "./
|
|
8
|
+
} from "./process-r5696se6.js";
|
|
9
9
|
import {
|
|
10
10
|
CorsConfig2,
|
|
11
11
|
isAllowedRequestOrigin2
|
|
12
|
-
} from "./
|
|
12
|
+
} from "./process-q4bn6dy8.js";
|
|
13
13
|
import {
|
|
14
|
-
runPtySocket2
|
|
15
|
-
|
|
14
|
+
runPtySocket2,
|
|
15
|
+
holdLocation2
|
|
16
|
+
} from "./process-q187pxxd.js";
|
|
16
17
|
|
|
17
18
|
// src/handlers/mcp.ts
|
|
18
19
|
import { Location } from "@opencode/core/location";
|
|
@@ -78,6 +79,7 @@ var McpHandler2 = HttpApiBuilder.group(Api2, "server.mcp", (handlers) => Effect.
|
|
|
78
79
|
const { McpSocketClient } = yield* Effect.promise(() => import("@opencode/core/mcp/socket-client"));
|
|
79
80
|
const socket = yield* Effect.orDie(ctx.request.upgrade);
|
|
80
81
|
const outbox = yield* Queue.unbounded();
|
|
82
|
+
yield* holdLocation2(outbox);
|
|
81
83
|
const state = { attached: false, disconnected: false };
|
|
82
84
|
const transport = McpSocketClient.make({
|
|
83
85
|
send: (text) => Queue.offerUnsafe(outbox, text),
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import {
|
|
2
2
|
missingSession2
|
|
3
|
-
} from "./
|
|
3
|
+
} from "./process-smaf4a18.js";
|
|
4
4
|
import {
|
|
5
5
|
locationErrors2,
|
|
6
6
|
response2,
|
|
7
7
|
sessionInfo2
|
|
8
|
-
} from "./
|
|
8
|
+
} from "./process-gqq6kfhc.js";
|
|
9
9
|
import {
|
|
10
10
|
Api2
|
|
11
|
-
} from "./
|
|
11
|
+
} from "./process-r5696se6.js";
|
|
12
12
|
|
|
13
13
|
// src/handlers/permission.ts
|
|
14
14
|
import { Instance } from "@opencode/core/instance/service";
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
missingSession2,
|
|
3
3
|
failedMessageDecode2
|
|
4
|
-
} from "./
|
|
4
|
+
} from "./process-smaf4a18.js";
|
|
5
5
|
import {
|
|
6
6
|
Api2
|
|
7
|
-
} from "./
|
|
7
|
+
} from "./process-r5696se6.js";
|
|
8
8
|
import {
|
|
9
9
|
wantsMediaRefs2
|
|
10
|
-
} from "./
|
|
10
|
+
} from "./process-xthc02cw.js";
|
|
11
11
|
|
|
12
12
|
// src/handlers/message.ts
|
|
13
13
|
import { SessionMessage } from "@opencode/core/session/message";
|
|
@@ -1,12 +1,18 @@
|
|
|
1
1
|
import {
|
|
2
2
|
isAllowedCorsOrigin2
|
|
3
|
-
} from "./
|
|
3
|
+
} from "./process-q4bn6dy8.js";
|
|
4
|
+
import {
|
|
5
|
+
middleware2
|
|
6
|
+
} from "./process-myqk22k5.js";
|
|
7
|
+
import {
|
|
8
|
+
withoutParentSpan2
|
|
9
|
+
} from "./process-yc7nft6q.js";
|
|
4
10
|
import {
|
|
5
11
|
createRoutes2
|
|
6
|
-
} from "./
|
|
12
|
+
} from "./process-xjbee3xk.js";
|
|
7
13
|
import {
|
|
8
14
|
__export
|
|
9
|
-
} from "./
|
|
15
|
+
} from "./process-9rqn6x4v.js";
|
|
10
16
|
|
|
11
17
|
// src/fetch.ts
|
|
12
18
|
var exports_fetch = {};
|
|
@@ -18,9 +24,9 @@ import { Context, Effect, Layer } from "effect";
|
|
|
18
24
|
import { HttpEffect, HttpMiddleware, HttpRouter, HttpServer } from "effect/http";
|
|
19
25
|
import { SessionRestart } from "@opencode/core/session/execution/restart";
|
|
20
26
|
var make2 = Effect.fn("ServerFetch.make")(function* (options = {}, boot = {}) {
|
|
21
|
-
const context = yield* Layer.build(createRoutes2(options, () => [], boot.overrides ?? []).pipe(Layer.provide(HttpServer.layerServices)));
|
|
27
|
+
const context = yield* Layer.build(createRoutes2(options, () => [], boot.overrides ?? []).pipe(Layer.provide(HttpServer.layerServices))).pipe(withoutParentSpan2);
|
|
22
28
|
yield* Effect.forkDetach(Context.get(context, SessionRestart.Service).resumeSuspendedSessions);
|
|
23
|
-
return Context.get(context, HttpRouter.HttpRouter).asHttpEffect().pipe(HttpMiddleware.cors({ allowedOrigins: (origin) => isAllowedCorsOrigin2(origin, options), maxAge: 86400 }), HttpEffect.toWebHandlerWith(context));
|
|
29
|
+
return Context.get(context, HttpRouter.HttpRouter).asHttpEffect().pipe(middleware2(options), HttpMiddleware.cors({ allowedOrigins: (origin) => isAllowedCorsOrigin2(origin, options), maxAge: 86400 }), HttpEffect.toWebHandlerWith(context));
|
|
24
30
|
});
|
|
25
31
|
|
|
26
32
|
export { make2, exports_fetch };
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import {
|
|
2
2
|
__export
|
|
3
|
-
} from "./
|
|
3
|
+
} from "./process-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: () => layer2
|
|
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 layer2(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, layer2, connectionURLs2, exports_server_info };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import {
|
|
2
|
+
missingSession2
|
|
3
|
+
} from "./process-smaf4a18.js";
|
|
4
|
+
|
|
5
|
+
// src/handlers/job.ts
|
|
6
|
+
import { Job } from "@opencode/core/job";
|
|
7
|
+
import { Session } from "@opencode/core/session";
|
|
8
|
+
import { SessionBackground } from "@opencode/core/session/background";
|
|
9
|
+
import { Effect, Option } from "effect";
|
|
10
|
+
var makeJob2 = Effect.gen(function* () {
|
|
11
|
+
const jobs = yield* Job.Service;
|
|
12
|
+
const sessions = yield* Session.Service;
|
|
13
|
+
const lookup = {
|
|
14
|
+
get: (sessionID) => sessions.get(sessionID).pipe(Effect.option, Effect.map(Option.getOrUndefined))
|
|
15
|
+
};
|
|
16
|
+
return {
|
|
17
|
+
list: Effect.fn("JobHandler.list")(function* (query) {
|
|
18
|
+
if (query.sessionID !== undefined) {
|
|
19
|
+
yield* sessions.get(query.sessionID).pipe(Effect.catchTag("Session.NotFoundError", missingSession2));
|
|
20
|
+
}
|
|
21
|
+
return {
|
|
22
|
+
data: yield* SessionBackground.list(jobs, lookup, query)
|
|
23
|
+
};
|
|
24
|
+
})
|
|
25
|
+
};
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
export { makeJob2 };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
awaitPlugins2,
|
|
3
3
|
response2
|
|
4
|
-
} from "./
|
|
4
|
+
} from "./process-gqq6kfhc.js";
|
|
5
5
|
import {
|
|
6
6
|
Api2
|
|
7
|
-
} from "./
|
|
7
|
+
} from "./process-r5696se6.js";
|
|
8
8
|
|
|
9
9
|
// src/handlers/websearch.ts
|
|
10
10
|
import { WebSearch } from "@opencode/core/websearch";
|
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
2
|
response2
|
|
3
|
-
} from "./
|
|
3
|
+
} from "./process-gqq6kfhc.js";
|
|
4
4
|
import {
|
|
5
5
|
Api2
|
|
6
|
-
} from "./
|
|
6
|
+
} from "./process-r5696se6.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,13 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
response2
|
|
3
|
-
} from "./
|
|
3
|
+
} from "./process-gqq6kfhc.js";
|
|
4
4
|
import {
|
|
5
5
|
Api2
|
|
6
|
-
} from "./
|
|
6
|
+
} from "./process-r5696se6.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"))));
|
|
@@ -134,9 +132,14 @@ var IntegrationHandler2 = HttpApiBuilder.group(Api2, "server.integration", (hand
|
|
|
134
132
|
attemptID: error.attemptID,
|
|
135
133
|
message: `OAuth attempt not found: ${error.attemptID}`
|
|
136
134
|
});
|
|
135
|
+
if (error._tag === "Integration.CodeRequired")
|
|
136
|
+
return new InvalidRequestError({
|
|
137
|
+
message: "Authorization code is required",
|
|
138
|
+
kind: "integration_code_required"
|
|
139
|
+
});
|
|
137
140
|
return new InvalidRequestError({
|
|
138
|
-
message: error.
|
|
139
|
-
kind:
|
|
141
|
+
message: error.cause instanceof Error && error.cause.message.trim() ? error.cause.message : "Authentication failed",
|
|
142
|
+
kind: "integration_authorization"
|
|
140
143
|
});
|
|
141
144
|
}));
|
|
142
145
|
return HttpApiSchema.NoContent.make();
|
|
@@ -3,16 +3,16 @@ import {
|
|
|
3
3
|
missingMessage2,
|
|
4
4
|
failedMessageDecode2,
|
|
5
5
|
failedSnapshot2
|
|
6
|
-
} from "./
|
|
6
|
+
} from "./process-smaf4a18.js";
|
|
7
7
|
import {
|
|
8
8
|
locationErrors2
|
|
9
|
-
} from "./
|
|
9
|
+
} from "./process-gqq6kfhc.js";
|
|
10
10
|
import {
|
|
11
11
|
Api2
|
|
12
|
-
} from "./
|
|
12
|
+
} from "./process-r5696se6.js";
|
|
13
13
|
import {
|
|
14
14
|
wantsMediaRefs2
|
|
15
|
-
} from "./
|
|
15
|
+
} from "./process-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,3 +1,8 @@
|
|
|
1
|
+
import {
|
|
2
|
+
CONTENT_SECURITY_POLICY2,
|
|
3
|
+
disposition2
|
|
4
|
+
} from "./process-t32e1bbt.js";
|
|
5
|
+
|
|
1
6
|
// src/handlers/media.ts
|
|
2
7
|
import { Database } from "@opencode/core/database/database";
|
|
3
8
|
import { SessionBlob } from "@opencode/core/session/blob";
|
|
@@ -6,10 +11,6 @@ import { Effect } from "effect";
|
|
|
6
11
|
import { HttpServerResponse } from "effect/http";
|
|
7
12
|
var INLINE_IMAGE_MIMES = new Set(["image/png", "image/jpeg", "image/gif", "image/webp"]);
|
|
8
13
|
var CACHE_CONTROL = "private, max-age=31536000, immutable";
|
|
9
|
-
var SECURITY_HEADERS = {
|
|
10
|
-
"x-content-type-options": "nosniff",
|
|
11
|
-
"content-security-policy": "default-src 'none'; sandbox"
|
|
12
|
-
};
|
|
13
14
|
var makeMediaGet2 = Effect.gen(function* () {
|
|
14
15
|
const { db } = yield* Database.Service;
|
|
15
16
|
return (hash, request) => Effect.gen(function* () {
|
|
@@ -22,8 +23,9 @@ var makeMediaGet2 = Effect.gen(function* () {
|
|
|
22
23
|
const headers = {
|
|
23
24
|
"cache-control": CACHE_CONTROL,
|
|
24
25
|
etag,
|
|
25
|
-
|
|
26
|
-
|
|
26
|
+
"content-disposition": disposition2(""),
|
|
27
|
+
"content-security-policy": CONTENT_SECURITY_POLICY2,
|
|
28
|
+
"x-content-type-options": "nosniff"
|
|
27
29
|
};
|
|
28
30
|
if (matchesIfNoneMatch(request.headers["if-none-match"], etag))
|
|
29
31
|
return HttpServerResponse.empty({ status: 304, headers });
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Api2
|
|
3
|
-
} from "./
|
|
3
|
+
} from "./process-r5696se6.js";
|
|
4
4
|
import {
|
|
5
5
|
SESSION_TTL_SECONDS2,
|
|
6
6
|
Config2,
|
|
7
7
|
issueSession2,
|
|
8
8
|
sessionCookieName2
|
|
9
|
-
} from "./
|
|
9
|
+
} from "./process-j4at0y5c.js";
|
|
10
10
|
import {
|
|
11
|
-
|
|
12
|
-
} from "./
|
|
11
|
+
Service3
|
|
12
|
+
} from "./process-5pdfedjd.js";
|
|
13
13
|
import {
|
|
14
14
|
Service2
|
|
15
|
-
} from "./
|
|
15
|
+
} from "./process-kqr36gas.js";
|
|
16
16
|
|
|
17
17
|
// src/handlers/server.ts
|
|
18
18
|
import { hostname } from "node:os";
|
|
@@ -25,7 +25,7 @@ var ServerHandler2 = HttpApiBuilder.group(Api2, "server.server", (handlers) => E
|
|
|
25
25
|
const pairing = yield* Service2;
|
|
26
26
|
const auth = yield* Config2;
|
|
27
27
|
return handlers.handle("server.info", () => Effect.gen(function* () {
|
|
28
|
-
const info = yield*
|
|
28
|
+
const info = yield* Service3;
|
|
29
29
|
return {
|
|
30
30
|
version: info.app.version ?? "unknown",
|
|
31
31
|
pid: process.pid ?? 0,
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Api2
|
|
3
|
-
} from "./
|
|
3
|
+
} from "./process-r5696se6.js";
|
|
4
4
|
import {
|
|
5
|
-
|
|
5
|
+
Service4,
|
|
6
6
|
frame2
|
|
7
|
-
} from "./
|
|
7
|
+
} from "./process-wecgp61r.js";
|
|
8
8
|
|
|
9
9
|
// src/handlers/event.ts
|
|
10
10
|
import { Event } from "@opencode/schema/event";
|
|
@@ -12,7 +12,7 @@ import { Effect, Stream } from "effect";
|
|
|
12
12
|
import { HttpServerResponse } from "effect/http";
|
|
13
13
|
import { HttpApiBuilder } from "effect/http-api";
|
|
14
14
|
var EventHandler2 = HttpApiBuilder.group(Api2, "server.event", (handlers) => Effect.gen(function* () {
|
|
15
|
-
const feed = yield*
|
|
15
|
+
const feed = yield* Service4;
|
|
16
16
|
return handlers.handleRaw("event.subscribe", (ctx) => Effect.gen(function* () {
|
|
17
17
|
const connected = {
|
|
18
18
|
id: Event.ID.create(),
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
missingSession2
|
|
3
|
-
} from "./
|
|
3
|
+
} from "./process-smaf4a18.js";
|
|
4
4
|
|
|
5
5
|
// src/location.ts
|
|
6
6
|
import { FileSystem } from "@opencode/core/filesystem";
|
|
@@ -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 "./
|
|
3
|
+
} from "./process-gqq6kfhc.js";
|
|
4
4
|
import {
|
|
5
5
|
Api2
|
|
6
|
-
} from "./
|
|
6
|
+
} from "./process-r5696se6.js";
|
|
7
7
|
|
|
8
8
|
// src/handlers/debug.ts
|
|
9
9
|
import { LocationServiceMap } from "@opencode/core/location-service-map";
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
|
-
awaitPlugins2,
|
|
3
2
|
response2
|
|
4
|
-
} from "./
|
|
3
|
+
} from "./process-gqq6kfhc.js";
|
|
5
4
|
import {
|
|
6
5
|
Api2
|
|
7
|
-
} from "./
|
|
6
|
+
} from "./process-r5696se6.js";
|
|
8
7
|
|
|
9
8
|
// src/handlers/usage.ts
|
|
10
9
|
import { UsageLimits } from "@opencode/core/usage-limits";
|
|
@@ -13,7 +12,6 @@ import { Effect } from "effect";
|
|
|
13
12
|
import { HttpApiBuilder } from "effect/http-api";
|
|
14
13
|
var UsageHandler2 = HttpApiBuilder.group(Api2, "server.usage", (handlers) => Effect.gen(function* () {
|
|
15
14
|
return handlers.handle("usage.limits", Effect.fn("server.usage.limits")(function* () {
|
|
16
|
-
yield* awaitPlugins2;
|
|
17
15
|
const limits = yield* UsageLimits.Service;
|
|
18
16
|
return yield* response2(limits.get().pipe(Effect.map((info) => info ?? null), Effect.mapError((error) => new ServiceUnavailableError({ message: error.message, service: "opencode" }))));
|
|
19
17
|
}));
|