@opencode-ai/protocol 0.0.0-next-15234 → 0.0.0-next-15241

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.
@@ -1163,7 +1163,6 @@ export declare const makeSessionGroup: <I extends HttpApiMiddleware.AnyId, S>(se
1163
1163
  }>>>, never, never>;
1164
1164
  }>;
1165
1165
  readonly delivery: Schema.Literals<readonly ["steer", "queue"]>;
1166
- readonly promotedSeq: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Int>>, Schema.optionalKey<Schema.Int>, never, never>;
1167
1166
  readonly admittedSeq: Schema.Int;
1168
1167
  readonly id: Schema.brand<Schema.String, "Session.Message.ID"> & {
1169
1168
  create: () => string & import("effect/Brand").Brand<"Session.Message.ID">;
@@ -1393,7 +1392,6 @@ export declare const makeSessionGroup: <I extends HttpApiMiddleware.AnyId, S>(se
1393
1392
  }>>>, never, never>;
1394
1393
  }>;
1395
1394
  readonly delivery: Schema.Literals<readonly ["steer", "queue"]>;
1396
- readonly promotedSeq: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Int>>, Schema.optionalKey<Schema.Int>, never, never>;
1397
1395
  readonly admittedSeq: Schema.Int;
1398
1396
  readonly id: Schema.brand<Schema.String, "Session.Message.ID"> & {
1399
1397
  create: () => string & import("effect/Brand").Brand<"Session.Message.ID">;
@@ -1441,7 +1439,6 @@ export declare const makeSessionGroup: <I extends HttpApiMiddleware.AnyId, S>(se
1441
1439
  readonly metadata: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Unknown>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Unknown>>, never, never>;
1442
1440
  }>;
1443
1441
  readonly delivery: Schema.Literals<readonly ["steer", "queue"]>;
1444
- readonly promotedSeq: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Int>>, Schema.optionalKey<Schema.Int>, never, never>;
1445
1442
  readonly admittedSeq: Schema.Int;
1446
1443
  readonly id: Schema.brand<Schema.String, "Session.Message.ID"> & {
1447
1444
  create: () => string & import("effect/Brand").Brand<"Session.Message.ID">;
@@ -1476,7 +1473,6 @@ export declare const makeSessionGroup: <I extends HttpApiMiddleware.AnyId, S>(se
1476
1473
  }>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<Schema.Struct<{
1477
1474
  readonly data: Schema.Struct<{
1478
1475
  readonly type: Schema.tag<"compaction">;
1479
- readonly handledSeq: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Int>>, Schema.optionalKey<Schema.Int>, never, never>;
1480
1476
  readonly admittedSeq: Schema.Int;
1481
1477
  readonly id: Schema.brand<Schema.String, "Session.Message.ID"> & {
1482
1478
  create: () => string & import("effect/Brand").Brand<"Session.Message.ID">;
@@ -2017,7 +2013,161 @@ export declare const makeSessionGroup: <I extends HttpApiMiddleware.AnyId, S>(se
2017
2013
  }>;
2018
2014
  readonly type: Schema.tag<"compaction">;
2019
2015
  }>]>]>>;
2020
- }>>, HttpApiEndpoint.Json<typeof UnknownError | typeof SessionNotFoundError>, I, HttpApiMiddleware.Requires<I>> | HttpApiEndpoint.HttpApiEndpoint<"session.instructions.entry.list", "GET", "/api/session/:sessionID/instructions/entries", HttpApiEndpoint.StringTree<Schema.Struct<{
2016
+ }>>, HttpApiEndpoint.Json<typeof UnknownError | typeof SessionNotFoundError>, I, HttpApiMiddleware.Requires<I>> | HttpApiEndpoint.HttpApiEndpoint<"session.pending.list", "GET", "/api/session/:sessionID/pending", HttpApiEndpoint.StringTree<Schema.Struct<{
2017
+ sessionID: Schema.brand<Schema.String, "SessionID"> & {
2018
+ create: () => string & import("effect/Brand").Brand<"SessionID">;
2019
+ descending: (id?: string) => string & import("effect/Brand").Brand<"SessionID">;
2020
+ };
2021
+ }>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<Schema.Struct<{
2022
+ readonly data: Schema.$Array<Schema.Union<readonly [Schema.Struct<{
2023
+ readonly type: Schema.tag<"user">;
2024
+ readonly data: Schema.Struct<{
2025
+ readonly metadata: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Unknown>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Unknown>>, never, never>;
2026
+ readonly text: Schema.String;
2027
+ readonly files: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Array<Schema.Struct<{
2028
+ readonly data: Schema.String;
2029
+ readonly mime: Schema.String;
2030
+ readonly source: Schema.Union<readonly [Schema.Struct<{
2031
+ readonly type: Schema.Literal<"inline">;
2032
+ }>, Schema.Struct<{
2033
+ readonly type: Schema.Literal<"uri">;
2034
+ readonly uri: Schema.String;
2035
+ }>]>;
2036
+ readonly name: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
2037
+ readonly description: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
2038
+ readonly mention: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
2039
+ readonly start: Schema.Finite;
2040
+ readonly end: Schema.Finite;
2041
+ readonly text: Schema.String;
2042
+ }>>>, Schema.optionalKey<Schema.Struct<{
2043
+ readonly start: Schema.Finite;
2044
+ readonly end: Schema.Finite;
2045
+ readonly text: Schema.String;
2046
+ }>>, never, never>;
2047
+ }> & {
2048
+ create: (input: SessionEvent.FileAttachment) => {
2049
+ readonly data: string;
2050
+ readonly mime: string;
2051
+ readonly source: {
2052
+ readonly type: "inline";
2053
+ } | {
2054
+ readonly type: "uri";
2055
+ readonly uri: string;
2056
+ };
2057
+ readonly name?: string | undefined;
2058
+ readonly description?: string | undefined;
2059
+ readonly mention?: {
2060
+ readonly start: number;
2061
+ readonly end: number;
2062
+ readonly text: string;
2063
+ } | undefined;
2064
+ };
2065
+ }>>>, Schema.optionalKey<Schema.$Array<Schema.Struct<{
2066
+ readonly data: Schema.String;
2067
+ readonly mime: Schema.String;
2068
+ readonly source: Schema.Union<readonly [Schema.Struct<{
2069
+ readonly type: Schema.Literal<"inline">;
2070
+ }>, Schema.Struct<{
2071
+ readonly type: Schema.Literal<"uri">;
2072
+ readonly uri: Schema.String;
2073
+ }>]>;
2074
+ readonly name: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
2075
+ readonly description: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
2076
+ readonly mention: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
2077
+ readonly start: Schema.Finite;
2078
+ readonly end: Schema.Finite;
2079
+ readonly text: Schema.String;
2080
+ }>>>, Schema.optionalKey<Schema.Struct<{
2081
+ readonly start: Schema.Finite;
2082
+ readonly end: Schema.Finite;
2083
+ readonly text: Schema.String;
2084
+ }>>, never, never>;
2085
+ }> & {
2086
+ create: (input: SessionEvent.FileAttachment) => {
2087
+ readonly data: string;
2088
+ readonly mime: string;
2089
+ readonly source: {
2090
+ readonly type: "inline";
2091
+ } | {
2092
+ readonly type: "uri";
2093
+ readonly uri: string;
2094
+ };
2095
+ readonly name?: string | undefined;
2096
+ readonly description?: string | undefined;
2097
+ readonly mention?: {
2098
+ readonly start: number;
2099
+ readonly end: number;
2100
+ readonly text: string;
2101
+ } | undefined;
2102
+ };
2103
+ }>>, never, never>;
2104
+ readonly agents: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Array<Schema.Struct<{
2105
+ readonly name: Schema.String;
2106
+ readonly mention: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
2107
+ readonly start: Schema.Finite;
2108
+ readonly end: Schema.Finite;
2109
+ readonly text: Schema.String;
2110
+ }>>>, Schema.optionalKey<Schema.Struct<{
2111
+ readonly start: Schema.Finite;
2112
+ readonly end: Schema.Finite;
2113
+ readonly text: Schema.String;
2114
+ }>>, never, never>;
2115
+ }>>>>, Schema.optionalKey<Schema.$Array<Schema.Struct<{
2116
+ readonly name: Schema.String;
2117
+ readonly mention: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
2118
+ readonly start: Schema.Finite;
2119
+ readonly end: Schema.Finite;
2120
+ readonly text: Schema.String;
2121
+ }>>>, Schema.optionalKey<Schema.Struct<{
2122
+ readonly start: Schema.Finite;
2123
+ readonly end: Schema.Finite;
2124
+ readonly text: Schema.String;
2125
+ }>>, never, never>;
2126
+ }>>>, never, never>;
2127
+ }>;
2128
+ readonly delivery: Schema.Literals<readonly ["steer", "queue"]>;
2129
+ readonly admittedSeq: Schema.Int;
2130
+ readonly id: Schema.brand<Schema.String, "Session.Message.ID"> & {
2131
+ create: () => string & import("effect/Brand").Brand<"Session.Message.ID">;
2132
+ fromEvent: (eventID: Event.ID) => string & import("effect/Brand").Brand<"Session.Message.ID">;
2133
+ };
2134
+ readonly sessionID: Schema.brand<Schema.String, "SessionID"> & {
2135
+ create: () => string & import("effect/Brand").Brand<"SessionID">;
2136
+ descending: (id?: string) => string & import("effect/Brand").Brand<"SessionID">;
2137
+ };
2138
+ readonly timeCreated: Schema.decodeTo<Schema.DateTimeUtc, Schema.Finite, never, never>;
2139
+ }>, Schema.Struct<{
2140
+ readonly type: Schema.tag<"synthetic">;
2141
+ readonly data: Schema.Struct<{
2142
+ readonly text: Schema.String;
2143
+ readonly description: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
2144
+ readonly metadata: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Unknown>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Unknown>>, never, never>;
2145
+ }>;
2146
+ readonly delivery: Schema.Literals<readonly ["steer", "queue"]>;
2147
+ readonly admittedSeq: Schema.Int;
2148
+ readonly id: Schema.brand<Schema.String, "Session.Message.ID"> & {
2149
+ create: () => string & import("effect/Brand").Brand<"Session.Message.ID">;
2150
+ fromEvent: (eventID: Event.ID) => string & import("effect/Brand").Brand<"Session.Message.ID">;
2151
+ };
2152
+ readonly sessionID: Schema.brand<Schema.String, "SessionID"> & {
2153
+ create: () => string & import("effect/Brand").Brand<"SessionID">;
2154
+ descending: (id?: string) => string & import("effect/Brand").Brand<"SessionID">;
2155
+ };
2156
+ readonly timeCreated: Schema.decodeTo<Schema.DateTimeUtc, Schema.Finite, never, never>;
2157
+ }>, Schema.Struct<{
2158
+ readonly type: Schema.tag<"compaction">;
2159
+ readonly admittedSeq: Schema.Int;
2160
+ readonly id: Schema.brand<Schema.String, "Session.Message.ID"> & {
2161
+ create: () => string & import("effect/Brand").Brand<"Session.Message.ID">;
2162
+ fromEvent: (eventID: Event.ID) => string & import("effect/Brand").Brand<"Session.Message.ID">;
2163
+ };
2164
+ readonly sessionID: Schema.brand<Schema.String, "SessionID"> & {
2165
+ create: () => string & import("effect/Brand").Brand<"SessionID">;
2166
+ descending: (id?: string) => string & import("effect/Brand").Brand<"SessionID">;
2167
+ };
2168
+ readonly timeCreated: Schema.decodeTo<Schema.DateTimeUtc, Schema.Finite, never, never>;
2169
+ }>]>>;
2170
+ }>>, HttpApiEndpoint.Json<typeof SessionNotFoundError>, I, HttpApiMiddleware.Requires<I>> | HttpApiEndpoint.HttpApiEndpoint<"session.instructions.entry.list", "GET", "/api/session/:sessionID/instructions/entries", HttpApiEndpoint.StringTree<Schema.Struct<{
2021
2171
  sessionID: Schema.brand<Schema.String, "SessionID"> & {
2022
2172
  create: () => string & import("effect/Brand").Brand<"SessionID">;
2023
2173
  descending: (id?: string) => string & import("effect/Brand").Brand<"SessionID">;
@@ -1,5 +1,5 @@
1
1
  import { SessionMessage } from "@opencode-ai/schema/session-message";
2
- import { SessionInput } from "@opencode-ai/schema/session-input";
2
+ import { SessionPending } from "@opencode-ai/schema/session-pending";
3
3
  import { PromptInput } from "@opencode-ai/schema/prompt-input";
4
4
  import { Session } from "@opencode-ai/schema/session";
5
5
  import { InstructionEntry } from "@opencode-ai/schema/instruction-entry";
@@ -214,11 +214,11 @@ export const makeSessionGroup = (sessionLocationMiddleware) => HttpApiGroup.make
214
214
  payload: Schema.Struct({
215
215
  id: SessionMessage.ID.pipe(Schema.optional),
216
216
  ...PromptInput.Prompt.fields,
217
- metadata: SessionInput.UserData.fields.metadata,
218
- delivery: SessionInput.Delivery.pipe(Schema.optional),
217
+ metadata: SessionPending.UserData.fields.metadata,
218
+ delivery: SessionPending.Delivery.pipe(Schema.optional),
219
219
  resume: Schema.Boolean.pipe(Schema.optional),
220
220
  }),
221
- success: Schema.Struct({ data: SessionInput.User }),
221
+ success: Schema.Struct({ data: SessionPending.User }),
222
222
  error: [ConflictError, InvalidRequestError, SessionNotFoundError],
223
223
  })
224
224
  .middleware(sessionLocationMiddleware)
@@ -237,10 +237,10 @@ export const makeSessionGroup = (sessionLocationMiddleware) => HttpApiGroup.make
237
237
  model: Model.Ref.pipe(Schema.optional),
238
238
  files: PromptInput.Prompt.fields.files,
239
239
  agents: PromptInput.Prompt.fields.agents,
240
- delivery: SessionInput.Delivery.pipe(Schema.optional),
240
+ delivery: SessionPending.Delivery.pipe(Schema.optional),
241
241
  resume: Schema.Boolean.pipe(Schema.optional),
242
242
  }),
243
- success: Schema.Struct({ data: SessionInput.User }),
243
+ success: Schema.Struct({ data: SessionPending.User }),
244
244
  error: [ConflictError, InvalidRequestError, SessionNotFoundError, CommandNotFoundError, CommandEvaluationError],
245
245
  })
246
246
  .middleware(sessionLocationMiddleware)
@@ -272,10 +272,10 @@ export const makeSessionGroup = (sessionLocationMiddleware) => HttpApiGroup.make
272
272
  text: Schema.String,
273
273
  description: Schema.String.pipe(Schema.optional),
274
274
  metadata: SessionMessage.Synthetic.fields.metadata,
275
- delivery: SessionInput.Delivery.pipe(Schema.optional),
275
+ delivery: SessionPending.Delivery.pipe(Schema.optional),
276
276
  resume: Schema.Boolean.pipe(Schema.optional),
277
277
  }),
278
- success: Schema.Struct({ data: SessionInput.Synthetic }),
278
+ success: Schema.Struct({ data: SessionPending.Synthetic }),
279
279
  error: [ConflictError, SessionNotFoundError],
280
280
  })
281
281
  .middleware(sessionLocationMiddleware)
@@ -302,7 +302,7 @@ export const makeSessionGroup = (sessionLocationMiddleware) => HttpApiGroup.make
302
302
  .add(HttpApiEndpoint.post("session.compact", "/api/session/:sessionID/compact", {
303
303
  params: { sessionID: Session.ID },
304
304
  payload: Schema.Struct({ id: SessionMessage.ID.pipe(Schema.optional) }),
305
- success: Schema.Struct({ data: SessionInput.Compaction }),
305
+ success: Schema.Struct({ data: SessionPending.Compaction }),
306
306
  error: [ConflictError, SessionNotFoundError],
307
307
  })
308
308
  .middleware(sessionLocationMiddleware)
@@ -358,6 +358,17 @@ export const makeSessionGroup = (sessionLocationMiddleware) => HttpApiGroup.make
358
358
  identifier: "v2.session.context",
359
359
  summary: "Get session context",
360
360
  description: "Retrieve the active context messages for a session (all messages after the last compaction).",
361
+ })))
362
+ .add(HttpApiEndpoint.get("session.pending.list", "/api/session/:sessionID/pending", {
363
+ params: { sessionID: Session.ID },
364
+ success: Schema.Struct({ data: Schema.Array(SessionPending.Info) }),
365
+ error: SessionNotFoundError,
366
+ })
367
+ .middleware(sessionLocationMiddleware)
368
+ .annotateMerge(OpenApi.annotations({
369
+ identifier: "v2.session.pending.list",
370
+ summary: "List pending session work",
371
+ description: "List durable admitted session work not yet visible in projected history, ordered by admission. Includes unpromoted user and synthetic inputs and unhandled compaction barriers. The runner owns consumption; items disappear once promoted or handled.",
361
372
  })))
362
373
  .add(HttpApiEndpoint.get("session.instructions.entry.list", "/api/session/:sessionID/instructions/entries", {
363
374
  params: { sessionID: Session.ID },
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/package.json",
3
3
  "name": "@opencode-ai/protocol",
4
- "version": "0.0.0-next-15234",
4
+ "version": "0.0.0-next-15241",
5
5
  "type": "module",
6
6
  "license": "MIT",
7
7
  "repository": {
@@ -26,7 +26,7 @@
26
26
  "typecheck": "tsgo --noEmit"
27
27
  },
28
28
  "dependencies": {
29
- "@opencode-ai/schema": "0.0.0-next-15234",
29
+ "@opencode-ai/schema": "0.0.0-next-15241",
30
30
  "effect": "4.0.0-beta.83"
31
31
  },
32
32
  "devDependencies": {