@dev-anywhere/proxy 0.9.3 → 0.9.4
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/{autostart-ZQ5YVCZY.js → autostart-G2MSOPL7.js} +1 -1
- package/dist/{chunk-M72SC32A.js → chunk-EIXVJR3C.js} +2 -2
- package/dist/{chunk-25JBQRJI.js → chunk-GIFG7KAJ.js} +196 -125
- package/dist/chunk-GIFG7KAJ.js.map +1 -0
- package/dist/{chunk-44SDJYGT.js → chunk-M34C6LTF.js} +2 -2
- package/dist/{chunk-H623APEF.js → chunk-YYNHKGCH.js} +2 -2
- package/dist/index.js +5 -5
- package/dist/serve.js +3 -3
- package/dist/session-worker.js +1 -1
- package/dist/{terminal-PIFFUL2A.js → terminal-UTFRKKZ4.js} +3 -3
- package/dist/terminal-worker.js +3 -3
- package/package.json +3 -3
- package/dist/chunk-25JBQRJI.js.map +0 -1
- /package/dist/{autostart-ZQ5YVCZY.js.map → autostart-G2MSOPL7.js.map} +0 -0
- /package/dist/{chunk-M72SC32A.js.map → chunk-EIXVJR3C.js.map} +0 -0
- /package/dist/{chunk-44SDJYGT.js.map → chunk-M34C6LTF.js.map} +0 -0
- /package/dist/{chunk-H623APEF.js.map → chunk-YYNHKGCH.js.map} +0 -0
- /package/dist/{terminal-PIFFUL2A.js.map → terminal-UTFRKKZ4.js.map} +0 -0
|
@@ -22,10 +22,10 @@ var AssistantMessagePayloadSchema = z2.object({
|
|
|
22
22
|
revision: z2.number().int().positive(),
|
|
23
23
|
text: z2.string(),
|
|
24
24
|
status: z2.enum(["streaming", "completed"])
|
|
25
|
-
})
|
|
25
|
+
});
|
|
26
26
|
var ThinkingPayloadSchema = z2.object({
|
|
27
27
|
text: z2.string()
|
|
28
|
-
})
|
|
28
|
+
});
|
|
29
29
|
|
|
30
30
|
// ../../packages/shared/dist/schemas/tool.js
|
|
31
31
|
import { z as z3 } from "zod";
|
|
@@ -39,13 +39,13 @@ var ApprovalOptionSchema = z3.object({
|
|
|
39
39
|
optionId: IdSchema,
|
|
40
40
|
name: z3.string().min(1),
|
|
41
41
|
kind: ApprovalOptionKindSchema
|
|
42
|
-
})
|
|
42
|
+
});
|
|
43
43
|
var ToolUseRequestPayloadSchema = z3.object({
|
|
44
44
|
toolName: z3.string(),
|
|
45
45
|
toolId: IdSchema,
|
|
46
46
|
parameters: z3.record(z3.string(), z3.unknown()),
|
|
47
47
|
options: z3.array(ApprovalOptionSchema).optional()
|
|
48
|
-
})
|
|
48
|
+
});
|
|
49
49
|
var ToolApprovePayloadSchema = z3.object({
|
|
50
50
|
toolId: IdSchema,
|
|
51
51
|
whitelistTool: z3.boolean().optional(),
|
|
@@ -60,7 +60,7 @@ var ToolResultPayloadSchema = z3.object({
|
|
|
60
60
|
toolId: IdSchema,
|
|
61
61
|
result: z3.unknown(),
|
|
62
62
|
isError: z3.boolean()
|
|
63
|
-
})
|
|
63
|
+
});
|
|
64
64
|
|
|
65
65
|
// ../../packages/shared/dist/schemas/session.js
|
|
66
66
|
import { z as z4 } from "zod";
|
|
@@ -109,22 +109,23 @@ function createSessionIdentitySchema(commonFields) {
|
|
|
109
109
|
...commonFields,
|
|
110
110
|
kind: z4.literal("agent"),
|
|
111
111
|
mode: z4.literal("json"),
|
|
112
|
-
provider: z4.enum(providerValues)
|
|
113
|
-
|
|
112
|
+
provider: z4.enum(providerValues),
|
|
113
|
+
ptyOwner: z4.never().optional()
|
|
114
|
+
}),
|
|
114
115
|
z4.object({
|
|
115
116
|
...commonFields,
|
|
116
117
|
kind: z4.literal("agent"),
|
|
117
118
|
mode: z4.literal("pty"),
|
|
118
119
|
provider: z4.enum(providerValues),
|
|
119
120
|
ptyOwner: z4.enum(ptyOwnerValues)
|
|
120
|
-
})
|
|
121
|
+
}),
|
|
121
122
|
z4.object({
|
|
122
123
|
...commonFields,
|
|
123
124
|
kind: z4.literal("terminal"),
|
|
124
125
|
mode: z4.literal("pty"),
|
|
125
126
|
provider: z4.literal("claude"),
|
|
126
127
|
ptyOwner: z4.literal("proxy-hosted")
|
|
127
|
-
})
|
|
128
|
+
})
|
|
128
129
|
]);
|
|
129
130
|
}
|
|
130
131
|
var SessionInfoSchema = createSessionIdentitySchema({
|
|
@@ -139,12 +140,12 @@ var SessionInfoSchema = createSessionIdentitySchema({
|
|
|
139
140
|
});
|
|
140
141
|
var SessionListPayloadSchema = z4.object({
|
|
141
142
|
sessions: z4.array(SessionInfoSchema)
|
|
142
|
-
})
|
|
143
|
+
});
|
|
143
144
|
var SessionStatusPayloadSchema = z4.object({
|
|
144
145
|
sessionId: IdSchema,
|
|
145
146
|
state: z4.enum(sessionStateValues),
|
|
146
147
|
lastActive: z4.number()
|
|
147
|
-
})
|
|
148
|
+
});
|
|
148
149
|
var PtyStatePayloadSchema = z4.object({
|
|
149
150
|
state: z4.enum(ptySemanticStateValues),
|
|
150
151
|
seq: z4.number().int().nonnegative(),
|
|
@@ -172,7 +173,7 @@ var AgentStatusPayloadSchema = z4.object({
|
|
|
172
173
|
|
|
173
174
|
// ../../packages/shared/dist/schemas/system.js
|
|
174
175
|
import { z as z5 } from "zod";
|
|
175
|
-
var HeartbeatPayloadSchema = z5.object({})
|
|
176
|
+
var HeartbeatPayloadSchema = z5.object({});
|
|
176
177
|
var AuthPayloadSchema = z5.object({
|
|
177
178
|
pairingCode: z5.string().optional(),
|
|
178
179
|
token: z5.string().optional()
|
|
@@ -182,7 +183,7 @@ var SyncRequestPayloadSchema = z5.object({
|
|
|
182
183
|
}).strict();
|
|
183
184
|
var SyncResponsePayloadSchema = z5.object({
|
|
184
185
|
messages: z5.array(z5.record(z5.string(), z5.unknown()))
|
|
185
|
-
})
|
|
186
|
+
});
|
|
186
187
|
|
|
187
188
|
// ../../packages/shared/dist/schemas/envelope.js
|
|
188
189
|
var BaseEnvelopeFields = {
|
|
@@ -195,6 +196,10 @@ var SessionedEnvelopeFields = {
|
|
|
195
196
|
...BaseEnvelopeFields,
|
|
196
197
|
sessionId: IdSchema
|
|
197
198
|
};
|
|
199
|
+
var GlobalEnvelopeFields = {
|
|
200
|
+
...BaseEnvelopeFields,
|
|
201
|
+
sessionId: z6.never().optional()
|
|
202
|
+
};
|
|
198
203
|
var MessageEnvelopeSchema = z6.discriminatedUnion("type", [
|
|
199
204
|
// chat (3)
|
|
200
205
|
z6.object({
|
|
@@ -206,65 +211,65 @@ var MessageEnvelopeSchema = z6.discriminatedUnion("type", [
|
|
|
206
211
|
...SessionedEnvelopeFields,
|
|
207
212
|
type: z6.literal("assistant_message"),
|
|
208
213
|
payload: AssistantMessagePayloadSchema
|
|
209
|
-
})
|
|
214
|
+
}),
|
|
210
215
|
z6.object({
|
|
211
216
|
...SessionedEnvelopeFields,
|
|
212
217
|
type: z6.literal("thinking"),
|
|
213
218
|
payload: ThinkingPayloadSchema
|
|
214
|
-
})
|
|
219
|
+
}),
|
|
215
220
|
// tool (4): 工具审批决策属于 relay control,不进入会话消息信封。
|
|
216
221
|
// tool_use_request: 审批流请求(proxy → client),toolId 是 approval requestId
|
|
217
222
|
z6.object({
|
|
218
223
|
...SessionedEnvelopeFields,
|
|
219
224
|
type: z6.literal("tool_use_request"),
|
|
220
225
|
payload: ToolUseRequestPayloadSchema
|
|
221
|
-
})
|
|
226
|
+
}),
|
|
222
227
|
// tool_result: 工具执行结果(proxy → client),toolId 对应 assistant_tool_use / tool_use_request 的 toolId
|
|
223
228
|
z6.object({
|
|
224
229
|
...SessionedEnvelopeFields,
|
|
225
230
|
type: z6.literal("tool_result"),
|
|
226
231
|
payload: ToolResultPayloadSchema
|
|
227
|
-
})
|
|
232
|
+
}),
|
|
228
233
|
// assistant_tool_use: 纯展示型工具调用(proxy → client),区别于 tool_use_request 无审批语义
|
|
229
234
|
// payload 结构复用 ToolUseRequestPayloadSchema;toolId 是 Claude 分配的 tool_use id
|
|
230
235
|
z6.object({
|
|
231
236
|
...SessionedEnvelopeFields,
|
|
232
237
|
type: z6.literal("assistant_tool_use"),
|
|
233
238
|
payload: ToolUseRequestPayloadSchema
|
|
234
|
-
})
|
|
239
|
+
}),
|
|
235
240
|
// session (2)
|
|
236
241
|
// session_list 是全局广播 (列出所有 session), 不绑定具体 sessionId, 不携带该字段。
|
|
237
242
|
z6.object({
|
|
238
|
-
...
|
|
243
|
+
...GlobalEnvelopeFields,
|
|
239
244
|
type: z6.literal("session_list"),
|
|
240
245
|
payload: SessionListPayloadSchema
|
|
241
|
-
})
|
|
246
|
+
}),
|
|
242
247
|
z6.object({
|
|
243
248
|
...SessionedEnvelopeFields,
|
|
244
249
|
type: z6.literal("session_status"),
|
|
245
250
|
payload: SessionStatusPayloadSchema
|
|
246
|
-
})
|
|
251
|
+
}),
|
|
247
252
|
// system (5): 心跳 / 认证 / 同步——全局, 无 sessionId
|
|
248
253
|
z6.object({
|
|
249
|
-
...
|
|
254
|
+
...GlobalEnvelopeFields,
|
|
250
255
|
type: z6.literal("heartbeat"),
|
|
251
256
|
payload: HeartbeatPayloadSchema
|
|
252
|
-
})
|
|
257
|
+
}),
|
|
253
258
|
z6.object({
|
|
254
|
-
...
|
|
259
|
+
...GlobalEnvelopeFields,
|
|
255
260
|
type: z6.literal("auth"),
|
|
256
261
|
payload: AuthPayloadSchema
|
|
257
262
|
}).strict(),
|
|
258
263
|
z6.object({
|
|
259
|
-
...
|
|
264
|
+
...GlobalEnvelopeFields,
|
|
260
265
|
type: z6.literal("sync_request"),
|
|
261
266
|
payload: SyncRequestPayloadSchema
|
|
262
267
|
}).strict(),
|
|
263
268
|
z6.object({
|
|
264
|
-
...
|
|
269
|
+
...GlobalEnvelopeFields,
|
|
265
270
|
type: z6.literal("sync_response"),
|
|
266
271
|
payload: SyncResponsePayloadSchema
|
|
267
|
-
})
|
|
272
|
+
})
|
|
268
273
|
]);
|
|
269
274
|
|
|
270
275
|
// ../../packages/shared/dist/builders/index.js
|
|
@@ -377,8 +382,11 @@ var VoiceProviderConfigSchema = z7.object({
|
|
|
377
382
|
asrModel: z7.string().min(1),
|
|
378
383
|
ttsModel: z7.string().min(1),
|
|
379
384
|
ttsVoice: z7.string().min(1),
|
|
380
|
-
turnIdleSeconds: z7.number().int().positive().safe().default(3)
|
|
381
|
-
|
|
385
|
+
turnIdleSeconds: z7.number().int().positive().safe().default(3),
|
|
386
|
+
// 密钥及其写入操作不属于可公开的配置描述。
|
|
387
|
+
apiKey: z7.never().optional(),
|
|
388
|
+
clearApiKey: z7.never().optional()
|
|
389
|
+
});
|
|
382
390
|
var VoiceConfigUpdateSchema = z7.object({
|
|
383
391
|
provider: z7.enum(voiceProviderValues).optional(),
|
|
384
392
|
apiKey: z7.string().min(1).optional(),
|
|
@@ -397,13 +405,13 @@ var VoiceOptionSchema = z7.object({
|
|
|
397
405
|
age: z7.string().min(1).optional(),
|
|
398
406
|
model: z7.string().min(1).optional(),
|
|
399
407
|
source: z7.enum(voiceOptionSourceValues)
|
|
400
|
-
})
|
|
408
|
+
});
|
|
401
409
|
var VoiceCapabilitiesSchema = z7.object({
|
|
402
410
|
asrModels: z7.array(VoiceOptionSchema),
|
|
403
411
|
ttsModels: z7.array(VoiceOptionSchema),
|
|
404
412
|
ttsVoices: z7.array(VoiceOptionSchema),
|
|
405
413
|
fetchedAt: z7.number().optional()
|
|
406
|
-
})
|
|
414
|
+
});
|
|
407
415
|
var VoiceSummaryReasonSchema = z7.enum([
|
|
408
416
|
"code",
|
|
409
417
|
"table",
|
|
@@ -477,19 +485,19 @@ var WebPreviewTunnelStatusSchema = z10.discriminatedUnion("available", [
|
|
|
477
485
|
version: z10.string().min(1).max(256).optional(),
|
|
478
486
|
error: z10.never().optional(),
|
|
479
487
|
suggestions: WebPreviewTunnelSuggestionsSchema
|
|
480
|
-
})
|
|
488
|
+
}),
|
|
481
489
|
z10.object({
|
|
482
490
|
available: z10.literal(false),
|
|
483
491
|
command: z10.never().optional(),
|
|
484
492
|
version: z10.never().optional(),
|
|
485
493
|
error: z10.string().min(1).max(WEB_PREVIEW_ERROR_MAX_LENGTH),
|
|
486
494
|
suggestions: WebPreviewTunnelSuggestionsSchema
|
|
487
|
-
})
|
|
495
|
+
})
|
|
488
496
|
]);
|
|
489
497
|
var WebPreviewCapabilitySchema = z10.object({
|
|
490
498
|
cloudflared: WebPreviewTunnelStatusSchema,
|
|
491
499
|
cpolar: WebPreviewTunnelStatusSchema
|
|
492
|
-
})
|
|
500
|
+
});
|
|
493
501
|
var WebPreviewSourceInputSchema = z10.discriminatedUnion("kind", [
|
|
494
502
|
z10.object({
|
|
495
503
|
kind: z10.literal("local"),
|
|
@@ -504,13 +512,16 @@ var WebPreviewSourceInputSchema = z10.discriminatedUnion("kind", [
|
|
|
504
512
|
var PreviewSourceSchema = z10.discriminatedUnion("kind", [
|
|
505
513
|
z10.object({
|
|
506
514
|
kind: z10.literal("local"),
|
|
515
|
+
rootPath: z10.never().optional(),
|
|
516
|
+
entryPath: z10.never().optional(),
|
|
507
517
|
url: LoopbackHttpUrlSchema
|
|
508
|
-
})
|
|
518
|
+
}),
|
|
509
519
|
z10.object({
|
|
510
520
|
kind: z10.literal("static"),
|
|
521
|
+
url: z10.never().optional(),
|
|
511
522
|
rootPath: WebPreviewPathSchema,
|
|
512
523
|
entryPath: WebPreviewPathSchema
|
|
513
|
-
})
|
|
524
|
+
})
|
|
514
525
|
]);
|
|
515
526
|
var previewStateValues = [
|
|
516
527
|
"starting",
|
|
@@ -536,25 +547,25 @@ var PreviewSummarySchema = z10.discriminatedUnion("state", [
|
|
|
536
547
|
PreviewSummaryBaseSchema.extend({
|
|
537
548
|
state: z10.literal("starting"),
|
|
538
549
|
...PreviewSummaryInactiveShape
|
|
539
|
-
})
|
|
550
|
+
}),
|
|
540
551
|
PreviewSummaryBaseSchema.extend({
|
|
541
552
|
state: z10.literal("ready"),
|
|
542
553
|
publicUrl: PublicPreviewUrlSchema,
|
|
543
554
|
error: z10.never().optional()
|
|
544
|
-
})
|
|
555
|
+
}),
|
|
545
556
|
PreviewSummaryBaseSchema.extend({
|
|
546
557
|
state: z10.literal("disconnected"),
|
|
547
558
|
...PreviewSummaryInactiveShape
|
|
548
|
-
})
|
|
559
|
+
}),
|
|
549
560
|
PreviewSummaryBaseSchema.extend({
|
|
550
561
|
state: z10.literal("failed"),
|
|
551
562
|
publicUrl: z10.never().optional(),
|
|
552
563
|
error: z10.string().min(1).max(WEB_PREVIEW_ERROR_MAX_LENGTH)
|
|
553
|
-
})
|
|
564
|
+
}),
|
|
554
565
|
PreviewSummaryBaseSchema.extend({
|
|
555
566
|
state: z10.literal("stopping"),
|
|
556
567
|
...PreviewSummaryInactiveShape
|
|
557
|
-
})
|
|
568
|
+
})
|
|
558
569
|
]).superRefine((preview, context) => {
|
|
559
570
|
if (preview.state !== "ready")
|
|
560
571
|
return;
|
|
@@ -597,7 +608,7 @@ var DevicePreviewToolStatusSchema = z11.union([
|
|
|
597
608
|
version: z11.never().optional(),
|
|
598
609
|
error: z11.string().min(1).max(DEVICE_PREVIEW_ERROR_MAX_LENGTH),
|
|
599
610
|
suggestions: DevicePreviewToolSuggestionsSchema
|
|
600
|
-
})
|
|
611
|
+
}),
|
|
601
612
|
z11.object({
|
|
602
613
|
supported: z11.literal(true),
|
|
603
614
|
available: z11.literal(false),
|
|
@@ -606,7 +617,7 @@ var DevicePreviewToolStatusSchema = z11.union([
|
|
|
606
617
|
version: z11.string().min(1).max(DEVICE_PREVIEW_VERSION_MAX_LENGTH).optional(),
|
|
607
618
|
error: z11.string().min(1).max(DEVICE_PREVIEW_ERROR_MAX_LENGTH),
|
|
608
619
|
suggestions: DevicePreviewToolSuggestionsSchema
|
|
609
|
-
})
|
|
620
|
+
}),
|
|
610
621
|
z11.object({
|
|
611
622
|
supported: z11.literal(true),
|
|
612
623
|
available: z11.literal(true),
|
|
@@ -615,12 +626,12 @@ var DevicePreviewToolStatusSchema = z11.union([
|
|
|
615
626
|
version: z11.string().min(1).max(DEVICE_PREVIEW_VERSION_MAX_LENGTH).optional(),
|
|
616
627
|
error: z11.never().optional(),
|
|
617
628
|
suggestions: DevicePreviewToolSuggestionsSchema
|
|
618
|
-
})
|
|
629
|
+
})
|
|
619
630
|
]);
|
|
620
631
|
var DevicePreviewCapabilitySchema = z11.object({
|
|
621
632
|
ios: DevicePreviewToolStatusSchema,
|
|
622
633
|
android: DevicePreviewToolStatusSchema
|
|
623
|
-
})
|
|
634
|
+
});
|
|
624
635
|
var DevicePreviewTargetBaseSchema = z11.object({
|
|
625
636
|
targetId: IdSchema,
|
|
626
637
|
platform: DevicePreviewPlatformSchema,
|
|
@@ -634,11 +645,11 @@ var DevicePreviewTargetSchema = z11.union([
|
|
|
634
645
|
DevicePreviewTargetBaseSchema.extend({
|
|
635
646
|
width: DevicePreviewScreenEdgeSchema,
|
|
636
647
|
height: DevicePreviewScreenEdgeSchema
|
|
637
|
-
})
|
|
648
|
+
}),
|
|
638
649
|
DevicePreviewTargetBaseSchema.extend({
|
|
639
650
|
width: z11.never().optional(),
|
|
640
651
|
height: z11.never().optional()
|
|
641
|
-
})
|
|
652
|
+
})
|
|
642
653
|
]);
|
|
643
654
|
var DevicePreviewStateSchema = z11.enum(["ready", "disconnected"]);
|
|
644
655
|
var DevicePreviewSummaryBaseSchema = z11.object({
|
|
@@ -656,11 +667,11 @@ var DevicePreviewSummarySchema = z11.discriminatedUnion("state", [
|
|
|
656
667
|
DevicePreviewSummaryBaseSchema.extend({
|
|
657
668
|
state: z11.literal("ready"),
|
|
658
669
|
error: z11.never().optional()
|
|
659
|
-
})
|
|
670
|
+
}),
|
|
660
671
|
DevicePreviewSummaryBaseSchema.extend({
|
|
661
672
|
state: z11.literal("disconnected"),
|
|
662
673
|
error: z11.never().optional()
|
|
663
|
-
})
|
|
674
|
+
})
|
|
664
675
|
]);
|
|
665
676
|
var DevicePreviewJpegStreamProfileSchema = z11.object({
|
|
666
677
|
format: z11.literal("jpeg"),
|
|
@@ -716,17 +727,18 @@ var DevicePreviewStreamRegisterSchema = z11.object({
|
|
|
716
727
|
type: z11.literal("device_preview_stream_register"),
|
|
717
728
|
proxyId: IdSchema,
|
|
718
729
|
connectionId: IdSchema
|
|
719
|
-
})
|
|
730
|
+
});
|
|
720
731
|
var DevicePreviewStreamRegisterResponseSchema = z11.discriminatedUnion("success", [
|
|
721
732
|
z11.object({
|
|
722
733
|
type: z11.literal("device_preview_stream_register_response"),
|
|
723
|
-
success: z11.literal(true)
|
|
724
|
-
|
|
734
|
+
success: z11.literal(true),
|
|
735
|
+
error: z11.never().optional()
|
|
736
|
+
}),
|
|
725
737
|
z11.object({
|
|
726
738
|
type: z11.literal("device_preview_stream_register_response"),
|
|
727
739
|
success: z11.literal(false),
|
|
728
740
|
error: z11.string().min(1).max(DEVICE_PREVIEW_ERROR_MAX_LENGTH)
|
|
729
|
-
})
|
|
741
|
+
})
|
|
730
742
|
]);
|
|
731
743
|
var DevicePreviewStreamFlowBaseSchema = z11.object({
|
|
732
744
|
type: z11.literal("device_preview_stream_flow"),
|
|
@@ -988,6 +1000,10 @@ var RequestErrorShape = {
|
|
|
988
1000
|
error: z13.string().optional(),
|
|
989
1001
|
errorCode: ControlErrorCodeSchema.optional()
|
|
990
1002
|
};
|
|
1003
|
+
var NoRequestErrorShape = {
|
|
1004
|
+
error: z13.never().optional(),
|
|
1005
|
+
errorCode: z13.never().optional()
|
|
1006
|
+
};
|
|
991
1007
|
var RequiredRequestErrorShape = {
|
|
992
1008
|
error: z13.string().min(1),
|
|
993
1009
|
errorCode: ControlErrorCodeSchema
|
|
@@ -1026,15 +1042,18 @@ var ProxySelectResponseSchema = z13.discriminatedUnion("success", [
|
|
|
1026
1042
|
type: z13.literal("proxy_select_response"),
|
|
1027
1043
|
...RequestIdShape,
|
|
1028
1044
|
success: z13.literal(true),
|
|
1045
|
+
...NoRequestErrorShape,
|
|
1029
1046
|
proxyId: IdSchema,
|
|
1030
1047
|
bindingId: IdSchema
|
|
1031
|
-
})
|
|
1048
|
+
}),
|
|
1032
1049
|
z13.object({
|
|
1033
1050
|
type: z13.literal("proxy_select_response"),
|
|
1034
1051
|
...RequestIdShape,
|
|
1035
1052
|
success: z13.literal(false),
|
|
1053
|
+
proxyId: z13.never().optional(),
|
|
1054
|
+
bindingId: z13.never().optional(),
|
|
1036
1055
|
...RequestErrorShape
|
|
1037
|
-
})
|
|
1056
|
+
})
|
|
1038
1057
|
]);
|
|
1039
1058
|
var ClientRegisterResponseSchema = z13.discriminatedUnion("status", [
|
|
1040
1059
|
z13.object({
|
|
@@ -1043,19 +1062,22 @@ var ClientRegisterResponseSchema = z13.discriminatedUnion("status", [
|
|
|
1043
1062
|
status: z13.literal("restored"),
|
|
1044
1063
|
proxyId: IdSchema,
|
|
1045
1064
|
bindingId: IdSchema
|
|
1046
|
-
})
|
|
1065
|
+
}),
|
|
1047
1066
|
z13.object({
|
|
1048
1067
|
type: z13.literal("client_register_response"),
|
|
1049
1068
|
protocolVersion: z13.literal(RELAY_CONTROL_PROTOCOL_VERSION),
|
|
1050
1069
|
status: z13.literal("proxy_offline"),
|
|
1051
1070
|
proxyId: IdSchema,
|
|
1052
1071
|
bindingId: IdSchema
|
|
1053
|
-
})
|
|
1072
|
+
}),
|
|
1054
1073
|
z13.object({
|
|
1055
1074
|
type: z13.literal("client_register_response"),
|
|
1056
1075
|
protocolVersion: z13.literal(RELAY_CONTROL_PROTOCOL_VERSION),
|
|
1057
|
-
status: z13.literal("new")
|
|
1058
|
-
|
|
1076
|
+
status: z13.literal("new"),
|
|
1077
|
+
// 已知的绑定字段不能作为扩展信息被忽略;new 状态明确表示尚未绑定。
|
|
1078
|
+
proxyId: z13.never().optional(),
|
|
1079
|
+
bindingId: z13.never().optional()
|
|
1080
|
+
})
|
|
1059
1081
|
]);
|
|
1060
1082
|
var PreviewCreateResponseSchema = z13.discriminatedUnion("accepted", [
|
|
1061
1083
|
z13.object({
|
|
@@ -1064,16 +1086,18 @@ var PreviewCreateResponseSchema = z13.discriminatedUnion("accepted", [
|
|
|
1064
1086
|
scope: PreviewScopeSchema,
|
|
1065
1087
|
operationId: IdSchema,
|
|
1066
1088
|
accepted: z13.literal(true),
|
|
1089
|
+
...NoRequestErrorShape,
|
|
1067
1090
|
previewId: IdSchema
|
|
1068
|
-
})
|
|
1091
|
+
}),
|
|
1069
1092
|
z13.object({
|
|
1070
1093
|
type: z13.literal("preview_create_response"),
|
|
1071
1094
|
...RequiredRequestIdShape,
|
|
1072
1095
|
scope: PreviewScopeSchema,
|
|
1073
1096
|
operationId: IdSchema,
|
|
1074
1097
|
accepted: z13.literal(false),
|
|
1098
|
+
previewId: z13.never().optional(),
|
|
1075
1099
|
...RequiredRequestErrorShape
|
|
1076
|
-
})
|
|
1100
|
+
})
|
|
1077
1101
|
]);
|
|
1078
1102
|
var DevicePreviewCreateResponseSchema = z13.discriminatedUnion("accepted", [
|
|
1079
1103
|
z13.object({
|
|
@@ -1082,16 +1106,18 @@ var DevicePreviewCreateResponseSchema = z13.discriminatedUnion("accepted", [
|
|
|
1082
1106
|
scope: PreviewScopeSchema,
|
|
1083
1107
|
operationId: IdSchema,
|
|
1084
1108
|
accepted: z13.literal(true),
|
|
1109
|
+
...NoRequestErrorShape,
|
|
1085
1110
|
previewId: IdSchema
|
|
1086
|
-
})
|
|
1111
|
+
}),
|
|
1087
1112
|
z13.object({
|
|
1088
1113
|
type: z13.literal("device_preview_create_response"),
|
|
1089
1114
|
...RequiredRequestIdShape,
|
|
1090
1115
|
scope: PreviewScopeSchema,
|
|
1091
1116
|
operationId: IdSchema,
|
|
1092
1117
|
accepted: z13.literal(false),
|
|
1118
|
+
previewId: z13.never().optional(),
|
|
1093
1119
|
...RequiredRequestErrorShape
|
|
1094
|
-
})
|
|
1120
|
+
})
|
|
1095
1121
|
]);
|
|
1096
1122
|
var PreviewCapabilityResponseSchema = z13.discriminatedUnion("success", [
|
|
1097
1123
|
z13.object({
|
|
@@ -1099,15 +1125,17 @@ var PreviewCapabilityResponseSchema = z13.discriminatedUnion("success", [
|
|
|
1099
1125
|
...RequiredRequestIdShape,
|
|
1100
1126
|
scope: PreviewScopeSchema,
|
|
1101
1127
|
success: z13.literal(true),
|
|
1128
|
+
...NoRequestErrorShape,
|
|
1102
1129
|
capability: WebPreviewCapabilitySchema
|
|
1103
|
-
})
|
|
1130
|
+
}),
|
|
1104
1131
|
z13.object({
|
|
1105
1132
|
type: z13.literal("preview_capability_response"),
|
|
1106
1133
|
...RequiredRequestIdShape,
|
|
1107
1134
|
scope: PreviewScopeSchema,
|
|
1108
1135
|
success: z13.literal(false),
|
|
1136
|
+
capability: z13.never().optional(),
|
|
1109
1137
|
...RequiredRequestErrorShape
|
|
1110
|
-
})
|
|
1138
|
+
})
|
|
1111
1139
|
]);
|
|
1112
1140
|
var DevicePreviewCapabilityResponseSchema = z13.discriminatedUnion("success", [
|
|
1113
1141
|
z13.object({
|
|
@@ -1115,15 +1143,17 @@ var DevicePreviewCapabilityResponseSchema = z13.discriminatedUnion("success", [
|
|
|
1115
1143
|
...RequiredRequestIdShape,
|
|
1116
1144
|
scope: PreviewScopeSchema,
|
|
1117
1145
|
success: z13.literal(true),
|
|
1146
|
+
...NoRequestErrorShape,
|
|
1118
1147
|
capability: DevicePreviewCapabilitySchema
|
|
1119
|
-
})
|
|
1148
|
+
}),
|
|
1120
1149
|
z13.object({
|
|
1121
1150
|
type: z13.literal("device_preview_capability_response"),
|
|
1122
1151
|
...RequiredRequestIdShape,
|
|
1123
1152
|
scope: PreviewScopeSchema,
|
|
1124
1153
|
success: z13.literal(false),
|
|
1154
|
+
capability: z13.never().optional(),
|
|
1125
1155
|
...RequiredRequestErrorShape
|
|
1126
|
-
})
|
|
1156
|
+
})
|
|
1127
1157
|
]);
|
|
1128
1158
|
var ProxyInfoRequestSchema = z13.object({
|
|
1129
1159
|
type: z13.literal("proxy_info_request"),
|
|
@@ -1134,23 +1164,26 @@ var ProxyInfoResponseSchema = z13.object({
|
|
|
1134
1164
|
...RequestIdShape,
|
|
1135
1165
|
homePath: z13.string(),
|
|
1136
1166
|
agentCli: AgentCliStatusSchema
|
|
1137
|
-
})
|
|
1167
|
+
});
|
|
1138
1168
|
var PreviewStaticInspectResponseSchema = z13.discriminatedUnion("success", [
|
|
1139
1169
|
z13.object({
|
|
1140
1170
|
type: z13.literal("preview_static_inspect_response"),
|
|
1141
1171
|
...RequiredRequestIdShape,
|
|
1142
1172
|
scope: PreviewScopeSchema,
|
|
1143
1173
|
success: z13.literal(true),
|
|
1174
|
+
...NoRequestErrorShape,
|
|
1144
1175
|
entryPath: WebPreviewPathSchema.optional(),
|
|
1145
1176
|
htmlEntries: PreviewHtmlEntriesSchema
|
|
1146
|
-
})
|
|
1177
|
+
}),
|
|
1147
1178
|
z13.object({
|
|
1148
1179
|
type: z13.literal("preview_static_inspect_response"),
|
|
1149
1180
|
...RequiredRequestIdShape,
|
|
1150
1181
|
scope: PreviewScopeSchema,
|
|
1151
1182
|
success: z13.literal(false),
|
|
1183
|
+
entryPath: z13.never().optional(),
|
|
1184
|
+
htmlEntries: z13.never().optional(),
|
|
1152
1185
|
...RequiredRequestErrorShape
|
|
1153
|
-
})
|
|
1186
|
+
})
|
|
1154
1187
|
]);
|
|
1155
1188
|
var PreviewRenameResponseSchema = z13.discriminatedUnion("success", [
|
|
1156
1189
|
z13.object({
|
|
@@ -1159,8 +1192,9 @@ var PreviewRenameResponseSchema = z13.discriminatedUnion("success", [
|
|
|
1159
1192
|
scope: PreviewScopeSchema,
|
|
1160
1193
|
operationId: IdSchema,
|
|
1161
1194
|
previewId: IdSchema,
|
|
1162
|
-
success: z13.literal(true)
|
|
1163
|
-
|
|
1195
|
+
success: z13.literal(true),
|
|
1196
|
+
...NoRequestErrorShape
|
|
1197
|
+
}),
|
|
1164
1198
|
z13.object({
|
|
1165
1199
|
type: z13.literal("preview_rename_response"),
|
|
1166
1200
|
...RequiredRequestIdShape,
|
|
@@ -1169,7 +1203,7 @@ var PreviewRenameResponseSchema = z13.discriminatedUnion("success", [
|
|
|
1169
1203
|
previewId: IdSchema,
|
|
1170
1204
|
success: z13.literal(false),
|
|
1171
1205
|
...RequiredRequestErrorShape
|
|
1172
|
-
})
|
|
1206
|
+
})
|
|
1173
1207
|
]);
|
|
1174
1208
|
var PreviewReconnectResponseSchema = z13.discriminatedUnion("success", [
|
|
1175
1209
|
z13.object({
|
|
@@ -1178,8 +1212,9 @@ var PreviewReconnectResponseSchema = z13.discriminatedUnion("success", [
|
|
|
1178
1212
|
scope: PreviewScopeSchema,
|
|
1179
1213
|
operationId: IdSchema,
|
|
1180
1214
|
previewId: IdSchema,
|
|
1181
|
-
success: z13.literal(true)
|
|
1182
|
-
|
|
1215
|
+
success: z13.literal(true),
|
|
1216
|
+
...NoRequestErrorShape
|
|
1217
|
+
}),
|
|
1183
1218
|
z13.object({
|
|
1184
1219
|
type: z13.literal("preview_reconnect_response"),
|
|
1185
1220
|
...RequiredRequestIdShape,
|
|
@@ -1188,7 +1223,7 @@ var PreviewReconnectResponseSchema = z13.discriminatedUnion("success", [
|
|
|
1188
1223
|
previewId: IdSchema,
|
|
1189
1224
|
success: z13.literal(false),
|
|
1190
1225
|
...RequiredRequestErrorShape
|
|
1191
|
-
})
|
|
1226
|
+
})
|
|
1192
1227
|
]);
|
|
1193
1228
|
var PreviewCloseResponseSchema = z13.discriminatedUnion("success", [
|
|
1194
1229
|
z13.object({
|
|
@@ -1197,8 +1232,9 @@ var PreviewCloseResponseSchema = z13.discriminatedUnion("success", [
|
|
|
1197
1232
|
scope: PreviewScopeSchema,
|
|
1198
1233
|
operationId: IdSchema,
|
|
1199
1234
|
previewId: IdSchema,
|
|
1200
|
-
success: z13.literal(true)
|
|
1201
|
-
|
|
1235
|
+
success: z13.literal(true),
|
|
1236
|
+
...NoRequestErrorShape
|
|
1237
|
+
}),
|
|
1202
1238
|
z13.object({
|
|
1203
1239
|
type: z13.literal("preview_close_response"),
|
|
1204
1240
|
...RequiredRequestIdShape,
|
|
@@ -1207,7 +1243,7 @@ var PreviewCloseResponseSchema = z13.discriminatedUnion("success", [
|
|
|
1207
1243
|
previewId: IdSchema,
|
|
1208
1244
|
success: z13.literal(false),
|
|
1209
1245
|
...RequiredRequestErrorShape
|
|
1210
|
-
})
|
|
1246
|
+
})
|
|
1211
1247
|
]);
|
|
1212
1248
|
var DevicePreviewTargetsResponseSchema = z13.discriminatedUnion("success", [
|
|
1213
1249
|
z13.object({
|
|
@@ -1215,15 +1251,17 @@ var DevicePreviewTargetsResponseSchema = z13.discriminatedUnion("success", [
|
|
|
1215
1251
|
...RequiredRequestIdShape,
|
|
1216
1252
|
scope: PreviewScopeSchema,
|
|
1217
1253
|
success: z13.literal(true),
|
|
1254
|
+
...NoRequestErrorShape,
|
|
1218
1255
|
targets: z13.array(DevicePreviewTargetSchema).max(1024)
|
|
1219
|
-
})
|
|
1256
|
+
}),
|
|
1220
1257
|
z13.object({
|
|
1221
1258
|
type: z13.literal("device_preview_targets_response"),
|
|
1222
1259
|
...RequiredRequestIdShape,
|
|
1223
1260
|
scope: PreviewScopeSchema,
|
|
1224
1261
|
success: z13.literal(false),
|
|
1262
|
+
targets: z13.never().optional(),
|
|
1225
1263
|
...RequiredRequestErrorShape
|
|
1226
|
-
})
|
|
1264
|
+
})
|
|
1227
1265
|
]);
|
|
1228
1266
|
var DevicePreviewRenameResponseSchema = z13.discriminatedUnion("success", [
|
|
1229
1267
|
z13.object({
|
|
@@ -1232,8 +1270,9 @@ var DevicePreviewRenameResponseSchema = z13.discriminatedUnion("success", [
|
|
|
1232
1270
|
scope: PreviewScopeSchema,
|
|
1233
1271
|
operationId: IdSchema,
|
|
1234
1272
|
previewId: IdSchema,
|
|
1235
|
-
success: z13.literal(true)
|
|
1236
|
-
|
|
1273
|
+
success: z13.literal(true),
|
|
1274
|
+
...NoRequestErrorShape
|
|
1275
|
+
}),
|
|
1237
1276
|
z13.object({
|
|
1238
1277
|
type: z13.literal("device_preview_rename_response"),
|
|
1239
1278
|
...RequiredRequestIdShape,
|
|
@@ -1242,7 +1281,7 @@ var DevicePreviewRenameResponseSchema = z13.discriminatedUnion("success", [
|
|
|
1242
1281
|
previewId: IdSchema,
|
|
1243
1282
|
success: z13.literal(false),
|
|
1244
1283
|
...RequiredRequestErrorShape
|
|
1245
|
-
})
|
|
1284
|
+
})
|
|
1246
1285
|
]);
|
|
1247
1286
|
var DevicePreviewReconnectResponseSchema = z13.discriminatedUnion("success", [
|
|
1248
1287
|
z13.object({
|
|
@@ -1251,8 +1290,9 @@ var DevicePreviewReconnectResponseSchema = z13.discriminatedUnion("success", [
|
|
|
1251
1290
|
scope: PreviewScopeSchema,
|
|
1252
1291
|
operationId: IdSchema,
|
|
1253
1292
|
previewId: IdSchema,
|
|
1254
|
-
success: z13.literal(true)
|
|
1255
|
-
|
|
1293
|
+
success: z13.literal(true),
|
|
1294
|
+
...NoRequestErrorShape
|
|
1295
|
+
}),
|
|
1256
1296
|
z13.object({
|
|
1257
1297
|
type: z13.literal("device_preview_reconnect_response"),
|
|
1258
1298
|
...RequiredRequestIdShape,
|
|
@@ -1261,7 +1301,7 @@ var DevicePreviewReconnectResponseSchema = z13.discriminatedUnion("success", [
|
|
|
1261
1301
|
previewId: IdSchema,
|
|
1262
1302
|
success: z13.literal(false),
|
|
1263
1303
|
...RequiredRequestErrorShape
|
|
1264
|
-
})
|
|
1304
|
+
})
|
|
1265
1305
|
]);
|
|
1266
1306
|
var DevicePreviewCloseResponseSchema = z13.discriminatedUnion("success", [
|
|
1267
1307
|
z13.object({
|
|
@@ -1270,8 +1310,9 @@ var DevicePreviewCloseResponseSchema = z13.discriminatedUnion("success", [
|
|
|
1270
1310
|
scope: PreviewScopeSchema,
|
|
1271
1311
|
operationId: IdSchema,
|
|
1272
1312
|
previewId: IdSchema,
|
|
1273
|
-
success: z13.literal(true)
|
|
1274
|
-
|
|
1313
|
+
success: z13.literal(true),
|
|
1314
|
+
...NoRequestErrorShape
|
|
1315
|
+
}),
|
|
1275
1316
|
z13.object({
|
|
1276
1317
|
type: z13.literal("device_preview_close_response"),
|
|
1277
1318
|
...RequiredRequestIdShape,
|
|
@@ -1280,7 +1321,7 @@ var DevicePreviewCloseResponseSchema = z13.discriminatedUnion("success", [
|
|
|
1280
1321
|
previewId: IdSchema,
|
|
1281
1322
|
success: z13.literal(false),
|
|
1282
1323
|
...RequiredRequestErrorShape
|
|
1283
|
-
})
|
|
1324
|
+
})
|
|
1284
1325
|
]);
|
|
1285
1326
|
var DevicePreviewStreamUrlResponseSchema = z13.discriminatedUnion("success", [
|
|
1286
1327
|
z13.object({
|
|
@@ -1289,19 +1330,24 @@ var DevicePreviewStreamUrlResponseSchema = z13.discriminatedUnion("success", [
|
|
|
1289
1330
|
scope: PreviewScopeSchema,
|
|
1290
1331
|
previewId: IdSchema,
|
|
1291
1332
|
success: z13.literal(true),
|
|
1333
|
+
...NoRequestErrorShape,
|
|
1292
1334
|
url: z13.string().min(1).max(4096),
|
|
1293
1335
|
leaseId: IdSchema,
|
|
1294
1336
|
expiresAt: z13.number().int().nonnegative(),
|
|
1295
1337
|
controlMode: z13.enum(["controller", "view_only"])
|
|
1296
|
-
})
|
|
1338
|
+
}),
|
|
1297
1339
|
z13.object({
|
|
1298
1340
|
type: z13.literal("device_preview_stream_url_response"),
|
|
1299
1341
|
...RequiredRequestIdShape,
|
|
1300
1342
|
scope: PreviewScopeSchema,
|
|
1301
1343
|
previewId: IdSchema,
|
|
1302
1344
|
success: z13.literal(false),
|
|
1345
|
+
url: z13.never().optional(),
|
|
1346
|
+
leaseId: z13.never().optional(),
|
|
1347
|
+
expiresAt: z13.never().optional(),
|
|
1348
|
+
controlMode: z13.never().optional(),
|
|
1303
1349
|
...RequiredRequestErrorShape
|
|
1304
|
-
})
|
|
1350
|
+
})
|
|
1305
1351
|
]);
|
|
1306
1352
|
var DevicePreviewStreamStartResponseBaseShape = {
|
|
1307
1353
|
type: z13.literal("device_preview_stream_start_response"),
|
|
@@ -1312,10 +1358,11 @@ var DevicePreviewStreamStartResponseBaseShape = {
|
|
|
1312
1358
|
var DevicePreviewStreamStartSuccessSchema = z13.object({
|
|
1313
1359
|
...DevicePreviewStreamStartResponseBaseShape,
|
|
1314
1360
|
success: z13.literal(true),
|
|
1361
|
+
...NoRequestErrorShape,
|
|
1315
1362
|
format: DevicePreviewStreamFormatSchema,
|
|
1316
1363
|
width: z13.number().int().positive().max(16384).optional(),
|
|
1317
1364
|
height: z13.number().int().positive().max(16384).optional()
|
|
1318
|
-
}).
|
|
1365
|
+
}).superRefine((response, context) => {
|
|
1319
1366
|
if (response.width === void 0 === (response.height === void 0))
|
|
1320
1367
|
return;
|
|
1321
1368
|
context.addIssue({
|
|
@@ -1329,8 +1376,11 @@ var DevicePreviewStreamStartResponseSchema = z13.discriminatedUnion("success", [
|
|
|
1329
1376
|
z13.object({
|
|
1330
1377
|
...DevicePreviewStreamStartResponseBaseShape,
|
|
1331
1378
|
success: z13.literal(false),
|
|
1379
|
+
format: z13.never().optional(),
|
|
1380
|
+
width: z13.never().optional(),
|
|
1381
|
+
height: z13.never().optional(),
|
|
1332
1382
|
...RequiredRequestErrorShape
|
|
1333
|
-
})
|
|
1383
|
+
})
|
|
1334
1384
|
]);
|
|
1335
1385
|
var DevicePreviewStreamCompleteSchema = z13.object({
|
|
1336
1386
|
type: z13.literal("device_preview_stream_complete"),
|
|
@@ -1339,7 +1389,7 @@ var DevicePreviewStreamCompleteSchema = z13.object({
|
|
|
1339
1389
|
previewId: IdSchema,
|
|
1340
1390
|
success: z13.literal(false),
|
|
1341
1391
|
error: z13.string().min(1)
|
|
1342
|
-
})
|
|
1392
|
+
});
|
|
1343
1393
|
var DevicePreviewStreamStartBaseShape = {
|
|
1344
1394
|
type: z13.literal("device_preview_stream_start"),
|
|
1345
1395
|
streamId: IdSchema,
|
|
@@ -1362,8 +1412,9 @@ var DevicePreviewInputAckSchema = z13.discriminatedUnion("success", [
|
|
|
1362
1412
|
scope: PreviewScopeSchema,
|
|
1363
1413
|
leaseId: IdSchema,
|
|
1364
1414
|
inputSeq: z13.number().int().min(0).max(4294967295),
|
|
1365
|
-
success: z13.literal(true)
|
|
1366
|
-
|
|
1415
|
+
success: z13.literal(true),
|
|
1416
|
+
...NoRequestErrorShape
|
|
1417
|
+
}),
|
|
1367
1418
|
z13.object({
|
|
1368
1419
|
type: z13.literal("device_preview_input_ack"),
|
|
1369
1420
|
scope: PreviewScopeSchema,
|
|
@@ -1371,7 +1422,7 @@ var DevicePreviewInputAckSchema = z13.discriminatedUnion("success", [
|
|
|
1371
1422
|
inputSeq: z13.number().int().min(0).max(4294967295),
|
|
1372
1423
|
success: z13.literal(false),
|
|
1373
1424
|
...RequiredRequestErrorShape
|
|
1374
|
-
})
|
|
1425
|
+
})
|
|
1375
1426
|
]);
|
|
1376
1427
|
var DevicePreviewControlClaimResponseSchema = z13.discriminatedUnion("success", [
|
|
1377
1428
|
z13.object({
|
|
@@ -1380,16 +1431,18 @@ var DevicePreviewControlClaimResponseSchema = z13.discriminatedUnion("success",
|
|
|
1380
1431
|
scope: PreviewScopeSchema,
|
|
1381
1432
|
leaseId: IdSchema,
|
|
1382
1433
|
success: z13.literal(true),
|
|
1434
|
+
...NoRequestErrorShape,
|
|
1383
1435
|
controlMode: z13.literal("controller")
|
|
1384
|
-
})
|
|
1436
|
+
}),
|
|
1385
1437
|
z13.object({
|
|
1386
1438
|
type: z13.literal("device_preview_control_claim_response"),
|
|
1387
1439
|
...RequiredRequestIdShape,
|
|
1388
1440
|
scope: PreviewScopeSchema,
|
|
1389
1441
|
leaseId: IdSchema,
|
|
1390
1442
|
success: z13.literal(false),
|
|
1443
|
+
controlMode: z13.never().optional(),
|
|
1391
1444
|
...RequiredRequestErrorShape
|
|
1392
|
-
})
|
|
1445
|
+
})
|
|
1393
1446
|
]);
|
|
1394
1447
|
var SessionPermissionModeSchema = z13.enum([
|
|
1395
1448
|
"default",
|
|
@@ -1437,6 +1490,8 @@ var SessionCreateSchema = z13.discriminatedUnion("mode", [
|
|
|
1437
1490
|
z13.discriminatedUnion("kind", [AgentPtySessionCreateSchema, TerminalSessionCreateSchema])
|
|
1438
1491
|
]);
|
|
1439
1492
|
var SessionCreateSuccessBaseShape = {
|
|
1493
|
+
...NoRequestErrorShape,
|
|
1494
|
+
activeWriterPid: z13.never().optional(),
|
|
1440
1495
|
type: z13.literal("session_create_response"),
|
|
1441
1496
|
...RequiredRequestIdShape,
|
|
1442
1497
|
success: z13.literal(true),
|
|
@@ -1451,8 +1506,9 @@ var SessionCreateSuccessResponseSchema = z13.discriminatedUnion("mode", [
|
|
|
1451
1506
|
...SessionCreateSuccessBaseShape,
|
|
1452
1507
|
kind: z13.literal("agent"),
|
|
1453
1508
|
mode: z13.literal("json"),
|
|
1509
|
+
ptyOwner: z13.never().optional(),
|
|
1454
1510
|
provider: z13.enum(providerValues)
|
|
1455
|
-
})
|
|
1511
|
+
}),
|
|
1456
1512
|
z13.discriminatedUnion("kind", [
|
|
1457
1513
|
z13.object({
|
|
1458
1514
|
...SessionCreateSuccessBaseShape,
|
|
@@ -1460,14 +1516,14 @@ var SessionCreateSuccessResponseSchema = z13.discriminatedUnion("mode", [
|
|
|
1460
1516
|
mode: z13.literal("pty"),
|
|
1461
1517
|
provider: z13.enum(providerValues),
|
|
1462
1518
|
ptyOwner: z13.enum(ptyOwnerValues)
|
|
1463
|
-
})
|
|
1519
|
+
}),
|
|
1464
1520
|
z13.object({
|
|
1465
1521
|
...SessionCreateSuccessBaseShape,
|
|
1466
1522
|
kind: z13.literal("terminal"),
|
|
1467
1523
|
mode: z13.literal("pty"),
|
|
1468
1524
|
provider: z13.literal("claude"),
|
|
1469
1525
|
ptyOwner: z13.literal("proxy-hosted")
|
|
1470
|
-
})
|
|
1526
|
+
})
|
|
1471
1527
|
])
|
|
1472
1528
|
]);
|
|
1473
1529
|
var SessionCreateResponseSchema = z13.discriminatedUnion("success", [
|
|
@@ -1476,18 +1532,27 @@ var SessionCreateResponseSchema = z13.discriminatedUnion("success", [
|
|
|
1476
1532
|
type: z13.literal("session_create_response"),
|
|
1477
1533
|
...RequiredRequestIdShape,
|
|
1478
1534
|
success: z13.literal(false),
|
|
1535
|
+
sessionId: z13.never().optional(),
|
|
1536
|
+
cwd: z13.never().optional(),
|
|
1537
|
+
lastActive: z13.never().optional(),
|
|
1538
|
+
name: z13.never().optional(),
|
|
1539
|
+
nameLocked: z13.never().optional(),
|
|
1540
|
+
kind: z13.never().optional(),
|
|
1541
|
+
mode: z13.never().optional(),
|
|
1542
|
+
provider: z13.never().optional(),
|
|
1543
|
+
ptyOwner: z13.never().optional(),
|
|
1479
1544
|
...RequiredRequestErrorShape,
|
|
1480
1545
|
activeWriterPid: z13.number().int().positive().optional()
|
|
1481
|
-
})
|
|
1546
|
+
})
|
|
1482
1547
|
]);
|
|
1483
1548
|
var relayControlDefinitions = [
|
|
1484
|
-
|
|
1549
|
+
control("proxy_register", {
|
|
1485
1550
|
protocolVersion: z13.literal(RELAY_CONTROL_PROTOCOL_VERSION),
|
|
1486
1551
|
proxyId: IdSchema,
|
|
1487
1552
|
name: z13.string().optional(),
|
|
1488
1553
|
proxyVersion: z13.string().min(1).max(64)
|
|
1489
1554
|
}),
|
|
1490
|
-
|
|
1555
|
+
control("proxy_register_response", {
|
|
1491
1556
|
protocolVersion: z13.literal(RELAY_CONTROL_PROTOCOL_VERSION),
|
|
1492
1557
|
status: z13.enum(["new", "reconnected"]),
|
|
1493
1558
|
relayVersion: z13.string().min(1).max(64),
|
|
@@ -1713,7 +1778,7 @@ var relayControlDefinitions = [
|
|
|
1713
1778
|
}, "client_to_proxy"),
|
|
1714
1779
|
controlSchema("preview_create_response", PreviewCreateResponseSchema, "proxy_to_client"),
|
|
1715
1780
|
strictControl("preview_list_request", { ...RequiredRequestIdShape, scope: PreviewScopeSchema }, "client_to_proxy"),
|
|
1716
|
-
|
|
1781
|
+
control("preview_list_response", {
|
|
1717
1782
|
...RequiredRequestIdShape,
|
|
1718
1783
|
scope: PreviewScopeSchema,
|
|
1719
1784
|
epoch: IdSchema,
|
|
@@ -1742,23 +1807,23 @@ var relayControlDefinitions = [
|
|
|
1742
1807
|
previewId: IdSchema
|
|
1743
1808
|
}, "client_to_proxy"),
|
|
1744
1809
|
controlSchema("preview_close_response", PreviewCloseResponseSchema, "proxy_to_client"),
|
|
1745
|
-
|
|
1810
|
+
control("preview_state_event", {
|
|
1746
1811
|
epoch: IdSchema,
|
|
1747
1812
|
revision: z13.number().int().nonnegative(),
|
|
1748
1813
|
preview: PreviewSummarySchema
|
|
1749
1814
|
}),
|
|
1750
|
-
|
|
1815
|
+
control("preview_removed_event", {
|
|
1751
1816
|
epoch: IdSchema,
|
|
1752
1817
|
revision: z13.number().int().nonnegative(),
|
|
1753
1818
|
previewId: IdSchema
|
|
1754
1819
|
}),
|
|
1755
|
-
|
|
1820
|
+
control("preview_state_push", {
|
|
1756
1821
|
scope: PreviewScopeSchema,
|
|
1757
1822
|
epoch: IdSchema,
|
|
1758
1823
|
revision: z13.number().int().nonnegative(),
|
|
1759
1824
|
preview: PreviewSummarySchema
|
|
1760
1825
|
}, "proxy_to_client"),
|
|
1761
|
-
|
|
1826
|
+
control("preview_removed_push", {
|
|
1762
1827
|
scope: PreviewScopeSchema,
|
|
1763
1828
|
epoch: IdSchema,
|
|
1764
1829
|
revision: z13.number().int().nonnegative(),
|
|
@@ -1788,7 +1853,7 @@ var relayControlDefinitions = [
|
|
|
1788
1853
|
}, "client_to_proxy"),
|
|
1789
1854
|
controlSchema("device_preview_create_response", DevicePreviewCreateResponseSchema, "proxy_to_client"),
|
|
1790
1855
|
strictControl("device_preview_list_request", { ...RequiredRequestIdShape, scope: PreviewScopeSchema }, "client_to_proxy"),
|
|
1791
|
-
|
|
1856
|
+
control("device_preview_list_response", {
|
|
1792
1857
|
...RequiredRequestIdShape,
|
|
1793
1858
|
scope: PreviewScopeSchema,
|
|
1794
1859
|
epoch: IdSchema,
|
|
@@ -1817,23 +1882,23 @@ var relayControlDefinitions = [
|
|
|
1817
1882
|
previewId: IdSchema
|
|
1818
1883
|
}, "client_to_proxy"),
|
|
1819
1884
|
controlSchema("device_preview_close_response", DevicePreviewCloseResponseSchema, "proxy_to_client"),
|
|
1820
|
-
|
|
1885
|
+
control("device_preview_state_event", {
|
|
1821
1886
|
epoch: IdSchema,
|
|
1822
1887
|
revision: z13.number().int().nonnegative(),
|
|
1823
1888
|
preview: DevicePreviewSummarySchema
|
|
1824
1889
|
}),
|
|
1825
|
-
|
|
1890
|
+
control("device_preview_removed_event", {
|
|
1826
1891
|
epoch: IdSchema,
|
|
1827
1892
|
revision: z13.number().int().nonnegative(),
|
|
1828
1893
|
previewId: IdSchema
|
|
1829
1894
|
}),
|
|
1830
|
-
|
|
1895
|
+
control("device_preview_state_push", {
|
|
1831
1896
|
scope: PreviewScopeSchema,
|
|
1832
1897
|
epoch: IdSchema,
|
|
1833
1898
|
revision: z13.number().int().nonnegative(),
|
|
1834
1899
|
preview: DevicePreviewSummarySchema
|
|
1835
1900
|
}, "proxy_to_client"),
|
|
1836
|
-
|
|
1901
|
+
control("device_preview_removed_push", {
|
|
1837
1902
|
scope: PreviewScopeSchema,
|
|
1838
1903
|
epoch: IdSchema,
|
|
1839
1904
|
revision: z13.number().int().nonnegative(),
|
|
@@ -1872,13 +1937,13 @@ var relayControlDefinitions = [
|
|
|
1872
1937
|
leaseId: IdSchema
|
|
1873
1938
|
}),
|
|
1874
1939
|
controlSchema("device_preview_control_claim_response", DevicePreviewControlClaimResponseSchema),
|
|
1875
|
-
|
|
1940
|
+
control("device_preview_control_revoked_push", {
|
|
1876
1941
|
scope: PreviewScopeSchema,
|
|
1877
1942
|
leaseId: IdSchema,
|
|
1878
1943
|
reason: z13.enum(["taken_over", "stream_closed", "proxy_offline", "lease_expired"])
|
|
1879
1944
|
}),
|
|
1880
1945
|
// 客户端注册协议
|
|
1881
|
-
|
|
1946
|
+
control("client_register", {
|
|
1882
1947
|
protocolVersion: z13.literal(RELAY_CONTROL_PROTOCOL_VERSION),
|
|
1883
1948
|
clientId: IdSchema,
|
|
1884
1949
|
userAgent: z13.string().optional(),
|
|
@@ -2402,19 +2467,24 @@ var TerminalSessionCreateRequestSchema = z14.discriminatedUnion("kind", [
|
|
|
2402
2467
|
}).strict()
|
|
2403
2468
|
]);
|
|
2404
2469
|
var TerminalSessionCreateResponseSchema = z14.discriminatedUnion("success", [
|
|
2470
|
+
// Responses may add descriptive fields within the same protocol generation. Validate known
|
|
2471
|
+
// fields and discard extensions, while rejecting fields that contradict the success branch.
|
|
2405
2472
|
z14.object({
|
|
2406
2473
|
type: z14.literal("session_create_response"),
|
|
2407
2474
|
success: z14.literal(true),
|
|
2408
2475
|
sessionId: z14.string().min(1),
|
|
2409
2476
|
protocolVersion: z14.literal(TERMINAL_IPC_PROTOCOL_VERSION),
|
|
2410
|
-
hook: ProviderHookContextSchema.optional()
|
|
2411
|
-
|
|
2477
|
+
hook: ProviderHookContextSchema.optional(),
|
|
2478
|
+
error: z14.never().optional()
|
|
2479
|
+
}),
|
|
2412
2480
|
z14.object({
|
|
2413
2481
|
type: z14.literal("session_create_response"),
|
|
2414
2482
|
success: z14.literal(false),
|
|
2415
2483
|
protocolVersion: z14.literal(TERMINAL_IPC_PROTOCOL_VERSION),
|
|
2416
|
-
error: z14.string().min(1)
|
|
2417
|
-
|
|
2484
|
+
error: z14.string().min(1),
|
|
2485
|
+
sessionId: z14.never().optional(),
|
|
2486
|
+
hook: z14.never().optional()
|
|
2487
|
+
})
|
|
2418
2488
|
]);
|
|
2419
2489
|
var IpcMessageSchema = z14.discriminatedUnion("type", [
|
|
2420
2490
|
// 客户端请求创建新会话,sessionId 可选用于重连时复用
|
|
@@ -2535,20 +2605,21 @@ var IpcMessageSchema = z14.discriminatedUnion("type", [
|
|
|
2535
2605
|
var WorkerMessageSchema = z14.discriminatedUnion("type", [
|
|
2536
2606
|
// worker → serve: every socket connection begins with this protocol and process identity.
|
|
2537
2607
|
// Readiness is reported separately because provider bootstrap can fail after IPC negotiation.
|
|
2608
|
+
// Hello extensions are informational; the required version and identity remain authoritative.
|
|
2538
2609
|
z14.object({
|
|
2539
2610
|
type: z14.literal("worker_protocol_hello"),
|
|
2540
2611
|
protocolVersion: z14.literal(WORKER_IPC_PROTOCOL_VERSION),
|
|
2541
2612
|
sessionId: z14.string().min(1),
|
|
2542
2613
|
provider: z14.enum(providerValues),
|
|
2543
2614
|
pid: z14.number().int().positive().max(Number.MAX_SAFE_INTEGER)
|
|
2544
|
-
})
|
|
2615
|
+
}),
|
|
2545
2616
|
// serve → worker: the worker also rejects a daemon from another IPC generation.
|
|
2546
2617
|
z14.object({
|
|
2547
2618
|
type: z14.literal("serve_protocol_hello"),
|
|
2548
2619
|
protocolVersion: z14.literal(WORKER_IPC_PROTOCOL_VERSION),
|
|
2549
2620
|
sessionId: z14.string().min(1),
|
|
2550
2621
|
pid: z14.number().int().positive().max(Number.MAX_SAFE_INTEGER)
|
|
2551
|
-
})
|
|
2622
|
+
}),
|
|
2552
2623
|
// serve → worker: 发送用户输入给 claude
|
|
2553
2624
|
z14.object({
|
|
2554
2625
|
type: z14.literal("worker_input"),
|
|
@@ -2754,4 +2825,4 @@ export {
|
|
|
2754
2825
|
serializeIpc,
|
|
2755
2826
|
createIpcReader
|
|
2756
2827
|
};
|
|
2757
|
-
//# sourceMappingURL=chunk-
|
|
2828
|
+
//# sourceMappingURL=chunk-GIFG7KAJ.js.map
|