@opencode/protocol 0.0.0-dev-19552 → 0.0.0-dev-19553
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 +1 -2
- package/dist/api.js +0 -2
- package/dist/client.d.ts +0 -1
- package/dist/client.js +0 -1
- package/dist/groups/server.d.ts +9 -1
- package/dist/groups/server.js +11 -5
- package/package.json +2 -2
- package/dist/groups/health.d.ts +0 -15
- package/dist/groups/health.js +0 -20
package/dist/api.d.ts
CHANGED
|
@@ -16,7 +16,6 @@ import { EventGroup, makeEventGroup } from "./groups/event.js";
|
|
|
16
16
|
import type { Definition } from "@opencode/schema/event";
|
|
17
17
|
import { AgentGroup } from "./groups/agent.js";
|
|
18
18
|
import { PluginGroup } from "./groups/plugin.js";
|
|
19
|
-
import { HealthGroup } from "./groups/health.js";
|
|
20
19
|
import { ServerGroup } from "./groups/server.js";
|
|
21
20
|
import { DebugGroup } from "./groups/debug.js";
|
|
22
21
|
import { PtyGroup } from "./groups/pty.js";
|
|
@@ -39,7 +38,7 @@ type LocationGroups<LocationId extends HttpApiMiddleware.AnyId> = HttpApiGroup.A
|
|
|
39
38
|
type SessionGroups<SessionLocationId extends HttpApiMiddleware.AnyId, SessionLocationService> = ReturnType<typeof makeSessionGroup<SessionLocationId, SessionLocationService>> | typeof MessageGroup;
|
|
40
39
|
type FormGroups<LocationId extends HttpApiMiddleware.AnyId, LocationService, FormLocationId extends HttpApiMiddleware.AnyId, FormLocationService> = ReturnType<typeof makeFormGroup<LocationId, LocationService, FormLocationId, FormLocationService>>;
|
|
41
40
|
type MixedMiddlewareGroups<LocationId extends HttpApiMiddleware.AnyId, LocationService, SessionLocationId extends HttpApiMiddleware.AnyId, SessionLocationService> = ReturnType<typeof makePermissionGroup<LocationId, LocationService, SessionLocationId, SessionLocationService>>;
|
|
42
|
-
type ApiGroups<LocationId extends HttpApiMiddleware.AnyId, LocationService, FormLocationId extends HttpApiMiddleware.AnyId, FormLocationService, SessionLocationId extends HttpApiMiddleware.AnyId, SessionLocationService, Event extends HttpApiGroup.Constraint> = typeof
|
|
41
|
+
type ApiGroups<LocationId extends HttpApiMiddleware.AnyId, LocationService, FormLocationId extends HttpApiMiddleware.AnyId, FormLocationService, SessionLocationId extends HttpApiMiddleware.AnyId, SessionLocationService, Event extends HttpApiGroup.Constraint> = typeof ServerGroup | typeof DebugGroup | typeof MigrationGroup | typeof WorkspaceGroup | typeof GenerateGroup | typeof PersistentPtyGroup | LocationGroups<LocationId> | FormGroups<LocationId, LocationService, FormLocationId, FormLocationService> | SessionGroups<SessionLocationId, SessionLocationService> | MixedMiddlewareGroups<LocationId, LocationService, SessionLocationId, SessionLocationService> | Event;
|
|
43
42
|
type EventGroupFor<Definitions extends ReadonlyArray<Definition>> = ReturnType<typeof makeEventGroup<Definitions>>;
|
|
44
43
|
export type Api<LocationId extends HttpApiMiddleware.AnyId, LocationService, FormLocationId extends HttpApiMiddleware.AnyId, FormLocationService, SessionLocationId extends HttpApiMiddleware.AnyId, SessionLocationService, Event extends HttpApiGroup.Constraint> = HttpApi.HttpApi<"server", HttpApiGroup.AddMiddleware<HttpApiGroup.AddMiddleware<ApiGroups<LocationId, LocationService, FormLocationId, FormLocationService, SessionLocationId, SessionLocationService, Event>, Authorization>, SchemaErrorMiddleware>>;
|
|
45
44
|
export declare const makeApi: <const Definitions extends ReadonlyArray<Definition>, LocationId extends HttpApiMiddleware.AnyId, LocationService, FormLocationId extends HttpApiMiddleware.AnyId, FormLocationService, SessionLocationId extends HttpApiMiddleware.AnyId, SessionLocationService>(options: {
|
package/dist/api.js
CHANGED
|
@@ -15,7 +15,6 @@ import { RpcGroup } from "./groups/rpc.js";
|
|
|
15
15
|
import { EventGroup, makeEventGroup } from "./groups/event.js";
|
|
16
16
|
import { AgentGroup } from "./groups/agent.js";
|
|
17
17
|
import { PluginGroup } from "./groups/plugin.js";
|
|
18
|
-
import { HealthGroup } from "./groups/health.js";
|
|
19
18
|
import { ServerGroup } from "./groups/server.js";
|
|
20
19
|
import { DebugGroup } from "./groups/debug.js";
|
|
21
20
|
import { PtyGroup } from "./groups/pty.js";
|
|
@@ -36,7 +35,6 @@ import { ConfigGroup } from "./groups/config.js";
|
|
|
36
35
|
import { WorkspaceGroup } from "./groups/workspace.js";
|
|
37
36
|
// Protocol owns middleware placement, while Server injects concrete keys so Core service identities stay downstream.
|
|
38
37
|
const makeApiFromGroup = (eventGroup, locationMiddleware, formLocationMiddleware, sessionLocationMiddleware) => HttpApi.make("server")
|
|
39
|
-
.add(HealthGroup)
|
|
40
38
|
.add(ServerGroup)
|
|
41
39
|
.add(LocationGroup.middleware(locationMiddleware))
|
|
42
40
|
.add(AgentGroup.middleware(locationMiddleware))
|
package/dist/client.d.ts
CHANGED
|
@@ -26,7 +26,6 @@ declare class SessionLocationMiddleware extends SessionLocationMiddleware_base {
|
|
|
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>;
|
|
27
27
|
export declare const ClientApi: ClientApiShape;
|
|
28
28
|
export declare const groupNames: {
|
|
29
|
-
readonly "server.health": "health";
|
|
30
29
|
readonly "server.server": "server";
|
|
31
30
|
readonly "server.debug": "debug";
|
|
32
31
|
readonly "server.migration": "migration";
|
package/dist/client.js
CHANGED
package/dist/groups/server.d.ts
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
import { Schema } from "effect";
|
|
2
2
|
import { HttpApiEndpoint, HttpApiGroup } from "effect/unstable/httpapi";
|
|
3
|
-
export declare const
|
|
3
|
+
export declare const ServerStatus: Schema.Struct<{
|
|
4
|
+
readonly version: Schema.String;
|
|
5
|
+
readonly pid: Schema.Int;
|
|
6
|
+
readonly urls: Schema.$Array<Schema.String>;
|
|
7
|
+
}>;
|
|
8
|
+
export type ServerStatus = typeof ServerStatus.Type;
|
|
9
|
+
export declare const ServerGroup: HttpApiGroup.HttpApiGroup<"server.server", HttpApiEndpoint.HttpApiEndpoint<"server.status", "GET", "/api/status", never, never, never, never, Schema.toCodecJson<Schema.Struct<{
|
|
10
|
+
readonly version: Schema.String;
|
|
11
|
+
readonly pid: Schema.Int;
|
|
4
12
|
readonly urls: Schema.$Array<Schema.String>;
|
|
5
13
|
}>>, never, never, never>, false>;
|
package/dist/groups/server.js
CHANGED
|
@@ -1,11 +1,17 @@
|
|
|
1
1
|
import { Schema } from "effect";
|
|
2
2
|
import { HttpApiEndpoint, HttpApiGroup, OpenApi } from "effect/unstable/httpapi";
|
|
3
|
+
export const ServerStatus = Schema.Struct({
|
|
4
|
+
version: Schema.String,
|
|
5
|
+
// 0 means the runtime has no OS process identity (e.g. workerd).
|
|
6
|
+
pid: Schema.Int.check(Schema.isGreaterThanOrEqualTo(0)),
|
|
7
|
+
urls: Schema.Array(Schema.String),
|
|
8
|
+
}).annotate({ identifier: "ServerStatus" });
|
|
3
9
|
export const ServerGroup = HttpApiGroup.make("server.server")
|
|
4
|
-
.add(HttpApiEndpoint.get("server.
|
|
5
|
-
success:
|
|
10
|
+
.add(HttpApiEndpoint.get("server.status", "/api/status", {
|
|
11
|
+
success: ServerStatus,
|
|
6
12
|
}).annotateMerge(OpenApi.annotations({
|
|
7
|
-
identifier: "server.
|
|
8
|
-
summary: "Get server
|
|
9
|
-
description: "Return the
|
|
13
|
+
identifier: "server.status",
|
|
14
|
+
summary: "Get server status",
|
|
15
|
+
description: "Return the server identity, connection URLs, and readiness status.",
|
|
10
16
|
})))
|
|
11
17
|
.annotateMerge(OpenApi.annotations({ title: "server" }));
|
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-19553",
|
|
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-19553",
|
|
36
36
|
"effect": "4.0.0-rc.112"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
package/dist/groups/health.d.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { Schema } from "effect";
|
|
2
|
-
import { HttpApiEndpoint, HttpApiGroup } from "effect/unstable/httpapi";
|
|
3
|
-
export declare namespace ServiceStatus {
|
|
4
|
-
const Health: Schema.Struct<{
|
|
5
|
-
readonly healthy: Schema.Literal<true>;
|
|
6
|
-
readonly version: Schema.String;
|
|
7
|
-
readonly pid: Schema.Int;
|
|
8
|
-
}>;
|
|
9
|
-
type Health = typeof Health.Type;
|
|
10
|
-
}
|
|
11
|
-
export declare const HealthGroup: HttpApiGroup.HttpApiGroup<"server.health", HttpApiEndpoint.HttpApiEndpoint<"health.get", "GET", "/api/health", never, never, never, never, Schema.toCodecJson<Schema.Struct<{
|
|
12
|
-
readonly healthy: Schema.Literal<true>;
|
|
13
|
-
readonly version: Schema.String;
|
|
14
|
-
readonly pid: Schema.Int;
|
|
15
|
-
}>>, never, never, never>, false>;
|
package/dist/groups/health.js
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { Schema } from "effect";
|
|
2
|
-
import { HttpApiEndpoint, HttpApiGroup, OpenApi } from "effect/unstable/httpapi";
|
|
3
|
-
export var ServiceStatus;
|
|
4
|
-
(function (ServiceStatus) {
|
|
5
|
-
ServiceStatus.Health = Schema.Struct({
|
|
6
|
-
healthy: Schema.Literal(true),
|
|
7
|
-
version: Schema.String,
|
|
8
|
-
// 0 means the runtime has no OS process identity (e.g. workerd).
|
|
9
|
-
pid: Schema.Int.check(Schema.isGreaterThanOrEqualTo(0)),
|
|
10
|
-
}).annotate({ identifier: "ServiceHealth" });
|
|
11
|
-
})(ServiceStatus || (ServiceStatus = {}));
|
|
12
|
-
export const HealthGroup = HttpApiGroup.make("server.health")
|
|
13
|
-
.add(HttpApiEndpoint.get("health.get", "/api/health", {
|
|
14
|
-
success: ServiceStatus.Health,
|
|
15
|
-
}).annotateMerge(OpenApi.annotations({
|
|
16
|
-
identifier: "health.get",
|
|
17
|
-
summary: "Check server health",
|
|
18
|
-
description: "Report the owning server process and its application status.",
|
|
19
|
-
})))
|
|
20
|
-
.annotateMerge(OpenApi.annotations({ title: "health" }));
|