@opencode/schema 2.2.6 → 2.3.0
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/agent.d.ts +9 -0
- package/dist/config/experimental.d.ts +4 -1
- package/dist/config/experimental.js +3 -3
- package/dist/config/flag.d.ts +3 -0
- package/dist/config/flag.js +3 -0
- package/dist/config/provider.d.ts +47 -0
- package/dist/config/provider.js +1 -0
- package/dist/config/warming.js +1 -1
- package/dist/credential.d.ts +24 -4
- package/dist/credential.js +2 -1
- package/dist/event-manifest.d.ts +272 -4
- package/dist/event-manifest.js +1 -1
- package/dist/generate.d.ts +21 -0
- package/dist/generate.js +3 -0
- 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/dist/model.d.ts +4 -0
- package/dist/model.js +3 -0
- package/dist/provider.d.ts +61 -0
- package/dist/provider.js +8 -1
- package/dist/session-event.d.ts +291 -8
- package/dist/session-event.js +11 -2
- package/dist/session-message.d.ts +6 -0
- package/dist/session-message.js +2 -0
- package/dist/session-transfer.d.ts +1 -0
- package/dist/tool.d.ts +18 -0
- package/dist/tool.js +9 -0
- package/package.json +5 -5
package/dist/generate.d.ts
CHANGED
|
@@ -133,6 +133,13 @@ export declare const PredicateQuestion: Schema.Struct<{
|
|
|
133
133
|
readonly type: Schema.Literal<"predicate">;
|
|
134
134
|
readonly name: Schema.String;
|
|
135
135
|
readonly instructions: Schema.String;
|
|
136
|
+
readonly criteria: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
|
|
137
|
+
readonly true: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
|
|
138
|
+
readonly false: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
|
|
139
|
+
}>>>, Schema.optionalKey<Schema.Struct<{
|
|
140
|
+
readonly true: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
|
|
141
|
+
readonly false: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
|
|
142
|
+
}>>, never, never>;
|
|
136
143
|
}>;
|
|
137
144
|
export interface ChoiceQuestion extends Schema.Schema.Type<typeof ChoiceQuestion> {
|
|
138
145
|
}
|
|
@@ -161,6 +168,13 @@ export declare const DecisionQuestion: Schema.Union<readonly [Schema.Struct<{
|
|
|
161
168
|
readonly type: Schema.Literal<"predicate">;
|
|
162
169
|
readonly name: Schema.String;
|
|
163
170
|
readonly instructions: Schema.String;
|
|
171
|
+
readonly criteria: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
|
|
172
|
+
readonly true: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
|
|
173
|
+
readonly false: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
|
|
174
|
+
}>>>, Schema.optionalKey<Schema.Struct<{
|
|
175
|
+
readonly true: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
|
|
176
|
+
readonly false: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
|
|
177
|
+
}>>, never, never>;
|
|
164
178
|
}>, Schema.Struct<{
|
|
165
179
|
readonly type: Schema.Literal<"choice">;
|
|
166
180
|
readonly name: Schema.String;
|
|
@@ -221,6 +235,13 @@ export declare const DecisionRequest: Schema.Struct<{
|
|
|
221
235
|
readonly type: Schema.Literal<"predicate">;
|
|
222
236
|
readonly name: Schema.String;
|
|
223
237
|
readonly instructions: Schema.String;
|
|
238
|
+
readonly criteria: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
|
|
239
|
+
readonly true: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
|
|
240
|
+
readonly false: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
|
|
241
|
+
}>>>, Schema.optionalKey<Schema.Struct<{
|
|
242
|
+
readonly true: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
|
|
243
|
+
readonly false: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
|
|
244
|
+
}>>, never, never>;
|
|
224
245
|
}>, Schema.Struct<{
|
|
225
246
|
readonly type: Schema.Literal<"choice">;
|
|
226
247
|
readonly name: Schema.String;
|
package/dist/generate.js
CHANGED
|
@@ -71,6 +71,9 @@ export const PredicateQuestion = Schema.Struct({
|
|
|
71
71
|
type: Schema.Literal("predicate"),
|
|
72
72
|
name: QuestionName,
|
|
73
73
|
instructions: Schema.String,
|
|
74
|
+
criteria: Schema.Struct({ true: Schema.String.pipe(optional), false: Schema.String.pipe(optional) })
|
|
75
|
+
.pipe(optional)
|
|
76
|
+
.annotate(description("What counts as true and as false, for statements the instructions alone leave ambiguous")),
|
|
74
77
|
}).annotate({ identifier: "Generate.PredicateQuestion", description: "The probability that a statement is true" });
|
|
75
78
|
export const ChoiceQuestion = Schema.Struct({
|
|
76
79
|
type: Schema.Literal("choice"),
|
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,
|
package/dist/model.d.ts
CHANGED
|
@@ -207,6 +207,8 @@ export interface Capabilities extends Schema.Schema.Type<typeof Capabilities> {
|
|
|
207
207
|
}
|
|
208
208
|
export declare const Capabilities: Schema.Struct<{
|
|
209
209
|
readonly tools: Schema.Boolean;
|
|
210
|
+
/** Freeform tool input formats advertised by the selected API. Absent or empty means JSON tools only. */
|
|
211
|
+
readonly freeform: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Array<Schema.Literals<("lark" | "regex" | "text")[]>>>>, Schema.optionalKey<Schema.$Array<Schema.Literals<("lark" | "regex" | "text")[]>>>, never, never>;
|
|
210
212
|
readonly input: Schema.$Array<Schema.String>;
|
|
211
213
|
readonly output: Schema.$Array<Schema.String>;
|
|
212
214
|
/** Whether the model accepts a sampling temperature. Unknown when unset. */
|
|
@@ -413,6 +415,8 @@ export declare const Info: Schema.Struct<{
|
|
|
413
415
|
readonly package: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
|
|
414
416
|
readonly capabilities: Schema.Struct<{
|
|
415
417
|
readonly tools: Schema.Boolean;
|
|
418
|
+
/** Freeform tool input formats advertised by the selected API. Absent or empty means JSON tools only. */
|
|
419
|
+
readonly freeform: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Array<Schema.Literals<("lark" | "regex" | "text")[]>>>>, Schema.optionalKey<Schema.$Array<Schema.Literals<("lark" | "regex" | "text")[]>>>, never, never>;
|
|
416
420
|
readonly input: Schema.$Array<Schema.String>;
|
|
417
421
|
readonly output: Schema.$Array<Schema.String>;
|
|
418
422
|
/** Whether the model accepts a sampling temperature. Unknown when unset. */
|
package/dist/model.js
CHANGED
|
@@ -4,6 +4,7 @@ import { optional, statics } from "./schema.js";
|
|
|
4
4
|
import { Provider } from "./provider.js";
|
|
5
5
|
import { Compatibility, MaxTokensField, MediaInput, ReasoningField } from "./model-compatibility.js";
|
|
6
6
|
import { Money } from "./money.js";
|
|
7
|
+
import { FreeformFormat } from "./tool.js";
|
|
7
8
|
import { ephemeral, inventory } from "./event.js";
|
|
8
9
|
export const ID = Schema.String.pipe(Schema.brand("Model.ID"));
|
|
9
10
|
const Updated = ephemeral({ type: "model.updated", schema: {} });
|
|
@@ -51,6 +52,8 @@ export const Overlays = {
|
|
|
51
52
|
};
|
|
52
53
|
export const Capabilities = Schema.Struct({
|
|
53
54
|
tools: Schema.Boolean,
|
|
55
|
+
/** Freeform tool input formats advertised by the selected API. Absent or empty means JSON tools only. */
|
|
56
|
+
freeform: Schema.Array(FreeformFormat).pipe(optional),
|
|
54
57
|
input: Schema.Array(Schema.String),
|
|
55
58
|
output: Schema.Array(Schema.String),
|
|
56
59
|
/** Whether the model accepts a sampling temperature. Unknown when unset. */
|
package/dist/provider.d.ts
CHANGED
|
@@ -120,6 +120,13 @@ export type Cache = typeof Cache.Type;
|
|
|
120
120
|
/** HTTP request body compression; only endpoints known to decode it should enable it. */
|
|
121
121
|
export declare const Encoding: Schema.Literals<readonly ["zstd", "gzip", "none"]>;
|
|
122
122
|
export type Encoding = typeof Encoding.Type;
|
|
123
|
+
/** Client certificate for gateways that require mutual TLS. Values are PEM text; use `{file:...}` to read a file. */
|
|
124
|
+
export declare const Tls: Schema.Struct<{
|
|
125
|
+
readonly cert: Schema.String;
|
|
126
|
+
readonly key: Schema.String;
|
|
127
|
+
readonly passphrase: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
|
|
128
|
+
}>;
|
|
129
|
+
export type Tls = typeof Tls.Type;
|
|
123
130
|
export declare const Settings: Schema.StructWithRest<Schema.Struct<{
|
|
124
131
|
readonly timeout: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Union<readonly [Schema.Finite, Schema.Literal<false>]>>>, Schema.optionalKey<Schema.Union<readonly [Schema.Finite, Schema.Literal<false>]>>, never, never>;
|
|
125
132
|
readonly headerTimeout: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Union<readonly [Schema.Finite, Schema.Literal<false>]>>>, Schema.optionalKey<Schema.Union<readonly [Schema.Finite, Schema.Literal<false>]>>, never, never>;
|
|
@@ -154,6 +161,15 @@ export declare const Settings: Schema.StructWithRest<Schema.Struct<{
|
|
|
154
161
|
}>>, never, never>;
|
|
155
162
|
readonly transport: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["http", "websocket"]>>>, Schema.optionalKey<Schema.Literals<readonly ["http", "websocket"]>>, never, never>;
|
|
156
163
|
readonly encoding: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["zstd", "gzip", "none"]>>>, Schema.optionalKey<Schema.Literals<readonly ["zstd", "gzip", "none"]>>, never, never>;
|
|
164
|
+
readonly tls: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
|
|
165
|
+
readonly cert: Schema.String;
|
|
166
|
+
readonly key: Schema.String;
|
|
167
|
+
readonly passphrase: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
|
|
168
|
+
}>>>, Schema.optionalKey<Schema.Struct<{
|
|
169
|
+
readonly cert: Schema.String;
|
|
170
|
+
readonly key: Schema.String;
|
|
171
|
+
readonly passphrase: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
|
|
172
|
+
}>>, never, never>;
|
|
157
173
|
}>, readonly [Schema.$Record<Schema.String, Schema.Any>]>;
|
|
158
174
|
export type Settings = typeof Settings.Type;
|
|
159
175
|
export declare const Overlays: {
|
|
@@ -191,6 +207,15 @@ export declare const Overlays: {
|
|
|
191
207
|
}>>, never, never>;
|
|
192
208
|
readonly transport: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["http", "websocket"]>>>, Schema.optionalKey<Schema.Literals<readonly ["http", "websocket"]>>, never, never>;
|
|
193
209
|
readonly encoding: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["zstd", "gzip", "none"]>>>, Schema.optionalKey<Schema.Literals<readonly ["zstd", "gzip", "none"]>>, never, never>;
|
|
210
|
+
readonly tls: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
|
|
211
|
+
readonly cert: Schema.String;
|
|
212
|
+
readonly key: Schema.String;
|
|
213
|
+
readonly passphrase: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
|
|
214
|
+
}>>>, Schema.optionalKey<Schema.Struct<{
|
|
215
|
+
readonly cert: Schema.String;
|
|
216
|
+
readonly key: Schema.String;
|
|
217
|
+
readonly passphrase: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
|
|
218
|
+
}>>, never, never>;
|
|
194
219
|
}>, readonly [Schema.$Record<Schema.String, Schema.Any>]>>>, Schema.optionalKey<Schema.StructWithRest<Schema.Struct<{
|
|
195
220
|
readonly timeout: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Union<readonly [Schema.Finite, Schema.Literal<false>]>>>, Schema.optionalKey<Schema.Union<readonly [Schema.Finite, Schema.Literal<false>]>>, never, never>;
|
|
196
221
|
readonly headerTimeout: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Union<readonly [Schema.Finite, Schema.Literal<false>]>>>, Schema.optionalKey<Schema.Union<readonly [Schema.Finite, Schema.Literal<false>]>>, never, never>;
|
|
@@ -225,6 +250,15 @@ export declare const Overlays: {
|
|
|
225
250
|
}>>, never, never>;
|
|
226
251
|
readonly transport: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["http", "websocket"]>>>, Schema.optionalKey<Schema.Literals<readonly ["http", "websocket"]>>, never, never>;
|
|
227
252
|
readonly encoding: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["zstd", "gzip", "none"]>>>, Schema.optionalKey<Schema.Literals<readonly ["zstd", "gzip", "none"]>>, never, never>;
|
|
253
|
+
readonly tls: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
|
|
254
|
+
readonly cert: Schema.String;
|
|
255
|
+
readonly key: Schema.String;
|
|
256
|
+
readonly passphrase: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
|
|
257
|
+
}>>>, Schema.optionalKey<Schema.Struct<{
|
|
258
|
+
readonly cert: Schema.String;
|
|
259
|
+
readonly key: Schema.String;
|
|
260
|
+
readonly passphrase: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
|
|
261
|
+
}>>, never, never>;
|
|
228
262
|
}>, readonly [Schema.$Record<Schema.String, Schema.Any>]>>, never, never>;
|
|
229
263
|
headers: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.String>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.String>>, never, never>;
|
|
230
264
|
body: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Any>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Any>>, never, never>;
|
|
@@ -266,6 +300,15 @@ export declare const Request: Schema.Struct<{
|
|
|
266
300
|
}>>, never, never>;
|
|
267
301
|
readonly transport: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["http", "websocket"]>>>, Schema.optionalKey<Schema.Literals<readonly ["http", "websocket"]>>, never, never>;
|
|
268
302
|
readonly encoding: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["zstd", "gzip", "none"]>>>, Schema.optionalKey<Schema.Literals<readonly ["zstd", "gzip", "none"]>>, never, never>;
|
|
303
|
+
readonly tls: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
|
|
304
|
+
readonly cert: Schema.String;
|
|
305
|
+
readonly key: Schema.String;
|
|
306
|
+
readonly passphrase: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
|
|
307
|
+
}>>>, Schema.optionalKey<Schema.Struct<{
|
|
308
|
+
readonly cert: Schema.String;
|
|
309
|
+
readonly key: Schema.String;
|
|
310
|
+
readonly passphrase: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
|
|
311
|
+
}>>, never, never>;
|
|
269
312
|
}>, readonly [Schema.$Record<Schema.String, Schema.Any>]>>;
|
|
270
313
|
readonly headers: Schema.$Record<Schema.String, Schema.String>;
|
|
271
314
|
readonly body: Schema.$Record<Schema.String, Schema.Any>;
|
|
@@ -307,6 +350,15 @@ export declare const Info: Schema.Struct<{
|
|
|
307
350
|
}>>, never, never>;
|
|
308
351
|
readonly transport: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["http", "websocket"]>>>, Schema.optionalKey<Schema.Literals<readonly ["http", "websocket"]>>, never, never>;
|
|
309
352
|
readonly encoding: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["zstd", "gzip", "none"]>>>, Schema.optionalKey<Schema.Literals<readonly ["zstd", "gzip", "none"]>>, never, never>;
|
|
353
|
+
readonly tls: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
|
|
354
|
+
readonly cert: Schema.String;
|
|
355
|
+
readonly key: Schema.String;
|
|
356
|
+
readonly passphrase: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
|
|
357
|
+
}>>>, Schema.optionalKey<Schema.Struct<{
|
|
358
|
+
readonly cert: Schema.String;
|
|
359
|
+
readonly key: Schema.String;
|
|
360
|
+
readonly passphrase: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
|
|
361
|
+
}>>, never, never>;
|
|
310
362
|
}>, readonly [Schema.$Record<Schema.String, Schema.Any>]>>>, Schema.optionalKey<Schema.StructWithRest<Schema.Struct<{
|
|
311
363
|
readonly timeout: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Union<readonly [Schema.Finite, Schema.Literal<false>]>>>, Schema.optionalKey<Schema.Union<readonly [Schema.Finite, Schema.Literal<false>]>>, never, never>;
|
|
312
364
|
readonly headerTimeout: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Union<readonly [Schema.Finite, Schema.Literal<false>]>>>, Schema.optionalKey<Schema.Union<readonly [Schema.Finite, Schema.Literal<false>]>>, never, never>;
|
|
@@ -341,6 +393,15 @@ export declare const Info: Schema.Struct<{
|
|
|
341
393
|
}>>, never, never>;
|
|
342
394
|
readonly transport: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["http", "websocket"]>>>, Schema.optionalKey<Schema.Literals<readonly ["http", "websocket"]>>, never, never>;
|
|
343
395
|
readonly encoding: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["zstd", "gzip", "none"]>>>, Schema.optionalKey<Schema.Literals<readonly ["zstd", "gzip", "none"]>>, never, never>;
|
|
396
|
+
readonly tls: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
|
|
397
|
+
readonly cert: Schema.String;
|
|
398
|
+
readonly key: Schema.String;
|
|
399
|
+
readonly passphrase: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
|
|
400
|
+
}>>>, Schema.optionalKey<Schema.Struct<{
|
|
401
|
+
readonly cert: Schema.String;
|
|
402
|
+
readonly key: Schema.String;
|
|
403
|
+
readonly passphrase: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
|
|
404
|
+
}>>, never, never>;
|
|
344
405
|
}>, readonly [Schema.$Record<Schema.String, Schema.Any>]>>, never, never>;
|
|
345
406
|
readonly headers: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.String>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.String>>, never, never>;
|
|
346
407
|
readonly body: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Any>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Any>>, never, never>;
|
package/dist/provider.js
CHANGED
|
@@ -41,7 +41,7 @@ export const CacheWarming = Schema.Union([
|
|
|
41
41
|
// Settings hold JSON, so durations stay strings here; the warming plugin parses them.
|
|
42
42
|
interval: Schema.Union([Schema.Literal("auto"), Schema.String])
|
|
43
43
|
.pipe(optional)
|
|
44
|
-
.annotate({ description: 'Duration such as "4 minutes", or "auto" for 90% of the model\'s cache.ttl' }),
|
|
44
|
+
.annotate({ description: 'Duration such as "4 minutes", or "auto" (default) for 90% of the model\'s cache.ttl' }),
|
|
45
45
|
duration: Schema.String.pipe(optional).annotate({ description: 'Duration such as "30 minutes"' }),
|
|
46
46
|
}),
|
|
47
47
|
]).annotate({ identifier: "Provider.CacheWarming" });
|
|
@@ -53,6 +53,12 @@ export const Cache = Schema.Struct({
|
|
|
53
53
|
/** HTTP request body compression; only endpoints known to decode it should enable it. */
|
|
54
54
|
export const Encoding = Schema.Literals(["zstd", "gzip", "none"]).annotate({ identifier: "Provider.Encoding" });
|
|
55
55
|
const Timeout = Schema.Union([Schema.Finite, Schema.Literal(false)]).pipe(optional);
|
|
56
|
+
/** Client certificate for gateways that require mutual TLS. Values are PEM text; use `{file:...}` to read a file. */
|
|
57
|
+
export const Tls = Schema.Struct({
|
|
58
|
+
cert: Schema.String.annotate({ description: "PEM client certificate, usually `{file:/path/to/client.pem}`" }),
|
|
59
|
+
key: Schema.String.annotate({ description: "PEM private key, usually `{file:/path/to/client.key}`" }),
|
|
60
|
+
passphrase: Schema.String.pipe(optional).annotate({ description: "Passphrase for an encrypted private key" }),
|
|
61
|
+
}).annotate({ identifier: "Provider.Tls" });
|
|
56
62
|
// The named fields are the settings OpenCode reads itself; every other key is a provider option for the provider package.
|
|
57
63
|
export const Settings = Schema.StructWithRest(Schema.Struct({
|
|
58
64
|
timeout: Timeout,
|
|
@@ -62,6 +68,7 @@ export const Settings = Schema.StructWithRest(Schema.Struct({
|
|
|
62
68
|
cache: Cache.pipe(optional),
|
|
63
69
|
transport: Transport.pipe(optional),
|
|
64
70
|
encoding: Encoding.pipe(optional),
|
|
71
|
+
tls: Tls.pipe(optional),
|
|
65
72
|
}), [Schema.Record(Schema.String, Schema.Any)]).annotate({ identifier: "Provider.Settings" });
|
|
66
73
|
export const Overlays = {
|
|
67
74
|
settings: Settings.pipe(optional),
|