@skillbuilder/miniapp-simulator 0.2.2 → 0.2.7

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 (46) hide show
  1. package/docs/assets/audit-auto-stop-config-2026-10-21.jpg +0 -0
  2. package/docs/assets/audit-balanced-panel-2026-10-16.jpg +0 -0
  3. package/docs/assets/audit-lcp-input-2026-10-20.jpg +0 -0
  4. package/docs/assets/audit-paint-game3d-2026-10-16.jpg +0 -0
  5. package/docs/assets/audit-paint-webgl-2026-10-16.jpg +0 -0
  6. package/docs/assets/audit-paint-webgl-apm-excerpt-2026-10-16.json +397 -0
  7. package/docs/assets/audit-poetry-2026-10-16.jpg +0 -0
  8. package/docs/assets/audit-remaining-results-2026-10-16.json +2749 -0
  9. package/docs/assets/miniapp-audit-risk-review-2026-10-13.png +0 -0
  10. package/docs/assets/miniapp-audit-runtime-hung-2026-10-13.png +0 -0
  11. package/docs/audit-data-collection.codex.md +105 -0
  12. package/docs/audit-local-validation.codex.md +165 -0
  13. package/docs/audit-score-design.codex.md +222 -0
  14. package/docs/audit-score-design.md +832 -0
  15. package/docs/audit-score-tech-plan.md +450 -0
  16. package/docs/audit-tech-design.codex.md +485 -0
  17. package/docs/electron-review.md +223 -12
  18. package/docs/quality-evaluation-redoc.xml +163 -0
  19. package/docs/tracker.md +3 -2
  20. package/lib/client-BjYHK9LR.mjs +1220 -0
  21. package/lib/{index-D5AYVv8s.mjs → index-CqClPZVv.mjs} +230 -184
  22. package/lib/index.js +2204 -1999
  23. package/lib/remote-client.js +2 -2
  24. package/lib/types/host/shadow-host.d.ts +10 -0
  25. package/lib/types/injection/registry.d.ts +5 -0
  26. package/lib/types/remote/audit-controller.d.ts +61 -0
  27. package/lib/types/remote/audit-leave-monitor.d.ts +12 -0
  28. package/lib/types/remote/audit-package-sources.d.ts +9 -0
  29. package/lib/types/remote/audit-telemetry.d.ts +36 -0
  30. package/lib/types/remote/audit-watchdog.d.ts +14 -0
  31. package/lib/types/remote/client.d.ts +25 -1
  32. package/lib/types/remote/load-timing.d.ts +5 -0
  33. package/lib/types/remote/protocol.d.ts +162 -1
  34. package/lib/types/remote/runtime.d.ts +2 -0
  35. package/lib/types/remote-client.d.ts +2 -2
  36. package/lib/types/runtime/jsapi-modules/interaction.d.ts +1 -1
  37. package/lib/types/runtime/jsapi-modules/local-media.d.ts +4 -0
  38. package/lib/types/runtime/jsapi-modules/media.d.ts +1 -1
  39. package/lib/types/runtime/jsapi-modules/note-publish-media.d.ts +9 -0
  40. package/lib/types/sw/service-worker-host.d.ts +15 -0
  41. package/lib/types/tracker/constants.d.ts +1 -1
  42. package/lib/types/tracker/default-tracker.d.ts +9 -1
  43. package/lib/types/types/options.d.ts +24 -0
  44. package/lib/workbench.js +1 -1
  45. package/package.json +1 -1
  46. package/lib/client-_vNHVHSm.mjs +0 -775
@@ -0,0 +1,397 @@
1
+ {
2
+ "note": "真实 WebGL 包 APM 请求的 paint/result 事件摘录;同批其他事件未包含。",
3
+ "requests": [
4
+ {
5
+ "endpoint": "https://apm-fe-test.xiaohongshu.com/api/data",
6
+ "headers": {
7
+ "content-type": "application/json",
8
+ "Biz-Type": "apm_fe",
9
+ "Batch": "true"
10
+ },
11
+ "metrics": [
12
+ {
13
+ "clientTime": 1792121437855,
14
+ "context_sdkSessionId": "db291f2f-4e12-4ea9-ac23-686448850438",
15
+ "context_pageSessionId": "cae9fd06-b9c5-4385-a507-a93e55aba7ca",
16
+ "context_sdkSeqId": 13,
17
+ "context_nameTracker": "wapT",
18
+ "context_platform": "PC",
19
+ "context_accountGeographicZone": "cn",
20
+ "context_appVersion": "discovery-0.0.0",
21
+ "context_osVersion": "unknown",
22
+ "context_deviceModel": "",
23
+ "context_deviceId": "",
24
+ "context_package": "",
25
+ "context_networkType": "unknow",
26
+ "context_networkQuality": "UNKNOWN",
27
+ "context_matchedPath": "/simulator",
28
+ "context_route": "http://127.0.0.1:5286/simulator?server=http://127.0.0.1:5284/simulator-dev/",
29
+ "context_userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/155.0.0.0 Safari/537.36",
30
+ "context_artifactName": "skillbuilder-miniapp",
31
+ "context_artifactVersion": "0.1.10",
32
+ "context_deviceLevel": "unknown",
33
+ "context_feSdkVersion": "1.3.13",
34
+ "context_userId": "playground-test-user",
35
+ "measurement_name": "miniapp_simulator_event",
36
+ "measurement_data": {
37
+ "event_name": "miniapp_audit_paint",
38
+ "timestamp": 1792121437855,
39
+ "business_line": "mars",
40
+ "sdk_version": "0.1.10",
41
+ "renderer": "iframe-service-worker",
42
+ "app_id": "playground-test-app",
43
+ "simulator_session_id": "ac8dbb98-2bf0-4c32-af75-165c327c7267",
44
+ "runtime_version": "local",
45
+ "app_type": "tool",
46
+ "policy_version": "phase1-paint-2026-10-16",
47
+ "rules_version": "1.1.0",
48
+ "probe_version": "1.1.0",
49
+ "audit_session_id": "6e7886a0-0f43-4b46-af42-cfb6595a5654",
50
+ "attempt_no": 1,
51
+ "fcp_status": "pending",
52
+ "lcp_status": "pending",
53
+ "lcp_finalized": 0,
54
+ "paint_timing_source": "guest-navigation",
55
+ "session_elapsed_ms": 103,
56
+ "review_task_id": "playground-review-task",
57
+ "package_version": "playground-sample-v1",
58
+ "package_hash": "80dcd8eebf7059162c7aecff61af2347b1ab4c2b7e5ab8efc1ec10e8ce87b23f"
59
+ }
60
+ },
61
+ {
62
+ "clientTime": 1792121438065,
63
+ "context_sdkSessionId": "db291f2f-4e12-4ea9-ac23-686448850438",
64
+ "context_pageSessionId": "cae9fd06-b9c5-4385-a507-a93e55aba7ca",
65
+ "context_sdkSeqId": 14,
66
+ "context_nameTracker": "wapT",
67
+ "context_platform": "PC",
68
+ "context_accountGeographicZone": "cn",
69
+ "context_appVersion": "discovery-0.0.0",
70
+ "context_osVersion": "unknown",
71
+ "context_deviceModel": "",
72
+ "context_deviceId": "",
73
+ "context_package": "",
74
+ "context_networkType": "unknow",
75
+ "context_networkQuality": "UNKNOWN",
76
+ "context_matchedPath": "/simulator",
77
+ "context_route": "http://127.0.0.1:5286/simulator?server=http://127.0.0.1:5284/simulator-dev/",
78
+ "context_userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/155.0.0.0 Safari/537.36",
79
+ "context_artifactName": "skillbuilder-miniapp",
80
+ "context_artifactVersion": "0.1.10",
81
+ "context_deviceLevel": "unknown",
82
+ "context_feSdkVersion": "1.3.13",
83
+ "context_userId": "playground-test-user",
84
+ "measurement_name": "miniapp_simulator_event",
85
+ "measurement_data": {
86
+ "event_name": "miniapp_audit_paint",
87
+ "timestamp": 1792121438065,
88
+ "business_line": "mars",
89
+ "sdk_version": "0.1.10",
90
+ "renderer": "iframe-service-worker",
91
+ "app_id": "playground-test-app",
92
+ "simulator_session_id": "ac8dbb98-2bf0-4c32-af75-165c327c7267",
93
+ "runtime_version": "local",
94
+ "app_type": "tool",
95
+ "policy_version": "phase1-paint-2026-10-16",
96
+ "rules_version": "1.1.0",
97
+ "probe_version": "1.1.0",
98
+ "audit_session_id": "6e7886a0-0f43-4b46-af42-cfb6595a5654",
99
+ "attempt_no": 1,
100
+ "fcp_ms": 228,
101
+ "fcp_status": "measured",
102
+ "lcp_status": "pending",
103
+ "lcp_finalized": 0,
104
+ "paint_timing_source": "guest-navigation",
105
+ "session_elapsed_ms": 315,
106
+ "review_task_id": "playground-review-task",
107
+ "package_version": "playground-sample-v1",
108
+ "package_hash": "80dcd8eebf7059162c7aecff61af2347b1ab4c2b7e5ab8efc1ec10e8ce87b23f"
109
+ }
110
+ }
111
+ ]
112
+ },
113
+ {
114
+ "endpoint": "https://apm-fe-test.xiaohongshu.com/api/data",
115
+ "headers": {
116
+ "content-type": "application/json",
117
+ "Biz-Type": "apm_fe",
118
+ "Batch": "true"
119
+ },
120
+ "metrics": [
121
+ {
122
+ "clientTime": 1792121438066,
123
+ "context_sdkSessionId": "db291f2f-4e12-4ea9-ac23-686448850438",
124
+ "context_pageSessionId": "cae9fd06-b9c5-4385-a507-a93e55aba7ca",
125
+ "context_sdkSeqId": 15,
126
+ "context_nameTracker": "wapT",
127
+ "context_platform": "PC",
128
+ "context_accountGeographicZone": "cn",
129
+ "context_appVersion": "discovery-0.0.0",
130
+ "context_osVersion": "unknown",
131
+ "context_deviceModel": "",
132
+ "context_deviceId": "",
133
+ "context_package": "",
134
+ "context_networkType": "unknow",
135
+ "context_networkQuality": "UNKNOWN",
136
+ "context_matchedPath": "/simulator",
137
+ "context_route": "http://127.0.0.1:5286/simulator?server=http://127.0.0.1:5284/simulator-dev/",
138
+ "context_userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/155.0.0.0 Safari/537.36",
139
+ "context_artifactName": "skillbuilder-miniapp",
140
+ "context_artifactVersion": "0.1.10",
141
+ "context_deviceLevel": "unknown",
142
+ "context_feSdkVersion": "1.3.13",
143
+ "context_userId": "playground-test-user",
144
+ "measurement_name": "miniapp_simulator_event",
145
+ "measurement_data": {
146
+ "event_name": "miniapp_audit_paint",
147
+ "timestamp": 1792121438066,
148
+ "business_line": "mars",
149
+ "sdk_version": "0.1.10",
150
+ "renderer": "iframe-service-worker",
151
+ "app_id": "playground-test-app",
152
+ "simulator_session_id": "ac8dbb98-2bf0-4c32-af75-165c327c7267",
153
+ "runtime_version": "local",
154
+ "app_type": "tool",
155
+ "policy_version": "phase1-paint-2026-10-16",
156
+ "rules_version": "1.1.0",
157
+ "probe_version": "1.1.0",
158
+ "audit_session_id": "6e7886a0-0f43-4b46-af42-cfb6595a5654",
159
+ "attempt_no": 1,
160
+ "fcp_ms": 228,
161
+ "lcp_ms": 228,
162
+ "fcp_status": "measured",
163
+ "lcp_status": "measured",
164
+ "lcp_finalized": 0,
165
+ "paint_timing_source": "guest-navigation",
166
+ "session_elapsed_ms": 315,
167
+ "review_task_id": "playground-review-task",
168
+ "package_version": "playground-sample-v1",
169
+ "package_hash": "80dcd8eebf7059162c7aecff61af2347b1ab4c2b7e5ab8efc1ec10e8ce87b23f"
170
+ }
171
+ }
172
+ ]
173
+ },
174
+ {
175
+ "endpoint": "https://apm-fe-test.xiaohongshu.com/api/data",
176
+ "headers": {
177
+ "content-type": "application/json",
178
+ "Biz-Type": "apm_fe",
179
+ "Batch": "true"
180
+ },
181
+ "metrics": [
182
+ {
183
+ "clientTime": 1792121452749,
184
+ "context_sdkSessionId": "db291f2f-4e12-4ea9-ac23-686448850438",
185
+ "context_pageSessionId": "cae9fd06-b9c5-4385-a507-a93e55aba7ca",
186
+ "context_sdkSeqId": 31,
187
+ "context_nameTracker": "wapT",
188
+ "context_platform": "PC",
189
+ "context_accountGeographicZone": "cn",
190
+ "context_appVersion": "discovery-0.0.0",
191
+ "context_osVersion": "unknown",
192
+ "context_deviceModel": "",
193
+ "context_deviceId": "",
194
+ "context_package": "",
195
+ "context_networkType": "unknow",
196
+ "context_networkQuality": "UNKNOWN",
197
+ "context_matchedPath": "/simulator",
198
+ "context_route": "http://127.0.0.1:5286/simulator?server=http://127.0.0.1:5284/simulator-dev/",
199
+ "context_userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/155.0.0.0 Safari/537.36",
200
+ "context_artifactName": "skillbuilder-miniapp",
201
+ "context_artifactVersion": "0.1.10",
202
+ "context_deviceLevel": "unknown",
203
+ "context_feSdkVersion": "1.3.13",
204
+ "context_userId": "playground-test-user",
205
+ "measurement_name": "miniapp_simulator_event",
206
+ "measurement_data": {
207
+ "event_name": "miniapp_audit_paint",
208
+ "timestamp": 1792121452749,
209
+ "business_line": "mars",
210
+ "sdk_version": "0.1.10",
211
+ "renderer": "iframe-service-worker",
212
+ "app_id": "playground-test-app",
213
+ "simulator_session_id": "ac8dbb98-2bf0-4c32-af75-165c327c7267",
214
+ "runtime_version": "local",
215
+ "app_type": "tool",
216
+ "policy_version": "phase1-paint-2026-10-16",
217
+ "rules_version": "1.1.0",
218
+ "probe_version": "1.1.0",
219
+ "audit_session_id": "6e7886a0-0f43-4b46-af42-cfb6595a5654",
220
+ "attempt_no": 1,
221
+ "fcp_ms": 228,
222
+ "lcp_ms": 228,
223
+ "fcp_status": "measured",
224
+ "lcp_status": "measured",
225
+ "lcp_finalized": 1,
226
+ "paint_finalize_reason": "interaction",
227
+ "paint_timing_source": "guest-navigation",
228
+ "session_elapsed_ms": 14998,
229
+ "review_task_id": "playground-review-task",
230
+ "package_version": "playground-sample-v1",
231
+ "package_hash": "80dcd8eebf7059162c7aecff61af2347b1ab4c2b7e5ab8efc1ec10e8ce87b23f"
232
+ }
233
+ }
234
+ ]
235
+ },
236
+ {
237
+ "endpoint": "https://apm-fe-test.xiaohongshu.com/api/data",
238
+ "headers": {
239
+ "content-type": "application/json",
240
+ "Biz-Type": "apm_fe",
241
+ "Batch": "true"
242
+ },
243
+ "metrics": [
244
+ {
245
+ "clientTime": 1792121519349,
246
+ "context_sdkSessionId": "db291f2f-4e12-4ea9-ac23-686448850438",
247
+ "context_pageSessionId": "cae9fd06-b9c5-4385-a507-a93e55aba7ca",
248
+ "context_sdkSeqId": 99,
249
+ "context_nameTracker": "wapT",
250
+ "context_platform": "PC",
251
+ "context_accountGeographicZone": "cn",
252
+ "context_appVersion": "discovery-0.0.0",
253
+ "context_osVersion": "unknown",
254
+ "context_deviceModel": "",
255
+ "context_deviceId": "",
256
+ "context_package": "",
257
+ "context_networkType": "unknow",
258
+ "context_networkQuality": "UNKNOWN",
259
+ "context_matchedPath": "/simulator",
260
+ "context_route": "http://127.0.0.1:5286/simulator?server=http://127.0.0.1:5284/simulator-dev/",
261
+ "context_userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/155.0.0.0 Safari/537.36",
262
+ "context_artifactName": "skillbuilder-miniapp",
263
+ "context_artifactVersion": "0.1.10",
264
+ "context_deviceLevel": "unknown",
265
+ "context_feSdkVersion": "1.3.13",
266
+ "context_userId": "playground-test-user",
267
+ "measurement_name": "miniapp_simulator_event",
268
+ "measurement_data": {
269
+ "event_name": "miniapp_audit_paint",
270
+ "timestamp": 1792121519349,
271
+ "business_line": "mars",
272
+ "sdk_version": "0.1.10",
273
+ "renderer": "iframe-service-worker",
274
+ "app_id": "playground-test-app",
275
+ "simulator_session_id": "ac8dbb98-2bf0-4c32-af75-165c327c7267",
276
+ "runtime_version": "local",
277
+ "app_type": "tool",
278
+ "policy_version": "phase1-paint-2026-10-16",
279
+ "rules_version": "1.1.0",
280
+ "probe_version": "1.1.0",
281
+ "audit_session_id": "6e7886a0-0f43-4b46-af42-cfb6595a5654",
282
+ "attempt_no": 1,
283
+ "fcp_ms": 228,
284
+ "lcp_ms": 228,
285
+ "fcp_status": "measured",
286
+ "lcp_status": "measured",
287
+ "lcp_finalized": 1,
288
+ "paint_finalize_reason": "interaction",
289
+ "paint_timing_source": "guest-navigation",
290
+ "session_elapsed_ms": 81598,
291
+ "review_task_id": "playground-review-task",
292
+ "package_version": "playground-sample-v1",
293
+ "package_hash": "80dcd8eebf7059162c7aecff61af2347b1ab4c2b7e5ab8efc1ec10e8ce87b23f"
294
+ }
295
+ }
296
+ ]
297
+ },
298
+ {
299
+ "endpoint": "https://apm-fe-test.xiaohongshu.com/api/data",
300
+ "headers": {
301
+ "content-type": "application/json",
302
+ "Biz-Type": "apm_fe",
303
+ "Batch": "true"
304
+ },
305
+ "metrics": [
306
+ {
307
+ "clientTime": 1792121519352,
308
+ "context_sdkSessionId": "db291f2f-4e12-4ea9-ac23-686448850438",
309
+ "context_pageSessionId": "cae9fd06-b9c5-4385-a507-a93e55aba7ca",
310
+ "context_sdkSeqId": 101,
311
+ "context_nameTracker": "wapT",
312
+ "context_platform": "PC",
313
+ "context_accountGeographicZone": "cn",
314
+ "context_appVersion": "discovery-0.0.0",
315
+ "context_osVersion": "unknown",
316
+ "context_deviceModel": "",
317
+ "context_deviceId": "",
318
+ "context_package": "",
319
+ "context_networkType": "unknow",
320
+ "context_networkQuality": "UNKNOWN",
321
+ "context_matchedPath": "/simulator",
322
+ "context_route": "http://127.0.0.1:5286/simulator?server=http://127.0.0.1:5284/simulator-dev/",
323
+ "context_userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/155.0.0.0 Safari/537.36",
324
+ "context_artifactName": "skillbuilder-miniapp",
325
+ "context_artifactVersion": "0.1.10",
326
+ "context_deviceLevel": "unknown",
327
+ "context_feSdkVersion": "1.3.13",
328
+ "context_userId": "playground-test-user",
329
+ "measurement_name": "miniapp_simulator_event",
330
+ "measurement_data": {
331
+ "event_name": "miniapp_audit_result",
332
+ "timestamp": 1792121519351,
333
+ "business_line": "mars",
334
+ "sdk_version": "0.1.10",
335
+ "renderer": "iframe-service-worker",
336
+ "app_id": "playground-test-app",
337
+ "simulator_session_id": "ac8dbb98-2bf0-4c32-af75-165c327c7267",
338
+ "runtime_version": "local",
339
+ "app_type": "game3d",
340
+ "policy_version": "phase1-paint-2026-10-16",
341
+ "rules_version": "1.1.0",
342
+ "probe_version": "1.1.0",
343
+ "fcp_ms": 228,
344
+ "lcp_ms": 228,
345
+ "fcp_status": "measured",
346
+ "lcp_status": "measured",
347
+ "lcp_finalized": 1,
348
+ "paint_finalize_reason": "interaction",
349
+ "paint_timing_source": "guest-navigation",
350
+ "score_fcp": 100,
351
+ "score_lcp": 100,
352
+ "fcp_threshold_ms": 1800,
353
+ "lcp_threshold_ms": 2500,
354
+ "status": "scored",
355
+ "blocking_passed": 1,
356
+ "enforced": 0,
357
+ "score_total": 94,
358
+ "score_memory": 100,
359
+ "score_performance": 100,
360
+ "score_package": 66,
361
+ "coverage_ratio": 1,
362
+ "effective_ms": 77000,
363
+ "complete": 1,
364
+ "sample_count": 78,
365
+ "interaction_count": 7,
366
+ "first_interaction_ms": 10999,
367
+ "core_reached": 1,
368
+ "core_reached_ms": 77165,
369
+ "reload_count": 0,
370
+ "probe_saturated": 0,
371
+ "sufficient": 1,
372
+ "infrastructure_error_count": 0,
373
+ "blocking_failure_count": 0,
374
+ "tag_mismatch": 1,
375
+ "peak_heap_bytes": 4287307.049999997,
376
+ "heap_growth_mb_per_min": -1.5475789672713567,
377
+ "tex_watermark_bytes": 38894741,
378
+ "buf_watermark_bytes": 296,
379
+ "canvas_bytes": 4535304,
380
+ "img_bytes": 6792192,
381
+ "wasm_bytes": 0,
382
+ "max_workers": 0,
383
+ "fps_p5": 29,
384
+ "long_task_count": 1,
385
+ "long_task_max_ms": 101,
386
+ "js_error_total": 0,
387
+ "review_task_id": "playground-review-task",
388
+ "audit_session_id": "6e7886a0-0f43-4b46-af42-cfb6595a5654",
389
+ "attempt_no": 1,
390
+ "package_version": "playground-sample-v1",
391
+ "package_hash": "80dcd8eebf7059162c7aecff61af2347b1ab4c2b7e5ab8efc1ec10e8ce87b23f"
392
+ }
393
+ }
394
+ ]
395
+ }
396
+ ]
397
+ }