@opencode/protocol 2.2.0 → 2.2.2

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.
@@ -128,6 +128,9 @@ export declare const ModelGroup: HttpApiGroup.HttpApiGroup<"server.model", HttpA
128
128
  };
129
129
  };
130
130
  readonly variants: Schema.$Array<Schema.Struct<{
131
+ readonly headers: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.String>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.String>>, never, never>;
132
+ readonly body: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Any>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Any>>, never, never>;
133
+ readonly id: Schema.brand<Schema.String, "Model.VariantID">;
131
134
  readonly settings: Schema.decodeTo<Schema.optional<Schema.toType<Schema.StructWithRest<Schema.Struct<{
132
135
  readonly compaction: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Union<readonly [Schema.Struct<{
133
136
  readonly type: Schema.Literal<"summary">;
@@ -138,11 +141,6 @@ export declare const ModelGroup: HttpApiGroup.HttpApiGroup<"server.model", HttpA
138
141
  }>, Schema.Struct<{
139
142
  readonly type: Schema.Literal<"native">;
140
143
  }>]>>, never, never>;
141
- readonly cache: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
142
- readonly ttl: Schema.decodeTo<Schema.optional<Schema.toType<Schema.TemplateLiteral<readonly [Schema.Number, Schema.Literals<readonly ["ms", "s", "m", "h", "d"]>]>>>, Schema.optionalKey<Schema.TemplateLiteral<readonly [Schema.Number, Schema.Literals<readonly ["ms", "s", "m", "h", "d"]>]>>, never, never>;
143
- }>>>, Schema.optionalKey<Schema.Struct<{
144
- readonly ttl: Schema.decodeTo<Schema.optional<Schema.toType<Schema.TemplateLiteral<readonly [Schema.Number, Schema.Literals<readonly ["ms", "s", "m", "h", "d"]>]>>>, Schema.optionalKey<Schema.TemplateLiteral<readonly [Schema.Number, Schema.Literals<readonly ["ms", "s", "m", "h", "d"]>]>>, never, never>;
145
- }>>, never, never>;
146
144
  readonly encoding: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["zstd", "gzip", "none"]>>>, Schema.optionalKey<Schema.Literals<readonly ["zstd", "gzip", "none"]>>, never, never>;
147
145
  }>, readonly [Schema.$Record<Schema.String, Schema.Any>]>>>, Schema.optionalKey<Schema.StructWithRest<Schema.Struct<{
148
146
  readonly compaction: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Union<readonly [Schema.Struct<{
@@ -154,16 +152,8 @@ export declare const ModelGroup: HttpApiGroup.HttpApiGroup<"server.model", HttpA
154
152
  }>, Schema.Struct<{
155
153
  readonly type: Schema.Literal<"native">;
156
154
  }>]>>, never, never>;
157
- readonly cache: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
158
- readonly ttl: Schema.decodeTo<Schema.optional<Schema.toType<Schema.TemplateLiteral<readonly [Schema.Number, Schema.Literals<readonly ["ms", "s", "m", "h", "d"]>]>>>, Schema.optionalKey<Schema.TemplateLiteral<readonly [Schema.Number, Schema.Literals<readonly ["ms", "s", "m", "h", "d"]>]>>, never, never>;
159
- }>>>, Schema.optionalKey<Schema.Struct<{
160
- readonly ttl: Schema.decodeTo<Schema.optional<Schema.toType<Schema.TemplateLiteral<readonly [Schema.Number, Schema.Literals<readonly ["ms", "s", "m", "h", "d"]>]>>>, Schema.optionalKey<Schema.TemplateLiteral<readonly [Schema.Number, Schema.Literals<readonly ["ms", "s", "m", "h", "d"]>]>>, never, never>;
161
- }>>, never, never>;
162
155
  readonly encoding: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["zstd", "gzip", "none"]>>>, Schema.optionalKey<Schema.Literals<readonly ["zstd", "gzip", "none"]>>, never, never>;
163
156
  }>, readonly [Schema.$Record<Schema.String, Schema.Any>]>>, never, never>;
164
- readonly headers: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.String>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.String>>, never, never>;
165
- readonly body: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Any>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Any>>, never, never>;
166
- readonly id: Schema.brand<Schema.String, "Model.VariantID">;
167
157
  }>>;
168
158
  readonly time: Schema.Struct<{
169
159
  readonly released: Schema.Finite;
@@ -349,6 +339,9 @@ export declare const ModelGroup: HttpApiGroup.HttpApiGroup<"server.model", HttpA
349
339
  };
350
340
  };
351
341
  readonly variants: Schema.$Array<Schema.Struct<{
342
+ readonly headers: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.String>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.String>>, never, never>;
343
+ readonly body: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Any>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Any>>, never, never>;
344
+ readonly id: Schema.brand<Schema.String, "Model.VariantID">;
352
345
  readonly settings: Schema.decodeTo<Schema.optional<Schema.toType<Schema.StructWithRest<Schema.Struct<{
353
346
  readonly compaction: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Union<readonly [Schema.Struct<{
354
347
  readonly type: Schema.Literal<"summary">;
@@ -359,11 +352,6 @@ export declare const ModelGroup: HttpApiGroup.HttpApiGroup<"server.model", HttpA
359
352
  }>, Schema.Struct<{
360
353
  readonly type: Schema.Literal<"native">;
361
354
  }>]>>, never, never>;
362
- readonly cache: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
363
- readonly ttl: Schema.decodeTo<Schema.optional<Schema.toType<Schema.TemplateLiteral<readonly [Schema.Number, Schema.Literals<readonly ["ms", "s", "m", "h", "d"]>]>>>, Schema.optionalKey<Schema.TemplateLiteral<readonly [Schema.Number, Schema.Literals<readonly ["ms", "s", "m", "h", "d"]>]>>, never, never>;
364
- }>>>, Schema.optionalKey<Schema.Struct<{
365
- readonly ttl: Schema.decodeTo<Schema.optional<Schema.toType<Schema.TemplateLiteral<readonly [Schema.Number, Schema.Literals<readonly ["ms", "s", "m", "h", "d"]>]>>>, Schema.optionalKey<Schema.TemplateLiteral<readonly [Schema.Number, Schema.Literals<readonly ["ms", "s", "m", "h", "d"]>]>>, never, never>;
366
- }>>, never, never>;
367
355
  readonly encoding: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["zstd", "gzip", "none"]>>>, Schema.optionalKey<Schema.Literals<readonly ["zstd", "gzip", "none"]>>, never, never>;
368
356
  }>, readonly [Schema.$Record<Schema.String, Schema.Any>]>>>, Schema.optionalKey<Schema.StructWithRest<Schema.Struct<{
369
357
  readonly compaction: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Union<readonly [Schema.Struct<{
@@ -375,16 +363,8 @@ export declare const ModelGroup: HttpApiGroup.HttpApiGroup<"server.model", HttpA
375
363
  }>, Schema.Struct<{
376
364
  readonly type: Schema.Literal<"native">;
377
365
  }>]>>, never, never>;
378
- readonly cache: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
379
- readonly ttl: Schema.decodeTo<Schema.optional<Schema.toType<Schema.TemplateLiteral<readonly [Schema.Number, Schema.Literals<readonly ["ms", "s", "m", "h", "d"]>]>>>, Schema.optionalKey<Schema.TemplateLiteral<readonly [Schema.Number, Schema.Literals<readonly ["ms", "s", "m", "h", "d"]>]>>, never, never>;
380
- }>>>, Schema.optionalKey<Schema.Struct<{
381
- readonly ttl: Schema.decodeTo<Schema.optional<Schema.toType<Schema.TemplateLiteral<readonly [Schema.Number, Schema.Literals<readonly ["ms", "s", "m", "h", "d"]>]>>>, Schema.optionalKey<Schema.TemplateLiteral<readonly [Schema.Number, Schema.Literals<readonly ["ms", "s", "m", "h", "d"]>]>>, never, never>;
382
- }>>, never, never>;
383
366
  readonly encoding: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["zstd", "gzip", "none"]>>>, Schema.optionalKey<Schema.Literals<readonly ["zstd", "gzip", "none"]>>, never, never>;
384
367
  }>, readonly [Schema.$Record<Schema.String, Schema.Any>]>>, never, never>;
385
- readonly headers: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.String>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.String>>, never, never>;
386
- readonly body: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Any>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Any>>, never, never>;
387
- readonly id: Schema.brand<Schema.String, "Model.VariantID">;
388
368
  }>>;
389
369
  readonly time: Schema.Struct<{
390
370
  readonly released: Schema.Finite;
@@ -23,6 +23,7 @@ export const PersistentPtyGroup = HttpApiGroup.make("server.experimental")
23
23
  success: Schema.Struct({ data: Schema.NullOr(PersistentPty.ReadResult) }),
24
24
  error: [ServiceUnavailableError],
25
25
  }).annotateMerge(OpenApi.annotations({
26
+ identifier: "experimental.persistentPty.read",
26
27
  summary: "Read the session's most recently controlled terminal",
27
28
  description: "Read the last physical rows without changing selection or taking control. Omitted lines uses the live terminal height; larger counts include retained history. Blank rows are preserved. Screen dimensions and cursor remain relative to the live screen. Returns null when no current terminal exists. Selection is server-local and resets on restart. Experimental: may change without compatibility guarantees.",
28
29
  })))
@@ -30,54 +31,54 @@ export const PersistentPtyGroup = HttpApiGroup.make("server.experimental")
30
31
  params: { sessionID: Session.ID },
31
32
  success: Schema.Struct({ data: Schema.Array(PersistentPty.Info) }),
32
33
  error: errors,
33
- }))
34
+ }).annotateMerge(OpenApi.annotations({ identifier: "experimental.persistentPty.list" })))
34
35
  .add(HttpApiEndpoint.post("persistentPty.create", "/api/experimental/session/:sessionID/terminal", {
35
36
  params: { sessionID: Session.ID },
36
37
  payload: PersistentPty.CreateInput,
37
38
  success: Schema.Struct({ data: PersistentPty.Info }),
38
39
  error: errors,
39
- }))
40
+ }).annotateMerge(OpenApi.annotations({ identifier: "experimental.persistentPty.create" })))
40
41
  .add(HttpApiEndpoint.post("persistentPty.shutdown", "/api/experimental/persistent-pty/shutdown", {
41
42
  success: HttpApiSchema.NoContent,
42
43
  error: [ServiceUnavailableError],
43
- }))
44
+ }).annotateMerge(OpenApi.annotations({ identifier: "experimental.persistentPty.shutdown" })))
44
45
  .add(HttpApiEndpoint.post("persistentPty.handoff", "/api/experimental/persistent-pty/handoff", {
45
46
  success: Schema.Struct({ handoff: Schema.NullOr(PersistentPty.Handoff) }),
46
47
  error: [ServiceUnavailableError],
47
- }))
48
+ }).annotateMerge(OpenApi.annotations({ identifier: "experimental.persistentPty.handoff" })))
48
49
  .add(HttpApiEndpoint.get("persistentPty.get", "/api/experimental/persistent-pty/:ptyID", {
49
50
  params: { ptyID: Pty.ID },
50
51
  success: Schema.Struct({ data: PersistentPty.Info }),
51
52
  error: terminalErrors,
52
- }))
53
+ }).annotateMerge(OpenApi.annotations({ identifier: "experimental.persistentPty.get" })))
53
54
  .add(HttpApiEndpoint.put("persistentPty.update", "/api/experimental/persistent-pty/:ptyID", {
54
55
  params: { ptyID: Pty.ID },
55
56
  payload: PersistentPty.UpdateInput,
56
57
  success: Schema.Struct({ data: PersistentPty.Info }),
57
58
  error: terminalErrors,
58
- }))
59
+ }).annotateMerge(OpenApi.annotations({ identifier: "experimental.persistentPty.update" })))
59
60
  .add(HttpApiEndpoint.get("persistentPty.snapshot", "/api/experimental/persistent-pty/:ptyID/snapshot", {
60
61
  params: { ptyID: Pty.ID },
61
62
  success: Schema.Struct({ data: PersistentPty.Snapshot }),
62
63
  error: terminalErrors,
63
- }))
64
+ }).annotateMerge(OpenApi.annotations({ identifier: "experimental.persistentPty.snapshot" })))
64
65
  .add(HttpApiEndpoint.delete("persistentPty.remove", "/api/experimental/persistent-pty/:ptyID", {
65
66
  params: { ptyID: Pty.ID },
66
67
  success: HttpApiSchema.NoContent,
67
68
  error: terminalErrors,
68
- }))
69
+ }).annotateMerge(OpenApi.annotations({ identifier: "experimental.persistentPty.remove" })))
69
70
  .add(HttpApiEndpoint.post("persistentPty.connectToken", "/api/experimental/persistent-pty/:ptyID/connect-token", {
70
71
  params: { ptyID: Pty.ID },
71
72
  headers: Schema.Struct({ [PTY_CONNECT_TOKEN_HEADER]: Schema.optional(Schema.String) }),
72
73
  success: Schema.Struct({ data: PtyTicket.ConnectToken }),
73
74
  error: [ForbiddenError, PtyNotFoundError, ServiceUnavailableError],
74
- }))
75
+ }).annotateMerge(OpenApi.annotations({ identifier: "experimental.persistentPty.connectToken" })))
75
76
  .add(HttpApiEndpoint.get("persistentPty.connect", PERSISTENT_PTY_CONNECT_PATH, {
76
77
  params: { ptyID: Pty.ID },
77
78
  success: Schema.Boolean,
78
79
  error: [ForbiddenError, PtyNotFoundError, ServiceUnavailableError],
79
80
  }).annotateMerge(OpenApi.annotations({
80
- identifier: "persistentPty.connect",
81
+ identifier: "experimental.persistentPty.connect",
81
82
  summary: "Connect to a persistent PTY",
82
83
  description: "Stream persistent PTY output through the OpenCode server.",
83
84
  transform: (operation) => ({