@opencode/server 0.0.0-dev-19555 → 0.0.0-dev-19557
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 +2 -18
- package/dist/handlers/location.js +0 -1
- package/dist/handlers/session.js +0 -2
- package/dist/handlers.d.ts +1 -1
- package/dist/handlers.js +1 -2
- package/dist/location.js +2 -5
- package/package.json +8 -8
- package/dist/handlers/workspace.d.ts +0 -2
- package/dist/handlers/workspace.js +0 -20
package/dist/api.d.ts
CHANGED
|
@@ -6156,13 +6156,6 @@ export declare const Api: import("@opencode/protocol/api").Api<LocationMiddlewar
|
|
|
6156
6156
|
readonly type: import("effect/Schema").TemplateLiteral<readonly ["rpc.", import("effect/Schema").String]>;
|
|
6157
6157
|
readonly location: import("effect/Schema").Struct<{
|
|
6158
6158
|
readonly directory: import("effect/Schema").brand<import("effect/Schema").String, "AbsolutePath">;
|
|
6159
|
-
readonly workspaceID: import("effect/Schema").decodeTo<import("effect/Schema").optional<import("effect/Schema").toType<import("effect/Schema").brand<import("effect/Schema").String, "Workspace.ID"> & {
|
|
6160
|
-
ascending: (id?: string) => string & import("effect/Brand").Brand<"Workspace.ID">;
|
|
6161
|
-
create: () => string & import("effect/Brand").Brand<"Workspace.ID">;
|
|
6162
|
-
}>>, import("effect/Schema").optionalKey<import("effect/Schema").brand<import("effect/Schema").String, "Workspace.ID"> & {
|
|
6163
|
-
ascending: (id?: string) => string & import("effect/Brand").Brand<"Workspace.ID">;
|
|
6164
|
-
create: () => string & import("effect/Brand").Brand<"Workspace.ID">;
|
|
6165
|
-
}>, never, never>;
|
|
6166
6159
|
}>;
|
|
6167
6160
|
readonly data: import("effect/Schema").$Record<import("effect/Schema").String, import("effect/Schema").Unknown>;
|
|
6168
6161
|
}>, ...import("effect/Schema").Struct<{
|
|
@@ -6174,13 +6167,6 @@ export declare const Api: import("@opencode/protocol/api").Api<LocationMiddlewar
|
|
|
6174
6167
|
readonly metadata: import("effect/Schema").optional<import("effect/Schema").$Record<import("effect/Schema").String, import("effect/Schema").Unknown>>;
|
|
6175
6168
|
readonly location: import("effect/Schema").optional<import("effect/Schema").Struct<{
|
|
6176
6169
|
readonly directory: import("effect/Schema").brand<import("effect/Schema").String, "AbsolutePath">;
|
|
6177
|
-
readonly workspaceID: import("effect/Schema").decodeTo<import("effect/Schema").optional<import("effect/Schema").toType<import("effect/Schema").brand<import("effect/Schema").String, "Workspace.ID"> & {
|
|
6178
|
-
ascending: (id?: string) => string & import("effect/Brand").Brand<"Workspace.ID">;
|
|
6179
|
-
create: () => string & import("effect/Brand").Brand<"Workspace.ID">;
|
|
6180
|
-
}>>, import("effect/Schema").optionalKey<import("effect/Schema").brand<import("effect/Schema").String, "Workspace.ID"> & {
|
|
6181
|
-
ascending: (id?: string) => string & import("effect/Brand").Brand<"Workspace.ID">;
|
|
6182
|
-
create: () => string & import("effect/Brand").Brand<"Workspace.ID">;
|
|
6183
|
-
}>, never, never>;
|
|
6184
6170
|
}>>;
|
|
6185
6171
|
}>[]]>>, import("effect/Schema").Never, {
|
|
6186
6172
|
readonly id: string & import("effect/Brand").Brand<"Event.ID">;
|
|
@@ -6199,8 +6185,6 @@ export declare const Api: import("@opencode/protocol/api").Api<LocationMiddlewar
|
|
|
6199
6185
|
readonly data: {
|
|
6200
6186
|
readonly form: {
|
|
6201
6187
|
readonly id: string & import("effect/Brand").Brand<"Form.ID">;
|
|
6202
|
-
readonly sessionID: string;
|
|
6203
|
-
readonly title: string;
|
|
6204
6188
|
readonly fields: readonly [{
|
|
6205
6189
|
readonly type: "string";
|
|
6206
6190
|
readonly key: string;
|
|
@@ -6380,6 +6364,8 @@ export declare const Api: import("@opencode/protocol/api").Api<LocationMiddlewar
|
|
|
6380
6364
|
readonly description?: string | undefined;
|
|
6381
6365
|
readonly title?: string | undefined;
|
|
6382
6366
|
})[]];
|
|
6367
|
+
readonly sessionID: string;
|
|
6368
|
+
readonly title: string;
|
|
6383
6369
|
readonly metadata?: {
|
|
6384
6370
|
readonly [x: string]: unknown;
|
|
6385
6371
|
} | undefined;
|
|
@@ -8370,7 +8356,6 @@ export declare const Api: import("@opencode/protocol/api").Api<LocationMiddlewar
|
|
|
8370
8356
|
readonly id: string & import("effect/Brand").Brand<"Event.ID">;
|
|
8371
8357
|
readonly location: {
|
|
8372
8358
|
readonly directory: string & import("effect/Brand").Brand<"AbsolutePath">;
|
|
8373
|
-
readonly workspaceID?: (string & import("effect/Brand").Brand<"Workspace.ID">) | undefined;
|
|
8374
8359
|
};
|
|
8375
8360
|
readonly data: {
|
|
8376
8361
|
readonly [x: string]: unknown;
|
|
@@ -8386,7 +8371,6 @@ export declare const Api: import("@opencode/protocol/api").Api<LocationMiddlewar
|
|
|
8386
8371
|
readonly type: "server.connected";
|
|
8387
8372
|
readonly location?: {
|
|
8388
8373
|
readonly directory: string & import("effect/Brand").Brand<"AbsolutePath">;
|
|
8389
|
-
readonly workspaceID?: (string & import("effect/Brand").Brand<"Workspace.ID">) | undefined;
|
|
8390
8374
|
} | undefined;
|
|
8391
8375
|
readonly metadata?: {
|
|
8392
8376
|
readonly [x: string]: unknown;
|
|
@@ -6,7 +6,6 @@ export const LocationHandler = HttpApiBuilder.group(Api, "server.location", (han
|
|
|
6
6
|
const location = yield* Location.Service;
|
|
7
7
|
return new Location.Info({
|
|
8
8
|
directory: location.directory,
|
|
9
|
-
workspaceID: location.workspaceID,
|
|
10
9
|
project: location.project
|
|
11
10
|
});
|
|
12
11
|
})));
|
package/dist/handlers/session.js
CHANGED
|
@@ -29,7 +29,6 @@ export const SessionHandler = HttpApiBuilder.group(Api, "server.session", (handl
|
|
|
29
29
|
return handlers.handle("session.list", Effect.fn(function* (ctx) {
|
|
30
30
|
const query = ctx.query.cursor !== void 0 ? yield* SessionsCursor.parse(ctx.query.cursor).pipe(Effect.mapError(() => new InvalidCursorError({ message: "Invalid cursor" }))) : ctx.query, sessions = (yield* session.list({
|
|
31
31
|
...query,
|
|
32
|
-
workspaceID: query.workspace,
|
|
33
32
|
limit: ctx.query.limit ?? DefaultSessionsLimit
|
|
34
33
|
})).data, first = sessions[0], last = sessions.at(-1);
|
|
35
34
|
return {
|
|
@@ -133,7 +132,6 @@ export const SessionHandler = HttpApiBuilder.group(Api, "server.session", (handl
|
|
|
133
132
|
yield* session.move({
|
|
134
133
|
sessionID: ctx.params.sessionID,
|
|
135
134
|
directory: ctx.payload.directory,
|
|
136
|
-
workspaceID: ctx.payload.workspaceID,
|
|
137
135
|
delivery: ctx.payload.delivery
|
|
138
136
|
}).pipe(Effect.catchTag("Session.NotFoundError", missingSession), Effect.catchTag("Session.DestinationNotFoundError", (error) => Effect.fail(new InvalidRequestError({ message: `Directory does not exist: ${error.directory}` }))), Effect.catchTag("Session.DestinationNotDirectoryError", (error) => Effect.fail(new InvalidRequestError({ message: `Not a directory: ${error.directory}` }))), Effect.catchTag("Session.DestinationUnavailableError", (error) => Effect.fail(new InvalidRequestError({ message: `Directory is unavailable: ${error.directory}` }))));
|
|
139
137
|
return HttpApiSchema.NoContent.make();
|
package/dist/handlers.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { Layer } from "effect";
|
|
2
|
-
export declare const handlers: Layer.Layer<import("effect/unstable/httpapi/HttpApiGroup").Service<"server", "server.generate"> | import("effect/unstable/httpapi/HttpApiGroup").Service<"server", "server.message"> | import("effect/unstable/httpapi/HttpApiGroup").Service<"server", "server.model"> | import("effect/unstable/httpapi/HttpApiGroup").Service<"server", "server.provider"> | import("effect/unstable/httpapi/HttpApiGroup").Service<"server", "server.session"> | import("effect/unstable/httpapi/HttpApiGroup").Service<"server", "server.permission"> | import("effect/unstable/httpapi/HttpApiGroup").Service<"server", "server.fs"> | import("effect/unstable/httpapi/HttpApiGroup").Service<"server", "server.form"> | import("effect/unstable/httpapi/HttpApiGroup").Service<"server", "server.command"> | import("effect/unstable/httpapi/HttpApiGroup").Service<"server", "server.skill"> | import("effect/unstable/httpapi/HttpApiGroup").Service<"server", "server.rpc"> | import("effect/unstable/httpapi/HttpApiGroup").Service<"server", "server.event"> | import("effect/unstable/httpapi/HttpApiGroup").Service<"server", "server.agent"> | import("effect/unstable/httpapi/HttpApiGroup").Service<"server", "server.plugin"> | import("effect/unstable/httpapi/HttpApiGroup").Service<"server", "server.server"> | import("effect/unstable/httpapi/HttpApiGroup").Service<"server", "server.debug"> | import("effect/unstable/httpapi/HttpApiGroup").Service<"server", "server.pty"> | import("effect/unstable/httpapi/HttpApiGroup").Service<"server", "server.experimental"> | import("effect/unstable/httpapi/HttpApiGroup").Service<"server", "server.shell"> | import("effect/unstable/httpapi/HttpApiGroup").Service<"server", "server.reference"> | import("effect/unstable/httpapi/HttpApiGroup").Service<"server", "server.location"> | import("effect/unstable/httpapi/HttpApiGroup").Service<"server", "server.integration"> | import("effect/unstable/httpapi/HttpApiGroup").Service<"server", "server.websearch"> | import("effect/unstable/httpapi/HttpApiGroup").Service<"server", "server.mcp"> | import("effect/unstable/httpapi/HttpApiGroup").Service<"server", "server.credential"> | import("effect/unstable/httpapi/HttpApiGroup").Service<"server", "server.project"> | import("effect/unstable/httpapi/HttpApiGroup").Service<"server", "server.worktree"> | import("effect/unstable/httpapi/HttpApiGroup").Service<"server", "server.vcs"> | import("effect/unstable/httpapi/HttpApiGroup").Service<"server", "server.migration"> | import("effect/unstable/httpapi/HttpApiGroup").Service<"server", "server.config"
|
|
2
|
+
export declare const handlers: Layer.Layer<import("effect/unstable/httpapi/HttpApiGroup").Service<"server", "server.generate"> | import("effect/unstable/httpapi/HttpApiGroup").Service<"server", "server.message"> | import("effect/unstable/httpapi/HttpApiGroup").Service<"server", "server.model"> | import("effect/unstable/httpapi/HttpApiGroup").Service<"server", "server.provider"> | import("effect/unstable/httpapi/HttpApiGroup").Service<"server", "server.session"> | import("effect/unstable/httpapi/HttpApiGroup").Service<"server", "server.permission"> | import("effect/unstable/httpapi/HttpApiGroup").Service<"server", "server.fs"> | import("effect/unstable/httpapi/HttpApiGroup").Service<"server", "server.form"> | import("effect/unstable/httpapi/HttpApiGroup").Service<"server", "server.command"> | import("effect/unstable/httpapi/HttpApiGroup").Service<"server", "server.skill"> | import("effect/unstable/httpapi/HttpApiGroup").Service<"server", "server.rpc"> | import("effect/unstable/httpapi/HttpApiGroup").Service<"server", "server.event"> | import("effect/unstable/httpapi/HttpApiGroup").Service<"server", "server.agent"> | import("effect/unstable/httpapi/HttpApiGroup").Service<"server", "server.plugin"> | import("effect/unstable/httpapi/HttpApiGroup").Service<"server", "server.server"> | import("effect/unstable/httpapi/HttpApiGroup").Service<"server", "server.debug"> | import("effect/unstable/httpapi/HttpApiGroup").Service<"server", "server.pty"> | import("effect/unstable/httpapi/HttpApiGroup").Service<"server", "server.experimental"> | import("effect/unstable/httpapi/HttpApiGroup").Service<"server", "server.shell"> | import("effect/unstable/httpapi/HttpApiGroup").Service<"server", "server.reference"> | import("effect/unstable/httpapi/HttpApiGroup").Service<"server", "server.location"> | import("effect/unstable/httpapi/HttpApiGroup").Service<"server", "server.integration"> | import("effect/unstable/httpapi/HttpApiGroup").Service<"server", "server.websearch"> | import("effect/unstable/httpapi/HttpApiGroup").Service<"server", "server.mcp"> | import("effect/unstable/httpapi/HttpApiGroup").Service<"server", "server.credential"> | import("effect/unstable/httpapi/HttpApiGroup").Service<"server", "server.project"> | import("effect/unstable/httpapi/HttpApiGroup").Service<"server", "server.worktree"> | import("effect/unstable/httpapi/HttpApiGroup").Service<"server", "server.vcs"> | import("effect/unstable/httpapi/HttpApiGroup").Service<"server", "server.migration"> | import("effect/unstable/httpapi/HttpApiGroup").Service<"server", "server.config">, never, import("@opencode/protocol/middleware/schema-error").SchemaErrorMiddleware | import("@opencode/protocol/middleware/authorization").Authorization | import("@opencode/util/global").Service | import("@opencode/core/bus").Service | import("@opencode/core/persistent-pty/index").Service | import("@opencode/core/location-service-map").Service | import("@opencode/core/session").Service | import("@opencode/core/instance").Service | import("./location").LocationMiddleware | import("./middleware/form-location").FormLocationMiddleware | import("./middleware/session-location").SessionLocationMiddleware | import("@opencode/core/pty/ticket").Service | import("@opencode/core/session/transfer").Service | import("effect/unstable/http/HttpRouter").Request<"Requires", import("@opencode/core/database/database").Service> | import("effect/unstable/http/HttpRouter").Request<"Requires", import("@opencode/core/permission/saved").Service> | import("effect/unstable/http/HttpRouter").Request<"Requires", import("@opencode/core/plugin/update").Service> | import("effect/unstable/http/HttpRouter").Request<"Requires", import("./server-info").Service> | import("./pty-environment").Service | import("effect/unstable/http/HttpRouter").Request<"Requires", import("@opencode/core/wellknown").Service> | import("effect/unstable/http/HttpRouter").Request<"Requires", import("@opencode/core/project").Service>>;
|
package/dist/handlers.js
CHANGED
|
@@ -30,5 +30,4 @@ import { VcsHandler } from "./handlers/vcs";
|
|
|
30
30
|
import { EventFeed } from "./event-feed";
|
|
31
31
|
import { MigrationHandler } from "./handlers/migration";
|
|
32
32
|
import { ConfigHandler } from "./handlers/config";
|
|
33
|
-
|
|
34
|
-
export const handlers = Layer.mergeAll(ServerHandler, DebugHandler, MigrationHandler, LocationHandler, AgentHandler, PluginHandler, SessionHandler, MessageHandler, ModelHandler, GenerateHandler, ProviderHandler, IntegrationHandler, WebSearchHandler, McpHandler, CredentialHandler, ProjectHandler, FormHandler, PermissionHandler, FileSystemHandler, CommandHandler, SkillHandler, RpcHandler, EventHandler.pipe(Layer.provide(EventFeed.layer)), PtyHandler, PersistentPtyHandler, ShellHandler, ReferenceHandler, WorktreeHandler, WorkspaceHandler, VcsHandler, ConfigHandler);
|
|
33
|
+
export const handlers = Layer.mergeAll(ServerHandler, DebugHandler, MigrationHandler, LocationHandler, AgentHandler, PluginHandler, SessionHandler, MessageHandler, ModelHandler, GenerateHandler, ProviderHandler, IntegrationHandler, WebSearchHandler, McpHandler, CredentialHandler, ProjectHandler, FormHandler, PermissionHandler, FileSystemHandler, CommandHandler, SkillHandler, RpcHandler, EventHandler.pipe(Layer.provide(EventFeed.layer)), PtyHandler, PersistentPtyHandler, ShellHandler, ReferenceHandler, WorktreeHandler, VcsHandler, ConfigHandler);
|
package/dist/location.js
CHANGED
|
@@ -2,7 +2,6 @@ import { Location } from "@opencode/core/location";
|
|
|
2
2
|
import { LocationServiceMap } from "@opencode/core/location-services";
|
|
3
3
|
import { AbsolutePath } from "@opencode/core/schema";
|
|
4
4
|
import { Session } from "@opencode/core/session";
|
|
5
|
-
import { Workspace } from "@opencode/core/workspace";
|
|
6
5
|
import { InvalidRequestError } from "@opencode/protocol/errors";
|
|
7
6
|
import { Effect, Layer, Schema } from "effect";
|
|
8
7
|
import { HttpServerRequest } from "effect/unstable/http";
|
|
@@ -17,7 +16,6 @@ export function response(data) {
|
|
|
17
16
|
return {
|
|
18
17
|
location: new Location.Info({
|
|
19
18
|
directory: location.directory,
|
|
20
|
-
workspaceID: location.workspaceID,
|
|
21
19
|
project: location.project
|
|
22
20
|
}),
|
|
23
21
|
data: yield* data
|
|
@@ -30,10 +28,9 @@ export const sessionInfo = Effect.fnUntraced(function* (sessions, sessionID) {
|
|
|
30
28
|
return yield* sessions.get(id).pipe(Effect.catchTag("Session.NotFoundError", missingSession));
|
|
31
29
|
});
|
|
32
30
|
export function requestRef(request) {
|
|
33
|
-
const
|
|
31
|
+
const directory = new URL(request.url, "http://localhost").searchParams.get("location[directory]") || (request.headers["x-opencode-directory"] ? decode(request.headers["x-opencode-directory"]) : process.cwd());
|
|
34
32
|
return Location.Ref.make({
|
|
35
|
-
directory: AbsolutePath.make(directory)
|
|
36
|
-
workspaceID: workspaceID ? Workspace.ID.make(workspaceID) : void 0
|
|
33
|
+
directory: AbsolutePath.make(directory)
|
|
37
34
|
});
|
|
38
35
|
}
|
|
39
36
|
function decode(input) {
|
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-19557",
|
|
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-19557",
|
|
34
|
+
"@opencode/protocol": "0.0.0-dev-19557",
|
|
35
|
+
"@opencode/schema": "0.0.0-dev-19557",
|
|
36
|
+
"@opencode/simulation": "0.0.0-dev-19557",
|
|
37
|
+
"@opencode/util": "0.0.0-dev-19557",
|
|
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-19557",
|
|
43
|
+
"@opencode/plugin": "0.0.0-dev-19557",
|
|
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"
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import { Workspace } from "@opencode/core/workspace";
|
|
2
|
-
export declare const WorkspaceHandler: import("effect/Layer").Layer<import("effect/unstable/httpapi/HttpApiGroup").Service<"server", "server.workspace">, never, import("@opencode/protocol/middleware/schema-error").SchemaErrorMiddleware | import("@opencode/protocol/middleware/authorization").Authorization | Workspace.Service>;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { Workspace } from "@opencode/core/workspace";
|
|
2
|
-
import { ConflictError, ProviderNotFoundError, UnknownError } from "@opencode/protocol/errors";
|
|
3
|
-
import { Effect } from "effect";
|
|
4
|
-
import { HttpApiBuilder } from "effect/unstable/httpapi";
|
|
5
|
-
import { Api } from "../api";
|
|
6
|
-
export const WorkspaceHandler = HttpApiBuilder.group(Api, "server.workspace", (handlers) => Effect.gen(function* () {
|
|
7
|
-
const workspace = yield* Workspace.Service;
|
|
8
|
-
return handlers.handle("workspace.create", (ctx) => workspace.create(ctx.payload).pipe(Effect.map((workspaceID) => ({ data: workspaceID })), Effect.catchTags({
|
|
9
|
-
"Workspace.CreateConflict": (error) => new ConflictError({
|
|
10
|
-
resource: error.workspaceID,
|
|
11
|
-
message: `Workspace ${error.workspaceID} already uses provider ${error.existingProvider}, not ${error.provider}`
|
|
12
|
-
}),
|
|
13
|
-
"WorkspaceDriver.ProviderNotFound": (error) => new ProviderNotFoundError({
|
|
14
|
-
providerID: error.provider,
|
|
15
|
-
message: `Workspace provider not found: ${error.provider}`
|
|
16
|
-
})
|
|
17
|
-
}))).handle("workspace.destroy", (ctx) => workspace.destroy(ctx.params.workspaceID).pipe(Effect.mapError((error) => new UnknownError({
|
|
18
|
-
message: error._tag === "WorkspaceDriver.ProviderNotFound" ? `Workspace provider not found: ${error.provider}` : error.message ?? "Workspace provider failed to destroy the workspace"
|
|
19
|
-
}))));
|
|
20
|
-
}));
|