krillplayer-plugin 0.6.0 → 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.
Files changed (150) hide show
  1. package/LICENSE +2 -1
  2. package/README.md +1 -0
  3. package/dist/cli.js +351 -73
  4. package/dist/crypto.js +37 -11
  5. package/dist/engine/engine.c +6 -3
  6. package/kernel/Sources/CQuickJS/include/kernel_qjs.h +8 -1
  7. package/kernel/Sources/CQuickJS/kernel_internal.h +54 -0
  8. package/kernel/Sources/CQuickJS/kernel_qjs.c +17 -29
  9. package/kernel/Sources/CQuickJS/kernel_wasm.c +1155 -0
  10. package/kernel/Sources/CWAMR/include/kernel_wamr.h +151 -0
  11. package/kernel/Sources/CWAMR/include/kernel_wamr_config.h +66 -0
  12. package/kernel/Sources/CWAMR/vendor/LICENSE +219 -0
  13. package/kernel/Sources/CWAMR/vendor/core/config.h +727 -0
  14. package/kernel/Sources/CWAMR/vendor/core/iwasm/aot/aot_runtime.h +899 -0
  15. package/kernel/Sources/CWAMR/vendor/core/iwasm/common/arch/invokeNative_general.c +123 -0
  16. package/kernel/Sources/CWAMR/vendor/core/iwasm/common/wasm_application.c +933 -0
  17. package/kernel/Sources/CWAMR/vendor/core/iwasm/common/wasm_blocking_op.c +92 -0
  18. package/kernel/Sources/CWAMR/vendor/core/iwasm/common/wasm_c_api.c +5391 -0
  19. package/kernel/Sources/CWAMR/vendor/core/iwasm/common/wasm_c_api_internal.h +246 -0
  20. package/kernel/Sources/CWAMR/vendor/core/iwasm/common/wasm_exec_env.c +336 -0
  21. package/kernel/Sources/CWAMR/vendor/core/iwasm/common/wasm_exec_env.h +328 -0
  22. package/kernel/Sources/CWAMR/vendor/core/iwasm/common/wasm_loader_common.c +242 -0
  23. package/kernel/Sources/CWAMR/vendor/core/iwasm/common/wasm_loader_common.h +62 -0
  24. package/kernel/Sources/CWAMR/vendor/core/iwasm/common/wasm_memory.c +1999 -0
  25. package/kernel/Sources/CWAMR/vendor/core/iwasm/common/wasm_memory.h +154 -0
  26. package/kernel/Sources/CWAMR/vendor/core/iwasm/common/wasm_native.c +1532 -0
  27. package/kernel/Sources/CWAMR/vendor/core/iwasm/common/wasm_native.h +117 -0
  28. package/kernel/Sources/CWAMR/vendor/core/iwasm/common/wasm_runtime_common.c +8070 -0
  29. package/kernel/Sources/CWAMR/vendor/core/iwasm/common/wasm_runtime_common.h +1396 -0
  30. package/kernel/Sources/CWAMR/vendor/core/iwasm/common/wasm_shared_memory.c +477 -0
  31. package/kernel/Sources/CWAMR/vendor/core/iwasm/common/wasm_shared_memory.h +63 -0
  32. package/kernel/Sources/CWAMR/vendor/core/iwasm/common/wasm_suspend_flags.h +52 -0
  33. package/kernel/Sources/CWAMR/vendor/core/iwasm/compilation/aot.h +366 -0
  34. package/kernel/Sources/CWAMR/vendor/core/iwasm/include/lib_export.h +60 -0
  35. package/kernel/Sources/CWAMR/vendor/core/iwasm/include/wasm_c_api.h +910 -0
  36. package/kernel/Sources/CWAMR/vendor/core/iwasm/include/wasm_export.h +2440 -0
  37. package/kernel/Sources/CWAMR/vendor/core/iwasm/interpreter/wasm.h +1492 -0
  38. package/kernel/Sources/CWAMR/vendor/core/iwasm/interpreter/wasm_interp.h +122 -0
  39. package/kernel/Sources/CWAMR/vendor/core/iwasm/interpreter/wasm_interp_fast.c +7998 -0
  40. package/kernel/Sources/CWAMR/vendor/core/iwasm/interpreter/wasm_loader.c +16909 -0
  41. package/kernel/Sources/CWAMR/vendor/core/iwasm/interpreter/wasm_loader.h +80 -0
  42. package/kernel/Sources/CWAMR/vendor/core/iwasm/interpreter/wasm_opcode.h +1043 -0
  43. package/kernel/Sources/CWAMR/vendor/core/iwasm/interpreter/wasm_runtime.c +5174 -0
  44. package/kernel/Sources/CWAMR/vendor/core/iwasm/interpreter/wasm_runtime.h +912 -0
  45. package/kernel/Sources/CWAMR/vendor/core/iwasm/libraries/thread-mgr/thread_manager.c +1569 -0
  46. package/kernel/Sources/CWAMR/vendor/core/iwasm/libraries/thread-mgr/thread_manager.h +256 -0
  47. package/kernel/Sources/CWAMR/vendor/core/shared/mem-alloc/ems/ems_alloc.c +1169 -0
  48. package/kernel/Sources/CWAMR/vendor/core/shared/mem-alloc/ems/ems_gc.c +497 -0
  49. package/kernel/Sources/CWAMR/vendor/core/shared/mem-alloc/ems/ems_gc.h +350 -0
  50. package/kernel/Sources/CWAMR/vendor/core/shared/mem-alloc/ems/ems_gc_internal.h +384 -0
  51. package/kernel/Sources/CWAMR/vendor/core/shared/mem-alloc/ems/ems_hmu.c +95 -0
  52. package/kernel/Sources/CWAMR/vendor/core/shared/mem-alloc/ems/ems_kfc.c +547 -0
  53. package/kernel/Sources/CWAMR/vendor/core/shared/mem-alloc/mem_alloc.c +252 -0
  54. package/kernel/Sources/CWAMR/vendor/core/shared/mem-alloc/mem_alloc.h +96 -0
  55. package/kernel/Sources/CWAMR/vendor/core/shared/platform/common/memory/mremap.c +12 -0
  56. package/kernel/Sources/CWAMR/vendor/core/shared/platform/common/posix/posix_blocking_op.c +70 -0
  57. package/kernel/Sources/CWAMR/vendor/core/shared/platform/common/posix/posix_malloc.c +72 -0
  58. package/kernel/Sources/CWAMR/vendor/core/shared/platform/common/posix/posix_memmap.c +302 -0
  59. package/kernel/Sources/CWAMR/vendor/core/shared/platform/common/posix/posix_sleep.c +20 -0
  60. package/kernel/Sources/CWAMR/vendor/core/shared/platform/common/posix/posix_thread.c +784 -0
  61. package/kernel/Sources/CWAMR/vendor/core/shared/platform/common/posix/posix_time.c +28 -0
  62. package/kernel/Sources/CWAMR/vendor/core/shared/platform/darwin/platform_init.c +43 -0
  63. package/kernel/Sources/CWAMR/vendor/core/shared/platform/darwin/platform_internal.h +126 -0
  64. package/kernel/Sources/CWAMR/vendor/core/shared/platform/include/platform_api_extension.h +1676 -0
  65. package/kernel/Sources/CWAMR/vendor/core/shared/platform/include/platform_api_vmcore.h +192 -0
  66. package/kernel/Sources/CWAMR/vendor/core/shared/platform/include/platform_common.h +204 -0
  67. package/kernel/Sources/CWAMR/vendor/core/shared/platform/include/platform_wasi_types.h +610 -0
  68. package/kernel/Sources/CWAMR/vendor/core/shared/platform/linux/platform_init.c +43 -0
  69. package/kernel/Sources/CWAMR/vendor/core/shared/platform/linux/platform_internal.h +139 -0
  70. package/kernel/Sources/CWAMR/vendor/core/shared/utils/bh_assert.c +25 -0
  71. package/kernel/Sources/CWAMR/vendor/core/shared/utils/bh_assert.h +42 -0
  72. package/kernel/Sources/CWAMR/vendor/core/shared/utils/bh_atomic.h +300 -0
  73. package/kernel/Sources/CWAMR/vendor/core/shared/utils/bh_bitmap.c +27 -0
  74. package/kernel/Sources/CWAMR/vendor/core/shared/utils/bh_bitmap.h +114 -0
  75. package/kernel/Sources/CWAMR/vendor/core/shared/utils/bh_common.c +217 -0
  76. package/kernel/Sources/CWAMR/vendor/core/shared/utils/bh_common.h +83 -0
  77. package/kernel/Sources/CWAMR/vendor/core/shared/utils/bh_hashmap.c +339 -0
  78. package/kernel/Sources/CWAMR/vendor/core/shared/utils/bh_hashmap.h +168 -0
  79. package/kernel/Sources/CWAMR/vendor/core/shared/utils/bh_leb128.c +77 -0
  80. package/kernel/Sources/CWAMR/vendor/core/shared/utils/bh_leb128.h +30 -0
  81. package/kernel/Sources/CWAMR/vendor/core/shared/utils/bh_list.c +111 -0
  82. package/kernel/Sources/CWAMR/vendor/core/shared/utils/bh_list.h +109 -0
  83. package/kernel/Sources/CWAMR/vendor/core/shared/utils/bh_log.c +111 -0
  84. package/kernel/Sources/CWAMR/vendor/core/shared/utils/bh_log.h +94 -0
  85. package/kernel/Sources/CWAMR/vendor/core/shared/utils/bh_platform.h +38 -0
  86. package/kernel/Sources/CWAMR/vendor/core/shared/utils/bh_queue.c +256 -0
  87. package/kernel/Sources/CWAMR/vendor/core/shared/utils/bh_queue.h +80 -0
  88. package/kernel/Sources/CWAMR/vendor/core/shared/utils/bh_vector.c +279 -0
  89. package/kernel/Sources/CWAMR/vendor/core/shared/utils/bh_vector.h +126 -0
  90. package/kernel/Sources/CWAMR/vendor/core/shared/utils/gnuc.h +14 -0
  91. package/kernel/Sources/CWAMR/vendor/core/shared/utils/runtime_timer.c +469 -0
  92. package/kernel/Sources/CWAMR/vendor/core/shared/utils/runtime_timer.h +51 -0
  93. package/kernel/Sources/CWAMR/vendor/core/version.h +24 -0
  94. package/kernel/Sources/CWAMR/wamr_bh_assert.c +98 -0
  95. package/kernel/Sources/CWAMR/wamr_bh_bitmap.c +98 -0
  96. package/kernel/Sources/CWAMR/wamr_bh_common.c +98 -0
  97. package/kernel/Sources/CWAMR/wamr_bh_hashmap.c +98 -0
  98. package/kernel/Sources/CWAMR/wamr_bh_leb128.c +98 -0
  99. package/kernel/Sources/CWAMR/wamr_bh_list.c +98 -0
  100. package/kernel/Sources/CWAMR/wamr_bh_log.c +98 -0
  101. package/kernel/Sources/CWAMR/wamr_bh_queue.c +98 -0
  102. package/kernel/Sources/CWAMR/wamr_bh_vector.c +98 -0
  103. package/kernel/Sources/CWAMR/wamr_ems_alloc.c +98 -0
  104. package/kernel/Sources/CWAMR/wamr_ems_gc.c +98 -0
  105. package/kernel/Sources/CWAMR/wamr_ems_hmu.c +98 -0
  106. package/kernel/Sources/CWAMR/wamr_ems_kfc.c +98 -0
  107. package/kernel/Sources/CWAMR/wamr_invokeNative_general.c +98 -0
  108. package/kernel/Sources/CWAMR/wamr_mem_alloc.c +98 -0
  109. package/kernel/Sources/CWAMR/wamr_mremap.c +98 -0
  110. package/kernel/Sources/CWAMR/wamr_platform_init_darwin.c +100 -0
  111. package/kernel/Sources/CWAMR/wamr_platform_init_linux.c +100 -0
  112. package/kernel/Sources/CWAMR/wamr_posix_blocking_op.c +98 -0
  113. package/kernel/Sources/CWAMR/wamr_posix_malloc.c +98 -0
  114. package/kernel/Sources/CWAMR/wamr_posix_memmap.c +98 -0
  115. package/kernel/Sources/CWAMR/wamr_posix_sleep.c +98 -0
  116. package/kernel/Sources/CWAMR/wamr_posix_thread.c +98 -0
  117. package/kernel/Sources/CWAMR/wamr_posix_time.c +98 -0
  118. package/kernel/Sources/CWAMR/wamr_runtime_timer.c +98 -0
  119. package/kernel/Sources/CWAMR/wamr_thread_manager.c +98 -0
  120. package/kernel/Sources/CWAMR/wamr_wasm_application.c +98 -0
  121. package/kernel/Sources/CWAMR/wamr_wasm_blocking_op.c +98 -0
  122. package/kernel/Sources/CWAMR/wamr_wasm_c_api.c +98 -0
  123. package/kernel/Sources/CWAMR/wamr_wasm_exec_env.c +98 -0
  124. package/kernel/Sources/CWAMR/wamr_wasm_interp_fast.c +98 -0
  125. package/kernel/Sources/CWAMR/wamr_wasm_loader.c +98 -0
  126. package/kernel/Sources/CWAMR/wamr_wasm_loader_common.c +98 -0
  127. package/kernel/Sources/CWAMR/wamr_wasm_memory.c +98 -0
  128. package/kernel/Sources/CWAMR/wamr_wasm_native.c +98 -0
  129. package/kernel/Sources/CWAMR/wamr_wasm_runtime.c +98 -0
  130. package/kernel/Sources/CWAMR/wamr_wasm_runtime_common.c +98 -0
  131. package/kernel/Sources/CWAMR/wamr_wasm_shared_memory.c +98 -0
  132. package/kernel/Sources/Kernel/PluginPrelude.js +5 -2
  133. package/kernel/Tests/KernelTests/CasePins.js +50 -0
  134. package/package.json +2 -2
  135. package/skill/krillplayer-plugin/SKILL.md +2 -0
  136. package/skill/krillplayer-plugin/assets/samples/live-video-platform/cases/danmaku-send-content-rejected.json +8 -4
  137. package/skill/krillplayer-plugin/assets/samples/live-video-platform/cases/danmaku-send-login-expired.json +8 -4
  138. package/skill/krillplayer-plugin/assets/samples/live-video-platform/cases/danmaku-send-muted.json +8 -4
  139. package/skill/krillplayer-plugin/assets/samples/live-video-platform/cases/danmaku-send-other.json +8 -4
  140. package/skill/krillplayer-plugin/assets/samples/live-video-platform/cases/danmaku-send-rate-limited.json +8 -4
  141. package/skill/krillplayer-plugin/assets/samples/live-video-platform/cases/danmaku-send-sent.json +8 -4
  142. package/skill/krillplayer-plugin/assets/samples/live-video-platform/cases/play-live-logged-in.json +39 -0
  143. package/skill/krillplayer-plugin/assets/samples/live-video-platform/cases/play-live-selected-backup-line.json +8 -0
  144. package/skill/krillplayer-plugin/assets/samples/live-video-platform/cases/play-live-selected-line-gone.json +8 -0
  145. package/skill/krillplayer-plugin/assets/samples/live-video-platform/cases/play-live.json +8 -0
  146. package/skill/krillplayer-plugin/assets/samples/live-video-platform/plugin.ts +26 -9
  147. package/skill/krillplayer-plugin/references/cases.md +19 -1
  148. package/skill/krillplayer-plugin/references/contract.d.ts +104 -11
  149. package/skill/krillplayer-plugin/references/crypto-tools.md +104 -0
  150. package/skill/krillplayer-plugin/references/errors-and-fixes.md +5 -1
@@ -0,0 +1,98 @@
1
+ /* 由 Scripts/check-wamr.py 写出(--write),不手改:先带上钉住的编译选项、就地核对,再编入库的 WAMR 源文件(ADR 0042)。 */
2
+ #include "kernel_wamr_config.h"
3
+ #if !defined(WASM_ENABLE_INTERP) || WASM_ENABLE_INTERP != 1
4
+ #error "WASM_ENABLE_INTERP is pinned to 1 in kernel_wamr_config.h (ADR 0042)"
5
+ #endif
6
+ #if !defined(WASM_ENABLE_FAST_INTERP) || WASM_ENABLE_FAST_INTERP != 1
7
+ #error "WASM_ENABLE_FAST_INTERP is pinned to 1 in kernel_wamr_config.h (ADR 0042)"
8
+ #endif
9
+ #if !defined(WASM_ENABLE_AOT) || WASM_ENABLE_AOT != 0
10
+ #error "WASM_ENABLE_AOT is pinned to 0 in kernel_wamr_config.h (ADR 0042)"
11
+ #endif
12
+ #if !defined(WASM_ENABLE_JIT) || WASM_ENABLE_JIT != 0
13
+ #error "WASM_ENABLE_JIT is pinned to 0 in kernel_wamr_config.h (ADR 0042)"
14
+ #endif
15
+ #if !defined(WASM_ENABLE_FAST_JIT) || WASM_ENABLE_FAST_JIT != 0
16
+ #error "WASM_ENABLE_FAST_JIT is pinned to 0 in kernel_wamr_config.h (ADR 0042)"
17
+ #endif
18
+ #if !defined(WASM_ENABLE_LAZY_JIT) || WASM_ENABLE_LAZY_JIT != 0
19
+ #error "WASM_ENABLE_LAZY_JIT is pinned to 0 in kernel_wamr_config.h (ADR 0042)"
20
+ #endif
21
+ #if !defined(WASM_ENABLE_LIBC_BUILTIN) || WASM_ENABLE_LIBC_BUILTIN != 0
22
+ #error "WASM_ENABLE_LIBC_BUILTIN is pinned to 0 in kernel_wamr_config.h (ADR 0042)"
23
+ #endif
24
+ #if !defined(WASM_ENABLE_LIBC_WASI) || WASM_ENABLE_LIBC_WASI != 0
25
+ #error "WASM_ENABLE_LIBC_WASI is pinned to 0 in kernel_wamr_config.h (ADR 0042)"
26
+ #endif
27
+ #if !defined(WASM_ENABLE_LIB_PTHREAD) || WASM_ENABLE_LIB_PTHREAD != 0
28
+ #error "WASM_ENABLE_LIB_PTHREAD is pinned to 0 in kernel_wamr_config.h (ADR 0042)"
29
+ #endif
30
+ #if !defined(WASM_ENABLE_LIB_WASI_THREADS) || WASM_ENABLE_LIB_WASI_THREADS != 0
31
+ #error "WASM_ENABLE_LIB_WASI_THREADS is pinned to 0 in kernel_wamr_config.h (ADR 0042)"
32
+ #endif
33
+ #if !defined(WASM_ENABLE_MULTI_MODULE) || WASM_ENABLE_MULTI_MODULE != 0
34
+ #error "WASM_ENABLE_MULTI_MODULE is pinned to 0 in kernel_wamr_config.h (ADR 0042)"
35
+ #endif
36
+ #if !defined(WASM_ENABLE_THREAD_MGR) || WASM_ENABLE_THREAD_MGR != 1
37
+ #error "WASM_ENABLE_THREAD_MGR is pinned to 1 in kernel_wamr_config.h (ADR 0042)"
38
+ #endif
39
+ #if !defined(WASM_ENABLE_SHARED_MEMORY) || WASM_ENABLE_SHARED_MEMORY != 0
40
+ #error "WASM_ENABLE_SHARED_MEMORY is pinned to 0 in kernel_wamr_config.h (ADR 0042)"
41
+ #endif
42
+ #if !defined(WASM_ENABLE_SIMD) || WASM_ENABLE_SIMD != 0
43
+ #error "WASM_ENABLE_SIMD is pinned to 0 in kernel_wamr_config.h (ADR 0042)"
44
+ #endif
45
+ #if !defined(WASM_ENABLE_GC) || WASM_ENABLE_GC != 0
46
+ #error "WASM_ENABLE_GC is pinned to 0 in kernel_wamr_config.h (ADR 0042)"
47
+ #endif
48
+ #if !defined(WASM_ENABLE_EXCE_HANDLING) || WASM_ENABLE_EXCE_HANDLING != 0
49
+ #error "WASM_ENABLE_EXCE_HANDLING is pinned to 0 in kernel_wamr_config.h (ADR 0042)"
50
+ #endif
51
+ #if !defined(WASM_ENABLE_MEMORY64) || WASM_ENABLE_MEMORY64 != 0
52
+ #error "WASM_ENABLE_MEMORY64 is pinned to 0 in kernel_wamr_config.h (ADR 0042)"
53
+ #endif
54
+ #if !defined(WASM_ENABLE_TAIL_CALL) || WASM_ENABLE_TAIL_CALL != 0
55
+ #error "WASM_ENABLE_TAIL_CALL is pinned to 0 in kernel_wamr_config.h (ADR 0042)"
56
+ #endif
57
+ #if !defined(WASM_MEM_ALLOC_WITH_USAGE) || WASM_MEM_ALLOC_WITH_USAGE != 1
58
+ #error "WASM_MEM_ALLOC_WITH_USAGE is pinned to 1 in kernel_wamr_config.h (ADR 0042)"
59
+ #endif
60
+ #if !defined(WASM_DISABLE_HW_BOUND_CHECK) || WASM_DISABLE_HW_BOUND_CHECK != 1
61
+ #error "WASM_DISABLE_HW_BOUND_CHECK is pinned to 1 in kernel_wamr_config.h (ADR 0042)"
62
+ #endif
63
+ #if !defined(WASM_DISABLE_STACK_HW_BOUND_CHECK) || WASM_DISABLE_STACK_HW_BOUND_CHECK != 1
64
+ #error "WASM_DISABLE_STACK_HW_BOUND_CHECK is pinned to 1 in kernel_wamr_config.h (ADR 0042)"
65
+ #endif
66
+ #include "vendor/core/iwasm/common/wasm_runtime_common.c"
67
+ /* 钉住的各项在这个翻译单元编完时的取值(没定义的照原名交出),PluginWasmTests 逐个包装核对(ADR 0042)。 */
68
+ #define KQ_WAMR_TEXT(value) #value
69
+ #define KQ_WAMR_VALUE(value) KQ_WAMR_TEXT(value)
70
+ const char *kq_wamr_options_wasm_runtime_common(void) {
71
+ return
72
+ "WASM_ENABLE_INTERP=" KQ_WAMR_VALUE(WASM_ENABLE_INTERP) " "
73
+ "WASM_ENABLE_FAST_INTERP=" KQ_WAMR_VALUE(WASM_ENABLE_FAST_INTERP) " "
74
+ "WASM_ENABLE_AOT=" KQ_WAMR_VALUE(WASM_ENABLE_AOT) " "
75
+ "WASM_ENABLE_JIT=" KQ_WAMR_VALUE(WASM_ENABLE_JIT) " "
76
+ "WASM_ENABLE_FAST_JIT=" KQ_WAMR_VALUE(WASM_ENABLE_FAST_JIT) " "
77
+ "WASM_ENABLE_LAZY_JIT=" KQ_WAMR_VALUE(WASM_ENABLE_LAZY_JIT) " "
78
+ "WASM_ENABLE_LIBC_BUILTIN=" KQ_WAMR_VALUE(WASM_ENABLE_LIBC_BUILTIN) " "
79
+ "WASM_ENABLE_LIBC_WASI=" KQ_WAMR_VALUE(WASM_ENABLE_LIBC_WASI) " "
80
+ "WASM_ENABLE_LIB_PTHREAD=" KQ_WAMR_VALUE(WASM_ENABLE_LIB_PTHREAD) " "
81
+ "WASM_ENABLE_LIB_WASI_THREADS=" KQ_WAMR_VALUE(WASM_ENABLE_LIB_WASI_THREADS) " "
82
+ "WASM_ENABLE_MULTI_MODULE=" KQ_WAMR_VALUE(WASM_ENABLE_MULTI_MODULE) " "
83
+ "WASM_ENABLE_THREAD_MGR=" KQ_WAMR_VALUE(WASM_ENABLE_THREAD_MGR) " "
84
+ "WASM_ENABLE_SHARED_MEMORY=" KQ_WAMR_VALUE(WASM_ENABLE_SHARED_MEMORY) " "
85
+ "WASM_ENABLE_SIMD=" KQ_WAMR_VALUE(WASM_ENABLE_SIMD) " "
86
+ "WASM_ENABLE_GC=" KQ_WAMR_VALUE(WASM_ENABLE_GC) " "
87
+ "WASM_ENABLE_EXCE_HANDLING=" KQ_WAMR_VALUE(WASM_ENABLE_EXCE_HANDLING) " "
88
+ "WASM_ENABLE_MEMORY64=" KQ_WAMR_VALUE(WASM_ENABLE_MEMORY64) " "
89
+ "WASM_ENABLE_TAIL_CALL=" KQ_WAMR_VALUE(WASM_ENABLE_TAIL_CALL) " "
90
+ "WASM_MEM_ALLOC_WITH_USAGE=" KQ_WAMR_VALUE(WASM_MEM_ALLOC_WITH_USAGE) " "
91
+ "WASM_DISABLE_HW_BOUND_CHECK=" KQ_WAMR_VALUE(WASM_DISABLE_HW_BOUND_CHECK) " "
92
+ "WASM_DISABLE_STACK_HW_BOUND_CHECK=" KQ_WAMR_VALUE(WASM_DISABLE_STACK_HW_BOUND_CHECK) " "
93
+ #if defined(OS_ENABLE_HW_BOUND_CHECK)
94
+ "OS_ENABLE_HW_BOUND_CHECK=1";
95
+ #else
96
+ "OS_ENABLE_HW_BOUND_CHECK=0";
97
+ #endif
98
+ }
@@ -0,0 +1,98 @@
1
+ /* 由 Scripts/check-wamr.py 写出(--write),不手改:先带上钉住的编译选项、就地核对,再编入库的 WAMR 源文件(ADR 0042)。 */
2
+ #include "kernel_wamr_config.h"
3
+ #if !defined(WASM_ENABLE_INTERP) || WASM_ENABLE_INTERP != 1
4
+ #error "WASM_ENABLE_INTERP is pinned to 1 in kernel_wamr_config.h (ADR 0042)"
5
+ #endif
6
+ #if !defined(WASM_ENABLE_FAST_INTERP) || WASM_ENABLE_FAST_INTERP != 1
7
+ #error "WASM_ENABLE_FAST_INTERP is pinned to 1 in kernel_wamr_config.h (ADR 0042)"
8
+ #endif
9
+ #if !defined(WASM_ENABLE_AOT) || WASM_ENABLE_AOT != 0
10
+ #error "WASM_ENABLE_AOT is pinned to 0 in kernel_wamr_config.h (ADR 0042)"
11
+ #endif
12
+ #if !defined(WASM_ENABLE_JIT) || WASM_ENABLE_JIT != 0
13
+ #error "WASM_ENABLE_JIT is pinned to 0 in kernel_wamr_config.h (ADR 0042)"
14
+ #endif
15
+ #if !defined(WASM_ENABLE_FAST_JIT) || WASM_ENABLE_FAST_JIT != 0
16
+ #error "WASM_ENABLE_FAST_JIT is pinned to 0 in kernel_wamr_config.h (ADR 0042)"
17
+ #endif
18
+ #if !defined(WASM_ENABLE_LAZY_JIT) || WASM_ENABLE_LAZY_JIT != 0
19
+ #error "WASM_ENABLE_LAZY_JIT is pinned to 0 in kernel_wamr_config.h (ADR 0042)"
20
+ #endif
21
+ #if !defined(WASM_ENABLE_LIBC_BUILTIN) || WASM_ENABLE_LIBC_BUILTIN != 0
22
+ #error "WASM_ENABLE_LIBC_BUILTIN is pinned to 0 in kernel_wamr_config.h (ADR 0042)"
23
+ #endif
24
+ #if !defined(WASM_ENABLE_LIBC_WASI) || WASM_ENABLE_LIBC_WASI != 0
25
+ #error "WASM_ENABLE_LIBC_WASI is pinned to 0 in kernel_wamr_config.h (ADR 0042)"
26
+ #endif
27
+ #if !defined(WASM_ENABLE_LIB_PTHREAD) || WASM_ENABLE_LIB_PTHREAD != 0
28
+ #error "WASM_ENABLE_LIB_PTHREAD is pinned to 0 in kernel_wamr_config.h (ADR 0042)"
29
+ #endif
30
+ #if !defined(WASM_ENABLE_LIB_WASI_THREADS) || WASM_ENABLE_LIB_WASI_THREADS != 0
31
+ #error "WASM_ENABLE_LIB_WASI_THREADS is pinned to 0 in kernel_wamr_config.h (ADR 0042)"
32
+ #endif
33
+ #if !defined(WASM_ENABLE_MULTI_MODULE) || WASM_ENABLE_MULTI_MODULE != 0
34
+ #error "WASM_ENABLE_MULTI_MODULE is pinned to 0 in kernel_wamr_config.h (ADR 0042)"
35
+ #endif
36
+ #if !defined(WASM_ENABLE_THREAD_MGR) || WASM_ENABLE_THREAD_MGR != 1
37
+ #error "WASM_ENABLE_THREAD_MGR is pinned to 1 in kernel_wamr_config.h (ADR 0042)"
38
+ #endif
39
+ #if !defined(WASM_ENABLE_SHARED_MEMORY) || WASM_ENABLE_SHARED_MEMORY != 0
40
+ #error "WASM_ENABLE_SHARED_MEMORY is pinned to 0 in kernel_wamr_config.h (ADR 0042)"
41
+ #endif
42
+ #if !defined(WASM_ENABLE_SIMD) || WASM_ENABLE_SIMD != 0
43
+ #error "WASM_ENABLE_SIMD is pinned to 0 in kernel_wamr_config.h (ADR 0042)"
44
+ #endif
45
+ #if !defined(WASM_ENABLE_GC) || WASM_ENABLE_GC != 0
46
+ #error "WASM_ENABLE_GC is pinned to 0 in kernel_wamr_config.h (ADR 0042)"
47
+ #endif
48
+ #if !defined(WASM_ENABLE_EXCE_HANDLING) || WASM_ENABLE_EXCE_HANDLING != 0
49
+ #error "WASM_ENABLE_EXCE_HANDLING is pinned to 0 in kernel_wamr_config.h (ADR 0042)"
50
+ #endif
51
+ #if !defined(WASM_ENABLE_MEMORY64) || WASM_ENABLE_MEMORY64 != 0
52
+ #error "WASM_ENABLE_MEMORY64 is pinned to 0 in kernel_wamr_config.h (ADR 0042)"
53
+ #endif
54
+ #if !defined(WASM_ENABLE_TAIL_CALL) || WASM_ENABLE_TAIL_CALL != 0
55
+ #error "WASM_ENABLE_TAIL_CALL is pinned to 0 in kernel_wamr_config.h (ADR 0042)"
56
+ #endif
57
+ #if !defined(WASM_MEM_ALLOC_WITH_USAGE) || WASM_MEM_ALLOC_WITH_USAGE != 1
58
+ #error "WASM_MEM_ALLOC_WITH_USAGE is pinned to 1 in kernel_wamr_config.h (ADR 0042)"
59
+ #endif
60
+ #if !defined(WASM_DISABLE_HW_BOUND_CHECK) || WASM_DISABLE_HW_BOUND_CHECK != 1
61
+ #error "WASM_DISABLE_HW_BOUND_CHECK is pinned to 1 in kernel_wamr_config.h (ADR 0042)"
62
+ #endif
63
+ #if !defined(WASM_DISABLE_STACK_HW_BOUND_CHECK) || WASM_DISABLE_STACK_HW_BOUND_CHECK != 1
64
+ #error "WASM_DISABLE_STACK_HW_BOUND_CHECK is pinned to 1 in kernel_wamr_config.h (ADR 0042)"
65
+ #endif
66
+ #include "vendor/core/iwasm/common/wasm_shared_memory.c"
67
+ /* 钉住的各项在这个翻译单元编完时的取值(没定义的照原名交出),PluginWasmTests 逐个包装核对(ADR 0042)。 */
68
+ #define KQ_WAMR_TEXT(value) #value
69
+ #define KQ_WAMR_VALUE(value) KQ_WAMR_TEXT(value)
70
+ const char *kq_wamr_options_wasm_shared_memory(void) {
71
+ return
72
+ "WASM_ENABLE_INTERP=" KQ_WAMR_VALUE(WASM_ENABLE_INTERP) " "
73
+ "WASM_ENABLE_FAST_INTERP=" KQ_WAMR_VALUE(WASM_ENABLE_FAST_INTERP) " "
74
+ "WASM_ENABLE_AOT=" KQ_WAMR_VALUE(WASM_ENABLE_AOT) " "
75
+ "WASM_ENABLE_JIT=" KQ_WAMR_VALUE(WASM_ENABLE_JIT) " "
76
+ "WASM_ENABLE_FAST_JIT=" KQ_WAMR_VALUE(WASM_ENABLE_FAST_JIT) " "
77
+ "WASM_ENABLE_LAZY_JIT=" KQ_WAMR_VALUE(WASM_ENABLE_LAZY_JIT) " "
78
+ "WASM_ENABLE_LIBC_BUILTIN=" KQ_WAMR_VALUE(WASM_ENABLE_LIBC_BUILTIN) " "
79
+ "WASM_ENABLE_LIBC_WASI=" KQ_WAMR_VALUE(WASM_ENABLE_LIBC_WASI) " "
80
+ "WASM_ENABLE_LIB_PTHREAD=" KQ_WAMR_VALUE(WASM_ENABLE_LIB_PTHREAD) " "
81
+ "WASM_ENABLE_LIB_WASI_THREADS=" KQ_WAMR_VALUE(WASM_ENABLE_LIB_WASI_THREADS) " "
82
+ "WASM_ENABLE_MULTI_MODULE=" KQ_WAMR_VALUE(WASM_ENABLE_MULTI_MODULE) " "
83
+ "WASM_ENABLE_THREAD_MGR=" KQ_WAMR_VALUE(WASM_ENABLE_THREAD_MGR) " "
84
+ "WASM_ENABLE_SHARED_MEMORY=" KQ_WAMR_VALUE(WASM_ENABLE_SHARED_MEMORY) " "
85
+ "WASM_ENABLE_SIMD=" KQ_WAMR_VALUE(WASM_ENABLE_SIMD) " "
86
+ "WASM_ENABLE_GC=" KQ_WAMR_VALUE(WASM_ENABLE_GC) " "
87
+ "WASM_ENABLE_EXCE_HANDLING=" KQ_WAMR_VALUE(WASM_ENABLE_EXCE_HANDLING) " "
88
+ "WASM_ENABLE_MEMORY64=" KQ_WAMR_VALUE(WASM_ENABLE_MEMORY64) " "
89
+ "WASM_ENABLE_TAIL_CALL=" KQ_WAMR_VALUE(WASM_ENABLE_TAIL_CALL) " "
90
+ "WASM_MEM_ALLOC_WITH_USAGE=" KQ_WAMR_VALUE(WASM_MEM_ALLOC_WITH_USAGE) " "
91
+ "WASM_DISABLE_HW_BOUND_CHECK=" KQ_WAMR_VALUE(WASM_DISABLE_HW_BOUND_CHECK) " "
92
+ "WASM_DISABLE_STACK_HW_BOUND_CHECK=" KQ_WAMR_VALUE(WASM_DISABLE_STACK_HW_BOUND_CHECK) " "
93
+ #if defined(OS_ENABLE_HW_BOUND_CHECK)
94
+ "OS_ENABLE_HW_BOUND_CHECK=1";
95
+ #else
96
+ "OS_ENABLE_HW_BOUND_CHECK=0";
97
+ #endif
98
+ }
@@ -1,11 +1,11 @@
1
1
  // 插件代码之前在每个上下文里执行的一段 JS,App 内核(PluginPrelude.swift)与试跑器(plugins/trial-runner/engine.ts)读的是这同一个文件。
2
- // 它是一个函数表达式,引擎以 (native, utf8Encode, utf8Decode) 调用它(kernel_qjs.h 的 kq_install)。__GLOBALS__ 由两边换成
2
+ // 它是一个函数表达式,引擎以 (native, utf8Encode, utf8Decode, instantiate) 调用它(kernel_qjs.h 的 kq_install)。__GLOBALS__ 由两边换成
3
3
  // plugins/host/globals.ts 的全局对象清单。它删掉清单外的全局,补上原生实现的 TextEncoder / TextDecoder(只支持 UTF-8),
4
4
  // 建好交给插件的 krillplayer,并返回宿主调用插件用的分发函数。与宿主之间的值按 KrillPlayerWire 的线格式传。
5
5
  // console.* 接到 krillplayer.log(ADR 0019):log 与 info 记为 info,trace 记为 debug;参数按空格连起来,
6
6
  // 错误写成「名字: 说明」,别的不是字符串的先 JSON.stringify,转不了的用 String,再不行写 [unprintable]。
7
7
  // 插件改坏这里捕获前的内建只会弄坏它自己:域名与凭证的检查都在宿主一侧。
8
- (function (native, utf8Encode, utf8Decode) {
8
+ (function (native, utf8Encode, utf8Decode, instantiate) {
9
9
  "use strict";
10
10
  const allowed = new Set(__GLOBALS__);
11
11
  const { stringify, parse } = JSON;
@@ -213,6 +213,9 @@
213
213
  },
214
214
  }),
215
215
  parameters: freeze({ get: () => call("parameters.get", []) }),
216
+ // WebAssembly(ADR 0042):模块的字节由宿主按清单 modules 的名字给,经过插件改得了的 Map 与 Promise 才到这里,
217
+ // 所以长度与 SHA-256 由引擎按宿主登记的清单核对(kernel_wasm.c 的 kq_declare_module),实例化与沙箱也在引擎里。
218
+ wasm: freeze({ instantiate: async (name, imports) => instantiate(name, await start("wasm.module", [name]), imports ?? {}) }),
216
219
  // App 自己的密钥(#617):只有预装插件、只有清单 appKeys 写了的名字拿得到,别的都是 null。名字由宿主检查。
217
220
  appKeys: freeze({ get: async (name) => start("appKeys.get", [name]) }),
218
221
  // 词典与当前界面语言在宿主一侧(contract.md 第 5 节)。参数原样交过去,检查与报错由宿主做。
@@ -0,0 +1,50 @@
1
+ // 用例给时刻与随机数定值时(#895)套在前导脚本外面的一层:只有两个运行方跑用例时装它,App 不装。
2
+ // 试跑器(plugins/trial-runner/engine.ts 的 pinnedPrelude,经 kernelDirectory;npm 包里在 kernel/Tests/KernelTests/)与内核的用例回放
3
+ // (同目录的 CasePins.swift,作为测试包的资源)读这同一个文件,换掉下面三个两边带双下划线的占位(注释里不写它们的全名,免得也被换掉):CLOCK 是纪元毫秒数,或 null(时刻照真的走);
4
+ // RANDOM 为 true 时 Math.random 也向宿主的 crypto.randomBytes 取字节,与 krillplayer.crypto.randomBytes 同一串(宿主那一侧按用例的
5
+ // random 给、或录制时照真的取并记下);PRELUDE 是换好全局清单的前导脚本。它在前导脚本之前跑,换掉的 Date 与 Math.random
6
+ // 都在全局清单里,前导脚本不删。
7
+ (function (native, utf8Encode, utf8Decode, instantiate) {
8
+ "use strict";
9
+ const clock = __CLOCK__;
10
+ const pinRandom = __RANDOM__;
11
+ const { defineProperty } = Object;
12
+ const construct = Reflect.construct;
13
+
14
+ if (clock !== null) {
15
+ const RealDate = Date;
16
+ // 不带参数时是这一刻,带参数时同原来的 Date;当函数调用(不带 new)时给这一刻的字符串。
17
+ function PinnedDate(...args) {
18
+ if (new.target === undefined) return new RealDate(clock).toString();
19
+ return construct(RealDate, args.length === 0 ? [clock] : args, new.target);
20
+ }
21
+ defineProperty(PinnedDate, "prototype", { value: RealDate.prototype });
22
+ defineProperty(PinnedDate, "length", { value: RealDate.length });
23
+ defineProperty(PinnedDate, "name", { value: "Date" });
24
+ defineProperty(PinnedDate, "now", { value: function now() { return clock; }, writable: true, configurable: true });
25
+ defineProperty(PinnedDate, "parse", { value: RealDate.parse, writable: true, configurable: true });
26
+ defineProperty(PinnedDate, "UTC", { value: RealDate.UTC, writable: true, configurable: true });
27
+ defineProperty(RealDate.prototype, "constructor", { value: PinnedDate, writable: true, configurable: true });
28
+ defineProperty(globalThis, "Date", { value: PinnedDate, writable: true, configurable: true });
29
+ }
30
+
31
+ if (pinRandom) {
32
+ // 线格式同前导脚本的 call:[消息, 各字节块的长度]。回的字节块就是那 7 个字节。
33
+ const request = '[{"op":"call","name":"crypto.randomBytes","args":[7]},[]]';
34
+ const none = new Uint8Array(0);
35
+ // 7 个字节是 56 位,取高 53 位,与 Math.random 一样落在 [0, 1)。
36
+ defineProperty(Math, "random", {
37
+ value: function random() {
38
+ const bytes = native(request, none)[1];
39
+ if (bytes.length !== 7) throw new TypeError("Math.random: the host gave no random bytes");
40
+ const high = bytes[0] * 65536 + bytes[1] * 256 + bytes[2];
41
+ const low = bytes[3] * 16777216 + bytes[4] * 65536 + bytes[5] * 256 + bytes[6];
42
+ return (high * 536870912 + (low - (low % 8)) / 8) / 9007199254740992;
43
+ },
44
+ writable: true,
45
+ configurable: true,
46
+ });
47
+ }
48
+
49
+ return (__PRELUDE__)(native, utf8Encode, utf8Decode, instantiate);
50
+ })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "krillplayer-plugin",
3
- "version": "0.6.0",
3
+ "version": "0.7.0",
4
4
  "description": "Write, pack, record and test KrillPlayer source plugins on the App's own QuickJS-ng engine, with an AI skill.",
5
5
  "license": "MIT",
6
6
  "homepage": "https://krillplayer.kami.asia",
@@ -41,6 +41,6 @@
41
41
  "eslint": "9.39.5"
42
42
  },
43
43
  "optionalDependencies": {
44
- "@krillplayer/plugin-engine-darwin-arm64": "0.6.0"
44
+ "@krillplayer/plugin-engine-darwin-arm64": "0.7.0"
45
45
  }
46
46
  }
@@ -19,6 +19,7 @@ metadata:
19
19
  | 一样内容该写成哪个种类 | [references/choosing-a-kind.md](references/choosing-a-kind.md) |
20
20
  | 某条报错什么意思、怎么改 | [references/errors-and-fixes.md](references/errors-and-fixes.md) |
21
21
  | 用例文件怎么写、怎么录、失败情形怎么造 | [references/cases.md](references/cases.md) |
22
+ | 来源要摘要、签名或加解密:`krillplayer.crypto` 有哪些算法、各自适合什么,带时刻与随机数的签名怎么录成可复现的用例 | [references/crypto-tools.md](references/crypto-tools.md) |
22
23
  | 平台只在 WebSocket 上收弹幕:`danmaku.send` 返回发送会话、`sendDecode` 判收到的帧,用例里写假服务器 `socket` | [references/contract.d.ts](references/contract.d.ts) 的 `DanmakuSlot`,[references/cases.md](references/cases.md)「socket」 |
23
24
  | 照着改的样例:媒体服务器、文件类来源(`file-share` 用 `krillplayer.formats.xml` 解 WebDAV 的目录,`network-share` 经 `krillplayer.files` 让 App 替它读 SMB 共享)、既直播又发视频的平台、电视、播客、弹幕工具(`danmaku.match` 与 `comments`)、字幕工具(`subtitles.search` 与 `fetch`)、资源插件(`resources.find`:按作品回答有没有可播的版本)、目录插件(只导出 `browse`,作品清单经 `krillplayer.metadata` 查),数据都写在插件里、不出网 | `assets/samples/<样例>/`:`plugin.ts`、`manifest.ts`、`cases/` |
24
25
  | 出网的样例:`krillplayer.http.request`、解 JSON、HTTP 状态到错误种类、录下来的 `exchanges`、手工造的失败用例 | `assets/samples/internet-archive/` |
@@ -56,6 +57,7 @@ cd <目录> && npm install && npx krillplayer-plugin check
56
57
  - `plugin.ts` 只导出槽位对象与 `resolve`,每个槽位写成对象字面量并 `satisfies <槽位>Slot`,辅助函数不导出。类型从包里 import:`import type { BrowseSlot, Entry, PlaySlot } from "krillplayer-plugin";`。插件不能在运行时 import 任何东西,只有 `import type`。
57
58
  - `manifest.ts` 只写元数据:`export default { … } satisfies Omit<PluginManifest, "capabilities">`。`interfaceLevel` 与 `contractRevision` 写成 `contract.d.ts` 里 `InterfaceLevel`、`ContractRevision` 的字面量。能力(`capabilities`)由打包器按导出生成,不手写。
58
59
  - 插件里没有 `fetch`、`setTimeout`、`URL`、`URLSearchParams`、`atob`、`Buffer`、`Intl`:出网用 `krillplayer.http.request`,应答的 `body` 是字节,文本用 `new TextDecoder().decode(response.body)`,JSON 再 `JSON.parse`。地址用字符串拼,查询参数用 `encodeURIComponent`。
60
+ - 跳转默认由 App 跟,只交回最后一跳,跨到别的源时不带 `Cookie` 这类凭证请求头。换票链这类每一跳都有要收的 `set-cookie`、或下一跳要带凭证去另一台主机的,请求时写 `redirect: "manual"`:3xx 原样交回(`location` 与这一跳的 `set-cookie`),自己再请求 `location`,每一跳在用例里各录一条。自己跟的那一跳和别的请求一样,主机要在 `hosts` 里。
59
61
  - 来源返回的东西一律当不可信输入:字段缺失、类型不对、列表为空都给出确定的结果(跳过这一项,或 `throw krillplayer.error(kind, message)`),不让读 `undefined` 属性的 `TypeError` 冒出去变成 `other`。
60
62
  - 自己起名、给人看的字符串(清单的名字、参数标题与选项、运行时返回的标题)写原文,`manifest.ts` 写 `language`(原文的语言);译文放插件目录的 `locales/<语言标签>.json`,每个文件一张「原文 → 译文」的表。运行时返回的标题用 `krillplayer.i18n("共 {count} 集", { count })` 翻,同一句原文两处意思不同时给第三个参数 `context`、键写成 `原文|context`;不做复数变形。译文的占位符要与原文一致,全部词典合计不超过 256 KiB。来源给的内容(节目标题、简介)不翻。
61
63
  - 翻页一律用游标:`list` 等函数收 `cursor`,返回 `{ entries, next? }`;`next` 的内容由你定(页码、偏移、来源给的令牌都行),还有下一页才给。条目已经按播放顺序排好,App 不重排。
@@ -5,11 +5,18 @@
5
5
  "session-88231",
6
6
  "买粉加我"
7
7
  ],
8
+ "credentials": {
9
+ "token": "REDACTED-0000000000"
10
+ },
11
+ "clock": 1796407873894,
12
+ "random": {
13
+ "$bytes": "NySkWPrq6Vs="
14
+ },
8
15
  "exchanges": [
9
16
  {
10
17
  "request": {
11
18
  "method": "POST",
12
- "url": "https://live.example/room/session-88231/danmaku",
19
+ "url": "https://live.example/room/session-88231/danmaku?ts=1796407873&nonce=3724a458faeae95b&sign=faa4317a3efbfd3702145e9b3252bc0c9bd38378b72262ffe160d84e0c5b7277",
13
20
  "body": "{\"text\":\"买粉加我\"}"
14
21
  },
15
22
  "response": {
@@ -21,9 +28,6 @@
21
28
  }
22
29
  }
23
30
  ],
24
- "credentials": {
25
- "token": "REDACTED"
26
- },
27
31
  "error": {
28
32
  "kind": "contentRejected",
29
33
  "message": "内容含有屏蔽词"
@@ -5,11 +5,18 @@
5
5
  "session-88231",
6
6
  "晚上好"
7
7
  ],
8
+ "credentials": {
9
+ "token": "REDACTED-0000000000"
10
+ },
11
+ "clock": 1796407874117,
12
+ "random": {
13
+ "$bytes": "DFu73IJ3yIk="
14
+ },
8
15
  "exchanges": [
9
16
  {
10
17
  "request": {
11
18
  "method": "POST",
12
- "url": "https://live.example/room/session-88231/danmaku",
19
+ "url": "https://live.example/room/session-88231/danmaku?ts=1796407874&nonce=0c5bbbdc8277c889&sign=fbc2825959d9a068271e753cebde45be23df1bcd7adfec09fc94a980d687f881",
13
20
  "body": "{\"text\":\"晚上好\"}"
14
21
  },
15
22
  "response": {
@@ -21,9 +28,6 @@
21
28
  }
22
29
  }
23
30
  ],
24
- "credentials": {
25
- "token": "REDACTED"
26
- },
27
31
  "error": {
28
32
  "kind": "loginRequired",
29
33
  "message": "登录已过期"
@@ -5,11 +5,18 @@
5
5
  "session-88231",
6
6
  "晚上好"
7
7
  ],
8
+ "credentials": {
9
+ "token": "REDACTED-0000000000"
10
+ },
11
+ "clock": 1796407874169,
12
+ "random": {
13
+ "$bytes": "iXppnTQdXcg="
14
+ },
8
15
  "exchanges": [
9
16
  {
10
17
  "request": {
11
18
  "method": "POST",
12
- "url": "https://live.example/room/session-88231/danmaku",
19
+ "url": "https://live.example/room/session-88231/danmaku?ts=1796407874&nonce=897a699d341d5dc8&sign=83850a5f268a977e49251287906475d8befcd78f09c825ce9bd2a5fbaee8427f",
13
20
  "body": "{\"text\":\"晚上好\"}"
14
21
  },
15
22
  "response": {
@@ -21,9 +28,6 @@
21
28
  }
22
29
  }
23
30
  ],
24
- "credentials": {
25
- "token": "REDACTED"
26
- },
27
31
  "error": {
28
32
  "kind": "muted",
29
33
  "message": "你已被房管禁言"
@@ -5,11 +5,18 @@
5
5
  "session-88231",
6
6
  "晚上好"
7
7
  ],
8
+ "credentials": {
9
+ "token": "REDACTED-0000000000"
10
+ },
11
+ "clock": 1796407874213,
12
+ "random": {
13
+ "$bytes": "DrMGXcK2Cbc="
14
+ },
8
15
  "exchanges": [
9
16
  {
10
17
  "request": {
11
18
  "method": "POST",
12
- "url": "https://live.example/room/session-88231/danmaku",
19
+ "url": "https://live.example/room/session-88231/danmaku?ts=1796407874&nonce=0eb3065dc2b609b7&sign=074c250f4b5980e3a59a56a7c0e2eb937c55abf4c004c6e637a9b8f9a7885827",
13
20
  "body": "{\"text\":\"晚上好\"}"
14
21
  },
15
22
  "response": {
@@ -21,9 +28,6 @@
21
28
  }
22
29
  }
23
30
  ],
24
- "credentials": {
25
- "token": "REDACTED"
26
- },
27
31
  "error": {
28
32
  "kind": "other",
29
33
  "message": "发送接口返回 503"
@@ -5,11 +5,18 @@
5
5
  "session-88231",
6
6
  "晚上好"
7
7
  ],
8
+ "credentials": {
9
+ "token": "REDACTED-0000000000"
10
+ },
11
+ "clock": 1796407874267,
12
+ "random": {
13
+ "$bytes": "H8OwXwaXgyw="
14
+ },
8
15
  "exchanges": [
9
16
  {
10
17
  "request": {
11
18
  "method": "POST",
12
- "url": "https://live.example/room/session-88231/danmaku",
19
+ "url": "https://live.example/room/session-88231/danmaku?ts=1796407874&nonce=1fc3b05f0697832c&sign=11b59bf2ca08af2d31fcfa2ec2d3d64b0eb3050936a747cb70e53a8469430798",
13
20
  "body": "{\"text\":\"晚上好\"}"
14
21
  },
15
22
  "response": {
@@ -21,9 +28,6 @@
21
28
  }
22
29
  }
23
30
  ],
24
- "credentials": {
25
- "token": "REDACTED"
26
- },
27
31
  "error": {
28
32
  "kind": "rateLimited",
29
33
  "message": "发送太频繁"
@@ -5,11 +5,18 @@
5
5
  "session-88231",
6
6
  "晚上好"
7
7
  ],
8
+ "credentials": {
9
+ "token": "REDACTED-0000000000"
10
+ },
11
+ "clock": 1796407874351,
12
+ "random": {
13
+ "$bytes": "8Q0xc2izXUI="
14
+ },
8
15
  "exchanges": [
9
16
  {
10
17
  "request": {
11
18
  "method": "POST",
12
- "url": "https://live.example/room/session-88231/danmaku",
19
+ "url": "https://live.example/room/session-88231/danmaku?ts=1796407874&nonce=f10d317368b35d42&sign=ea0e71ba2322e0f85828ab60b83035717fe81e83ca121dddf1b582d6a19ba9a7",
13
20
  "body": "{\"text\":\"晚上好\"}"
14
21
  },
15
22
  "response": {
@@ -21,8 +28,5 @@
21
28
  }
22
29
  }
23
30
  ],
24
- "credentials": {
25
- "token": "REDACTED"
26
- },
27
31
  "output": null
28
32
  }
@@ -0,0 +1,39 @@
1
+ {
2
+ "slot": "play",
3
+ "call": "start",
4
+ "args": [
5
+ "session-88231"
6
+ ],
7
+ "exchanges": [],
8
+ "credentials": {
9
+ "token": "REDACTED"
10
+ },
11
+ "output": {
12
+ "timing": "live",
13
+ "lines": [
14
+ {
15
+ "name": "主线路",
16
+ "streams": [
17
+ {
18
+ "quality": "蓝光",
19
+ "url": "https://cdn.example/live/session-88231/main/1080p.m3u8"
20
+ }
21
+ ],
22
+ "qualities": [
23
+ "蓝光",
24
+ "原画",
25
+ "高清"
26
+ ]
27
+ },
28
+ {
29
+ "name": "备用线路",
30
+ "streams": [],
31
+ "qualities": [
32
+ "蓝光",
33
+ "原画",
34
+ "高清"
35
+ ]
36
+ }
37
+ ]
38
+ }
39
+ }
@@ -16,8 +16,12 @@
16
16
  "name": "主线路",
17
17
  "streams": [],
18
18
  "qualities": [
19
+ "蓝光",
19
20
  "原画",
20
21
  "高清"
22
+ ],
23
+ "loginQualities": [
24
+ "蓝光"
21
25
  ]
22
26
  },
23
27
  {
@@ -29,8 +33,12 @@
29
33
  }
30
34
  ],
31
35
  "qualities": [
36
+ "蓝光",
32
37
  "原画",
33
38
  "高清"
39
+ ],
40
+ "loginQualities": [
41
+ "蓝光"
34
42
  ]
35
43
  }
36
44
  ]
@@ -21,16 +21,24 @@
21
21
  }
22
22
  ],
23
23
  "qualities": [
24
+ "蓝光",
24
25
  "原画",
25
26
  "高清"
27
+ ],
28
+ "loginQualities": [
29
+ "蓝光"
26
30
  ]
27
31
  },
28
32
  {
29
33
  "name": "备用线路",
30
34
  "streams": [],
31
35
  "qualities": [
36
+ "蓝光",
32
37
  "原画",
33
38
  "高清"
39
+ ],
40
+ "loginQualities": [
41
+ "蓝光"
34
42
  ]
35
43
  }
36
44
  ]
@@ -17,16 +17,24 @@
17
17
  }
18
18
  ],
19
19
  "qualities": [
20
+ "蓝光",
20
21
  "原画",
21
22
  "高清"
23
+ ],
24
+ "loginQualities": [
25
+ "蓝光"
22
26
  ]
23
27
  },
24
28
  {
25
29
  "name": "备用线路",
26
30
  "streams": [],
27
31
  "qualities": [
32
+ "蓝光",
28
33
  "原画",
29
34
  "高清"
35
+ ],
36
+ "loginQualities": [
37
+ "蓝光"
30
38
  ]
31
39
  }
32
40
  ]