@opencode/protocol 2.0.5 → 2.0.6

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
@@ -23,7 +23,7 @@ import { PersistentPtyGroup } from "./groups/persistent-pty.js";
23
23
  import { ShellGroup } from "./groups/shell.js";
24
24
  import { ReferenceGroup } from "./groups/reference.js";
25
25
  import { Authorization } from "./middleware/authorization.js";
26
- import { LocationGroup } from "./groups/location.js";
26
+ import { makeLocationGroup } from "./groups/location.js";
27
27
  import { IntegrationGroup } from "./groups/integration.js";
28
28
  import { WebSearchGroup } from "./groups/websearch.js";
29
29
  import { McpGroup } from "./groups/mcp.js";
@@ -33,11 +33,12 @@ import { WorktreeGroup } from "./groups/worktree.js";
33
33
  import { VcsGroup } from "./groups/vcs.js";
34
34
  import { MigrationGroup } from "./groups/migration.js";
35
35
  import { ConfigGroup } from "./groups/config.js";
36
- type LocationGroups<LocationId extends HttpApiMiddleware.AnyId> = HttpApiGroup.AddMiddleware<typeof LocationGroup, LocationId> | HttpApiGroup.AddMiddleware<typeof AgentGroup, LocationId> | HttpApiGroup.AddMiddleware<typeof PluginGroup, LocationId> | HttpApiGroup.AddMiddleware<typeof ModelGroup, LocationId> | HttpApiGroup.AddMiddleware<typeof ProviderGroup, LocationId> | HttpApiGroup.AddMiddleware<typeof IntegrationGroup, LocationId> | HttpApiGroup.AddMiddleware<typeof WebSearchGroup, LocationId> | HttpApiGroup.AddMiddleware<typeof McpGroup, LocationId> | HttpApiGroup.AddMiddleware<typeof ProjectGroup, LocationId> | HttpApiGroup.AddMiddleware<typeof FileSystemGroup, LocationId> | HttpApiGroup.AddMiddleware<typeof CommandGroup, LocationId> | HttpApiGroup.AddMiddleware<typeof SkillGroup, LocationId> | HttpApiGroup.AddMiddleware<typeof RpcGroup, LocationId> | HttpApiGroup.AddMiddleware<typeof PtyGroup, LocationId> | HttpApiGroup.AddMiddleware<typeof ShellGroup, LocationId> | HttpApiGroup.AddMiddleware<typeof ReferenceGroup, LocationId> | HttpApiGroup.AddMiddleware<typeof VcsGroup, LocationId> | HttpApiGroup.AddMiddleware<typeof ConfigGroup, LocationId>;
36
+ type LocationGroups<LocationId extends HttpApiMiddleware.AnyId> = HttpApiGroup.AddMiddleware<typeof AgentGroup, LocationId> | HttpApiGroup.AddMiddleware<typeof PluginGroup, LocationId> | HttpApiGroup.AddMiddleware<typeof ModelGroup, LocationId> | HttpApiGroup.AddMiddleware<typeof ProviderGroup, LocationId> | HttpApiGroup.AddMiddleware<typeof IntegrationGroup, LocationId> | HttpApiGroup.AddMiddleware<typeof WebSearchGroup, LocationId> | HttpApiGroup.AddMiddleware<typeof McpGroup, LocationId> | HttpApiGroup.AddMiddleware<typeof ProjectGroup, LocationId> | HttpApiGroup.AddMiddleware<typeof FileSystemGroup, LocationId> | HttpApiGroup.AddMiddleware<typeof CommandGroup, LocationId> | HttpApiGroup.AddMiddleware<typeof SkillGroup, LocationId> | HttpApiGroup.AddMiddleware<typeof RpcGroup, LocationId> | HttpApiGroup.AddMiddleware<typeof PtyGroup, LocationId> | HttpApiGroup.AddMiddleware<typeof ShellGroup, LocationId> | HttpApiGroup.AddMiddleware<typeof ReferenceGroup, LocationId> | HttpApiGroup.AddMiddleware<typeof VcsGroup, LocationId> | HttpApiGroup.AddMiddleware<typeof ConfigGroup, LocationId>;
37
37
  type SessionGroups<SessionLocationId extends HttpApiMiddleware.AnyId, SessionLocationService, FormLocationId extends HttpApiMiddleware.AnyId, FormLocationService> = ReturnType<typeof makeSessionGroup<SessionLocationId, SessionLocationService, FormLocationId, FormLocationService>> | typeof MessageGroup;
38
38
  type FormGroups<LocationId extends HttpApiMiddleware.AnyId, LocationService> = ReturnType<typeof makeFormGroup<LocationId, LocationService>>;
39
+ type LocationGroup<LocationId extends HttpApiMiddleware.AnyId, LocationService> = ReturnType<typeof makeLocationGroup<LocationId, LocationService>>;
39
40
  type MixedMiddlewareGroups<LocationId extends HttpApiMiddleware.AnyId, LocationService, SessionLocationId extends HttpApiMiddleware.AnyId, SessionLocationService> = ReturnType<typeof makePermissionGroup<LocationId, LocationService, SessionLocationId, SessionLocationService>>;
40
- 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 WorktreeGroup | typeof GenerateGroup | typeof PersistentPtyGroup | typeof CredentialGroup | LocationGroups<LocationId> | FormGroups<LocationId, LocationService> | SessionGroups<SessionLocationId, SessionLocationService, FormLocationId, FormLocationService> | MixedMiddlewareGroups<LocationId, LocationService, SessionLocationId, SessionLocationService> | Event;
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 WorktreeGroup | typeof GenerateGroup | typeof PersistentPtyGroup | typeof CredentialGroup | LocationGroups<LocationId> | LocationGroup<LocationId, LocationService> | FormGroups<LocationId, LocationService> | SessionGroups<SessionLocationId, SessionLocationService, FormLocationId, FormLocationService> | MixedMiddlewareGroups<LocationId, LocationService, SessionLocationId, SessionLocationService> | Event;
41
42
  type EventGroupFor<Definitions extends ReadonlyArray<Definition>> = ReturnType<typeof makeEventGroup<Definitions>>;
42
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>>;
43
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
@@ -22,7 +22,7 @@ import { PersistentPtyGroup } from "./groups/persistent-pty.js";
22
22
  import { ShellGroup } from "./groups/shell.js";
23
23
  import { ReferenceGroup } from "./groups/reference.js";
24
24
  import { Authorization } from "./middleware/authorization.js";
25
- import { LocationGroup } from "./groups/location.js";
25
+ import { makeLocationGroup } from "./groups/location.js";
26
26
  import { IntegrationGroup } from "./groups/integration.js";
27
27
  import { WebSearchGroup } from "./groups/websearch.js";
28
28
  import { McpGroup } from "./groups/mcp.js";
@@ -35,7 +35,7 @@ import { ConfigGroup } from "./groups/config.js";
35
35
  // Protocol owns middleware placement, while Server injects concrete keys so Core service identities stay downstream.
36
36
  const makeApiFromGroup = (eventGroup, locationMiddleware, formLocationMiddleware, sessionLocationMiddleware) => HttpApi.make("server")
37
37
  .add(ServerGroup)
38
- .add(LocationGroup.middleware(locationMiddleware))
38
+ .add(makeLocationGroup(locationMiddleware))
39
39
  .add(AgentGroup.middleware(locationMiddleware))
40
40
  .add(PluginGroup.middleware(locationMiddleware))
41
41
  .add(makeSessionGroup(sessionLocationMiddleware, formLocationMiddleware))
package/dist/client.js CHANGED
@@ -45,4 +45,4 @@ export const groupNames = {
45
45
  "server.config": "config",
46
46
  };
47
47
  export const promiseOmitEndpoints = new Set(["pty.connect", "persistentPty.connect"]);
48
- export const effectOmitEndpoints = new Set(["fs.read", "pty.connect", "persistentPty.connect"]);
48
+ export const effectOmitEndpoints = new Set(["fs.read", "fs.write", "pty.connect", "persistentPty.connect"]);
@@ -48,6 +48,38 @@ export declare const makeEventGroup: <const Definitions extends ReadonlyArray<De
48
48
  } | undefined;
49
49
  }[]])[number]>, never, never, never>, false>;
50
50
  export declare const EventGroup: HttpApiGroup.HttpApiGroup<"server.event", HttpApiEndpoint.HttpApiEndpoint<"event.subscribe", "GET", "/api/event", never, never, never, never, HttpApiSchema.StreamSse<HttpApiSchema.SseEventFromData<Schema.Union<readonly [Schema.Struct<{
51
+ readonly id: Schema.brand<Schema.String, "Event.ID"> & {
52
+ create: () => string & import("effect/Brand").Brand<"Event.ID">;
53
+ };
54
+ readonly created: Schema.Finite;
55
+ readonly metadata: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Unknown>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Unknown>>, never, never>;
56
+ readonly type: Schema.Literal<"location.shutdown">;
57
+ readonly location: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
58
+ readonly directory: Schema.brand<Schema.String, "AbsolutePath">;
59
+ readonly workspaceID: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.String, "Workspace.ID"> & {
60
+ ascending: (id?: string) => string & import("effect/Brand").Brand<"Workspace.ID">;
61
+ create: () => string & import("effect/Brand").Brand<"Workspace.ID">;
62
+ }>>, Schema.optionalKey<Schema.brand<Schema.String, "Workspace.ID"> & {
63
+ ascending: (id?: string) => string & import("effect/Brand").Brand<"Workspace.ID">;
64
+ create: () => string & import("effect/Brand").Brand<"Workspace.ID">;
65
+ }>, never, never>;
66
+ }>>>, Schema.optionalKey<Schema.Struct<{
67
+ readonly directory: Schema.brand<Schema.String, "AbsolutePath">;
68
+ readonly workspaceID: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.String, "Workspace.ID"> & {
69
+ ascending: (id?: string) => string & import("effect/Brand").Brand<"Workspace.ID">;
70
+ create: () => string & import("effect/Brand").Brand<"Workspace.ID">;
71
+ }>>, Schema.optionalKey<Schema.brand<Schema.String, "Workspace.ID"> & {
72
+ ascending: (id?: string) => string & import("effect/Brand").Brand<"Workspace.ID">;
73
+ create: () => string & import("effect/Brand").Brand<"Workspace.ID">;
74
+ }>, never, never>;
75
+ }>>, never, never>;
76
+ readonly data: Schema.Struct<{}>;
77
+ }> & {
78
+ type: "location.shutdown";
79
+ durability: "ephemeral";
80
+ durable: undefined;
81
+ data: Schema.Struct<{}>;
82
+ }, Schema.Struct<{
51
83
  readonly id: Schema.brand<Schema.String, "Event.ID"> & {
52
84
  create: () => string & import("effect/Brand").Brand<"Event.ID">;
53
85
  };
@@ -8132,6 +8164,18 @@ export declare const EventGroup: HttpApiGroup.HttpApiGroup<"server.event", HttpA
8132
8164
  readonly metadata?: {
8133
8165
  readonly [x: string]: unknown;
8134
8166
  } | undefined;
8167
+ } | {
8168
+ readonly id: string & import("effect/Brand").Brand<"Event.ID">;
8169
+ readonly data: {};
8170
+ readonly type: "location.shutdown";
8171
+ readonly created: number;
8172
+ readonly location?: {
8173
+ readonly directory: string & import("effect/Brand").Brand<"AbsolutePath">;
8174
+ readonly workspaceID?: (string & import("effect/Brand").Brand<"Workspace.ID">) | undefined;
8175
+ } | undefined;
8176
+ readonly metadata?: {
8177
+ readonly [x: string]: unknown;
8178
+ } | undefined;
8135
8179
  } | {
8136
8180
  readonly id: string & import("effect/Brand").Brand<"Event.ID">;
8137
8181
  readonly data: {
@@ -8464,6 +8508,38 @@ export declare const EventGroup: HttpApiGroup.HttpApiGroup<"server.event", HttpA
8464
8508
  } | undefined;
8465
8509
  }>, never, never, never>, false>;
8466
8510
  export declare const OpenCodeEvent: Schema.Union<readonly [Schema.Struct<{
8511
+ readonly id: Schema.brand<Schema.String, "Event.ID"> & {
8512
+ create: () => string & import("effect/Brand").Brand<"Event.ID">;
8513
+ };
8514
+ readonly created: Schema.Finite;
8515
+ readonly metadata: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Unknown>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Unknown>>, never, never>;
8516
+ readonly type: Schema.Literal<"location.shutdown">;
8517
+ readonly location: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
8518
+ readonly directory: Schema.brand<Schema.String, "AbsolutePath">;
8519
+ readonly workspaceID: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.String, "Workspace.ID"> & {
8520
+ ascending: (id?: string) => string & import("effect/Brand").Brand<"Workspace.ID">;
8521
+ create: () => string & import("effect/Brand").Brand<"Workspace.ID">;
8522
+ }>>, Schema.optionalKey<Schema.brand<Schema.String, "Workspace.ID"> & {
8523
+ ascending: (id?: string) => string & import("effect/Brand").Brand<"Workspace.ID">;
8524
+ create: () => string & import("effect/Brand").Brand<"Workspace.ID">;
8525
+ }>, never, never>;
8526
+ }>>>, Schema.optionalKey<Schema.Struct<{
8527
+ readonly directory: Schema.brand<Schema.String, "AbsolutePath">;
8528
+ readonly workspaceID: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.String, "Workspace.ID"> & {
8529
+ ascending: (id?: string) => string & import("effect/Brand").Brand<"Workspace.ID">;
8530
+ create: () => string & import("effect/Brand").Brand<"Workspace.ID">;
8531
+ }>>, Schema.optionalKey<Schema.brand<Schema.String, "Workspace.ID"> & {
8532
+ ascending: (id?: string) => string & import("effect/Brand").Brand<"Workspace.ID">;
8533
+ create: () => string & import("effect/Brand").Brand<"Workspace.ID">;
8534
+ }>, never, never>;
8535
+ }>>, never, never>;
8536
+ readonly data: Schema.Struct<{}>;
8537
+ }> & {
8538
+ type: "location.shutdown";
8539
+ durability: "ephemeral";
8540
+ durable: undefined;
8541
+ data: Schema.Struct<{}>;
8542
+ }, Schema.Struct<{
8467
8543
  readonly id: Schema.brand<Schema.String, "Event.ID"> & {
8468
8544
  create: () => string & import("effect/Brand").Brand<"Event.ID">;
8469
8545
  };
@@ -33,4 +33,16 @@ export declare const FileSystemGroup: HttpApiGroup.HttpApiGroup<"server.fs", Htt
33
33
  readonly path: Schema.brand<Schema.String, "RelativePath">;
34
34
  readonly type: Schema.Literals<readonly ["file", "directory"]>;
35
35
  }>>;
36
+ }>>, never, never, never> | HttpApiEndpoint.HttpApiEndpoint<"fs.write", "POST", "/api/experimental/fs/write", never, Schema.toCodecStringTree<Schema.Struct<{
37
+ readonly path: Schema.String;
38
+ readonly location: Schema.optional<Schema.Struct<{
39
+ readonly directory: Schema.optional<Schema.String>;
40
+ }>>;
41
+ }>>, Schema.toCodecJson<Schema.Uint8Array>, never, Schema.toCodecJson<Schema.Struct<{
42
+ readonly location: Schema.Struct<{
43
+ readonly directory: Schema.brand<Schema.String, "AbsolutePath">;
44
+ }>;
45
+ readonly data: Schema.Struct<{
46
+ readonly path: Schema.brand<Schema.String, "AbsolutePath">;
47
+ }>;
36
48
  }>>, never, never, never>, false>;
package/dist/groups/fs.js CHANGED
@@ -11,6 +11,12 @@ const ListQuery = Schema.Struct({
11
11
  description: "An absolute path or a path relative to the requested location. Defaults to the location directory.",
12
12
  }),
13
13
  });
14
+ const WriteQuery = Schema.Struct({
15
+ ...LocationQuery.fields,
16
+ path: Schema.String.annotate({
17
+ description: "An absolute path or a path relative to the requested location. Missing parent directories are created.",
18
+ }),
19
+ });
14
20
  const FindQuery = Schema.Struct({
15
21
  ...LocationQuery.fields,
16
22
  query: FileSystem.FindInput.fields.query,
@@ -48,6 +54,17 @@ export const FileSystemGroup = HttpApiGroup.make("server.fs")
48
54
  identifier: "fs.find",
49
55
  summary: "Find files",
50
56
  description: "Find recursively ranked filesystem entries relative to the requested location.",
57
+ })))
58
+ .add(HttpApiEndpoint.post("fs.write", "/api/experimental/fs/write", {
59
+ query: WriteQuery,
60
+ payload: Schema.Uint8Array.pipe(HttpApiSchema.asUint8Array()),
61
+ success: Location.response(FileSystem.Write),
62
+ })
63
+ .annotateMerge(locationQueryOpenApi)
64
+ .annotateMerge(OpenApi.annotations({
65
+ identifier: "experimental.fs.write",
66
+ summary: "Write file",
67
+ description: "Write the raw request body to an absolute path or a path relative to the requested location, creating parent directories, and return the resolved absolute path. Unlike read, the target is not confined to the location. Experimental: may change without compatibility guarantees.",
51
68
  })))
52
69
  .annotateMerge(OpenApi.annotations({
53
70
  title: "filesystem",
@@ -1,12 +1,13 @@
1
- import { Schema } from "effect";
2
- import { HttpApiEndpoint, HttpApiGroup } from "effect/unstable/httpapi";
1
+ import { Context, Schema } from "effect";
2
+ import { HttpApiEndpoint, HttpApiGroup, HttpApiMiddleware, HttpApiSchema } from "effect/unstable/httpapi";
3
+ import { ServiceUnavailableError } from "../errors.js";
3
4
  export declare const LocationQuery: Schema.Struct<{
4
5
  readonly location: Schema.optional<Schema.Struct<{
5
6
  readonly directory: Schema.optional<Schema.String>;
6
7
  }>>;
7
8
  }>;
8
- export declare const locationQueryOpenApi: import("effect/Context").Context<never>;
9
- export declare const LocationGroup: HttpApiGroup.HttpApiGroup<"server.location", HttpApiEndpoint.HttpApiEndpoint<"location.get", "GET", "/api/location", never, Schema.toCodecStringTree<Schema.Struct<{
9
+ export declare const locationQueryOpenApi: Context.Context<never>;
10
+ export declare const makeLocationGroup: <LocationId extends HttpApiMiddleware.AnyId, LocationService>(locationMiddleware: Context.Key<LocationId, LocationService>) => HttpApiGroup.HttpApiGroup<"server.location", HttpApiEndpoint.HttpApiEndpoint<"location.get", "GET", "/api/location", never, Schema.toCodecStringTree<Schema.Struct<{
10
11
  readonly location: Schema.optional<Schema.Struct<{
11
12
  readonly directory: Schema.optional<Schema.String>;
12
13
  }>>;
@@ -19,4 +20,4 @@ export declare const LocationGroup: HttpApiGroup.HttpApiGroup<"server.location",
19
20
  readonly directory: Schema.brand<Schema.String, "AbsolutePath">;
20
21
  readonly canonical: Schema.brand<Schema.String, "AbsolutePath">;
21
22
  }>;
22
- }>>, never, never, never>, false>;
23
+ }>>, never, LocationId, HttpApiMiddleware.Requires<LocationId>> | HttpApiEndpoint.HttpApiEndpoint<"location.reload", "POST", "/api/location/reload", never, never, never, never, Schema.toCodecJson<HttpApiSchema.NoContent>, Schema.toCodecJson<typeof ServiceUnavailableError>, never, never>, false>;
@@ -1,6 +1,7 @@
1
1
  import { Location } from "@opencode/schema/location";
2
- import { Schema } from "effect";
3
- import { HttpApiEndpoint, HttpApiGroup, OpenApi } from "effect/unstable/httpapi";
2
+ import { Context, Schema } from "effect";
3
+ import { HttpApiEndpoint, HttpApiGroup, HttpApiMiddleware, HttpApiSchema, OpenApi } from "effect/unstable/httpapi";
4
+ import { ServiceUnavailableError } from "../errors.js";
4
5
  export const LocationQuery = Schema.Struct({
5
6
  location: Schema.optional(Schema.Struct({
6
7
  directory: Schema.optional(Schema.String),
@@ -19,15 +20,26 @@ export const locationQueryOpenApi = OpenApi.annotations({
19
20
  };
20
21
  },
21
22
  });
22
- export const LocationGroup = HttpApiGroup.make("server.location")
23
+ // Middleware is applied per endpoint: reload acts on every loaded location and
24
+ // must not boot the caller's location first.
25
+ export const makeLocationGroup = (locationMiddleware) => HttpApiGroup.make("server.location")
23
26
  .add(HttpApiEndpoint.get("location.get", "/api/location", {
24
27
  query: LocationQuery,
25
28
  success: Location.PublicInfo,
26
29
  })
30
+ .middleware(locationMiddleware)
27
31
  .annotateMerge(locationQueryOpenApi)
28
32
  .annotateMerge(OpenApi.annotations({
29
33
  identifier: "location.get",
30
34
  summary: "Get location",
31
35
  description: "Resolve the requested location or the server default location.",
36
+ })))
37
+ .add(HttpApiEndpoint.post("location.reload", "/api/location/reload", {
38
+ success: HttpApiSchema.NoContent,
39
+ error: ServiceUnavailableError,
40
+ }).annotateMerge(OpenApi.annotations({
41
+ identifier: "location.reload",
42
+ summary: "Reload locations",
43
+ description: "Shut down and rebuild every loaded location. Pending permissions and forms are cancelled; running sessions continue with fresh services at the next step boundary. Emits location.shutdown for client recovery and responds once all replacement builds settle.",
32
44
  })))
33
45
  .annotateMerge(OpenApi.annotations({ title: "location" }));
@@ -1,13 +1,19 @@
1
1
  import { Schema } from "effect";
2
2
  import { HttpApiEndpoint, HttpApiGroup } from "effect/unstable/httpapi";
3
- export declare const ServerStatus: Schema.Struct<{
3
+ export declare const ServerInfo: Schema.Struct<{
4
4
  readonly version: Schema.String;
5
5
  readonly pid: Schema.Int;
6
6
  readonly urls: Schema.$Array<Schema.String>;
7
+ readonly paths: Schema.Struct<{
8
+ readonly tmp: Schema.String;
9
+ }>;
7
10
  }>;
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<{
11
+ export type ServerInfo = typeof ServerInfo.Type;
12
+ export declare const ServerGroup: HttpApiGroup.HttpApiGroup<"server.server", HttpApiEndpoint.HttpApiEndpoint<"server.info", "GET", "/api/info", never, never, never, never, Schema.toCodecJson<Schema.Struct<{
10
13
  readonly version: Schema.String;
11
14
  readonly pid: Schema.Int;
12
15
  readonly urls: Schema.$Array<Schema.String>;
16
+ readonly paths: Schema.Struct<{
17
+ readonly tmp: Schema.String;
18
+ }>;
13
19
  }>>, never, never, never>, false>;
@@ -1,17 +1,20 @@
1
1
  import { Schema } from "effect";
2
2
  import { HttpApiEndpoint, HttpApiGroup, OpenApi } from "effect/unstable/httpapi";
3
- export const ServerStatus = Schema.Struct({
3
+ export const ServerInfo = Schema.Struct({
4
4
  version: Schema.String,
5
5
  // 0 means the runtime has no OS process identity (e.g. workerd).
6
6
  pid: Schema.Int.check(Schema.isGreaterThanOrEqualTo(0)),
7
7
  urls: Schema.Array(Schema.String),
8
- }).annotate({ identifier: "ServerStatus" });
8
+ paths: Schema.Struct({
9
+ tmp: Schema.String,
10
+ }),
11
+ }).annotate({ identifier: "ServerInfo" });
9
12
  export const ServerGroup = HttpApiGroup.make("server.server")
10
- .add(HttpApiEndpoint.get("server.status", "/api/status", {
11
- success: ServerStatus,
13
+ .add(HttpApiEndpoint.get("server.info", "/api/info", {
14
+ success: ServerInfo,
12
15
  }).annotateMerge(OpenApi.annotations({
13
- identifier: "server.status",
14
- summary: "Get server status",
15
- description: "Return the server identity, connection URLs, and readiness status.",
16
+ identifier: "server.info",
17
+ summary: "Get server info",
18
+ description: "Return the server identity, connection URLs, paths, and readiness status.",
16
19
  })))
17
20
  .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": "2.0.5",
4
+ "version": "2.0.6",
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": "2.0.5",
35
+ "@opencode/schema": "2.0.6",
36
36
  "effect": "4.0.0-rc.112"
37
37
  },
38
38
  "devDependencies": {