@dp-bohrium/widget-cli 0.5.1 → 0.7.0

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.
@@ -72,24 +72,6 @@
72
72
  },
73
73
  "fileReadResult": { "$ref": "#/$defs/FileReadResult" },
74
74
  "fileWriteResult": { "$ref": "#/$defs/FileWriteResult" },
75
- "taskObservationSnapshot": {
76
- "$ref": "#/$defs/TaskObservationSnapshot"
77
- },
78
- "taskObservationEvent": {
79
- "$ref": "#/$defs/TaskObservationEvent"
80
- },
81
- "taskObservationBatch": {
82
- "$ref": "#/$defs/TaskObservationBatch"
83
- },
84
- "taskListField": {
85
- "$ref": "#/$defs/TaskListField"
86
- },
87
- "taskListItem": {
88
- "$ref": "#/$defs/TaskListItem"
89
- },
90
- "taskListPage": {
91
- "$ref": "#/$defs/TaskListPage"
92
- },
93
75
  "toolResultEnvelope": {
94
76
  "$ref": "#/$defs/ToolResultEnvelope"
95
77
  },
@@ -119,6 +101,28 @@
119
101
  },
120
102
  "hostUserServiceRequest": {
121
103
  "$ref": "#/$defs/HostUserServiceRequest"
104
+ },
105
+ "widgetDevelopmentDiagnostic": {
106
+ "$ref": "#/$defs/WidgetDevelopmentDiagnostic"
107
+ },
108
+ "widgetRecoveryContext": { "$ref": "#/$defs/WidgetRecoveryContext" },
109
+ "widgetRecoveryPlan": {
110
+ "$ref": "#/$defs/WidgetRecoveryPlan"
111
+ },
112
+ "widgetRecoveryRule": {
113
+ "$ref": "#/$defs/WidgetRecoveryRule"
114
+ },
115
+ "widgetDevelopmentOffer": {
116
+ "$ref": "#/$defs/WidgetDevelopmentOffer"
117
+ },
118
+ "widgetDevelopmentConnect": {
119
+ "$ref": "#/$defs/WidgetDevelopmentConnect"
120
+ },
121
+ "widgetRenderResult": {
122
+ "$ref": "#/$defs/WidgetRenderResult"
123
+ },
124
+ "widgetDevelopmentMessage": {
125
+ "$ref": "#/$defs/WidgetDevelopmentMessage"
122
126
  }
123
127
  },
124
128
  "$defs": {
@@ -402,190 +406,6 @@
402
406
  }
403
407
  }
404
408
  },
405
- "TaskStatus": {
406
- "description": "Host 投影给 Widget 的统一任务状态。",
407
- "title": "TaskStatus",
408
- "enum": ["queued", "running", "succeeded", "failed", "cancelled", "expired"]
409
- },
410
- "TaskObservationSnapshot": {
411
- "description": "任务观察的当前快照:taskId、status 与 updatedAt;progress、message 可选。",
412
- "title": "TaskObservationSnapshot",
413
- "type": "object",
414
- "additionalProperties": false,
415
- "required": ["taskId", "status", "updatedAt"],
416
- "properties": {
417
- "taskId": {
418
- "type": "string",
419
- "minLength": 1,
420
- "maxLength": 256
421
- },
422
- "status": { "$ref": "#/$defs/TaskStatus" },
423
- "progress": {
424
- "type": "number",
425
- "minimum": 0,
426
- "maximum": 1
427
- },
428
- "message": {
429
- "type": "string",
430
- "maxLength": 1024
431
- },
432
- "updatedAt": {
433
- "type": "string",
434
- "pattern": "^\\d{4}-\\d{2}-\\d{2}T[^ ]+Z$"
435
- }
436
- }
437
- },
438
- "TaskObservationEvent": {
439
- "description": "任务观察流中的单条事件;payload 由服务端裁剪。",
440
- "title": "TaskObservationEvent",
441
- "type": "object",
442
- "additionalProperties": false,
443
- "required": ["id", "type", "occurredAt", "payload"],
444
- "properties": {
445
- "id": {
446
- "type": "string",
447
- "minLength": 1,
448
- "maxLength": 256
449
- },
450
- "type": {
451
- "enum": ["started", "progress", "succeeded", "failed", "cancelled", "expired"]
452
- },
453
- "occurredAt": {
454
- "type": "string",
455
- "pattern": "^\\d{4}-\\d{2}-\\d{2}T[^ ]+Z$"
456
- },
457
- "payload": {
458
- "$ref": "#/$defs/JsonValue"
459
- }
460
- }
461
- },
462
- "TaskObservationBatch": {
463
- "description": "任务观察的一页结果:快照 + 有限事件页 + 游标。",
464
- "title": "TaskObservationBatch",
465
- "type": "object",
466
- "additionalProperties": false,
467
- "required": ["schemaVersion", "taskId", "cursor", "reset", "hasMore", "snapshot", "events"],
468
- "properties": {
469
- "schemaVersion": { "const": 1 },
470
- "taskId": {
471
- "type": "string",
472
- "minLength": 1,
473
- "maxLength": 256
474
- },
475
- "cursor": {
476
- "type": "string",
477
- "minLength": 1,
478
- "maxLength": 256
479
- },
480
- "reset": { "type": "boolean" },
481
- "hasMore": { "type": "boolean" },
482
- "snapshot": { "$ref": "#/$defs/TaskObservationSnapshot" },
483
- "events": {
484
- "type": "array",
485
- "maxItems": 100,
486
- "items": { "$ref": "#/$defs/TaskObservationEvent" }
487
- }
488
- }
489
- },
490
- "TaskListField": {
491
- "description": "任务列表中的受限展示字段;key 是稳定机器键,value 是 Host 裁剪后的展示文本。",
492
- "title": "TaskListField",
493
- "type": "object",
494
- "additionalProperties": false,
495
- "required": ["key", "value"],
496
- "properties": {
497
- "key": {
498
- "description": "展示字段的稳定机器键,例如 machine 或 command。",
499
- "type": "string",
500
- "minLength": 1,
501
- "maxLength": 64,
502
- "pattern": "^[A-Za-z][A-Za-z0-9_.:-]*$"
503
- },
504
- "value": {
505
- "description": "Host 完成授权与裁剪后的展示文本。",
506
- "type": "string",
507
- "maxLength": 16384
508
- }
509
- }
510
- },
511
- "TaskListItem": {
512
- "description": "Host 已授权发现的任务摘要;taskId 是可继续传给 tasks.watch 的不透明引用。",
513
- "title": "TaskListItem",
514
- "type": "object",
515
- "additionalProperties": false,
516
- "required": ["taskId", "kind", "name", "status", "updatedAt", "fields"],
517
- "properties": {
518
- "taskId": {
519
- "description": "可继续传给 tasks.watch 的 Host 不透明任务引用。",
520
- "type": "string",
521
- "minLength": 1,
522
- "maxLength": 256
523
- },
524
- "kind": {
525
- "description": "任务来源类型的稳定机器键。",
526
- "type": "string",
527
- "minLength": 1,
528
- "maxLength": 64,
529
- "pattern": "^[A-Za-z][A-Za-z0-9_.:-]*$"
530
- },
531
- "name": {
532
- "description": "任务的安全展示名称。",
533
- "type": "string",
534
- "minLength": 1,
535
- "maxLength": 256
536
- },
537
- "status": {
538
- "$ref": "#/$defs/TaskStatus"
539
- },
540
- "progress": {
541
- "description": "可选执行进度,取值范围为 0 到 1。",
542
- "type": "number",
543
- "minimum": 0,
544
- "maximum": 1
545
- },
546
- "message": {
547
- "description": "Host 裁剪后的可选状态说明。",
548
- "type": "string",
549
- "maxLength": 1024
550
- },
551
- "updatedAt": {
552
- "description": "任务摘要最后更新时间,使用 UTC ISO 8601 字符串。",
553
- "type": "string",
554
- "pattern": "^\\d{4}-\\d{2}-\\d{2}T[^ ]+Z$"
555
- },
556
- "fields": {
557
- "description": "任务面板可展示的受限附加字段。",
558
- "type": "array",
559
- "maxItems": 32,
560
- "items": { "$ref": "#/$defs/TaskListField" }
561
- }
562
- }
563
- },
564
- "TaskListPage": {
565
- "description": "Host 已授权任务摘要的一页结果;nextCursor 缺失表示当前页已到末尾。",
566
- "title": "TaskListPage",
567
- "type": "object",
568
- "additionalProperties": false,
569
- "required": ["schemaVersion", "tasks"],
570
- "properties": {
571
- "schemaVersion": {
572
- "description": "任务列表页结构版本,当前固定为 1。",
573
- "const": 1
574
- },
575
- "tasks": {
576
- "description": "当前页中 Host 已授权的任务摘要。",
577
- "type": "array",
578
- "maxItems": 100,
579
- "items": { "$ref": "#/$defs/TaskListItem" }
580
- },
581
- "nextCursor": {
582
- "description": "下一页的不透明游标;缺失表示当前列表已到末尾。",
583
- "type": "string",
584
- "minLength": 1,
585
- "maxLength": 512
586
- }
587
- }
588
- },
589
409
  "ToolResultMetric": {
590
410
  "description": "工具结果中的单个指标。",
591
411
  "title": "ToolResultMetric",
@@ -908,42 +728,6 @@
908
728
  }
909
729
  }
910
730
  },
911
- {
912
- "type": "object",
913
- "additionalProperties": false,
914
- "required": ["name", "limits"],
915
- "properties": {
916
- "name": { "const": "tasks.list" },
917
- "limits": {
918
- "type": "object",
919
- "additionalProperties": false,
920
- "required": ["callsPerMinute", "pageSize", "minPollMs"],
921
- "properties": {
922
- "callsPerMinute": { "type": "integer", "minimum": 1, "maximum": 9007199254740991 },
923
- "pageSize": { "type": "integer", "minimum": 1, "maximum": 100 },
924
- "minPollMs": { "type": "integer", "minimum": 1000, "maximum": 60000 }
925
- }
926
- }
927
- }
928
- },
929
- {
930
- "type": "object",
931
- "additionalProperties": false,
932
- "required": ["name", "limits"],
933
- "properties": {
934
- "name": { "const": "tasks.watch" },
935
- "limits": {
936
- "type": "object",
937
- "additionalProperties": false,
938
- "required": ["callsPerMinute", "pageSize", "minPollMs"],
939
- "properties": {
940
- "callsPerMinute": { "type": "integer", "minimum": 1, "maximum": 9007199254740991 },
941
- "pageSize": { "type": "integer", "minimum": 1, "maximum": 100 },
942
- "minPollMs": { "type": "integer", "minimum": 1000, "maximum": 60000 }
943
- }
944
- }
945
- }
946
- },
947
731
  {
948
732
  "type": "object",
949
733
  "additionalProperties": false,
@@ -1362,40 +1146,6 @@
1362
1146
  }
1363
1147
  }
1364
1148
  },
1365
- {
1366
- "type": "object",
1367
- "additionalProperties": false,
1368
- "required": ["operation", "input"],
1369
- "properties": {
1370
- "operation": { "const": "tasks.list" },
1371
- "input": {
1372
- "type": "object",
1373
- "additionalProperties": false,
1374
- "properties": {
1375
- "cursor": { "type": "string", "minLength": 1, "maxLength": 512 },
1376
- "limit": { "type": "integer", "minimum": 1, "maximum": 100 }
1377
- }
1378
- }
1379
- }
1380
- },
1381
- {
1382
- "type": "object",
1383
- "additionalProperties": false,
1384
- "required": ["operation", "input"],
1385
- "properties": {
1386
- "operation": { "const": "tasks.watch" },
1387
- "input": {
1388
- "type": "object",
1389
- "additionalProperties": false,
1390
- "required": ["taskId"],
1391
- "properties": {
1392
- "taskId": { "type": "string", "minLength": 1, "maxLength": 256 },
1393
- "cursor": { "type": "string", "minLength": 1, "maxLength": 256 },
1394
- "limit": { "type": "integer", "minimum": 1, "maximum": 100 }
1395
- }
1396
- }
1397
- }
1398
- },
1399
1149
  {
1400
1150
  "type": "object",
1401
1151
  "additionalProperties": false,
@@ -2869,6 +2619,890 @@
2869
2619
  ]
2870
2620
  }
2871
2621
  }
2622
+ },
2623
+ "WidgetDiagnosticDetail": {
2624
+ "title": "WidgetDiagnosticDetail",
2625
+ "description": "受控字段诊断或工程相对源码位置;不携带原始对象。",
2626
+ "oneOf": [
2627
+ {
2628
+ "type": "object",
2629
+ "additionalProperties": false,
2630
+ "required": [
2631
+ "field"
2632
+ ],
2633
+ "properties": {
2634
+ "field": {
2635
+ "type": "string",
2636
+ "minLength": 1,
2637
+ "maxLength": 128
2638
+ },
2639
+ "expected": {
2640
+ "type": "string",
2641
+ "maxLength": 256
2642
+ },
2643
+ "observed": {
2644
+ "type": "string",
2645
+ "maxLength": 256
2646
+ }
2647
+ }
2648
+ },
2649
+ {
2650
+ "type": "object",
2651
+ "additionalProperties": false,
2652
+ "required": [
2653
+ "file",
2654
+ "line",
2655
+ "column"
2656
+ ],
2657
+ "properties": {
2658
+ "file": {
2659
+ "type": "string",
2660
+ "minLength": 1,
2661
+ "maxLength": 256,
2662
+ "pattern": "^(?!/)(?!.*\\\\)(?!.*:)(?!.*(?:^|/)\\.{1,2}(?:/|$))[^\\u0000-\\u001f]+$"
2663
+ },
2664
+ "line": {
2665
+ "type": "integer",
2666
+ "minimum": 1
2667
+ },
2668
+ "column": {
2669
+ "type": "integer",
2670
+ "minimum": 1
2671
+ },
2672
+ "excerpt": {
2673
+ "type": "string",
2674
+ "minLength": 1,
2675
+ "maxLength": 1024
2676
+ }
2677
+ }
2678
+ }
2679
+ ]
2680
+ },
2681
+ "WidgetDiagnosticIO": {
2682
+ "title": "WidgetDiagnosticIO",
2683
+ "description": "保留 transport、HTTP 与非法响应事实;不包含 URL 或原始响应。",
2684
+ "oneOf": [
2685
+ {
2686
+ "type": "object",
2687
+ "additionalProperties": false,
2688
+ "required": [
2689
+ "kind"
2690
+ ],
2691
+ "properties": {
2692
+ "kind": {
2693
+ "enum": [
2694
+ "transport",
2695
+ "invalid-response"
2696
+ ]
2697
+ },
2698
+ "sourceCode": {
2699
+ "type": "string",
2700
+ "minLength": 1,
2701
+ "maxLength": 96,
2702
+ "pattern": "^[A-Za-z][A-Za-z0-9_.-]*$"
2703
+ }
2704
+ }
2705
+ },
2706
+ {
2707
+ "type": "object",
2708
+ "additionalProperties": false,
2709
+ "required": [
2710
+ "kind",
2711
+ "status"
2712
+ ],
2713
+ "properties": {
2714
+ "kind": {
2715
+ "enum": [
2716
+ "http"
2717
+ ]
2718
+ },
2719
+ "status": {
2720
+ "type": "integer",
2721
+ "minimum": 100,
2722
+ "maximum": 599,
2723
+ "not": { "minimum": 200, "maximum": 299 }
2724
+ },
2725
+ "sourceCode": {
2726
+ "type": "string",
2727
+ "minLength": 1,
2728
+ "maxLength": 96,
2729
+ "pattern": "^[A-Za-z][A-Za-z0-9_.-]*$"
2730
+ }
2731
+ }
2732
+ }
2733
+ ]
2734
+ },
2735
+ "WidgetDevelopmentDiagnostic": {
2736
+ "title": "WidgetDevelopmentDiagnostic",
2737
+ "description": "可信出口的标准诊断;恢复指令和 scope 由宿主另行生成。",
2738
+ "type": "object",
2739
+ "additionalProperties": false,
2740
+ "required": [
2741
+ "schemaVersion",
2742
+ "source",
2743
+ "code",
2744
+ "phase",
2745
+ "operation",
2746
+ "severity",
2747
+ "message"
2748
+ ],
2749
+ "properties": {
2750
+ "schemaVersion": {
2751
+ "const": 1
2752
+ },
2753
+ "source": {
2754
+ "enum": [
2755
+ "sdk",
2756
+ "host",
2757
+ "toolchain"
2758
+ ]
2759
+ },
2760
+ "code": {
2761
+ "type": "string",
2762
+ "minLength": 1,
2763
+ "maxLength": 96,
2764
+ "pattern": "^[A-Za-z][A-Za-z0-9_.-]*$"
2765
+ },
2766
+ "sourceCode": {
2767
+ "type": "string",
2768
+ "minLength": 1,
2769
+ "maxLength": 96,
2770
+ "pattern": "^[A-Za-z][A-Za-z0-9_.-]*$"
2771
+ },
2772
+ "phase": {
2773
+ "enum": [
2774
+ "discovery",
2775
+ "build",
2776
+ "config",
2777
+ "load",
2778
+ "handshake",
2779
+ "render",
2780
+ "update",
2781
+ "capability",
2782
+ "dispose"
2783
+ ]
2784
+ },
2785
+ "sourcePhase": {
2786
+ "type": "string",
2787
+ "minLength": 1,
2788
+ "maxLength": 96,
2789
+ "pattern": "^[A-Za-z][A-Za-z0-9_.-]*$"
2790
+ },
2791
+ "operation": {
2792
+ "type": "string",
2793
+ "minLength": 1,
2794
+ "maxLength": 96,
2795
+ "pattern": "^[A-Za-z][A-Za-z0-9_.-]*$"
2796
+ },
2797
+ "severity": {
2798
+ "enum": [
2799
+ "warning",
2800
+ "request-error",
2801
+ "instance-failure"
2802
+ ]
2803
+ },
2804
+ "message": {
2805
+ "type": "string",
2806
+ "minLength": 1,
2807
+ "maxLength": 1024
2808
+ },
2809
+ "retryable": {
2810
+ "type": "boolean"
2811
+ },
2812
+ "correlationId": { "$ref": "#/$defs/WidgetError/properties/correlationId" },
2813
+ "diagnostics": {
2814
+ "type": "array",
2815
+ "maxItems": 8,
2816
+ "items": {
2817
+ "$ref": "#/$defs/WidgetDiagnosticDetail"
2818
+ }
2819
+ },
2820
+ "io": {
2821
+ "$ref": "#/$defs/WidgetDiagnosticIO"
2822
+ }
2823
+ }
2824
+ },
2825
+ "WidgetRecoveryAction": {
2826
+ "title": "WidgetRecoveryAction",
2827
+ "description": "恢复动作的语义及类型化参数;可信宿主绑定已有工具,不包含任意命令。",
2828
+ "oneOf": [
2829
+ {
2830
+ "type": "object",
2831
+ "additionalProperties": false,
2832
+ "required": [
2833
+ "id",
2834
+ "params"
2835
+ ],
2836
+ "properties": {
2837
+ "id": {
2838
+ "const": "inspect"
2839
+ },
2840
+ "params": {
2841
+ "type": "object",
2842
+ "additionalProperties": false,
2843
+ "required": [
2844
+ "area"
2845
+ ],
2846
+ "properties": {
2847
+ "area": {
2848
+ "enum": [
2849
+ "toolchain",
2850
+ "host-bridge",
2851
+ "configuration",
2852
+ "bundle",
2853
+ "handshake",
2854
+ "render",
2855
+ "capability",
2856
+ "lease",
2857
+ "operation-outcome",
2858
+ "runtime"
2859
+ ]
2860
+ }
2861
+ }
2862
+ }
2863
+ }
2864
+ },
2865
+ {
2866
+ "type": "object",
2867
+ "additionalProperties": false,
2868
+ "required": [
2869
+ "id",
2870
+ "params"
2871
+ ],
2872
+ "properties": {
2873
+ "id": {
2874
+ "const": "wait"
2875
+ },
2876
+ "params": {
2877
+ "type": "object",
2878
+ "additionalProperties": false,
2879
+ "required": [
2880
+ "milestone"
2881
+ ],
2882
+ "properties": {
2883
+ "milestone": {
2884
+ "enum": [
2885
+ "budget-reset",
2886
+ "connection-restored"
2887
+ ]
2888
+ },
2889
+ "retryAfterMs": {
2890
+ "type": "integer",
2891
+ "minimum": 1
2892
+ }
2893
+ }
2894
+ }
2895
+ }
2896
+ },
2897
+ {
2898
+ "type": "object",
2899
+ "additionalProperties": false,
2900
+ "required": [
2901
+ "id",
2902
+ "params"
2903
+ ],
2904
+ "properties": {
2905
+ "id": {
2906
+ "const": "edit-project"
2907
+ },
2908
+ "params": {
2909
+ "type": "object",
2910
+ "additionalProperties": false,
2911
+ "required": [
2912
+ "evidence"
2913
+ ],
2914
+ "properties": {
2915
+ "evidence": {
2916
+ "const": "diagnostics"
2917
+ }
2918
+ }
2919
+ }
2920
+ }
2921
+ },
2922
+ {
2923
+ "type": "object",
2924
+ "additionalProperties": false,
2925
+ "required": [
2926
+ "id",
2927
+ "params"
2928
+ ],
2929
+ "properties": {
2930
+ "id": {
2931
+ "const": "build-project"
2932
+ },
2933
+ "params": {
2934
+ "type": "object",
2935
+ "additionalProperties": false,
2936
+ "required": [
2937
+ "target"
2938
+ ],
2939
+ "properties": {
2940
+ "target": {
2941
+ "const": "current-project"
2942
+ }
2943
+ }
2944
+ }
2945
+ }
2946
+ },
2947
+ {
2948
+ "type": "object",
2949
+ "additionalProperties": false,
2950
+ "required": [
2951
+ "id",
2952
+ "params"
2953
+ ],
2954
+ "properties": {
2955
+ "id": {
2956
+ "const": "refresh-preview"
2957
+ },
2958
+ "params": {
2959
+ "type": "object",
2960
+ "additionalProperties": false,
2961
+ "required": [
2962
+ "target"
2963
+ ],
2964
+ "properties": {
2965
+ "target": {
2966
+ "const": "current-project"
2967
+ }
2968
+ }
2969
+ }
2970
+ }
2971
+ },
2972
+ {
2973
+ "type": "object",
2974
+ "additionalProperties": false,
2975
+ "required": [
2976
+ "id",
2977
+ "params"
2978
+ ],
2979
+ "properties": {
2980
+ "id": {
2981
+ "const": "verify-scenario"
2982
+ },
2983
+ "params": {
2984
+ "type": "object",
2985
+ "additionalProperties": false,
2986
+ "required": [
2987
+ "target"
2988
+ ],
2989
+ "properties": {
2990
+ "target": {
2991
+ "enum": [
2992
+ "current-attempt",
2993
+ "next-built-generation"
2994
+ ]
2995
+ },
2996
+ "scenarioId": {
2997
+ "type": "string",
2998
+ "minLength": 1,
2999
+ "maxLength": 96,
3000
+ "pattern": "^[A-Za-z][A-Za-z0-9_.-]*$"
3001
+ }
3002
+ }
3003
+ }
3004
+ }
3005
+ },
3006
+ {
3007
+ "type": "object",
3008
+ "additionalProperties": false,
3009
+ "required": [
3010
+ "id",
3011
+ "params"
3012
+ ],
3013
+ "properties": {
3014
+ "id": {
3015
+ "const": "request-external-action"
3016
+ },
3017
+ "params": {
3018
+ "type": "object",
3019
+ "additionalProperties": false,
3020
+ "required": [
3021
+ "reason"
3022
+ ],
3023
+ "properties": {
3024
+ "reason": {
3025
+ "enum": [
3026
+ "authorization",
3027
+ "host-support",
3028
+ "host-start",
3029
+ "credentials"
3030
+ ]
3031
+ }
3032
+ }
3033
+ }
3034
+ }
3035
+ },
3036
+ {
3037
+ "type": "object",
3038
+ "additionalProperties": false,
3039
+ "required": [
3040
+ "id",
3041
+ "params"
3042
+ ],
3043
+ "properties": {
3044
+ "id": {
3045
+ "const": "stop-preview"
3046
+ },
3047
+ "params": {
3048
+ "type": "object",
3049
+ "additionalProperties": false,
3050
+ "required": [
3051
+ "target"
3052
+ ],
3053
+ "properties": {
3054
+ "target": {
3055
+ "const": "current-preview"
3056
+ }
3057
+ }
3058
+ }
3059
+ }
3060
+ }
3061
+ ]
3062
+ },
3063
+ "WidgetRecoveryVerification": {
3064
+ "title": "WidgetRecoveryVerification",
3065
+ "description": "恢复复验目标;下一成功构建须在取得回执后绑定实际产物。",
3066
+ "type": "object",
3067
+ "additionalProperties": false,
3068
+ "required": [
3069
+ "target",
3070
+ "milestone"
3071
+ ],
3072
+ "properties": {
3073
+ "target": {
3074
+ "enum": [
3075
+ "current-attempt",
3076
+ "next-built-generation",
3077
+ "original-operation"
3078
+ ]
3079
+ },
3080
+ "milestone": {
3081
+ "enum": [
3082
+ "diagnostics-updated",
3083
+ "render-handled",
3084
+ "scenario-passed",
3085
+ "operation-confirmed"
3086
+ ]
3087
+ },
3088
+ "scenarioId": {
3089
+ "type": "string",
3090
+ "minLength": 1,
3091
+ "maxLength": 96,
3092
+ "pattern": "^[A-Za-z][A-Za-z0-9_.-]*$"
3093
+ }
3094
+ }
3095
+ },
3096
+ "WidgetRecoveryPlan": {
3097
+ "title": "WidgetRecoveryPlan",
3098
+ "description": "可信宿主选择的恢复计划;不能由 Guest 的诊断 payload 指定。",
3099
+ "type": "object",
3100
+ "additionalProperties": false,
3101
+ "required": [
3102
+ "schemaVersion",
3103
+ "ruleId",
3104
+ "ruleVersion",
3105
+ "disposition",
3106
+ "nextAction",
3107
+ "verification",
3108
+ "guidance",
3109
+ "followUpActions"
3110
+ ],
3111
+ "properties": {
3112
+ "progress": { "$ref": "#/$defs/WidgetRecoveryProgress" },
3113
+ "schemaVersion": {
3114
+ "const": 1
3115
+ },
3116
+ "ruleId": {
3117
+ "type": "string",
3118
+ "minLength": 1,
3119
+ "maxLength": 96,
3120
+ "pattern": "^[A-Za-z][A-Za-z0-9_.-]*$"
3121
+ },
3122
+ "ruleVersion": {
3123
+ "type": "integer",
3124
+ "minimum": 1
3125
+ },
3126
+ "disposition": {
3127
+ "enum": [
3128
+ "retry",
3129
+ "repair",
3130
+ "inspect",
3131
+ "external-action",
3132
+ "stop"
3133
+ ]
3134
+ },
3135
+ "nextAction": {
3136
+ "$ref": "#/$defs/WidgetRecoveryAction"
3137
+ },
3138
+ "verification": {
3139
+ "$ref": "#/$defs/WidgetRecoveryVerification"
3140
+ },
3141
+ "guidance": {
3142
+ "type": "string",
3143
+ "minLength": 1,
3144
+ "maxLength": 4096
3145
+ },
3146
+ "followUpActions": {
3147
+ "description": "首项动作完成后的有限恢复步骤;宿主逐步验证前置条件,不原样盲目重放。",
3148
+ "type": "array",
3149
+ "maxItems": 8,
3150
+ "items": {
3151
+ "$ref": "#/$defs/WidgetRecoveryAction"
3152
+ }
3153
+ }
3154
+ }
3155
+ },
3156
+ "WidgetRecoveryRule": {
3157
+ "title": "WidgetRecoveryRule",
3158
+ "description": "公共恢复规则目录条目;空 codes 仅用于显式 unknown 回退。",
3159
+ "type": "object",
3160
+ "additionalProperties": false,
3161
+ "required": [
3162
+ "id",
3163
+ "version",
3164
+ "sources",
3165
+ "codes",
3166
+ "disposition",
3167
+ "nextAction",
3168
+ "verification",
3169
+ "guidance",
3170
+ "followUpActions"
3171
+ ],
3172
+ "properties": {
3173
+ "id": {
3174
+ "type": "string",
3175
+ "minLength": 1,
3176
+ "maxLength": 96,
3177
+ "pattern": "^[A-Za-z][A-Za-z0-9_.-]*$"
3178
+ },
3179
+ "version": {
3180
+ "type": "integer",
3181
+ "minimum": 1
3182
+ },
3183
+ "sources": {
3184
+ "type": "array",
3185
+ "minItems": 1,
3186
+ "maxItems": 3,
3187
+ "uniqueItems": true,
3188
+ "items": {
3189
+ "enum": [
3190
+ "sdk",
3191
+ "host",
3192
+ "toolchain"
3193
+ ]
3194
+ }
3195
+ },
3196
+ "codes": {
3197
+ "type": "array",
3198
+ "maxItems": 64,
3199
+ "uniqueItems": true,
3200
+ "items": {
3201
+ "type": "string",
3202
+ "minLength": 1,
3203
+ "maxLength": 96,
3204
+ "pattern": "^[A-Za-z][A-Za-z0-9_.-]*$"
3205
+ }
3206
+ },
3207
+ "disposition": {
3208
+ "enum": [
3209
+ "retry",
3210
+ "repair",
3211
+ "inspect",
3212
+ "external-action",
3213
+ "stop"
3214
+ ]
3215
+ },
3216
+ "nextAction": {
3217
+ "$ref": "#/$defs/WidgetRecoveryAction"
3218
+ },
3219
+ "verification": {
3220
+ "$ref": "#/$defs/WidgetRecoveryVerification"
3221
+ },
3222
+ "guidance": {
3223
+ "type": "string",
3224
+ "minLength": 1,
3225
+ "maxLength": 4096
3226
+ },
3227
+ "followUpActions": {
3228
+ "description": "首项动作完成后的有限恢复步骤;宿主逐步验证前置条件,不原样盲目重放。",
3229
+ "type": "array",
3230
+ "maxItems": 8,
3231
+ "items": {
3232
+ "$ref": "#/$defs/WidgetRecoveryAction"
3233
+ }
3234
+ }
3235
+ }
3236
+ },
3237
+ "WidgetDevelopmentExtension": {
3238
+ "title": "WidgetDevelopmentExtension",
3239
+ "description": "经 offer/connect 显式选择的开发扩展;不授予 capability。",
3240
+ "const": "development-diagnostics-v1"
3241
+ },
3242
+ "WidgetDevelopmentOffer": {
3243
+ "title": "WidgetDevelopmentOffer",
3244
+ "description": "独立于旧 bootstrap-ready 的支持声明,接收方仍须校验 frame 来源和挂载尝试。",
3245
+ "type": "object",
3246
+ "additionalProperties": false,
3247
+ "required": [
3248
+ "type",
3249
+ "protocolVersion",
3250
+ "extensions"
3251
+ ],
3252
+ "properties": {
3253
+ "type": {
3254
+ "const": "widget-bootstrap-offer"
3255
+ },
3256
+ "protocolVersion": {
3257
+ "const": 1
3258
+ },
3259
+ "extensions": {
3260
+ "type": "array",
3261
+ "minItems": 1,
3262
+ "maxItems": 1,
3263
+ "uniqueItems": true,
3264
+ "items": {
3265
+ "$ref": "#/$defs/WidgetDevelopmentExtension"
3266
+ }
3267
+ }
3268
+ }
3269
+ },
3270
+ "WidgetDevelopmentConnect": {
3271
+ "title": "WidgetDevelopmentConnect",
3272
+ "description": "仅在收到当前 iframe 合法 offer 后使用的扩展 connect;旧形状保持不变。",
3273
+ "type": "object",
3274
+ "additionalProperties": false,
3275
+ "required": [
3276
+ "type",
3277
+ "protocolVersion",
3278
+ "channelId",
3279
+ "initPayload",
3280
+ "extensions"
3281
+ ],
3282
+ "properties": {
3283
+ "type": {
3284
+ "const": "widget-host-connect"
3285
+ },
3286
+ "protocolVersion": {
3287
+ "const": 1
3288
+ },
3289
+ "channelId": {
3290
+ "type": "string",
3291
+ "minLength": 16
3292
+ },
3293
+ "initPayload": {
3294
+ "$ref": "#/$defs/InitPayload"
3295
+ },
3296
+ "extensions": {
3297
+ "type": "array",
3298
+ "minItems": 1,
3299
+ "maxItems": 1,
3300
+ "uniqueItems": true,
3301
+ "items": {
3302
+ "$ref": "#/$defs/WidgetDevelopmentExtension"
3303
+ }
3304
+ }
3305
+ }
3306
+ },
3307
+ "WidgetRenderResult": {
3308
+ "title": "WidgetRenderResult",
3309
+ "description": "仅表示受管渲染处理器的处理结果,不代表视觉或业务验收。",
3310
+ "oneOf": [
3311
+ {
3312
+ "type": "object",
3313
+ "additionalProperties": false,
3314
+ "required": [
3315
+ "requestId",
3316
+ "revision",
3317
+ "outcome"
3318
+ ],
3319
+ "properties": {
3320
+ "requestId": { "$ref": "#/$defs/RenderRequestBase/properties/requestId" },
3321
+ "revision": {
3322
+ "type": "integer",
3323
+ "minimum": 1
3324
+ },
3325
+ "outcome": {
3326
+ "enum": [
3327
+ "handled",
3328
+ "superseded"
3329
+ ]
3330
+ }
3331
+ }
3332
+ },
3333
+ {
3334
+ "type": "object",
3335
+ "additionalProperties": false,
3336
+ "required": [
3337
+ "requestId",
3338
+ "revision",
3339
+ "outcome",
3340
+ "diagnostic"
3341
+ ],
3342
+ "properties": {
3343
+ "requestId": { "$ref": "#/$defs/RenderRequestBase/properties/requestId" },
3344
+ "revision": {
3345
+ "type": "integer",
3346
+ "minimum": 1
3347
+ },
3348
+ "outcome": {
3349
+ "const": "failed"
3350
+ },
3351
+ "diagnostic": {
3352
+ "$ref": "#/$defs/WidgetRenderFailureDiagnostic"
3353
+ }
3354
+ }
3355
+ }
3356
+ ]
3357
+ },
3358
+ "WidgetDiagnosticMessage": {
3359
+ "title": "WidgetDiagnosticMessage",
3360
+ "description": "经协商的开发扩展 Bridge 消息;仍受现有通道与消息预算约束。",
3361
+ "type": "object",
3362
+ "allOf": [
3363
+ {
3364
+ "$ref": "#/$defs/BridgeEnvelopeBase"
3365
+ },
3366
+ {
3367
+ "type": "object",
3368
+ "required": [
3369
+ "type",
3370
+ "payload"
3371
+ ],
3372
+ "properties": {
3373
+ "type": {
3374
+ "const": "diagnostic"
3375
+ },
3376
+ "payload": {
3377
+ "$ref": "#/$defs/WidgetGuestDiagnostic"
3378
+ }
3379
+ }
3380
+ }
3381
+ ],
3382
+ "unevaluatedProperties": false
3383
+ },
3384
+ "WidgetRenderResultMessage": {
3385
+ "title": "WidgetRenderResultMessage",
3386
+ "description": "经协商的开发扩展 Bridge 消息;仍受现有通道与消息预算约束。",
3387
+ "type": "object",
3388
+ "allOf": [
3389
+ {
3390
+ "$ref": "#/$defs/BridgeEnvelopeBase"
3391
+ },
3392
+ {
3393
+ "type": "object",
3394
+ "required": [
3395
+ "type",
3396
+ "payload"
3397
+ ],
3398
+ "properties": {
3399
+ "type": {
3400
+ "const": "render-result"
3401
+ },
3402
+ "payload": {
3403
+ "$ref": "#/$defs/WidgetRenderResult"
3404
+ }
3405
+ }
3406
+ }
3407
+ ],
3408
+ "unevaluatedProperties": false
3409
+ },
3410
+ "WidgetDevelopmentMessage": {
3411
+ "title": "WidgetDevelopmentMessage",
3412
+ "description": "扩展 profile 下的 Widget → Host 消息;原 WidgetToHostMessage 不扩展。",
3413
+ "oneOf": [
3414
+ {
3415
+ "$ref": "#/$defs/WidgetToHostMessage"
3416
+ },
3417
+ {
3418
+ "$ref": "#/$defs/WidgetDiagnosticMessage"
3419
+ },
3420
+ {
3421
+ "$ref": "#/$defs/WidgetRenderResultMessage"
3422
+ }
3423
+ ]
3424
+ },
3425
+ "WidgetRecoveryContext": {
3426
+ "title": "WidgetRecoveryContext",
3427
+ "description": "复用工具执行结果语义的可信恢复上下文;缺失字段表示未知,不能授权重放。",
3428
+ "type": "object",
3429
+ "additionalProperties": false,
3430
+ "properties": {
3431
+ "progress": { "$ref": "#/$defs/WidgetRecoveryProgress" },
3432
+ "executionState": {
3433
+ "enum": [
3434
+ "not_started",
3435
+ "finished",
3436
+ "partial",
3437
+ "unknown"
3438
+ ]
3439
+ },
3440
+ "mayHaveExecuted": {
3441
+ "type": "boolean"
3442
+ }
3443
+ }
3444
+ },
3445
+ "WidgetGuestDiagnostic": {
3446
+ "title": "WidgetGuestDiagnostic",
3447
+ "description": "Guest 仅声明 SDK 诊断事实,不得冒充 Host 或工具链。",
3448
+ "allOf": [
3449
+ {
3450
+ "$ref": "#/$defs/WidgetDevelopmentDiagnostic"
3451
+ },
3452
+ {
3453
+ "type": "object",
3454
+ "required": [
3455
+ "source"
3456
+ ],
3457
+ "properties": {
3458
+ "source": {
3459
+ "const": "sdk"
3460
+ }
3461
+ }
3462
+ }
3463
+ ]
3464
+ },
3465
+ "WidgetRenderFailureDiagnostic": {
3466
+ "title": "WidgetRenderFailureDiagnostic",
3467
+ "description": "失败处理回执的 SDK 请求诊断;接收方还须匹配当前 requestId。",
3468
+ "allOf": [
3469
+ {
3470
+ "$ref": "#/$defs/WidgetGuestDiagnostic"
3471
+ },
3472
+ {
3473
+ "type": "object",
3474
+ "required": [
3475
+ "correlationId"
3476
+ ],
3477
+ "properties": {
3478
+ "correlationId": { "$ref": "#/$defs/WidgetDevelopmentDiagnostic/properties/correlationId" },
3479
+ "phase": {
3480
+ "enum": [
3481
+ "render",
3482
+ "update"
3483
+ ]
3484
+ }
3485
+ }
3486
+ }
3487
+ ]
3488
+ },
3489
+ "WidgetRecoveryProgress": {
3490
+ "title": "WidgetRecoveryProgress",
3491
+ "description": "可信宿主观察到的恢复进展;重复故障无新证据时不能重复同一修复。",
3492
+ "type": "object",
3493
+ "additionalProperties": false,
3494
+ "required": [
3495
+ "repeated",
3496
+ "hasNewEvidence"
3497
+ ],
3498
+ "properties": {
3499
+ "repeated": {
3500
+ "type": "boolean"
3501
+ },
3502
+ "hasNewEvidence": {
3503
+ "type": "boolean"
3504
+ }
3505
+ }
2872
3506
  }
2873
3507
  }
2874
3508
  }