@auv-js/cli
安装匹配当前操作的 AUV 命令行可执行文件
系统与CPU架构. 可执行文件由特定平台交付
可选 npm 依赖性, 因此安装不会运行网络下载
postinstall 剧本.
pnpm add @auv-js/cli
pnpm exec auv --help
节点应用程序可以明确解决已安装可执行文件:
import { binaryPath } from '@auv-js/cli/binary'
import { startAuv } from '@auv-js/sdk/node'
const daemon = await startAuv({ binaryPath: binaryPath() })
在 macOS 上, 原生装订暴露了与 CLI 相同的帮助器设置模块 :
import {
installMacosHelper,
macosHelperStatus,
openMacosHelperAccessibilitySettings,
openMacosHelperBackgroundItemsSettings,
uninstallMacosHelper,
} from '@auv-js/cli'
const before = await macosHelperStatus()
const installed = await installMacosHelper()
if (installed.state === 'requires-approval') {
openMacosHelperBackgroundItemsSettings()
}
else if (installed.state === 'running') {
openMacosHelperAccessibilitySettings()
}
// Removes only the helper app and its Accessibility decision. Enrollment is
// retained so a later reinstall does not require credential entry again.
await uninstallMacosHelper()
installMacosHelper() 验证和安装嵌入式应用程序
当前用户的 AUV 应用程序支持目录, 然后注册其嵌入式
通过 SMAppService。它不需要 sudo 也没有
管理员密码 。 发展约束力报告 helperEmbedded=false· ;
官方 macOS 发布绑定 载有相同的签名和公证辅助程序
作为CLI.
CLI 和每个捆绑的包 @auv-js/cli 是独立的前端
一个每个用户的助手。 任何声明协议范围包括此内容的助手
约束协议是可用的,无论它的版本. installMacosHelper()
仅当它比嵌入式帮助器年长或不支持时才替换它
绝不降级 如果已安装的助手放弃此选项
约束协议、状况报告 frontend-outdated: 更新此软件包
而不是帮助者.
uninstallMacosHelper() 等待服务管理部门停止任何飞行
帮助进程, 重新设置帮助包的可访问性决定, 并删除
只有已安装的应用程序。 它保留了入学和所有其他 AUV 应用程序
支持内容.
电子包装
不从内部执行二进制 app.asar在包装时,复制
路径返回 binaryPath() 进入一个无包装的、由应用程序拥有的地点并解决问题
在运行时复制路径 .
- 复制给
YourApp.app/Contents/MacOS/auv列表中 电子制造器mac.binaries因此,它被签为巢编码. - 视窗: 复制到
resources/bin/auv.exe结束extraResources。 。 。 . - Linux: 复制包含路径的完整目录
binaryPath()改为resources/bin结束extraResources兄弟姐妹们lib/, (中文(简体) ),share/,以及licenses/条目是可执行文件的一部分 运行时间捆绑; 只复制auv不支持.
电能主要过程应拥有儿童过程,并随之通过
绝对路径到 startAuv()。导入 @auv-js/cli/binary 装入时
不装入 NAPI 附加词。 如果应用程序还导入根 NAPI
运行时进入点, 保留 *.node 自动搜索和救援系统外的 软件包文件
本地模块/asarUnpack 支助。 使SDK独立于包装政策
因此浏览器和远程客户端消费者不会安装本地可执行文件.
运送自己的macOS助手
应用程序可以用它自己的名字、图标、捆绑来运送 macOS 帮助器
标识符,和开发者 ID 团队而不是官方 AUV Helper构建
带它 crates/auv-device-helper-macos/package/package.sh 联 合 国
AUV_MACOS_HELPER_* 覆盖、公证和锁定,并嵌入无包装物
应用程序捆绑中不重新签名的应用程序(例如)
YourApp.app/Contents/Library/Helpers/) (中文(简体) ). 传出一条绝对的道路
守护进程和设置 :
import path from 'node:path'
import process from 'node:process'
import { installMacosHelper } from '@auv-js/cli'
import { startAuv } from '@auv-js/sdk/node'
const helperApp = path.join(process.resourcesPath, '..', 'Library', 'Helpers', 'Your Computer Use.app')
const status = await installMacosHelper({ helperApp })
const daemon = await startAuv({ binaryPath, platforms: { macos: { helperApp } } })
AUV 从该应用程序的签名读取捆绑标识符和团队ID,安装
抄本如下: ~/Library/Application Support/<bundle identifier>/,则
守护进程只信任这个身份 。 CLI 等值为
auv setup macos-helper install --helper-app <path>见
帮助设置引用。 。 。 .
支持的软件包目前覆盖macOS arm64/x64, glibc Linux arm64/x64,以及
Windows arm64/x64 (英语). 安装可选的依赖性
二进制; binaryPath() 报告该案件存在可起诉错误.