@opencode-ai/server 0.0.0-beta-18286 → 0.0.0-beta-18314

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/api.d.ts CHANGED
@@ -2271,6 +2271,64 @@ export declare const Api: import("@opencode-ai/protocol/api").Api<LocationMiddle
2271
2271
  descending: (id?: string) => string & import("effect/Brand").Brand<"SessionID">;
2272
2272
  };
2273
2273
  }>;
2274
+ }, import("effect/Schema").Struct<{
2275
+ readonly id: import("effect/Schema").brand<import("effect/Schema").String, "Event.ID"> & {
2276
+ create: () => string & import("effect/Brand").Brand<"Event.ID">;
2277
+ };
2278
+ readonly created: import("effect/Schema").Finite;
2279
+ readonly metadata: import("effect/Schema").decodeTo<import("effect/Schema").optional<import("effect/Schema").toType<import("effect/Schema").$Record<import("effect/Schema").String, import("effect/Schema").Unknown>>>, import("effect/Schema").optionalKey<import("effect/Schema").$Record<import("effect/Schema").String, import("effect/Schema").Unknown>>, never, never>;
2280
+ readonly type: import("effect/Schema").Literal<"session.step.streamed">;
2281
+ readonly durable: import("effect/Schema").Struct<{
2282
+ readonly aggregateID: import("effect/Schema").String;
2283
+ readonly seq: import("effect/Schema").brand<import("effect/Schema").Int, "Event.Seq">;
2284
+ readonly version: import("effect/Schema").decodeTo<import("effect/Schema").toType<import("effect/Schema").brand<import("effect/Schema").Int, "Event.Version">>, import("effect/Schema").Literal<number>, never, never>;
2285
+ }>;
2286
+ readonly location: import("effect/Schema").decodeTo<import("effect/Schema").optional<import("effect/Schema").toType<import("effect/Schema").Struct<{
2287
+ readonly directory: import("effect/Schema").brand<import("effect/Schema").String, "AbsolutePath">;
2288
+ readonly workspaceID: import("effect/Schema").decodeTo<import("effect/Schema").optional<import("effect/Schema").toType<import("effect/Schema").brand<import("effect/Schema").String, "Workspace.ID"> & {
2289
+ ascending: (id?: string) => string & import("effect/Brand").Brand<"Workspace.ID">;
2290
+ create: () => string & import("effect/Brand").Brand<"Workspace.ID">;
2291
+ }>>, import("effect/Schema").optionalKey<import("effect/Schema").brand<import("effect/Schema").String, "Workspace.ID"> & {
2292
+ ascending: (id?: string) => string & import("effect/Brand").Brand<"Workspace.ID">;
2293
+ create: () => string & import("effect/Brand").Brand<"Workspace.ID">;
2294
+ }>, never, never>;
2295
+ }>>>, import("effect/Schema").optionalKey<import("effect/Schema").Struct<{
2296
+ readonly directory: import("effect/Schema").brand<import("effect/Schema").String, "AbsolutePath">;
2297
+ readonly workspaceID: import("effect/Schema").decodeTo<import("effect/Schema").optional<import("effect/Schema").toType<import("effect/Schema").brand<import("effect/Schema").String, "Workspace.ID"> & {
2298
+ ascending: (id?: string) => string & import("effect/Brand").Brand<"Workspace.ID">;
2299
+ create: () => string & import("effect/Brand").Brand<"Workspace.ID">;
2300
+ }>>, import("effect/Schema").optionalKey<import("effect/Schema").brand<import("effect/Schema").String, "Workspace.ID"> & {
2301
+ ascending: (id?: string) => string & import("effect/Brand").Brand<"Workspace.ID">;
2302
+ create: () => string & import("effect/Brand").Brand<"Workspace.ID">;
2303
+ }>, never, never>;
2304
+ }>>, never, never>;
2305
+ readonly data: import("effect/Schema").Struct<{
2306
+ readonly assistantMessageID: import("effect/Schema").brand<import("effect/Schema").String, "Session.Message.ID"> & {
2307
+ create: () => string & import("effect/Brand").Brand<"Session.Message.ID">;
2308
+ fromEvent: (eventID: import("@opencode-ai/schema/event").ID) => string & import("effect/Brand").Brand<"Session.Message.ID">;
2309
+ };
2310
+ readonly sessionID: import("effect/Schema").brand<import("effect/Schema").String, "SessionID"> & {
2311
+ create: () => string & import("effect/Brand").Brand<"SessionID">;
2312
+ descending: (id?: string) => string & import("effect/Brand").Brand<"SessionID">;
2313
+ };
2314
+ }>;
2315
+ }> & {
2316
+ type: "session.step.streamed";
2317
+ durability: "durable";
2318
+ durable: {
2319
+ readonly version: number;
2320
+ readonly aggregate: string;
2321
+ };
2322
+ data: import("effect/Schema").Struct<{
2323
+ readonly assistantMessageID: import("effect/Schema").brand<import("effect/Schema").String, "Session.Message.ID"> & {
2324
+ create: () => string & import("effect/Brand").Brand<"Session.Message.ID">;
2325
+ fromEvent: (eventID: import("@opencode-ai/schema/event").ID) => string & import("effect/Brand").Brand<"Session.Message.ID">;
2326
+ };
2327
+ readonly sessionID: import("effect/Schema").brand<import("effect/Schema").String, "SessionID"> & {
2328
+ create: () => string & import("effect/Brand").Brand<"SessionID">;
2329
+ descending: (id?: string) => string & import("effect/Brand").Brand<"SessionID">;
2330
+ };
2331
+ }>;
2274
2332
  }, import("effect/Schema").Struct<{
2275
2333
  readonly id: import("effect/Schema").brand<import("effect/Schema").String, "Event.ID"> & {
2276
2334
  create: () => string & import("effect/Brand").Brand<"Event.ID">;
@@ -3851,6 +3909,214 @@ export declare const Api: import("@opencode-ai/protocol/api").Api<LocationMiddle
3851
3909
  descending: (id?: string) => string & import("effect/Brand").Brand<"SessionID">;
3852
3910
  };
3853
3911
  }>;
3912
+ }, import("effect/Schema").Struct<{
3913
+ readonly id: import("effect/Schema").brand<import("effect/Schema").String, "Event.ID"> & {
3914
+ create: () => string & import("effect/Brand").Brand<"Event.ID">;
3915
+ };
3916
+ readonly created: import("effect/Schema").Finite;
3917
+ readonly metadata: import("effect/Schema").decodeTo<import("effect/Schema").optional<import("effect/Schema").toType<import("effect/Schema").$Record<import("effect/Schema").String, import("effect/Schema").Unknown>>>, import("effect/Schema").optionalKey<import("effect/Schema").$Record<import("effect/Schema").String, import("effect/Schema").Unknown>>, never, never>;
3918
+ readonly type: import("effect/Schema").Literal<"session.message.content.updated">;
3919
+ readonly durable: import("effect/Schema").Struct<{
3920
+ readonly aggregateID: import("effect/Schema").String;
3921
+ readonly seq: import("effect/Schema").brand<import("effect/Schema").Int, "Event.Seq">;
3922
+ readonly version: import("effect/Schema").decodeTo<import("effect/Schema").toType<import("effect/Schema").brand<import("effect/Schema").Int, "Event.Version">>, import("effect/Schema").Literal<number>, never, never>;
3923
+ }>;
3924
+ readonly location: import("effect/Schema").decodeTo<import("effect/Schema").optional<import("effect/Schema").toType<import("effect/Schema").Struct<{
3925
+ readonly directory: import("effect/Schema").brand<import("effect/Schema").String, "AbsolutePath">;
3926
+ readonly workspaceID: import("effect/Schema").decodeTo<import("effect/Schema").optional<import("effect/Schema").toType<import("effect/Schema").brand<import("effect/Schema").String, "Workspace.ID"> & {
3927
+ ascending: (id?: string) => string & import("effect/Brand").Brand<"Workspace.ID">;
3928
+ create: () => string & import("effect/Brand").Brand<"Workspace.ID">;
3929
+ }>>, import("effect/Schema").optionalKey<import("effect/Schema").brand<import("effect/Schema").String, "Workspace.ID"> & {
3930
+ ascending: (id?: string) => string & import("effect/Brand").Brand<"Workspace.ID">;
3931
+ create: () => string & import("effect/Brand").Brand<"Workspace.ID">;
3932
+ }>, never, never>;
3933
+ }>>>, import("effect/Schema").optionalKey<import("effect/Schema").Struct<{
3934
+ readonly directory: import("effect/Schema").brand<import("effect/Schema").String, "AbsolutePath">;
3935
+ readonly workspaceID: import("effect/Schema").decodeTo<import("effect/Schema").optional<import("effect/Schema").toType<import("effect/Schema").brand<import("effect/Schema").String, "Workspace.ID"> & {
3936
+ ascending: (id?: string) => string & import("effect/Brand").Brand<"Workspace.ID">;
3937
+ create: () => string & import("effect/Brand").Brand<"Workspace.ID">;
3938
+ }>>, import("effect/Schema").optionalKey<import("effect/Schema").brand<import("effect/Schema").String, "Workspace.ID"> & {
3939
+ ascending: (id?: string) => string & import("effect/Brand").Brand<"Workspace.ID">;
3940
+ create: () => string & import("effect/Brand").Brand<"Workspace.ID">;
3941
+ }>, never, never>;
3942
+ }>>, never, never>;
3943
+ readonly data: import("effect/Schema").Struct<{
3944
+ readonly messageID: import("effect/Schema").brand<import("effect/Schema").String, "Session.Message.ID"> & {
3945
+ create: () => string & import("effect/Brand").Brand<"Session.Message.ID">;
3946
+ fromEvent: (eventID: import("@opencode-ai/schema/event").ID) => string & import("effect/Brand").Brand<"Session.Message.ID">;
3947
+ };
3948
+ readonly content: import("effect/Schema").$Array<import("effect/Schema").toEncoded<import("effect/Schema").toTaggedUnion<"type", readonly [import("effect/Schema").Struct<{
3949
+ readonly type: import("effect/Schema").tag<"text">;
3950
+ readonly text: import("effect/Schema").String;
3951
+ readonly state: import("effect/Schema").decodeTo<import("effect/Schema").optional<import("effect/Schema").toType<import("effect/Schema").$Record<import("effect/Schema").String, import("effect/Schema").Unknown>>>, import("effect/Schema").optionalKey<import("effect/Schema").$Record<import("effect/Schema").String, import("effect/Schema").Unknown>>, never, never>;
3952
+ }>, import("effect/Schema").Struct<{
3953
+ readonly type: import("effect/Schema").tag<"reasoning">;
3954
+ readonly text: import("effect/Schema").String;
3955
+ readonly state: import("effect/Schema").decodeTo<import("effect/Schema").optional<import("effect/Schema").toType<import("effect/Schema").$Record<import("effect/Schema").String, import("effect/Schema").Unknown>>>, import("effect/Schema").optionalKey<import("effect/Schema").$Record<import("effect/Schema").String, import("effect/Schema").Unknown>>, never, never>;
3956
+ readonly time: import("effect/Schema").decodeTo<import("effect/Schema").optional<import("effect/Schema").toType<import("effect/Schema").Struct<{
3957
+ readonly created: import("effect/Schema").decodeTo<import("effect/Schema").DateTimeUtc, import("effect/Schema").Finite, never, never>;
3958
+ readonly completed: import("effect/Schema").decodeTo<import("effect/Schema").optional<import("effect/Schema").toType<import("effect/Schema").decodeTo<import("effect/Schema").DateTimeUtc, import("effect/Schema").Finite, never, never>>>, import("effect/Schema").optionalKey<import("effect/Schema").decodeTo<import("effect/Schema").DateTimeUtc, import("effect/Schema").Finite, never, never>>, never, never>;
3959
+ }>>>, import("effect/Schema").optionalKey<import("effect/Schema").Struct<{
3960
+ readonly created: import("effect/Schema").decodeTo<import("effect/Schema").DateTimeUtc, import("effect/Schema").Finite, never, never>;
3961
+ readonly completed: import("effect/Schema").decodeTo<import("effect/Schema").optional<import("effect/Schema").toType<import("effect/Schema").decodeTo<import("effect/Schema").DateTimeUtc, import("effect/Schema").Finite, never, never>>>, import("effect/Schema").optionalKey<import("effect/Schema").decodeTo<import("effect/Schema").DateTimeUtc, import("effect/Schema").Finite, never, never>>, never, never>;
3962
+ }>>, never, never>;
3963
+ }>, import("effect/Schema").Struct<{
3964
+ readonly type: import("effect/Schema").tag<"tool">;
3965
+ readonly id: import("effect/Schema").String;
3966
+ readonly name: import("effect/Schema").String;
3967
+ readonly executed: import("effect/Schema").decodeTo<import("effect/Schema").optional<import("effect/Schema").toType<import("effect/Schema").Boolean>>, import("effect/Schema").optionalKey<import("effect/Schema").Boolean>, never, never>;
3968
+ readonly providerState: import("effect/Schema").decodeTo<import("effect/Schema").optional<import("effect/Schema").toType<import("effect/Schema").$Record<import("effect/Schema").String, import("effect/Schema").Unknown>>>, import("effect/Schema").optionalKey<import("effect/Schema").$Record<import("effect/Schema").String, import("effect/Schema").Unknown>>, never, never>;
3969
+ readonly providerResultState: import("effect/Schema").decodeTo<import("effect/Schema").optional<import("effect/Schema").toType<import("effect/Schema").$Record<import("effect/Schema").String, import("effect/Schema").Unknown>>>, import("effect/Schema").optionalKey<import("effect/Schema").$Record<import("effect/Schema").String, import("effect/Schema").Unknown>>, never, never>;
3970
+ readonly state: import("effect/Schema").toTaggedUnion<"status", readonly [import("effect/Schema").Struct<{
3971
+ readonly status: import("effect/Schema").tag<"streaming">;
3972
+ readonly input: import("effect/Schema").String;
3973
+ }>, import("effect/Schema").Struct<{
3974
+ readonly status: import("effect/Schema").tag<"running">;
3975
+ readonly input: import("effect/Schema").$Record<import("effect/Schema").String, import("effect/Schema").Unknown>;
3976
+ readonly metadata: import("effect/Schema").$Record<import("effect/Schema").String, import("effect/Schema").Codec<import("effect/Schema").Json, import("effect/Schema").Json, never, never>>;
3977
+ }>, import("effect/Schema").Struct<{
3978
+ readonly status: import("effect/Schema").tag<"completed">;
3979
+ readonly input: import("effect/Schema").$Record<import("effect/Schema").String, import("effect/Schema").Unknown>;
3980
+ readonly content: import("effect/Schema").NonEmptyArray<import("effect/Schema").Union<readonly [import("effect/Schema").Struct<{
3981
+ readonly type: import("effect/Schema").Literal<"text">;
3982
+ readonly text: import("effect/Schema").String;
3983
+ }>, import("effect/Schema").Struct<{
3984
+ readonly type: import("effect/Schema").Literal<"file">;
3985
+ readonly uri: import("effect/Schema").String;
3986
+ readonly mime: import("effect/Schema").String;
3987
+ readonly name: import("effect/Schema").optional<import("effect/Schema").String>;
3988
+ }>]>>;
3989
+ readonly metadata: import("effect/Schema").decodeTo<import("effect/Schema").optional<import("effect/Schema").toType<import("effect/Schema").$Record<import("effect/Schema").String, import("effect/Schema").Codec<import("effect/Schema").Json, import("effect/Schema").Json, never, never>>>>, import("effect/Schema").optionalKey<import("effect/Schema").$Record<import("effect/Schema").String, import("effect/Schema").Codec<import("effect/Schema").Json, import("effect/Schema").Json, never, never>>>, never, never>;
3990
+ }>, import("effect/Schema").Struct<{
3991
+ readonly status: import("effect/Schema").tag<"error">;
3992
+ readonly input: import("effect/Schema").$Record<import("effect/Schema").String, import("effect/Schema").Unknown>;
3993
+ readonly error: import("effect/Schema").Struct<{
3994
+ readonly type: import("effect/Schema").String;
3995
+ readonly message: import("effect/Schema").String;
3996
+ readonly status: import("effect/Schema").decodeTo<import("effect/Schema").optional<import("effect/Schema").toType<import("effect/Schema").Int>>, import("effect/Schema").optionalKey<import("effect/Schema").Int>, never, never>;
3997
+ }>;
3998
+ readonly content: import("effect/Schema").decodeTo<import("effect/Schema").optional<import("effect/Schema").toType<import("effect/Schema").NonEmptyArray<import("effect/Schema").Union<readonly [import("effect/Schema").Struct<{
3999
+ readonly type: import("effect/Schema").Literal<"text">;
4000
+ readonly text: import("effect/Schema").String;
4001
+ }>, import("effect/Schema").Struct<{
4002
+ readonly type: import("effect/Schema").Literal<"file">;
4003
+ readonly uri: import("effect/Schema").String;
4004
+ readonly mime: import("effect/Schema").String;
4005
+ readonly name: import("effect/Schema").optional<import("effect/Schema").String>;
4006
+ }>]>>>>, import("effect/Schema").optionalKey<import("effect/Schema").NonEmptyArray<import("effect/Schema").Union<readonly [import("effect/Schema").Struct<{
4007
+ readonly type: import("effect/Schema").Literal<"text">;
4008
+ readonly text: import("effect/Schema").String;
4009
+ }>, import("effect/Schema").Struct<{
4010
+ readonly type: import("effect/Schema").Literal<"file">;
4011
+ readonly uri: import("effect/Schema").String;
4012
+ readonly mime: import("effect/Schema").String;
4013
+ readonly name: import("effect/Schema").optional<import("effect/Schema").String>;
4014
+ }>]>>>, never, never>;
4015
+ readonly metadata: import("effect/Schema").decodeTo<import("effect/Schema").optional<import("effect/Schema").toType<import("effect/Schema").$Record<import("effect/Schema").String, import("effect/Schema").Codec<import("effect/Schema").Json, import("effect/Schema").Json, never, never>>>>, import("effect/Schema").optionalKey<import("effect/Schema").$Record<import("effect/Schema").String, import("effect/Schema").Codec<import("effect/Schema").Json, import("effect/Schema").Json, never, never>>>, never, never>;
4016
+ }>]>;
4017
+ readonly time: import("effect/Schema").Struct<{
4018
+ readonly created: import("effect/Schema").decodeTo<import("effect/Schema").DateTimeUtc, import("effect/Schema").Finite, never, never>;
4019
+ readonly ran: import("effect/Schema").decodeTo<import("effect/Schema").optional<import("effect/Schema").toType<import("effect/Schema").decodeTo<import("effect/Schema").DateTimeUtc, import("effect/Schema").Finite, never, never>>>, import("effect/Schema").optionalKey<import("effect/Schema").decodeTo<import("effect/Schema").DateTimeUtc, import("effect/Schema").Finite, never, never>>, never, never>;
4020
+ readonly completed: import("effect/Schema").decodeTo<import("effect/Schema").optional<import("effect/Schema").toType<import("effect/Schema").decodeTo<import("effect/Schema").DateTimeUtc, import("effect/Schema").Finite, never, never>>>, import("effect/Schema").optionalKey<import("effect/Schema").decodeTo<import("effect/Schema").DateTimeUtc, import("effect/Schema").Finite, never, never>>, never, never>;
4021
+ }>;
4022
+ }>]>>>;
4023
+ readonly sessionID: import("effect/Schema").brand<import("effect/Schema").String, "SessionID"> & {
4024
+ create: () => string & import("effect/Brand").Brand<"SessionID">;
4025
+ descending: (id?: string) => string & import("effect/Brand").Brand<"SessionID">;
4026
+ };
4027
+ }>;
4028
+ }> & {
4029
+ type: "session.message.content.updated";
4030
+ durability: "durable";
4031
+ durable: {
4032
+ readonly version: number;
4033
+ readonly aggregate: string;
4034
+ };
4035
+ data: import("effect/Schema").Struct<{
4036
+ readonly messageID: import("effect/Schema").brand<import("effect/Schema").String, "Session.Message.ID"> & {
4037
+ create: () => string & import("effect/Brand").Brand<"Session.Message.ID">;
4038
+ fromEvent: (eventID: import("@opencode-ai/schema/event").ID) => string & import("effect/Brand").Brand<"Session.Message.ID">;
4039
+ };
4040
+ readonly content: import("effect/Schema").$Array<import("effect/Schema").toEncoded<import("effect/Schema").toTaggedUnion<"type", readonly [import("effect/Schema").Struct<{
4041
+ readonly type: import("effect/Schema").tag<"text">;
4042
+ readonly text: import("effect/Schema").String;
4043
+ readonly state: import("effect/Schema").decodeTo<import("effect/Schema").optional<import("effect/Schema").toType<import("effect/Schema").$Record<import("effect/Schema").String, import("effect/Schema").Unknown>>>, import("effect/Schema").optionalKey<import("effect/Schema").$Record<import("effect/Schema").String, import("effect/Schema").Unknown>>, never, never>;
4044
+ }>, import("effect/Schema").Struct<{
4045
+ readonly type: import("effect/Schema").tag<"reasoning">;
4046
+ readonly text: import("effect/Schema").String;
4047
+ readonly state: import("effect/Schema").decodeTo<import("effect/Schema").optional<import("effect/Schema").toType<import("effect/Schema").$Record<import("effect/Schema").String, import("effect/Schema").Unknown>>>, import("effect/Schema").optionalKey<import("effect/Schema").$Record<import("effect/Schema").String, import("effect/Schema").Unknown>>, never, never>;
4048
+ readonly time: import("effect/Schema").decodeTo<import("effect/Schema").optional<import("effect/Schema").toType<import("effect/Schema").Struct<{
4049
+ readonly created: import("effect/Schema").decodeTo<import("effect/Schema").DateTimeUtc, import("effect/Schema").Finite, never, never>;
4050
+ readonly completed: import("effect/Schema").decodeTo<import("effect/Schema").optional<import("effect/Schema").toType<import("effect/Schema").decodeTo<import("effect/Schema").DateTimeUtc, import("effect/Schema").Finite, never, never>>>, import("effect/Schema").optionalKey<import("effect/Schema").decodeTo<import("effect/Schema").DateTimeUtc, import("effect/Schema").Finite, never, never>>, never, never>;
4051
+ }>>>, import("effect/Schema").optionalKey<import("effect/Schema").Struct<{
4052
+ readonly created: import("effect/Schema").decodeTo<import("effect/Schema").DateTimeUtc, import("effect/Schema").Finite, never, never>;
4053
+ readonly completed: import("effect/Schema").decodeTo<import("effect/Schema").optional<import("effect/Schema").toType<import("effect/Schema").decodeTo<import("effect/Schema").DateTimeUtc, import("effect/Schema").Finite, never, never>>>, import("effect/Schema").optionalKey<import("effect/Schema").decodeTo<import("effect/Schema").DateTimeUtc, import("effect/Schema").Finite, never, never>>, never, never>;
4054
+ }>>, never, never>;
4055
+ }>, import("effect/Schema").Struct<{
4056
+ readonly type: import("effect/Schema").tag<"tool">;
4057
+ readonly id: import("effect/Schema").String;
4058
+ readonly name: import("effect/Schema").String;
4059
+ readonly executed: import("effect/Schema").decodeTo<import("effect/Schema").optional<import("effect/Schema").toType<import("effect/Schema").Boolean>>, import("effect/Schema").optionalKey<import("effect/Schema").Boolean>, never, never>;
4060
+ readonly providerState: import("effect/Schema").decodeTo<import("effect/Schema").optional<import("effect/Schema").toType<import("effect/Schema").$Record<import("effect/Schema").String, import("effect/Schema").Unknown>>>, import("effect/Schema").optionalKey<import("effect/Schema").$Record<import("effect/Schema").String, import("effect/Schema").Unknown>>, never, never>;
4061
+ readonly providerResultState: import("effect/Schema").decodeTo<import("effect/Schema").optional<import("effect/Schema").toType<import("effect/Schema").$Record<import("effect/Schema").String, import("effect/Schema").Unknown>>>, import("effect/Schema").optionalKey<import("effect/Schema").$Record<import("effect/Schema").String, import("effect/Schema").Unknown>>, never, never>;
4062
+ readonly state: import("effect/Schema").toTaggedUnion<"status", readonly [import("effect/Schema").Struct<{
4063
+ readonly status: import("effect/Schema").tag<"streaming">;
4064
+ readonly input: import("effect/Schema").String;
4065
+ }>, import("effect/Schema").Struct<{
4066
+ readonly status: import("effect/Schema").tag<"running">;
4067
+ readonly input: import("effect/Schema").$Record<import("effect/Schema").String, import("effect/Schema").Unknown>;
4068
+ readonly metadata: import("effect/Schema").$Record<import("effect/Schema").String, import("effect/Schema").Codec<import("effect/Schema").Json, import("effect/Schema").Json, never, never>>;
4069
+ }>, import("effect/Schema").Struct<{
4070
+ readonly status: import("effect/Schema").tag<"completed">;
4071
+ readonly input: import("effect/Schema").$Record<import("effect/Schema").String, import("effect/Schema").Unknown>;
4072
+ readonly content: import("effect/Schema").NonEmptyArray<import("effect/Schema").Union<readonly [import("effect/Schema").Struct<{
4073
+ readonly type: import("effect/Schema").Literal<"text">;
4074
+ readonly text: import("effect/Schema").String;
4075
+ }>, import("effect/Schema").Struct<{
4076
+ readonly type: import("effect/Schema").Literal<"file">;
4077
+ readonly uri: import("effect/Schema").String;
4078
+ readonly mime: import("effect/Schema").String;
4079
+ readonly name: import("effect/Schema").optional<import("effect/Schema").String>;
4080
+ }>]>>;
4081
+ readonly metadata: import("effect/Schema").decodeTo<import("effect/Schema").optional<import("effect/Schema").toType<import("effect/Schema").$Record<import("effect/Schema").String, import("effect/Schema").Codec<import("effect/Schema").Json, import("effect/Schema").Json, never, never>>>>, import("effect/Schema").optionalKey<import("effect/Schema").$Record<import("effect/Schema").String, import("effect/Schema").Codec<import("effect/Schema").Json, import("effect/Schema").Json, never, never>>>, never, never>;
4082
+ }>, import("effect/Schema").Struct<{
4083
+ readonly status: import("effect/Schema").tag<"error">;
4084
+ readonly input: import("effect/Schema").$Record<import("effect/Schema").String, import("effect/Schema").Unknown>;
4085
+ readonly error: import("effect/Schema").Struct<{
4086
+ readonly type: import("effect/Schema").String;
4087
+ readonly message: import("effect/Schema").String;
4088
+ readonly status: import("effect/Schema").decodeTo<import("effect/Schema").optional<import("effect/Schema").toType<import("effect/Schema").Int>>, import("effect/Schema").optionalKey<import("effect/Schema").Int>, never, never>;
4089
+ }>;
4090
+ readonly content: import("effect/Schema").decodeTo<import("effect/Schema").optional<import("effect/Schema").toType<import("effect/Schema").NonEmptyArray<import("effect/Schema").Union<readonly [import("effect/Schema").Struct<{
4091
+ readonly type: import("effect/Schema").Literal<"text">;
4092
+ readonly text: import("effect/Schema").String;
4093
+ }>, import("effect/Schema").Struct<{
4094
+ readonly type: import("effect/Schema").Literal<"file">;
4095
+ readonly uri: import("effect/Schema").String;
4096
+ readonly mime: import("effect/Schema").String;
4097
+ readonly name: import("effect/Schema").optional<import("effect/Schema").String>;
4098
+ }>]>>>>, import("effect/Schema").optionalKey<import("effect/Schema").NonEmptyArray<import("effect/Schema").Union<readonly [import("effect/Schema").Struct<{
4099
+ readonly type: import("effect/Schema").Literal<"text">;
4100
+ readonly text: import("effect/Schema").String;
4101
+ }>, import("effect/Schema").Struct<{
4102
+ readonly type: import("effect/Schema").Literal<"file">;
4103
+ readonly uri: import("effect/Schema").String;
4104
+ readonly mime: import("effect/Schema").String;
4105
+ readonly name: import("effect/Schema").optional<import("effect/Schema").String>;
4106
+ }>]>>>, never, never>;
4107
+ readonly metadata: import("effect/Schema").decodeTo<import("effect/Schema").optional<import("effect/Schema").toType<import("effect/Schema").$Record<import("effect/Schema").String, import("effect/Schema").Codec<import("effect/Schema").Json, import("effect/Schema").Json, never, never>>>>, import("effect/Schema").optionalKey<import("effect/Schema").$Record<import("effect/Schema").String, import("effect/Schema").Codec<import("effect/Schema").Json, import("effect/Schema").Json, never, never>>>, never, never>;
4108
+ }>]>;
4109
+ readonly time: import("effect/Schema").Struct<{
4110
+ readonly created: import("effect/Schema").decodeTo<import("effect/Schema").DateTimeUtc, import("effect/Schema").Finite, never, never>;
4111
+ readonly ran: import("effect/Schema").decodeTo<import("effect/Schema").optional<import("effect/Schema").toType<import("effect/Schema").decodeTo<import("effect/Schema").DateTimeUtc, import("effect/Schema").Finite, never, never>>>, import("effect/Schema").optionalKey<import("effect/Schema").decodeTo<import("effect/Schema").DateTimeUtc, import("effect/Schema").Finite, never, never>>, never, never>;
4112
+ readonly completed: import("effect/Schema").decodeTo<import("effect/Schema").optional<import("effect/Schema").toType<import("effect/Schema").decodeTo<import("effect/Schema").DateTimeUtc, import("effect/Schema").Finite, never, never>>>, import("effect/Schema").optionalKey<import("effect/Schema").decodeTo<import("effect/Schema").DateTimeUtc, import("effect/Schema").Finite, never, never>>, never, never>;
4113
+ }>;
4114
+ }>]>>>;
4115
+ readonly sessionID: import("effect/Schema").brand<import("effect/Schema").String, "SessionID"> & {
4116
+ create: () => string & import("effect/Brand").Brand<"SessionID">;
4117
+ descending: (id?: string) => string & import("effect/Brand").Brand<"SessionID">;
4118
+ };
4119
+ }>;
3854
4120
  }, import("effect/Schema").Struct<{
3855
4121
  readonly id: import("effect/Schema").brand<import("effect/Schema").String, "Event.ID"> & {
3856
4122
  create: () => string & import("effect/Brand").Brand<"Event.ID">;
@@ -6368,6 +6634,126 @@ export declare const Api: import("@opencode-ai/protocol/api").Api<LocationMiddle
6368
6634
  readonly metadata?: {
6369
6635
  readonly [x: string]: unknown;
6370
6636
  } | undefined;
6637
+ } | {
6638
+ readonly id: string & import("effect/Brand").Brand<"Event.ID">;
6639
+ readonly data: {
6640
+ readonly messageID: string & import("effect/Brand").Brand<"Session.Message.ID">;
6641
+ readonly content: readonly ({
6642
+ readonly id: string;
6643
+ readonly type: "tool";
6644
+ readonly name: string;
6645
+ readonly time: {
6646
+ readonly created: number;
6647
+ readonly completed?: number | undefined;
6648
+ readonly ran?: number | undefined;
6649
+ };
6650
+ readonly state: {
6651
+ readonly status: "streaming";
6652
+ readonly input: string;
6653
+ } | {
6654
+ readonly status: "running";
6655
+ readonly input: {
6656
+ readonly [x: string]: unknown;
6657
+ };
6658
+ readonly metadata: {
6659
+ readonly [x: string]: import("effect/Schema").Json;
6660
+ };
6661
+ } | {
6662
+ readonly content: readonly [{
6663
+ readonly type: "text";
6664
+ readonly text: string;
6665
+ } | {
6666
+ readonly type: "file";
6667
+ readonly uri: string;
6668
+ readonly mime: string;
6669
+ readonly name?: string | undefined;
6670
+ }, ...({
6671
+ readonly type: "text";
6672
+ readonly text: string;
6673
+ } | {
6674
+ readonly type: "file";
6675
+ readonly uri: string;
6676
+ readonly mime: string;
6677
+ readonly name?: string | undefined;
6678
+ })[]];
6679
+ readonly status: "completed";
6680
+ readonly input: {
6681
+ readonly [x: string]: unknown;
6682
+ };
6683
+ readonly metadata?: {
6684
+ readonly [x: string]: import("effect/Schema").Json;
6685
+ } | undefined;
6686
+ } | {
6687
+ readonly error: {
6688
+ readonly type: string;
6689
+ readonly message: string;
6690
+ readonly status?: number | undefined;
6691
+ };
6692
+ readonly status: "error";
6693
+ readonly input: {
6694
+ readonly [x: string]: unknown;
6695
+ };
6696
+ readonly metadata?: {
6697
+ readonly [x: string]: import("effect/Schema").Json;
6698
+ } | undefined;
6699
+ readonly content?: readonly [{
6700
+ readonly type: "text";
6701
+ readonly text: string;
6702
+ } | {
6703
+ readonly type: "file";
6704
+ readonly uri: string;
6705
+ readonly mime: string;
6706
+ readonly name?: string | undefined;
6707
+ }, ...({
6708
+ readonly type: "text";
6709
+ readonly text: string;
6710
+ } | {
6711
+ readonly type: "file";
6712
+ readonly uri: string;
6713
+ readonly mime: string;
6714
+ readonly name?: string | undefined;
6715
+ })[]] | undefined;
6716
+ };
6717
+ readonly executed?: boolean | undefined;
6718
+ readonly providerState?: {
6719
+ readonly [x: string]: unknown;
6720
+ } | undefined;
6721
+ readonly providerResultState?: {
6722
+ readonly [x: string]: unknown;
6723
+ } | undefined;
6724
+ } | {
6725
+ readonly type: "text";
6726
+ readonly text: string;
6727
+ readonly state?: {
6728
+ readonly [x: string]: unknown;
6729
+ } | undefined;
6730
+ } | {
6731
+ readonly type: "reasoning";
6732
+ readonly text: string;
6733
+ readonly time?: {
6734
+ readonly created: number;
6735
+ readonly completed?: number | undefined;
6736
+ } | undefined;
6737
+ readonly state?: {
6738
+ readonly [x: string]: unknown;
6739
+ } | undefined;
6740
+ })[];
6741
+ readonly sessionID: string & import("effect/Brand").Brand<"SessionID">;
6742
+ };
6743
+ readonly durable: {
6744
+ readonly aggregateID: string;
6745
+ readonly seq: number & import("effect/Brand").Brand<"Event.Seq">;
6746
+ readonly version: number & import("effect/Brand").Brand<"Event.Version">;
6747
+ };
6748
+ readonly type: "session.message.content.updated";
6749
+ readonly created: number;
6750
+ readonly location?: {
6751
+ readonly directory: string & import("effect/Brand").Brand<"AbsolutePath">;
6752
+ readonly workspaceID?: (string & import("effect/Brand").Brand<"Workspace.ID">) | undefined;
6753
+ } | undefined;
6754
+ readonly metadata?: {
6755
+ readonly [x: string]: unknown;
6756
+ } | undefined;
6371
6757
  } | {
6372
6758
  readonly id: string & import("effect/Brand").Brand<"Event.ID">;
6373
6759
  readonly data: {
@@ -6853,6 +7239,26 @@ export declare const Api: import("@opencode-ai/protocol/api").Api<LocationMiddle
6853
7239
  readonly metadata?: {
6854
7240
  readonly [x: string]: unknown;
6855
7241
  } | undefined;
7242
+ } | {
7243
+ readonly id: string & import("effect/Brand").Brand<"Event.ID">;
7244
+ readonly data: {
7245
+ readonly assistantMessageID: string & import("effect/Brand").Brand<"Session.Message.ID">;
7246
+ readonly sessionID: string & import("effect/Brand").Brand<"SessionID">;
7247
+ };
7248
+ readonly durable: {
7249
+ readonly aggregateID: string;
7250
+ readonly seq: number & import("effect/Brand").Brand<"Event.Seq">;
7251
+ readonly version: number & import("effect/Brand").Brand<"Event.Version">;
7252
+ };
7253
+ readonly type: "session.step.streamed";
7254
+ readonly created: number;
7255
+ readonly location?: {
7256
+ readonly directory: string & import("effect/Brand").Brand<"AbsolutePath">;
7257
+ readonly workspaceID?: (string & import("effect/Brand").Brand<"Workspace.ID">) | undefined;
7258
+ } | undefined;
7259
+ readonly metadata?: {
7260
+ readonly [x: string]: unknown;
7261
+ } | undefined;
6856
7262
  } | {
6857
7263
  readonly id: string & import("effect/Brand").Brand<"Event.ID">;
6858
7264
  readonly data: {
@@ -48,8 +48,6 @@ export const PersistentPtyHandler = HttpApiBuilder.group(Api, "server.experiment
48
48
  yield* pty.get(ctx.params.ptyID).pipe(mapTerminalError);
49
49
  return { data: yield* tickets.issue({ ptyID: ctx.params.ptyID }) };
50
50
  })).handleRaw("persistentPty.connect", Effect.fn("PersistentPtyHandler.connect")(function* (ctx) {
51
- if (!(yield* pty.get(ctx.params.ptyID).pipe(Effect.as(!0), Effect.catchTag("PersistentPty.NotFoundError", () => Effect.succeed(!1)), Effect.catchTag("PersistentPty.UnavailableError", () => Effect.succeed(!1)))))
52
- return HttpServerResponse.empty({ status: 404 });
53
51
  const url = new URL(ctx.request.url, "http://localhost"), ticket = url.searchParams.get(PTY_CONNECT_TICKET_QUERY);
54
52
  if (ticket) {
55
53
  if (!(isAllowedRequestOrigin(ctx.request.headers.origin, ctx.request.headers.host, cors) ? yield* tickets.consume({ ticket, ptyID: ctx.params.ptyID }) : !1))
@@ -58,45 +56,50 @@ export const PersistentPtyHandler = HttpApiBuilder.group(Api, "server.experiment
58
56
  const cursor = Number(url.searchParams.get("cursor") ?? "0"), role = url.searchParams.get("role") === "observer" ? "observer" : "controller", framedInput = url.searchParams.get("input_protocol") === "1", attachmentID = url.searchParams.get("attachment_id") ?? crypto.randomUUID();
59
57
  if (!Number.isSafeInteger(cursor) || cursor < 0)
60
58
  return HttpServerResponse.empty({ status: 400 });
61
- const socket = yield* Effect.orDie(ctx.request.upgrade), write = yield* socket.writer, outbox = yield* Queue.unbounded(), input = yield* Semaphore.make(1), attachment = yield* pty.attach(ctx.params.ptyID, {
62
- cursor,
63
- attachmentID,
64
- role,
65
- takeover: url.searchParams.get("takeover") === "true",
66
- onEvent: (event) => {
67
- if (event.type === "output")
68
- Queue.offerUnsafe(outbox, event.data);
69
- if (event.type === "resized")
70
- Queue.offerUnsafe(outbox, JSON.stringify({ ...event, checkpoint: Buffer.from(event.checkpoint).toString("base64") }));
71
- if (event.type !== "output" && event.type !== "resized")
72
- Queue.offerUnsafe(outbox, JSON.stringify(event));
73
- },
74
- onEnd: () => Queue.offerUnsafe(outbox, new Socket.CloseEvent(1000))
75
- }).pipe(Effect.catchTags({
76
- "PersistentPty.NotFoundError": () => Effect.succeed(void 0),
77
- "PersistentPty.UnavailableError": () => Effect.succeed(void 0)
78
- }));
79
- if (!attachment)
80
- return HttpServerResponse.empty({ status: 404 });
81
- Queue.offerUnsafe(outbox, JSON.stringify({
82
- type: "attached",
83
- attachmentID,
84
- inputProtocol: framedInput ? 1 : 0,
85
- info: attachment.info,
86
- role: attachment.role,
87
- generation: attachment.generation,
88
- replay: {
89
- requestedOffset: attachment.replay.requestedOffset,
90
- availableOffset: attachment.replay.availableOffset,
91
- endOffset: attachment.replay.endOffset,
92
- truncated: attachment.replay.truncated
59
+ const socket = yield* Effect.orDie(ctx.request.upgrade), write = yield* socket.writer, outbox = yield* Queue.unbounded(), input = yield* Semaphore.make(1);
60
+ let attachment;
61
+ const onOpen = Effect.gen(function* () {
62
+ attachment = yield* pty.attach(ctx.params.ptyID, {
63
+ cursor,
64
+ attachmentID,
65
+ role,
66
+ takeover: url.searchParams.get("takeover") === "true",
67
+ onEvent: (event) => {
68
+ if (event.type === "output")
69
+ Queue.offerUnsafe(outbox, event.data);
70
+ if (event.type === "resized")
71
+ Queue.offerUnsafe(outbox, JSON.stringify({ ...event, checkpoint: Buffer.from(event.checkpoint).toString("base64") }));
72
+ if (event.type !== "output" && event.type !== "resized")
73
+ Queue.offerUnsafe(outbox, JSON.stringify(event));
74
+ },
75
+ onEnd: () => Queue.offerUnsafe(outbox, new Socket.CloseEvent(1000))
76
+ }).pipe(Effect.catchTags({
77
+ "PersistentPty.NotFoundError": () => Effect.succeed(void 0),
78
+ "PersistentPty.UnavailableError": () => Effect.succeed(void 0)
79
+ }));
80
+ if (!attachment) {
81
+ Queue.offerUnsafe(outbox, new Socket.CloseEvent(4404, "terminal unavailable"));
82
+ return;
93
83
  }
94
- }));
95
- if (attachment.replay.data.length > 0)
96
- Queue.offerUnsafe(outbox, attachment.replay.data);
97
- Queue.offerUnsafe(outbox, JSON.stringify({ type: "replay_complete", endOffset: attachment.replay.endOffset }));
98
- attachment.activate();
99
- const drain = Effect.gen(function* () {
84
+ Queue.offerUnsafe(outbox, JSON.stringify({
85
+ type: "attached",
86
+ attachmentID,
87
+ inputProtocol: framedInput ? 1 : 0,
88
+ info: attachment.info,
89
+ role: attachment.role,
90
+ generation: attachment.generation,
91
+ replay: {
92
+ requestedOffset: attachment.replay.requestedOffset,
93
+ availableOffset: attachment.replay.availableOffset,
94
+ endOffset: attachment.replay.endOffset,
95
+ truncated: attachment.replay.truncated
96
+ }
97
+ }));
98
+ if (attachment.replay.data.length > 0)
99
+ Queue.offerUnsafe(outbox, attachment.replay.data);
100
+ Queue.offerUnsafe(outbox, JSON.stringify({ type: "replay_complete", endOffset: attachment.replay.endOffset }));
101
+ attachment.activate();
102
+ }), drain = Effect.gen(function* () {
100
103
  while (!0) {
101
104
  const item = yield* Queue.take(outbox);
102
105
  yield* write(item);
@@ -105,6 +108,8 @@ export const PersistentPtyHandler = HttpApiBuilder.group(Api, "server.experiment
105
108
  }
106
109
  });
107
110
  yield* Effect.race(drain, socket.runRaw((message) => input.withPermit(Effect.suspend(() => {
111
+ if (!attachment)
112
+ return Effect.void;
108
113
  const data = typeof message === "string" ? Buffer.from(message) : message;
109
114
  if (!framedInput)
110
115
  return pty.input(ctx.params.ptyID, attachmentID, attachment.info.size.cols, attachment.info.size.rows, data).pipe(Effect.ignore);
@@ -116,7 +121,7 @@ export const PersistentPtyHandler = HttpApiBuilder.group(Api, "server.experiment
116
121
  if (type === 0)
117
122
  return pty.control(ctx.params.ptyID, attachmentID, cols, rows).pipe(Effect.ignore);
118
123
  return pty.input(ctx.params.ptyID, attachmentID, cols, rows, data.subarray(5)).pipe(Effect.ignore);
119
- })))).pipe(Effect.catchReason("SocketError", "SocketCloseError", () => Effect.void), Effect.ensuring(Effect.sync(() => attachment.detach())), Effect.orDie);
124
+ })), { onOpen })).pipe(Effect.catchReason("SocketError", "SocketCloseError", () => Effect.void), Effect.ensuring(Effect.sync(() => attachment?.detach())), Effect.orDie);
120
125
  return HttpServerResponse.empty();
121
126
  }));
122
127
  }));
@@ -1,3 +1,3 @@
1
1
  import { Session } from "@opencode-ai/core/session";
2
2
  import { SessionTransfer } from "@opencode-ai/core/session/transfer";
3
- export declare const SessionHandler: import("effect/Layer").Layer<import("effect/unstable/httpapi/HttpApiGroup").Service<"server", "server.session">, never, import("@opencode-ai/protocol/middleware/schema-error").SchemaErrorMiddleware | import("@opencode-ai/protocol/middleware/authorization").Authorization | Session.Service | import("../middleware/session-location").SessionLocationMiddleware | SessionTransfer.Service | import("effect/unstable/http/HttpRouter").Request<"Requires", import("@opencode-ai/core/database/database").Service>>;
3
+ export declare const SessionHandler: import("effect/Layer").Layer<import("effect/unstable/httpapi/HttpApiGroup").Service<"server", "server.session">, never, Session.Service | import("../middleware/session-location").SessionLocationMiddleware | SessionTransfer.Service | import("effect/unstable/http/HttpRouter").Request<"Requires", import("@opencode-ai/core/database/database").Service> | (import("@opencode-ai/protocol/middleware/schema-error").SchemaErrorMiddleware | import("@opencode-ai/protocol/middleware/authorization").Authorization)>;
@@ -283,5 +283,11 @@ export const SessionHandler = HttpApiBuilder.group(Api, "server.session", (handl
283
283
  messageID: ctx.params.messageID,
284
284
  message: `Message not found: ${ctx.params.messageID}`
285
285
  });
286
+ })).handle("session.messageUpdate", Effect.fn(function* (ctx) {
287
+ return { data: yield* session.updateMessage({ ...ctx.params, content: ctx.payload.content }).pipe(Effect.catchTag("Session.NotFoundError", missingSession), Effect.catchTag("Session.MessageNotFoundError", (error) => new MessageNotFoundError({
288
+ sessionID: error.sessionID,
289
+ messageID: error.messageID,
290
+ message: `Message not found: ${error.messageID}`
291
+ })), Effect.catchTag("Session.BusyError", busySession), Effect.catchTag("Session.MessageNotAssistantError", () => new InvalidRequestError({ message: "Only assistant messages can be updated", field: "messageID" })), Effect.catchTag("Session.MessageIncompleteError", (error) => new ConflictError({ message: "Assistant message is incomplete", resource: error.messageID })), Effect.catchTag("Session.MessageToolIncompleteError", () => new InvalidRequestError({ message: "Tool content must be completed", field: "content" }))) };
286
292
  }));
287
293
  }));
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/package.json",
3
3
  "name": "@opencode-ai/server",
4
- "version": "0.0.0-beta-18286",
4
+ "version": "0.0.0-beta-18314",
5
5
  "type": "module",
6
6
  "license": "MIT",
7
7
  "repository": {
@@ -30,11 +30,11 @@
30
30
  "dependencies": {
31
31
  "@effect/platform-node": "4.0.0-rc.111",
32
32
  "@effect/platform-node-shared": "4.0.0-rc.111",
33
- "@opencode-ai/core": "0.0.0-beta-18286",
34
- "@opencode-ai/protocol": "0.0.0-beta-18286",
35
- "@opencode-ai/schema": "0.0.0-beta-18286",
36
- "@opencode-ai/simulation": "0.0.0-beta-18286",
37
- "@opencode-ai/util": "0.0.0-beta-18286",
33
+ "@opencode-ai/core": "0.0.0-beta-18314",
34
+ "@opencode-ai/protocol": "0.0.0-beta-18314",
35
+ "@opencode-ai/schema": "0.0.0-beta-18314",
36
+ "@opencode-ai/simulation": "0.0.0-beta-18314",
37
+ "@opencode-ai/util": "0.0.0-beta-18314",
38
38
  "drizzle-orm": "1.0.0-rc.5-169397b",
39
39
  "effect": "4.0.0-rc.111"
40
40
  },