@opencode/protocol 0.0.0-dev-20484 → 0.0.0-dev-20485
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/client.d.ts +5 -5
- package/dist/client.js +3 -3
- package/dist/errors.d.ts +8 -0
- package/dist/errors.js +3 -0
- package/dist/groups/generate.d.ts +2 -2
- package/dist/groups/generate.js +2 -2
- package/dist/groups/permission.d.ts +2 -2
- package/dist/groups/permission.js +2 -2
- package/dist/groups/session.d.ts +2 -2
- package/dist/groups/session.js +2 -2
- package/package.json +2 -2
package/dist/client.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { InvalidRequestError, SessionNotFoundError } from "./errors.js";
|
|
1
|
+
import { LocationNotFoundError, InvalidRequestError, SessionNotFoundError } from "./errors.js";
|
|
2
2
|
import type { Api } from "./api.js";
|
|
3
3
|
import type { Context } from "effect";
|
|
4
4
|
import { HttpApiMiddleware } from "effect/unstable/httpapi";
|
|
@@ -6,21 +6,21 @@ import type { EventGroup } from "./groups/event.js";
|
|
|
6
6
|
declare const LocationMiddleware_base: HttpApiMiddleware.ServiceClass<LocationMiddleware, "@opencode/client/LocationMiddleware", {
|
|
7
7
|
requires: never;
|
|
8
8
|
provides: never;
|
|
9
|
-
error:
|
|
9
|
+
error: readonly [typeof LocationNotFoundError];
|
|
10
10
|
clientError: never;
|
|
11
11
|
requiredForClient: false;
|
|
12
12
|
security: never;
|
|
13
|
-
}, HttpApiMiddleware.HttpApiMiddleware<never,
|
|
13
|
+
}, HttpApiMiddleware.HttpApiMiddleware<never, readonly [typeof LocationNotFoundError], never>>;
|
|
14
14
|
declare class LocationMiddleware extends LocationMiddleware_base {
|
|
15
15
|
}
|
|
16
16
|
declare const SessionLocationMiddleware_base: HttpApiMiddleware.ServiceClass<SessionLocationMiddleware, "@opencode/client/SessionLocationMiddleware", {
|
|
17
17
|
requires: never;
|
|
18
18
|
provides: never;
|
|
19
|
-
error: readonly [typeof InvalidRequestError, typeof SessionNotFoundError];
|
|
19
|
+
error: readonly [typeof InvalidRequestError, typeof SessionNotFoundError, typeof LocationNotFoundError];
|
|
20
20
|
clientError: never;
|
|
21
21
|
requiredForClient: false;
|
|
22
22
|
security: never;
|
|
23
|
-
}, HttpApiMiddleware.HttpApiMiddleware<never, readonly [typeof InvalidRequestError, typeof SessionNotFoundError], never>>;
|
|
23
|
+
}, HttpApiMiddleware.HttpApiMiddleware<never, readonly [typeof InvalidRequestError, typeof SessionNotFoundError, typeof LocationNotFoundError], never>>;
|
|
24
24
|
declare class SessionLocationMiddleware extends SessionLocationMiddleware_base {
|
|
25
25
|
}
|
|
26
26
|
type ClientApiShape = Api<Context.Service.Identifier<typeof LocationMiddleware>, Context.Service.Shape<typeof LocationMiddleware>, Context.Service.Identifier<typeof SessionLocationMiddleware>, Context.Service.Shape<typeof SessionLocationMiddleware>, Context.Service.Identifier<typeof SessionLocationMiddleware>, Context.Service.Shape<typeof SessionLocationMiddleware>, typeof EventGroup>;
|
package/dist/client.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { InvalidRequestError, SessionNotFoundError } from "./errors.js";
|
|
1
|
+
import { LocationNotFoundError, InvalidRequestError, SessionNotFoundError } from "./errors.js";
|
|
2
2
|
import { makeDefaultApi } from "./api.js";
|
|
3
3
|
import { HttpApiMiddleware } from "effect/unstable/httpapi";
|
|
4
|
-
class LocationMiddleware extends HttpApiMiddleware.Service()("@opencode/client/LocationMiddleware") {
|
|
4
|
+
class LocationMiddleware extends HttpApiMiddleware.Service()("@opencode/client/LocationMiddleware", { error: [LocationNotFoundError] }) {
|
|
5
5
|
}
|
|
6
|
-
class SessionLocationMiddleware extends HttpApiMiddleware.Service()("@opencode/client/SessionLocationMiddleware", { error: [InvalidRequestError, SessionNotFoundError] }) {
|
|
6
|
+
class SessionLocationMiddleware extends HttpApiMiddleware.Service()("@opencode/client/SessionLocationMiddleware", { error: [InvalidRequestError, SessionNotFoundError, LocationNotFoundError] }) {
|
|
7
7
|
}
|
|
8
8
|
export const ClientApi = makeDefaultApi({
|
|
9
9
|
locationMiddleware: LocationMiddleware,
|
package/dist/errors.d.ts
CHANGED
|
@@ -1,4 +1,12 @@
|
|
|
1
1
|
import { Schema } from "effect";
|
|
2
|
+
declare const LocationNotFoundError_base: Schema.Class<LocationNotFoundError, Schema.TaggedStruct<"LocationNotFoundError", {
|
|
3
|
+
readonly location: Schema.Struct<{
|
|
4
|
+
readonly directory: Schema.brand<Schema.String, "AbsolutePath">;
|
|
5
|
+
}>;
|
|
6
|
+
readonly message: Schema.String;
|
|
7
|
+
}>, import("effect/Cause").YieldableError>;
|
|
8
|
+
export declare class LocationNotFoundError extends LocationNotFoundError_base {
|
|
9
|
+
}
|
|
2
10
|
declare const InvalidRequestError_base: Schema.Class<InvalidRequestError, Schema.TaggedStruct<"InvalidRequestError", {
|
|
3
11
|
readonly message: Schema.String;
|
|
4
12
|
readonly kind: Schema.optional<Schema.String>;
|
package/dist/errors.js
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { Schema } from "effect";
|
|
2
2
|
import { Skill } from "@opencode/schema/skill";
|
|
3
|
+
import { Location } from "@opencode/schema/location";
|
|
4
|
+
export class LocationNotFoundError extends Schema.TaggedError()("LocationNotFoundError", { location: Location.PublicRef, message: Schema.String }, { httpApiStatus: 404 }) {
|
|
5
|
+
}
|
|
3
6
|
export class InvalidRequestError extends Schema.TaggedError()("InvalidRequestError", {
|
|
4
7
|
message: Schema.String,
|
|
5
8
|
kind: Schema.optional(Schema.String),
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Schema } from "effect";
|
|
2
2
|
import { HttpApiEndpoint, HttpApiGroup } from "effect/unstable/httpapi";
|
|
3
|
-
import { InvalidRequestError, ServiceUnavailableError } from "../errors.js";
|
|
3
|
+
import { LocationNotFoundError, InvalidRequestError, ServiceUnavailableError } from "../errors.js";
|
|
4
4
|
export declare const GenerateGroup: HttpApiGroup.HttpApiGroup<"server.generate", HttpApiEndpoint.HttpApiEndpoint<"generate.text", "POST", "/api/experimental/generate", never, never, Schema.toCodecJson<Schema.Struct<{
|
|
5
5
|
readonly prompt: Schema.String;
|
|
6
6
|
readonly model: Schema.optional<Schema.Struct<{
|
|
@@ -30,4 +30,4 @@ export declare const GenerateGroup: HttpApiGroup.HttpApiGroup<"server.generate",
|
|
|
30
30
|
readonly data: Schema.Struct<{
|
|
31
31
|
readonly text: Schema.String;
|
|
32
32
|
}>;
|
|
33
|
-
}>>, Schema.toCodecJson<typeof InvalidRequestError | typeof ServiceUnavailableError>, never, never>, false>;
|
|
33
|
+
}>>, Schema.toCodecJson<typeof LocationNotFoundError | typeof InvalidRequestError | typeof ServiceUnavailableError>, never, never>, false>;
|
package/dist/groups/generate.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Model } from "@opencode/schema/model";
|
|
2
2
|
import { Schema } from "effect";
|
|
3
3
|
import { HttpApiEndpoint, HttpApiGroup, OpenApi } from "effect/unstable/httpapi";
|
|
4
|
-
import { InvalidRequestError, ServiceUnavailableError } from "../errors.js";
|
|
4
|
+
import { LocationNotFoundError, InvalidRequestError, ServiceUnavailableError } from "../errors.js";
|
|
5
5
|
export const GenerateGroup = HttpApiGroup.make("server.generate")
|
|
6
6
|
.add(HttpApiEndpoint.post("generate.text", "/api/experimental/generate", {
|
|
7
7
|
payload: Schema.Struct({
|
|
@@ -11,7 +11,7 @@ export const GenerateGroup = HttpApiGroup.make("server.generate")
|
|
|
11
11
|
success: Schema.Struct({
|
|
12
12
|
data: Schema.Struct({ text: Schema.String }),
|
|
13
13
|
}).annotate({ identifier: "GenerateTextResponse" }),
|
|
14
|
-
error: [InvalidRequestError, ServiceUnavailableError],
|
|
14
|
+
error: [InvalidRequestError, ServiceUnavailableError, LocationNotFoundError],
|
|
15
15
|
}).annotateMerge(OpenApi.annotations({
|
|
16
16
|
identifier: "experimental.generate.text",
|
|
17
17
|
summary: "Generate text",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Context, Schema } from "effect";
|
|
2
2
|
import { HttpApiEndpoint, HttpApiGroup, HttpApiMiddleware, HttpApiSchema } from "effect/unstable/httpapi";
|
|
3
|
-
import { PermissionNotFoundError, SessionNotFoundError } from "../errors.js";
|
|
3
|
+
import { LocationNotFoundError, PermissionNotFoundError, SessionNotFoundError } from "../errors.js";
|
|
4
4
|
export declare const makePermissionGroup: <LocationId extends HttpApiMiddleware.AnyId, LocationService, SessionLocationId extends HttpApiMiddleware.AnyId, SessionLocationService>(locationMiddleware: Context.Key<LocationId, LocationService>, sessionLocationMiddleware: Context.Key<SessionLocationId, SessionLocationService>) => HttpApiGroup.HttpApiGroup<"server.permission", HttpApiEndpoint.HttpApiEndpoint<"permission.request.list", "GET", "/api/permission/request", never, Schema.toCodecStringTree<Schema.Struct<{
|
|
5
5
|
readonly location: Schema.optional<Schema.Struct<{
|
|
6
6
|
readonly directory: Schema.optional<Schema.String>;
|
|
@@ -114,7 +114,7 @@ export declare const makePermissionGroup: <LocationId extends HttpApiMiddleware.
|
|
|
114
114
|
create: (id?: string) => string & import("effect/Brand").Brand<"Permission.ID">;
|
|
115
115
|
};
|
|
116
116
|
}>>;
|
|
117
|
-
}>>, Schema.toCodecJson<typeof SessionNotFoundError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"session.permission.get", "GET", "/api/session/:sessionID/permission/:requestID", Schema.toCodecStringTree<Schema.Struct<{
|
|
117
|
+
}>>, Schema.toCodecJson<typeof LocationNotFoundError | typeof SessionNotFoundError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"session.permission.get", "GET", "/api/session/:sessionID/permission/:requestID", Schema.toCodecStringTree<Schema.Struct<{
|
|
118
118
|
sessionID: Schema.brand<Schema.String, "SessionID"> & {
|
|
119
119
|
create: () => string & import("effect/Brand").Brand<"SessionID">;
|
|
120
120
|
descending: (id?: string) => string & import("effect/Brand").Brand<"SessionID">;
|
|
@@ -6,7 +6,7 @@ import { Project } from "@opencode/schema/project";
|
|
|
6
6
|
import { Session } from "@opencode/schema/session";
|
|
7
7
|
import { Context, Schema } from "effect";
|
|
8
8
|
import { HttpApiEndpoint, HttpApiGroup, HttpApiMiddleware, HttpApiSchema, OpenApi } from "effect/unstable/httpapi";
|
|
9
|
-
import { PermissionNotFoundError, SessionNotFoundError } from "../errors.js";
|
|
9
|
+
import { LocationNotFoundError, PermissionNotFoundError, SessionNotFoundError } from "../errors.js";
|
|
10
10
|
import { LocationQuery, locationQueryOpenApi } from "./location.js";
|
|
11
11
|
export const makePermissionGroup = (locationMiddleware, sessionLocationMiddleware) => HttpApiGroup.make("server.permission")
|
|
12
12
|
.add(HttpApiEndpoint.get("permission.request.list", "/api/permission/request", {
|
|
@@ -62,7 +62,7 @@ export const makePermissionGroup = (locationMiddleware, sessionLocationMiddlewar
|
|
|
62
62
|
.add(HttpApiEndpoint.get("session.permission.list", "/api/session/:sessionID/permission", {
|
|
63
63
|
params: { sessionID: Session.ID },
|
|
64
64
|
success: Schema.Struct({ data: Schema.Array(Permission.Request) }),
|
|
65
|
-
error: SessionNotFoundError,
|
|
65
|
+
error: [SessionNotFoundError, LocationNotFoundError],
|
|
66
66
|
}).annotateMerge(OpenApi.annotations({
|
|
67
67
|
identifier: "session.permission.list",
|
|
68
68
|
summary: "List session permission requests",
|
package/dist/groups/session.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { InstructionEntry } from "@opencode/schema/instruction-entry";
|
|
|
3
3
|
import { Event } from "@opencode/schema/event";
|
|
4
4
|
import { Context, Effect, Schema } from "effect";
|
|
5
5
|
import { HttpApiEndpoint, HttpApiGroup, HttpApiMiddleware, HttpApiSchema } from "effect/unstable/httpapi";
|
|
6
|
-
import { ConflictError, CommandExecutionError, CommandNotFoundError, FormAlreadySettledError, FormInvalidAnswerError, FormNotFoundError, InvalidCursorError, InvalidRequestError, MessageNotFoundError, ServiceUnavailableError, SessionBusyError, SessionNotFoundError, SkillNotFoundError, UnknownError } from "../errors.js";
|
|
6
|
+
import { ConflictError, LocationNotFoundError, CommandExecutionError, CommandNotFoundError, FormAlreadySettledError, FormInvalidAnswerError, FormNotFoundError, InvalidCursorError, InvalidRequestError, MessageNotFoundError, ServiceUnavailableError, SessionBusyError, SessionNotFoundError, SkillNotFoundError, UnknownError } from "../errors.js";
|
|
7
7
|
declare const SessionsCursorInput: Schema.Union<readonly [Schema.Struct<{
|
|
8
8
|
readonly directory: Schema.brand<Schema.String, "AbsolutePath">;
|
|
9
9
|
readonly parentID: Schema.optional<Schema.Union<readonly [Schema.brand<Schema.String, "SessionID"> & {
|
|
@@ -4339,7 +4339,7 @@ export declare const makeSessionGroup: <I extends HttpApiMiddleware.AnyId, S, Fo
|
|
|
4339
4339
|
readonly deletions: Schema.Int;
|
|
4340
4340
|
readonly status: Schema.Literals<readonly ["added", "deleted", "modified"]>;
|
|
4341
4341
|
}>>;
|
|
4342
|
-
}>>, Schema.toCodecJson<typeof InvalidRequestError | typeof UnknownError | typeof SessionNotFoundError | typeof MessageNotFoundError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"session.inbox.list", "GET", "/api/session/:sessionID/inbox", Schema.toCodecStringTree<Schema.Struct<{
|
|
4342
|
+
}>>, Schema.toCodecJson<typeof LocationNotFoundError | typeof InvalidRequestError | typeof UnknownError | typeof SessionNotFoundError | typeof MessageNotFoundError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"session.inbox.list", "GET", "/api/session/:sessionID/inbox", Schema.toCodecStringTree<Schema.Struct<{
|
|
4343
4343
|
sessionID: Schema.brand<Schema.String, "SessionID"> & {
|
|
4344
4344
|
create: () => string & import("effect/Brand").Brand<"SessionID">;
|
|
4345
4345
|
descending: (id?: string) => string & import("effect/Brand").Brand<"SessionID">;
|
package/dist/groups/session.js
CHANGED
|
@@ -9,7 +9,7 @@ import { AbsolutePath, DateTimeUtcFromMillis, NonNegativeInt, PositiveInt, Relat
|
|
|
9
9
|
import { Event } from "@opencode/schema/event";
|
|
10
10
|
import { Context, Effect, Encoding, Result, Schema, SchemaGetter, Struct } from "effect";
|
|
11
11
|
import { HttpApiEndpoint, HttpApiGroup, HttpApiMiddleware, HttpApiSchema, OpenApi } from "effect/unstable/httpapi";
|
|
12
|
-
import { ConflictError, CommandExecutionError, CommandNotFoundError, FormAlreadySettledError, FormInvalidAnswerError, FormNotFoundError, InvalidCursorError, InvalidRequestError, MessageNotFoundError, ServiceUnavailableError, SessionBusyError, SessionNotFoundError, SkillNotFoundError, UnknownError, } from "../errors.js";
|
|
12
|
+
import { ConflictError, LocationNotFoundError, CommandExecutionError, CommandNotFoundError, FormAlreadySettledError, FormInvalidAnswerError, FormNotFoundError, InvalidCursorError, InvalidRequestError, MessageNotFoundError, ServiceUnavailableError, SessionBusyError, SessionNotFoundError, SkillNotFoundError, UnknownError, } from "../errors.js";
|
|
13
13
|
import { Agent } from "@opencode/schema/agent";
|
|
14
14
|
import { Skill } from "@opencode/schema/skill";
|
|
15
15
|
import { Model } from "@opencode/schema/model";
|
|
@@ -435,7 +435,7 @@ export const makeSessionGroup = (sessionLocationMiddleware, formLocationMiddlewa
|
|
|
435
435
|
}),
|
|
436
436
|
}),
|
|
437
437
|
success: Schema.Struct({ data: Schema.Array(FileDiff.Info) }),
|
|
438
|
-
error: [InvalidRequestError, MessageNotFoundError, SessionNotFoundError, UnknownError],
|
|
438
|
+
error: [InvalidRequestError, MessageNotFoundError, SessionNotFoundError, UnknownError, LocationNotFoundError],
|
|
439
439
|
}).annotateMerge(OpenApi.annotations({
|
|
440
440
|
identifier: "session.diff",
|
|
441
441
|
summary: "Diff session turns",
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/package.json",
|
|
3
3
|
"name": "@opencode/protocol",
|
|
4
|
-
"version": "0.0.0-dev-
|
|
4
|
+
"version": "0.0.0-dev-20485",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"repository": {
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"typecheck": "tsgo --noEmit"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@opencode/schema": "0.0.0-dev-
|
|
35
|
+
"@opencode/schema": "0.0.0-dev-20485",
|
|
36
36
|
"effect": "4.0.0-rc.112"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|