@opencode/schema 0.0.0-dev-1227 → 0.0.0-dev-1229
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/event-manifest.d.ts +136 -0
- package/dist/event-manifest.js +1 -1
- package/dist/mcp-event.d.ts +188 -0
- package/dist/mcp-event.js +26 -1
- package/dist/mcp.d.ts +21 -0
- package/dist/mcp.js +15 -0
- package/package.json +1 -1
package/dist/event-manifest.d.ts
CHANGED
|
@@ -6436,6 +6436,56 @@ export declare const ServerDefinitions: readonly [Schema.Struct<{
|
|
|
6436
6436
|
data: Schema.Struct<{
|
|
6437
6437
|
readonly server: Schema.String;
|
|
6438
6438
|
}>;
|
|
6439
|
+
}, Schema.Struct<{
|
|
6440
|
+
readonly id: Schema.brand<Schema.String, "Event.ID"> & {
|
|
6441
|
+
create: () => string & import("effect/Brand").Brand<"Event.ID">;
|
|
6442
|
+
};
|
|
6443
|
+
readonly created: Schema.Finite;
|
|
6444
|
+
readonly metadata: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Unknown>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Unknown>>, never, never>;
|
|
6445
|
+
readonly type: Schema.Literal<"experimental.mcp.event">;
|
|
6446
|
+
readonly location: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
|
|
6447
|
+
readonly directory: Schema.brand<Schema.String, "AbsolutePath">;
|
|
6448
|
+
readonly workspaceID: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.String, "Workspace.ID"> & {
|
|
6449
|
+
ascending: (id?: string) => string & import("effect/Brand").Brand<"Workspace.ID">;
|
|
6450
|
+
create: () => string & import("effect/Brand").Brand<"Workspace.ID">;
|
|
6451
|
+
}>>, Schema.optionalKey<Schema.brand<Schema.String, "Workspace.ID"> & {
|
|
6452
|
+
ascending: (id?: string) => string & import("effect/Brand").Brand<"Workspace.ID">;
|
|
6453
|
+
create: () => string & import("effect/Brand").Brand<"Workspace.ID">;
|
|
6454
|
+
}>, never, never>;
|
|
6455
|
+
}>>>, Schema.optionalKey<Schema.Struct<{
|
|
6456
|
+
readonly directory: Schema.brand<Schema.String, "AbsolutePath">;
|
|
6457
|
+
readonly workspaceID: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.String, "Workspace.ID"> & {
|
|
6458
|
+
ascending: (id?: string) => string & import("effect/Brand").Brand<"Workspace.ID">;
|
|
6459
|
+
create: () => string & import("effect/Brand").Brand<"Workspace.ID">;
|
|
6460
|
+
}>>, Schema.optionalKey<Schema.brand<Schema.String, "Workspace.ID"> & {
|
|
6461
|
+
ascending: (id?: string) => string & import("effect/Brand").Brand<"Workspace.ID">;
|
|
6462
|
+
create: () => string & import("effect/Brand").Brand<"Workspace.ID">;
|
|
6463
|
+
}>, never, never>;
|
|
6464
|
+
}>>, never, never>;
|
|
6465
|
+
readonly data: Schema.Struct<{
|
|
6466
|
+
readonly id: Schema.String;
|
|
6467
|
+
readonly server: Schema.String;
|
|
6468
|
+
readonly name: Schema.String;
|
|
6469
|
+
readonly eventId: Schema.String;
|
|
6470
|
+
readonly timestamp: Schema.String;
|
|
6471
|
+
readonly data: Schema.Codec<Schema.Json, Schema.Json, never, never>;
|
|
6472
|
+
readonly cursor: Schema.NullOr<Schema.String>;
|
|
6473
|
+
readonly truncated: Schema.optional<Schema.Boolean>;
|
|
6474
|
+
}>;
|
|
6475
|
+
}> & {
|
|
6476
|
+
type: "experimental.mcp.event";
|
|
6477
|
+
durability: "ephemeral";
|
|
6478
|
+
durable: undefined;
|
|
6479
|
+
data: Schema.Struct<{
|
|
6480
|
+
readonly id: Schema.String;
|
|
6481
|
+
readonly server: Schema.String;
|
|
6482
|
+
readonly name: Schema.String;
|
|
6483
|
+
readonly eventId: Schema.String;
|
|
6484
|
+
readonly timestamp: Schema.String;
|
|
6485
|
+
readonly data: Schema.Codec<Schema.Json, Schema.Json, never, never>;
|
|
6486
|
+
readonly cursor: Schema.NullOr<Schema.String>;
|
|
6487
|
+
readonly truncated: Schema.optional<Schema.Boolean>;
|
|
6488
|
+
}>;
|
|
6439
6489
|
}];
|
|
6440
6490
|
export declare const Server: ReadonlyMap<string, Event.Definition<string, Schema.Codec<unknown, unknown, never, never>>>;
|
|
6441
6491
|
export type ServerEvent = Schema.Schema.Type<(typeof ServerDefinitions)[number]>;
|
|
@@ -12778,6 +12828,92 @@ export declare const Definitions: readonly [Schema.Struct<{
|
|
|
12778
12828
|
data: Schema.Struct<{
|
|
12779
12829
|
readonly server: Schema.String;
|
|
12780
12830
|
}>;
|
|
12831
|
+
}, Schema.Struct<{
|
|
12832
|
+
readonly id: Schema.brand<Schema.String, "Event.ID"> & {
|
|
12833
|
+
create: () => string & import("effect/Brand").Brand<"Event.ID">;
|
|
12834
|
+
};
|
|
12835
|
+
readonly created: Schema.Finite;
|
|
12836
|
+
readonly metadata: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Unknown>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Unknown>>, never, never>;
|
|
12837
|
+
readonly type: Schema.Literal<"experimental.mcp.event">;
|
|
12838
|
+
readonly location: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
|
|
12839
|
+
readonly directory: Schema.brand<Schema.String, "AbsolutePath">;
|
|
12840
|
+
readonly workspaceID: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.String, "Workspace.ID"> & {
|
|
12841
|
+
ascending: (id?: string) => string & import("effect/Brand").Brand<"Workspace.ID">;
|
|
12842
|
+
create: () => string & import("effect/Brand").Brand<"Workspace.ID">;
|
|
12843
|
+
}>>, Schema.optionalKey<Schema.brand<Schema.String, "Workspace.ID"> & {
|
|
12844
|
+
ascending: (id?: string) => string & import("effect/Brand").Brand<"Workspace.ID">;
|
|
12845
|
+
create: () => string & import("effect/Brand").Brand<"Workspace.ID">;
|
|
12846
|
+
}>, never, never>;
|
|
12847
|
+
}>>>, Schema.optionalKey<Schema.Struct<{
|
|
12848
|
+
readonly directory: Schema.brand<Schema.String, "AbsolutePath">;
|
|
12849
|
+
readonly workspaceID: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.String, "Workspace.ID"> & {
|
|
12850
|
+
ascending: (id?: string) => string & import("effect/Brand").Brand<"Workspace.ID">;
|
|
12851
|
+
create: () => string & import("effect/Brand").Brand<"Workspace.ID">;
|
|
12852
|
+
}>>, Schema.optionalKey<Schema.brand<Schema.String, "Workspace.ID"> & {
|
|
12853
|
+
ascending: (id?: string) => string & import("effect/Brand").Brand<"Workspace.ID">;
|
|
12854
|
+
create: () => string & import("effect/Brand").Brand<"Workspace.ID">;
|
|
12855
|
+
}>, never, never>;
|
|
12856
|
+
}>>, never, never>;
|
|
12857
|
+
readonly data: Schema.Struct<{
|
|
12858
|
+
readonly id: Schema.String;
|
|
12859
|
+
readonly server: Schema.String;
|
|
12860
|
+
readonly name: Schema.String;
|
|
12861
|
+
readonly eventId: Schema.String;
|
|
12862
|
+
readonly timestamp: Schema.String;
|
|
12863
|
+
readonly data: Schema.Codec<Schema.Json, Schema.Json, never, never>;
|
|
12864
|
+
readonly cursor: Schema.NullOr<Schema.String>;
|
|
12865
|
+
readonly truncated: Schema.optional<Schema.Boolean>;
|
|
12866
|
+
}>;
|
|
12867
|
+
}> & {
|
|
12868
|
+
type: "experimental.mcp.event";
|
|
12869
|
+
durability: "ephemeral";
|
|
12870
|
+
durable: undefined;
|
|
12871
|
+
data: Schema.Struct<{
|
|
12872
|
+
readonly id: Schema.String;
|
|
12873
|
+
readonly server: Schema.String;
|
|
12874
|
+
readonly name: Schema.String;
|
|
12875
|
+
readonly eventId: Schema.String;
|
|
12876
|
+
readonly timestamp: Schema.String;
|
|
12877
|
+
readonly data: Schema.Codec<Schema.Json, Schema.Json, never, never>;
|
|
12878
|
+
readonly cursor: Schema.NullOr<Schema.String>;
|
|
12879
|
+
readonly truncated: Schema.optional<Schema.Boolean>;
|
|
12880
|
+
}>;
|
|
12881
|
+
}, Schema.Struct<{
|
|
12882
|
+
readonly id: Schema.brand<Schema.String, "Event.ID"> & {
|
|
12883
|
+
create: () => string & import("effect/Brand").Brand<"Event.ID">;
|
|
12884
|
+
};
|
|
12885
|
+
readonly created: Schema.Finite;
|
|
12886
|
+
readonly metadata: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Unknown>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Unknown>>, never, never>;
|
|
12887
|
+
readonly type: Schema.Literal<"experimental.mcp.subscription.changed">;
|
|
12888
|
+
readonly location: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
|
|
12889
|
+
readonly directory: Schema.brand<Schema.String, "AbsolutePath">;
|
|
12890
|
+
readonly workspaceID: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.String, "Workspace.ID"> & {
|
|
12891
|
+
ascending: (id?: string) => string & import("effect/Brand").Brand<"Workspace.ID">;
|
|
12892
|
+
create: () => string & import("effect/Brand").Brand<"Workspace.ID">;
|
|
12893
|
+
}>>, Schema.optionalKey<Schema.brand<Schema.String, "Workspace.ID"> & {
|
|
12894
|
+
ascending: (id?: string) => string & import("effect/Brand").Brand<"Workspace.ID">;
|
|
12895
|
+
create: () => string & import("effect/Brand").Brand<"Workspace.ID">;
|
|
12896
|
+
}>, never, never>;
|
|
12897
|
+
}>>>, Schema.optionalKey<Schema.Struct<{
|
|
12898
|
+
readonly directory: Schema.brand<Schema.String, "AbsolutePath">;
|
|
12899
|
+
readonly workspaceID: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.String, "Workspace.ID"> & {
|
|
12900
|
+
ascending: (id?: string) => string & import("effect/Brand").Brand<"Workspace.ID">;
|
|
12901
|
+
create: () => string & import("effect/Brand").Brand<"Workspace.ID">;
|
|
12902
|
+
}>>, Schema.optionalKey<Schema.brand<Schema.String, "Workspace.ID"> & {
|
|
12903
|
+
ascending: (id?: string) => string & import("effect/Brand").Brand<"Workspace.ID">;
|
|
12904
|
+
create: () => string & import("effect/Brand").Brand<"Workspace.ID">;
|
|
12905
|
+
}>, never, never>;
|
|
12906
|
+
}>>, never, never>;
|
|
12907
|
+
readonly data: Schema.Struct<{
|
|
12908
|
+
readonly id: Schema.String;
|
|
12909
|
+
}>;
|
|
12910
|
+
}> & {
|
|
12911
|
+
type: "experimental.mcp.subscription.changed";
|
|
12912
|
+
durability: "ephemeral";
|
|
12913
|
+
durable: undefined;
|
|
12914
|
+
data: Schema.Struct<{
|
|
12915
|
+
readonly id: Schema.String;
|
|
12916
|
+
}>;
|
|
12781
12917
|
}, Schema.Struct<{
|
|
12782
12918
|
readonly id: Schema.brand<Schema.String, "Event.ID"> & {
|
|
12783
12919
|
create: () => string & import("effect/Brand").Brand<"Event.ID">;
|
package/dist/event-manifest.js
CHANGED
|
@@ -41,7 +41,7 @@ const foundationDefinitions = Event.inventory(...LocationEvent.Definitions, ...M
|
|
|
41
41
|
const featureDefinitions = Event.inventory(...FileSystem.Event.Definitions, ...Reference.Event.Definitions, ...Permission.Event.Definitions, ...Plugin.Event.Definitions, ...Project.Event.Definitions, ...Worktree.Event.Definitions, ...Command.Event.Definitions, ...Config.Event.Definitions, ...Skill.Event.Definitions, ...Pty.Event.Definitions, ...PersistentPty.Event.Definitions, ...Shell.Event.Definitions, ...Form.Event.Definitions, ...WebSearch.Event.Definitions, ...Artifact.Event.Definitions);
|
|
42
42
|
export const ServerDefinitions = Event.inventory(...foundationDefinitions, ...featureDefinitions,
|
|
43
43
|
// Current events the TUI consumes from the public stream.
|
|
44
|
-
...SessionStatusEvent.Definitions, ...TuiEvent.Definitions, ...InstallationEvent.Definitions, ...VcsEvent.Definitions, McpEvent.StatusChanged, McpEvent.ResourcesChanged);
|
|
44
|
+
...SessionStatusEvent.Definitions, ...TuiEvent.Definitions, ...InstallationEvent.Definitions, ...VcsEvent.Definitions, McpEvent.StatusChanged, McpEvent.ResourcesChanged, McpEvent.ExperimentalEvent);
|
|
45
45
|
export const Server = Event.latest(ServerDefinitions);
|
|
46
46
|
export const isServer = (event) => Server.has(event.type);
|
|
47
47
|
export const Definitions = Event.inventory(...foundationDefinitions, ...InstallationEvent.Definitions, ...featureDefinitions, ...LspEvent.Definitions, ...TuiEvent.Definitions, ...McpEvent.Definitions, ...LegacyEventV1.Definitions, ...FileSystemV1.Event.Definitions, ...SessionStatusEvent.Definitions, ...VcsEvent.Definitions, ...WorkspaceEvent.Definitions, ...WorktreeEvent.Definitions, ...ServerEvent.Definitions);
|
package/dist/mcp-event.d.ts
CHANGED
|
@@ -111,6 +111,102 @@ export declare const StatusChanged: Schema.Struct<{
|
|
|
111
111
|
readonly server: Schema.String;
|
|
112
112
|
}>;
|
|
113
113
|
};
|
|
114
|
+
/** One event from an MCP Events subscription. Delivery is at least once: dedupe on `id` and `eventId`. */
|
|
115
|
+
export declare const ExperimentalEvent: Schema.Struct<{
|
|
116
|
+
readonly id: Schema.brand<Schema.String, "Event.ID"> & {
|
|
117
|
+
create: () => string & import("effect/Brand").Brand<"Event.ID">;
|
|
118
|
+
};
|
|
119
|
+
readonly created: Schema.Finite;
|
|
120
|
+
readonly metadata: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Unknown>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Unknown>>, never, never>;
|
|
121
|
+
readonly type: Schema.Literal<"experimental.mcp.event">;
|
|
122
|
+
readonly location: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
|
|
123
|
+
readonly directory: Schema.brand<Schema.String, "AbsolutePath">;
|
|
124
|
+
readonly workspaceID: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.String, "Workspace.ID"> & {
|
|
125
|
+
ascending: (id?: string) => string & import("effect/Brand").Brand<"Workspace.ID">;
|
|
126
|
+
create: () => string & import("effect/Brand").Brand<"Workspace.ID">;
|
|
127
|
+
}>>, Schema.optionalKey<Schema.brand<Schema.String, "Workspace.ID"> & {
|
|
128
|
+
ascending: (id?: string) => string & import("effect/Brand").Brand<"Workspace.ID">;
|
|
129
|
+
create: () => string & import("effect/Brand").Brand<"Workspace.ID">;
|
|
130
|
+
}>, never, never>;
|
|
131
|
+
}>>>, Schema.optionalKey<Schema.Struct<{
|
|
132
|
+
readonly directory: Schema.brand<Schema.String, "AbsolutePath">;
|
|
133
|
+
readonly workspaceID: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.String, "Workspace.ID"> & {
|
|
134
|
+
ascending: (id?: string) => string & import("effect/Brand").Brand<"Workspace.ID">;
|
|
135
|
+
create: () => string & import("effect/Brand").Brand<"Workspace.ID">;
|
|
136
|
+
}>>, Schema.optionalKey<Schema.brand<Schema.String, "Workspace.ID"> & {
|
|
137
|
+
ascending: (id?: string) => string & import("effect/Brand").Brand<"Workspace.ID">;
|
|
138
|
+
create: () => string & import("effect/Brand").Brand<"Workspace.ID">;
|
|
139
|
+
}>, never, never>;
|
|
140
|
+
}>>, never, never>;
|
|
141
|
+
readonly data: Schema.Struct<{
|
|
142
|
+
/** The subscription that received it. */
|
|
143
|
+
readonly id: Schema.String;
|
|
144
|
+
readonly server: Schema.String;
|
|
145
|
+
readonly name: Schema.String;
|
|
146
|
+
readonly eventId: Schema.String;
|
|
147
|
+
readonly timestamp: Schema.String;
|
|
148
|
+
readonly data: Schema.Codec<Schema.Json, Schema.Json, never, never>;
|
|
149
|
+
/** Where the subscription resumes from after this event; null when the event type has no replay. */
|
|
150
|
+
readonly cursor: Schema.NullOr<Schema.String>;
|
|
151
|
+
/** The server skipped events before this one, which it could not replay. */
|
|
152
|
+
readonly truncated: Schema.optional<Schema.Boolean>;
|
|
153
|
+
}>;
|
|
154
|
+
}> & {
|
|
155
|
+
type: "experimental.mcp.event";
|
|
156
|
+
durability: "ephemeral";
|
|
157
|
+
durable: undefined;
|
|
158
|
+
data: Schema.Struct<{
|
|
159
|
+
/** The subscription that received it. */
|
|
160
|
+
readonly id: Schema.String;
|
|
161
|
+
readonly server: Schema.String;
|
|
162
|
+
readonly name: Schema.String;
|
|
163
|
+
readonly eventId: Schema.String;
|
|
164
|
+
readonly timestamp: Schema.String;
|
|
165
|
+
readonly data: Schema.Codec<Schema.Json, Schema.Json, never, never>;
|
|
166
|
+
/** Where the subscription resumes from after this event; null when the event type has no replay. */
|
|
167
|
+
readonly cursor: Schema.NullOr<Schema.String>;
|
|
168
|
+
/** The server skipped events before this one, which it could not replay. */
|
|
169
|
+
readonly truncated: Schema.optional<Schema.Boolean>;
|
|
170
|
+
}>;
|
|
171
|
+
};
|
|
172
|
+
/** A subscription's status changed; read it with the MCP service's `subscriptions`. */
|
|
173
|
+
export declare const ExperimentalSubscriptionChanged: Schema.Struct<{
|
|
174
|
+
readonly id: Schema.brand<Schema.String, "Event.ID"> & {
|
|
175
|
+
create: () => string & import("effect/Brand").Brand<"Event.ID">;
|
|
176
|
+
};
|
|
177
|
+
readonly created: Schema.Finite;
|
|
178
|
+
readonly metadata: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Unknown>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Unknown>>, never, never>;
|
|
179
|
+
readonly type: Schema.Literal<"experimental.mcp.subscription.changed">;
|
|
180
|
+
readonly location: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
|
|
181
|
+
readonly directory: Schema.brand<Schema.String, "AbsolutePath">;
|
|
182
|
+
readonly workspaceID: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.String, "Workspace.ID"> & {
|
|
183
|
+
ascending: (id?: string) => string & import("effect/Brand").Brand<"Workspace.ID">;
|
|
184
|
+
create: () => string & import("effect/Brand").Brand<"Workspace.ID">;
|
|
185
|
+
}>>, Schema.optionalKey<Schema.brand<Schema.String, "Workspace.ID"> & {
|
|
186
|
+
ascending: (id?: string) => string & import("effect/Brand").Brand<"Workspace.ID">;
|
|
187
|
+
create: () => string & import("effect/Brand").Brand<"Workspace.ID">;
|
|
188
|
+
}>, never, never>;
|
|
189
|
+
}>>>, Schema.optionalKey<Schema.Struct<{
|
|
190
|
+
readonly directory: Schema.brand<Schema.String, "AbsolutePath">;
|
|
191
|
+
readonly workspaceID: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.String, "Workspace.ID"> & {
|
|
192
|
+
ascending: (id?: string) => string & import("effect/Brand").Brand<"Workspace.ID">;
|
|
193
|
+
create: () => string & import("effect/Brand").Brand<"Workspace.ID">;
|
|
194
|
+
}>>, Schema.optionalKey<Schema.brand<Schema.String, "Workspace.ID"> & {
|
|
195
|
+
ascending: (id?: string) => string & import("effect/Brand").Brand<"Workspace.ID">;
|
|
196
|
+
create: () => string & import("effect/Brand").Brand<"Workspace.ID">;
|
|
197
|
+
}>, never, never>;
|
|
198
|
+
}>>, never, never>;
|
|
199
|
+
readonly data: Schema.Struct<{
|
|
200
|
+
readonly id: Schema.String;
|
|
201
|
+
}>;
|
|
202
|
+
}> & {
|
|
203
|
+
type: "experimental.mcp.subscription.changed";
|
|
204
|
+
durability: "ephemeral";
|
|
205
|
+
durable: undefined;
|
|
206
|
+
data: Schema.Struct<{
|
|
207
|
+
readonly id: Schema.String;
|
|
208
|
+
}>;
|
|
209
|
+
};
|
|
114
210
|
export declare const Definitions: readonly [Schema.Struct<{
|
|
115
211
|
readonly id: Schema.brand<Schema.String, "Event.ID"> & {
|
|
116
212
|
create: () => string & import("effect/Brand").Brand<"Event.ID">;
|
|
@@ -219,4 +315,96 @@ export declare const Definitions: readonly [Schema.Struct<{
|
|
|
219
315
|
data: Schema.Struct<{
|
|
220
316
|
readonly server: Schema.String;
|
|
221
317
|
}>;
|
|
318
|
+
}, Schema.Struct<{
|
|
319
|
+
readonly id: Schema.brand<Schema.String, "Event.ID"> & {
|
|
320
|
+
create: () => string & import("effect/Brand").Brand<"Event.ID">;
|
|
321
|
+
};
|
|
322
|
+
readonly created: Schema.Finite;
|
|
323
|
+
readonly metadata: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Unknown>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Unknown>>, never, never>;
|
|
324
|
+
readonly type: Schema.Literal<"experimental.mcp.event">;
|
|
325
|
+
readonly location: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
|
|
326
|
+
readonly directory: Schema.brand<Schema.String, "AbsolutePath">;
|
|
327
|
+
readonly workspaceID: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.String, "Workspace.ID"> & {
|
|
328
|
+
ascending: (id?: string) => string & import("effect/Brand").Brand<"Workspace.ID">;
|
|
329
|
+
create: () => string & import("effect/Brand").Brand<"Workspace.ID">;
|
|
330
|
+
}>>, Schema.optionalKey<Schema.brand<Schema.String, "Workspace.ID"> & {
|
|
331
|
+
ascending: (id?: string) => string & import("effect/Brand").Brand<"Workspace.ID">;
|
|
332
|
+
create: () => string & import("effect/Brand").Brand<"Workspace.ID">;
|
|
333
|
+
}>, never, never>;
|
|
334
|
+
}>>>, Schema.optionalKey<Schema.Struct<{
|
|
335
|
+
readonly directory: Schema.brand<Schema.String, "AbsolutePath">;
|
|
336
|
+
readonly workspaceID: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.String, "Workspace.ID"> & {
|
|
337
|
+
ascending: (id?: string) => string & import("effect/Brand").Brand<"Workspace.ID">;
|
|
338
|
+
create: () => string & import("effect/Brand").Brand<"Workspace.ID">;
|
|
339
|
+
}>>, Schema.optionalKey<Schema.brand<Schema.String, "Workspace.ID"> & {
|
|
340
|
+
ascending: (id?: string) => string & import("effect/Brand").Brand<"Workspace.ID">;
|
|
341
|
+
create: () => string & import("effect/Brand").Brand<"Workspace.ID">;
|
|
342
|
+
}>, never, never>;
|
|
343
|
+
}>>, never, never>;
|
|
344
|
+
readonly data: Schema.Struct<{
|
|
345
|
+
/** The subscription that received it. */
|
|
346
|
+
readonly id: Schema.String;
|
|
347
|
+
readonly server: Schema.String;
|
|
348
|
+
readonly name: Schema.String;
|
|
349
|
+
readonly eventId: Schema.String;
|
|
350
|
+
readonly timestamp: Schema.String;
|
|
351
|
+
readonly data: Schema.Codec<Schema.Json, Schema.Json, never, never>;
|
|
352
|
+
/** Where the subscription resumes from after this event; null when the event type has no replay. */
|
|
353
|
+
readonly cursor: Schema.NullOr<Schema.String>;
|
|
354
|
+
/** The server skipped events before this one, which it could not replay. */
|
|
355
|
+
readonly truncated: Schema.optional<Schema.Boolean>;
|
|
356
|
+
}>;
|
|
357
|
+
}> & {
|
|
358
|
+
type: "experimental.mcp.event";
|
|
359
|
+
durability: "ephemeral";
|
|
360
|
+
durable: undefined;
|
|
361
|
+
data: Schema.Struct<{
|
|
362
|
+
/** The subscription that received it. */
|
|
363
|
+
readonly id: Schema.String;
|
|
364
|
+
readonly server: Schema.String;
|
|
365
|
+
readonly name: Schema.String;
|
|
366
|
+
readonly eventId: Schema.String;
|
|
367
|
+
readonly timestamp: Schema.String;
|
|
368
|
+
readonly data: Schema.Codec<Schema.Json, Schema.Json, never, never>;
|
|
369
|
+
/** Where the subscription resumes from after this event; null when the event type has no replay. */
|
|
370
|
+
readonly cursor: Schema.NullOr<Schema.String>;
|
|
371
|
+
/** The server skipped events before this one, which it could not replay. */
|
|
372
|
+
readonly truncated: Schema.optional<Schema.Boolean>;
|
|
373
|
+
}>;
|
|
374
|
+
}, Schema.Struct<{
|
|
375
|
+
readonly id: Schema.brand<Schema.String, "Event.ID"> & {
|
|
376
|
+
create: () => string & import("effect/Brand").Brand<"Event.ID">;
|
|
377
|
+
};
|
|
378
|
+
readonly created: Schema.Finite;
|
|
379
|
+
readonly metadata: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Unknown>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Unknown>>, never, never>;
|
|
380
|
+
readonly type: Schema.Literal<"experimental.mcp.subscription.changed">;
|
|
381
|
+
readonly location: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
|
|
382
|
+
readonly directory: Schema.brand<Schema.String, "AbsolutePath">;
|
|
383
|
+
readonly workspaceID: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.String, "Workspace.ID"> & {
|
|
384
|
+
ascending: (id?: string) => string & import("effect/Brand").Brand<"Workspace.ID">;
|
|
385
|
+
create: () => string & import("effect/Brand").Brand<"Workspace.ID">;
|
|
386
|
+
}>>, Schema.optionalKey<Schema.brand<Schema.String, "Workspace.ID"> & {
|
|
387
|
+
ascending: (id?: string) => string & import("effect/Brand").Brand<"Workspace.ID">;
|
|
388
|
+
create: () => string & import("effect/Brand").Brand<"Workspace.ID">;
|
|
389
|
+
}>, never, never>;
|
|
390
|
+
}>>>, Schema.optionalKey<Schema.Struct<{
|
|
391
|
+
readonly directory: Schema.brand<Schema.String, "AbsolutePath">;
|
|
392
|
+
readonly workspaceID: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.String, "Workspace.ID"> & {
|
|
393
|
+
ascending: (id?: string) => string & import("effect/Brand").Brand<"Workspace.ID">;
|
|
394
|
+
create: () => string & import("effect/Brand").Brand<"Workspace.ID">;
|
|
395
|
+
}>>, Schema.optionalKey<Schema.brand<Schema.String, "Workspace.ID"> & {
|
|
396
|
+
ascending: (id?: string) => string & import("effect/Brand").Brand<"Workspace.ID">;
|
|
397
|
+
create: () => string & import("effect/Brand").Brand<"Workspace.ID">;
|
|
398
|
+
}>, never, never>;
|
|
399
|
+
}>>, never, never>;
|
|
400
|
+
readonly data: Schema.Struct<{
|
|
401
|
+
readonly id: Schema.String;
|
|
402
|
+
}>;
|
|
403
|
+
}> & {
|
|
404
|
+
type: "experimental.mcp.subscription.changed";
|
|
405
|
+
durability: "ephemeral";
|
|
406
|
+
durable: undefined;
|
|
407
|
+
data: Schema.Struct<{
|
|
408
|
+
readonly id: Schema.String;
|
|
409
|
+
}>;
|
|
222
410
|
}];
|
package/dist/mcp-event.js
CHANGED
|
@@ -21,4 +21,29 @@ export const StatusChanged = Event.ephemeral({
|
|
|
21
21
|
server: Schema.String,
|
|
22
22
|
},
|
|
23
23
|
});
|
|
24
|
-
|
|
24
|
+
// Experimental: MCP Events is a draft extension; may change without compatibility guarantees.
|
|
25
|
+
/** One event from an MCP Events subscription. Delivery is at least once: dedupe on `id` and `eventId`. */
|
|
26
|
+
export const ExperimentalEvent = Event.ephemeral({
|
|
27
|
+
type: "experimental.mcp.event",
|
|
28
|
+
schema: {
|
|
29
|
+
/** The subscription that received it. */
|
|
30
|
+
id: Schema.String,
|
|
31
|
+
server: Schema.String,
|
|
32
|
+
name: Schema.String,
|
|
33
|
+
eventId: Schema.String,
|
|
34
|
+
timestamp: Schema.String,
|
|
35
|
+
data: Schema.Json,
|
|
36
|
+
/** Where the subscription resumes from after this event; null when the event type has no replay. */
|
|
37
|
+
cursor: Schema.NullOr(Schema.String),
|
|
38
|
+
/** The server skipped events before this one, which it could not replay. */
|
|
39
|
+
truncated: Schema.optional(Schema.Boolean),
|
|
40
|
+
},
|
|
41
|
+
});
|
|
42
|
+
/** A subscription's status changed; read it with the MCP service's `subscriptions`. */
|
|
43
|
+
export const ExperimentalSubscriptionChanged = Event.ephemeral({
|
|
44
|
+
type: "experimental.mcp.subscription.changed",
|
|
45
|
+
schema: {
|
|
46
|
+
id: Schema.String,
|
|
47
|
+
},
|
|
48
|
+
});
|
|
49
|
+
export const Definitions = Event.inventory(ToolsChanged, ResourcesChanged, StatusChanged, ExperimentalEvent, ExperimentalSubscriptionChanged);
|
package/dist/mcp.d.ts
CHANGED
|
@@ -61,6 +61,27 @@ export declare const Status: Schema.toTaggedUnion<"status", readonly [Schema.Str
|
|
|
61
61
|
readonly status: Schema.Literal<"needs_auth">;
|
|
62
62
|
readonly error: Schema.String;
|
|
63
63
|
}>]>;
|
|
64
|
+
/**
|
|
65
|
+
* An MCP Events subscription: `pending` until its server confirms the stream, `active` while it does, and `ended` when
|
|
66
|
+
* the server terminated or rejected it, or no longer offers events. Pending covers a server that is not connected.
|
|
67
|
+
* Experimental: MCP Events is a draft extension; may change without compatibility guarantees.
|
|
68
|
+
*/
|
|
69
|
+
export declare const SubscriptionStatus: Schema.Union<readonly [Schema.Struct<{
|
|
70
|
+
readonly status: Schema.Literal<"pending">;
|
|
71
|
+
}>, Schema.Struct<{
|
|
72
|
+
readonly status: Schema.Literal<"active">;
|
|
73
|
+
}>, Schema.Struct<{
|
|
74
|
+
readonly status: Schema.Literal<"ended">;
|
|
75
|
+
readonly reason: Schema.Literal<"unavailable">;
|
|
76
|
+
}>, Schema.Struct<{
|
|
77
|
+
readonly status: Schema.Literal<"ended">;
|
|
78
|
+
readonly reason: Schema.Literals<readonly ["terminated", "rejected"]>;
|
|
79
|
+
readonly error: Schema.Struct<{
|
|
80
|
+
readonly code: Schema.Number;
|
|
81
|
+
readonly message: Schema.String;
|
|
82
|
+
}>;
|
|
83
|
+
}>]>;
|
|
84
|
+
export type SubscriptionStatus = typeof SubscriptionStatus.Type;
|
|
64
85
|
export interface Server extends Schema.Schema.Type<typeof Server> {
|
|
65
86
|
}
|
|
66
87
|
export declare const Server: Schema.Struct<{
|
package/dist/mcp.js
CHANGED
|
@@ -80,6 +80,21 @@ const NeedsAuth = Schema.Struct({ status: Schema.Literal("needs_auth"), error: S
|
|
|
80
80
|
identifier: "Mcp.Status.NeedsAuth",
|
|
81
81
|
});
|
|
82
82
|
export const Status = Schema.Union([Connected, Pending, Disabled, Failed, NeedsAuth]).pipe(Schema.toTaggedUnion("status"));
|
|
83
|
+
/**
|
|
84
|
+
* An MCP Events subscription: `pending` until its server confirms the stream, `active` while it does, and `ended` when
|
|
85
|
+
* the server terminated or rejected it, or no longer offers events. Pending covers a server that is not connected.
|
|
86
|
+
* Experimental: MCP Events is a draft extension; may change without compatibility guarantees.
|
|
87
|
+
*/
|
|
88
|
+
export const SubscriptionStatus = Schema.Union([
|
|
89
|
+
Schema.Struct({ status: Schema.Literal("pending") }),
|
|
90
|
+
Schema.Struct({ status: Schema.Literal("active") }),
|
|
91
|
+
Schema.Struct({ status: Schema.Literal("ended"), reason: Schema.Literal("unavailable") }),
|
|
92
|
+
Schema.Struct({
|
|
93
|
+
status: Schema.Literal("ended"),
|
|
94
|
+
reason: Schema.Literals(["terminated", "rejected"]),
|
|
95
|
+
error: Schema.Struct({ code: Schema.Number, message: Schema.String }),
|
|
96
|
+
}),
|
|
97
|
+
]).annotate({ identifier: "Mcp.SubscriptionStatus" });
|
|
83
98
|
export const Server = Schema.Struct({
|
|
84
99
|
name: Schema.String,
|
|
85
100
|
status: Status,
|