yo-moss-ai 0.0.26 → 0.0.28
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.
- package/bin/bootstrap-deps.mjs +0 -30
- package/bin/runtime-manifest.json +1 -1
- package/bin/yo-moss-ai.mjs +2 -47
- package/dist/assets/{engine-3d-D4oEyAF6.js → engine-3d-DoxdUZhy.js} +21 -21
- package/dist/assets/{esp-flasher-Dm2UeoOa.js → esp-flasher-CLKzE7JE.js} +5 -5
- package/dist/assets/index-C1bPuFAs.js +692 -0
- package/dist/assets/{index-C8QVgBXn.css → index-CzQKR67c.css} +1 -1
- package/dist/index.html +4 -4
- package/dist-server/board-presets.mjs +1 -1
- package/dist-server/camera.mjs +1 -1
- package/dist-server/dev-ui.mjs +1 -1
- package/dist-server/device-chat-sync.mjs +1 -1
- package/dist-server/device-config-view.mjs +1 -1
- package/dist-server/device-focus.mjs +1 -1
- package/dist-server/device-http.mjs +1 -1
- package/dist-server/device-identity.mjs +1 -1
- package/dist-server/device-presence.mjs +1 -1
- package/dist-server/device-probe.mjs +1 -1
- package/dist-server/device-registry.mjs +1 -1
- package/dist-server/device-routes.mjs +1 -1
- package/dist-server/device-runtime.mjs +1 -1
- package/dist-server/device-session.mjs +1 -1
- package/dist-server/ffmpeg.mjs +1 -1
- package/dist-server/gimbal-control.mjs +1 -1
- package/dist-server/home-path.mjs +1 -1
- package/dist-server/index.mjs +1 -1
- package/dist-server/ir-import-validate.mjs +1 -1
- package/dist-server/known-scan-device.mjs +1 -1
- package/dist-server/lan-discover.mjs +1 -1
- package/dist-server/listen-port.mjs +1 -1
- package/dist-server/mcp/backoff.mjs +1 -1
- package/dist-server/mcp/bridge-manager.mjs +1 -1
- package/dist-server/mcp/builtin-tools.mjs +1 -1
- package/dist-server/mcp/dedupe-servers.mjs +1 -1
- package/dist-server/mcp/doctor.mjs +1 -1
- package/dist-server/mcp/fixtures/echo-mcp.mjs +1 -1
- package/dist-server/mcp/fixtures/hotkey-mcp.mjs +1 -1
- package/dist-server/mcp/fixtures/mihome-mcp.mjs +1 -1
- package/dist-server/mcp/fixtures/onvif-mcp.mjs +1 -1
- package/dist-server/mcp/fixtures/shell-mcp.mjs +1 -1
- package/dist-server/mcp/fixtures/yunxiangji-mcp.mjs +1 -1
- package/dist-server/mcp/hotkey-agent-docs.mjs +1 -1
- package/dist-server/mcp/hotkey-driver.mjs +1 -1
- package/dist-server/mcp/hotkey-handlers.mjs +1 -1
- package/dist-server/mcp/hotkey-import-validate.mjs +1 -1
- package/dist-server/mcp/hotkey-store.mjs +1 -1
- package/dist-server/mcp/http-client.mjs +1 -1
- package/dist-server/mcp/http-pipe.mjs +1 -1
- package/dist-server/mcp/local-probe.mjs +1 -1
- package/dist-server/mcp/marketplace.mjs +1 -1
- package/dist-server/mcp/onvif-handlers.mjs +1 -1
- package/dist-server/mcp/parse-server-json.mjs +1 -1
- package/dist-server/mcp/paths.mjs +1 -1
- package/dist-server/mcp/routes.mjs +1 -1
- package/dist-server/mcp/schema.mjs +1 -1
- package/dist-server/mcp/settings.mjs +1 -1
- package/dist-server/mcp/shell-approval.mjs +1 -1
- package/dist-server/mcp/shell-policy.mjs +1 -1
- package/dist-server/mcp/shell-trash.mjs +1 -1
- package/dist-server/mcp/stdio-pipe.mjs +1 -1
- package/dist-server/mcp/store.mjs +1 -1
- package/dist-server/mcp/task-notify.mjs +1 -1
- package/dist-server/mcp/ws-connect.mjs +1 -1
- package/dist-server/mcp/yunxiangji.mjs +1 -1
- package/dist-server/media-cache.mjs +1 -1
- package/dist-server/mihome/cloud.mjs +1 -1
- package/dist-server/mihome/devices.mjs +1 -1
- package/dist-server/mihome/local.mjs +1 -1
- package/dist-server/mihome/mcp-desc.mjs +1 -1
- package/dist-server/mihome/queue.mjs +1 -1
- package/dist-server/mihome/rc4.mjs +1 -1
- package/dist-server/mihome/routes.mjs +1 -1
- package/dist-server/mihome/service.mjs +1 -1
- package/dist-server/mihome/sign.mjs +1 -1
- package/dist-server/mihome/spec.mjs +1 -1
- package/dist-server/mihome/store.mjs +1 -1
- package/dist-server/onboard-preview.mjs +1 -1
- package/dist-server/tab-focus.mjs +1 -1
- package/dist-server/voice-wake.mjs +1 -1
- package/package.json +1 -1
- package/dist/assets/Camera-CEWHXLRY.js +0 -1
- package/dist/assets/FindMoss-8z3VYlpj.css +0 -1
- package/dist/assets/FindMoss-BsgTW7sA.js +0 -1
- package/dist/assets/Flash-BYqIQkJJ.css +0 -1
- package/dist/assets/Flash-C9yXzJqP.js +0 -3
- package/dist/assets/Gamepad-BLsH_xPM.js +0 -1
- package/dist/assets/Gamepad-C_tQwGIW.css +0 -1
- package/dist/assets/Hardware-BeuMlPF9.css +0 -1
- package/dist/assets/Hardware-CLi6HgdV.js +0 -1
- package/dist/assets/Hotkeys-7qBE2_p0.css +0 -1
- package/dist/assets/Hotkeys-C874jYEW.js +0 -1
- package/dist/assets/McpHub-CC17BjHc.css +0 -1
- package/dist/assets/McpHub-CbzysJHs.js +0 -30
- package/dist/assets/MiHome-CStQN-KE.js +0 -1
- package/dist/assets/MiHome-CrfRQedH.css +0 -1
- package/dist/assets/PhLightbulb.vue--mAiYvLw.js +0 -1
- package/dist/assets/PhLightning.vue-CGapFt6a.js +0 -1
- package/dist/assets/PhPlus.vue-C5oKtsK_.js +0 -1
- package/dist/assets/PhSpeakerHigh.vue-Ap9TeeHp.js +0 -1
- package/dist/assets/Remotes-DojSlnSG.css +0 -1
- package/dist/assets/Remotes-vmgwZzXp.js +0 -1
- package/dist/assets/Terminal-BAQJIC6d.js +0 -568
- package/dist/assets/Terminal-CaalakCh.css +0 -1
- package/dist/assets/Yunxiangji-CdkPpeaL.js +0 -1
- package/dist/assets/Yunxiangji-VBaFwdh4.css +0 -1
- package/dist/assets/gamepadRuntime-6Jv7MQBO.js +0 -1
- package/dist/assets/index-CMys3a7t.js +0 -93
- package/dist/assets/mpegts-D4BrshwP.js +0 -3
- package/dist/assets/ptzCommand-DnF6Q4IY.js +0 -1
- package/dist/assets/useGamepadMonitor-C7ccme3i.js +0 -1
- package/dist/assets/useMossWake-BJE6BeTI.js +0 -1
- package/dist/assets/usePtzControl-beaomAgt.js +0 -1
package/bin/bootstrap-deps.mjs
CHANGED
|
@@ -4,11 +4,8 @@ import path from 'node:path'
|
|
|
4
4
|
import http from 'node:http'
|
|
5
5
|
import https from 'node:https'
|
|
6
6
|
import { spawn } from 'node:child_process'
|
|
7
|
-
import { createRequire } from 'node:module'
|
|
8
7
|
import { pipeline } from 'node:stream/promises'
|
|
9
8
|
|
|
10
|
-
export const RUNTIME_PACKAGE_NAMES = ['express', 'cors', 'ws', 'onvif', 'qrcode', 'bonjour-service']
|
|
11
|
-
|
|
12
9
|
export const PROGRESS_BAR_WIDTH = 28
|
|
13
10
|
export const MEDIA_PACKAGE_NAME = 'yo-moss-ai-media'
|
|
14
11
|
|
|
@@ -291,33 +288,6 @@ export function mediaCacheReady(files, cacheDir = mediaCacheDir()) {
|
|
|
291
288
|
return files.every((file) => fileReady(path.join(cacheDir, file.path), file.size))
|
|
292
289
|
}
|
|
293
290
|
|
|
294
|
-
/** 源码仓库(npx 会优先跑本地 bin,而不是 npm 上的已发布包) */
|
|
295
|
-
export function isSourceCheckout(root) {
|
|
296
|
-
return fs.existsSync(path.join(root, 'server', 'index.mjs'))
|
|
297
|
-
&& fs.existsSync(path.join(root, 'package.json'))
|
|
298
|
-
}
|
|
299
|
-
|
|
300
|
-
/** Node 能否从该包根解析运行时 npm 依赖(pnpm 未 hoist / node_modules 损坏时为 false) */
|
|
301
|
-
export function runtimePackagesResolvable(root, names = RUNTIME_PACKAGE_NAMES) {
|
|
302
|
-
try {
|
|
303
|
-
const req = createRequire(path.join(root, 'package.json'))
|
|
304
|
-
for (const name of names) req.resolve(name)
|
|
305
|
-
return true
|
|
306
|
-
} catch {
|
|
307
|
-
return false
|
|
308
|
-
}
|
|
309
|
-
}
|
|
310
|
-
|
|
311
|
-
export function missingRuntimeDepsMessage(root) {
|
|
312
|
-
if (isSourceCheckout(root)) {
|
|
313
|
-
return [
|
|
314
|
-
'当前目录是源码仓库,npx 会启动本地构建,但 node_modules 里缺少 express 等运行依赖。',
|
|
315
|
-
'请先在本目录执行 pnpm install 后再运行;或换到其他目录执行 npx yo-moss-ai 使用已发布版本。',
|
|
316
|
-
].join('\n')
|
|
317
|
-
}
|
|
318
|
-
return '运行依赖未安装完整,请重新执行 npx yo-moss-ai 让 npm 自动安装。'
|
|
319
|
-
}
|
|
320
|
-
|
|
321
291
|
/**
|
|
322
292
|
* npx 安装精简包后,启动服务前下载媒体资源与扩展 npm 依赖。
|
|
323
293
|
*/
|
package/bin/yo-moss-ai.mjs
CHANGED
|
@@ -1,15 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import fs from 'node:fs'
|
|
3
|
-
import os from 'node:os'
|
|
4
3
|
import path from 'node:path'
|
|
5
|
-
import { spawn } from 'node:child_process'
|
|
6
4
|
import { fileURLToPath, pathToFileURL } from 'node:url'
|
|
7
|
-
import {
|
|
8
|
-
bootstrapRuntimeDeps,
|
|
9
|
-
isSourceCheckout,
|
|
10
|
-
missingRuntimeDepsMessage,
|
|
11
|
-
runtimePackagesResolvable,
|
|
12
|
-
} from './bootstrap-deps.mjs'
|
|
5
|
+
import { bootstrapRuntimeDeps } from './bootstrap-deps.mjs'
|
|
13
6
|
|
|
14
7
|
const root = path.join(path.dirname(fileURLToPath(import.meta.url)), '..')
|
|
15
8
|
let pkgVersion = ''
|
|
@@ -34,21 +27,6 @@ if (!fs.existsSync(server)) {
|
|
|
34
27
|
process.exit(1)
|
|
35
28
|
}
|
|
36
29
|
|
|
37
|
-
if (!runtimePackagesResolvable(root)) {
|
|
38
|
-
if (isSourceCheckout(root) && process.env.MOSS_NO_SOURCE_FALLBACK !== '1') {
|
|
39
|
-
console.log(`yo-moss-ai${pkgVersion ? ` v${pkgVersion}` : ''} 本地依赖不完整,改用 npm 已发布版本…`)
|
|
40
|
-
try {
|
|
41
|
-
process.exit(await runPublishedFromTemp(pkg.version))
|
|
42
|
-
} catch (err) {
|
|
43
|
-
console.error(missingRuntimeDepsMessage(root))
|
|
44
|
-
console.error(err?.message || err)
|
|
45
|
-
process.exit(1)
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
console.error(missingRuntimeDepsMessage(root))
|
|
49
|
-
process.exit(1)
|
|
50
|
-
}
|
|
51
|
-
|
|
52
30
|
console.log(`yo-moss-ai${pkgVersion ? ` v${pkgVersion}` : ''}`)
|
|
53
31
|
if (typeof process.stdout.write === 'function') process.stdout.write('')
|
|
54
32
|
|
|
@@ -64,27 +42,4 @@ process.env.NODE_ENV = 'production'
|
|
|
64
42
|
process.env.MOSS_OPEN_BROWSER = process.env.MOSS_OPEN_BROWSER || '1'
|
|
65
43
|
process.env.MOSS_VERSION = pkg.version
|
|
66
44
|
|
|
67
|
-
|
|
68
|
-
await import(pathToFileURL(server).href)
|
|
69
|
-
} catch (err) {
|
|
70
|
-
if (err?.code === 'ERR_MODULE_NOT_FOUND') {
|
|
71
|
-
console.error(missingRuntimeDepsMessage(root))
|
|
72
|
-
console.error(err.message)
|
|
73
|
-
process.exit(1)
|
|
74
|
-
}
|
|
75
|
-
throw err
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
function runPublishedFromTemp(version) {
|
|
79
|
-
return new Promise((resolve, reject) => {
|
|
80
|
-
const npxCmd = process.platform === 'win32' ? 'npx.cmd' : 'npx'
|
|
81
|
-
const child = spawn(npxCmd, ['--yes', `yo-moss-ai@${version}`], {
|
|
82
|
-
cwd: os.tmpdir(),
|
|
83
|
-
stdio: 'inherit',
|
|
84
|
-
shell: process.platform === 'win32',
|
|
85
|
-
env: { ...process.env, MOSS_NO_SOURCE_FALLBACK: '1' },
|
|
86
|
-
})
|
|
87
|
-
child.on('error', reject)
|
|
88
|
-
child.on('exit', (code) => resolve(code ?? 1))
|
|
89
|
-
})
|
|
90
|
-
}
|
|
45
|
+
await import(pathToFileURL(server).href)
|