@moxt-ai/mobius-sdk 0.0.129 → 0.0.131
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/README.md +7 -0
- package/dist/client.js +2 -2
- package/dist/client.js.map +1 -1
- package/dist/platform.d.ts +3 -0
- package/dist/platform.d.ts.map +1 -1
- package/dist/platform.js +6 -0
- package/dist/platform.js.map +1 -1
- package/dist/protocol/index.d.ts +1 -1
- package/dist/protocol/index.d.ts.map +1 -1
- package/dist/protocol/index.js +1 -1
- package/dist/protocol/index.js.map +1 -1
- package/dist/protocol/session/interactions/model.d.ts +2 -1
- package/dist/protocol/session/interactions/model.d.ts.map +1 -1
- package/dist/protocol/session/interactions/model.js +28 -1
- package/dist/protocol/session/interactions/model.js.map +1 -1
- package/dist/protocol/session/observability/event-log.d.ts +98 -1389
- package/dist/protocol/session/observability/event-log.d.ts.map +1 -1
- package/dist/protocol/session/observability/event-log.js +145 -10
- package/dist/protocol/session/observability/event-log.js.map +1 -1
- package/dist/protocol/session/observability/history.d.ts +42 -522
- package/dist/protocol/session/observability/history.d.ts.map +1 -1
- package/dist/protocol/session/observability/history.js +56 -3
- package/dist/protocol/session/observability/history.js.map +1 -1
- package/dist/protocol/session/recording/recorded-lifecycle-status.d.ts +2 -2
- package/dist/protocol/session/recording/recorded-lifecycle-status.d.ts.map +1 -1
- package/dist/protocol/session/recording/recorded-lifecycle-status.js.map +1 -1
- package/dist/protocol/session/recording/recording.d.ts +1 -1
- package/dist/protocol/session/recording/turn-history.d.ts +1 -1
- package/dist/protocol/session/recording/turn-history.d.ts.map +1 -1
- package/dist/protocol/session/recording/turn-history.js +133 -7
- package/dist/protocol/session/recording/turn-history.js.map +1 -1
- package/dist/protocol/session/recording/webhooks.d.ts +8 -13
- package/dist/protocol/session/recording/webhooks.d.ts.map +1 -1
- package/dist/protocol/session/recording/webhooks.js +30 -4
- package/dist/protocol/session/recording/webhooks.js.map +1 -1
- package/dist/protocol/session/turn/index.d.ts +2 -1
- package/dist/protocol/session/turn/index.d.ts.map +1 -1
- package/dist/protocol/session/turn/index.js +20 -1
- package/dist/protocol/session/turn/index.js.map +1 -1
- package/dist/protocol/shared/message-codec.d.ts +0 -6
- package/dist/protocol/shared/message-codec.d.ts.map +1 -1
- package/dist/protocol/shared/message-codec.js +0 -11
- package/dist/protocol/shared/message-codec.js.map +1 -1
- package/dist/protocol/transport/daemon-transport.d.ts +12 -425
- package/dist/protocol/transport/daemon-transport.d.ts.map +1 -1
- package/dist/protocol/transport/daemon-transport.js +81 -7
- package/dist/protocol/transport/daemon-transport.js.map +1 -1
- package/dist/resources.d.ts +1 -1
- package/dist/resources.d.ts.map +1 -1
- package/dist/resources.js +3 -0
- package/dist/resources.js.map +1 -1
- package/dist/service-client.d.ts.map +1 -1
- package/dist/service-client.js +22 -7
- package/dist/service-client.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"message-codec.js","sourceRoot":"","sources":["../../../src/protocol/shared/message-codec.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAAE,+BAA+B,EAAE,MAAM,gBAAgB,CAAC;AACxF,OAAO,EAAE,gBAAgB,EAAmB,MAAM,iBAAiB,CAAC;AAEpE,MAAM,OAAO,oBAAqB,SAAQ,KAAK;IAClC,IAAI,GAAG,0BAA0B,CAAC;IAE3C,YAAY,OAAe,EAAE,OAAO,GAAiB,EAAE;QACnD,KAAK,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QACxB,IAAI,CAAC,IAAI,GAAG,sBAAsB,CAAC;IACvC,CAAC;CACJ;AAED,
|
|
1
|
+
{"version":3,"file":"message-codec.js","sourceRoot":"","sources":["../../../src/protocol/shared/message-codec.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAAE,+BAA+B,EAAE,MAAM,gBAAgB,CAAC;AACxF,OAAO,EAAE,gBAAgB,EAAmB,MAAM,iBAAiB,CAAC;AAEpE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,OAAO,MAAM,CAAC,IAAI,CAAC;AACvB,CAAC;AAED,MAAM,UAAU,cAAc,CAAI,KAAc,EAAE,MAAoB;IAClE,MAAM,MAAM,GAAG,MAAM,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;IACvC,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;QAClB,MAAM,IAAI,oBAAoB,CAAC,yCAAyC,EAAE;YACtE,KAAK,EAAE,MAAM,CAAC,KAAK;SACtB,CAAC,CAAC;IACP,CAAC;IACD,OAAO,MAAM,CAAC,IAAI,CAAC;AACvB,CAAC;AAED,MAAM,UAAU,gBAAgB,CAAI,OAAU,EAAE,MAAoB;IAChE,OAAO,IAAI,CAAC,SAAS,CAAC,cAAc,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC,CAAC;AAC3D,CAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { SESSION_EVENT_KIND, type SessionWireEnvelope } from "../session/observability/event-log.ts";
|
|
2
|
+
import { SESSION_HISTORY_PAGE_LOADED_KIND, SESSION_PREVIEW_HISTORY_PAGE_LOADED_KIND, type SessionHistoryWirePageLoaded, type SessionPreviewHistoryWirePageLoaded } from "../session/observability/history.ts";
|
|
2
3
|
interface MessageSignature<TMessage extends {
|
|
3
4
|
readonly kind: string;
|
|
4
5
|
}> {
|
|
@@ -202,6 +203,8 @@ declare const serviceToDaemonSignatures: {
|
|
|
202
203
|
}>>;
|
|
203
204
|
};
|
|
204
205
|
export type ServiceToDaemonMessage = ReturnType<(typeof serviceToDaemonSignatures)[keyof typeof serviceToDaemonSignatures]["decoder"]>;
|
|
206
|
+
/** Decodes only message and nested variants known by this SDK. */
|
|
207
|
+
export declare function decodeKnownServiceToDaemonMessage(encoded: string): ServiceToDaemonMessage | null;
|
|
205
208
|
export declare function decodeServiceToDaemonMessage(encoded: string): ServiceToDaemonMessage;
|
|
206
209
|
export declare function encodeServiceToDaemonMessage(message: ServiceToDaemonMessage): string;
|
|
207
210
|
declare const daemonToServiceSignatures: {
|
|
@@ -218,7 +221,7 @@ declare const daemonToServiceSignatures: {
|
|
|
218
221
|
readonly "session.preview-history.page.loaded": MessageSignature<Readonly<{
|
|
219
222
|
events: Readonly<{
|
|
220
223
|
events: Readonly<{
|
|
221
|
-
events: readonly
|
|
224
|
+
events: readonly Readonly<{
|
|
222
225
|
eventId: string;
|
|
223
226
|
mobiusMetadata?: Readonly<{
|
|
224
227
|
omitted?: true | undefined;
|
|
@@ -1017,216 +1020,7 @@ declare const daemonToServiceSignatures: {
|
|
|
1017
1020
|
sessionUpdate: "compaction_summary_chunk";
|
|
1018
1021
|
}>;
|
|
1019
1022
|
type: "acp";
|
|
1020
|
-
}>
|
|
1021
|
-
eventId: string;
|
|
1022
|
-
mobiusMetadata?: Readonly<{
|
|
1023
|
-
omitted?: true | undefined;
|
|
1024
|
-
}> | undefined;
|
|
1025
|
-
recordedAt: string;
|
|
1026
|
-
sessionGenerationId: string;
|
|
1027
|
-
sessionId: string;
|
|
1028
|
-
payload: Readonly<{
|
|
1029
|
-
kind: "session.queue.changed";
|
|
1030
|
-
}> | Readonly<{
|
|
1031
|
-
event: Readonly<{
|
|
1032
|
-
commandId: string;
|
|
1033
|
-
details?: Readonly<{
|
|
1034
|
-
cwd: string;
|
|
1035
|
-
rawInput?: unknown;
|
|
1036
|
-
locations: readonly Readonly<{
|
|
1037
|
-
line?: number | null | undefined;
|
|
1038
|
-
path: string;
|
|
1039
|
-
}>[];
|
|
1040
|
-
}> | undefined;
|
|
1041
|
-
interactionId: string;
|
|
1042
|
-
kind: "session.permission.requested";
|
|
1043
|
-
options: readonly Readonly<{
|
|
1044
|
-
kind: "allow_always" | "allow_once" | "reject_always" | "reject_once";
|
|
1045
|
-
name: string;
|
|
1046
|
-
optionId: string;
|
|
1047
|
-
}>[];
|
|
1048
|
-
sessionId: string;
|
|
1049
|
-
title: string;
|
|
1050
|
-
toolCallId: string;
|
|
1051
|
-
toolKind: string;
|
|
1052
|
-
}>;
|
|
1053
|
-
kind: "session.permission.requested";
|
|
1054
|
-
}> | Readonly<{
|
|
1055
|
-
event: Readonly<{
|
|
1056
|
-
interactionId: string;
|
|
1057
|
-
kind: "session.permission.resolved";
|
|
1058
|
-
optionId: string;
|
|
1059
|
-
outcome: "cancelled" | "selected";
|
|
1060
|
-
sessionId: string;
|
|
1061
|
-
}>;
|
|
1062
|
-
kind: "session.permission.resolved";
|
|
1063
|
-
}> | Readonly<{
|
|
1064
|
-
event: Readonly<{
|
|
1065
|
-
accepted: boolean;
|
|
1066
|
-
commandId: string;
|
|
1067
|
-
elicitationId: string;
|
|
1068
|
-
fields: readonly Readonly<{
|
|
1069
|
-
defaultBooleanValue: boolean;
|
|
1070
|
-
defaultNumberValue: number;
|
|
1071
|
-
defaultStringValue: string;
|
|
1072
|
-
description: string;
|
|
1073
|
-
format: string;
|
|
1074
|
-
hasDefaultValue: boolean;
|
|
1075
|
-
maximum: string;
|
|
1076
|
-
maximumLength: string;
|
|
1077
|
-
minimum: string;
|
|
1078
|
-
minimumLength: string;
|
|
1079
|
-
multiline?: boolean | undefined;
|
|
1080
|
-
name: string;
|
|
1081
|
-
options: readonly Readonly<{
|
|
1082
|
-
description: string;
|
|
1083
|
-
label: string;
|
|
1084
|
-
value: string;
|
|
1085
|
-
}>[];
|
|
1086
|
-
pattern: string;
|
|
1087
|
-
required: boolean;
|
|
1088
|
-
title: string;
|
|
1089
|
-
type: "boolean" | "integer" | "multiselect" | "number" | "select" | "string";
|
|
1090
|
-
}>[];
|
|
1091
|
-
interactionId: string;
|
|
1092
|
-
kind: "session.elicitation.requested";
|
|
1093
|
-
message: string;
|
|
1094
|
-
mode: "form" | "url";
|
|
1095
|
-
sessionId: string;
|
|
1096
|
-
url: string;
|
|
1097
|
-
}>;
|
|
1098
|
-
kind: "session.elicitation.requested";
|
|
1099
|
-
}> | Readonly<{
|
|
1100
|
-
event: Readonly<{
|
|
1101
|
-
action: "accept" | "cancel" | "complete" | "decline";
|
|
1102
|
-
interactionId: string;
|
|
1103
|
-
kind: "session.elicitation.resolved";
|
|
1104
|
-
sessionId: string;
|
|
1105
|
-
}>;
|
|
1106
|
-
kind: "session.elicitation.resolved";
|
|
1107
|
-
}> | Readonly<{
|
|
1108
|
-
commandId: string;
|
|
1109
|
-
content: readonly (Readonly<{
|
|
1110
|
-
annotations?: Readonly<{
|
|
1111
|
-
audience?: readonly ("assistant" | "user")[] | null | undefined;
|
|
1112
|
-
lastModified?: string | null | undefined;
|
|
1113
|
-
priority?: number | null | undefined;
|
|
1114
|
-
}> | null | undefined;
|
|
1115
|
-
text: string;
|
|
1116
|
-
type: "text";
|
|
1117
|
-
}> | Readonly<{
|
|
1118
|
-
annotations?: Readonly<{
|
|
1119
|
-
audience?: readonly ("assistant" | "user")[] | null | undefined;
|
|
1120
|
-
lastModified?: string | null | undefined;
|
|
1121
|
-
priority?: number | null | undefined;
|
|
1122
|
-
}> | null | undefined;
|
|
1123
|
-
data: string;
|
|
1124
|
-
mimeType: string;
|
|
1125
|
-
type: "image";
|
|
1126
|
-
uri?: string | null | undefined;
|
|
1127
|
-
}> | Readonly<{
|
|
1128
|
-
annotations?: Readonly<{
|
|
1129
|
-
audience?: readonly ("assistant" | "user")[] | null | undefined;
|
|
1130
|
-
lastModified?: string | null | undefined;
|
|
1131
|
-
priority?: number | null | undefined;
|
|
1132
|
-
}> | null | undefined;
|
|
1133
|
-
data: string;
|
|
1134
|
-
mimeType: string;
|
|
1135
|
-
type: "audio";
|
|
1136
|
-
}> | Readonly<{
|
|
1137
|
-
annotations?: Readonly<{
|
|
1138
|
-
audience?: readonly ("assistant" | "user")[] | null | undefined;
|
|
1139
|
-
lastModified?: string | null | undefined;
|
|
1140
|
-
priority?: number | null | undefined;
|
|
1141
|
-
}> | null | undefined;
|
|
1142
|
-
description?: string | null | undefined;
|
|
1143
|
-
mimeType?: string | null | undefined;
|
|
1144
|
-
name: string;
|
|
1145
|
-
size?: number | null | undefined;
|
|
1146
|
-
title?: string | null | undefined;
|
|
1147
|
-
type: "resource_link";
|
|
1148
|
-
uri: string;
|
|
1149
|
-
}> | Readonly<{
|
|
1150
|
-
annotations?: Readonly<{
|
|
1151
|
-
audience?: readonly ("assistant" | "user")[] | null | undefined;
|
|
1152
|
-
lastModified?: string | null | undefined;
|
|
1153
|
-
priority?: number | null | undefined;
|
|
1154
|
-
}> | null | undefined;
|
|
1155
|
-
resource: Readonly<{
|
|
1156
|
-
mimeType?: string | null | undefined;
|
|
1157
|
-
text: string;
|
|
1158
|
-
uri: string;
|
|
1159
|
-
}> | Readonly<{
|
|
1160
|
-
blob: string;
|
|
1161
|
-
mimeType?: string | null | undefined;
|
|
1162
|
-
uri: string;
|
|
1163
|
-
}>;
|
|
1164
|
-
type: "resource";
|
|
1165
|
-
}> | Readonly<{
|
|
1166
|
-
annotations?: Readonly<{
|
|
1167
|
-
audience?: readonly ("assistant" | "user")[] | null | undefined;
|
|
1168
|
-
lastModified?: string | null | undefined;
|
|
1169
|
-
priority?: number | null | undefined;
|
|
1170
|
-
}> | null | undefined;
|
|
1171
|
-
byteLength: number;
|
|
1172
|
-
imageKey: string;
|
|
1173
|
-
mimeType: string;
|
|
1174
|
-
type: "external_image";
|
|
1175
|
-
uri?: string | null | undefined;
|
|
1176
|
-
}> | Readonly<{
|
|
1177
|
-
annotations?: Readonly<{
|
|
1178
|
-
audience?: readonly ("assistant" | "user")[] | null | undefined;
|
|
1179
|
-
lastModified?: string | null | undefined;
|
|
1180
|
-
priority?: number | null | undefined;
|
|
1181
|
-
}> | null | undefined;
|
|
1182
|
-
audioKey: string;
|
|
1183
|
-
byteLength: number;
|
|
1184
|
-
mimeType: string;
|
|
1185
|
-
type: "external_audio";
|
|
1186
|
-
}> | Readonly<{
|
|
1187
|
-
annotations?: Readonly<{
|
|
1188
|
-
audience?: readonly ("assistant" | "user")[] | null | undefined;
|
|
1189
|
-
lastModified?: string | null | undefined;
|
|
1190
|
-
priority?: number | null | undefined;
|
|
1191
|
-
}> | null | undefined;
|
|
1192
|
-
byteLength: number;
|
|
1193
|
-
encoding: "binary" | "text";
|
|
1194
|
-
mimeType?: string | null | undefined;
|
|
1195
|
-
resourceKey: string;
|
|
1196
|
-
type: "external_resource";
|
|
1197
|
-
uri: string;
|
|
1198
|
-
}>)[];
|
|
1199
|
-
disposition?: string | undefined;
|
|
1200
|
-
kind: "prompt.requested";
|
|
1201
|
-
context?: Readonly<{
|
|
1202
|
-
agentId: string;
|
|
1203
|
-
directoryId: string;
|
|
1204
|
-
additionalDirectoryIds: readonly string[];
|
|
1205
|
-
}> | undefined;
|
|
1206
|
-
targetCommandId?: string | undefined;
|
|
1207
|
-
}> | Readonly<{
|
|
1208
|
-
commandId: string;
|
|
1209
|
-
attemptId: string;
|
|
1210
|
-
epoch: string;
|
|
1211
|
-
kind: "prompt.started";
|
|
1212
|
-
}> | Readonly<{
|
|
1213
|
-
commandId: string;
|
|
1214
|
-
kind: "prompt.completed";
|
|
1215
|
-
stopReason: string;
|
|
1216
|
-
}> | Readonly<{
|
|
1217
|
-
commandId: string;
|
|
1218
|
-
code: string;
|
|
1219
|
-
kind: "prompt.failed-before-start";
|
|
1220
|
-
message: string;
|
|
1221
|
-
}> | Readonly<{
|
|
1222
|
-
commandId: string;
|
|
1223
|
-
attemptId: string;
|
|
1224
|
-
code: string;
|
|
1225
|
-
kind: "prompt.failed";
|
|
1226
|
-
message: string;
|
|
1227
|
-
}>;
|
|
1228
|
-
type: "lifecycle-metadata";
|
|
1229
|
-
}>)[];
|
|
1023
|
+
}>[];
|
|
1230
1024
|
nextCursor: string | null;
|
|
1231
1025
|
sessionGenerationId: string;
|
|
1232
1026
|
tailCursor: string;
|
|
@@ -2873,7 +2667,7 @@ declare const daemonToServiceSignatures: {
|
|
|
2873
2667
|
readonly "session.live-history.v2.page.loaded": MessageSignature<Readonly<{
|
|
2874
2668
|
events: Readonly<{
|
|
2875
2669
|
events: Readonly<{
|
|
2876
|
-
events: readonly
|
|
2670
|
+
events: readonly Readonly<{
|
|
2877
2671
|
eventId: string;
|
|
2878
2672
|
mobiusMetadata?: Readonly<{
|
|
2879
2673
|
omitted?: true | undefined;
|
|
@@ -3672,216 +3466,7 @@ declare const daemonToServiceSignatures: {
|
|
|
3672
3466
|
sessionUpdate: "compaction_summary_chunk";
|
|
3673
3467
|
}>;
|
|
3674
3468
|
type: "acp";
|
|
3675
|
-
}>
|
|
3676
|
-
eventId: string;
|
|
3677
|
-
mobiusMetadata?: Readonly<{
|
|
3678
|
-
omitted?: true | undefined;
|
|
3679
|
-
}> | undefined;
|
|
3680
|
-
recordedAt: string;
|
|
3681
|
-
sessionGenerationId: string;
|
|
3682
|
-
sessionId: string;
|
|
3683
|
-
payload: Readonly<{
|
|
3684
|
-
kind: "session.queue.changed";
|
|
3685
|
-
}> | Readonly<{
|
|
3686
|
-
event: Readonly<{
|
|
3687
|
-
commandId: string;
|
|
3688
|
-
details?: Readonly<{
|
|
3689
|
-
cwd: string;
|
|
3690
|
-
rawInput?: unknown;
|
|
3691
|
-
locations: readonly Readonly<{
|
|
3692
|
-
line?: number | null | undefined;
|
|
3693
|
-
path: string;
|
|
3694
|
-
}>[];
|
|
3695
|
-
}> | undefined;
|
|
3696
|
-
interactionId: string;
|
|
3697
|
-
kind: "session.permission.requested";
|
|
3698
|
-
options: readonly Readonly<{
|
|
3699
|
-
kind: "allow_always" | "allow_once" | "reject_always" | "reject_once";
|
|
3700
|
-
name: string;
|
|
3701
|
-
optionId: string;
|
|
3702
|
-
}>[];
|
|
3703
|
-
sessionId: string;
|
|
3704
|
-
title: string;
|
|
3705
|
-
toolCallId: string;
|
|
3706
|
-
toolKind: string;
|
|
3707
|
-
}>;
|
|
3708
|
-
kind: "session.permission.requested";
|
|
3709
|
-
}> | Readonly<{
|
|
3710
|
-
event: Readonly<{
|
|
3711
|
-
interactionId: string;
|
|
3712
|
-
kind: "session.permission.resolved";
|
|
3713
|
-
optionId: string;
|
|
3714
|
-
outcome: "cancelled" | "selected";
|
|
3715
|
-
sessionId: string;
|
|
3716
|
-
}>;
|
|
3717
|
-
kind: "session.permission.resolved";
|
|
3718
|
-
}> | Readonly<{
|
|
3719
|
-
event: Readonly<{
|
|
3720
|
-
accepted: boolean;
|
|
3721
|
-
commandId: string;
|
|
3722
|
-
elicitationId: string;
|
|
3723
|
-
fields: readonly Readonly<{
|
|
3724
|
-
defaultBooleanValue: boolean;
|
|
3725
|
-
defaultNumberValue: number;
|
|
3726
|
-
defaultStringValue: string;
|
|
3727
|
-
description: string;
|
|
3728
|
-
format: string;
|
|
3729
|
-
hasDefaultValue: boolean;
|
|
3730
|
-
maximum: string;
|
|
3731
|
-
maximumLength: string;
|
|
3732
|
-
minimum: string;
|
|
3733
|
-
minimumLength: string;
|
|
3734
|
-
multiline?: boolean | undefined;
|
|
3735
|
-
name: string;
|
|
3736
|
-
options: readonly Readonly<{
|
|
3737
|
-
description: string;
|
|
3738
|
-
label: string;
|
|
3739
|
-
value: string;
|
|
3740
|
-
}>[];
|
|
3741
|
-
pattern: string;
|
|
3742
|
-
required: boolean;
|
|
3743
|
-
title: string;
|
|
3744
|
-
type: "boolean" | "integer" | "multiselect" | "number" | "select" | "string";
|
|
3745
|
-
}>[];
|
|
3746
|
-
interactionId: string;
|
|
3747
|
-
kind: "session.elicitation.requested";
|
|
3748
|
-
message: string;
|
|
3749
|
-
mode: "form" | "url";
|
|
3750
|
-
sessionId: string;
|
|
3751
|
-
url: string;
|
|
3752
|
-
}>;
|
|
3753
|
-
kind: "session.elicitation.requested";
|
|
3754
|
-
}> | Readonly<{
|
|
3755
|
-
event: Readonly<{
|
|
3756
|
-
action: "accept" | "cancel" | "complete" | "decline";
|
|
3757
|
-
interactionId: string;
|
|
3758
|
-
kind: "session.elicitation.resolved";
|
|
3759
|
-
sessionId: string;
|
|
3760
|
-
}>;
|
|
3761
|
-
kind: "session.elicitation.resolved";
|
|
3762
|
-
}> | Readonly<{
|
|
3763
|
-
commandId: string;
|
|
3764
|
-
content: readonly (Readonly<{
|
|
3765
|
-
annotations?: Readonly<{
|
|
3766
|
-
audience?: readonly ("assistant" | "user")[] | null | undefined;
|
|
3767
|
-
lastModified?: string | null | undefined;
|
|
3768
|
-
priority?: number | null | undefined;
|
|
3769
|
-
}> | null | undefined;
|
|
3770
|
-
text: string;
|
|
3771
|
-
type: "text";
|
|
3772
|
-
}> | Readonly<{
|
|
3773
|
-
annotations?: Readonly<{
|
|
3774
|
-
audience?: readonly ("assistant" | "user")[] | null | undefined;
|
|
3775
|
-
lastModified?: string | null | undefined;
|
|
3776
|
-
priority?: number | null | undefined;
|
|
3777
|
-
}> | null | undefined;
|
|
3778
|
-
data: string;
|
|
3779
|
-
mimeType: string;
|
|
3780
|
-
type: "image";
|
|
3781
|
-
uri?: string | null | undefined;
|
|
3782
|
-
}> | Readonly<{
|
|
3783
|
-
annotations?: Readonly<{
|
|
3784
|
-
audience?: readonly ("assistant" | "user")[] | null | undefined;
|
|
3785
|
-
lastModified?: string | null | undefined;
|
|
3786
|
-
priority?: number | null | undefined;
|
|
3787
|
-
}> | null | undefined;
|
|
3788
|
-
data: string;
|
|
3789
|
-
mimeType: string;
|
|
3790
|
-
type: "audio";
|
|
3791
|
-
}> | Readonly<{
|
|
3792
|
-
annotations?: Readonly<{
|
|
3793
|
-
audience?: readonly ("assistant" | "user")[] | null | undefined;
|
|
3794
|
-
lastModified?: string | null | undefined;
|
|
3795
|
-
priority?: number | null | undefined;
|
|
3796
|
-
}> | null | undefined;
|
|
3797
|
-
description?: string | null | undefined;
|
|
3798
|
-
mimeType?: string | null | undefined;
|
|
3799
|
-
name: string;
|
|
3800
|
-
size?: number | null | undefined;
|
|
3801
|
-
title?: string | null | undefined;
|
|
3802
|
-
type: "resource_link";
|
|
3803
|
-
uri: string;
|
|
3804
|
-
}> | Readonly<{
|
|
3805
|
-
annotations?: Readonly<{
|
|
3806
|
-
audience?: readonly ("assistant" | "user")[] | null | undefined;
|
|
3807
|
-
lastModified?: string | null | undefined;
|
|
3808
|
-
priority?: number | null | undefined;
|
|
3809
|
-
}> | null | undefined;
|
|
3810
|
-
resource: Readonly<{
|
|
3811
|
-
mimeType?: string | null | undefined;
|
|
3812
|
-
text: string;
|
|
3813
|
-
uri: string;
|
|
3814
|
-
}> | Readonly<{
|
|
3815
|
-
blob: string;
|
|
3816
|
-
mimeType?: string | null | undefined;
|
|
3817
|
-
uri: string;
|
|
3818
|
-
}>;
|
|
3819
|
-
type: "resource";
|
|
3820
|
-
}> | Readonly<{
|
|
3821
|
-
annotations?: Readonly<{
|
|
3822
|
-
audience?: readonly ("assistant" | "user")[] | null | undefined;
|
|
3823
|
-
lastModified?: string | null | undefined;
|
|
3824
|
-
priority?: number | null | undefined;
|
|
3825
|
-
}> | null | undefined;
|
|
3826
|
-
byteLength: number;
|
|
3827
|
-
imageKey: string;
|
|
3828
|
-
mimeType: string;
|
|
3829
|
-
type: "external_image";
|
|
3830
|
-
uri?: string | null | undefined;
|
|
3831
|
-
}> | Readonly<{
|
|
3832
|
-
annotations?: Readonly<{
|
|
3833
|
-
audience?: readonly ("assistant" | "user")[] | null | undefined;
|
|
3834
|
-
lastModified?: string | null | undefined;
|
|
3835
|
-
priority?: number | null | undefined;
|
|
3836
|
-
}> | null | undefined;
|
|
3837
|
-
audioKey: string;
|
|
3838
|
-
byteLength: number;
|
|
3839
|
-
mimeType: string;
|
|
3840
|
-
type: "external_audio";
|
|
3841
|
-
}> | Readonly<{
|
|
3842
|
-
annotations?: Readonly<{
|
|
3843
|
-
audience?: readonly ("assistant" | "user")[] | null | undefined;
|
|
3844
|
-
lastModified?: string | null | undefined;
|
|
3845
|
-
priority?: number | null | undefined;
|
|
3846
|
-
}> | null | undefined;
|
|
3847
|
-
byteLength: number;
|
|
3848
|
-
encoding: "binary" | "text";
|
|
3849
|
-
mimeType?: string | null | undefined;
|
|
3850
|
-
resourceKey: string;
|
|
3851
|
-
type: "external_resource";
|
|
3852
|
-
uri: string;
|
|
3853
|
-
}>)[];
|
|
3854
|
-
disposition?: string | undefined;
|
|
3855
|
-
kind: "prompt.requested";
|
|
3856
|
-
context?: Readonly<{
|
|
3857
|
-
agentId: string;
|
|
3858
|
-
directoryId: string;
|
|
3859
|
-
additionalDirectoryIds: readonly string[];
|
|
3860
|
-
}> | undefined;
|
|
3861
|
-
targetCommandId?: string | undefined;
|
|
3862
|
-
}> | Readonly<{
|
|
3863
|
-
commandId: string;
|
|
3864
|
-
attemptId: string;
|
|
3865
|
-
epoch: string;
|
|
3866
|
-
kind: "prompt.started";
|
|
3867
|
-
}> | Readonly<{
|
|
3868
|
-
commandId: string;
|
|
3869
|
-
kind: "prompt.completed";
|
|
3870
|
-
stopReason: string;
|
|
3871
|
-
}> | Readonly<{
|
|
3872
|
-
commandId: string;
|
|
3873
|
-
code: string;
|
|
3874
|
-
kind: "prompt.failed-before-start";
|
|
3875
|
-
message: string;
|
|
3876
|
-
}> | Readonly<{
|
|
3877
|
-
commandId: string;
|
|
3878
|
-
attemptId: string;
|
|
3879
|
-
code: string;
|
|
3880
|
-
kind: "prompt.failed";
|
|
3881
|
-
message: string;
|
|
3882
|
-
}>;
|
|
3883
|
-
type: "lifecycle-metadata";
|
|
3884
|
-
}>)[];
|
|
3469
|
+
}>[];
|
|
3885
3470
|
nextCursor: string | null;
|
|
3886
3471
|
sessionGenerationId: string;
|
|
3887
3472
|
tailCursor: string;
|
|
@@ -4059,11 +3644,13 @@ declare const daemonToServiceSignatures: {
|
|
|
4059
3644
|
}>>;
|
|
4060
3645
|
};
|
|
4061
3646
|
export type DaemonToServiceMessage = ReturnType<(typeof daemonToServiceSignatures)[keyof typeof daemonToServiceSignatures]["decoder"]>;
|
|
3647
|
+
/** Decodes only message and nested variants known by this SDK. */
|
|
3648
|
+
export declare function decodeKnownDaemonToServiceMessage(encoded: string): DaemonToServiceMessage | null;
|
|
4062
3649
|
export declare function decodeDaemonToServiceMessage(encoded: string): DaemonToServiceMessage;
|
|
4063
3650
|
export type DaemonToRelayMessage = Exclude<DaemonToServiceMessage, {
|
|
4064
|
-
readonly kind: typeof SESSION_EVENT_KIND;
|
|
4065
|
-
}> | SessionWireEnvelope;
|
|
4066
|
-
export declare function decodeDaemonToRelayMessage(encoded: string): DaemonToRelayMessage;
|
|
3651
|
+
readonly kind: typeof SESSION_EVENT_KIND | typeof SESSION_HISTORY_PAGE_LOADED_KIND | typeof SESSION_PREVIEW_HISTORY_PAGE_LOADED_KIND;
|
|
3652
|
+
}> | SessionWireEnvelope | SessionHistoryWirePageLoaded | SessionPreviewHistoryWirePageLoaded;
|
|
3653
|
+
export declare function decodeDaemonToRelayMessage(encoded: string): DaemonToRelayMessage | null;
|
|
4067
3654
|
export declare function encodeDaemonToServiceMessage(message: DaemonToServiceMessage): string;
|
|
4068
3655
|
export {};
|
|
4069
3656
|
//# sourceMappingURL=daemon-transport.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"daemon-transport.d.ts","sourceRoot":"","sources":["../../../src/protocol/transport/daemon-transport.ts"],"names":[],"mappings":"AA6JA,OAAO,EAIH,kBAAkB,EAClB,KAAK,mBAAmB,EAC3B,MAAM,uCAAuC,CAAC;
|
|
1
|
+
{"version":3,"file":"daemon-transport.d.ts","sourceRoot":"","sources":["../../../src/protocol/transport/daemon-transport.ts"],"names":[],"mappings":"AA6JA,OAAO,EAIH,kBAAkB,EAClB,KAAK,mBAAmB,EAC3B,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EAYH,gCAAgC,EAEhC,wCAAwC,EACxC,KAAK,4BAA4B,EACjC,KAAK,mCAAmC,EAC3C,MAAM,qCAAqC,CAAC;AAyB7C,UAAU,gBAAgB,CAAC,QAAQ,SAAS;IAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;CAAE;IACjE,QAAQ,CAAC,OAAO,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,QAAQ,CAAC;IAChD,QAAQ,CAAC,OAAO,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,MAAM,CAAC;IAC/C,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC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sBAAsB,GAAG,UAAU,CAC3C,CAAC,OAAO,yBAAyB,CAAC,CAAC,MAAM,OAAO,yBAAyB,CAAC,CAAC,SAAS,CAAC,CACxF,CAAC;AAKF,kEAAkE;AAClE,wBAAgB,iCAAiC,CAAC,OAAO,EAAE,MAAM,GAAG,sBAAsB,GAAG,IAAI,CAQhG;AAED,wBAAgB,4BAA4B,CAAC,OAAO,EAAE,MAAM,GAAG,sBAAsB,CAOpF;AAED,MAAM,MAAM,oBAAoB,GAC1B,OAAO,CACH,sBAAsB,EACtB;IACI,QAAQ,CAAC,IAAI,EACP,OAAO,kBAAkB,GACzB,OAAO,gCAAgC,GACvC,OAAO,wCAAwC,CAAC;CACzD,CACJ,GACD,mBAAmB,GACnB,4BAA4B,GAC5B,mCAAmC,CAAC;AAE1C,wBAAgB,0BAA0B,CAAC,OAAO,EAAE,MAAM,GAAG,oBAAoB,GAAG,IAAI,CAYvF;AAED,wBAAgB,4BAA4B,CAAC,OAAO,EAAE,sBAAsB,GAAG,MAAM,CAEpF"}
|
|
@@ -10,10 +10,10 @@ import { decodeSessionElicitationRespondCommand, decodeSessionPermissionRespondC
|
|
|
10
10
|
import { decodeSessionCloseCommand, decodeSessionClosedEvent, decodeSessionCloseNoticeEvent, decodeSessionInfoUpdatedEvent, decodeSessionListCommand, decodeSessionOperationFailedEvent, decodeSessionPrepareCommand, decodeSessionQueryCommand, decodeSessionReadyEvent, decodeSessionRestoreCommand, decodeSessionRestoredEvent, decodeSessionStatusChangedEvent, decodeSessionsListedEvent, decodeSessionsQueriedEvent, encodeSessionCloseCommand, encodeSessionClosedEvent, encodeSessionCloseNoticeEvent, encodeSessionInfoUpdatedEvent, encodeSessionListCommand, encodeSessionOperationFailedEvent, encodeSessionPrepareCommand, encodeSessionQueryCommand, encodeSessionReadyEvent, encodeSessionRestoreCommand, encodeSessionRestoredEvent, encodeSessionStatusChangedEvent, encodeSessionsListedEvent, encodeSessionsQueriedEvent, SESSION_CLOSE_KIND, SESSION_CLOSE_NOTICE_KIND, SESSION_CLOSED_KIND, SESSION_INFO_UPDATED_KIND, SESSION_LIST_KIND, SESSION_LISTED_KIND, SESSION_OPERATION_FAILED_KIND, SESSION_PREPARE_KIND, SESSION_QUERIED_KIND, SESSION_QUERY_KIND, SESSION_READY_KIND, SESSION_RESTORE_KIND, SESSION_RESTORED_KIND, SESSION_STATUS_CHANGED_KIND, } from "../session/lifecycle/index.js";
|
|
11
11
|
import { decodeNativeSessionCancel, decodeNativeSessionCommand, decodeNativeSessionResult, encodeNativeSessionCancel, encodeNativeSessionCommand, encodeNativeSessionResult, NATIVE_SESSION_CANCEL_KIND, NATIVE_SESSION_REQUEST_KIND, NATIVE_SESSION_RESULT_KIND, } from "../session/native/index.js";
|
|
12
12
|
import { decodeSessionEventEnvelope, decodeSessionWireEnvelope, encodeSessionEventEnvelope, SESSION_EVENT_KIND, } from "../session/observability/event-log.js";
|
|
13
|
-
import { decodeSessionHistoryPageLoad, decodeSessionHistoryPageLoaded, decodeSessionPreviewHistoryPageLoad, decodeSessionPreviewHistoryPageLoaded, encodeSessionHistoryPageLoad, encodeSessionHistoryPageLoaded, encodeSessionPreviewHistoryPageLoad, encodeSessionPreviewHistoryPageLoaded, SESSION_HISTORY_PAGE_LOAD_KIND, SESSION_HISTORY_PAGE_LOADED_KIND, SESSION_PREVIEW_HISTORY_PAGE_LOAD_KIND, SESSION_PREVIEW_HISTORY_PAGE_LOADED_KIND, } from "../session/observability/history.js";
|
|
13
|
+
import { decodeSessionHistoryPageLoad, decodeSessionHistoryPageLoaded, decodeSessionHistoryWirePageLoaded, decodeSessionPreviewHistoryPageLoad, decodeSessionPreviewHistoryPageLoaded, decodeSessionPreviewHistoryWirePageLoaded, encodeSessionHistoryPageLoad, encodeSessionHistoryPageLoaded, encodeSessionPreviewHistoryPageLoad, encodeSessionPreviewHistoryPageLoaded, SESSION_HISTORY_PAGE_LOAD_KIND, SESSION_HISTORY_PAGE_LOADED_KIND, SESSION_PREVIEW_HISTORY_PAGE_LOAD_KIND, SESSION_PREVIEW_HISTORY_PAGE_LOADED_KIND, } from "../session/observability/history.js";
|
|
14
14
|
import { decodeSessionCancelBeforeStartCommand, decodeSessionCancelCommand, decodeSessionPromptCommand, decodeSessionPromptDispositionCommand, encodeSessionCancelBeforeStartCommand, encodeSessionCancelCommand, encodeSessionPromptCommand, encodeSessionPromptDispositionCommand, SESSION_CANCEL_BEFORE_START_KIND, SESSION_CANCEL_KIND, SESSION_PROMPT_DISPOSITION_KIND, SESSION_PROMPT_KIND, } from "../session/prompt/commands.js";
|
|
15
15
|
import { decodeWorkspaceEntriesEvent, decodeWorkspaceListCommand, encodeWorkspaceEntriesEvent, encodeWorkspaceListCommand, WORKSPACE_ENTRIES_KIND, WORKSPACE_LIST_KIND, } from "../session/workspace/index.js";
|
|
16
|
-
import { decodeMessageKind,
|
|
16
|
+
import { decodeMessageKind, ProtocolMessageError, parseJson } from "../shared/message-codec.js";
|
|
17
17
|
function defineMessageSignature(kind, encoder, decoder) {
|
|
18
18
|
const schema = (message) => decoder(JSON.stringify(message));
|
|
19
19
|
return {
|
|
@@ -54,11 +54,67 @@ const serviceToDaemonSignatures = {
|
|
|
54
54
|
[WORKSPACE_LIST_KIND]: defineMessageSignature(WORKSPACE_LIST_KIND, encodeWorkspaceListCommand, decodeWorkspaceListCommand),
|
|
55
55
|
};
|
|
56
56
|
const serviceToDaemonRegistry = serviceToDaemonSignatures;
|
|
57
|
+
const knownNativeActions = new Set(["active-turn", "find", "list", "import", "fork"]);
|
|
58
|
+
const knownSessionStatuses = new Set(["idle", "working"]);
|
|
59
|
+
const knownRuntimeUpgradeStatuses = new Set(["accepted", "succeeded", "failed", "rejected"]);
|
|
60
|
+
const knownInteractionKinds = new Set(["session.permission.requested", "session.elicitation.requested"]);
|
|
61
|
+
function isRecord(value) {
|
|
62
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
63
|
+
}
|
|
64
|
+
function hasUnknownDiscriminator(value, key, known) {
|
|
65
|
+
if (!isRecord(value)) {
|
|
66
|
+
return false;
|
|
67
|
+
}
|
|
68
|
+
const variant = value[key];
|
|
69
|
+
return typeof variant === "string" && !known.has(variant);
|
|
70
|
+
}
|
|
71
|
+
function hasUnknownServiceVariant(kind, value) {
|
|
72
|
+
return kind === NATIVE_SESSION_REQUEST_KIND && hasUnknownDiscriminator(value, "action", knownNativeActions);
|
|
73
|
+
}
|
|
74
|
+
function hasUnknownSessionStatus(value) {
|
|
75
|
+
return hasUnknownDiscriminator(value, "kind", knownSessionStatuses);
|
|
76
|
+
}
|
|
77
|
+
function hasUnknownDaemonVariant(kind, value) {
|
|
78
|
+
if (kind === SESSION_STATUS_CHANGED_KIND) {
|
|
79
|
+
return hasUnknownSessionStatus(value["status"]);
|
|
80
|
+
}
|
|
81
|
+
if (kind === SESSION_LISTED_KIND || kind === SESSION_QUERIED_KIND) {
|
|
82
|
+
const entries = value["entries"];
|
|
83
|
+
return (Array.isArray(entries) &&
|
|
84
|
+
entries.some((entry) => isRecord(entry) && hasUnknownSessionStatus(entry["status"])));
|
|
85
|
+
}
|
|
86
|
+
if (kind === SESSION_RESTORED_KIND) {
|
|
87
|
+
const entry = value["entry"];
|
|
88
|
+
return isRecord(entry) && hasUnknownSessionStatus(entry["status"]);
|
|
89
|
+
}
|
|
90
|
+
if (kind === "runtime.upgrade.result") {
|
|
91
|
+
return hasUnknownDiscriminator(value["outcome"], "status", knownRuntimeUpgradeStatuses);
|
|
92
|
+
}
|
|
93
|
+
if (kind === NATIVE_SESSION_RESULT_KIND) {
|
|
94
|
+
if (hasUnknownDiscriminator(value, "action", knownNativeActions)) {
|
|
95
|
+
return true;
|
|
96
|
+
}
|
|
97
|
+
if (value["action"] === "active-turn" && isRecord(value["turn"])) {
|
|
98
|
+
return hasUnknownDiscriminator(value["turn"]["interaction"], "kind", knownInteractionKinds);
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
return false;
|
|
102
|
+
}
|
|
103
|
+
/** Decodes only message and nested variants known by this SDK. */
|
|
104
|
+
export function decodeKnownServiceToDaemonMessage(encoded) {
|
|
105
|
+
const kind = decodeMessageKind(encoded);
|
|
106
|
+
const signature = serviceToDaemonRegistry[kind];
|
|
107
|
+
if (signature === undefined) {
|
|
108
|
+
return null;
|
|
109
|
+
}
|
|
110
|
+
const value = parseJson(encoded);
|
|
111
|
+
return hasUnknownServiceVariant(kind, value) ? null : signature.decoder(encoded);
|
|
112
|
+
}
|
|
57
113
|
export function decodeServiceToDaemonMessage(encoded) {
|
|
58
114
|
const kind = decodeMessageKind(encoded);
|
|
59
115
|
const signature = serviceToDaemonRegistry[kind];
|
|
60
116
|
if (signature === undefined) {
|
|
61
|
-
throw new
|
|
117
|
+
throw new ProtocolMessageError(`Unknown service-to-daemon message kind: ${kind}`);
|
|
62
118
|
}
|
|
63
119
|
return signature.decoder(encoded);
|
|
64
120
|
}
|
|
@@ -98,18 +154,36 @@ const daemonToServiceSignatures = {
|
|
|
98
154
|
[WORKSPACE_ENTRIES_KIND]: defineMessageSignature(WORKSPACE_ENTRIES_KIND, encodeWorkspaceEntriesEvent, decodeWorkspaceEntriesEvent),
|
|
99
155
|
};
|
|
100
156
|
const daemonToServiceRegistry = daemonToServiceSignatures;
|
|
157
|
+
/** Decodes only message and nested variants known by this SDK. */
|
|
158
|
+
export function decodeKnownDaemonToServiceMessage(encoded) {
|
|
159
|
+
const kind = decodeMessageKind(encoded);
|
|
160
|
+
const signature = daemonToServiceRegistry[kind];
|
|
161
|
+
if (signature === undefined) {
|
|
162
|
+
return null;
|
|
163
|
+
}
|
|
164
|
+
const value = parseJson(encoded);
|
|
165
|
+
return hasUnknownDaemonVariant(kind, value) ? null : signature.decoder(encoded);
|
|
166
|
+
}
|
|
101
167
|
export function decodeDaemonToServiceMessage(encoded) {
|
|
102
168
|
const kind = decodeMessageKind(encoded);
|
|
103
169
|
const signature = daemonToServiceRegistry[kind];
|
|
104
170
|
if (signature === undefined) {
|
|
105
|
-
throw new
|
|
171
|
+
throw new ProtocolMessageError(`Unknown daemon-to-service message kind: ${kind}`);
|
|
106
172
|
}
|
|
107
173
|
return signature.decoder(encoded);
|
|
108
174
|
}
|
|
109
175
|
export function decodeDaemonToRelayMessage(encoded) {
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
176
|
+
const kind = decodeMessageKind(encoded);
|
|
177
|
+
if (kind === SESSION_EVENT_KIND) {
|
|
178
|
+
return decodeSessionWireEnvelope(encoded);
|
|
179
|
+
}
|
|
180
|
+
if (kind === SESSION_HISTORY_PAGE_LOADED_KIND) {
|
|
181
|
+
return decodeSessionHistoryWirePageLoaded(encoded);
|
|
182
|
+
}
|
|
183
|
+
if (kind === SESSION_PREVIEW_HISTORY_PAGE_LOADED_KIND) {
|
|
184
|
+
return decodeSessionPreviewHistoryWirePageLoaded(encoded);
|
|
185
|
+
}
|
|
186
|
+
return decodeKnownDaemonToServiceMessage(encoded);
|
|
113
187
|
}
|
|
114
188
|
export function encodeDaemonToServiceMessage(message) {
|
|
115
189
|
return daemonToServiceSignatures[message.kind].encoder(message);
|