@opencode-ai/protocol 0.0.0-next-15154 → 0.0.0-next-15159

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 CHANGED
@@ -16,6 +16,7 @@ import type { Definition } from "@opencode-ai/schema/event";
16
16
  import { AgentGroup } from "./groups/agent.js";
17
17
  import { PluginGroup } from "./groups/plugin.js";
18
18
  import { HealthGroup } from "./groups/health.js";
19
+ import { ServerGroup } from "./groups/server.js";
19
20
  import { DebugGroup } from "./groups/debug.js";
20
21
  import { PtyGroup } from "./groups/pty.js";
21
22
  import { ShellGroup } from "./groups/shell.js";
@@ -33,7 +34,7 @@ type LocationGroups<LocationId extends HttpApiMiddleware.AnyId> = HttpApiGroup.A
33
34
  type SessionGroups<SessionLocationId extends HttpApiMiddleware.AnyId, SessionLocationService> = ReturnType<typeof makeSessionGroup<SessionLocationId, SessionLocationService>> | HttpApiGroup.AddMiddleware<typeof MessageGroup, SessionLocationId>;
34
35
  type FormGroups<LocationId extends HttpApiMiddleware.AnyId, LocationService, FormLocationId extends HttpApiMiddleware.AnyId, FormLocationService> = ReturnType<typeof makeFormGroup<LocationId, LocationService, FormLocationId, FormLocationService>>;
35
36
  type MixedMiddlewareGroups<LocationId extends HttpApiMiddleware.AnyId, LocationService, SessionLocationId extends HttpApiMiddleware.AnyId, SessionLocationService> = ReturnType<typeof makePermissionGroup<LocationId, LocationService, SessionLocationId, SessionLocationService>> | ReturnType<typeof makeQuestionGroup<LocationId, LocationService, SessionLocationId, SessionLocationService>>;
36
- type ApiGroups<LocationId extends HttpApiMiddleware.AnyId, LocationService, FormLocationId extends HttpApiMiddleware.AnyId, FormLocationService, SessionLocationId extends HttpApiMiddleware.AnyId, SessionLocationService, Event extends HttpApiGroup.Any> = typeof HealthGroup | typeof DebugGroup | LocationGroups<LocationId> | FormGroups<LocationId, LocationService, FormLocationId, FormLocationService> | SessionGroups<SessionLocationId, SessionLocationService> | MixedMiddlewareGroups<LocationId, LocationService, SessionLocationId, SessionLocationService> | Event;
37
+ type ApiGroups<LocationId extends HttpApiMiddleware.AnyId, LocationService, FormLocationId extends HttpApiMiddleware.AnyId, FormLocationService, SessionLocationId extends HttpApiMiddleware.AnyId, SessionLocationService, Event extends HttpApiGroup.Any> = typeof HealthGroup | typeof ServerGroup | typeof DebugGroup | LocationGroups<LocationId> | FormGroups<LocationId, LocationService, FormLocationId, FormLocationService> | SessionGroups<SessionLocationId, SessionLocationService> | MixedMiddlewareGroups<LocationId, LocationService, SessionLocationId, SessionLocationService> | Event;
37
38
  type EventGroupFor<Definitions extends ReadonlyArray<Definition>> = ReturnType<typeof makeEventGroup<Definitions>>;
38
39
  export type Api<LocationId extends HttpApiMiddleware.AnyId, LocationService, FormLocationId extends HttpApiMiddleware.AnyId, FormLocationService, SessionLocationId extends HttpApiMiddleware.AnyId, SessionLocationService, Event extends HttpApiGroup.Any> = HttpApi.HttpApi<"server", HttpApiGroup.AddMiddleware<HttpApiGroup.AddMiddleware<ApiGroups<LocationId, LocationService, FormLocationId, FormLocationService, SessionLocationId, SessionLocationService, Event>, Authorization>, SchemaErrorMiddleware>>;
39
40
  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,6 +15,7 @@ import { EventGroup, makeEventGroup } from "./groups/event.js";
15
15
  import { AgentGroup } from "./groups/agent.js";
16
16
  import { PluginGroup } from "./groups/plugin.js";
17
17
  import { HealthGroup } from "./groups/health.js";
18
+ import { ServerGroup } from "./groups/server.js";
18
19
  import { DebugGroup } from "./groups/debug.js";
19
20
  import { PtyGroup } from "./groups/pty.js";
20
21
  import { ShellGroup } from "./groups/shell.js";
@@ -31,6 +32,7 @@ import { VcsGroup } from "./groups/vcs.js";
31
32
  // Protocol owns middleware placement, while Server injects concrete keys so Core service identities stay downstream.
32
33
  const makeApiFromGroup = (eventGroup, locationMiddleware, formLocationMiddleware, sessionLocationMiddleware) => HttpApi.make("server")
33
34
  .add(HealthGroup)
35
+ .add(ServerGroup)
34
36
  .add(LocationGroup.middleware(locationMiddleware))
35
37
  .add(AgentGroup.middleware(locationMiddleware))
36
38
  .add(PluginGroup.middleware(locationMiddleware))
package/dist/client.d.ts CHANGED
@@ -27,6 +27,7 @@ type ClientApiShape = Api<Context.Service.Identifier<typeof LocationMiddleware>,
27
27
  export declare const ClientApi: ClientApiShape;
28
28
  export declare const groupNames: {
29
29
  readonly "server.health": "health";
30
+ readonly "server.server": "server";
30
31
  readonly "server.debug": "debug";
31
32
  readonly "server.location": "location";
32
33
  readonly "server.agent": "agent";
package/dist/client.js CHANGED
@@ -14,6 +14,7 @@ export const ClientApi = makeDefaultApi({
14
14
  });
15
15
  export const groupNames = {
16
16
  "server.health": "health",
17
+ "server.server": "server",
17
18
  "server.debug": "debug",
18
19
  "server.location": "location",
19
20
  "server.agent": "agent",
@@ -0,0 +1,5 @@
1
+ import { Schema } from "effect";
2
+ import { HttpApiEndpoint, HttpApiGroup } from "effect/unstable/httpapi";
3
+ export declare const ServerGroup: HttpApiGroup.HttpApiGroup<"server.server", HttpApiEndpoint.HttpApiEndpoint<"server.get", "GET", "/api/server", HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<Schema.Struct<{
4
+ readonly urls: Schema.$Array<Schema.String>;
5
+ }>>, HttpApiEndpoint.Json<never>, never, never>, false>;
@@ -0,0 +1,11 @@
1
+ import { Schema } from "effect";
2
+ import { HttpApiEndpoint, HttpApiGroup, OpenApi } from "effect/unstable/httpapi";
3
+ export const ServerGroup = HttpApiGroup.make("server.server")
4
+ .add(HttpApiEndpoint.get("server.get", "/api/server", {
5
+ success: Schema.Struct({ urls: Schema.Array(Schema.String) }),
6
+ }).annotateMerge(OpenApi.annotations({
7
+ identifier: "v2.server.get",
8
+ summary: "Get server information",
9
+ description: "Return the URLs that can be used to connect to this server.",
10
+ })))
11
+ .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-ai/protocol",
4
- "version": "0.0.0-next-15154",
4
+ "version": "0.0.0-next-15159",
5
5
  "type": "module",
6
6
  "license": "MIT",
7
7
  "repository": {
@@ -26,7 +26,7 @@
26
26
  "typecheck": "tsgo --noEmit"
27
27
  },
28
28
  "dependencies": {
29
- "@opencode-ai/schema": "0.0.0-next-15154",
29
+ "@opencode-ai/schema": "0.0.0-next-15159",
30
30
  "effect": "4.0.0-beta.83"
31
31
  },
32
32
  "devDependencies": {