@opencode/server 0.0.0-dev-44 → 0.0.0-dev-55
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 +5 -5
- package/dist/auth.d.ts +1 -5
- package/dist/auth.js +1 -3
- package/dist/chunks/{options-dk68ymtv.js → event-feed-05c5061t.js} +1 -1
- package/dist/chunks/{options-9c4eyh8m.js → event-feed-0e81et3m.js} +3 -3
- package/dist/chunks/{options-r6vmgwff.js → event-feed-0ey2b45p.js} +2 -2
- package/dist/chunks/{options-2xcc0x05.js → event-feed-0n4tjm17.js} +1 -1
- package/dist/chunks/{options-zjy4sw3d.js → event-feed-28ztppy1.js} +2 -2
- package/dist/chunks/{options-e6e4kz0w.js → event-feed-39nnfjx1.js} +4 -4
- package/dist/chunks/{options-xga54a1t.js → event-feed-4953j2kd.js} +4 -4
- package/dist/chunks/{options-0a5jm2na.js → event-feed-4p2y0qs3.js} +2 -2
- package/dist/chunks/{options-gqq6kfhc.js → event-feed-50bbk3b2.js} +3 -3
- package/dist/chunks/{options-5pdfedjd.js → event-feed-5pdfedjd.js} +1 -1
- package/dist/chunks/{options-9tsb9bht.js → event-feed-7b9xm1qg.js} +1 -1
- package/dist/chunks/{options-j9gxd9me.js → event-feed-89egwzf3.js} +2 -2
- package/dist/chunks/{options-vj2c9626.js → event-feed-8wqj6mpn.js} +4 -4
- package/dist/chunks/{options-wcfd0w14.js → event-feed-9e5240rj.js} +4 -4
- package/dist/chunks/{options-hax1v4bv.js → event-feed-9grnt8dc.js} +2 -2
- package/dist/chunks/{options-yet0vexm.js → event-feed-b3bmdkga.js} +1 -1
- package/dist/chunks/{options-z59gyc0x.js → event-feed-b4mqtccx.js} +2 -2
- package/dist/chunks/{options-be53s2qz.js → event-feed-djj5asqw.js} +1 -1
- package/dist/chunks/{options-e46y0tfd.js → event-feed-dx89xydc.js} +2 -2
- package/dist/chunks/{options-wxj3d9av.js → event-feed-et00mhwf.js} +2 -2
- package/dist/chunks/{options-22wspztn.js → event-feed-f8r9p2vr.js} +2 -2
- package/dist/chunks/{options-e9906t2e.js → event-feed-fehxjhae.js} +2 -2
- package/dist/chunks/{options-khcas2q2.js → event-feed-gkb2rnpp.js} +6 -6
- package/dist/chunks/{options-x8dgc261.js → event-feed-h1thjy6x.js} +2 -2
- package/dist/chunks/{options-gk0yxcp6.js → event-feed-htyf2qs7.js} +1 -1
- package/dist/chunks/{options-b2k9041j.js → event-feed-hx8bsq9d.js} +1 -1
- package/dist/chunks/{options-peg0afvz.js → event-feed-j4at0y5c.js} +5 -9
- package/dist/chunks/{options-awjv4jq4.js → event-feed-kafd488q.js} +2 -2
- package/dist/chunks/{options-ppma8fcc.js → event-feed-kg0ybx4v.js} +3 -3
- package/dist/chunks/{options-kqr36gas.js → event-feed-kqr36gas.js} +1 -1
- package/dist/chunks/{options-zgt2tacv.js → event-feed-m119esdv.js} +3 -3
- package/dist/chunks/{options-nha9c8fp.js → event-feed-mzqcpmk1.js} +4 -4
- package/dist/chunks/{options-xe9t9xr4.js → event-feed-nz17qv97.js} +2 -2
- package/dist/chunks/{options-6vs5sqy6.js → event-feed-q44yktpv.js} +2 -2
- package/dist/chunks/{options-s9k7mqbm.js → event-feed-qa4stgpe.js} +14 -14
- package/dist/chunks/{options-h9rcwvg0.js → event-feed-r6xkfcdx.js} +1 -1
- package/dist/chunks/{options-17ecnfcg.js → event-feed-rfdwk27n.js} +2 -2
- package/dist/chunks/{options-hnheq3hv.js → event-feed-s62wjkvx.js} +2 -2
- package/dist/chunks/{options-wecgp61r.js → event-feed-s802fzg1.js} +4 -4
- package/dist/chunks/{options-yr4wsvrw.js → event-feed-s9tkswmw.js} +2 -2
- package/dist/chunks/{options-fqnn17ss.js → event-feed-te9nzjz5.js} +35 -35
- package/dist/chunks/{options-m5rae7m4.js → event-feed-v8aqacn3.js} +2 -2
- package/dist/chunks/{options-1je14sn4.js → event-feed-x4b2rtcb.js} +1 -1
- package/dist/chunks/{options-h072q2hm.js → event-feed-zbe9jfhy.js} +1 -1
- package/dist/chunks/{options-kffvskmv.js → event-feed-zvbhqxt5.js} +4 -4
- package/dist/cors.js +1 -1
- package/dist/event-feed.js +3 -3
- package/dist/fetch.d.ts +0 -1
- package/dist/fetch.js +52 -52
- package/dist/handlers/agent.js +6 -6
- package/dist/handlers/command.js +6 -6
- package/dist/handlers/config.js +6 -6
- package/dist/handlers/credential.js +6 -6
- 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 +6 -6
- package/dist/handlers/generate.js +6 -6
- package/dist/handlers/integration.js +6 -6
- package/dist/handlers/location.js +6 -6
- package/dist/handlers/mcp.js +8 -8
- package/dist/handlers/media.js +1 -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.js +9 -9
- package/dist/handlers/plugin.js +6 -6
- package/dist/handlers/project.js +6 -6
- package/dist/handlers/provider.js +6 -6
- package/dist/handlers/pty-socket.js +1 -1
- package/dist/handlers/pty.js +8 -8
- package/dist/handlers/reference.js +6 -6
- package/dist/handlers/rpc.js +6 -6
- package/dist/handlers/server.js +9 -9
- package/dist/handlers/session-error.js +1 -1
- package/dist/handlers/session.js +7 -7
- package/dist/handlers/shell.js +6 -6
- package/dist/handlers/skill.js +6 -6
- package/dist/handlers/usage.js +6 -6
- package/dist/handlers/vcs.js +6 -6
- package/dist/handlers/voice.js +6 -6
- package/dist/handlers/websearch.js +6 -6
- package/dist/handlers/worktree.js +6 -6
- package/dist/handlers.js +46 -46
- 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 +0 -1
- package/dist/options.js +0 -1
- package/dist/pairing.js +1 -1
- package/dist/process.d.ts +0 -1
- package/dist/process.js +57 -61
- package/dist/request-tracing.js +1 -1
- package/dist/routes.js +49 -49
- package/dist/server-info.js +1 -1
- package/dist/service-status.js +3 -3
- package/dist/workerd.js +53 -53
- package/package.json +8 -8
- /package/dist/chunks/{options-9rqn6x4v.js → event-feed-9rqn6x4v.js} +0 -0
- /package/dist/chunks/{options-erzfdgke.js → event-feed-erzfdgke.js} +0 -0
- /package/dist/chunks/{options-h6rt5k9s.js → event-feed-h6rt5k9s.js} +0 -0
- /package/dist/chunks/{options-n321d8vm.js → event-feed-n321d8vm.js} +0 -0
- /package/dist/chunks/{options-q4bn6dy8.js → event-feed-q4bn6dy8.js} +0 -0
- /package/dist/chunks/{options-smaf4a18.js → event-feed-smaf4a18.js} +0 -0
- /package/dist/chunks/{options-xthc02cw.js → event-feed-xthc02cw.js} +0 -0
- /package/dist/chunks/{options-yc7nft6q.js → event-feed-yc7nft6q.js} +0 -0
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/event-feed-0e81et3m.js";
|
|
4
|
+
import"./chunks/event-feed-b3bmdkga.js";
|
|
5
|
+
import"./chunks/event-feed-htyf2qs7.js";
|
|
6
|
+
import"./chunks/event-feed-50bbk3b2.js";
|
|
7
|
+
import"./chunks/event-feed-smaf4a18.js";
|
|
8
8
|
export {
|
|
9
9
|
Api2 as Api
|
|
10
10
|
};
|
package/dist/auth.d.ts
CHANGED
|
@@ -8,14 +8,10 @@ export type Info = {
|
|
|
8
8
|
readonly password: Option.Option<string>;
|
|
9
9
|
readonly username: string;
|
|
10
10
|
};
|
|
11
|
-
export declare const DEFAULT_USERNAME = "opencode";
|
|
12
11
|
export declare const SESSION_TTL_SECONDS: number;
|
|
13
12
|
declare const Config_base: Context.ServiceClass<Config, "@opencode/ServerAuthConfig", Info>;
|
|
14
13
|
export declare class Config extends Config_base {
|
|
15
|
-
static configLayer(input:
|
|
16
|
-
readonly password: Option.Option<string>;
|
|
17
|
-
readonly username?: string;
|
|
18
|
-
}): Layer.Layer<Config, never, never>;
|
|
14
|
+
static configLayer(input: Pick<Info, "password">): Layer.Layer<Config, never, never>;
|
|
19
15
|
static get layer(): Layer.Layer<Config, never, never>;
|
|
20
16
|
}
|
|
21
17
|
export declare function required(config: Info): boolean;
|
package/dist/auth.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import {
|
|
2
|
-
DEFAULT_USERNAME2,
|
|
3
2
|
SESSION_TTL_SECONDS2,
|
|
4
3
|
Config2,
|
|
5
4
|
required2,
|
|
@@ -8,10 +7,9 @@ import {
|
|
|
8
7
|
verifySession2,
|
|
9
8
|
sessionCookieName2,
|
|
10
9
|
exports_auth
|
|
11
|
-
} from "./chunks/
|
|
10
|
+
} from "./chunks/event-feed-j4at0y5c.js";
|
|
12
11
|
export {
|
|
13
12
|
Config2 as Config,
|
|
14
|
-
DEFAULT_USERNAME2 as DEFAULT_USERNAME,
|
|
15
13
|
SESSION_TTL_SECONDS2 as SESSION_TTL_SECONDS,
|
|
16
14
|
exports_auth as ServerAuth,
|
|
17
15
|
authorized2 as authorized,
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
LocationMiddleware2
|
|
3
|
-
} from "./
|
|
3
|
+
} from "./event-feed-50bbk3b2.js";
|
|
4
4
|
import {
|
|
5
5
|
FormLocationMiddleware2
|
|
6
|
-
} from "./
|
|
6
|
+
} from "./event-feed-htyf2qs7.js";
|
|
7
7
|
import {
|
|
8
8
|
SessionLocationMiddleware2
|
|
9
|
-
} from "./
|
|
9
|
+
} from "./event-feed-b3bmdkga.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 "./
|
|
3
|
+
} from "./event-feed-50bbk3b2.js";
|
|
4
4
|
import {
|
|
5
5
|
Api2
|
|
6
|
-
} from "./
|
|
6
|
+
} from "./event-feed-0e81et3m.js";
|
|
7
7
|
|
|
8
8
|
// src/handlers/fs.ts
|
|
9
9
|
import { FileSystem } from "@opencode/core/filesystem";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
response2
|
|
3
|
-
} from "./
|
|
3
|
+
} from "./event-feed-50bbk3b2.js";
|
|
4
4
|
import {
|
|
5
5
|
Api2
|
|
6
|
-
} from "./
|
|
6
|
+
} from "./event-feed-0e81et3m.js";
|
|
7
7
|
|
|
8
8
|
// src/handlers/integration.ts
|
|
9
9
|
import { Integration } from "@opencode/core/integration";
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
2
|
__export
|
|
3
|
-
} from "./
|
|
3
|
+
} from "./event-feed-9rqn6x4v.js";
|
|
4
4
|
|
|
5
5
|
// src/service-status.ts
|
|
6
6
|
var exports_service_status = {};
|
|
7
7
|
__export(exports_service_status, {
|
|
8
8
|
Status: () => exports_service_status,
|
|
9
|
-
make: () =>
|
|
9
|
+
make: () => make2
|
|
10
10
|
});
|
|
11
11
|
import { Effect, Ref } from "effect";
|
|
12
|
-
var
|
|
12
|
+
var make2 = Effect.fnUntraced(function* (options = {}) {
|
|
13
13
|
const current = yield* Ref.make(options.initial ?? { type: "starting" });
|
|
14
14
|
const beginStopping = Ref.update(current, (status) => status.type === "stopping" ? status : { type: "stopping" });
|
|
15
15
|
return {
|
|
@@ -20,4 +20,4 @@ var make3 = Effect.fnUntraced(function* (options = {}) {
|
|
|
20
20
|
};
|
|
21
21
|
});
|
|
22
22
|
|
|
23
|
-
export {
|
|
23
|
+
export { make2, exports_service_status };
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Api2
|
|
3
|
-
} from "./
|
|
3
|
+
} from "./event-feed-0e81et3m.js";
|
|
4
4
|
import {
|
|
5
5
|
CorsConfig2,
|
|
6
6
|
isAllowedRequestOrigin2
|
|
7
|
-
} from "./
|
|
7
|
+
} from "./event-feed-q4bn6dy8.js";
|
|
8
8
|
import {
|
|
9
9
|
makeMediaGet2
|
|
10
|
-
} from "./
|
|
10
|
+
} from "./event-feed-n321d8vm.js";
|
|
11
11
|
import {
|
|
12
12
|
runPtySocket2
|
|
13
|
-
} from "./
|
|
13
|
+
} from "./event-feed-h6rt5k9s.js";
|
|
14
14
|
|
|
15
15
|
// src/handlers/persistent-pty.ts
|
|
16
16
|
import { PersistentPty } from "@opencode/core/persistent-pty";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
awaitPlugins2,
|
|
3
3
|
response2
|
|
4
|
-
} from "./
|
|
4
|
+
} from "./event-feed-50bbk3b2.js";
|
|
5
5
|
import {
|
|
6
6
|
Api2
|
|
7
|
-
} from "./
|
|
7
|
+
} from "./event-feed-0e81et3m.js";
|
|
8
8
|
|
|
9
9
|
// src/handlers/model.ts
|
|
10
10
|
import { Model } from "@opencode/core/model";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
missingSession2
|
|
3
|
-
} from "./
|
|
3
|
+
} from "./event-feed-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 layer4 = 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 layer3 = 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, layer4 };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
awaitPlugins2,
|
|
3
3
|
response2
|
|
4
|
-
} from "./
|
|
4
|
+
} from "./event-feed-50bbk3b2.js";
|
|
5
5
|
import {
|
|
6
6
|
Api2
|
|
7
|
-
} from "./
|
|
7
|
+
} from "./event-feed-0e81et3m.js";
|
|
8
8
|
|
|
9
9
|
// src/handlers/usage.ts
|
|
10
10
|
import { UsageLimits } from "@opencode/core/usage-limits";
|
|
@@ -2,17 +2,17 @@ import {
|
|
|
2
2
|
locationErrors2,
|
|
3
3
|
response2,
|
|
4
4
|
requestRef2
|
|
5
|
-
} from "./
|
|
5
|
+
} from "./event-feed-50bbk3b2.js";
|
|
6
6
|
import {
|
|
7
7
|
Api2
|
|
8
|
-
} from "./
|
|
8
|
+
} from "./event-feed-0e81et3m.js";
|
|
9
9
|
import {
|
|
10
10
|
CorsConfig2,
|
|
11
11
|
isAllowedRequestOrigin2
|
|
12
|
-
} from "./
|
|
12
|
+
} from "./event-feed-q4bn6dy8.js";
|
|
13
13
|
import {
|
|
14
14
|
runPtySocket2
|
|
15
|
-
} from "./
|
|
15
|
+
} from "./event-feed-h6rt5k9s.js";
|
|
16
16
|
|
|
17
17
|
// src/handlers/pty.ts
|
|
18
18
|
import { Pty } from "@opencode/core/pty";
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Api2
|
|
3
|
-
} from "./
|
|
3
|
+
} from "./event-feed-0e81et3m.js";
|
|
4
4
|
import {
|
|
5
5
|
SESSION_TTL_SECONDS2,
|
|
6
6
|
Config2,
|
|
7
7
|
issueSession2,
|
|
8
8
|
sessionCookieName2
|
|
9
|
-
} from "./
|
|
9
|
+
} from "./event-feed-j4at0y5c.js";
|
|
10
10
|
import {
|
|
11
11
|
Service3
|
|
12
|
-
} from "./
|
|
12
|
+
} from "./event-feed-5pdfedjd.js";
|
|
13
13
|
import {
|
|
14
14
|
Service2
|
|
15
|
-
} from "./
|
|
15
|
+
} from "./event-feed-kqr36gas.js";
|
|
16
16
|
|
|
17
17
|
// src/handlers/server.ts
|
|
18
18
|
import { hostname } from "node:os";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
awaitPlugins2,
|
|
3
3
|
response2
|
|
4
|
-
} from "./
|
|
4
|
+
} from "./event-feed-50bbk3b2.js";
|
|
5
5
|
import {
|
|
6
6
|
Api2
|
|
7
|
-
} from "./
|
|
7
|
+
} from "./event-feed-0e81et3m.js";
|
|
8
8
|
|
|
9
9
|
// src/handlers/provider.ts
|
|
10
10
|
import { Provider } from "@opencode/core/provider";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
response2
|
|
3
|
-
} from "./
|
|
3
|
+
} from "./event-feed-50bbk3b2.js";
|
|
4
4
|
import {
|
|
5
5
|
Api2
|
|
6
|
-
} from "./
|
|
6
|
+
} from "./event-feed-0e81et3m.js";
|
|
7
7
|
|
|
8
8
|
// src/handlers/command.ts
|
|
9
9
|
import { Command } from "@opencode/core/command";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
awaitPlugins2,
|
|
3
3
|
response2
|
|
4
|
-
} from "./
|
|
4
|
+
} from "./event-feed-50bbk3b2.js";
|
|
5
5
|
import {
|
|
6
6
|
Api2
|
|
7
|
-
} from "./
|
|
7
|
+
} from "./event-feed-0e81et3m.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
|
locationErrors2,
|
|
3
3
|
awaitPlugins2
|
|
4
|
-
} from "./
|
|
4
|
+
} from "./event-feed-50bbk3b2.js";
|
|
5
5
|
import {
|
|
6
6
|
Api2
|
|
7
|
-
} from "./
|
|
7
|
+
} from "./event-feed-0e81et3m.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
|
Api2
|
|
3
|
-
} from "./
|
|
3
|
+
} from "./event-feed-0e81et3m.js";
|
|
4
4
|
import {
|
|
5
5
|
Service4,
|
|
6
6
|
frame2
|
|
7
|
-
} from "./
|
|
7
|
+
} from "./event-feed-s802fzg1.js";
|
|
8
8
|
|
|
9
9
|
// src/handlers/event.ts
|
|
10
10
|
import { Event } from "@opencode/schema/event";
|
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
import {
|
|
2
2
|
isAllowedCorsOrigin2
|
|
3
|
-
} from "./
|
|
3
|
+
} from "./event-feed-q4bn6dy8.js";
|
|
4
4
|
import {
|
|
5
5
|
createRoutes2
|
|
6
|
-
} from "./
|
|
6
|
+
} from "./event-feed-qa4stgpe.js";
|
|
7
7
|
import {
|
|
8
8
|
__export
|
|
9
|
-
} from "./
|
|
9
|
+
} from "./event-feed-9rqn6x4v.js";
|
|
10
10
|
|
|
11
11
|
// src/fetch.ts
|
|
12
12
|
var exports_fetch = {};
|
|
13
13
|
__export(exports_fetch, {
|
|
14
14
|
ServerFetch: () => exports_fetch,
|
|
15
|
-
make: () =>
|
|
15
|
+
make: () => make3
|
|
16
16
|
});
|
|
17
17
|
import { Context, Effect, Layer } from "effect";
|
|
18
18
|
import { HttpEffect, HttpMiddleware, HttpRouter, HttpServer } from "effect/http";
|
|
19
19
|
import { SessionRestart } from "@opencode/core/session/execution/restart";
|
|
20
|
-
var
|
|
20
|
+
var make3 = Effect.fn("ServerFetch.make")(function* (options = {}, boot = {}) {
|
|
21
21
|
const context = yield* Layer.build(createRoutes2(options, () => [], boot.overrides ?? []).pipe(Layer.provide(HttpServer.layerServices)));
|
|
22
22
|
yield* Effect.forkDetach(Context.get(context, SessionRestart.Service).resumeSuspendedSessions);
|
|
23
23
|
return Context.get(context, HttpRouter.HttpRouter).asHttpEffect().pipe(HttpMiddleware.cors({ allowedOrigins: (origin) => isAllowedCorsOrigin2(origin, options), maxAge: 86400 }), HttpEffect.toWebHandlerWith(context));
|
|
24
24
|
});
|
|
25
25
|
|
|
26
|
-
export {
|
|
26
|
+
export { make3, exports_fetch };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
requestRef2
|
|
3
|
-
} from "./
|
|
3
|
+
} from "./event-feed-50bbk3b2.js";
|
|
4
4
|
import {
|
|
5
5
|
Api2
|
|
6
|
-
} from "./
|
|
6
|
+
} from "./event-feed-0e81et3m.js";
|
|
7
7
|
|
|
8
8
|
// src/handlers/debug.ts
|
|
9
9
|
import { LocationServiceMap } from "@opencode/core/location-service-map";
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
__export
|
|
3
|
-
} from "./
|
|
3
|
+
} from "./event-feed-9rqn6x4v.js";
|
|
4
4
|
|
|
5
5
|
// src/auth.ts
|
|
6
6
|
var exports_auth = {};
|
|
7
7
|
__export(exports_auth, {
|
|
8
8
|
Config: () => Config2,
|
|
9
|
-
DEFAULT_USERNAME: () => DEFAULT_USERNAME2,
|
|
10
9
|
SESSION_TTL_SECONDS: () => SESSION_TTL_SECONDS2,
|
|
11
10
|
ServerAuth: () => exports_auth,
|
|
12
11
|
authorized: () => authorized2,
|
|
@@ -17,12 +16,11 @@ __export(exports_auth, {
|
|
|
17
16
|
});
|
|
18
17
|
import { Context, Layer, Option, Redacted } from "effect";
|
|
19
18
|
import { createHmac, timingSafeEqual } from "node:crypto";
|
|
20
|
-
var DEFAULT_USERNAME2 = "opencode";
|
|
21
19
|
var SESSION_TTL_SECONDS2 = 30 * 24 * 60 * 60;
|
|
22
20
|
|
|
23
21
|
class Config2 extends Context.Service()("@opencode/ServerAuthConfig") {
|
|
24
22
|
static configLayer(input) {
|
|
25
|
-
return Layer.succeed(this, this.of({
|
|
23
|
+
return Layer.succeed(this, this.of({ ...input, username: "opencode" }));
|
|
26
24
|
}
|
|
27
25
|
static get layer() {
|
|
28
26
|
return this.configLayer({ password: Option.none() });
|
|
@@ -32,12 +30,10 @@ function required2(config) {
|
|
|
32
30
|
return Option.isSome(config.password) && config.password.value !== "";
|
|
33
31
|
}
|
|
34
32
|
function authorized2(credentials, config) {
|
|
35
|
-
if (Option.isNone(config.password))
|
|
33
|
+
if (Option.isNone(config.password) || credentials.username !== config.username)
|
|
36
34
|
return false;
|
|
37
35
|
const password = Redacted.value(credentials.password);
|
|
38
|
-
|
|
39
|
-
return true;
|
|
40
|
-
return credentials.username === config.username && password === config.password.value;
|
|
36
|
+
return password === config.password.value || verifySession2(password, config);
|
|
41
37
|
}
|
|
42
38
|
function issueSession2(config, now = Date.now()) {
|
|
43
39
|
if (Option.isNone(config.password))
|
|
@@ -67,4 +63,4 @@ function sign(password, payload) {
|
|
|
67
63
|
return createHmac("sha256", key).update(payload).digest("base64url");
|
|
68
64
|
}
|
|
69
65
|
|
|
70
|
-
export {
|
|
66
|
+
export { SESSION_TTL_SECONDS2, Config2, required2, authorized2, issueSession2, verifySession2, sessionCookieName2, exports_auth };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
response2
|
|
3
|
-
} from "./
|
|
3
|
+
} from "./event-feed-50bbk3b2.js";
|
|
4
4
|
import {
|
|
5
5
|
Api2
|
|
6
|
-
} from "./
|
|
6
|
+
} from "./event-feed-0e81et3m.js";
|
|
7
7
|
|
|
8
8
|
// src/handlers/plugin.ts
|
|
9
9
|
import { Plugin } from "@opencode/core/plugin";
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import {
|
|
2
2
|
missingSession2
|
|
3
|
-
} from "./
|
|
3
|
+
} from "./event-feed-smaf4a18.js";
|
|
4
4
|
import {
|
|
5
5
|
locationErrors2,
|
|
6
6
|
response2,
|
|
7
7
|
sessionInfo2
|
|
8
|
-
} from "./
|
|
8
|
+
} from "./event-feed-50bbk3b2.js";
|
|
9
9
|
import {
|
|
10
10
|
Api2
|
|
11
|
-
} from "./
|
|
11
|
+
} from "./event-feed-0e81et3m.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 "./event-feed-smaf4a18.js";
|
|
5
5
|
import {
|
|
6
6
|
Api2
|
|
7
|
-
} from "./
|
|
7
|
+
} from "./event-feed-0e81et3m.js";
|
|
8
8
|
import {
|
|
9
9
|
wantsMediaRefs2
|
|
10
|
-
} from "./
|
|
10
|
+
} from "./event-feed-xthc02cw.js";
|
|
11
11
|
|
|
12
12
|
// src/handlers/message.ts
|
|
13
13
|
import { SessionMessage } from "@opencode/core/session/message";
|
|
@@ -2,17 +2,17 @@ import {
|
|
|
2
2
|
locationErrors2,
|
|
3
3
|
response2,
|
|
4
4
|
requestRef2
|
|
5
|
-
} from "./
|
|
5
|
+
} from "./event-feed-50bbk3b2.js";
|
|
6
6
|
import {
|
|
7
7
|
Api2
|
|
8
|
-
} from "./
|
|
8
|
+
} from "./event-feed-0e81et3m.js";
|
|
9
9
|
import {
|
|
10
10
|
CorsConfig2,
|
|
11
11
|
isAllowedRequestOrigin2
|
|
12
|
-
} from "./
|
|
12
|
+
} from "./event-feed-q4bn6dy8.js";
|
|
13
13
|
import {
|
|
14
14
|
runPtySocket2
|
|
15
|
-
} from "./
|
|
15
|
+
} from "./event-feed-h6rt5k9s.js";
|
|
16
16
|
|
|
17
17
|
// src/handlers/mcp.ts
|
|
18
18
|
import { Location } from "@opencode/core/location";
|