@opencode/server 0.0.0-dev-19707 → 0.0.0-dev-19709
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 +44 -0
- package/dist/handlers/location.d.ts +2 -1
- package/dist/handlers/location.js +13 -8
- package/package.json +8 -8
package/dist/api.d.ts
CHANGED
|
@@ -2,6 +2,38 @@ import { LocationMiddleware } from "./location";
|
|
|
2
2
|
import { FormLocationMiddleware } from "./middleware/form-location";
|
|
3
3
|
import { SessionLocationMiddleware } from "./middleware/session-location";
|
|
4
4
|
export declare const Api: import("@opencode/protocol/api").Api<LocationMiddleware, import("effect/unstable/httpapi/HttpApiMiddleware").HttpApiMiddleware<import("@opencode/core/instance").Services, never, never>, FormLocationMiddleware, import("effect/unstable/httpapi/HttpApiMiddleware").HttpApiMiddleware<import("@opencode/core/instance").Services, readonly [typeof import("@opencode/protocol/errors").InvalidRequestError, typeof import("@opencode/protocol/errors").SessionNotFoundError], never>, SessionLocationMiddleware, import("effect/unstable/httpapi/HttpApiMiddleware").HttpApiMiddleware<import("@opencode/core/instance").Services, readonly [typeof import("@opencode/protocol/errors").InvalidRequestError, typeof import("@opencode/protocol/errors").SessionNotFoundError], never>, import("effect/unstable/httpapi/HttpApiGroup").HttpApiGroup<"server.event", import("effect/unstable/httpapi/HttpApiEndpoint").HttpApiEndpoint<"event.subscribe", "GET", "/api/event", never, never, never, never, import("effect/unstable/httpapi/HttpApiSchema").StreamSse<import("effect/unstable/httpapi/HttpApiSchema").SseEventFromData<import("effect/Schema").Union<readonly [import("effect/Schema").Struct<{
|
|
5
|
+
readonly id: import("effect/Schema").brand<import("effect/Schema").String, "Event.ID"> & {
|
|
6
|
+
create: () => string & import("effect/Brand").Brand<"Event.ID">;
|
|
7
|
+
};
|
|
8
|
+
readonly created: import("effect/Schema").Finite;
|
|
9
|
+
readonly metadata: import("effect/Schema").decodeTo<import("effect/Schema").optional<import("effect/Schema").toType<import("effect/Schema").$Record<import("effect/Schema").String, import("effect/Schema").Unknown>>>, import("effect/Schema").optionalKey<import("effect/Schema").$Record<import("effect/Schema").String, import("effect/Schema").Unknown>>, never, never>;
|
|
10
|
+
readonly type: import("effect/Schema").Literal<"location.shutdown">;
|
|
11
|
+
readonly location: import("effect/Schema").decodeTo<import("effect/Schema").optional<import("effect/Schema").toType<import("effect/Schema").Struct<{
|
|
12
|
+
readonly directory: import("effect/Schema").brand<import("effect/Schema").String, "AbsolutePath">;
|
|
13
|
+
readonly workspaceID: import("effect/Schema").decodeTo<import("effect/Schema").optional<import("effect/Schema").toType<import("effect/Schema").brand<import("effect/Schema").String, "Workspace.ID"> & {
|
|
14
|
+
ascending: (id?: string) => string & import("effect/Brand").Brand<"Workspace.ID">;
|
|
15
|
+
create: () => string & import("effect/Brand").Brand<"Workspace.ID">;
|
|
16
|
+
}>>, import("effect/Schema").optionalKey<import("effect/Schema").brand<import("effect/Schema").String, "Workspace.ID"> & {
|
|
17
|
+
ascending: (id?: string) => string & import("effect/Brand").Brand<"Workspace.ID">;
|
|
18
|
+
create: () => string & import("effect/Brand").Brand<"Workspace.ID">;
|
|
19
|
+
}>, never, never>;
|
|
20
|
+
}>>>, import("effect/Schema").optionalKey<import("effect/Schema").Struct<{
|
|
21
|
+
readonly directory: import("effect/Schema").brand<import("effect/Schema").String, "AbsolutePath">;
|
|
22
|
+
readonly workspaceID: import("effect/Schema").decodeTo<import("effect/Schema").optional<import("effect/Schema").toType<import("effect/Schema").brand<import("effect/Schema").String, "Workspace.ID"> & {
|
|
23
|
+
ascending: (id?: string) => string & import("effect/Brand").Brand<"Workspace.ID">;
|
|
24
|
+
create: () => string & import("effect/Brand").Brand<"Workspace.ID">;
|
|
25
|
+
}>>, import("effect/Schema").optionalKey<import("effect/Schema").brand<import("effect/Schema").String, "Workspace.ID"> & {
|
|
26
|
+
ascending: (id?: string) => string & import("effect/Brand").Brand<"Workspace.ID">;
|
|
27
|
+
create: () => string & import("effect/Brand").Brand<"Workspace.ID">;
|
|
28
|
+
}>, never, never>;
|
|
29
|
+
}>>, never, never>;
|
|
30
|
+
readonly data: import("effect/Schema").Struct<{}>;
|
|
31
|
+
}> & {
|
|
32
|
+
type: "location.shutdown";
|
|
33
|
+
durability: "ephemeral";
|
|
34
|
+
durable: undefined;
|
|
35
|
+
data: import("effect/Schema").Struct<{}>;
|
|
36
|
+
}, import("effect/Schema").Struct<{
|
|
5
37
|
readonly id: import("effect/Schema").brand<import("effect/Schema").String, "Event.ID"> & {
|
|
6
38
|
create: () => string & import("effect/Brand").Brand<"Event.ID">;
|
|
7
39
|
};
|
|
@@ -8086,6 +8118,18 @@ export declare const Api: import("@opencode/protocol/api").Api<LocationMiddlewar
|
|
|
8086
8118
|
readonly metadata?: {
|
|
8087
8119
|
readonly [x: string]: unknown;
|
|
8088
8120
|
} | undefined;
|
|
8121
|
+
} | {
|
|
8122
|
+
readonly id: string & import("effect/Brand").Brand<"Event.ID">;
|
|
8123
|
+
readonly data: {};
|
|
8124
|
+
readonly type: "location.shutdown";
|
|
8125
|
+
readonly created: number;
|
|
8126
|
+
readonly location?: {
|
|
8127
|
+
readonly directory: string & import("effect/Brand").Brand<"AbsolutePath">;
|
|
8128
|
+
readonly workspaceID?: (string & import("effect/Brand").Brand<"Workspace.ID">) | undefined;
|
|
8129
|
+
} | undefined;
|
|
8130
|
+
readonly metadata?: {
|
|
8131
|
+
readonly [x: string]: unknown;
|
|
8132
|
+
} | undefined;
|
|
8089
8133
|
} | {
|
|
8090
8134
|
readonly id: string & import("effect/Brand").Brand<"Event.ID">;
|
|
8091
8135
|
readonly data: {
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
import { LocationServiceMap } from "@opencode/core/location-service-map";
|
|
2
|
+
export declare const LocationHandler: import("effect/Layer").Layer<import("effect/unstable/httpapi/HttpApiGroup").Service<"server", "server.location">, never, import("@opencode/protocol/middleware/schema-error").SchemaErrorMiddleware | import("@opencode/protocol/middleware/authorization").Authorization | LocationServiceMap.Service | import("../location").LocationMiddleware>;
|
|
@@ -1,11 +1,16 @@
|
|
|
1
1
|
import { Location } from "@opencode/core/location";
|
|
2
|
-
import {
|
|
2
|
+
import { LocationServiceMap } from "@opencode/core/location-service-map";
|
|
3
|
+
import { ServiceUnavailableError } from "@opencode/protocol/errors";
|
|
4
|
+
import { Cause, Effect } from "effect";
|
|
3
5
|
import { HttpApiBuilder } from "effect/unstable/httpapi";
|
|
4
6
|
import { Api } from "../api";
|
|
5
|
-
export const LocationHandler = HttpApiBuilder.group(Api, "server.location", (handlers) =>
|
|
6
|
-
const
|
|
7
|
-
return
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
7
|
+
export const LocationHandler = HttpApiBuilder.group(Api, "server.location", (handlers) => Effect.gen(function* () {
|
|
8
|
+
const locations = yield* LocationServiceMap.Service;
|
|
9
|
+
return handlers.handle("location.get", Effect.fn(function* () {
|
|
10
|
+
const location = yield* Location.Service;
|
|
11
|
+
return new Location.Info({
|
|
12
|
+
directory: location.directory,
|
|
13
|
+
project: location.project
|
|
14
|
+
});
|
|
15
|
+
})).handle("location.reload", () => LocationServiceMap.reload().pipe(Effect.provideService(LocationServiceMap.Service, locations), Effect.catchCause((cause) => Cause.hasInterruptsOnly(cause) ? Effect.failCause(cause) : Effect.fail(new ServiceUnavailableError({ message: Cause.pretty(cause), service: "location" })))));
|
|
16
|
+
}));
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/package.json",
|
|
3
3
|
"name": "@opencode/server",
|
|
4
|
-
"version": "0.0.0-dev-
|
|
4
|
+
"version": "0.0.0-dev-19709",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"repository": {
|
|
@@ -30,17 +30,17 @@
|
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"@effect/platform-node": "4.0.0-rc.112",
|
|
32
32
|
"@effect/platform-node-shared": "4.0.0-rc.112",
|
|
33
|
-
"@opencode/core": "0.0.0-dev-
|
|
34
|
-
"@opencode/protocol": "0.0.0-dev-
|
|
35
|
-
"@opencode/schema": "0.0.0-dev-
|
|
36
|
-
"@opencode/simulation": "0.0.0-dev-
|
|
37
|
-
"@opencode/util": "0.0.0-dev-
|
|
33
|
+
"@opencode/core": "0.0.0-dev-19709",
|
|
34
|
+
"@opencode/protocol": "0.0.0-dev-19709",
|
|
35
|
+
"@opencode/schema": "0.0.0-dev-19709",
|
|
36
|
+
"@opencode/simulation": "0.0.0-dev-19709",
|
|
37
|
+
"@opencode/util": "0.0.0-dev-19709",
|
|
38
38
|
"drizzle-orm": "1.0.0-rc.5-169397b",
|
|
39
39
|
"effect": "4.0.0-rc.112"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
|
-
"@opencode/client": "0.0.0-dev-
|
|
43
|
-
"@opencode/plugin": "0.0.0-dev-
|
|
42
|
+
"@opencode/client": "0.0.0-dev-19709",
|
|
43
|
+
"@opencode/plugin": "0.0.0-dev-19709",
|
|
44
44
|
"@tsconfig/bun": "1.0.9",
|
|
45
45
|
"@types/bun": "1.4.0",
|
|
46
46
|
"@typescript/native-preview": "7.0.0-dev.20251207.1"
|