@opencode/protocol 0.0.0-dev-19555 → 0.0.0-dev-19559

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.
@@ -1,6 +1,7 @@
1
1
  import { Session } from "@opencode/schema/session";
2
2
  import { SessionMessage } from "@opencode/schema/session-message";
3
- import { Schema } from "effect";
3
+ import { Location } from "@opencode/schema/location";
4
+ import { Schema, Struct } from "effect";
4
5
  import { HttpApiEndpoint, HttpApiGroup, OpenApi } from "effect/unstable/httpapi";
5
6
  import { InvalidCursorError, SessionNotFoundError, UnknownError } from "../errors.js";
6
7
  export const SessionMessagesQuery = Schema.Struct({
@@ -28,12 +29,34 @@ export const SessionMessagesQuery = Schema.Struct({
28
29
  description: "Filter by message type before pagination. When omitted, all message types are returned. Pass the same type when following cursors.",
29
30
  }),
30
31
  }).annotate({ identifier: "SessionMessagesQuery" });
32
+ const PublicLocationSwitched = Schema.Struct({
33
+ ...Struct.omit(SessionMessage.LocationSwitched.fields, ["location", "previous"]),
34
+ location: Location.PublicRef,
35
+ previous: Schema.Struct({
36
+ location: Location.PublicRef,
37
+ projectID: SessionMessage.LocationSwitched.fields.projectID,
38
+ subpath: SessionMessage.LocationSwitched.fields.subpath,
39
+ }).pipe(Schema.optional),
40
+ }).annotate({ identifier: "Session.Message.LocationSwitched" });
41
+ export const PublicSessionMessage = Schema.Union([
42
+ SessionMessage.AgentSelected,
43
+ SessionMessage.ModelSelected,
44
+ PublicLocationSwitched,
45
+ SessionMessage.User,
46
+ SessionMessage.Synthetic,
47
+ SessionMessage.System,
48
+ SessionMessage.Skill,
49
+ SessionMessage.Shell,
50
+ SessionMessage.Assistant,
51
+ SessionMessage.Compaction,
52
+ SessionMessage.Idle,
53
+ ]).annotate({ identifier: "Session.Message.Info" });
31
54
  export const MessageGroup = HttpApiGroup.make("server.message")
32
55
  .add(HttpApiEndpoint.get("session.messages", "/api/session/:sessionID/message", {
33
56
  params: { sessionID: Session.ID },
34
57
  query: SessionMessagesQuery,
35
58
  success: Schema.Struct({
36
- data: Schema.Array(SessionMessage.Info),
59
+ data: Schema.Array(PublicSessionMessage),
37
60
  cursor: Schema.Struct({
38
61
  previous: Schema.String.pipe(Schema.optional),
39
62
  next: Schema.String.pipe(Schema.optional),
@@ -1,15 +1,15 @@
1
1
  import { Model } from "@opencode/schema/model";
2
- import { Location } from "@opencode/schema/location";
3
2
  import { Schema } from "effect";
4
3
  import { HttpApiEndpoint, HttpApiGroup } from "effect/unstable/httpapi";
5
4
  import { ServiceUnavailableError } from "../errors.js";
6
5
  export declare const ModelGroup: HttpApiGroup.HttpApiGroup<"server.model", HttpApiEndpoint.HttpApiEndpoint<"model.list", "GET", "/api/model", never, Schema.toCodecStringTree<Schema.Struct<{
7
6
  readonly location: Schema.optional<Schema.Struct<{
8
7
  readonly directory: Schema.optional<Schema.String>;
9
- readonly workspace: Schema.optional<Schema.String>;
10
8
  }>>;
11
9
  }>>, never, never, Schema.toCodecJson<Schema.Struct<{
12
- readonly location: typeof Location.Info;
10
+ readonly location: Schema.Struct<{
11
+ readonly directory: Schema.brand<Schema.String, "AbsolutePath">;
12
+ }>;
13
13
  readonly data: Schema.$Array<Schema.Struct<{
14
14
  readonly capabilities: Schema.Struct<{
15
15
  readonly tools: Schema.Boolean;
@@ -160,10 +160,11 @@ export declare const ModelGroup: HttpApiGroup.HttpApiGroup<"server.model", HttpA
160
160
  }>>, Schema.toCodecJson<typeof ServiceUnavailableError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"model.default", "GET", "/api/model/default", never, Schema.toCodecStringTree<Schema.Struct<{
161
161
  readonly location: Schema.optional<Schema.Struct<{
162
162
  readonly directory: Schema.optional<Schema.String>;
163
- readonly workspace: Schema.optional<Schema.String>;
164
163
  }>>;
165
164
  }>>, never, never, Schema.toCodecJson<Schema.Struct<{
166
- readonly location: typeof Location.Info;
165
+ readonly location: Schema.Struct<{
166
+ readonly directory: Schema.brand<Schema.String, "AbsolutePath">;
167
+ }>;
167
168
  readonly data: Schema.UndefinedOr<Schema.Struct<{
168
169
  readonly capabilities: Schema.Struct<{
169
170
  readonly tools: Schema.Boolean;
@@ -1,14 +1,14 @@
1
- import { Location } from "@opencode/schema/location";
2
1
  import { Context, Schema } from "effect";
3
2
  import { HttpApiEndpoint, HttpApiGroup, HttpApiMiddleware, HttpApiSchema } from "effect/unstable/httpapi";
4
3
  import { PermissionNotFoundError, SessionNotFoundError } from "../errors.js";
5
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<{
6
5
  readonly location: Schema.optional<Schema.Struct<{
7
6
  readonly directory: Schema.optional<Schema.String>;
8
- readonly workspace: Schema.optional<Schema.String>;
9
7
  }>>;
10
8
  }>>, never, never, Schema.toCodecJson<Schema.Struct<{
11
- readonly location: typeof Location.Info;
9
+ readonly location: Schema.Struct<{
10
+ readonly directory: Schema.brand<Schema.String, "AbsolutePath">;
11
+ }>;
12
12
  readonly data: Schema.$Array<Schema.Struct<{
13
13
  readonly sessionID: Schema.brand<Schema.String, "SessionID"> & {
14
14
  create: () => string & import("effect/Brand").Brand<"SessionID">;
@@ -1,14 +1,14 @@
1
- import { Location } from "@opencode/schema/location";
2
1
  import { Schema } from "effect";
3
2
  import { HttpApiEndpoint, HttpApiGroup, HttpApiSchema } from "effect/unstable/httpapi";
4
3
  import { InvalidRequestError, ServiceUnavailableError } from "../errors.js";
5
4
  export declare const PluginGroup: HttpApiGroup.HttpApiGroup<"server.plugin", HttpApiEndpoint.HttpApiEndpoint<"plugin.list", "GET", "/api/plugin", never, Schema.toCodecStringTree<Schema.Struct<{
6
5
  readonly location: Schema.optional<Schema.Struct<{
7
6
  readonly directory: Schema.optional<Schema.String>;
8
- readonly workspace: Schema.optional<Schema.String>;
9
7
  }>>;
10
8
  }>>, never, never, Schema.toCodecJson<Schema.Struct<{
11
- readonly location: typeof Location.Info;
9
+ readonly location: Schema.Struct<{
10
+ readonly directory: Schema.brand<Schema.String, "AbsolutePath">;
11
+ }>;
12
12
  readonly data: Schema.$Array<Schema.Struct<{
13
13
  readonly id: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.String, "Plugin.ID">>>, Schema.optionalKey<Schema.brand<Schema.String, "Plugin.ID">>, never, never>;
14
14
  readonly source: Schema.Union<readonly [Schema.Struct<{
@@ -41,17 +41,17 @@ export declare const PluginGroup: HttpApiGroup.HttpApiGroup<"server.plugin", Htt
41
41
  }>>, never, never, never> | HttpApiEndpoint.HttpApiEndpoint<"plugin.awaitActivation", "POST", "/api/plugin/await-activation", never, Schema.toCodecStringTree<Schema.Struct<{
42
42
  readonly location: Schema.optional<Schema.Struct<{
43
43
  readonly directory: Schema.optional<Schema.String>;
44
- readonly workspace: Schema.optional<Schema.String>;
45
44
  }>>;
46
45
  }>>, never, never, Schema.toCodecJson<HttpApiSchema.NoContent>, never, never, never> | HttpApiEndpoint.HttpApiEndpoint<"plugin.check", "POST", "/api/plugin/check", never, Schema.toCodecStringTree<Schema.Struct<{
47
46
  readonly location: Schema.optional<Schema.Struct<{
48
47
  readonly directory: Schema.optional<Schema.String>;
49
- readonly workspace: Schema.optional<Schema.String>;
50
48
  }>>;
51
49
  }>>, Schema.toCodecJson<Schema.Struct<{
52
50
  readonly target: Schema.optional<Schema.String>;
53
51
  }>>, never, Schema.toCodecJson<Schema.Struct<{
54
- readonly location: typeof Location.Info;
52
+ readonly location: Schema.Struct<{
53
+ readonly directory: Schema.brand<Schema.String, "AbsolutePath">;
54
+ }>;
55
55
  readonly data: Schema.$Array<Schema.Struct<{
56
56
  readonly id: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.String, "Plugin.ID">>>, Schema.optionalKey<Schema.brand<Schema.String, "Plugin.ID">>, never, never>;
57
57
  readonly source: Schema.Union<readonly [Schema.Struct<{
@@ -84,7 +84,6 @@ export declare const PluginGroup: HttpApiGroup.HttpApiGroup<"server.plugin", Htt
84
84
  }>>, Schema.toCodecJson<typeof InvalidRequestError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"plugin.update", "POST", "/api/plugin/update", never, Schema.toCodecStringTree<Schema.Struct<{
85
85
  readonly location: Schema.optional<Schema.Struct<{
86
86
  readonly directory: Schema.optional<Schema.String>;
87
- readonly workspace: Schema.optional<Schema.String>;
88
87
  }>>;
89
88
  }>>, Schema.toCodecJson<Schema.Struct<{
90
89
  readonly targets: Schema.$Array<Schema.String>;
@@ -25,7 +25,6 @@ export declare const ProjectGroup: HttpApiGroup.HttpApiGroup<"server.project", H
25
25
  readonly time: Schema.Struct<{
26
26
  readonly created: Schema.Int;
27
27
  readonly updated: Schema.Int;
28
- readonly initialized: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Int>>, Schema.optionalKey<Schema.Int>, never, never>;
29
28
  }>;
30
29
  readonly sandboxes: Schema.$Array<Schema.String>;
31
30
  }>>>, never, never, never> | HttpApiEndpoint.HttpApiEndpoint<"project.update", "PATCH", "/api/project/:projectID", Schema.toCodecStringTree<Schema.Struct<{
@@ -73,7 +72,6 @@ export declare const ProjectGroup: HttpApiGroup.HttpApiGroup<"server.project", H
73
72
  readonly time: Schema.Struct<{
74
73
  readonly created: Schema.Int;
75
74
  readonly updated: Schema.Int;
76
- readonly initialized: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Int>>, Schema.optionalKey<Schema.Int>, never, never>;
77
75
  }>;
78
76
  readonly sandboxes: Schema.$Array<Schema.String>;
79
77
  }>>, Schema.toCodecJson<typeof ProjectNotFoundError>, never, never>, false>;
@@ -1,15 +1,15 @@
1
1
  import { Provider } from "@opencode/schema/provider";
2
- import { Location } from "@opencode/schema/location";
3
2
  import { Schema } from "effect";
4
3
  import { HttpApiEndpoint, HttpApiGroup } from "effect/unstable/httpapi";
5
4
  import { ProviderNotFoundError, ServiceUnavailableError } from "../errors.js";
6
5
  export declare const ProviderGroup: HttpApiGroup.HttpApiGroup<"server.provider", HttpApiEndpoint.HttpApiEndpoint<"provider.list", "GET", "/api/provider", never, Schema.toCodecStringTree<Schema.Struct<{
7
6
  readonly location: Schema.optional<Schema.Struct<{
8
7
  readonly directory: Schema.optional<Schema.String>;
9
- readonly workspace: Schema.optional<Schema.String>;
10
8
  }>>;
11
9
  }>>, never, never, Schema.toCodecJson<Schema.Struct<{
12
- readonly location: typeof Location.Info;
10
+ readonly location: Schema.Struct<{
11
+ readonly directory: Schema.brand<Schema.String, "AbsolutePath">;
12
+ }>;
13
13
  readonly data: Schema.$Array<Schema.Struct<{
14
14
  readonly settings: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Any>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Any>>, never, never>;
15
15
  readonly headers: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.String>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.String>>, never, never>;
@@ -88,10 +88,11 @@ export declare const ProviderGroup: HttpApiGroup.HttpApiGroup<"server.provider",
88
88
  }>>, Schema.toCodecStringTree<Schema.Struct<{
89
89
  readonly location: Schema.optional<Schema.Struct<{
90
90
  readonly directory: Schema.optional<Schema.String>;
91
- readonly workspace: Schema.optional<Schema.String>;
92
91
  }>>;
93
92
  }>>, never, never, Schema.toCodecJson<Schema.Struct<{
94
- readonly location: typeof Location.Info;
93
+ readonly location: Schema.Struct<{
94
+ readonly directory: Schema.brand<Schema.String, "AbsolutePath">;
95
+ }>;
95
96
  readonly data: Schema.Struct<{
96
97
  readonly settings: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Any>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Any>>, never, never>;
97
98
  readonly headers: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.String>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.String>>, never, never>;
@@ -1,4 +1,3 @@
1
- import { Location } from "@opencode/schema/location";
2
1
  import { Schema } from "effect";
3
2
  import { HttpApiEndpoint, HttpApiGroup, HttpApiSchema } from "effect/unstable/httpapi";
4
3
  import { ForbiddenError, PtyNotFoundError } from "../errors.js";
@@ -9,10 +8,11 @@ export declare function hasPtyConnectTicketURL(url: URL): boolean;
9
8
  export declare const PtyGroup: HttpApiGroup.HttpApiGroup<"server.pty", HttpApiEndpoint.HttpApiEndpoint<"pty.list", "GET", "/api/pty", never, Schema.toCodecStringTree<Schema.Struct<{
10
9
  readonly location: Schema.optional<Schema.Struct<{
11
10
  readonly directory: Schema.optional<Schema.String>;
12
- readonly workspace: Schema.optional<Schema.String>;
13
11
  }>>;
14
12
  }>>, never, never, Schema.toCodecJson<Schema.Struct<{
15
- readonly location: typeof Location.Info;
13
+ readonly location: Schema.Struct<{
14
+ readonly directory: Schema.brand<Schema.String, "AbsolutePath">;
15
+ }>;
16
16
  readonly data: Schema.$Array<Schema.Struct<{
17
17
  readonly id: Schema.brand<Schema.String, "PtyID"> & {
18
18
  create: () => string & import("effect/Brand").Brand<"PtyID">;
@@ -29,7 +29,6 @@ export declare const PtyGroup: HttpApiGroup.HttpApiGroup<"server.pty", HttpApiEn
29
29
  }>>, never, never, never> | HttpApiEndpoint.HttpApiEndpoint<"pty.create", "POST", "/api/pty", never, Schema.toCodecStringTree<Schema.Struct<{
30
30
  readonly location: Schema.optional<Schema.Struct<{
31
31
  readonly directory: Schema.optional<Schema.String>;
32
- readonly workspace: Schema.optional<Schema.String>;
33
32
  }>>;
34
33
  }>>, Schema.toCodecJson<Schema.Struct<{
35
34
  readonly command: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
@@ -38,7 +37,9 @@ export declare const PtyGroup: HttpApiGroup.HttpApiGroup<"server.pty", HttpApiEn
38
37
  readonly title: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
39
38
  readonly env: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.String>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.String>>, never, never>;
40
39
  }>>, never, Schema.toCodecJson<Schema.Struct<{
41
- readonly location: typeof Location.Info;
40
+ readonly location: Schema.Struct<{
41
+ readonly directory: Schema.brand<Schema.String, "AbsolutePath">;
42
+ }>;
42
43
  readonly data: Schema.Struct<{
43
44
  readonly id: Schema.brand<Schema.String, "PtyID"> & {
44
45
  create: () => string & import("effect/Brand").Brand<"PtyID">;
@@ -60,10 +61,11 @@ export declare const PtyGroup: HttpApiGroup.HttpApiGroup<"server.pty", HttpApiEn
60
61
  }>>, Schema.toCodecStringTree<Schema.Struct<{
61
62
  readonly location: Schema.optional<Schema.Struct<{
62
63
  readonly directory: Schema.optional<Schema.String>;
63
- readonly workspace: Schema.optional<Schema.String>;
64
64
  }>>;
65
65
  }>>, never, never, Schema.toCodecJson<Schema.Struct<{
66
- readonly location: typeof Location.Info;
66
+ readonly location: Schema.Struct<{
67
+ readonly directory: Schema.brand<Schema.String, "AbsolutePath">;
68
+ }>;
67
69
  readonly data: Schema.Struct<{
68
70
  readonly id: Schema.brand<Schema.String, "PtyID"> & {
69
71
  create: () => string & import("effect/Brand").Brand<"PtyID">;
@@ -85,7 +87,6 @@ export declare const PtyGroup: HttpApiGroup.HttpApiGroup<"server.pty", HttpApiEn
85
87
  }>>, Schema.toCodecStringTree<Schema.Struct<{
86
88
  readonly location: Schema.optional<Schema.Struct<{
87
89
  readonly directory: Schema.optional<Schema.String>;
88
- readonly workspace: Schema.optional<Schema.String>;
89
90
  }>>;
90
91
  }>>, Schema.toCodecJson<Schema.Struct<{
91
92
  readonly title: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
@@ -97,7 +98,9 @@ export declare const PtyGroup: HttpApiGroup.HttpApiGroup<"server.pty", HttpApiEn
97
98
  readonly cols: Schema.Int;
98
99
  }>>, never, never>;
99
100
  }>>, never, Schema.toCodecJson<Schema.Struct<{
100
- readonly location: typeof Location.Info;
101
+ readonly location: Schema.Struct<{
102
+ readonly directory: Schema.brand<Schema.String, "AbsolutePath">;
103
+ }>;
101
104
  readonly data: Schema.Struct<{
102
105
  readonly id: Schema.brand<Schema.String, "PtyID"> & {
103
106
  create: () => string & import("effect/Brand").Brand<"PtyID">;
@@ -119,7 +122,6 @@ export declare const PtyGroup: HttpApiGroup.HttpApiGroup<"server.pty", HttpApiEn
119
122
  }>>, Schema.toCodecStringTree<Schema.Struct<{
120
123
  readonly location: Schema.optional<Schema.Struct<{
121
124
  readonly directory: Schema.optional<Schema.String>;
122
- readonly workspace: Schema.optional<Schema.String>;
123
125
  }>>;
124
126
  }>>, never, never, Schema.toCodecJson<HttpApiSchema.NoContent>, Schema.toCodecJson<typeof PtyNotFoundError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"pty.connectToken", "POST", "/api/pty/:ptyID/connect-token", Schema.toCodecStringTree<Schema.Struct<{
125
127
  ptyID: Schema.brand<Schema.String, "PtyID"> & {
@@ -129,12 +131,13 @@ export declare const PtyGroup: HttpApiGroup.HttpApiGroup<"server.pty", HttpApiEn
129
131
  }>>, Schema.toCodecStringTree<Schema.Struct<{
130
132
  readonly location: Schema.optional<Schema.Struct<{
131
133
  readonly directory: Schema.optional<Schema.String>;
132
- readonly workspace: Schema.optional<Schema.String>;
133
134
  }>>;
134
135
  }>>, never, Schema.toCodecStringTree<Schema.Struct<{
135
136
  readonly "x-opencode-ticket": Schema.optional<Schema.String>;
136
137
  }>>, Schema.toCodecJson<Schema.Struct<{
137
- readonly location: typeof Location.Info;
138
+ readonly location: Schema.Struct<{
139
+ readonly directory: Schema.brand<Schema.String, "AbsolutePath">;
140
+ }>;
138
141
  readonly data: Schema.Struct<{
139
142
  readonly ticket: Schema.String;
140
143
  readonly expires_in: Schema.Int;
@@ -102,7 +102,7 @@ HttpApiEndpoint.get("pty.connect", "/api/pty/:ptyID/connect", {
102
102
  "x-websocket": true,
103
103
  parameters: [
104
104
  ...(operation.parameters ?? []),
105
- ...["location[directory]", "location[workspace]", "cursor", PTY_CONNECT_TICKET_QUERY].map((name) => ({
105
+ ...["location[directory]", "cursor", PTY_CONNECT_TICKET_QUERY].map((name) => ({
106
106
  in: "query",
107
107
  name,
108
108
  schema: { type: "string" },
@@ -1,13 +1,13 @@
1
- import { Location } from "@opencode/schema/location";
2
1
  import { Schema } from "effect";
3
2
  import { HttpApiEndpoint, HttpApiGroup } from "effect/unstable/httpapi";
4
3
  export declare const ReferenceGroup: HttpApiGroup.HttpApiGroup<"server.reference", HttpApiEndpoint.HttpApiEndpoint<"reference.list", "GET", "/api/reference", never, Schema.toCodecStringTree<Schema.Struct<{
5
4
  readonly location: Schema.optional<Schema.Struct<{
6
5
  readonly directory: Schema.optional<Schema.String>;
7
- readonly workspace: Schema.optional<Schema.String>;
8
6
  }>>;
9
7
  }>>, never, never, Schema.toCodecJson<Schema.Struct<{
10
- readonly location: typeof Location.Info;
8
+ readonly location: Schema.Struct<{
9
+ readonly directory: Schema.brand<Schema.String, "AbsolutePath">;
10
+ }>;
11
11
  readonly data: Schema.$Array<Schema.Struct<{
12
12
  readonly name: Schema.String;
13
13
  readonly path: Schema.brand<Schema.String, "AbsolutePath">;
@@ -13,7 +13,6 @@ export declare const RpcGroup: HttpApiGroup.HttpApiGroup<"server.rpc", HttpApiEn
13
13
  }>>, Schema.toCodecStringTree<Schema.Struct<{
14
14
  readonly location: Schema.optional<Schema.Struct<{
15
15
  readonly directory: Schema.optional<Schema.String>;
16
- readonly workspace: Schema.optional<Schema.String>;
17
16
  }>>;
18
17
  }>>, Schema.toCodecJson<Schema.Struct<{
19
18
  readonly input: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Unknown>>, Schema.optionalKey<Schema.Unknown>, never, never>;