@moxt-ai/mobius-protocol 0.0.9 → 0.0.11
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/control-messages.d.ts +90 -7
- package/dist/control-messages.d.ts.map +1 -1
- package/dist/control-messages.js +68 -5
- package/dist/control-messages.js.map +1 -1
- package/dist/daemon-transport.d.ts +587 -0
- package/dist/daemon-transport.d.ts.map +1 -0
- package/dist/daemon-transport.js +88 -0
- package/dist/daemon-transport.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/messages.d.ts +1 -1
- package/dist/messages.d.ts.map +1 -1
- package/dist/messages.js +1 -1
- package/dist/messages.js.map +1 -1
- package/dist/session-events.d.ts +1 -0
- package/dist/session-events.d.ts.map +1 -1
- package/dist/session-events.js +1 -0
- package/dist/session-events.js.map +1 -1
- package/dist/session-history.d.ts +30 -1
- package/dist/session-history.d.ts.map +1 -1
- package/dist/session-history.js +40 -22
- package/dist/session-history.js.map +1 -1
- package/dist/session-live-history.d.ts +50 -0
- package/dist/session-live-history.d.ts.map +1 -0
- package/dist/session-live-history.js +40 -0
- package/dist/session-live-history.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,587 @@
|
|
|
1
|
+
interface MessageSignature<TMessage extends {
|
|
2
|
+
readonly kind: string;
|
|
3
|
+
}> {
|
|
4
|
+
readonly decoder: (encoded: string) => TMessage;
|
|
5
|
+
readonly encoder: (message: unknown) => string;
|
|
6
|
+
readonly kind: TMessage["kind"];
|
|
7
|
+
readonly schema: (message: unknown) => TMessage;
|
|
8
|
+
}
|
|
9
|
+
declare const serviceToDaemonSignatures: {
|
|
10
|
+
readonly "agent.catalog.refresh": MessageSignature<Readonly<{
|
|
11
|
+
kind: "agent.catalog.refresh";
|
|
12
|
+
requestId: string;
|
|
13
|
+
}>>;
|
|
14
|
+
readonly "agent.integration.install.cancel": MessageSignature<Readonly<{
|
|
15
|
+
kind: "agent.integration.install.cancel";
|
|
16
|
+
requestId: string;
|
|
17
|
+
}>>;
|
|
18
|
+
readonly "agent.integration.install.request": MessageSignature<Readonly<{
|
|
19
|
+
agentId: string;
|
|
20
|
+
requestId: string;
|
|
21
|
+
kind: "agent.integration.install.request";
|
|
22
|
+
}>>;
|
|
23
|
+
readonly "agent.settings.discover": MessageSignature<Readonly<{
|
|
24
|
+
agentId: string;
|
|
25
|
+
kind: "agent.settings.discover";
|
|
26
|
+
model?: string | undefined;
|
|
27
|
+
requestId: string;
|
|
28
|
+
}>>;
|
|
29
|
+
readonly "file.read": MessageSignature<Readonly<{
|
|
30
|
+
kind: "file.read";
|
|
31
|
+
maxBytes: number;
|
|
32
|
+
requestId: string;
|
|
33
|
+
sessionId: string;
|
|
34
|
+
path: string;
|
|
35
|
+
}>>;
|
|
36
|
+
readonly "native.session.cancel": MessageSignature<Readonly<{
|
|
37
|
+
requestId: string;
|
|
38
|
+
sessionId: string;
|
|
39
|
+
kind: "native.session.cancel";
|
|
40
|
+
}>>;
|
|
41
|
+
readonly "native.session.request": MessageSignature<Readonly<{
|
|
42
|
+
requestId: string;
|
|
43
|
+
sessionId: string;
|
|
44
|
+
kind: "native.session.request";
|
|
45
|
+
additionalDirectoryIds: readonly string[];
|
|
46
|
+
agentId: string;
|
|
47
|
+
bindingId: string;
|
|
48
|
+
directoryId: string;
|
|
49
|
+
action: "preview";
|
|
50
|
+
entryId: string;
|
|
51
|
+
}> | Readonly<{
|
|
52
|
+
requestId: string;
|
|
53
|
+
sessionId: string;
|
|
54
|
+
kind: "native.session.request";
|
|
55
|
+
additionalDirectoryIds: readonly string[];
|
|
56
|
+
agentId: string;
|
|
57
|
+
bindingId: string;
|
|
58
|
+
directoryId: string;
|
|
59
|
+
action: "find";
|
|
60
|
+
nativeSessionId: string;
|
|
61
|
+
}> | Readonly<{
|
|
62
|
+
requestId: string;
|
|
63
|
+
sessionId: string;
|
|
64
|
+
kind: "native.session.request";
|
|
65
|
+
additionalDirectoryIds: readonly string[];
|
|
66
|
+
agentId: string;
|
|
67
|
+
bindingId: string;
|
|
68
|
+
directoryId: string;
|
|
69
|
+
action: "list";
|
|
70
|
+
cursor: string | null;
|
|
71
|
+
}> | Readonly<{
|
|
72
|
+
requestId: string;
|
|
73
|
+
sessionId: string;
|
|
74
|
+
kind: "native.session.request";
|
|
75
|
+
additionalDirectoryIds: readonly string[];
|
|
76
|
+
agentId: string;
|
|
77
|
+
bindingId: string;
|
|
78
|
+
directoryId: string;
|
|
79
|
+
action: "fork" | "import";
|
|
80
|
+
entryId: string;
|
|
81
|
+
targetSessionId: string;
|
|
82
|
+
}> | Readonly<{
|
|
83
|
+
requestId: string;
|
|
84
|
+
sessionId: string;
|
|
85
|
+
kind: "native.session.request";
|
|
86
|
+
additionalDirectoryIds: readonly string[];
|
|
87
|
+
agentId: string;
|
|
88
|
+
bindingId: string;
|
|
89
|
+
directoryId: string;
|
|
90
|
+
action: "delete";
|
|
91
|
+
entryId: string;
|
|
92
|
+
}>>;
|
|
93
|
+
readonly "native.session.turn-fork": MessageSignature<Readonly<{
|
|
94
|
+
additionalDirectoryIds: readonly string[];
|
|
95
|
+
agentId: string;
|
|
96
|
+
bindingId: string;
|
|
97
|
+
directoryId: string;
|
|
98
|
+
requestId: string;
|
|
99
|
+
sessionId: string;
|
|
100
|
+
sourceCommandId: string;
|
|
101
|
+
targetSessionId: string;
|
|
102
|
+
kind: "native.session.turn-fork";
|
|
103
|
+
messageFingerprint: string;
|
|
104
|
+
messageId: string;
|
|
105
|
+
messageOccurrence: number;
|
|
106
|
+
title: string;
|
|
107
|
+
}>>;
|
|
108
|
+
readonly "runtime.delivery": MessageSignature<import("./messages.ts").RuntimeDelivery>;
|
|
109
|
+
readonly "runtime.delivery.committed": MessageSignature<import("./messages.ts").RuntimeDeliveryCommitted>;
|
|
110
|
+
readonly "runtime.heartbeat.ack": MessageSignature<import("./messages.ts").RuntimeHeartbeatAckEvent>;
|
|
111
|
+
readonly "runtime.liveness.ready": MessageSignature<import("./messages.ts").RuntimeLivenessReadyEvent>;
|
|
112
|
+
readonly "session.cancel": MessageSignature<import("./messages.ts").SessionCancelCommand>;
|
|
113
|
+
readonly "session.configure": MessageSignature<Readonly<{
|
|
114
|
+
additionalDirectoryIds: readonly string[];
|
|
115
|
+
agentId: string;
|
|
116
|
+
bindingId: string;
|
|
117
|
+
directoryId: string;
|
|
118
|
+
sessionId: string;
|
|
119
|
+
booleanValue: boolean;
|
|
120
|
+
configId: string;
|
|
121
|
+
kind: "session.configure";
|
|
122
|
+
requestId: string;
|
|
123
|
+
value: string;
|
|
124
|
+
valueType: "boolean" | "select";
|
|
125
|
+
}>>;
|
|
126
|
+
readonly "session.elicitation.respond": MessageSignature<Readonly<{
|
|
127
|
+
action: "accept" | "cancel" | "decline";
|
|
128
|
+
content: string;
|
|
129
|
+
interactionId: string;
|
|
130
|
+
kind: "session.elicitation.respond";
|
|
131
|
+
sessionId: string;
|
|
132
|
+
}>>;
|
|
133
|
+
readonly "session.event.ack": MessageSignature<Readonly<{
|
|
134
|
+
cursor: string;
|
|
135
|
+
duplicate: boolean;
|
|
136
|
+
eventId: string;
|
|
137
|
+
kind: "session.event.ack";
|
|
138
|
+
sequence: string;
|
|
139
|
+
sessionId: string;
|
|
140
|
+
}>>;
|
|
141
|
+
readonly "session.event.deferred": MessageSignature<Readonly<{
|
|
142
|
+
eventId: string;
|
|
143
|
+
kind: "session.event.deferred";
|
|
144
|
+
retryAfterMilliseconds: number;
|
|
145
|
+
sessionId: string;
|
|
146
|
+
}>>;
|
|
147
|
+
readonly "session.event.rejected": MessageSignature<Readonly<{
|
|
148
|
+
code: "session_deleted" | "session_not_found" | "session_rejected";
|
|
149
|
+
eventId: string;
|
|
150
|
+
kind: "session.event.rejected";
|
|
151
|
+
sessionId: string;
|
|
152
|
+
}>>;
|
|
153
|
+
readonly "session.live-history.load": MessageSignature<Readonly<{
|
|
154
|
+
additionalDirectoryIds: readonly string[];
|
|
155
|
+
agentId: string;
|
|
156
|
+
bindingId: string;
|
|
157
|
+
directoryId: string;
|
|
158
|
+
kind: "session.live-history.load";
|
|
159
|
+
requestId: string;
|
|
160
|
+
sessionId: string;
|
|
161
|
+
}>>;
|
|
162
|
+
readonly "session.permission.respond": MessageSignature<Readonly<{
|
|
163
|
+
interactionId: string;
|
|
164
|
+
kind: "session.permission.respond";
|
|
165
|
+
optionId: string;
|
|
166
|
+
outcome: "cancelled" | "selected";
|
|
167
|
+
sessionId: string;
|
|
168
|
+
}>>;
|
|
169
|
+
readonly "session.prepare": MessageSignature<Readonly<{
|
|
170
|
+
additionalDirectoryIds: readonly string[];
|
|
171
|
+
agentId: string;
|
|
172
|
+
bindingId: string;
|
|
173
|
+
directoryId: string;
|
|
174
|
+
sessionId: string;
|
|
175
|
+
configuration?: Readonly<{
|
|
176
|
+
booleanValue: boolean;
|
|
177
|
+
configId: string;
|
|
178
|
+
value: string;
|
|
179
|
+
valueType: "boolean" | "select";
|
|
180
|
+
}> | undefined;
|
|
181
|
+
kind: "session.prepare";
|
|
182
|
+
requestId: string;
|
|
183
|
+
sessionState?: "provisioned" | undefined;
|
|
184
|
+
transient?: boolean | undefined;
|
|
185
|
+
}>>;
|
|
186
|
+
readonly "session.prompt": MessageSignature<import("./messages.ts").SessionPromptCommand>;
|
|
187
|
+
readonly "workspace.list": MessageSignature<Readonly<{
|
|
188
|
+
bindingId: string;
|
|
189
|
+
directoryId: string;
|
|
190
|
+
kind: "workspace.list";
|
|
191
|
+
requestId: string;
|
|
192
|
+
}>>;
|
|
193
|
+
};
|
|
194
|
+
export type ServiceToDaemonMessage = ReturnType<(typeof serviceToDaemonSignatures)[keyof typeof serviceToDaemonSignatures]["decoder"]>;
|
|
195
|
+
export declare function decodeServiceToDaemonMessage(encoded: string): ServiceToDaemonMessage;
|
|
196
|
+
export declare function encodeServiceToDaemonMessage(message: ServiceToDaemonMessage): string;
|
|
197
|
+
declare const daemonToServiceSignatures: {
|
|
198
|
+
readonly "agent.catalog.refreshed": MessageSignature<Readonly<{
|
|
199
|
+
kind: "agent.catalog.refreshed";
|
|
200
|
+
requestId: string;
|
|
201
|
+
}>>;
|
|
202
|
+
readonly "agent.catalog.refresh.failed": MessageSignature<Readonly<{
|
|
203
|
+
code: string;
|
|
204
|
+
kind: "agent.catalog.refresh.failed";
|
|
205
|
+
message: string;
|
|
206
|
+
requestId: string;
|
|
207
|
+
}>>;
|
|
208
|
+
readonly "agent.integration.install.cancelled": MessageSignature<Readonly<{
|
|
209
|
+
agentId: string;
|
|
210
|
+
requestId: string;
|
|
211
|
+
kind: "agent.integration.install.cancelled";
|
|
212
|
+
}>>;
|
|
213
|
+
readonly "agent.integration.install.completed": MessageSignature<Readonly<{
|
|
214
|
+
agentId: string;
|
|
215
|
+
requestId: string;
|
|
216
|
+
authenticationMayBeRequired: boolean;
|
|
217
|
+
kind: "agent.integration.install.completed";
|
|
218
|
+
}>>;
|
|
219
|
+
readonly "agent.integration.install.failed": MessageSignature<Readonly<{
|
|
220
|
+
agentId: string;
|
|
221
|
+
requestId: string;
|
|
222
|
+
code: string;
|
|
223
|
+
kind: "agent.integration.install.failed";
|
|
224
|
+
message: string;
|
|
225
|
+
}>>;
|
|
226
|
+
readonly "agent.integration.install.progress": MessageSignature<Readonly<{
|
|
227
|
+
agentId: string;
|
|
228
|
+
requestId: string;
|
|
229
|
+
kind: "agent.integration.install.progress";
|
|
230
|
+
stage: "checking_acp" | "downloading" | "installing_adapter" | "installing_agent" | "verifying";
|
|
231
|
+
}>>;
|
|
232
|
+
readonly "agent.integration.install.started": MessageSignature<Readonly<{
|
|
233
|
+
agentId: string;
|
|
234
|
+
requestId: string;
|
|
235
|
+
kind: "agent.integration.install.started";
|
|
236
|
+
}>>;
|
|
237
|
+
readonly "agent.settings.discovered": MessageSignature<Readonly<{
|
|
238
|
+
agentId: string;
|
|
239
|
+
agentName: string;
|
|
240
|
+
agentVersion: string;
|
|
241
|
+
kind: "agent.settings.discovered";
|
|
242
|
+
modelEffort: Readonly<{
|
|
243
|
+
effortSettingId: string;
|
|
244
|
+
modelSettingId: string;
|
|
245
|
+
resolution: "complete" | "on_model_selection" | "unavailable";
|
|
246
|
+
unsupportedModelIds: readonly string[];
|
|
247
|
+
valuesByModel: Readonly<Record<string, readonly Readonly<{
|
|
248
|
+
description: string;
|
|
249
|
+
groupId: string;
|
|
250
|
+
groupName: string;
|
|
251
|
+
name: string;
|
|
252
|
+
value: string;
|
|
253
|
+
}>[]>>;
|
|
254
|
+
}>;
|
|
255
|
+
requestId: string;
|
|
256
|
+
settings: readonly Readonly<{
|
|
257
|
+
booleanValue: boolean;
|
|
258
|
+
category: string;
|
|
259
|
+
defaultValue: string;
|
|
260
|
+
description: string;
|
|
261
|
+
id: string;
|
|
262
|
+
name: string;
|
|
263
|
+
type: "boolean" | "select";
|
|
264
|
+
values: readonly Readonly<{
|
|
265
|
+
description: string;
|
|
266
|
+
groupId: string;
|
|
267
|
+
groupName: string;
|
|
268
|
+
name: string;
|
|
269
|
+
value: string;
|
|
270
|
+
}>[];
|
|
271
|
+
}>[];
|
|
272
|
+
settingsRevision: string;
|
|
273
|
+
}>>;
|
|
274
|
+
readonly "agent.settings.discovery.failed": MessageSignature<Readonly<{
|
|
275
|
+
code: string;
|
|
276
|
+
kind: "agent.settings.discovery.failed";
|
|
277
|
+
message: string;
|
|
278
|
+
requestId: string;
|
|
279
|
+
}>>;
|
|
280
|
+
readonly "file.begin": MessageSignature<Readonly<{
|
|
281
|
+
byteLength: number;
|
|
282
|
+
kind: "file.begin";
|
|
283
|
+
mediaType: string;
|
|
284
|
+
modifiedAt: string;
|
|
285
|
+
name: string;
|
|
286
|
+
requestId: string;
|
|
287
|
+
sessionId: string;
|
|
288
|
+
}>>;
|
|
289
|
+
readonly "file.chunk": MessageSignature<Readonly<{
|
|
290
|
+
data: string;
|
|
291
|
+
kind: "file.chunk";
|
|
292
|
+
requestId: string;
|
|
293
|
+
sequence: number;
|
|
294
|
+
sessionId: string;
|
|
295
|
+
}>>;
|
|
296
|
+
readonly "file.end": MessageSignature<Readonly<{
|
|
297
|
+
kind: "file.end";
|
|
298
|
+
requestId: string;
|
|
299
|
+
sessionId: string;
|
|
300
|
+
}>>;
|
|
301
|
+
readonly "file.failed": MessageSignature<Readonly<{
|
|
302
|
+
code: string;
|
|
303
|
+
kind: "file.failed";
|
|
304
|
+
message: string;
|
|
305
|
+
requestId: string;
|
|
306
|
+
sessionId: string;
|
|
307
|
+
}>>;
|
|
308
|
+
readonly "native.session.result": MessageSignature<Readonly<{
|
|
309
|
+
requestId: string;
|
|
310
|
+
sessionId: string;
|
|
311
|
+
kind: "native.session.result";
|
|
312
|
+
action: "find";
|
|
313
|
+
entry: Readonly<{
|
|
314
|
+
entryId: string;
|
|
315
|
+
title: string;
|
|
316
|
+
directoryId: string;
|
|
317
|
+
directoryLabel: string;
|
|
318
|
+
updatedAt: string | null;
|
|
319
|
+
additionalDirectories: readonly Readonly<{
|
|
320
|
+
directoryId: string;
|
|
321
|
+
name: string;
|
|
322
|
+
}>[];
|
|
323
|
+
}>;
|
|
324
|
+
}> | Readonly<{
|
|
325
|
+
requestId: string;
|
|
326
|
+
sessionId: string;
|
|
327
|
+
kind: "native.session.result";
|
|
328
|
+
action: "list";
|
|
329
|
+
capabilities: Readonly<{
|
|
330
|
+
additionalDirectories: boolean;
|
|
331
|
+
audioPrompt: boolean;
|
|
332
|
+
closeSession: boolean;
|
|
333
|
+
deleteSession: boolean;
|
|
334
|
+
embeddedContextPrompt: boolean;
|
|
335
|
+
imagePrompt: boolean;
|
|
336
|
+
listSessions: boolean;
|
|
337
|
+
loadSession: boolean;
|
|
338
|
+
promptQueueing: boolean;
|
|
339
|
+
resumeSession: boolean;
|
|
340
|
+
steering: boolean;
|
|
341
|
+
unstableForkSession: boolean;
|
|
342
|
+
}>;
|
|
343
|
+
entries: readonly Readonly<{
|
|
344
|
+
entryId: string;
|
|
345
|
+
title: string;
|
|
346
|
+
directoryId: string;
|
|
347
|
+
directoryLabel: string;
|
|
348
|
+
updatedAt: string | null;
|
|
349
|
+
additionalDirectories: readonly Readonly<{
|
|
350
|
+
directoryId: string;
|
|
351
|
+
name: string;
|
|
352
|
+
}>[];
|
|
353
|
+
}>[];
|
|
354
|
+
nextCursor: string | null;
|
|
355
|
+
}> | Readonly<{
|
|
356
|
+
requestId: string;
|
|
357
|
+
sessionId: string;
|
|
358
|
+
kind: "native.session.result";
|
|
359
|
+
action: "fork" | "import";
|
|
360
|
+
targetSessionId: string;
|
|
361
|
+
ready: Readonly<{
|
|
362
|
+
additionalDirectories: readonly Readonly<{
|
|
363
|
+
directoryId: string;
|
|
364
|
+
name: string;
|
|
365
|
+
}>[];
|
|
366
|
+
agentId: string;
|
|
367
|
+
agentName: string;
|
|
368
|
+
agentVersion: string;
|
|
369
|
+
capabilities: Readonly<{
|
|
370
|
+
additionalDirectories: boolean;
|
|
371
|
+
audioPrompt: boolean;
|
|
372
|
+
closeSession: boolean;
|
|
373
|
+
deleteSession: boolean;
|
|
374
|
+
embeddedContextPrompt: boolean;
|
|
375
|
+
imagePrompt: boolean;
|
|
376
|
+
listSessions: boolean;
|
|
377
|
+
loadSession: boolean;
|
|
378
|
+
promptQueueing: boolean;
|
|
379
|
+
resumeSession: boolean;
|
|
380
|
+
steering: boolean;
|
|
381
|
+
unstableForkSession: boolean;
|
|
382
|
+
}>;
|
|
383
|
+
commands: readonly Readonly<{
|
|
384
|
+
description: string;
|
|
385
|
+
inputHint: string;
|
|
386
|
+
name: string;
|
|
387
|
+
}>[];
|
|
388
|
+
configOptions: readonly Readonly<{
|
|
389
|
+
booleanValue: boolean;
|
|
390
|
+
category: string;
|
|
391
|
+
currentValue: string;
|
|
392
|
+
description: string;
|
|
393
|
+
id: string;
|
|
394
|
+
name: string;
|
|
395
|
+
type: "boolean" | "select";
|
|
396
|
+
values: readonly Readonly<{
|
|
397
|
+
description: string;
|
|
398
|
+
groupId: string;
|
|
399
|
+
groupName: string;
|
|
400
|
+
name: string;
|
|
401
|
+
value: string;
|
|
402
|
+
}>[];
|
|
403
|
+
}>[];
|
|
404
|
+
directoryId: string;
|
|
405
|
+
directoryLabel: string;
|
|
406
|
+
kind: "session.ready";
|
|
407
|
+
requestId: string;
|
|
408
|
+
restored: boolean;
|
|
409
|
+
runtimeTimings?: readonly Readonly<{
|
|
410
|
+
durationMilliseconds: number;
|
|
411
|
+
name: string;
|
|
412
|
+
}>[] | undefined;
|
|
413
|
+
sessionId: string;
|
|
414
|
+
}>;
|
|
415
|
+
history: Readonly<{
|
|
416
|
+
status: "available";
|
|
417
|
+
messages: readonly Readonly<{
|
|
418
|
+
role: "assistant" | "user";
|
|
419
|
+
text: string;
|
|
420
|
+
images?: readonly Readonly<{
|
|
421
|
+
data: string;
|
|
422
|
+
mimeType: "image/gif" | "image/jpeg" | "image/png" | "image/webp";
|
|
423
|
+
name: string;
|
|
424
|
+
}>[] | undefined;
|
|
425
|
+
}>[];
|
|
426
|
+
truncated: boolean;
|
|
427
|
+
coveredCommandIds: readonly string[];
|
|
428
|
+
coveredMessageIds: readonly string[];
|
|
429
|
+
}> | Readonly<{
|
|
430
|
+
status: "unavailable";
|
|
431
|
+
}>;
|
|
432
|
+
title: string;
|
|
433
|
+
}> | Readonly<{
|
|
434
|
+
requestId: string;
|
|
435
|
+
sessionId: string;
|
|
436
|
+
kind: "native.session.result";
|
|
437
|
+
action: "preview";
|
|
438
|
+
entryId: string;
|
|
439
|
+
targetSessionId: string;
|
|
440
|
+
reason: "continuation_unavailable" | "requested";
|
|
441
|
+
history: Readonly<{
|
|
442
|
+
status: "available";
|
|
443
|
+
messages: readonly Readonly<{
|
|
444
|
+
role: "assistant" | "user";
|
|
445
|
+
text: string;
|
|
446
|
+
images?: readonly Readonly<{
|
|
447
|
+
data: string;
|
|
448
|
+
mimeType: "image/gif" | "image/jpeg" | "image/png" | "image/webp";
|
|
449
|
+
name: string;
|
|
450
|
+
}>[] | undefined;
|
|
451
|
+
}>[];
|
|
452
|
+
truncated: boolean;
|
|
453
|
+
coveredCommandIds: readonly string[];
|
|
454
|
+
coveredMessageIds: readonly string[];
|
|
455
|
+
}> | Readonly<{
|
|
456
|
+
status: "unavailable";
|
|
457
|
+
}>;
|
|
458
|
+
title: string;
|
|
459
|
+
}> | Readonly<{
|
|
460
|
+
requestId: string;
|
|
461
|
+
sessionId: string;
|
|
462
|
+
kind: "native.session.result";
|
|
463
|
+
action: "delete";
|
|
464
|
+
entryId: string;
|
|
465
|
+
deletedSessionIds: readonly string[];
|
|
466
|
+
}>>;
|
|
467
|
+
readonly "runtime.delivery.received": MessageSignature<import("./messages.ts").RuntimeDeliveryReceived>;
|
|
468
|
+
readonly "runtime.heartbeat": MessageSignature<import("./messages.ts").RuntimeHeartbeatEvent>;
|
|
469
|
+
readonly "session.event": MessageSignature<Readonly<{
|
|
470
|
+
eventId: string;
|
|
471
|
+
kind: "session.event";
|
|
472
|
+
payload: string;
|
|
473
|
+
sessionId: string;
|
|
474
|
+
source: Readonly<{
|
|
475
|
+
attemptId: string;
|
|
476
|
+
kind: "attempt";
|
|
477
|
+
sourceSeq: string;
|
|
478
|
+
}> | Readonly<{
|
|
479
|
+
kind: "runtime";
|
|
480
|
+
sourceSeq: string;
|
|
481
|
+
}>;
|
|
482
|
+
}>>;
|
|
483
|
+
readonly "session.operation.failed": MessageSignature<Readonly<{
|
|
484
|
+
code: string;
|
|
485
|
+
kind: "session.operation.failed";
|
|
486
|
+
message: string;
|
|
487
|
+
requestId: string;
|
|
488
|
+
runtimeTimings?: readonly Readonly<{
|
|
489
|
+
durationMilliseconds: number;
|
|
490
|
+
name: string;
|
|
491
|
+
}>[] | undefined;
|
|
492
|
+
sessionId: string;
|
|
493
|
+
}>>;
|
|
494
|
+
readonly "session.live-history.loaded": MessageSignature<Readonly<{
|
|
495
|
+
history: Readonly<{
|
|
496
|
+
status: "available";
|
|
497
|
+
messages: readonly Readonly<{
|
|
498
|
+
role: "assistant" | "user";
|
|
499
|
+
text: string;
|
|
500
|
+
images?: readonly Readonly<{
|
|
501
|
+
data: string;
|
|
502
|
+
mimeType: "image/gif" | "image/jpeg" | "image/png" | "image/webp";
|
|
503
|
+
name: string;
|
|
504
|
+
}>[] | undefined;
|
|
505
|
+
}>[];
|
|
506
|
+
truncated: boolean;
|
|
507
|
+
coveredCommandIds: readonly string[];
|
|
508
|
+
coveredMessageIds: readonly string[];
|
|
509
|
+
}> | Readonly<{
|
|
510
|
+
status: "unavailable";
|
|
511
|
+
}>;
|
|
512
|
+
kind: "session.live-history.loaded";
|
|
513
|
+
requestId: string;
|
|
514
|
+
sessionId: string;
|
|
515
|
+
}>>;
|
|
516
|
+
readonly "session.ready": MessageSignature<Readonly<{
|
|
517
|
+
additionalDirectories: readonly Readonly<{
|
|
518
|
+
directoryId: string;
|
|
519
|
+
name: string;
|
|
520
|
+
}>[];
|
|
521
|
+
agentId: string;
|
|
522
|
+
agentName: string;
|
|
523
|
+
agentVersion: string;
|
|
524
|
+
capabilities: Readonly<{
|
|
525
|
+
additionalDirectories: boolean;
|
|
526
|
+
audioPrompt: boolean;
|
|
527
|
+
closeSession: boolean;
|
|
528
|
+
deleteSession: boolean;
|
|
529
|
+
embeddedContextPrompt: boolean;
|
|
530
|
+
imagePrompt: boolean;
|
|
531
|
+
listSessions: boolean;
|
|
532
|
+
loadSession: boolean;
|
|
533
|
+
promptQueueing: boolean;
|
|
534
|
+
resumeSession: boolean;
|
|
535
|
+
steering: boolean;
|
|
536
|
+
unstableForkSession: boolean;
|
|
537
|
+
}>;
|
|
538
|
+
commands: readonly Readonly<{
|
|
539
|
+
description: string;
|
|
540
|
+
inputHint: string;
|
|
541
|
+
name: string;
|
|
542
|
+
}>[];
|
|
543
|
+
configOptions: readonly Readonly<{
|
|
544
|
+
booleanValue: boolean;
|
|
545
|
+
category: string;
|
|
546
|
+
currentValue: string;
|
|
547
|
+
description: string;
|
|
548
|
+
id: string;
|
|
549
|
+
name: string;
|
|
550
|
+
type: "boolean" | "select";
|
|
551
|
+
values: readonly Readonly<{
|
|
552
|
+
description: string;
|
|
553
|
+
groupId: string;
|
|
554
|
+
groupName: string;
|
|
555
|
+
name: string;
|
|
556
|
+
value: string;
|
|
557
|
+
}>[];
|
|
558
|
+
}>[];
|
|
559
|
+
directoryId: string;
|
|
560
|
+
directoryLabel: string;
|
|
561
|
+
kind: "session.ready";
|
|
562
|
+
requestId: string;
|
|
563
|
+
restored: boolean;
|
|
564
|
+
runtimeTimings?: readonly Readonly<{
|
|
565
|
+
durationMilliseconds: number;
|
|
566
|
+
name: string;
|
|
567
|
+
}>[] | undefined;
|
|
568
|
+
sessionId: string;
|
|
569
|
+
}>>;
|
|
570
|
+
readonly "workspace.entries": MessageSignature<Readonly<{
|
|
571
|
+
bindingId: string;
|
|
572
|
+
directoryId: string;
|
|
573
|
+
directoryLabel: string;
|
|
574
|
+
entries: readonly Readonly<{
|
|
575
|
+
directoryId: string;
|
|
576
|
+
name: string;
|
|
577
|
+
}>[];
|
|
578
|
+
kind: "workspace.entries";
|
|
579
|
+
parentDirectoryId: string;
|
|
580
|
+
requestId: string;
|
|
581
|
+
}>>;
|
|
582
|
+
};
|
|
583
|
+
export type DaemonToServiceMessage = ReturnType<(typeof daemonToServiceSignatures)[keyof typeof daemonToServiceSignatures]["decoder"]>;
|
|
584
|
+
export declare function decodeDaemonToServiceMessage(encoded: string): DaemonToServiceMessage;
|
|
585
|
+
export declare function encodeDaemonToServiceMessage(message: DaemonToServiceMessage): string;
|
|
586
|
+
export {};
|
|
587
|
+
//# sourceMappingURL=daemon-transport.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"daemon-transport.d.ts","sourceRoot":"","sources":["../src/daemon-transport.ts"],"names":[],"mappings":"AAmJA,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,MAAM,CAAC,CAAC;IAChC,QAAQ,CAAC,MAAM,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,QAAQ,CAAC;CACnD;AAgBD,QAAA,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgHrB,CAAC;AAEX,MAAM,MAAM,sBAAsB,GAAG,UAAU,CAC3C,CAAC,OAAO,yBAAyB,CAAC,CAAC,MAAM,OAAO,yBAAyB,CAAC,CAAC,SAAS,CAAC,CACxF,CAAC;AAKF,wBAAgB,4BAA4B,CAAC,OAAO,EAAE,MAAM,GAAG,sBAAsB,CAOpF;AAED,wBAAgB,4BAA4B,CAAC,OAAO,EAAE,sBAAsB,GAAG,MAAM,CAEpF;AAED,QAAA,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsFrB,CAAC;AAEX,MAAM,MAAM,sBAAsB,GAAG,UAAU,CAC3C,CAAC,OAAO,yBAAyB,CAAC,CAAC,MAAM,OAAO,yBAAyB,CAAC,CAAC,SAAS,CAAC,CACxF,CAAC;AAKF,wBAAgB,4BAA4B,CAAC,OAAO,EAAE,MAAM,GAAG,sBAAsB,CAOpF;AAED,wBAAgB,4BAA4B,CAAC,OAAO,EAAE,sBAAsB,GAAG,MAAM,CAEpF"}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { decodeMessageKind, decodeRuntimeDelivery, decodeRuntimeDeliveryCommitted, decodeRuntimeDeliveryReceived, decodeRuntimeHeartbeatAckEvent, decodeRuntimeHeartbeatEvent, decodeRuntimeLivenessReadyEvent, decodeSessionCancelCommand, decodeSessionPromptCommand, encodeRuntimeDelivery, encodeRuntimeDeliveryCommitted, encodeRuntimeDeliveryReceived, encodeRuntimeHeartbeatAckEvent, encodeRuntimeHeartbeatEvent, encodeRuntimeLivenessReadyEvent, encodeSessionCancelCommand, encodeSessionPromptCommand, ProtocolMessageError, } from "./codecs/messages.js";
|
|
2
|
+
import { AGENT_CATALOG_REFRESH_FAILED_KIND, AGENT_CATALOG_REFRESH_KIND, AGENT_CATALOG_REFRESHED_KIND, AGENT_INSTALL_CANCEL_KIND, AGENT_INSTALL_CANCELLED_KIND, AGENT_INSTALL_COMPLETED_KIND, AGENT_INSTALL_FAILED_KIND, AGENT_INSTALL_PROGRESS_KIND, AGENT_INSTALL_REQUEST_KIND, AGENT_INSTALL_STARTED_KIND, AGENT_SETTINGS_DISCOVER_KIND, AGENT_SETTINGS_DISCOVERED_KIND, AGENT_SETTINGS_DISCOVERY_FAILED_KIND, decodeAgentCatalogRefreshCommand, decodeAgentCatalogRefreshedEvent, decodeAgentCatalogRefreshFailedEvent, decodeAgentInstallCancelCommand, decodeAgentInstallCancelledEvent, decodeAgentInstallCompletedEvent, decodeAgentInstallFailedEvent, decodeAgentInstallProgressEvent, decodeAgentInstallRequestCommand, decodeAgentInstallStartedEvent, decodeAgentSettingsDiscoverCommand, decodeAgentSettingsDiscoveredEvent, decodeAgentSettingsDiscoveryFailedEvent, decodeFileBeginEvent, decodeFileChunkEvent, decodeFileEndEvent, decodeFileFailedEvent, decodeFileReadCommand, decodeSessionConfigureCommand, decodeSessionElicitationRespondCommand, decodeSessionOperationFailedEvent, decodeSessionPermissionRespondCommand, decodeSessionPrepareCommand, decodeSessionReadyEvent, decodeWorkspaceEntriesEvent, decodeWorkspaceListCommand, encodeAgentCatalogRefreshCommand, encodeAgentCatalogRefreshedEvent, encodeAgentCatalogRefreshFailedEvent, encodeAgentInstallCancelCommand, encodeAgentInstallCancelledEvent, encodeAgentInstallCompletedEvent, encodeAgentInstallFailedEvent, encodeAgentInstallProgressEvent, encodeAgentInstallRequestCommand, encodeAgentInstallStartedEvent, encodeAgentSettingsDiscoverCommand, encodeAgentSettingsDiscoveredEvent, encodeAgentSettingsDiscoveryFailedEvent, encodeFileBeginEvent, encodeFileChunkEvent, encodeFileEndEvent, encodeFileFailedEvent, encodeFileReadCommand, encodeSessionConfigureCommand, encodeSessionElicitationRespondCommand, encodeSessionOperationFailedEvent, encodeSessionPermissionRespondCommand, encodeSessionPrepareCommand, encodeSessionReadyEvent, encodeWorkspaceEntriesEvent, encodeWorkspaceListCommand, FILE_BEGIN_KIND, FILE_CHUNK_KIND, FILE_END_KIND, FILE_FAILED_KIND, FILE_READ_KIND, SESSION_CONFIGURE_KIND, SESSION_ELICITATION_RESPOND_KIND, SESSION_OPERATION_FAILED_KIND, SESSION_PERMISSION_RESPOND_KIND, SESSION_PREPARE_KIND, SESSION_READY_KIND, WORKSPACE_ENTRIES_KIND, WORKSPACE_LIST_KIND, } from "./control-messages.js";
|
|
3
|
+
import { RUNTIME_DELIVERY_COMMITTED_KIND, RUNTIME_DELIVERY_KIND, RUNTIME_DELIVERY_RECEIVED_KIND, RUNTIME_HEARTBEAT_ACK_KIND, RUNTIME_HEARTBEAT_KIND, RUNTIME_LIVENESS_READY_KIND, SESSION_CANCEL_KIND, SESSION_PROMPT_KIND, } from "./messages.js";
|
|
4
|
+
import { decodeNativeSessionCancel, decodeNativeSessionCommand, decodeNativeSessionResult, decodeNativeSessionTurnForkCommand, encodeNativeSessionCancel, encodeNativeSessionCommand, encodeNativeSessionResult, encodeNativeSessionTurnForkCommand, NATIVE_SESSION_CANCEL_KIND, NATIVE_SESSION_REQUEST_KIND, NATIVE_SESSION_RESULT_KIND, NATIVE_SESSION_TURN_FORK_KIND, } from "./native-sessions.js";
|
|
5
|
+
import { decodeSessionEventAcknowledgement, decodeSessionEventDeferred, decodeSessionEventEnvelope, decodeSessionEventRejection, encodeSessionEventAcknowledgement, encodeSessionEventDeferred, encodeSessionEventEnvelope, encodeSessionEventRejection, SESSION_EVENT_ACK_KIND, SESSION_EVENT_DEFERRED_KIND, SESSION_EVENT_KIND, SESSION_EVENT_REJECTED_KIND, } from "./session-events.js";
|
|
6
|
+
import { decodeSessionLiveHistoryLoad, decodeSessionLiveHistoryLoaded, encodeSessionLiveHistoryLoad, encodeSessionLiveHistoryLoaded, SESSION_LIVE_HISTORY_LOAD_KIND, SESSION_LIVE_HISTORY_LOADED_KIND, } from "./session-live-history.js";
|
|
7
|
+
function defineMessageSignature(kind, encoder, decoder) {
|
|
8
|
+
const schema = (message) => decoder(JSON.stringify(message));
|
|
9
|
+
return {
|
|
10
|
+
decoder,
|
|
11
|
+
encoder: (message) => encoder(schema(message)),
|
|
12
|
+
kind,
|
|
13
|
+
schema,
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
const serviceToDaemonSignatures = {
|
|
17
|
+
[AGENT_CATALOG_REFRESH_KIND]: defineMessageSignature(AGENT_CATALOG_REFRESH_KIND, encodeAgentCatalogRefreshCommand, decodeAgentCatalogRefreshCommand),
|
|
18
|
+
[AGENT_INSTALL_CANCEL_KIND]: defineMessageSignature(AGENT_INSTALL_CANCEL_KIND, encodeAgentInstallCancelCommand, decodeAgentInstallCancelCommand),
|
|
19
|
+
[AGENT_INSTALL_REQUEST_KIND]: defineMessageSignature(AGENT_INSTALL_REQUEST_KIND, encodeAgentInstallRequestCommand, decodeAgentInstallRequestCommand),
|
|
20
|
+
[AGENT_SETTINGS_DISCOVER_KIND]: defineMessageSignature(AGENT_SETTINGS_DISCOVER_KIND, encodeAgentSettingsDiscoverCommand, decodeAgentSettingsDiscoverCommand),
|
|
21
|
+
[FILE_READ_KIND]: defineMessageSignature(FILE_READ_KIND, encodeFileReadCommand, decodeFileReadCommand),
|
|
22
|
+
[NATIVE_SESSION_CANCEL_KIND]: defineMessageSignature(NATIVE_SESSION_CANCEL_KIND, encodeNativeSessionCancel, decodeNativeSessionCancel),
|
|
23
|
+
[NATIVE_SESSION_REQUEST_KIND]: defineMessageSignature(NATIVE_SESSION_REQUEST_KIND, encodeNativeSessionCommand, decodeNativeSessionCommand),
|
|
24
|
+
[NATIVE_SESSION_TURN_FORK_KIND]: defineMessageSignature(NATIVE_SESSION_TURN_FORK_KIND, encodeNativeSessionTurnForkCommand, decodeNativeSessionTurnForkCommand),
|
|
25
|
+
[RUNTIME_DELIVERY_KIND]: defineMessageSignature(RUNTIME_DELIVERY_KIND, encodeRuntimeDelivery, decodeRuntimeDelivery),
|
|
26
|
+
[RUNTIME_DELIVERY_COMMITTED_KIND]: defineMessageSignature(RUNTIME_DELIVERY_COMMITTED_KIND, encodeRuntimeDeliveryCommitted, decodeRuntimeDeliveryCommitted),
|
|
27
|
+
[RUNTIME_HEARTBEAT_ACK_KIND]: defineMessageSignature(RUNTIME_HEARTBEAT_ACK_KIND, encodeRuntimeHeartbeatAckEvent, decodeRuntimeHeartbeatAckEvent),
|
|
28
|
+
[RUNTIME_LIVENESS_READY_KIND]: defineMessageSignature(RUNTIME_LIVENESS_READY_KIND, encodeRuntimeLivenessReadyEvent, decodeRuntimeLivenessReadyEvent),
|
|
29
|
+
[SESSION_CANCEL_KIND]: defineMessageSignature(SESSION_CANCEL_KIND, encodeSessionCancelCommand, decodeSessionCancelCommand),
|
|
30
|
+
[SESSION_CONFIGURE_KIND]: defineMessageSignature(SESSION_CONFIGURE_KIND, encodeSessionConfigureCommand, decodeSessionConfigureCommand),
|
|
31
|
+
[SESSION_ELICITATION_RESPOND_KIND]: defineMessageSignature(SESSION_ELICITATION_RESPOND_KIND, encodeSessionElicitationRespondCommand, decodeSessionElicitationRespondCommand),
|
|
32
|
+
[SESSION_EVENT_ACK_KIND]: defineMessageSignature(SESSION_EVENT_ACK_KIND, encodeSessionEventAcknowledgement, decodeSessionEventAcknowledgement),
|
|
33
|
+
[SESSION_EVENT_DEFERRED_KIND]: defineMessageSignature(SESSION_EVENT_DEFERRED_KIND, encodeSessionEventDeferred, decodeSessionEventDeferred),
|
|
34
|
+
[SESSION_EVENT_REJECTED_KIND]: defineMessageSignature(SESSION_EVENT_REJECTED_KIND, encodeSessionEventRejection, decodeSessionEventRejection),
|
|
35
|
+
[SESSION_LIVE_HISTORY_LOAD_KIND]: defineMessageSignature(SESSION_LIVE_HISTORY_LOAD_KIND, encodeSessionLiveHistoryLoad, decodeSessionLiveHistoryLoad),
|
|
36
|
+
[SESSION_PERMISSION_RESPOND_KIND]: defineMessageSignature(SESSION_PERMISSION_RESPOND_KIND, encodeSessionPermissionRespondCommand, decodeSessionPermissionRespondCommand),
|
|
37
|
+
[SESSION_PREPARE_KIND]: defineMessageSignature(SESSION_PREPARE_KIND, encodeSessionPrepareCommand, decodeSessionPrepareCommand),
|
|
38
|
+
[SESSION_PROMPT_KIND]: defineMessageSignature(SESSION_PROMPT_KIND, encodeSessionPromptCommand, decodeSessionPromptCommand),
|
|
39
|
+
[WORKSPACE_LIST_KIND]: defineMessageSignature(WORKSPACE_LIST_KIND, encodeWorkspaceListCommand, decodeWorkspaceListCommand),
|
|
40
|
+
};
|
|
41
|
+
const serviceToDaemonRegistry = serviceToDaemonSignatures;
|
|
42
|
+
export function decodeServiceToDaemonMessage(encoded) {
|
|
43
|
+
const kind = decodeMessageKind(encoded);
|
|
44
|
+
const signature = serviceToDaemonRegistry[kind];
|
|
45
|
+
if (signature === undefined) {
|
|
46
|
+
throw new ProtocolMessageError(`Unsupported service-to-daemon message kind: ${kind}`);
|
|
47
|
+
}
|
|
48
|
+
return signature.decoder(encoded);
|
|
49
|
+
}
|
|
50
|
+
export function encodeServiceToDaemonMessage(message) {
|
|
51
|
+
return serviceToDaemonSignatures[message.kind].encoder(message);
|
|
52
|
+
}
|
|
53
|
+
const daemonToServiceSignatures = {
|
|
54
|
+
[AGENT_CATALOG_REFRESHED_KIND]: defineMessageSignature(AGENT_CATALOG_REFRESHED_KIND, encodeAgentCatalogRefreshedEvent, decodeAgentCatalogRefreshedEvent),
|
|
55
|
+
[AGENT_CATALOG_REFRESH_FAILED_KIND]: defineMessageSignature(AGENT_CATALOG_REFRESH_FAILED_KIND, encodeAgentCatalogRefreshFailedEvent, decodeAgentCatalogRefreshFailedEvent),
|
|
56
|
+
[AGENT_INSTALL_CANCELLED_KIND]: defineMessageSignature(AGENT_INSTALL_CANCELLED_KIND, encodeAgentInstallCancelledEvent, decodeAgentInstallCancelledEvent),
|
|
57
|
+
[AGENT_INSTALL_COMPLETED_KIND]: defineMessageSignature(AGENT_INSTALL_COMPLETED_KIND, encodeAgentInstallCompletedEvent, decodeAgentInstallCompletedEvent),
|
|
58
|
+
[AGENT_INSTALL_FAILED_KIND]: defineMessageSignature(AGENT_INSTALL_FAILED_KIND, encodeAgentInstallFailedEvent, decodeAgentInstallFailedEvent),
|
|
59
|
+
[AGENT_INSTALL_PROGRESS_KIND]: defineMessageSignature(AGENT_INSTALL_PROGRESS_KIND, encodeAgentInstallProgressEvent, decodeAgentInstallProgressEvent),
|
|
60
|
+
[AGENT_INSTALL_STARTED_KIND]: defineMessageSignature(AGENT_INSTALL_STARTED_KIND, encodeAgentInstallStartedEvent, decodeAgentInstallStartedEvent),
|
|
61
|
+
[AGENT_SETTINGS_DISCOVERED_KIND]: defineMessageSignature(AGENT_SETTINGS_DISCOVERED_KIND, encodeAgentSettingsDiscoveredEvent, decodeAgentSettingsDiscoveredEvent),
|
|
62
|
+
[AGENT_SETTINGS_DISCOVERY_FAILED_KIND]: defineMessageSignature(AGENT_SETTINGS_DISCOVERY_FAILED_KIND, encodeAgentSettingsDiscoveryFailedEvent, decodeAgentSettingsDiscoveryFailedEvent),
|
|
63
|
+
[FILE_BEGIN_KIND]: defineMessageSignature(FILE_BEGIN_KIND, encodeFileBeginEvent, decodeFileBeginEvent),
|
|
64
|
+
[FILE_CHUNK_KIND]: defineMessageSignature(FILE_CHUNK_KIND, encodeFileChunkEvent, decodeFileChunkEvent),
|
|
65
|
+
[FILE_END_KIND]: defineMessageSignature(FILE_END_KIND, encodeFileEndEvent, decodeFileEndEvent),
|
|
66
|
+
[FILE_FAILED_KIND]: defineMessageSignature(FILE_FAILED_KIND, encodeFileFailedEvent, decodeFileFailedEvent),
|
|
67
|
+
[NATIVE_SESSION_RESULT_KIND]: defineMessageSignature(NATIVE_SESSION_RESULT_KIND, encodeNativeSessionResult, decodeNativeSessionResult),
|
|
68
|
+
[RUNTIME_DELIVERY_RECEIVED_KIND]: defineMessageSignature(RUNTIME_DELIVERY_RECEIVED_KIND, encodeRuntimeDeliveryReceived, decodeRuntimeDeliveryReceived),
|
|
69
|
+
[RUNTIME_HEARTBEAT_KIND]: defineMessageSignature(RUNTIME_HEARTBEAT_KIND, encodeRuntimeHeartbeatEvent, decodeRuntimeHeartbeatEvent),
|
|
70
|
+
[SESSION_EVENT_KIND]: defineMessageSignature(SESSION_EVENT_KIND, encodeSessionEventEnvelope, decodeSessionEventEnvelope),
|
|
71
|
+
[SESSION_OPERATION_FAILED_KIND]: defineMessageSignature(SESSION_OPERATION_FAILED_KIND, encodeSessionOperationFailedEvent, decodeSessionOperationFailedEvent),
|
|
72
|
+
[SESSION_LIVE_HISTORY_LOADED_KIND]: defineMessageSignature(SESSION_LIVE_HISTORY_LOADED_KIND, encodeSessionLiveHistoryLoaded, decodeSessionLiveHistoryLoaded),
|
|
73
|
+
[SESSION_READY_KIND]: defineMessageSignature(SESSION_READY_KIND, encodeSessionReadyEvent, decodeSessionReadyEvent),
|
|
74
|
+
[WORKSPACE_ENTRIES_KIND]: defineMessageSignature(WORKSPACE_ENTRIES_KIND, encodeWorkspaceEntriesEvent, decodeWorkspaceEntriesEvent),
|
|
75
|
+
};
|
|
76
|
+
const daemonToServiceRegistry = daemonToServiceSignatures;
|
|
77
|
+
export function decodeDaemonToServiceMessage(encoded) {
|
|
78
|
+
const kind = decodeMessageKind(encoded);
|
|
79
|
+
const signature = daemonToServiceRegistry[kind];
|
|
80
|
+
if (signature === undefined) {
|
|
81
|
+
throw new ProtocolMessageError(`Unsupported daemon-to-service message kind: ${kind}`);
|
|
82
|
+
}
|
|
83
|
+
return signature.decoder(encoded);
|
|
84
|
+
}
|
|
85
|
+
export function encodeDaemonToServiceMessage(message) {
|
|
86
|
+
return daemonToServiceSignatures[message.kind].encoder(message);
|
|
87
|
+
}
|
|
88
|
+
//# sourceMappingURL=daemon-transport.js.map
|