@opencode/protocol 0.0.0-dev-21130 → 0.0.0-dev-21132

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.
@@ -5,7 +5,7 @@ export declare const SessionMessagesQuery: Schema.Struct<{
5
5
  readonly limit: Schema.optional<Schema.NumberFromString>;
6
6
  readonly order: Schema.optional<Schema.Union<readonly [Schema.Literal<"asc">, Schema.Literal<"desc">]>>;
7
7
  readonly cursor: Schema.optional<Schema.String>;
8
- readonly type: Schema.optional<Schema.Literals<("agent-switched" | "assistant" | "compaction" | "location-switched" | "model-switched" | "shell" | "skill" | "synthetic" | "system" | "user")[]>>;
8
+ readonly type: Schema.optional<Schema.Literals<readonly ("agent-switched" | "assistant" | "compaction" | "idle" | "location-switched" | "model-switched" | "shell" | "skill" | "synthetic" | "system" | "user")[]>>;
9
9
  }>;
10
10
  export declare const PublicSessionMessage: Schema.Union<readonly [Schema.Struct<{
11
11
  readonly id: Schema.brand<Schema.String, "Session.Message.ID"> & {
@@ -754,7 +754,7 @@ export declare const MessageGroup: HttpApiGroup.HttpApiGroup<"server.message", H
754
754
  readonly limit: Schema.optional<Schema.NumberFromString>;
755
755
  readonly order: Schema.optional<Schema.Union<readonly [Schema.Literal<"asc">, Schema.Literal<"desc">]>>;
756
756
  readonly cursor: Schema.optional<Schema.String>;
757
- readonly type: Schema.optional<Schema.Literals<("agent-switched" | "assistant" | "compaction" | "location-switched" | "model-switched" | "shell" | "skill" | "synthetic" | "system" | "user")[]>>;
757
+ readonly type: Schema.optional<Schema.Literals<readonly ("agent-switched" | "assistant" | "compaction" | "idle" | "location-switched" | "model-switched" | "shell" | "skill" | "synthetic" | "system" | "user")[]>>;
758
758
  }>>, never, never, Schema.toCodecJson<Schema.Struct<{
759
759
  readonly data: Schema.$Array<Schema.Union<readonly [Schema.Struct<{
760
760
  readonly id: Schema.brand<Schema.String, "Session.Message.ID"> & {
@@ -4,6 +4,20 @@ import { Location } from "@opencode/schema/location";
4
4
  import { Schema, Struct } from "effect";
5
5
  import { HttpApiEndpoint, HttpApiGroup, OpenApi } from "effect/http-api";
6
6
  import { InvalidCursorError, SessionNotFoundError, UnknownError } from "../errors.js";
7
+ // Keyed by message type so a new message type cannot be left out of the filter.
8
+ const MessageTypes = {
9
+ "agent-switched": true,
10
+ "model-switched": true,
11
+ "location-switched": true,
12
+ user: true,
13
+ synthetic: true,
14
+ system: true,
15
+ skill: true,
16
+ shell: true,
17
+ assistant: true,
18
+ compaction: true,
19
+ idle: true,
20
+ };
7
21
  export const SessionMessagesQuery = Schema.Struct({
8
22
  limit: Schema.optional(Schema.NumberFromString.check(Schema.isInt(), Schema.isGreaterThanOrEqualTo(1), Schema.isLessThanOrEqualTo(200))).annotate({
9
23
  description: "Maximum number of messages to return. When omitted, the endpoint returns its default page size.",
@@ -14,18 +28,7 @@ export const SessionMessagesQuery = Schema.Struct({
14
28
  cursor: Schema.optional(Schema.String.annotate({
15
29
  description: "Opaque pagination cursor returned as cursor.previous or cursor.next in the previous response. Do not combine with order.",
16
30
  })),
17
- type: Schema.optional(Schema.Literals([
18
- "agent-switched",
19
- "model-switched",
20
- "location-switched",
21
- "user",
22
- "synthetic",
23
- "system",
24
- "skill",
25
- "shell",
26
- "assistant",
27
- "compaction",
28
- ])).annotate({
31
+ type: Schema.optional(Schema.Literals(Object.keys(MessageTypes))).annotate({
29
32
  description: "Filter by message type before pagination. When omitted, all message types are returned. Pass the same type when following cursors.",
30
33
  }),
31
34
  }).annotate({ identifier: "SessionMessagesQuery" });
@@ -62,7 +62,26 @@ export declare const makePtyGroup: <LocationId extends HttpApiMiddleware.AnyId,
62
62
  readonly pid: Schema.Int;
63
63
  readonly exitCode: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Int>>, Schema.optionalKey<Schema.Int>, never, never>;
64
64
  }>;
65
- }>>, Schema.toCodecJson<typeof PtyNotFoundError>, LocationId, HttpApiMiddleware.Requires<LocationId>> | HttpApiEndpoint.HttpApiEndpoint<"pty.create", "POST", "/api/pty", never, Schema.toCodecStringTree<Schema.Struct<{
65
+ }>>, Schema.toCodecJson<typeof PtyNotFoundError>, LocationId, HttpApiMiddleware.Requires<LocationId>> | HttpApiEndpoint.HttpApiEndpoint<"pty.connectToken", "POST", "/api/pty/:ptyID/connect-token", Schema.toCodecStringTree<Schema.Struct<{
66
+ ptyID: Schema.brand<Schema.String, "PtyID"> & {
67
+ create: () => string & import("effect/Brand").Brand<"PtyID">;
68
+ ascending: (id?: string) => string & import("effect/Brand").Brand<"PtyID">;
69
+ };
70
+ }>>, Schema.toCodecStringTree<Schema.Struct<{
71
+ readonly location: Schema.optional<Schema.Struct<{
72
+ readonly directory: Schema.optional<Schema.String>;
73
+ }>>;
74
+ }>>, never, Schema.toCodecStringTree<Schema.Struct<{
75
+ readonly "x-opencode-ticket": Schema.optional<Schema.String>;
76
+ }>>, Schema.toCodecJson<Schema.Struct<{
77
+ readonly location: Schema.Struct<{
78
+ readonly directory: Schema.brand<Schema.String, "AbsolutePath">;
79
+ }>;
80
+ readonly data: Schema.Struct<{
81
+ readonly ticket: Schema.String;
82
+ readonly expires_in: Schema.Int;
83
+ }>;
84
+ }>>, Schema.toCodecJson<typeof ForbiddenError | typeof PtyNotFoundError>, LocationId, HttpApiMiddleware.Requires<LocationId>> | HttpApiEndpoint.HttpApiEndpoint<"pty.create", "POST", "/api/pty", never, Schema.toCodecStringTree<Schema.Struct<{
66
85
  readonly location: Schema.optional<Schema.Struct<{
67
86
  readonly directory: Schema.optional<Schema.String>;
68
87
  }>>;
@@ -89,26 +108,7 @@ export declare const makePtyGroup: <LocationId extends HttpApiMiddleware.AnyId,
89
108
  readonly pid: Schema.Int;
90
109
  readonly exitCode: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Int>>, Schema.optionalKey<Schema.Int>, never, never>;
91
110
  }>;
92
- }>>, never, LocationId, HttpApiMiddleware.Requires<LocationId>> | HttpApiEndpoint.HttpApiEndpoint<"pty.connectToken", "POST", "/api/pty/:ptyID/connect-token", Schema.toCodecStringTree<Schema.Struct<{
93
- ptyID: Schema.brand<Schema.String, "PtyID"> & {
94
- create: () => string & import("effect/Brand").Brand<"PtyID">;
95
- ascending: (id?: string) => string & import("effect/Brand").Brand<"PtyID">;
96
- };
97
- }>>, Schema.toCodecStringTree<Schema.Struct<{
98
- readonly location: Schema.optional<Schema.Struct<{
99
- readonly directory: Schema.optional<Schema.String>;
100
- }>>;
101
- }>>, never, Schema.toCodecStringTree<Schema.Struct<{
102
- readonly "x-opencode-ticket": Schema.optional<Schema.String>;
103
- }>>, Schema.toCodecJson<Schema.Struct<{
104
- readonly location: Schema.Struct<{
105
- readonly directory: Schema.brand<Schema.String, "AbsolutePath">;
106
- }>;
107
- readonly data: Schema.Struct<{
108
- readonly ticket: Schema.String;
109
- readonly expires_in: Schema.Int;
110
- }>;
111
- }>>, Schema.toCodecJson<typeof ForbiddenError | typeof PtyNotFoundError>, LocationId, HttpApiMiddleware.Requires<LocationId>> | HttpApiEndpoint.HttpApiEndpoint<"pty.update", "PUT", "/api/pty/:ptyID", Schema.toCodecStringTree<Schema.Struct<{
111
+ }>>, never, LocationId, HttpApiMiddleware.Requires<LocationId>> | HttpApiEndpoint.HttpApiEndpoint<"pty.update", "PUT", "/api/pty/:ptyID", Schema.toCodecStringTree<Schema.Struct<{
112
112
  ptyID: Schema.brand<Schema.String, "PtyID"> & {
113
113
  create: () => string & import("effect/Brand").Brand<"PtyID">;
114
114
  ascending: (id?: string) => string & import("effect/Brand").Brand<"PtyID">;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/package.json",
3
3
  "name": "@opencode/protocol",
4
- "version": "0.0.0-dev-21130",
4
+ "version": "0.0.0-dev-21132",
5
5
  "type": "module",
6
6
  "license": "MIT",
7
7
  "repository": {
@@ -33,7 +33,7 @@
33
33
  "typecheck": "tsc --noEmit"
34
34
  },
35
35
  "dependencies": {
36
- "@opencode/schema": "0.0.0-dev-21130",
36
+ "@opencode/schema": "0.0.0-dev-21132",
37
37
  "effect": "4.0.1"
38
38
  },
39
39
  "devDependencies": {