@opencode-ai/protocol 0.0.0-next-14710 → 0.0.0-next-14715

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/errors.d.ts CHANGED
@@ -60,6 +60,18 @@ declare const SkillNotFoundError_base: Schema.Class<SkillNotFoundError, Schema.T
60
60
  }>, import("effect/Cause").YieldableError>;
61
61
  export declare class SkillNotFoundError extends SkillNotFoundError_base {
62
62
  }
63
+ declare const CommandNotFoundError_base: Schema.Class<CommandNotFoundError, Schema.TaggedStruct<"CommandNotFoundError", {
64
+ readonly command: Schema.String;
65
+ readonly message: Schema.String;
66
+ }>, import("effect/Cause").YieldableError>;
67
+ export declare class CommandNotFoundError extends CommandNotFoundError_base {
68
+ }
69
+ declare const CommandEvaluationError_base: Schema.Class<CommandEvaluationError, Schema.TaggedStruct<"CommandEvaluationError", {
70
+ readonly command: Schema.String;
71
+ readonly message: Schema.String;
72
+ }>, import("effect/Cause").YieldableError>;
73
+ export declare class CommandEvaluationError extends CommandEvaluationError_base {
74
+ }
63
75
  declare const InvalidCursorError_base: Schema.Class<InvalidCursorError, Schema.TaggedStruct<"InvalidCursorError", {
64
76
  readonly message: Schema.String;
65
77
  }>, import("effect/Cause").YieldableError>;
package/dist/errors.js CHANGED
@@ -48,6 +48,16 @@ export class SkillNotFoundError extends Schema.TaggedErrorClass()("SkillNotFound
48
48
  message: Schema.String,
49
49
  }, { httpApiStatus: 404 }) {
50
50
  }
51
+ export class CommandNotFoundError extends Schema.TaggedErrorClass()("CommandNotFoundError", {
52
+ command: Schema.String,
53
+ message: Schema.String,
54
+ }, { httpApiStatus: 404 }) {
55
+ }
56
+ export class CommandEvaluationError extends Schema.TaggedErrorClass()("CommandEvaluationError", {
57
+ command: Schema.String,
58
+ message: Schema.String,
59
+ }, { httpApiStatus: 500 }) {
60
+ }
51
61
  export class InvalidCursorError extends Schema.TaggedErrorClass()("InvalidCursorError", { message: Schema.String }, { httpApiStatus: 400 }) {
52
62
  }
53
63
  export class PermissionNotFoundError extends Schema.TaggedErrorClass()("PermissionNotFoundError", {
@@ -3438,6 +3438,48 @@ export declare const EventGroup: HttpApiGroup.HttpApiGroup<"server.event", HttpA
3438
3438
  readonly aggregate: string;
3439
3439
  } | undefined;
3440
3440
  type: "file.edited";
3441
+ }) | (Schema.Struct<{
3442
+ readonly id: Schema.brand<Schema.String, "Event.ID"> & {
3443
+ create: () => string & import("effect/Brand").Brand<"Event.ID">;
3444
+ };
3445
+ readonly metadata: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Unknown>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Unknown>>, never, never>;
3446
+ readonly type: Schema.Literal<"command.updated">;
3447
+ readonly durable: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
3448
+ readonly aggregateID: Schema.String;
3449
+ readonly seq: Schema.Int;
3450
+ readonly version: Schema.Int;
3451
+ }>>>, Schema.optionalKey<Schema.Struct<{
3452
+ readonly aggregateID: Schema.String;
3453
+ readonly seq: Schema.Int;
3454
+ readonly version: Schema.Int;
3455
+ }>>, never, never>;
3456
+ readonly location: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
3457
+ readonly directory: Schema.brand<Schema.String, "AbsolutePath">;
3458
+ readonly workspaceID: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.String, "WorkspaceV2.ID"> & {
3459
+ ascending: (id?: string) => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
3460
+ create: () => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
3461
+ }>>, Schema.optionalKey<Schema.brand<Schema.String, "WorkspaceV2.ID"> & {
3462
+ ascending: (id?: string) => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
3463
+ create: () => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
3464
+ }>, never, never>;
3465
+ }>>>, Schema.optionalKey<Schema.Struct<{
3466
+ readonly directory: Schema.brand<Schema.String, "AbsolutePath">;
3467
+ readonly workspaceID: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.String, "WorkspaceV2.ID"> & {
3468
+ ascending: (id?: string) => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
3469
+ create: () => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
3470
+ }>>, Schema.optionalKey<Schema.brand<Schema.String, "WorkspaceV2.ID"> & {
3471
+ ascending: (id?: string) => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
3472
+ create: () => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
3473
+ }>, never, never>;
3474
+ }>>, never, never>;
3475
+ readonly data: Schema.Struct<{}>;
3476
+ }> & {
3477
+ data: Schema.Struct<{}>;
3478
+ durable?: {
3479
+ readonly version: number;
3480
+ readonly aggregate: string;
3481
+ } | undefined;
3482
+ type: "command.updated";
3441
3483
  }) | (Schema.Struct<{
3442
3484
  readonly id: Schema.brand<Schema.String, "Event.ID"> & {
3443
3485
  create: () => string & import("effect/Brand").Brand<"Event.ID">;
@@ -8065,6 +8107,22 @@ export declare const EventGroup: HttpApiGroup.HttpApiGroup<"server.event", HttpA
8065
8107
  readonly directory: string & import("effect/Brand").Brand<"AbsolutePath">;
8066
8108
  readonly workspaceID?: (string & import("effect/Brand").Brand<"WorkspaceV2.ID">) | undefined;
8067
8109
  } | undefined;
8110
+ } | {
8111
+ readonly id: string & import("effect/Brand").Brand<"Event.ID">;
8112
+ readonly type: "command.updated";
8113
+ readonly data: {};
8114
+ readonly metadata?: {
8115
+ readonly [x: string]: unknown;
8116
+ } | undefined;
8117
+ readonly durable?: {
8118
+ readonly aggregateID: string;
8119
+ readonly seq: number;
8120
+ readonly version: number;
8121
+ } | undefined;
8122
+ readonly location?: {
8123
+ readonly directory: string & import("effect/Brand").Brand<"AbsolutePath">;
8124
+ readonly workspaceID?: (string & import("effect/Brand").Brand<"WorkspaceV2.ID">) | undefined;
8125
+ } | undefined;
8068
8126
  } | {
8069
8127
  readonly id: string & import("effect/Brand").Brand<"Event.ID">;
8070
8128
  readonly type: "skill.updated";
@@ -12676,6 +12734,48 @@ export declare const OpenCodeEvent: Schema.Union<readonly [Schema.Struct<{
12676
12734
  readonly aggregate: string;
12677
12735
  } | undefined;
12678
12736
  type: "file.edited";
12737
+ }) | (Schema.Struct<{
12738
+ readonly id: Schema.brand<Schema.String, "Event.ID"> & {
12739
+ create: () => string & import("effect/Brand").Brand<"Event.ID">;
12740
+ };
12741
+ readonly metadata: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Unknown>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Unknown>>, never, never>;
12742
+ readonly type: Schema.Literal<"command.updated">;
12743
+ readonly durable: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
12744
+ readonly aggregateID: Schema.String;
12745
+ readonly seq: Schema.Int;
12746
+ readonly version: Schema.Int;
12747
+ }>>>, Schema.optionalKey<Schema.Struct<{
12748
+ readonly aggregateID: Schema.String;
12749
+ readonly seq: Schema.Int;
12750
+ readonly version: Schema.Int;
12751
+ }>>, never, never>;
12752
+ readonly location: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
12753
+ readonly directory: Schema.brand<Schema.String, "AbsolutePath">;
12754
+ readonly workspaceID: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.String, "WorkspaceV2.ID"> & {
12755
+ ascending: (id?: string) => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
12756
+ create: () => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
12757
+ }>>, Schema.optionalKey<Schema.brand<Schema.String, "WorkspaceV2.ID"> & {
12758
+ ascending: (id?: string) => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
12759
+ create: () => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
12760
+ }>, never, never>;
12761
+ }>>>, Schema.optionalKey<Schema.Struct<{
12762
+ readonly directory: Schema.brand<Schema.String, "AbsolutePath">;
12763
+ readonly workspaceID: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.String, "WorkspaceV2.ID"> & {
12764
+ ascending: (id?: string) => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
12765
+ create: () => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
12766
+ }>>, Schema.optionalKey<Schema.brand<Schema.String, "WorkspaceV2.ID"> & {
12767
+ ascending: (id?: string) => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
12768
+ create: () => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
12769
+ }>, never, never>;
12770
+ }>>, never, never>;
12771
+ readonly data: Schema.Struct<{}>;
12772
+ }> & {
12773
+ data: Schema.Struct<{}>;
12774
+ durable?: {
12775
+ readonly version: number;
12776
+ readonly aggregate: string;
12777
+ } | undefined;
12778
+ type: "command.updated";
12679
12779
  }) | (Schema.Struct<{
12680
12780
  readonly id: Schema.brand<Schema.String, "Event.ID"> & {
12681
12781
  create: () => string & import("effect/Brand").Brand<"Event.ID">;
@@ -1,7 +1,7 @@
1
1
  import { PromptInput } from "@opencode-ai/schema/prompt-input";
2
2
  import { Context, Effect, Schema } from "effect";
3
3
  import { HttpApiEndpoint, HttpApiGroup, HttpApiMiddleware, HttpApiSchema } from "effect/unstable/httpapi";
4
- import { ConflictError, InvalidCursorError, InvalidRequestError, MessageNotFoundError, ServiceUnavailableError, SessionBusyError, SessionNotFoundError, SkillNotFoundError, UnknownError } from "../errors.js";
4
+ import { ConflictError, CommandEvaluationError, CommandNotFoundError, InvalidCursorError, InvalidRequestError, MessageNotFoundError, ServiceUnavailableError, SessionBusyError, SessionNotFoundError, SkillNotFoundError, UnknownError } from "../errors.js";
5
5
  import { SessionEvent } from "@opencode-ai/schema/session-event";
6
6
  declare const SessionsCursorInput: Schema.Union<readonly [Schema.Struct<{
7
7
  readonly search: Schema.optional<Schema.String>;
@@ -983,7 +983,248 @@ export declare const makeSessionGroup: <I extends HttpApiMiddleware.AnyId, S>(se
983
983
  readonly timeCreated: Schema.decodeTo<Schema.DateTimeUtc, Schema.Finite, never, never>;
984
984
  readonly promotedSeq: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Int>>, Schema.optionalKey<Schema.Int>, never, never>;
985
985
  }>;
986
- }>>, HttpApiEndpoint.Json<typeof ConflictError | typeof SessionNotFoundError>, I, HttpApiMiddleware.Requires<I>> | HttpApiEndpoint.HttpApiEndpoint<"session.skill", "POST", "/api/session/:sessionID/skill", HttpApiEndpoint.StringTree<Schema.Struct<{
986
+ }>>, HttpApiEndpoint.Json<typeof ConflictError | typeof SessionNotFoundError>, I, HttpApiMiddleware.Requires<I>> | HttpApiEndpoint.HttpApiEndpoint<"session.command", "POST", "/api/session/:sessionID/command", HttpApiEndpoint.StringTree<Schema.Struct<{
987
+ sessionID: Schema.brand<Schema.String, "SessionID"> & {
988
+ create: () => string & import("effect/Brand").Brand<"SessionID">;
989
+ descending: (id?: string) => string & import("effect/Brand").Brand<"SessionID">;
990
+ };
991
+ }>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<Schema.Struct<{
992
+ readonly id: Schema.optional<Schema.brand<Schema.String, "Session.Message.ID"> & {
993
+ create: () => string & import("effect/Brand").Brand<"Session.Message.ID">;
994
+ }>;
995
+ readonly command: Schema.String;
996
+ readonly arguments: Schema.optional<Schema.String>;
997
+ readonly agent: Schema.optional<Schema.String>;
998
+ readonly model: Schema.optional<Schema.Struct<{
999
+ readonly id: Schema.brand<Schema.String, "ModelV2.ID">;
1000
+ readonly providerID: Schema.brand<Schema.String, "ProviderV2.ID"> & {
1001
+ opencode: string & import("effect/Brand").Brand<"ProviderV2.ID">;
1002
+ anthropic: string & import("effect/Brand").Brand<"ProviderV2.ID">;
1003
+ openai: string & import("effect/Brand").Brand<"ProviderV2.ID">;
1004
+ google: string & import("effect/Brand").Brand<"ProviderV2.ID">;
1005
+ googleVertex: string & import("effect/Brand").Brand<"ProviderV2.ID">;
1006
+ githubCopilot: string & import("effect/Brand").Brand<"ProviderV2.ID">;
1007
+ amazonBedrock: string & import("effect/Brand").Brand<"ProviderV2.ID">;
1008
+ azure: string & import("effect/Brand").Brand<"ProviderV2.ID">;
1009
+ openrouter: string & import("effect/Brand").Brand<"ProviderV2.ID">;
1010
+ mistral: string & import("effect/Brand").Brand<"ProviderV2.ID">;
1011
+ gitlab: string & import("effect/Brand").Brand<"ProviderV2.ID">;
1012
+ };
1013
+ readonly variant: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.String, "VariantID">>>, Schema.optionalKey<Schema.brand<Schema.String, "VariantID">>, never, never>;
1014
+ }>>;
1015
+ readonly files: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Array<Schema.Struct<{
1016
+ readonly uri: Schema.String;
1017
+ readonly name: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
1018
+ readonly description: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
1019
+ readonly source: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
1020
+ readonly start: Schema.Finite;
1021
+ readonly end: Schema.Finite;
1022
+ readonly text: Schema.String;
1023
+ }>>>, Schema.optionalKey<Schema.Struct<{
1024
+ readonly start: Schema.Finite;
1025
+ readonly end: Schema.Finite;
1026
+ readonly text: Schema.String;
1027
+ }>>, never, never>;
1028
+ }> & {
1029
+ create: (input: PromptInput.FileAttachment) => {
1030
+ readonly uri: string;
1031
+ readonly name?: string | undefined;
1032
+ readonly description?: string | undefined;
1033
+ readonly source?: {
1034
+ readonly start: number;
1035
+ readonly end: number;
1036
+ readonly text: string;
1037
+ } | undefined;
1038
+ };
1039
+ }>>>, Schema.optionalKey<Schema.$Array<Schema.Struct<{
1040
+ readonly uri: Schema.String;
1041
+ readonly name: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
1042
+ readonly description: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
1043
+ readonly source: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
1044
+ readonly start: Schema.Finite;
1045
+ readonly end: Schema.Finite;
1046
+ readonly text: Schema.String;
1047
+ }>>>, Schema.optionalKey<Schema.Struct<{
1048
+ readonly start: Schema.Finite;
1049
+ readonly end: Schema.Finite;
1050
+ readonly text: Schema.String;
1051
+ }>>, never, never>;
1052
+ }> & {
1053
+ create: (input: PromptInput.FileAttachment) => {
1054
+ readonly uri: string;
1055
+ readonly name?: string | undefined;
1056
+ readonly description?: string | undefined;
1057
+ readonly source?: {
1058
+ readonly start: number;
1059
+ readonly end: number;
1060
+ readonly text: string;
1061
+ } | undefined;
1062
+ };
1063
+ }>>, never, never>;
1064
+ readonly agents: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Array<Schema.Struct<{
1065
+ readonly name: Schema.String;
1066
+ readonly source: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
1067
+ readonly start: Schema.Finite;
1068
+ readonly end: Schema.Finite;
1069
+ readonly text: Schema.String;
1070
+ }>>>, Schema.optionalKey<Schema.Struct<{
1071
+ readonly start: Schema.Finite;
1072
+ readonly end: Schema.Finite;
1073
+ readonly text: Schema.String;
1074
+ }>>, never, never>;
1075
+ }>>>>, Schema.optionalKey<Schema.$Array<Schema.Struct<{
1076
+ readonly name: Schema.String;
1077
+ readonly source: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
1078
+ readonly start: Schema.Finite;
1079
+ readonly end: Schema.Finite;
1080
+ readonly text: Schema.String;
1081
+ }>>>, Schema.optionalKey<Schema.Struct<{
1082
+ readonly start: Schema.Finite;
1083
+ readonly end: Schema.Finite;
1084
+ readonly text: Schema.String;
1085
+ }>>, never, never>;
1086
+ }>>>, never, never>;
1087
+ readonly delivery: Schema.optional<Schema.Literals<readonly ["steer", "queue"]>>;
1088
+ readonly resume: Schema.optional<Schema.Boolean>;
1089
+ }>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<Schema.Struct<{
1090
+ readonly data: Schema.Struct<{
1091
+ readonly admittedSeq: Schema.Int;
1092
+ readonly id: Schema.brand<Schema.String, "Session.Message.ID"> & {
1093
+ create: () => string & import("effect/Brand").Brand<"Session.Message.ID">;
1094
+ };
1095
+ readonly sessionID: Schema.brand<Schema.String, "SessionID"> & {
1096
+ create: () => string & import("effect/Brand").Brand<"SessionID">;
1097
+ descending: (id?: string) => string & import("effect/Brand").Brand<"SessionID">;
1098
+ };
1099
+ readonly prompt: Schema.Struct<{
1100
+ readonly text: Schema.String;
1101
+ readonly files: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Array<Schema.Struct<{
1102
+ readonly uri: Schema.String;
1103
+ readonly mime: Schema.String;
1104
+ readonly name: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
1105
+ readonly description: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
1106
+ readonly source: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
1107
+ readonly start: Schema.Finite;
1108
+ readonly end: Schema.Finite;
1109
+ readonly text: Schema.String;
1110
+ }>>>, Schema.optionalKey<Schema.Struct<{
1111
+ readonly start: Schema.Finite;
1112
+ readonly end: Schema.Finite;
1113
+ readonly text: Schema.String;
1114
+ }>>, never, never>;
1115
+ }> & {
1116
+ create: (input: SessionEvent.FileAttachment) => {
1117
+ readonly uri: string;
1118
+ readonly mime: string;
1119
+ readonly name?: string | undefined;
1120
+ readonly description?: string | undefined;
1121
+ readonly source?: {
1122
+ readonly start: number;
1123
+ readonly end: number;
1124
+ readonly text: string;
1125
+ } | undefined;
1126
+ };
1127
+ }>>>, Schema.optionalKey<Schema.$Array<Schema.Struct<{
1128
+ readonly uri: Schema.String;
1129
+ readonly mime: Schema.String;
1130
+ readonly name: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
1131
+ readonly description: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
1132
+ readonly source: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
1133
+ readonly start: Schema.Finite;
1134
+ readonly end: Schema.Finite;
1135
+ readonly text: Schema.String;
1136
+ }>>>, Schema.optionalKey<Schema.Struct<{
1137
+ readonly start: Schema.Finite;
1138
+ readonly end: Schema.Finite;
1139
+ readonly text: Schema.String;
1140
+ }>>, never, never>;
1141
+ }> & {
1142
+ create: (input: SessionEvent.FileAttachment) => {
1143
+ readonly uri: string;
1144
+ readonly mime: string;
1145
+ readonly name?: string | undefined;
1146
+ readonly description?: string | undefined;
1147
+ readonly source?: {
1148
+ readonly start: number;
1149
+ readonly end: number;
1150
+ readonly text: string;
1151
+ } | undefined;
1152
+ };
1153
+ }>>, never, never>;
1154
+ readonly agents: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Array<Schema.Struct<{
1155
+ readonly name: Schema.String;
1156
+ readonly source: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
1157
+ readonly start: Schema.Finite;
1158
+ readonly end: Schema.Finite;
1159
+ readonly text: Schema.String;
1160
+ }>>>, Schema.optionalKey<Schema.Struct<{
1161
+ readonly start: Schema.Finite;
1162
+ readonly end: Schema.Finite;
1163
+ readonly text: Schema.String;
1164
+ }>>, never, never>;
1165
+ }>>>>, Schema.optionalKey<Schema.$Array<Schema.Struct<{
1166
+ readonly name: Schema.String;
1167
+ readonly source: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
1168
+ readonly start: Schema.Finite;
1169
+ readonly end: Schema.Finite;
1170
+ readonly text: Schema.String;
1171
+ }>>>, Schema.optionalKey<Schema.Struct<{
1172
+ readonly start: Schema.Finite;
1173
+ readonly end: Schema.Finite;
1174
+ readonly text: Schema.String;
1175
+ }>>, never, never>;
1176
+ }>>>, never, never>;
1177
+ }> & {
1178
+ equivalence: import("effect/Equivalence").Equivalence<{
1179
+ readonly text: string;
1180
+ readonly files?: readonly {
1181
+ readonly uri: string;
1182
+ readonly mime: string;
1183
+ readonly name?: string | undefined;
1184
+ readonly description?: string | undefined;
1185
+ readonly source?: {
1186
+ readonly start: number;
1187
+ readonly end: number;
1188
+ readonly text: string;
1189
+ } | undefined;
1190
+ }[] | undefined;
1191
+ readonly agents?: readonly {
1192
+ readonly name: string;
1193
+ readonly source?: {
1194
+ readonly start: number;
1195
+ readonly end: number;
1196
+ readonly text: string;
1197
+ } | undefined;
1198
+ }[] | undefined;
1199
+ }>;
1200
+ fromUserMessage: (input: Pick<import("@opencode-ai/schema/prompt").Prompt, "text" | "files" | "agents">) => {
1201
+ readonly text: string;
1202
+ readonly files?: readonly {
1203
+ readonly uri: string;
1204
+ readonly mime: string;
1205
+ readonly name?: string | undefined;
1206
+ readonly description?: string | undefined;
1207
+ readonly source?: {
1208
+ readonly start: number;
1209
+ readonly end: number;
1210
+ readonly text: string;
1211
+ } | undefined;
1212
+ }[] | undefined;
1213
+ readonly agents?: readonly {
1214
+ readonly name: string;
1215
+ readonly source?: {
1216
+ readonly start: number;
1217
+ readonly end: number;
1218
+ readonly text: string;
1219
+ } | undefined;
1220
+ }[] | undefined;
1221
+ };
1222
+ };
1223
+ readonly delivery: Schema.Literals<readonly ["steer", "queue"]>;
1224
+ readonly timeCreated: Schema.decodeTo<Schema.DateTimeUtc, Schema.Finite, never, never>;
1225
+ readonly promotedSeq: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Int>>, Schema.optionalKey<Schema.Int>, never, never>;
1226
+ }>;
1227
+ }>>, HttpApiEndpoint.Json<typeof ConflictError | typeof SessionNotFoundError | typeof CommandNotFoundError | typeof CommandEvaluationError>, I, HttpApiMiddleware.Requires<I>> | HttpApiEndpoint.HttpApiEndpoint<"session.skill", "POST", "/api/session/:sessionID/skill", HttpApiEndpoint.StringTree<Schema.Struct<{
987
1228
  sessionID: Schema.brand<Schema.String, "SessionID"> & {
988
1229
  create: () => string & import("effect/Brand").Brand<"SessionID">;
989
1230
  descending: (id?: string) => string & import("effect/Brand").Brand<"SessionID">;
@@ -8,7 +8,7 @@ import { AbsolutePath, NonNegativeInt, PositiveInt, RelativePath, statics } from
8
8
  import { Workspace } from "@opencode-ai/schema/workspace";
9
9
  import { Context, Effect, Encoding, Result, Schema, Struct } from "effect";
10
10
  import { HttpApiEndpoint, HttpApiGroup, HttpApiMiddleware, HttpApiSchema, OpenApi } from "effect/unstable/httpapi";
11
- import { ConflictError, InvalidCursorError, InvalidRequestError, MessageNotFoundError, ServiceUnavailableError, SessionBusyError, SessionNotFoundError, SkillNotFoundError, UnknownError, } from "../errors.js";
11
+ import { ConflictError, CommandEvaluationError, CommandNotFoundError, InvalidCursorError, InvalidRequestError, MessageNotFoundError, ServiceUnavailableError, SessionBusyError, SessionNotFoundError, SkillNotFoundError, UnknownError, } from "../errors.js";
12
12
  import { Agent } from "@opencode-ai/schema/agent";
13
13
  import { Model } from "@opencode-ai/schema/model";
14
14
  import { Location } from "@opencode-ai/schema/location";
@@ -188,6 +188,28 @@ export const makeSessionGroup = (sessionLocationMiddleware) => HttpApiGroup.make
188
188
  identifier: "v2.session.prompt",
189
189
  summary: "Send message",
190
190
  description: "Durably admit one session input and schedule agent-loop execution unless resume is false.",
191
+ })))
192
+ .add(HttpApiEndpoint.post("session.command", "/api/session/:sessionID/command", {
193
+ params: { sessionID: Session.ID },
194
+ payload: Schema.Struct({
195
+ id: SessionMessage.ID.pipe(Schema.optional),
196
+ command: Schema.String,
197
+ arguments: Schema.String.pipe(Schema.optional),
198
+ agent: Schema.String.pipe(Schema.optional),
199
+ model: Model.Ref.pipe(Schema.optional),
200
+ files: PromptInput.Prompt.fields.files,
201
+ agents: PromptInput.Prompt.fields.agents,
202
+ delivery: SessionInput.Delivery.pipe(Schema.optional),
203
+ resume: Schema.Boolean.pipe(Schema.optional),
204
+ }),
205
+ success: Schema.Struct({ data: SessionInput.Admitted }),
206
+ error: [ConflictError, SessionNotFoundError, CommandNotFoundError, CommandEvaluationError],
207
+ })
208
+ .middleware(sessionLocationMiddleware)
209
+ .annotateMerge(OpenApi.annotations({
210
+ identifier: "v2.session.command",
211
+ summary: "Run command",
212
+ description: "Resolve a slash command into prompt input, admit it durably, and schedule execution unless resume is false.",
191
213
  })))
192
214
  .add(HttpApiEndpoint.post("session.skill", "/api/session/:sessionID/skill", {
193
215
  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-14710",
4
+ "version": "0.0.0-next-14715",
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-14710",
29
+ "@opencode-ai/schema": "0.0.0-next-14715",
30
30
  "effect": "4.0.0-beta.83"
31
31
  },
32
32
  "devDependencies": {