ms-vite-plugin 1.4.59 → 1.4.60

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 (80) hide show
  1. package/dist/luaBundle.js +1 -1
  2. package/dist/luaObfuscator/addVararg.d.ts +2 -0
  3. package/dist/luaObfuscator/addVararg.js +1 -0
  4. package/dist/luaObfuscator/antiTamper.d.ts +2 -0
  5. package/dist/luaObfuscator/antiTamper.js +26 -0
  6. package/dist/luaObfuscator/ast.d.ts +191 -0
  7. package/dist/luaObfuscator/ast.js +1 -0
  8. package/dist/luaObfuscator/cipher.d.ts +10 -0
  9. package/dist/luaObfuscator/cipher.js +28 -0
  10. package/dist/luaObfuscator/compiler.d.ts +31 -0
  11. package/dist/luaObfuscator/compiler.js +1 -0
  12. package/dist/luaObfuscator/constantArray.d.ts +5 -0
  13. package/dist/luaObfuscator/constantArray.js +1 -0
  14. package/dist/luaObfuscator/flatten.d.ts +2 -0
  15. package/dist/luaObfuscator/flatten.js +1 -0
  16. package/dist/luaObfuscator/index.d.ts +6 -0
  17. package/dist/luaObfuscator/index.js +1 -0
  18. package/dist/luaObfuscator/lexer.d.ts +14 -0
  19. package/dist/luaObfuscator/lexer.js +10 -0
  20. package/dist/luaObfuscator/minify.d.ts +3 -0
  21. package/dist/luaObfuscator/minify.js +1 -0
  22. package/dist/luaObfuscator/numbers.d.ts +2 -0
  23. package/dist/luaObfuscator/numbers.js +1 -0
  24. package/dist/luaObfuscator/opcodes.d.ts +3 -0
  25. package/dist/luaObfuscator/opcodes.js +1 -0
  26. package/dist/luaObfuscator/parser.d.ts +8 -0
  27. package/dist/luaObfuscator/parser.js +1 -0
  28. package/dist/luaObfuscator/rename.d.ts +3 -0
  29. package/dist/luaObfuscator/rename.js +1 -0
  30. package/dist/luaObfuscator/reserved.d.ts +5 -0
  31. package/dist/luaObfuscator/reserved.js +1 -0
  32. package/dist/luaObfuscator/scope.d.ts +11 -0
  33. package/dist/luaObfuscator/scope.js +1 -0
  34. package/dist/luaObfuscator/selftest.d.ts +1 -0
  35. package/dist/luaObfuscator/selftest.js +39 -0
  36. package/dist/luaObfuscator/splitStrings.d.ts +2 -0
  37. package/dist/luaObfuscator/splitStrings.js +1 -0
  38. package/dist/luaObfuscator/strings.d.ts +4 -0
  39. package/dist/luaObfuscator/strings.js +1 -0
  40. package/dist/luaObfuscator/visit.d.ts +5 -0
  41. package/dist/luaObfuscator/visit.js +1 -0
  42. package/dist/luaObfuscator/vmEmit.d.ts +2 -0
  43. package/dist/luaObfuscator/vmEmit.js +281 -0
  44. package/dist/luaObfuscator/wrapInFunction.d.ts +2 -0
  45. package/dist/luaObfuscator/wrapInFunction.js +1 -0
  46. package/docs/AGENTS.md +1 -1
  47. package/docs/SKILL.md +1 -1
  48. package/docs/apilua/action.md +2 -27
  49. package/docs/apilua/appleocr.md +2 -6
  50. package/docs/apilua/cloud.md +2 -6
  51. package/docs/apilua/config.md +2 -6
  52. package/docs/apilua/cryptoUtils.md +2 -7
  53. package/docs/apilua/device.md +2 -19
  54. package/docs/apilua/dotocr.md +2 -5
  55. package/docs/apilua/file.md +2 -17
  56. package/docs/apilua/global.md +1 -1
  57. package/docs/apilua/hid.md +2 -44
  58. package/docs/apilua/hotUpdate.md +2 -3
  59. package/docs/apilua/http.md +2 -7
  60. package/docs/apilua/image.md +2 -20
  61. package/docs/apilua/ime.md +2 -10
  62. package/docs/apilua/logger.md +3 -9
  63. package/docs/apilua/media.md +2 -9
  64. package/docs/apilua/mysql.md +2 -10
  65. package/docs/apilua/netCard.md +2 -6
  66. package/docs/apilua/node.md +2 -3
  67. package/docs/apilua/opencv.md +1 -27
  68. package/docs/apilua/paddleocr.md +2 -7
  69. package/docs/apilua/pip.md +2 -12
  70. package/docs/apilua/system.md +2 -23
  71. package/docs/apilua/tomatoocr.md +2 -16
  72. package/docs/apilua/tts.md +2 -9
  73. package/docs/apilua/ui.md +3 -9
  74. package/docs/apilua/utils.md +2 -9
  75. package/docs/apilua/yolo.md +2 -4
  76. package/docs/apilua/yolocls.md +2 -5
  77. package/docs/mcp-agent-description.md +1 -1
  78. package/docs/quick/vscode/createProject.md +1 -1
  79. package/docs/quick/vscode/packProject.md +1 -1
  80. package/package.json +1 -1
@@ -1,5 +1,7 @@
1
1
  # 系统模块 (System)
2
2
 
3
+ 模块表是内置全局 `system`,直接调用即可。不要 `require` 宿主模块。
4
+
3
5
  系统模块提供了与操作系统交互的核心功能,包括应用管理、锁屏控制、剪贴板操作、URL 打开和系统通知等功能。
4
6
 
5
7
  ## 功能概览
@@ -50,7 +52,6 @@ function startApp(bundleId) end
50
52
  **示例:**
51
53
 
52
54
  ```lua
53
- local system = require("system")
54
55
  -- 启动应用
55
56
  local started = system.startApp("com.example.app")
56
57
  if started then
@@ -81,7 +82,6 @@ function stopApp(bundleId) end
81
82
  **示例:**
82
83
 
83
84
  ```lua
84
- local system = require("system")
85
85
  local stopped = system.stopApp("com.example.app")
86
86
  if stopped then
87
87
  print("应用关闭成功")
@@ -113,7 +113,6 @@ function activateApp(bundleId) end
113
113
  **示例:**
114
114
 
115
115
  ```lua
116
- local system = require("system")
117
116
  local activated = system.activateApp("com.apple.Safari")
118
117
  if activated then
119
118
  print("Safari 已激活")
@@ -138,7 +137,6 @@ function activateAppInfo() end
138
137
  **示例:**
139
138
 
140
139
  ```lua
141
- local system = require("system")
142
140
  local appInfo = system.activateAppInfo()
143
141
  if appInfo then
144
142
  print("当前前台应用: " .. tostring(appInfo.name))
@@ -159,7 +157,6 @@ function backgroundAppInfos() end
159
157
  **示例:**
160
158
 
161
159
  ```lua
162
- local system = require("system")
163
160
  local apps = system.backgroundAppInfos()
164
161
  if #apps > 0 then
165
162
  print(apps[1].name)
@@ -176,7 +173,6 @@ function getInstalledAppList() end
176
173
  **示例:**
177
174
 
178
175
  ```lua
179
- local system = require("system")
180
176
  local apps = system.getInstalledAppList()
181
177
  if #apps > 0 then
182
178
  print(apps[1].appName)
@@ -193,7 +189,6 @@ function recent() end
193
189
  **示例:**
194
190
 
195
191
  ```lua
196
- local system = require("system")
197
192
  local opened = system.recent()
198
193
  if opened then
199
194
  print("打开成功")
@@ -222,7 +217,6 @@ function isLocked() end
222
217
  **示例:**
223
218
 
224
219
  ```lua
225
- local system = require("system")
226
220
  if system.isLocked() then
227
221
  print("系统已锁屏")
228
222
  else
@@ -246,7 +240,6 @@ function lock() end
246
240
  **示例:**
247
241
 
248
242
  ```lua
249
- local system = require("system")
250
243
  local locked = system.lock()
251
244
  if locked then
252
245
  print("系统已锁屏")
@@ -271,7 +264,6 @@ function unlock() end
271
264
  **示例:**
272
265
 
273
266
  ```lua
274
- local system = require("system")
275
267
  local unlocked = system.unlock()
276
268
  if unlocked then
277
269
  print("系统已解锁")
@@ -305,7 +297,6 @@ function setClipboard(text) end
305
297
  **示例:**
306
298
 
307
299
  ```lua
308
- local system = require("system")
309
300
  local set = system.setClipboard("Hello, World!")
310
301
  if set then
311
302
  print("剪贴板内容已设置")
@@ -330,7 +321,6 @@ function getClipboard() end
330
321
  **示例:**
331
322
 
332
323
  ```lua
333
- local system = require("system")
334
324
  local clipboardText = system.getClipboard()
335
325
  if clipboardText then
336
326
  print("剪贴板内容: " .. tostring(clipboardText))
@@ -368,7 +358,6 @@ function openURL(url) end
368
358
  **示例:**
369
359
 
370
360
  ```lua
371
- local system = require("system")
372
361
  -- 打开网页
373
362
  local webOpened = system.openURL("https://www.apple.com")
374
363
  if webOpened then
@@ -408,7 +397,6 @@ function notify(msg, title, id) end
408
397
  **示例:**
409
398
 
410
399
  ```lua
411
- local system = require("system")
412
400
  -- 发送基础通知
413
401
  system.notify("任务已完成", "提醒", "task_complete")
414
402
  -- 发送进度通知(会覆盖之前的通知)
@@ -442,7 +430,6 @@ function getMemoryInfo() end
442
430
  **示例:**
443
431
 
444
432
  ```lua
445
- local system = require("system")
446
433
  local memInfo = system.getMemoryInfo()
447
434
  print("应用占用: " .. tostring(memInfo.used) .. "MB")
448
435
  print("系统内存: " .. tostring(memInfo.systemUsed) .. "/" .. tostring(memInfo.total) .. "MB")
@@ -473,7 +460,6 @@ function getUsedMemory() end
473
460
  **示例:**
474
461
 
475
462
  ```lua
476
- local system = require("system")
477
463
  -- 获取已使用内存
478
464
  local usedMemory = system.getUsedMemory()
479
465
  print("已使用内存: " .. tostring(usedMemory) .. "MB")
@@ -503,7 +489,6 @@ function getAvailableMemory() end
503
489
  **示例:**
504
490
 
505
491
  ```lua
506
- local system = require("system")
507
492
  -- 获取可用内存
508
493
  local availableMemory = system.getAvailableMemory()
509
494
  print("可用内存: " .. tostring(availableMemory) .. "MB")
@@ -533,7 +518,6 @@ function getTotalMemory() end
533
518
  **示例:**
534
519
 
535
520
  ```lua
536
- local system = require("system")
537
521
  -- 获取系统总内存
538
522
  local totalMemory = system.getTotalMemory()
539
523
  print("系统总内存: " .. tostring(totalMemory) .. "MB")
@@ -556,7 +540,6 @@ function getSystemUsedMemory() end
556
540
  **示例:**
557
541
 
558
542
  ```lua
559
- local system = require("system")
560
543
  print(system.getSystemUsedMemory())
561
544
  ```
562
545
 
@@ -570,7 +553,6 @@ function getCpuUsage() end
570
553
  **示例:**
571
554
 
572
555
  ```lua
573
- local system = require("system")
574
556
  print(system.getCpuUsage())
575
557
  ```
576
558
 
@@ -602,7 +584,6 @@ function startAgent() end
602
584
  **示例:**
603
585
 
604
586
  ```lua
605
- local system = require("system")
606
587
  -- 启动 Agent 服务
607
588
  local started = system.startAgent()
608
589
  if started then
@@ -632,7 +613,6 @@ function getAgentStatus() end
632
613
  **示例:**
633
614
 
634
615
  ```lua
635
- local system = require("system")
636
616
  -- 检查 快点 Agent 服务状态
637
617
  local isRunning = system.getAgentStatus()
638
618
  if isRunning then
@@ -661,7 +641,6 @@ function stopAgent() end
661
641
  **示例:**
662
642
 
663
643
  ```lua
664
- local system = require("system")
665
644
  local stopped = system.stopAgent()
666
645
  if stopped then
667
646
  print("已停止 Agent")
@@ -1,5 +1,7 @@
1
1
  # TomatoOCR 模块
2
2
 
3
+ 模块表是内置全局 `tomatoocr`,直接调用即可。不要 `require` 宿主模块。
4
+
3
5
  TomatoOCR 模块提供基于 TomatoOCR 框架的文字识别和 YOLO 目标检测功能,支持多种识别模式和配置选项。
4
6
 
5
7
  该 ocr 为付费插件, 具体资费请联系https://www.52tomato.com, 如果购买请选择插件版-快点 JS-IOS
@@ -50,7 +52,6 @@ function initializeWithConfig(mode, licenseData, remark) end
50
52
  **示例:**
51
53
 
52
54
  ```lua
53
- local tomatoocr = require("tomatoocr")
54
55
  -- 不带备注
55
56
  local result1 = tomatoocr.initializeWithConfig(
56
57
  "online",
@@ -85,7 +86,6 @@ function setHttpIntervalTime(second) end
85
86
  **示例:**
86
87
 
87
88
  ```lua
88
- local tomatoocr = require("tomatoocr")
89
89
  tomatoocr.setHttpIntervalTime(3600)
90
90
  ```
91
91
 
@@ -107,7 +107,6 @@ function setRecType(recType) end
107
107
  **示例:**
108
108
 
109
109
  ```lua
110
- local tomatoocr = require("tomatoocr")
111
110
  -- 普通中英文识别,3.0版模型
112
111
  tomatoocr.setRecType("ch-3.0")
113
112
  -- 普通中英文识别,2.0版模型
@@ -142,7 +141,6 @@ function setDetBoxType(detBoxType) end
142
141
  **示例:**
143
142
 
144
143
  ```lua
145
- local tomatoocr = require("tomatoocr")
146
144
  -- 矩形文本
147
145
  tomatoocr.setDetBoxType("rect")
148
146
  -- 倾斜文本
@@ -167,7 +165,6 @@ function setDetScaleRatio(detScaleRatio) end
167
165
  **示例:**
168
166
 
169
167
  ```lua
170
- local tomatoocr = require("tomatoocr")
171
168
  tomatoocr.setDetScaleRatio(0.5)
172
169
  ```
173
170
 
@@ -189,7 +186,6 @@ function setDetUnclipRatio(detUnclipRatio) end
189
186
  **示例:**
190
187
 
191
188
  ```lua
192
- local tomatoocr = require("tomatoocr")
193
189
  tomatoocr.setDetUnclipRatio(1.9)
194
190
  ```
195
191
 
@@ -211,7 +207,6 @@ function setRecScoreThreshold(recScoreThreshold) end
211
207
  **示例:**
212
208
 
213
209
  ```lua
214
- local tomatoocr = require("tomatoocr")
215
210
  tomatoocr.setRecScoreThreshold(0.1)
216
211
  ```
217
212
 
@@ -233,7 +228,6 @@ function setReturnType(returnType) end
233
228
  **示例:**
234
229
 
235
230
  ```lua
236
- local tomatoocr = require("tomatoocr")
237
231
  tomatoocr.setReturnType("json")
238
232
  ```
239
233
 
@@ -255,7 +249,6 @@ function setBinaryThresh(binaryThresh) end
255
249
  **示例:**
256
250
 
257
251
  ```lua
258
- local tomatoocr = require("tomatoocr")
259
252
  tomatoocr.setBinaryThresh(0)
260
253
  ```
261
254
 
@@ -277,7 +270,6 @@ function setRunMode(runMode) end
277
270
  **示例:**
278
271
 
279
272
  ```lua
280
- local tomatoocr = require("tomatoocr")
281
273
  tomatoocr.setRunMode("fast")
282
274
  ```
283
275
 
@@ -301,7 +293,6 @@ function setFilterColor(filterColor, backgroundColor) end
301
293
  **示例:**
302
294
 
303
295
  ```lua
304
- local tomatoocr = require("tomatoocr")
305
296
  tomatoocr.setFilterColor("#41917A,38,38", "black")
306
297
  tomatoocr.setFilterColor("#41917A,38,38|#E091A8,50,50", "white")
307
298
  ```
@@ -343,7 +334,6 @@ function ocrImage(input, type, x, y, ex, ey) end
343
334
  **示例:**
344
335
 
345
336
  ```lua
346
- local tomatoocr = require("tomatoocr")
347
337
  -- 识别屏幕
348
338
  local result1 = tomatoocr.ocrImage("screen", 0, 0, 0, 0, 0)
349
339
  print("识别屏幕结果:" .. tostring(result1))
@@ -382,7 +372,6 @@ function findTapPoint(data) end
382
372
  **示例:**
383
373
 
384
374
  ```lua
385
- local tomatoocr = require("tomatoocr")
386
375
  local result = tomatoocr.findTapPoint(“确定”)
387
376
  print(result)
388
377
  ```
@@ -412,7 +401,6 @@ function findTapPoints(data) end
412
401
  **示例:**
413
402
 
414
403
  ```lua
415
- local tomatoocr = require("tomatoocr")
416
404
  local result = tomatoocr.findTapPoints(“确定”)
417
405
  print(result)
418
406
  ```
@@ -428,14 +416,12 @@ function release() end
428
416
  **示例:**
429
417
 
430
418
  ```lua
431
- local tomatoocr = require("tomatoocr")
432
419
  tomatoocr.release()
433
420
  ```
434
421
 
435
422
  ## 完整示例
436
423
 
437
424
  ```lua
438
- local tomatoocr = require("tomatoocr")
439
425
  -- 初始化 TomatoOCR 并设置基本配置
440
426
  local initResult = tomatoocr.initializeWithConfig(
441
427
  "online",
@@ -1,5 +1,7 @@
1
1
  # TTS 模块 (Text-to-Speech)
2
2
 
3
+ 模块表是内置全局 `tts`,直接调用即可。不要 `require` 宿主模块。
4
+
3
5
  TTS(文本转语音)模块提供了语音合成、播放控制等功能,支持多种语言和语音设置。
4
6
 
5
7
  ## 接口定义
@@ -58,7 +60,6 @@ function speak(text, rate, pitch, volume, language) end
58
60
  **示例:**
59
61
 
60
62
  ```lua
61
- local tts = require("tts")
62
63
  -- 使用简化参数播放中文文本
63
64
  tts.speak("欢迎使用 TTS 功能")
64
65
  -- 使用完整参数播放中文语音
@@ -90,7 +91,6 @@ function waitEnd() end
90
91
  **示例:**
91
92
 
92
93
  ```lua
93
- local tts = require("tts")
94
94
  -- 播放一段文本
95
95
  tts.speak("这是一段需要等待播放完成的文本")
96
96
  -- 等待播放完成
@@ -110,7 +110,6 @@ function stop() end
110
110
  **示例:**
111
111
 
112
112
  ```lua
113
- local tts = require("tts")
114
113
  -- 开始播放
115
114
  tts.speak("这是一段很长的文本内容...")
116
115
  -- 在某个条件下停止播放
@@ -138,7 +137,6 @@ function isSpeaking() end
138
137
  **示例:**
139
138
 
140
139
  ```lua
141
- local tts = require("tts")
142
140
  -- 检查播放状态
143
141
  if tts.isSpeaking() then
144
142
  print("正在播放语音")
@@ -172,7 +170,6 @@ function getAvailableVoices() end
172
170
  **示例:**
173
171
 
174
172
  ```lua
175
- local tts = require("tts")
176
173
  -- 获取并显示所有可用语音
177
174
  local voices = tts.getAvailableVoices()
178
175
  print("找到 " .. tostring(#voices) .. " 个可用语音:")
@@ -217,7 +214,6 @@ function setVoice(voiceIdentifier) end
217
214
  **示例:**
218
215
 
219
216
  ```lua
220
- local tts = require("tts")
221
217
  -- 获取可用语音并设置第一个中文语音
222
218
  local voices = tts.getAvailableVoices()
223
219
  local chineseVoice = voices.find((voice) => voice.language.startsWith("zh"))
@@ -258,7 +254,6 @@ function free() end
258
254
  **示例:**
259
255
 
260
256
  ```lua
261
- local tts = require("tts")
262
257
  tts.free()
263
258
  ```
264
259
 
@@ -267,7 +262,6 @@ tts.free()
267
262
  ### 语音提醒功能
268
263
 
269
264
  ```lua
270
- local tts = require("tts")
271
265
  local function voiceAlert(message, urgent)
272
266
  if urgent then
273
267
  -- 紧急提醒:快速、高音调
@@ -285,7 +279,6 @@ voiceAlert("发现错误,请立即处理", true)
285
279
  ### 多语言播报
286
280
 
287
281
  ```lua
288
- local tts = require("tts")
289
282
  local function speakInLanguage(text, language)
290
283
  -- 根据语言选择合适的语音
291
284
  local voices = tts.getAvailableVoices()
package/docs/apilua/ui.md CHANGED
@@ -1,5 +1,7 @@
1
1
  # UI 模块 (UI)
2
2
 
3
+ 模块表是内置全局 `ui`,直接调用即可。不要 `require` 宿主模块。
4
+
3
5
  UI 模块提供了 WebView 相关功能,支持事件通信和 JavaScript 交互。该模块使用共享的 WebView 实例,通过静态方法进行操作。
4
6
 
5
7
  ## UI 设计器
@@ -9,7 +11,7 @@ UI 模块提供了 WebView 相关功能,支持事件通信和 JavaScript 交
9
11
  ## 注意事项
10
12
 
11
13
  - UI 相关方法仅 app 在前台可用
12
- - Lua 脚本 API `require("ui")`;网页里的 `ms.*` 是 JavaScript
14
+ - Lua 脚本 API 用全局 `ui`;网页里的 `ms.*` 是 JavaScript
13
15
 
14
16
  ## 配置
15
17
 
@@ -81,7 +83,6 @@ function show() end
81
83
  **示例:**
82
84
 
83
85
  ```lua
84
- local ui = require("ui")
85
86
  ui.show()
86
87
  ```
87
88
 
@@ -101,7 +102,6 @@ function eval(code) end
101
102
  **示例:**
102
103
 
103
104
  ```lua
104
- local ui = require("ui")
105
105
  ui.eval("document.title = 'KuaiJS'")
106
106
  ```
107
107
 
@@ -124,7 +124,6 @@ function onEvent(onEvent) end
124
124
  **示例:**
125
125
 
126
126
  ```lua
127
- local ui = require("ui")
128
127
  -- 设置事件回调
129
128
  ui.onEvent(function(event, data)
130
129
  print("收到事件: " .. tostring(event) .. ", 数据: " .. tostring(ToJsonString(data)))
@@ -149,7 +148,6 @@ function call(key, data) end
149
148
  **示例:**
150
149
 
151
150
  ```lua
152
- local ui = require("ui")
153
151
  -- 调用网页中的方法
154
152
  ui.call("updateStatus", { status = "running", progress = 50 })
155
153
  ui.call("loadData", {
@@ -174,7 +172,6 @@ function showToast(message) end
174
172
  **示例:**
175
173
 
176
174
  ```lua
177
- local ui = require("ui")
178
175
  -- 显示成功提示
179
176
  ui.showToast("操作成功")
180
177
  -- 显示错误提示
@@ -208,7 +205,6 @@ function confirm(title, message) end
208
205
  **示例:**
209
206
 
210
207
  ```lua
211
- local ui = require("ui")
212
208
  -- 显示确认对话框
213
209
  local result = ui.confirm("确认删除", "是否确定要删除这个文件?")
214
210
  if result then
@@ -250,7 +246,6 @@ function confirmInput(title, message) end
250
246
  **示例:**
251
247
 
252
248
  ```lua
253
- local ui = require("ui")
254
249
  -- 获取用户输入
255
250
  local username = ui.confirmInput("用户登录", "请输入您的用户名:")
256
251
  if username then
@@ -285,7 +280,6 @@ function alert(title, message) end
285
280
  **示例:**
286
281
 
287
282
  ```lua
288
- local ui = require("ui")
289
283
  -- 显示错误警告
290
284
  ui.alert("错误", "网络连接失败,请检查网络设置")
291
285
  -- 显示重要提示
@@ -1,5 +1,7 @@
1
1
  # 工具模块 (Utils)
2
2
 
3
+ 模块表是内置全局 `utils`,直接调用即可。不要 `require` 宿主模块。
4
+
3
5
  工具模块提供了一系列实用的工具函数,包括时间格式化、随机数生成、应用前台切换等常用功能。
4
6
 
5
7
  ## 功能概览
@@ -36,7 +38,6 @@ function timeFormat(format) end
36
38
  **示例:**
37
39
 
38
40
  ```lua
39
- local utils = require("utils")
40
41
 
41
42
  -- 标准日期时间格式
42
43
  local dateTime = utils.timeFormat("yyyy-MM-dd HH:mm:ss")
@@ -86,7 +87,6 @@ function random(min, max) end
86
87
  **示例:**
87
88
 
88
89
  ```lua
89
- local utils = require("utils")
90
90
 
91
91
  -- 生成1-10之间的随机数
92
92
  local randomNum = utils.random(1, 10)
@@ -123,7 +123,6 @@ function takeMeToFront() end
123
123
  **示例:**
124
124
 
125
125
  ```lua
126
- local utils = require("utils")
127
126
 
128
127
  -- 将应用切换到前台
129
128
  utils.takeMeToFront()
@@ -142,7 +141,6 @@ function randomUUID() end
142
141
  **示例:**
143
142
 
144
143
  ```lua
145
- local utils = require("utils")
146
144
  print(utils.randomUUID())
147
145
  ```
148
146
 
@@ -157,7 +155,6 @@ function hexString(source) end
157
155
  **示例:**
158
156
 
159
157
  ```lua
160
- local utils = require("utils")
161
158
  print(utils.hexString("hello"))
162
159
  ```
163
160
 
@@ -172,7 +169,6 @@ function base64Encoded(source) end
172
169
  **示例:**
173
170
 
174
171
  ```lua
175
- local utils = require("utils")
176
172
  print(utils.base64Encoded("hello"))
177
173
  ```
178
174
 
@@ -187,7 +183,6 @@ function base64Decoded(source) end
187
183
  **示例:**
188
184
 
189
185
  ```lua
190
- local utils = require("utils")
191
186
  print(utils.base64Decoded("aGVsbG8="))
192
187
  ```
193
188
 
@@ -202,7 +197,6 @@ function hexStringBase64Encoded(hexString) end
202
197
  **示例:**
203
198
 
204
199
  ```lua
205
- local utils = require("utils")
206
200
  print(utils.hexStringBase64Encoded("68656c6c6f"))
207
201
  ```
208
202
 
@@ -217,6 +211,5 @@ function hexStringBase64Decoded(base64HexString) end
217
211
  **示例:**
218
212
 
219
213
  ```lua
220
- local utils = require("utils")
221
214
  print(utils.hexStringBase64Decoded("aGVsbG8="))
222
215
  ```
@@ -1,5 +1,7 @@
1
1
  # YOLO 目标检测模块 (YOLO)
2
2
 
3
+ 模块表是内置全局 `yolo`,直接调用即可。不要 `require` 宿主模块。
4
+
3
5
  YOLO 模块基于 YOLOV8/YOLO11/YOLO26 算法和 NCNN 框架,提供高性能的实时目标检测功能,支持多种输入源和自定义模型,可用于物体识别、位置定位等应用场景。
4
6
 
5
7
  ## 数据标注
@@ -91,7 +93,6 @@ function load(paramPath, binPath, nc, version, useGpu) end
91
93
  **示例:**
92
94
 
93
95
  ```lua
94
- local yolo = require("yolo")
95
96
  local modelId = yolo.load(
96
97
  "yolov8n_ncnn_model/model.ncnn.param",
97
98
  "yolov8n_ncnn_model/model.ncnn.bin",
@@ -144,7 +145,6 @@ function detectAbs(modelId, img, x, y, ex, ey, targetSize, threshold, nmsThresho
144
145
  **示例:**
145
146
 
146
147
  ```lua
147
- local yolo = require("yolo")
148
148
 
149
149
  -- 首先加载模型
150
150
  local modelId = yolo.load(
@@ -206,7 +206,6 @@ function free(modelId) end
206
206
  **示例:**
207
207
 
208
208
  ```lua
209
- local yolo = require("yolo")
210
209
 
211
210
  -- 释放特定模型
212
211
  if modelId then
@@ -224,7 +223,6 @@ function freeAll() end
224
223
  **示例:**
225
224
 
226
225
  ```lua
227
- local yolo = require("yolo")
228
226
 
229
227
  -- 释放所有模型资源
230
228
  yolo.freeAll()
@@ -1,5 +1,7 @@
1
1
  # YOLO 图像分类模块 (YoloCls)
2
2
 
3
+ 模块表是内置全局 `yolocls`,直接调用即可。不要 `require` 宿主模块。
4
+
3
5
  YOLO 图像分类模块基于 YOLOv8-cls / YOLO11-cls / YOLO26-cls 分类模型和 NCNN 框架,提供整图分类、区域分类和模型资源管理能力。
4
6
 
5
7
  ## 功能概览
@@ -82,7 +84,6 @@ function load(paramPath, binPath, nc, useGpu) end
82
84
  **示例:**
83
85
 
84
86
  ```lua
85
- local yolocls = require("yolocls")
86
87
  -- 模型文件通常放在 res 目录
87
88
  local modelId = yolocls.load(
88
89
  "yolo11n_cls_ncnn_model/model.ncnn.param",
@@ -129,7 +130,6 @@ function classify(modelId, img, targetSize) end
129
130
  **示例:**
130
131
 
131
132
  ```lua
132
- local yolocls = require("yolocls")
133
133
  local modelId = yolocls.load(
134
134
  "yolo11n_cls_ncnn_model/model.ncnn.param",
135
135
  "yolo11n_cls_ncnn_model/model.ncnn.bin",
@@ -206,7 +206,6 @@ function classifyRegion(modelId, img, x, y, ex, ey, targetSize) end
206
206
  **示例:**
207
207
 
208
208
  ```lua
209
- local yolocls = require("yolocls")
210
209
  local regionProbs = yolocls.classifyRegion(
211
210
  modelId,
212
211
  "screen",
@@ -244,7 +243,6 @@ function free(modelId) end
244
243
  **示例:**
245
244
 
246
245
  ```lua
247
- local yolocls = require("yolocls")
248
246
  if modelId then
249
247
  yolocls.free(modelId)
250
248
  print("YOLO 分类模型 " .. tostring(modelId) .. " 资源已释放")
@@ -262,7 +260,6 @@ function freeAll() end
262
260
  **示例:**
263
261
 
264
262
  ```lua
265
- local yolocls = require("yolocls")
266
263
  yolocls.freeAll()
267
264
  print("所有 YOLO 分类模型资源已释放")
268
265
  ```
@@ -15,7 +15,7 @@
15
15
  - 不要把快点JS Python 脚本当成普通 CPython 脚本。
16
16
  - 不要对快点JS Python 脚本运行 `python -m py_compile`、`py_compile` 或类似 CPython 编译校验。
17
17
  - 不要创建、保留或同步 `__pycache__`、`.pyc` 作为项目改动。
18
- - Lua 用户模块请用 `require("foo")` / `require("lib.bar")`。Release 打包默认会把 `scripts` 下除 `main.lua` 外的用户 `.lua` 合并进单个 `main.lua`;不要用 `dofile` / `loadfile` 按路径加载这些文件。
18
+ - Lua 宿主模块是内置全局表(如 `device`),不要 `require`。用户模块请用 `require("foo")` / `require("lib.bar")`。Release 打包默认会把 `scripts` 下除 `main.lua` 外的用户 `.lua` 合并进单个 `main.lua`;不要用 `dofile` / `loadfile` 按路径加载这些文件。
19
19
  - 文档未确认的能力必须明确说明无法确认,不要凭经验补全。
20
20
 
21
21
  ## 允许的执行方式
@@ -17,7 +17,7 @@
17
17
  - 选择一个文件目录,输入项目名称,回车创建项目
18
18
  - 快点 JS-JS 引擎使用 `ES6` 语法,支持 import 别的 js 文件
19
19
  - 快点 JS-Python 引擎使用 `Python3.14`, 打包需要安装 `Python3.14`
20
- - 快点 JS-Lua 引擎入口为 `scripts/main.lua`,模块通过 `require("device")` 加载,全局函数如 `Sleep` 可直接调用
20
+ - 快点 JS-Lua 引擎入口为 `scripts/main.lua`,宿主模块是内置全局表(如 `device`),不要 `require`;全局函数如 `Sleep` 可直接调用
21
21
  - 项目创建完成后,会自动打开项目,项目结构如下:
22
22
 
23
23
  ### 项目结构
@@ -11,7 +11,7 @@
11
11
  - 输入在开发者后台->网络验证管理->软件列表 中获取的 `AppId` 字段
12
12
  - JS / Lua 项目可编辑根目录 `obfuscator.json` 决定打包行为;Python 打包编译为 `.pyc`,没有该配置
13
13
  - JS:Vite 把入口打成单文件后再按 `enabled` 混淆
14
- - Lua:Release 默认把 `scripts` 下用户模块合并为单个 `scripts/main.lua`(`bundle`,缺省 `true`),再按 `enabled` / `preset` 用 Prometheus 混淆该文件。`enabled: false` 时仍可合并。宿主 `require("device")` 等不受影响。不要用 `dofile` / `loadfile` 去读会被删掉的其它 `.lua`
14
+ - Lua:Release 默认把 `scripts` 下用户模块合并为单个 `scripts/main.lua`(`bundle`,缺省 `true`),再按 `enabled` / `preset` 用 Prometheus 混淆该文件。`enabled: false` 时仍可合并。宿主全局模块(如 `device`)不受影响。不要用 `dofile` / `loadfile` 去读会被删掉的其它 `.lua`
15
15
  - 注意:上传到快点JS热更新服务后,可通过开发者后台->网络验证管理->软件列表的软件编号进行分发
16
16
  - 注意:快点JS上可通过软件面板,输入软件编号进行搜索加载应用
17
17
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ms-vite-plugin",
3
- "version": "1.4.59",
3
+ "version": "1.4.60",
4
4
  "type": "commonjs",
5
5
  "license": "MIT",
6
6
  "publishConfig": {