@dev-anywhere/proxy 0.9.3 → 0.9.5

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.
Files changed (39) hide show
  1. package/dist/{autostart-ZQ5YVCZY.js → autostart-XIZTTKSV.js} +96 -22
  2. package/dist/autostart-XIZTTKSV.js.map +1 -0
  3. package/dist/{chunk-25JBQRJI.js → chunk-3KATRUOJ.js} +198 -125
  4. package/dist/chunk-3KATRUOJ.js.map +1 -0
  5. package/dist/{chunk-44SDJYGT.js → chunk-4TXAGHXH.js} +13 -5
  6. package/dist/chunk-4TXAGHXH.js.map +1 -0
  7. package/dist/{chunk-2YUDGRJ6.js → chunk-L2DA7PGQ.js} +2 -2
  8. package/dist/{chunk-HYDXGNKA.js → chunk-N63J6URN.js} +2 -2
  9. package/dist/{chunk-YK2XKOP4.js → chunk-POTR6UPA.js} +2 -1
  10. package/dist/{chunk-H623APEF.js → chunk-Q6EYYC4Z.js} +2 -2
  11. package/dist/{chunk-M72SC32A.js → chunk-QWHC5PEP.js} +4 -4
  12. package/dist/{chunk-GYL5JKWQ.js → chunk-R4SLOZKJ.js} +3 -3
  13. package/dist/{chunk-KWODOJBK.js → chunk-T7N6ALSP.js} +2 -2
  14. package/dist/{chunk-QZ3OZJBG.js → chunk-TMY2OA3C.js} +2 -2
  15. package/dist/index.js +8 -8
  16. package/dist/{logger-B7B64O4P.js → logger-NB7VSWM5.js} +3 -3
  17. package/dist/{relay-token-N3BSBURG.js → relay-token-DJX6KWOT.js} +4 -4
  18. package/dist/serve.js +84 -17
  19. package/dist/serve.js.map +1 -1
  20. package/dist/session-worker.js +4 -4
  21. package/dist/{terminal-PIFFUL2A.js → terminal-ZAWO3GKY.js} +7 -7
  22. package/dist/terminal-worker.js +14 -13
  23. package/dist/terminal-worker.js.map +1 -1
  24. package/dist/update-runner.js +2 -2
  25. package/package.json +3 -3
  26. package/dist/autostart-ZQ5YVCZY.js.map +0 -1
  27. package/dist/chunk-25JBQRJI.js.map +0 -1
  28. package/dist/chunk-44SDJYGT.js.map +0 -1
  29. /package/dist/{chunk-2YUDGRJ6.js.map → chunk-L2DA7PGQ.js.map} +0 -0
  30. /package/dist/{chunk-HYDXGNKA.js.map → chunk-N63J6URN.js.map} +0 -0
  31. /package/dist/{chunk-YK2XKOP4.js.map → chunk-POTR6UPA.js.map} +0 -0
  32. /package/dist/{chunk-H623APEF.js.map → chunk-Q6EYYC4Z.js.map} +0 -0
  33. /package/dist/{chunk-M72SC32A.js.map → chunk-QWHC5PEP.js.map} +0 -0
  34. /package/dist/{chunk-GYL5JKWQ.js.map → chunk-R4SLOZKJ.js.map} +0 -0
  35. /package/dist/{chunk-KWODOJBK.js.map → chunk-T7N6ALSP.js.map} +0 -0
  36. /package/dist/{chunk-QZ3OZJBG.js.map → chunk-TMY2OA3C.js.map} +0 -0
  37. /package/dist/{logger-B7B64O4P.js.map → logger-NB7VSWM5.js.map} +0 -0
  38. /package/dist/{relay-token-N3BSBURG.js.map → relay-token-DJX6KWOT.js.map} +0 -0
  39. /package/dist/{terminal-PIFFUL2A.js.map → terminal-ZAWO3GKY.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
- }).strict();
25
+ });
26
26
  var ThinkingPayloadSchema = z2.object({
27
27
  text: z2.string()
28
- }).strict();
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
- }).strict();
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
- }).strict();
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
- }).strict();
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
- }).strict(),
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
- }).strict(),
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
- }).strict()
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
- }).strict();
143
+ });
143
144
  var SessionStatusPayloadSchema = z4.object({
144
145
  sessionId: IdSchema,
145
146
  state: z4.enum(sessionStateValues),
146
147
  lastActive: z4.number()
147
- }).strict();
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({}).strict();
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
- }).strict();
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
- }).strict(),
214
+ }),
210
215
  z6.object({
211
216
  ...SessionedEnvelopeFields,
212
217
  type: z6.literal("thinking"),
213
218
  payload: ThinkingPayloadSchema
214
- }).strict(),
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
- }).strict(),
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
- }).strict(),
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
- }).strict(),
239
+ }),
235
240
  // session (2)
236
241
  // session_list 是全局广播 (列出所有 session), 不绑定具体 sessionId, 不携带该字段。
237
242
  z6.object({
238
- ...BaseEnvelopeFields,
243
+ ...GlobalEnvelopeFields,
239
244
  type: z6.literal("session_list"),
240
245
  payload: SessionListPayloadSchema
241
- }).strict(),
246
+ }),
242
247
  z6.object({
243
248
  ...SessionedEnvelopeFields,
244
249
  type: z6.literal("session_status"),
245
250
  payload: SessionStatusPayloadSchema
246
- }).strict(),
251
+ }),
247
252
  // system (5): 心跳 / 认证 / 同步——全局, 无 sessionId
248
253
  z6.object({
249
- ...BaseEnvelopeFields,
254
+ ...GlobalEnvelopeFields,
250
255
  type: z6.literal("heartbeat"),
251
256
  payload: HeartbeatPayloadSchema
252
- }).strict(),
257
+ }),
253
258
  z6.object({
254
- ...BaseEnvelopeFields,
259
+ ...GlobalEnvelopeFields,
255
260
  type: z6.literal("auth"),
256
261
  payload: AuthPayloadSchema
257
262
  }).strict(),
258
263
  z6.object({
259
- ...BaseEnvelopeFields,
264
+ ...GlobalEnvelopeFields,
260
265
  type: z6.literal("sync_request"),
261
266
  payload: SyncRequestPayloadSchema
262
267
  }).strict(),
263
268
  z6.object({
264
- ...BaseEnvelopeFields,
269
+ ...GlobalEnvelopeFields,
265
270
  type: z6.literal("sync_response"),
266
271
  payload: SyncResponsePayloadSchema
267
- }).strict()
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
- }).strict();
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
- }).strict();
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
- }).strict();
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
- }).strict(),
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
- }).strict()
495
+ })
488
496
  ]);
489
497
  var WebPreviewCapabilitySchema = z10.object({
490
498
  cloudflared: WebPreviewTunnelStatusSchema,
491
499
  cpolar: WebPreviewTunnelStatusSchema
492
- }).strict();
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
- }).strict(),
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
- }).strict()
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
- }).strict(),
550
+ }),
540
551
  PreviewSummaryBaseSchema.extend({
541
552
  state: z10.literal("ready"),
542
553
  publicUrl: PublicPreviewUrlSchema,
543
554
  error: z10.never().optional()
544
- }).strict(),
555
+ }),
545
556
  PreviewSummaryBaseSchema.extend({
546
557
  state: z10.literal("disconnected"),
547
558
  ...PreviewSummaryInactiveShape
548
- }).strict(),
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
- }).strict(),
564
+ }),
554
565
  PreviewSummaryBaseSchema.extend({
555
566
  state: z10.literal("stopping"),
556
567
  ...PreviewSummaryInactiveShape
557
- }).strict()
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
- }).strict(),
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
- }).strict(),
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
- }).strict()
629
+ })
619
630
  ]);
620
631
  var DevicePreviewCapabilitySchema = z11.object({
621
632
  ios: DevicePreviewToolStatusSchema,
622
633
  android: DevicePreviewToolStatusSchema
623
- }).strict();
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
- }).strict(),
648
+ }),
638
649
  DevicePreviewTargetBaseSchema.extend({
639
650
  width: z11.never().optional(),
640
651
  height: z11.never().optional()
641
- }).strict()
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
- }).strict(),
670
+ }),
660
671
  DevicePreviewSummaryBaseSchema.extend({
661
672
  state: z11.literal("disconnected"),
662
673
  error: z11.never().optional()
663
- }).strict()
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
- }).strict();
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
- }).strict(),
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
- }).strict()
741
+ })
730
742
  ]);
731
743
  var DevicePreviewStreamFlowBaseSchema = z11.object({
732
744
  type: z11.literal("device_preview_stream_flow"),
@@ -914,6 +926,7 @@ var RELAY_CONTROL_PROTOCOL_VERSION = 1;
914
926
  var ProxyInfoSchema = z13.object({
915
927
  proxyId: IdSchema,
916
928
  name: z13.string().optional(),
929
+ osName: z13.string().min(1).max(64).optional(),
917
930
  version: z13.string().min(1).max(64),
918
931
  online: z13.boolean(),
919
932
  sessions: z13.array(z13.string())
@@ -988,6 +1001,10 @@ var RequestErrorShape = {
988
1001
  error: z13.string().optional(),
989
1002
  errorCode: ControlErrorCodeSchema.optional()
990
1003
  };
1004
+ var NoRequestErrorShape = {
1005
+ error: z13.never().optional(),
1006
+ errorCode: z13.never().optional()
1007
+ };
991
1008
  var RequiredRequestErrorShape = {
992
1009
  error: z13.string().min(1),
993
1010
  errorCode: ControlErrorCodeSchema
@@ -1026,15 +1043,18 @@ var ProxySelectResponseSchema = z13.discriminatedUnion("success", [
1026
1043
  type: z13.literal("proxy_select_response"),
1027
1044
  ...RequestIdShape,
1028
1045
  success: z13.literal(true),
1046
+ ...NoRequestErrorShape,
1029
1047
  proxyId: IdSchema,
1030
1048
  bindingId: IdSchema
1031
- }).strict(),
1049
+ }),
1032
1050
  z13.object({
1033
1051
  type: z13.literal("proxy_select_response"),
1034
1052
  ...RequestIdShape,
1035
1053
  success: z13.literal(false),
1054
+ proxyId: z13.never().optional(),
1055
+ bindingId: z13.never().optional(),
1036
1056
  ...RequestErrorShape
1037
- }).strict()
1057
+ })
1038
1058
  ]);
1039
1059
  var ClientRegisterResponseSchema = z13.discriminatedUnion("status", [
1040
1060
  z13.object({
@@ -1043,19 +1063,22 @@ var ClientRegisterResponseSchema = z13.discriminatedUnion("status", [
1043
1063
  status: z13.literal("restored"),
1044
1064
  proxyId: IdSchema,
1045
1065
  bindingId: IdSchema
1046
- }).strict(),
1066
+ }),
1047
1067
  z13.object({
1048
1068
  type: z13.literal("client_register_response"),
1049
1069
  protocolVersion: z13.literal(RELAY_CONTROL_PROTOCOL_VERSION),
1050
1070
  status: z13.literal("proxy_offline"),
1051
1071
  proxyId: IdSchema,
1052
1072
  bindingId: IdSchema
1053
- }).strict(),
1073
+ }),
1054
1074
  z13.object({
1055
1075
  type: z13.literal("client_register_response"),
1056
1076
  protocolVersion: z13.literal(RELAY_CONTROL_PROTOCOL_VERSION),
1057
- status: z13.literal("new")
1058
- }).strict()
1077
+ status: z13.literal("new"),
1078
+ // 已知的绑定字段不能作为扩展信息被忽略;new 状态明确表示尚未绑定。
1079
+ proxyId: z13.never().optional(),
1080
+ bindingId: z13.never().optional()
1081
+ })
1059
1082
  ]);
1060
1083
  var PreviewCreateResponseSchema = z13.discriminatedUnion("accepted", [
1061
1084
  z13.object({
@@ -1064,16 +1087,18 @@ var PreviewCreateResponseSchema = z13.discriminatedUnion("accepted", [
1064
1087
  scope: PreviewScopeSchema,
1065
1088
  operationId: IdSchema,
1066
1089
  accepted: z13.literal(true),
1090
+ ...NoRequestErrorShape,
1067
1091
  previewId: IdSchema
1068
- }).strict(),
1092
+ }),
1069
1093
  z13.object({
1070
1094
  type: z13.literal("preview_create_response"),
1071
1095
  ...RequiredRequestIdShape,
1072
1096
  scope: PreviewScopeSchema,
1073
1097
  operationId: IdSchema,
1074
1098
  accepted: z13.literal(false),
1099
+ previewId: z13.never().optional(),
1075
1100
  ...RequiredRequestErrorShape
1076
- }).strict()
1101
+ })
1077
1102
  ]);
1078
1103
  var DevicePreviewCreateResponseSchema = z13.discriminatedUnion("accepted", [
1079
1104
  z13.object({
@@ -1082,16 +1107,18 @@ var DevicePreviewCreateResponseSchema = z13.discriminatedUnion("accepted", [
1082
1107
  scope: PreviewScopeSchema,
1083
1108
  operationId: IdSchema,
1084
1109
  accepted: z13.literal(true),
1110
+ ...NoRequestErrorShape,
1085
1111
  previewId: IdSchema
1086
- }).strict(),
1112
+ }),
1087
1113
  z13.object({
1088
1114
  type: z13.literal("device_preview_create_response"),
1089
1115
  ...RequiredRequestIdShape,
1090
1116
  scope: PreviewScopeSchema,
1091
1117
  operationId: IdSchema,
1092
1118
  accepted: z13.literal(false),
1119
+ previewId: z13.never().optional(),
1093
1120
  ...RequiredRequestErrorShape
1094
- }).strict()
1121
+ })
1095
1122
  ]);
1096
1123
  var PreviewCapabilityResponseSchema = z13.discriminatedUnion("success", [
1097
1124
  z13.object({
@@ -1099,15 +1126,17 @@ var PreviewCapabilityResponseSchema = z13.discriminatedUnion("success", [
1099
1126
  ...RequiredRequestIdShape,
1100
1127
  scope: PreviewScopeSchema,
1101
1128
  success: z13.literal(true),
1129
+ ...NoRequestErrorShape,
1102
1130
  capability: WebPreviewCapabilitySchema
1103
- }).strict(),
1131
+ }),
1104
1132
  z13.object({
1105
1133
  type: z13.literal("preview_capability_response"),
1106
1134
  ...RequiredRequestIdShape,
1107
1135
  scope: PreviewScopeSchema,
1108
1136
  success: z13.literal(false),
1137
+ capability: z13.never().optional(),
1109
1138
  ...RequiredRequestErrorShape
1110
- }).strict()
1139
+ })
1111
1140
  ]);
1112
1141
  var DevicePreviewCapabilityResponseSchema = z13.discriminatedUnion("success", [
1113
1142
  z13.object({
@@ -1115,15 +1144,17 @@ var DevicePreviewCapabilityResponseSchema = z13.discriminatedUnion("success", [
1115
1144
  ...RequiredRequestIdShape,
1116
1145
  scope: PreviewScopeSchema,
1117
1146
  success: z13.literal(true),
1147
+ ...NoRequestErrorShape,
1118
1148
  capability: DevicePreviewCapabilitySchema
1119
- }).strict(),
1149
+ }),
1120
1150
  z13.object({
1121
1151
  type: z13.literal("device_preview_capability_response"),
1122
1152
  ...RequiredRequestIdShape,
1123
1153
  scope: PreviewScopeSchema,
1124
1154
  success: z13.literal(false),
1155
+ capability: z13.never().optional(),
1125
1156
  ...RequiredRequestErrorShape
1126
- }).strict()
1157
+ })
1127
1158
  ]);
1128
1159
  var ProxyInfoRequestSchema = z13.object({
1129
1160
  type: z13.literal("proxy_info_request"),
@@ -1134,23 +1165,26 @@ var ProxyInfoResponseSchema = z13.object({
1134
1165
  ...RequestIdShape,
1135
1166
  homePath: z13.string(),
1136
1167
  agentCli: AgentCliStatusSchema
1137
- }).strict();
1168
+ });
1138
1169
  var PreviewStaticInspectResponseSchema = z13.discriminatedUnion("success", [
1139
1170
  z13.object({
1140
1171
  type: z13.literal("preview_static_inspect_response"),
1141
1172
  ...RequiredRequestIdShape,
1142
1173
  scope: PreviewScopeSchema,
1143
1174
  success: z13.literal(true),
1175
+ ...NoRequestErrorShape,
1144
1176
  entryPath: WebPreviewPathSchema.optional(),
1145
1177
  htmlEntries: PreviewHtmlEntriesSchema
1146
- }).strict(),
1178
+ }),
1147
1179
  z13.object({
1148
1180
  type: z13.literal("preview_static_inspect_response"),
1149
1181
  ...RequiredRequestIdShape,
1150
1182
  scope: PreviewScopeSchema,
1151
1183
  success: z13.literal(false),
1184
+ entryPath: z13.never().optional(),
1185
+ htmlEntries: z13.never().optional(),
1152
1186
  ...RequiredRequestErrorShape
1153
- }).strict()
1187
+ })
1154
1188
  ]);
1155
1189
  var PreviewRenameResponseSchema = z13.discriminatedUnion("success", [
1156
1190
  z13.object({
@@ -1159,8 +1193,9 @@ var PreviewRenameResponseSchema = z13.discriminatedUnion("success", [
1159
1193
  scope: PreviewScopeSchema,
1160
1194
  operationId: IdSchema,
1161
1195
  previewId: IdSchema,
1162
- success: z13.literal(true)
1163
- }).strict(),
1196
+ success: z13.literal(true),
1197
+ ...NoRequestErrorShape
1198
+ }),
1164
1199
  z13.object({
1165
1200
  type: z13.literal("preview_rename_response"),
1166
1201
  ...RequiredRequestIdShape,
@@ -1169,7 +1204,7 @@ var PreviewRenameResponseSchema = z13.discriminatedUnion("success", [
1169
1204
  previewId: IdSchema,
1170
1205
  success: z13.literal(false),
1171
1206
  ...RequiredRequestErrorShape
1172
- }).strict()
1207
+ })
1173
1208
  ]);
1174
1209
  var PreviewReconnectResponseSchema = z13.discriminatedUnion("success", [
1175
1210
  z13.object({
@@ -1178,8 +1213,9 @@ var PreviewReconnectResponseSchema = z13.discriminatedUnion("success", [
1178
1213
  scope: PreviewScopeSchema,
1179
1214
  operationId: IdSchema,
1180
1215
  previewId: IdSchema,
1181
- success: z13.literal(true)
1182
- }).strict(),
1216
+ success: z13.literal(true),
1217
+ ...NoRequestErrorShape
1218
+ }),
1183
1219
  z13.object({
1184
1220
  type: z13.literal("preview_reconnect_response"),
1185
1221
  ...RequiredRequestIdShape,
@@ -1188,7 +1224,7 @@ var PreviewReconnectResponseSchema = z13.discriminatedUnion("success", [
1188
1224
  previewId: IdSchema,
1189
1225
  success: z13.literal(false),
1190
1226
  ...RequiredRequestErrorShape
1191
- }).strict()
1227
+ })
1192
1228
  ]);
1193
1229
  var PreviewCloseResponseSchema = z13.discriminatedUnion("success", [
1194
1230
  z13.object({
@@ -1197,8 +1233,9 @@ var PreviewCloseResponseSchema = z13.discriminatedUnion("success", [
1197
1233
  scope: PreviewScopeSchema,
1198
1234
  operationId: IdSchema,
1199
1235
  previewId: IdSchema,
1200
- success: z13.literal(true)
1201
- }).strict(),
1236
+ success: z13.literal(true),
1237
+ ...NoRequestErrorShape
1238
+ }),
1202
1239
  z13.object({
1203
1240
  type: z13.literal("preview_close_response"),
1204
1241
  ...RequiredRequestIdShape,
@@ -1207,7 +1244,7 @@ var PreviewCloseResponseSchema = z13.discriminatedUnion("success", [
1207
1244
  previewId: IdSchema,
1208
1245
  success: z13.literal(false),
1209
1246
  ...RequiredRequestErrorShape
1210
- }).strict()
1247
+ })
1211
1248
  ]);
1212
1249
  var DevicePreviewTargetsResponseSchema = z13.discriminatedUnion("success", [
1213
1250
  z13.object({
@@ -1215,15 +1252,17 @@ var DevicePreviewTargetsResponseSchema = z13.discriminatedUnion("success", [
1215
1252
  ...RequiredRequestIdShape,
1216
1253
  scope: PreviewScopeSchema,
1217
1254
  success: z13.literal(true),
1255
+ ...NoRequestErrorShape,
1218
1256
  targets: z13.array(DevicePreviewTargetSchema).max(1024)
1219
- }).strict(),
1257
+ }),
1220
1258
  z13.object({
1221
1259
  type: z13.literal("device_preview_targets_response"),
1222
1260
  ...RequiredRequestIdShape,
1223
1261
  scope: PreviewScopeSchema,
1224
1262
  success: z13.literal(false),
1263
+ targets: z13.never().optional(),
1225
1264
  ...RequiredRequestErrorShape
1226
- }).strict()
1265
+ })
1227
1266
  ]);
1228
1267
  var DevicePreviewRenameResponseSchema = z13.discriminatedUnion("success", [
1229
1268
  z13.object({
@@ -1232,8 +1271,9 @@ var DevicePreviewRenameResponseSchema = z13.discriminatedUnion("success", [
1232
1271
  scope: PreviewScopeSchema,
1233
1272
  operationId: IdSchema,
1234
1273
  previewId: IdSchema,
1235
- success: z13.literal(true)
1236
- }).strict(),
1274
+ success: z13.literal(true),
1275
+ ...NoRequestErrorShape
1276
+ }),
1237
1277
  z13.object({
1238
1278
  type: z13.literal("device_preview_rename_response"),
1239
1279
  ...RequiredRequestIdShape,
@@ -1242,7 +1282,7 @@ var DevicePreviewRenameResponseSchema = z13.discriminatedUnion("success", [
1242
1282
  previewId: IdSchema,
1243
1283
  success: z13.literal(false),
1244
1284
  ...RequiredRequestErrorShape
1245
- }).strict()
1285
+ })
1246
1286
  ]);
1247
1287
  var DevicePreviewReconnectResponseSchema = z13.discriminatedUnion("success", [
1248
1288
  z13.object({
@@ -1251,8 +1291,9 @@ var DevicePreviewReconnectResponseSchema = z13.discriminatedUnion("success", [
1251
1291
  scope: PreviewScopeSchema,
1252
1292
  operationId: IdSchema,
1253
1293
  previewId: IdSchema,
1254
- success: z13.literal(true)
1255
- }).strict(),
1294
+ success: z13.literal(true),
1295
+ ...NoRequestErrorShape
1296
+ }),
1256
1297
  z13.object({
1257
1298
  type: z13.literal("device_preview_reconnect_response"),
1258
1299
  ...RequiredRequestIdShape,
@@ -1261,7 +1302,7 @@ var DevicePreviewReconnectResponseSchema = z13.discriminatedUnion("success", [
1261
1302
  previewId: IdSchema,
1262
1303
  success: z13.literal(false),
1263
1304
  ...RequiredRequestErrorShape
1264
- }).strict()
1305
+ })
1265
1306
  ]);
1266
1307
  var DevicePreviewCloseResponseSchema = z13.discriminatedUnion("success", [
1267
1308
  z13.object({
@@ -1270,8 +1311,9 @@ var DevicePreviewCloseResponseSchema = z13.discriminatedUnion("success", [
1270
1311
  scope: PreviewScopeSchema,
1271
1312
  operationId: IdSchema,
1272
1313
  previewId: IdSchema,
1273
- success: z13.literal(true)
1274
- }).strict(),
1314
+ success: z13.literal(true),
1315
+ ...NoRequestErrorShape
1316
+ }),
1275
1317
  z13.object({
1276
1318
  type: z13.literal("device_preview_close_response"),
1277
1319
  ...RequiredRequestIdShape,
@@ -1280,7 +1322,7 @@ var DevicePreviewCloseResponseSchema = z13.discriminatedUnion("success", [
1280
1322
  previewId: IdSchema,
1281
1323
  success: z13.literal(false),
1282
1324
  ...RequiredRequestErrorShape
1283
- }).strict()
1325
+ })
1284
1326
  ]);
1285
1327
  var DevicePreviewStreamUrlResponseSchema = z13.discriminatedUnion("success", [
1286
1328
  z13.object({
@@ -1289,19 +1331,24 @@ var DevicePreviewStreamUrlResponseSchema = z13.discriminatedUnion("success", [
1289
1331
  scope: PreviewScopeSchema,
1290
1332
  previewId: IdSchema,
1291
1333
  success: z13.literal(true),
1334
+ ...NoRequestErrorShape,
1292
1335
  url: z13.string().min(1).max(4096),
1293
1336
  leaseId: IdSchema,
1294
1337
  expiresAt: z13.number().int().nonnegative(),
1295
1338
  controlMode: z13.enum(["controller", "view_only"])
1296
- }).strict(),
1339
+ }),
1297
1340
  z13.object({
1298
1341
  type: z13.literal("device_preview_stream_url_response"),
1299
1342
  ...RequiredRequestIdShape,
1300
1343
  scope: PreviewScopeSchema,
1301
1344
  previewId: IdSchema,
1302
1345
  success: z13.literal(false),
1346
+ url: z13.never().optional(),
1347
+ leaseId: z13.never().optional(),
1348
+ expiresAt: z13.never().optional(),
1349
+ controlMode: z13.never().optional(),
1303
1350
  ...RequiredRequestErrorShape
1304
- }).strict()
1351
+ })
1305
1352
  ]);
1306
1353
  var DevicePreviewStreamStartResponseBaseShape = {
1307
1354
  type: z13.literal("device_preview_stream_start_response"),
@@ -1312,10 +1359,11 @@ var DevicePreviewStreamStartResponseBaseShape = {
1312
1359
  var DevicePreviewStreamStartSuccessSchema = z13.object({
1313
1360
  ...DevicePreviewStreamStartResponseBaseShape,
1314
1361
  success: z13.literal(true),
1362
+ ...NoRequestErrorShape,
1315
1363
  format: DevicePreviewStreamFormatSchema,
1316
1364
  width: z13.number().int().positive().max(16384).optional(),
1317
1365
  height: z13.number().int().positive().max(16384).optional()
1318
- }).strict().superRefine((response, context) => {
1366
+ }).superRefine((response, context) => {
1319
1367
  if (response.width === void 0 === (response.height === void 0))
1320
1368
  return;
1321
1369
  context.addIssue({
@@ -1329,8 +1377,11 @@ var DevicePreviewStreamStartResponseSchema = z13.discriminatedUnion("success", [
1329
1377
  z13.object({
1330
1378
  ...DevicePreviewStreamStartResponseBaseShape,
1331
1379
  success: z13.literal(false),
1380
+ format: z13.never().optional(),
1381
+ width: z13.never().optional(),
1382
+ height: z13.never().optional(),
1332
1383
  ...RequiredRequestErrorShape
1333
- }).strict()
1384
+ })
1334
1385
  ]);
1335
1386
  var DevicePreviewStreamCompleteSchema = z13.object({
1336
1387
  type: z13.literal("device_preview_stream_complete"),
@@ -1339,7 +1390,7 @@ var DevicePreviewStreamCompleteSchema = z13.object({
1339
1390
  previewId: IdSchema,
1340
1391
  success: z13.literal(false),
1341
1392
  error: z13.string().min(1)
1342
- }).strict();
1393
+ });
1343
1394
  var DevicePreviewStreamStartBaseShape = {
1344
1395
  type: z13.literal("device_preview_stream_start"),
1345
1396
  streamId: IdSchema,
@@ -1362,8 +1413,9 @@ var DevicePreviewInputAckSchema = z13.discriminatedUnion("success", [
1362
1413
  scope: PreviewScopeSchema,
1363
1414
  leaseId: IdSchema,
1364
1415
  inputSeq: z13.number().int().min(0).max(4294967295),
1365
- success: z13.literal(true)
1366
- }).strict(),
1416
+ success: z13.literal(true),
1417
+ ...NoRequestErrorShape
1418
+ }),
1367
1419
  z13.object({
1368
1420
  type: z13.literal("device_preview_input_ack"),
1369
1421
  scope: PreviewScopeSchema,
@@ -1371,7 +1423,7 @@ var DevicePreviewInputAckSchema = z13.discriminatedUnion("success", [
1371
1423
  inputSeq: z13.number().int().min(0).max(4294967295),
1372
1424
  success: z13.literal(false),
1373
1425
  ...RequiredRequestErrorShape
1374
- }).strict()
1426
+ })
1375
1427
  ]);
1376
1428
  var DevicePreviewControlClaimResponseSchema = z13.discriminatedUnion("success", [
1377
1429
  z13.object({
@@ -1380,16 +1432,18 @@ var DevicePreviewControlClaimResponseSchema = z13.discriminatedUnion("success",
1380
1432
  scope: PreviewScopeSchema,
1381
1433
  leaseId: IdSchema,
1382
1434
  success: z13.literal(true),
1435
+ ...NoRequestErrorShape,
1383
1436
  controlMode: z13.literal("controller")
1384
- }).strict(),
1437
+ }),
1385
1438
  z13.object({
1386
1439
  type: z13.literal("device_preview_control_claim_response"),
1387
1440
  ...RequiredRequestIdShape,
1388
1441
  scope: PreviewScopeSchema,
1389
1442
  leaseId: IdSchema,
1390
1443
  success: z13.literal(false),
1444
+ controlMode: z13.never().optional(),
1391
1445
  ...RequiredRequestErrorShape
1392
- }).strict()
1446
+ })
1393
1447
  ]);
1394
1448
  var SessionPermissionModeSchema = z13.enum([
1395
1449
  "default",
@@ -1437,6 +1491,8 @@ var SessionCreateSchema = z13.discriminatedUnion("mode", [
1437
1491
  z13.discriminatedUnion("kind", [AgentPtySessionCreateSchema, TerminalSessionCreateSchema])
1438
1492
  ]);
1439
1493
  var SessionCreateSuccessBaseShape = {
1494
+ ...NoRequestErrorShape,
1495
+ activeWriterPid: z13.never().optional(),
1440
1496
  type: z13.literal("session_create_response"),
1441
1497
  ...RequiredRequestIdShape,
1442
1498
  success: z13.literal(true),
@@ -1451,8 +1507,9 @@ var SessionCreateSuccessResponseSchema = z13.discriminatedUnion("mode", [
1451
1507
  ...SessionCreateSuccessBaseShape,
1452
1508
  kind: z13.literal("agent"),
1453
1509
  mode: z13.literal("json"),
1510
+ ptyOwner: z13.never().optional(),
1454
1511
  provider: z13.enum(providerValues)
1455
- }).strict(),
1512
+ }),
1456
1513
  z13.discriminatedUnion("kind", [
1457
1514
  z13.object({
1458
1515
  ...SessionCreateSuccessBaseShape,
@@ -1460,14 +1517,14 @@ var SessionCreateSuccessResponseSchema = z13.discriminatedUnion("mode", [
1460
1517
  mode: z13.literal("pty"),
1461
1518
  provider: z13.enum(providerValues),
1462
1519
  ptyOwner: z13.enum(ptyOwnerValues)
1463
- }).strict(),
1520
+ }),
1464
1521
  z13.object({
1465
1522
  ...SessionCreateSuccessBaseShape,
1466
1523
  kind: z13.literal("terminal"),
1467
1524
  mode: z13.literal("pty"),
1468
1525
  provider: z13.literal("claude"),
1469
1526
  ptyOwner: z13.literal("proxy-hosted")
1470
- }).strict()
1527
+ })
1471
1528
  ])
1472
1529
  ]);
1473
1530
  var SessionCreateResponseSchema = z13.discriminatedUnion("success", [
@@ -1476,18 +1533,28 @@ var SessionCreateResponseSchema = z13.discriminatedUnion("success", [
1476
1533
  type: z13.literal("session_create_response"),
1477
1534
  ...RequiredRequestIdShape,
1478
1535
  success: z13.literal(false),
1536
+ sessionId: z13.never().optional(),
1537
+ cwd: z13.never().optional(),
1538
+ lastActive: z13.never().optional(),
1539
+ name: z13.never().optional(),
1540
+ nameLocked: z13.never().optional(),
1541
+ kind: z13.never().optional(),
1542
+ mode: z13.never().optional(),
1543
+ provider: z13.never().optional(),
1544
+ ptyOwner: z13.never().optional(),
1479
1545
  ...RequiredRequestErrorShape,
1480
1546
  activeWriterPid: z13.number().int().positive().optional()
1481
- }).strict()
1547
+ })
1482
1548
  ]);
1483
1549
  var relayControlDefinitions = [
1484
- strictControl("proxy_register", {
1550
+ control("proxy_register", {
1485
1551
  protocolVersion: z13.literal(RELAY_CONTROL_PROTOCOL_VERSION),
1486
1552
  proxyId: IdSchema,
1487
1553
  name: z13.string().optional(),
1554
+ osName: z13.string().min(1).max(64).optional(),
1488
1555
  proxyVersion: z13.string().min(1).max(64)
1489
1556
  }),
1490
- strictControl("proxy_register_response", {
1557
+ control("proxy_register_response", {
1491
1558
  protocolVersion: z13.literal(RELAY_CONTROL_PROTOCOL_VERSION),
1492
1559
  status: z13.enum(["new", "reconnected"]),
1493
1560
  relayVersion: z13.string().min(1).max(64),
@@ -1713,7 +1780,7 @@ var relayControlDefinitions = [
1713
1780
  }, "client_to_proxy"),
1714
1781
  controlSchema("preview_create_response", PreviewCreateResponseSchema, "proxy_to_client"),
1715
1782
  strictControl("preview_list_request", { ...RequiredRequestIdShape, scope: PreviewScopeSchema }, "client_to_proxy"),
1716
- strictControl("preview_list_response", {
1783
+ control("preview_list_response", {
1717
1784
  ...RequiredRequestIdShape,
1718
1785
  scope: PreviewScopeSchema,
1719
1786
  epoch: IdSchema,
@@ -1742,23 +1809,23 @@ var relayControlDefinitions = [
1742
1809
  previewId: IdSchema
1743
1810
  }, "client_to_proxy"),
1744
1811
  controlSchema("preview_close_response", PreviewCloseResponseSchema, "proxy_to_client"),
1745
- strictControl("preview_state_event", {
1812
+ control("preview_state_event", {
1746
1813
  epoch: IdSchema,
1747
1814
  revision: z13.number().int().nonnegative(),
1748
1815
  preview: PreviewSummarySchema
1749
1816
  }),
1750
- strictControl("preview_removed_event", {
1817
+ control("preview_removed_event", {
1751
1818
  epoch: IdSchema,
1752
1819
  revision: z13.number().int().nonnegative(),
1753
1820
  previewId: IdSchema
1754
1821
  }),
1755
- strictControl("preview_state_push", {
1822
+ control("preview_state_push", {
1756
1823
  scope: PreviewScopeSchema,
1757
1824
  epoch: IdSchema,
1758
1825
  revision: z13.number().int().nonnegative(),
1759
1826
  preview: PreviewSummarySchema
1760
1827
  }, "proxy_to_client"),
1761
- strictControl("preview_removed_push", {
1828
+ control("preview_removed_push", {
1762
1829
  scope: PreviewScopeSchema,
1763
1830
  epoch: IdSchema,
1764
1831
  revision: z13.number().int().nonnegative(),
@@ -1788,7 +1855,7 @@ var relayControlDefinitions = [
1788
1855
  }, "client_to_proxy"),
1789
1856
  controlSchema("device_preview_create_response", DevicePreviewCreateResponseSchema, "proxy_to_client"),
1790
1857
  strictControl("device_preview_list_request", { ...RequiredRequestIdShape, scope: PreviewScopeSchema }, "client_to_proxy"),
1791
- strictControl("device_preview_list_response", {
1858
+ control("device_preview_list_response", {
1792
1859
  ...RequiredRequestIdShape,
1793
1860
  scope: PreviewScopeSchema,
1794
1861
  epoch: IdSchema,
@@ -1817,23 +1884,23 @@ var relayControlDefinitions = [
1817
1884
  previewId: IdSchema
1818
1885
  }, "client_to_proxy"),
1819
1886
  controlSchema("device_preview_close_response", DevicePreviewCloseResponseSchema, "proxy_to_client"),
1820
- strictControl("device_preview_state_event", {
1887
+ control("device_preview_state_event", {
1821
1888
  epoch: IdSchema,
1822
1889
  revision: z13.number().int().nonnegative(),
1823
1890
  preview: DevicePreviewSummarySchema
1824
1891
  }),
1825
- strictControl("device_preview_removed_event", {
1892
+ control("device_preview_removed_event", {
1826
1893
  epoch: IdSchema,
1827
1894
  revision: z13.number().int().nonnegative(),
1828
1895
  previewId: IdSchema
1829
1896
  }),
1830
- strictControl("device_preview_state_push", {
1897
+ control("device_preview_state_push", {
1831
1898
  scope: PreviewScopeSchema,
1832
1899
  epoch: IdSchema,
1833
1900
  revision: z13.number().int().nonnegative(),
1834
1901
  preview: DevicePreviewSummarySchema
1835
1902
  }, "proxy_to_client"),
1836
- strictControl("device_preview_removed_push", {
1903
+ control("device_preview_removed_push", {
1837
1904
  scope: PreviewScopeSchema,
1838
1905
  epoch: IdSchema,
1839
1906
  revision: z13.number().int().nonnegative(),
@@ -1872,13 +1939,13 @@ var relayControlDefinitions = [
1872
1939
  leaseId: IdSchema
1873
1940
  }),
1874
1941
  controlSchema("device_preview_control_claim_response", DevicePreviewControlClaimResponseSchema),
1875
- strictControl("device_preview_control_revoked_push", {
1942
+ control("device_preview_control_revoked_push", {
1876
1943
  scope: PreviewScopeSchema,
1877
1944
  leaseId: IdSchema,
1878
1945
  reason: z13.enum(["taken_over", "stream_closed", "proxy_offline", "lease_expired"])
1879
1946
  }),
1880
1947
  // 客户端注册协议
1881
- strictControl("client_register", {
1948
+ control("client_register", {
1882
1949
  protocolVersion: z13.literal(RELAY_CONTROL_PROTOCOL_VERSION),
1883
1950
  clientId: IdSchema,
1884
1951
  userAgent: z13.string().optional(),
@@ -2402,19 +2469,24 @@ var TerminalSessionCreateRequestSchema = z14.discriminatedUnion("kind", [
2402
2469
  }).strict()
2403
2470
  ]);
2404
2471
  var TerminalSessionCreateResponseSchema = z14.discriminatedUnion("success", [
2472
+ // Responses may add descriptive fields within the same protocol generation. Validate known
2473
+ // fields and discard extensions, while rejecting fields that contradict the success branch.
2405
2474
  z14.object({
2406
2475
  type: z14.literal("session_create_response"),
2407
2476
  success: z14.literal(true),
2408
2477
  sessionId: z14.string().min(1),
2409
2478
  protocolVersion: z14.literal(TERMINAL_IPC_PROTOCOL_VERSION),
2410
- hook: ProviderHookContextSchema.optional()
2411
- }).strict(),
2479
+ hook: ProviderHookContextSchema.optional(),
2480
+ error: z14.never().optional()
2481
+ }),
2412
2482
  z14.object({
2413
2483
  type: z14.literal("session_create_response"),
2414
2484
  success: z14.literal(false),
2415
2485
  protocolVersion: z14.literal(TERMINAL_IPC_PROTOCOL_VERSION),
2416
- error: z14.string().min(1)
2417
- }).strict()
2486
+ error: z14.string().min(1),
2487
+ sessionId: z14.never().optional(),
2488
+ hook: z14.never().optional()
2489
+ })
2418
2490
  ]);
2419
2491
  var IpcMessageSchema = z14.discriminatedUnion("type", [
2420
2492
  // 客户端请求创建新会话,sessionId 可选用于重连时复用
@@ -2535,20 +2607,21 @@ var IpcMessageSchema = z14.discriminatedUnion("type", [
2535
2607
  var WorkerMessageSchema = z14.discriminatedUnion("type", [
2536
2608
  // worker → serve: every socket connection begins with this protocol and process identity.
2537
2609
  // Readiness is reported separately because provider bootstrap can fail after IPC negotiation.
2610
+ // Hello extensions are informational; the required version and identity remain authoritative.
2538
2611
  z14.object({
2539
2612
  type: z14.literal("worker_protocol_hello"),
2540
2613
  protocolVersion: z14.literal(WORKER_IPC_PROTOCOL_VERSION),
2541
2614
  sessionId: z14.string().min(1),
2542
2615
  provider: z14.enum(providerValues),
2543
2616
  pid: z14.number().int().positive().max(Number.MAX_SAFE_INTEGER)
2544
- }).strict(),
2617
+ }),
2545
2618
  // serve → worker: the worker also rejects a daemon from another IPC generation.
2546
2619
  z14.object({
2547
2620
  type: z14.literal("serve_protocol_hello"),
2548
2621
  protocolVersion: z14.literal(WORKER_IPC_PROTOCOL_VERSION),
2549
2622
  sessionId: z14.string().min(1),
2550
2623
  pid: z14.number().int().positive().max(Number.MAX_SAFE_INTEGER)
2551
- }).strict(),
2624
+ }),
2552
2625
  // serve → worker: 发送用户输入给 claude
2553
2626
  z14.object({
2554
2627
  type: z14.literal("worker_input"),
@@ -2754,4 +2827,4 @@ export {
2754
2827
  serializeIpc,
2755
2828
  createIpcReader
2756
2829
  };
2757
- //# sourceMappingURL=chunk-25JBQRJI.js.map
2830
+ //# sourceMappingURL=chunk-3KATRUOJ.js.map