@opencode-ai/protocol 0.0.0-next-15029 → 0.0.0-next-15036

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.
@@ -3011,6 +3011,64 @@ export declare const EventGroup: HttpApiGroup.HttpApiGroup<"server.event", HttpA
3011
3011
  descending: (id?: string) => string & import("effect/Brand").Brand<"SessionID">;
3012
3012
  };
3013
3013
  }>;
3014
+ }) | (Schema.Struct<{
3015
+ readonly id: Schema.brand<Schema.String, "Event.ID"> & {
3016
+ create: () => string & import("effect/Brand").Brand<"Event.ID">;
3017
+ };
3018
+ readonly created: Schema.decodeTo<Schema.DateTimeUtc, Schema.Finite, never, never>;
3019
+ readonly metadata: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Unknown>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Unknown>>, never, never>;
3020
+ readonly type: Schema.Literal<"session.compaction.admitted">;
3021
+ readonly durable: Schema.Struct<{
3022
+ readonly aggregateID: Schema.String;
3023
+ readonly seq: Schema.brand<Schema.Int, "Event.Seq">;
3024
+ readonly version: Schema.brand<Schema.Int, "Event.Version">;
3025
+ }>;
3026
+ readonly location: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
3027
+ readonly directory: Schema.brand<Schema.String, "AbsolutePath">;
3028
+ readonly workspaceID: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.String, "WorkspaceV2.ID"> & {
3029
+ ascending: (id?: string) => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
3030
+ create: () => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
3031
+ }>>, Schema.optionalKey<Schema.brand<Schema.String, "WorkspaceV2.ID"> & {
3032
+ ascending: (id?: string) => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
3033
+ create: () => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
3034
+ }>, never, never>;
3035
+ }>>>, Schema.optionalKey<Schema.Struct<{
3036
+ readonly directory: Schema.brand<Schema.String, "AbsolutePath">;
3037
+ readonly workspaceID: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.String, "WorkspaceV2.ID"> & {
3038
+ ascending: (id?: string) => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
3039
+ create: () => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
3040
+ }>>, Schema.optionalKey<Schema.brand<Schema.String, "WorkspaceV2.ID"> & {
3041
+ ascending: (id?: string) => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
3042
+ create: () => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
3043
+ }>, never, never>;
3044
+ }>>, never, never>;
3045
+ readonly data: Schema.Struct<{
3046
+ readonly inputID: Schema.brand<Schema.String, "Session.Message.ID"> & {
3047
+ create: () => string & import("effect/Brand").Brand<"Session.Message.ID">;
3048
+ fromEvent: (eventID: Event.ID) => string & import("effect/Brand").Brand<"Session.Message.ID">;
3049
+ };
3050
+ readonly sessionID: Schema.brand<Schema.String, "SessionID"> & {
3051
+ create: () => string & import("effect/Brand").Brand<"SessionID">;
3052
+ descending: (id?: string) => string & import("effect/Brand").Brand<"SessionID">;
3053
+ };
3054
+ }>;
3055
+ }> & {
3056
+ type: "session.compaction.admitted";
3057
+ durability: "durable";
3058
+ durable: {
3059
+ readonly version: number;
3060
+ readonly aggregate: string;
3061
+ };
3062
+ data: Schema.Struct<{
3063
+ readonly inputID: Schema.brand<Schema.String, "Session.Message.ID"> & {
3064
+ create: () => string & import("effect/Brand").Brand<"Session.Message.ID">;
3065
+ fromEvent: (eventID: Event.ID) => string & import("effect/Brand").Brand<"Session.Message.ID">;
3066
+ };
3067
+ readonly sessionID: Schema.brand<Schema.String, "SessionID"> & {
3068
+ create: () => string & import("effect/Brand").Brand<"SessionID">;
3069
+ descending: (id?: string) => string & import("effect/Brand").Brand<"SessionID">;
3070
+ };
3071
+ }>;
3014
3072
  }) | (Schema.Struct<{
3015
3073
  readonly id: Schema.brand<Schema.String, "Event.ID"> & {
3016
3074
  create: () => string & import("effect/Brand").Brand<"Event.ID">;
@@ -3163,6 +3221,56 @@ export declare const EventGroup: HttpApiGroup.HttpApiGroup<"server.event", HttpA
3163
3221
  descending: (id?: string) => string & import("effect/Brand").Brand<"SessionID">;
3164
3222
  };
3165
3223
  }>;
3224
+ }) | (Schema.Struct<{
3225
+ readonly id: Schema.brand<Schema.String, "Event.ID"> & {
3226
+ create: () => string & import("effect/Brand").Brand<"Event.ID">;
3227
+ };
3228
+ readonly created: Schema.decodeTo<Schema.DateTimeUtc, Schema.Finite, never, never>;
3229
+ readonly metadata: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Unknown>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Unknown>>, never, never>;
3230
+ readonly type: Schema.Literal<"session.compaction.failed">;
3231
+ readonly durable: Schema.Struct<{
3232
+ readonly aggregateID: Schema.String;
3233
+ readonly seq: Schema.brand<Schema.Int, "Event.Seq">;
3234
+ readonly version: Schema.brand<Schema.Int, "Event.Version">;
3235
+ }>;
3236
+ readonly location: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
3237
+ readonly directory: Schema.brand<Schema.String, "AbsolutePath">;
3238
+ readonly workspaceID: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.String, "WorkspaceV2.ID"> & {
3239
+ ascending: (id?: string) => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
3240
+ create: () => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
3241
+ }>>, Schema.optionalKey<Schema.brand<Schema.String, "WorkspaceV2.ID"> & {
3242
+ ascending: (id?: string) => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
3243
+ create: () => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
3244
+ }>, never, never>;
3245
+ }>>>, Schema.optionalKey<Schema.Struct<{
3246
+ readonly directory: Schema.brand<Schema.String, "AbsolutePath">;
3247
+ readonly workspaceID: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.String, "WorkspaceV2.ID"> & {
3248
+ ascending: (id?: string) => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
3249
+ create: () => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
3250
+ }>>, Schema.optionalKey<Schema.brand<Schema.String, "WorkspaceV2.ID"> & {
3251
+ ascending: (id?: string) => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
3252
+ create: () => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
3253
+ }>, never, never>;
3254
+ }>>, never, never>;
3255
+ readonly data: Schema.Struct<{
3256
+ sessionID: Schema.brand<Schema.String, "SessionID"> & {
3257
+ create: () => string & import("effect/Brand").Brand<"SessionID">;
3258
+ descending: (id?: string) => string & import("effect/Brand").Brand<"SessionID">;
3259
+ };
3260
+ }>;
3261
+ }> & {
3262
+ type: "session.compaction.failed";
3263
+ durability: "durable";
3264
+ durable: {
3265
+ readonly version: number;
3266
+ readonly aggregate: string;
3267
+ };
3268
+ data: Schema.Struct<{
3269
+ sessionID: Schema.brand<Schema.String, "SessionID"> & {
3270
+ create: () => string & import("effect/Brand").Brand<"SessionID">;
3271
+ descending: (id?: string) => string & import("effect/Brand").Brand<"SessionID">;
3272
+ };
3273
+ }>;
3166
3274
  }) | (Schema.Struct<{
3167
3275
  readonly id: Schema.brand<Schema.String, "Event.ID"> & {
3168
3276
  create: () => string & import("effect/Brand").Brand<"Event.ID">;
@@ -8636,6 +8744,26 @@ export declare const EventGroup: HttpApiGroup.HttpApiGroup<"server.event", HttpA
8636
8744
  readonly directory: string & import("effect/Brand").Brand<"AbsolutePath">;
8637
8745
  readonly workspaceID?: (string & import("effect/Brand").Brand<"WorkspaceV2.ID">) | undefined;
8638
8746
  } | undefined;
8747
+ } | {
8748
+ readonly id: string & import("effect/Brand").Brand<"Event.ID">;
8749
+ readonly created: import("effect/DateTime").Utc;
8750
+ readonly type: "session.compaction.admitted";
8751
+ readonly durable: {
8752
+ readonly aggregateID: string;
8753
+ readonly seq: number & import("effect/Brand").Brand<"Event.Seq">;
8754
+ readonly version: number & import("effect/Brand").Brand<"Event.Version">;
8755
+ };
8756
+ readonly data: {
8757
+ readonly inputID: string & import("effect/Brand").Brand<"Session.Message.ID">;
8758
+ readonly sessionID: string & import("effect/Brand").Brand<"SessionID">;
8759
+ };
8760
+ readonly metadata?: {
8761
+ readonly [x: string]: unknown;
8762
+ } | undefined;
8763
+ readonly location?: {
8764
+ readonly directory: string & import("effect/Brand").Brand<"AbsolutePath">;
8765
+ readonly workspaceID?: (string & import("effect/Brand").Brand<"WorkspaceV2.ID">) | undefined;
8766
+ } | undefined;
8639
8767
  } | {
8640
8768
  readonly id: string & import("effect/Brand").Brand<"Event.ID">;
8641
8769
  readonly created: import("effect/DateTime").Utc;
@@ -8693,6 +8821,25 @@ export declare const EventGroup: HttpApiGroup.HttpApiGroup<"server.event", HttpA
8693
8821
  readonly directory: string & import("effect/Brand").Brand<"AbsolutePath">;
8694
8822
  readonly workspaceID?: (string & import("effect/Brand").Brand<"WorkspaceV2.ID">) | undefined;
8695
8823
  } | undefined;
8824
+ } | {
8825
+ readonly id: string & import("effect/Brand").Brand<"Event.ID">;
8826
+ readonly created: import("effect/DateTime").Utc;
8827
+ readonly type: "session.compaction.failed";
8828
+ readonly durable: {
8829
+ readonly aggregateID: string;
8830
+ readonly seq: number & import("effect/Brand").Brand<"Event.Seq">;
8831
+ readonly version: number & import("effect/Brand").Brand<"Event.Version">;
8832
+ };
8833
+ readonly data: {
8834
+ readonly sessionID: string & import("effect/Brand").Brand<"SessionID">;
8835
+ };
8836
+ readonly metadata?: {
8837
+ readonly [x: string]: unknown;
8838
+ } | undefined;
8839
+ readonly location?: {
8840
+ readonly directory: string & import("effect/Brand").Brand<"AbsolutePath">;
8841
+ readonly workspaceID?: (string & import("effect/Brand").Brand<"WorkspaceV2.ID">) | undefined;
8842
+ } | undefined;
8696
8843
  } | {
8697
8844
  readonly id: string & import("effect/Brand").Brand<"Event.ID">;
8698
8845
  readonly created: import("effect/DateTime").Utc;
@@ -13222,6 +13369,64 @@ export declare const OpenCodeEvent: Schema.Union<readonly [Schema.Struct<{
13222
13369
  descending: (id?: string) => string & import("effect/Brand").Brand<"SessionID">;
13223
13370
  };
13224
13371
  }>;
13372
+ }) | (Schema.Struct<{
13373
+ readonly id: Schema.brand<Schema.String, "Event.ID"> & {
13374
+ create: () => string & import("effect/Brand").Brand<"Event.ID">;
13375
+ };
13376
+ readonly created: Schema.decodeTo<Schema.DateTimeUtc, Schema.Finite, never, never>;
13377
+ readonly metadata: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Unknown>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Unknown>>, never, never>;
13378
+ readonly type: Schema.Literal<"session.compaction.admitted">;
13379
+ readonly durable: Schema.Struct<{
13380
+ readonly aggregateID: Schema.String;
13381
+ readonly seq: Schema.brand<Schema.Int, "Event.Seq">;
13382
+ readonly version: Schema.brand<Schema.Int, "Event.Version">;
13383
+ }>;
13384
+ readonly location: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
13385
+ readonly directory: Schema.brand<Schema.String, "AbsolutePath">;
13386
+ readonly workspaceID: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.String, "WorkspaceV2.ID"> & {
13387
+ ascending: (id?: string) => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
13388
+ create: () => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
13389
+ }>>, Schema.optionalKey<Schema.brand<Schema.String, "WorkspaceV2.ID"> & {
13390
+ ascending: (id?: string) => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
13391
+ create: () => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
13392
+ }>, never, never>;
13393
+ }>>>, Schema.optionalKey<Schema.Struct<{
13394
+ readonly directory: Schema.brand<Schema.String, "AbsolutePath">;
13395
+ readonly workspaceID: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.String, "WorkspaceV2.ID"> & {
13396
+ ascending: (id?: string) => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
13397
+ create: () => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
13398
+ }>>, Schema.optionalKey<Schema.brand<Schema.String, "WorkspaceV2.ID"> & {
13399
+ ascending: (id?: string) => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
13400
+ create: () => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
13401
+ }>, never, never>;
13402
+ }>>, never, never>;
13403
+ readonly data: Schema.Struct<{
13404
+ readonly inputID: Schema.brand<Schema.String, "Session.Message.ID"> & {
13405
+ create: () => string & import("effect/Brand").Brand<"Session.Message.ID">;
13406
+ fromEvent: (eventID: Event.ID) => string & import("effect/Brand").Brand<"Session.Message.ID">;
13407
+ };
13408
+ readonly sessionID: Schema.brand<Schema.String, "SessionID"> & {
13409
+ create: () => string & import("effect/Brand").Brand<"SessionID">;
13410
+ descending: (id?: string) => string & import("effect/Brand").Brand<"SessionID">;
13411
+ };
13412
+ }>;
13413
+ }> & {
13414
+ type: "session.compaction.admitted";
13415
+ durability: "durable";
13416
+ durable: {
13417
+ readonly version: number;
13418
+ readonly aggregate: string;
13419
+ };
13420
+ data: Schema.Struct<{
13421
+ readonly inputID: Schema.brand<Schema.String, "Session.Message.ID"> & {
13422
+ create: () => string & import("effect/Brand").Brand<"Session.Message.ID">;
13423
+ fromEvent: (eventID: Event.ID) => string & import("effect/Brand").Brand<"Session.Message.ID">;
13424
+ };
13425
+ readonly sessionID: Schema.brand<Schema.String, "SessionID"> & {
13426
+ create: () => string & import("effect/Brand").Brand<"SessionID">;
13427
+ descending: (id?: string) => string & import("effect/Brand").Brand<"SessionID">;
13428
+ };
13429
+ }>;
13225
13430
  }) | (Schema.Struct<{
13226
13431
  readonly id: Schema.brand<Schema.String, "Event.ID"> & {
13227
13432
  create: () => string & import("effect/Brand").Brand<"Event.ID">;
@@ -13374,6 +13579,56 @@ export declare const OpenCodeEvent: Schema.Union<readonly [Schema.Struct<{
13374
13579
  descending: (id?: string) => string & import("effect/Brand").Brand<"SessionID">;
13375
13580
  };
13376
13581
  }>;
13582
+ }) | (Schema.Struct<{
13583
+ readonly id: Schema.brand<Schema.String, "Event.ID"> & {
13584
+ create: () => string & import("effect/Brand").Brand<"Event.ID">;
13585
+ };
13586
+ readonly created: Schema.decodeTo<Schema.DateTimeUtc, Schema.Finite, never, never>;
13587
+ readonly metadata: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Unknown>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Unknown>>, never, never>;
13588
+ readonly type: Schema.Literal<"session.compaction.failed">;
13589
+ readonly durable: Schema.Struct<{
13590
+ readonly aggregateID: Schema.String;
13591
+ readonly seq: Schema.brand<Schema.Int, "Event.Seq">;
13592
+ readonly version: Schema.brand<Schema.Int, "Event.Version">;
13593
+ }>;
13594
+ readonly location: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
13595
+ readonly directory: Schema.brand<Schema.String, "AbsolutePath">;
13596
+ readonly workspaceID: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.String, "WorkspaceV2.ID"> & {
13597
+ ascending: (id?: string) => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
13598
+ create: () => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
13599
+ }>>, Schema.optionalKey<Schema.brand<Schema.String, "WorkspaceV2.ID"> & {
13600
+ ascending: (id?: string) => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
13601
+ create: () => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
13602
+ }>, never, never>;
13603
+ }>>>, Schema.optionalKey<Schema.Struct<{
13604
+ readonly directory: Schema.brand<Schema.String, "AbsolutePath">;
13605
+ readonly workspaceID: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.String, "WorkspaceV2.ID"> & {
13606
+ ascending: (id?: string) => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
13607
+ create: () => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
13608
+ }>>, Schema.optionalKey<Schema.brand<Schema.String, "WorkspaceV2.ID"> & {
13609
+ ascending: (id?: string) => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
13610
+ create: () => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
13611
+ }>, never, never>;
13612
+ }>>, never, never>;
13613
+ readonly data: Schema.Struct<{
13614
+ sessionID: Schema.brand<Schema.String, "SessionID"> & {
13615
+ create: () => string & import("effect/Brand").Brand<"SessionID">;
13616
+ descending: (id?: string) => string & import("effect/Brand").Brand<"SessionID">;
13617
+ };
13618
+ }>;
13619
+ }> & {
13620
+ type: "session.compaction.failed";
13621
+ durability: "durable";
13622
+ durable: {
13623
+ readonly version: number;
13624
+ readonly aggregate: string;
13625
+ };
13626
+ data: Schema.Struct<{
13627
+ sessionID: Schema.brand<Schema.String, "SessionID"> & {
13628
+ create: () => string & import("effect/Brand").Brand<"SessionID">;
13629
+ descending: (id?: string) => string & import("effect/Brand").Brand<"SessionID">;
13630
+ };
13631
+ }>;
13377
13632
  }) | (Schema.Struct<{
13378
13633
  readonly id: Schema.brand<Schema.String, "Event.ID"> & {
13379
13634
  create: () => string & import("effect/Brand").Brand<"Event.ID">;
@@ -521,6 +521,7 @@ export declare const MessageGroup: HttpApiGroup.HttpApiGroup<"server.message", H
521
521
  readonly created: Schema.decodeTo<Schema.DateTimeUtc, Schema.Finite, never, never>;
522
522
  }>;
523
523
  readonly type: Schema.Literal<"compaction">;
524
+ readonly status: Schema.Literals<readonly ["queued", "running", "completed", "failed"]>;
524
525
  readonly reason: Schema.Literals<readonly ["auto", "manual"]>;
525
526
  readonly summary: Schema.String;
526
527
  readonly recent: Schema.String;
@@ -1476,7 +1476,27 @@ export declare const makeSessionGroup: <I extends HttpApiMiddleware.AnyId, S>(se
1476
1476
  create: () => string & import("effect/Brand").Brand<"SessionID">;
1477
1477
  descending: (id?: string) => string & import("effect/Brand").Brand<"SessionID">;
1478
1478
  };
1479
- }>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<never>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<HttpApiSchema.NoContent>, HttpApiEndpoint.Json<typeof SessionBusyError | typeof ServiceUnavailableError | typeof UnknownError | typeof SessionNotFoundError>, I, HttpApiMiddleware.Requires<I>> | HttpApiEndpoint.HttpApiEndpoint<"session.wait", "POST", "/api/session/:sessionID/wait", HttpApiEndpoint.StringTree<Schema.Struct<{
1479
+ }>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<Schema.Struct<{
1480
+ readonly id: Schema.optional<Schema.brand<Schema.String, "Session.Message.ID"> & {
1481
+ create: () => string & import("effect/Brand").Brand<"Session.Message.ID">;
1482
+ fromEvent: (eventID: Event.ID) => string & import("effect/Brand").Brand<"Session.Message.ID">;
1483
+ }>;
1484
+ }>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<Schema.Struct<{
1485
+ readonly data: Schema.Struct<{
1486
+ readonly type: Schema.Literal<"compaction">;
1487
+ readonly admittedSeq: Schema.Int;
1488
+ readonly id: Schema.brand<Schema.String, "Session.Message.ID"> & {
1489
+ create: () => string & import("effect/Brand").Brand<"Session.Message.ID">;
1490
+ fromEvent: (eventID: Event.ID) => string & import("effect/Brand").Brand<"Session.Message.ID">;
1491
+ };
1492
+ readonly sessionID: Schema.brand<Schema.String, "SessionID"> & {
1493
+ create: () => string & import("effect/Brand").Brand<"SessionID">;
1494
+ descending: (id?: string) => string & import("effect/Brand").Brand<"SessionID">;
1495
+ };
1496
+ readonly timeCreated: Schema.decodeTo<Schema.DateTimeUtc, Schema.Finite, never, never>;
1497
+ readonly handledSeq: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Int>>, Schema.optionalKey<Schema.Int>, never, never>;
1498
+ }>;
1499
+ }>>, HttpApiEndpoint.Json<typeof ConflictError | typeof SessionNotFoundError>, I, HttpApiMiddleware.Requires<I>> | HttpApiEndpoint.HttpApiEndpoint<"session.wait", "POST", "/api/session/:sessionID/wait", HttpApiEndpoint.StringTree<Schema.Struct<{
1480
1500
  sessionID: Schema.brand<Schema.String, "SessionID"> & {
1481
1501
  create: () => string & import("effect/Brand").Brand<"SessionID">;
1482
1502
  descending: (id?: string) => string & import("effect/Brand").Brand<"SessionID">;
@@ -2036,6 +2056,7 @@ export declare const makeSessionGroup: <I extends HttpApiMiddleware.AnyId, S>(se
2036
2056
  readonly created: Schema.decodeTo<Schema.DateTimeUtc, Schema.Finite, never, never>;
2037
2057
  }>;
2038
2058
  readonly type: Schema.Literal<"compaction">;
2059
+ readonly status: Schema.Literals<readonly ["queued", "running", "completed", "failed"]>;
2039
2060
  readonly reason: Schema.Literals<readonly ["auto", "manual"]>;
2040
2061
  readonly summary: Schema.String;
2041
2062
  readonly recent: Schema.String;
@@ -4444,6 +4465,64 @@ export declare const makeSessionGroup: <I extends HttpApiMiddleware.AnyId, S>(se
4444
4465
  descending: (id?: string) => string & import("effect/Brand").Brand<"SessionID">;
4445
4466
  };
4446
4467
  }>;
4468
+ }) | (Schema.Struct<{
4469
+ readonly id: Schema.brand<Schema.String, "Event.ID"> & {
4470
+ create: () => string & import("effect/Brand").Brand<"Event.ID">;
4471
+ };
4472
+ readonly created: Schema.decodeTo<Schema.DateTimeUtc, Schema.Finite, never, never>;
4473
+ readonly metadata: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Unknown>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Unknown>>, never, never>;
4474
+ readonly type: Schema.Literal<"session.compaction.admitted">;
4475
+ readonly durable: Schema.Struct<{
4476
+ readonly aggregateID: Schema.String;
4477
+ readonly seq: Schema.brand<Schema.Int, "Event.Seq">;
4478
+ readonly version: Schema.brand<Schema.Int, "Event.Version">;
4479
+ }>;
4480
+ readonly location: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
4481
+ readonly directory: Schema.brand<Schema.String, "AbsolutePath">;
4482
+ readonly workspaceID: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.String, "WorkspaceV2.ID"> & {
4483
+ ascending: (id?: string) => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
4484
+ create: () => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
4485
+ }>>, Schema.optionalKey<Schema.brand<Schema.String, "WorkspaceV2.ID"> & {
4486
+ ascending: (id?: string) => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
4487
+ create: () => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
4488
+ }>, never, never>;
4489
+ }>>>, Schema.optionalKey<Schema.Struct<{
4490
+ readonly directory: Schema.brand<Schema.String, "AbsolutePath">;
4491
+ readonly workspaceID: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.String, "WorkspaceV2.ID"> & {
4492
+ ascending: (id?: string) => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
4493
+ create: () => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
4494
+ }>>, Schema.optionalKey<Schema.brand<Schema.String, "WorkspaceV2.ID"> & {
4495
+ ascending: (id?: string) => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
4496
+ create: () => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
4497
+ }>, never, never>;
4498
+ }>>, never, never>;
4499
+ readonly data: Schema.Struct<{
4500
+ readonly inputID: Schema.brand<Schema.String, "Session.Message.ID"> & {
4501
+ create: () => string & import("effect/Brand").Brand<"Session.Message.ID">;
4502
+ fromEvent: (eventID: Event.ID) => string & import("effect/Brand").Brand<"Session.Message.ID">;
4503
+ };
4504
+ readonly sessionID: Schema.brand<Schema.String, "SessionID"> & {
4505
+ create: () => string & import("effect/Brand").Brand<"SessionID">;
4506
+ descending: (id?: string) => string & import("effect/Brand").Brand<"SessionID">;
4507
+ };
4508
+ }>;
4509
+ }> & {
4510
+ type: "session.compaction.admitted";
4511
+ durability: "durable";
4512
+ durable: {
4513
+ readonly version: number;
4514
+ readonly aggregate: string;
4515
+ };
4516
+ data: Schema.Struct<{
4517
+ readonly inputID: Schema.brand<Schema.String, "Session.Message.ID"> & {
4518
+ create: () => string & import("effect/Brand").Brand<"Session.Message.ID">;
4519
+ fromEvent: (eventID: Event.ID) => string & import("effect/Brand").Brand<"Session.Message.ID">;
4520
+ };
4521
+ readonly sessionID: Schema.brand<Schema.String, "SessionID"> & {
4522
+ create: () => string & import("effect/Brand").Brand<"SessionID">;
4523
+ descending: (id?: string) => string & import("effect/Brand").Brand<"SessionID">;
4524
+ };
4525
+ }>;
4447
4526
  }) | (Schema.Struct<{
4448
4527
  readonly id: Schema.brand<Schema.String, "Event.ID"> & {
4449
4528
  create: () => string & import("effect/Brand").Brand<"Event.ID">;
@@ -4552,6 +4631,56 @@ export declare const makeSessionGroup: <I extends HttpApiMiddleware.AnyId, S>(se
4552
4631
  descending: (id?: string) => string & import("effect/Brand").Brand<"SessionID">;
4553
4632
  };
4554
4633
  }>;
4634
+ }) | (Schema.Struct<{
4635
+ readonly id: Schema.brand<Schema.String, "Event.ID"> & {
4636
+ create: () => string & import("effect/Brand").Brand<"Event.ID">;
4637
+ };
4638
+ readonly created: Schema.decodeTo<Schema.DateTimeUtc, Schema.Finite, never, never>;
4639
+ readonly metadata: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Unknown>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Unknown>>, never, never>;
4640
+ readonly type: Schema.Literal<"session.compaction.failed">;
4641
+ readonly durable: Schema.Struct<{
4642
+ readonly aggregateID: Schema.String;
4643
+ readonly seq: Schema.brand<Schema.Int, "Event.Seq">;
4644
+ readonly version: Schema.brand<Schema.Int, "Event.Version">;
4645
+ }>;
4646
+ readonly location: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
4647
+ readonly directory: Schema.brand<Schema.String, "AbsolutePath">;
4648
+ readonly workspaceID: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.String, "WorkspaceV2.ID"> & {
4649
+ ascending: (id?: string) => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
4650
+ create: () => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
4651
+ }>>, Schema.optionalKey<Schema.brand<Schema.String, "WorkspaceV2.ID"> & {
4652
+ ascending: (id?: string) => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
4653
+ create: () => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
4654
+ }>, never, never>;
4655
+ }>>>, Schema.optionalKey<Schema.Struct<{
4656
+ readonly directory: Schema.brand<Schema.String, "AbsolutePath">;
4657
+ readonly workspaceID: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.String, "WorkspaceV2.ID"> & {
4658
+ ascending: (id?: string) => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
4659
+ create: () => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
4660
+ }>>, Schema.optionalKey<Schema.brand<Schema.String, "WorkspaceV2.ID"> & {
4661
+ ascending: (id?: string) => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
4662
+ create: () => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
4663
+ }>, never, never>;
4664
+ }>>, never, never>;
4665
+ readonly data: Schema.Struct<{
4666
+ sessionID: Schema.brand<Schema.String, "SessionID"> & {
4667
+ create: () => string & import("effect/Brand").Brand<"SessionID">;
4668
+ descending: (id?: string) => string & import("effect/Brand").Brand<"SessionID">;
4669
+ };
4670
+ }>;
4671
+ }> & {
4672
+ type: "session.compaction.failed";
4673
+ durability: "durable";
4674
+ durable: {
4675
+ readonly version: number;
4676
+ readonly aggregate: string;
4677
+ };
4678
+ data: Schema.Struct<{
4679
+ sessionID: Schema.brand<Schema.String, "SessionID"> & {
4680
+ create: () => string & import("effect/Brand").Brand<"SessionID">;
4681
+ descending: (id?: string) => string & import("effect/Brand").Brand<"SessionID">;
4682
+ };
4683
+ }>;
4555
4684
  }) | (Schema.Struct<{
4556
4685
  readonly id: Schema.brand<Schema.String, "Event.ID"> & {
4557
4686
  create: () => string & import("effect/Brand").Brand<"Event.ID">;
@@ -5555,6 +5684,26 @@ export declare const makeSessionGroup: <I extends HttpApiMiddleware.AnyId, S>(se
5555
5684
  readonly directory: string & import("effect/Brand").Brand<"AbsolutePath">;
5556
5685
  readonly workspaceID?: (string & import("effect/Brand").Brand<"WorkspaceV2.ID">) | undefined;
5557
5686
  } | undefined;
5687
+ } | {
5688
+ readonly id: string & import("effect/Brand").Brand<"Event.ID">;
5689
+ readonly created: import("effect/DateTime").Utc;
5690
+ readonly type: "session.compaction.admitted";
5691
+ readonly durable: {
5692
+ readonly aggregateID: string;
5693
+ readonly seq: number & import("effect/Brand").Brand<"Event.Seq">;
5694
+ readonly version: number & import("effect/Brand").Brand<"Event.Version">;
5695
+ };
5696
+ readonly data: {
5697
+ readonly inputID: string & import("effect/Brand").Brand<"Session.Message.ID">;
5698
+ readonly sessionID: string & import("effect/Brand").Brand<"SessionID">;
5699
+ };
5700
+ readonly metadata?: {
5701
+ readonly [x: string]: unknown;
5702
+ } | undefined;
5703
+ readonly location?: {
5704
+ readonly directory: string & import("effect/Brand").Brand<"AbsolutePath">;
5705
+ readonly workspaceID?: (string & import("effect/Brand").Brand<"WorkspaceV2.ID">) | undefined;
5706
+ } | undefined;
5558
5707
  } | {
5559
5708
  readonly id: string & import("effect/Brand").Brand<"Event.ID">;
5560
5709
  readonly created: import("effect/DateTime").Utc;
@@ -5597,6 +5746,25 @@ export declare const makeSessionGroup: <I extends HttpApiMiddleware.AnyId, S>(se
5597
5746
  readonly directory: string & import("effect/Brand").Brand<"AbsolutePath">;
5598
5747
  readonly workspaceID?: (string & import("effect/Brand").Brand<"WorkspaceV2.ID">) | undefined;
5599
5748
  } | undefined;
5749
+ } | {
5750
+ readonly id: string & import("effect/Brand").Brand<"Event.ID">;
5751
+ readonly created: import("effect/DateTime").Utc;
5752
+ readonly type: "session.compaction.failed";
5753
+ readonly durable: {
5754
+ readonly aggregateID: string;
5755
+ readonly seq: number & import("effect/Brand").Brand<"Event.Seq">;
5756
+ readonly version: number & import("effect/Brand").Brand<"Event.Version">;
5757
+ };
5758
+ readonly data: {
5759
+ readonly sessionID: string & import("effect/Brand").Brand<"SessionID">;
5760
+ };
5761
+ readonly metadata?: {
5762
+ readonly [x: string]: unknown;
5763
+ } | undefined;
5764
+ readonly location?: {
5765
+ readonly directory: string & import("effect/Brand").Brand<"AbsolutePath">;
5766
+ readonly workspaceID?: (string & import("effect/Brand").Brand<"WorkspaceV2.ID">) | undefined;
5767
+ } | undefined;
5600
5768
  } | {
5601
5769
  readonly id: string & import("effect/Brand").Brand<"Event.ID">;
5602
5770
  readonly created: import("effect/DateTime").Utc;
@@ -6197,6 +6365,7 @@ export declare const makeSessionGroup: <I extends HttpApiMiddleware.AnyId, S>(se
6197
6365
  readonly created: Schema.decodeTo<Schema.DateTimeUtc, Schema.Finite, never, never>;
6198
6366
  }>;
6199
6367
  readonly type: Schema.Literal<"compaction">;
6368
+ readonly status: Schema.Literals<readonly ["queued", "running", "completed", "failed"]>;
6200
6369
  readonly reason: Schema.Literals<readonly ["auto", "manual"]>;
6201
6370
  readonly summary: Schema.String;
6202
6371
  readonly recent: Schema.String;
@@ -225,13 +225,7 @@ export const makeSessionGroup = (sessionLocationMiddleware) => HttpApiGroup.make
225
225
  resume: Schema.Boolean.pipe(Schema.optional),
226
226
  }),
227
227
  success: Schema.Struct({ data: SessionInput.Admitted }),
228
- error: [
229
- ConflictError,
230
- InvalidRequestError,
231
- SessionNotFoundError,
232
- CommandNotFoundError,
233
- CommandEvaluationError,
234
- ],
228
+ error: [ConflictError, InvalidRequestError, SessionNotFoundError, CommandNotFoundError, CommandEvaluationError],
235
229
  })
236
230
  .middleware(sessionLocationMiddleware)
237
231
  .annotateMerge(OpenApi.annotations({
@@ -288,14 +282,15 @@ export const makeSessionGroup = (sessionLocationMiddleware) => HttpApiGroup.make
288
282
  })))
289
283
  .add(HttpApiEndpoint.post("session.compact", "/api/session/:sessionID/compact", {
290
284
  params: { sessionID: Session.ID },
291
- success: HttpApiSchema.NoContent,
292
- error: [SessionNotFoundError, SessionBusyError, ServiceUnavailableError, UnknownError],
285
+ payload: Schema.Struct({ id: SessionMessage.ID.pipe(Schema.optional) }),
286
+ success: Schema.Struct({ data: SessionInput.Compaction }),
287
+ error: [ConflictError, SessionNotFoundError],
293
288
  })
294
289
  .middleware(sessionLocationMiddleware)
295
290
  .annotateMerge(OpenApi.annotations({
296
291
  identifier: "v2.session.compact",
297
292
  summary: "Compact session",
298
- description: "Compact a session conversation.",
293
+ description: "Queue a durable session compaction request.",
299
294
  })))
300
295
  .add(HttpApiEndpoint.post("session.wait", "/api/session/:sessionID/wait", {
301
296
  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-15029",
4
+ "version": "0.0.0-next-15036",
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-15029",
29
+ "@opencode-ai/schema": "0.0.0-next-15036",
30
30
  "effect": "4.0.0-beta.83"
31
31
  },
32
32
  "devDependencies": {