Docs / Device Platform / Architecture
一段录音,如何进入你的应用 How a recording reaches your application
这套系统分成两个边界清晰的包:服务器平台负责数据与权限,Demo 应用负责把数据变成可审核、可继续处理的工作结果。 The system has two clear boundaries: the server platform owns data and permissions, while the Demo app turns that data into reviewable, actionable work.
自托管服务器平台Self-hosted server platform
负责设备接入、录音同步、Group 授权边界,以及 MCP、REST 和 Webhook 接口。它是你自己部署、自己保存数据的基础设施。Owns device access, recording sync, Group authorization, and the MCP, REST and Webhook interfaces. This is the infrastructure you deploy and control.
voicecan/device-platform
下游 Demo 应用Downstream Demo application
运行在平台之上,负责转写处理、场景选择、结果审核和动作预览。它使用独立 Application,不继承平台管理员权限。Runs on top of the platform for transcription, scene selection, review and action previews. It uses its own Application and never inherits platform-admin access.
voicecan/voicecan-studio
安装、初始化或连接过程中遇到问题?联系 support@voicecan.ai Need help with installation, setup or connecting the platform? Contact support@voicecan.ai
MCP 工具只返回录音元数据与一次性临时下载链接,不返回音频、Base64 或可被 Host 自动读取的持久资源;凭证只存在 Host 的安全环境中,不作为 Tool 参数传入。MCP tools return recording metadata and one-use temporary download links—not audio, Base64 or persistent resources a Host may auto-read. Credentials stay in the Host's secret environment, never in Tool arguments.
首次初始化与管理边界First-time setup and administration boundaries
服务首次启动后会生成一个仅所有者可读的高熵 Setup Token。它只用于创建第一位 System Admin;初始化完成后,日常操作都在 /admin 中进行。On first start, the service creates a high-entropy, owner-readable Setup Token. It is used only to create the first System Admin; ongoing work then happens in /admin.
创建第一位管理员Create the first administrator
打开 /admin,使用安装目录 data/setup-token 中的一次性 Token 完成初始化。Open /admin and complete setup with the one-use token stored at data/setup-token.
创建 GroupCreate a Group
Group 是设备、录音、事件和成员的授权边界。录音文件权限永远由设备当前所属的 Group 推导。A Group is the authorization boundary for devices, recordings, events and members. Recording access is always derived from the Device's current Group.
创建 ApplicationCreate an Application
每个下游应用、机器人或工作流都应拥有独立的 Application、通道、权限、配额与凭证。Give every downstream app, bot or workflow its own Application, channels, permissions, quotas and credentials.
只授予必要权限Grant least privilege
凭证只能选择 Application 权限的子集。密钥只显示一次;暂停 Application 或撤销凭证会在下一次请求立即生效。A credential can select only a subset of its Application permissions. Secrets are shown once; suspensions and revocations take effect on the next request.
用浏览器连接一台设备Connect a device from the browser
Device Platform 的管理端负责授权,具备蓝牙的用户电脑负责 BLE 操作。服务器部署在 NAS 或无蓝牙主机上也没有关系。Admin owns authorization while the user's Bluetooth-capable computer performs BLE operations. The server itself can run on a NAS or another host without Bluetooth.
创建绑定凭证Create a binding credential
在 /admin?view=provision 选择目标 Group,创建有效期 30 分钟、与来源绑定的设备绑定凭证。Select the target Group in /admin?view=provision and create a 30-minute, origin-bound binding credential.
选择附近设备Select a nearby device
点击页面按钮唤起浏览器设备选择器。连接页依次建立 GATT、读取身份、领取绑定 Token,并完成安全握手。Use the page button to open the browser device picker. The connector establishes GATT, reads identity, obtains a binding token and completes the secure handshake.
配置网络并等待上线Configure the network and wait online
保留现有网络或写入新的 Wi-Fi。设备必须能访问 Platform Server;页面会等待服务器确认设备上线。Keep the existing network or configure new Wi-Fi. The Device must be able to reach the Platform Server; the page waits for authoritative online confirmation.
为应用开放最小必要能力Expose only the capabilities an application needs
REST、stdio MCP、远程 MCP 和 Webhook 使用同一套 Permission Catalog、配额与审计。Application 属于一个 Group,凭证不能越过这个边界。REST, stdio MCP, remote MCP and Webhooks share one Permission Catalog, quota and audit model. An Application belongs to one Group and its credentials cannot cross that boundary.
| PERMISSION | 允许的能力CAPABILITY |
|---|---|
devices:read | 读取设备元数据与已审核能力Read Device metadata and reviewed capabilities |
devices:sync | 创建受控的录音同步命令Create the reviewed recording synchronization command |
recordings:read | 搜索和读取录音元数据,不包含音频Search and read recording metadata without audio bytes |
recordings:download_link:create | 创建一次性临时下载授权Create a one-use temporary download grant |
events:read | 读取事件元数据Read event metadata |
服务到服务调用Service-to-service access
启用 rest,创建 api_token,并先调用 GET /api/v1/capabilities 确认可用能力。Enable rest, create an api_token, then call GET /api/v1/capabilities before enabling an integration.
接收录音事件Receive recording events
按事件类型、设备或录音属性过滤签名 Webhook;消费端必须先验证原始请求体,再解析与去重。Filter signed Webhooks by event type, Device or recording attributes. Verify the raw request body before parsing and deduplicating.
把初始化页面里的每一个值准备好Prepare every value required by Studio setup
Studio 不是自动获得整个平台的权限。先在 Device Platform 为它创建一个独立 Application、一次性显示的 API Token 和签名 Webhook,再根据运行档位准备处理服务。下面的路径与字段和 Demo 当前界面一一对应。Studio does not inherit platform-wide access. Create a dedicated Application, a one-time API Token and a signed Webhook in Device Platform, then prepare processors for the selected deployment profile. The paths below map directly to the current Demo fields.
Application、api_token、Webhook endpoint。只有 External 档位需要填写 HTTP ASR 与 Summary 服务。Application, api_token and a Webhook endpoint. Only the External profile requires HTTP ASR and Summary services.创建 Studio ApplicationCreate the Studio Application
进入 /admin → Open platform → Create application,选择录音所在 Group,启用 rest 与 webhook,只授予 recordings:read 和 recordings:download_link:create。Open /admin → Open platform → Create application, select the recording Group, enable rest and webhook, then grant only recordings:read and recordings:download_link:create.
创建应用令牌Create the Application Token
在该 Application 的 Credentials 页创建 api_token。立即复制只显示一次的 vcd_app_...,填入 Studio 的「应用令牌」。Create an api_token in the Application's Credentials tab. Immediately copy the one-time vcd_app_... value into Studio's Application Token field.
创建签名 WebhookCreate the signed Webhook
在 Webhooks 页创建 https://<studio-host>/webhooks/voicecan,事件选择 file.synced 与 recording.deleted。复制只显示一次的 vce_... 到「Webhook 密钥」。Create https://<studio-host>/webhooks/voicecan in Webhooks and select file.synced plus recording.deleted. Copy the one-time vce_... value into Webhook Secret.
保存并运行 DoctorSave and run Doctor
External 首次启动打开 http://127.0.0.1:8811 填表;验证通过后配置以 0600 权限原子写入。保存后运行 Doctor,再刷新授权来源。On the first External start, open http://127.0.0.1:8811. Validated configuration is atomically written with 0600 permissions. Run Doctor, then refresh authorized sources.
Channels rest, webhook
Permissions recordings:read
recordings:download_link:create
Webhook https://<studio-host>/webhooks/voicecan
Events file.synced, recording.deleted
| Studio 字段Studio field | 从哪里获得Source | 填写规则How to fill |
|---|---|---|
平台地址Platform URL | 已部署的 Device PlatformYour Device Platform deployment | 填写 API 基础地址,例如 https://device.example.com,末尾不需要斜杠。Use the API base URL, such as https://device.example.com, without a trailing slash. |
应用令牌Application token | Application → CredentialsApplication → Credentials | 创建 api_token 后立即复制 vcd_app_...;现有 Secret 无法再次查看。Create an api_token and immediately copy vcd_app_...; an existing secret cannot be revealed again. |
Webhook 密钥Webhook secret | Application → WebhooksApplication → Webhooks | 创建 Endpoint 时复制 vce_...。必须与指向 Studio 的 Endpoint 属于同一个 Application。Copy vce_... when creating the endpoint. It must belong to the same Application that points to Studio. |
下一个 Webhook 密钥Next Webhook secret | Webhooks → Rotate secretWebhooks → Rotate secret | 日常留空。轮换期间把新 Secret 放这里,使旧、新签名同时可验证;切换完成后再更新主密钥。Leave blank normally. During rotation, place the new secret here so old and new signatures both verify; promote it after activation. |
ASR / Summary 地址与 KeyASR / Summary URLs and keys | 你的 HTTP 处理服务Your HTTP processors | 仅 External 使用;地址必须能被 Studio 主机访问。Key 是否必填由对应服务决定。External only. Endpoints must be reachable from the Studio host; whether keys are required depends on each processor. |
摘要模型 / 提示词版本Summary model / prompt version | 你的 Summary 服务契约Your Summary service contract | 填写服务实际使用的模型标识和 Prompt 版本,用于结果溯源,不要随意沿用占位值。Use the actual model identifier and Prompt version for result lineage; do not retain placeholder values blindly. |
Courier / Studio 公开地址Courier / Studio public URL | 可选外发配置Optional delivery configuration | 不需要消息外发时保持关闭。启用后填写 Courier Key;公开地址填写外部可访问的 Studio HTTPS 基础地址。Keep delivery disabled when unused. If enabled, provide a Courier key and the externally reachable Studio HTTPS base URL. |
结果保留天数Result retention days | 你的数据保留策略Your retention policy | 默认 30 天;根据磁盘容量、备份与合规策略调整。Defaults to 30 days; adjust for storage, backup and compliance requirements. |
连接已有处理服务Connect existing processors
浏览器 Setup 页面负责验证 Platform、HTTP ASR、HTTP Summary 与可选 Courier。适合已有模型 API 或需要独立扩缩容的部署。The browser Setup page validates Platform, HTTP ASR, HTTP Summary and optional Courier. Use it with existing model APIs or independently scaled processors.
本地模型由安装脚本准备Local models are prepared by the installer
运行 studio/scripts/setup-local-linux.sh 或 Windows 安装脚本;Faster-Whisper、Qwen3-4B GGUF、模型路径与校验由脚本准备。仍需在 .env 提供平台地址、应用令牌和 Webhook 密钥。Run studio/scripts/setup-local-linux.sh or the Windows installer. It prepares Faster-Whisper, Qwen3-4B GGUF, model paths and verification. Platform URL, Application Token and Webhook Secret still belong in .env.
让 Agent 使用你的设备与录音数据Let agents use your device and recording data
平台提供两个互相隔离的 MCP 权限面:Local Admin MCP 用于操作本机安装;Application MCP 只暴露某个应用被授权的设备、录音、命令和事件能力。The platform exposes two isolated MCP permission planes: Local Admin MCP operates the local installation, while Application MCP exposes only the Device, recording, command and event capabilities granted to one Application.
Local Admin MCP
使用所有者本地自动化通道管理服务状态、Doctor、绑定意图、Application 和 MCP 连接计划;不会提供破坏性命令。Use the owner-local automation channel for service status, Doctor, binding intents, Applications and MCP connection plans. Destructive commands are omitted.
Application MCP
为 Agent 创建独立 Application 与 mcp_stdio_token。它不能获得主机管理权限,也不能把凭证作为 Tool 参数传入。Create a dedicated Application and mcp_stdio_token for an agent. It cannot gain host administration or pass credentials as Tool arguments.
voicecan-device mcp connect --application <application-id> --client generic --output json
该命令创建 stdio 凭证,将它保存为仅所有者可读的 Secret Reference,并返回不含明文 Token 的 Host 配置。远程 MCP 则使用 OAuth、PKCE 与显式授权绑定到一个可访问的 Application。This command creates a stdio credential, stores it as an owner-only Secret Reference and returns a Host configuration without a plaintext token. Remote MCP instead uses OAuth, PKCE and explicit consent bound to an accessible Application.
Codex 连接前,先明确授权范围Define the permission boundary before Codex connects
远程连接会展示目标 Application、请求权限与本地回调地址。用户确认后,Agent 才能在这组明确的权限内访问设备、录音、命令和事件。The remote flow shows the target Application, requested permissions and local callback. Only after explicit consent can an agent access Devices, recordings, commands and events within that boundary.
- 01确认要连接的 ApplicationConfirm the target Application
- 02检查最小必要权限Review the minimum required permissions
- 03确认回调地址并授权连接Verify the callback and authorize
devices.listdevices.getdevices.get_capabilitiesdevices.synccommands.getrecordings.searchrecordings.getrecordings.create_download_linkevents.list
安全获取一段录音Retrieve a recording safely
Open Platform API 和 MCP 都不会直接携带录音字节。应用先查询元数据,再创建短时、一次性的 Download Grant;授权消费时会重新检查 Application、凭证、录音状态与设备当前 Group。Neither Open Platform APIs nor MCP carry recording bytes. An app first queries metadata, then creates a short-lived, one-use Download Grant. Consumption rechecks the Application, credential, recording lifecycle and the Device's current Group.
POST /api/v1/recordings/file_xxx/download-links
Authorization: Bearer vcd_app_...
Idempotency-Key: stable-request-id
Content-Type: application/json
{"purpose":"download","ttl_seconds":300,"reason":"Reviewed export"}
搜索录音元数据Search recording metadata
根据 Device、状态、属性或时间范围搜索;响应包含不可变媒体信息与资源版本,不包含音频。Search by Device, status, attribute or time range. Responses include immutable media facts and resource versions, never audio bytes.
创建一次性授权Create a one-use grant
使用稳定的 Idempotency Key 创建 Download Grant。完整临时 URL 不进入日志、审计、Webhook 或 MCP Resource。Create a Download Grant with a stable Idempotency Key. Full temporary URLs are excluded from logs, audit, Webhooks and MCP Resources.
流式下载并校验Stream and verify
按返回的长度、SHA-256 与 Range 能力流式处理文件。授权过期后创建新的 Grant,不复用旧链接。Stream the file using its returned length, SHA-256 and Range capability. Create a new Grant after expiry rather than reusing an old URL.
上线与日常运维Production and day-two operations
公开部署需要明确区分应用/API 地址和设备 WSS 地址。备份必须同时覆盖数据库、录音对象和部署密钥;只复制数据库不构成有效备份。Public deployments require explicit application/API and Device WSS URLs. A valid backup covers the database, recording objects and deployment keys; a database-only copy is not sufficient.
- TLS / WSS通过经过审核的反向代理终止 TLS 1.2+,保留
/device/v1/ws的 WebSocket Upgrade,并关闭大文件代理缓冲。Terminate TLS 1.2+ at a reviewed reverse proxy, preserve WebSocket Upgrade for/device/v1/ws, and disable proxy buffering for large files. - BACKUP定期执行 Backup Create 和 Verify;只在服务器停止时恢复到新的空目录,并抽样读取不可变录音验证结果。Run Backup Create and Verify regularly. Restore only while stopped into a new empty directory, then sample an immutable recording.
- UPGRADE先停止或排空服务、验证备份、记录版本与校验信息,再显式执行迁移。不要让两个 SQLite 实例共享同一数据目录。Drain or stop, verify a backup, record versions and checksums, then run migrations explicitly. Never run two SQLite instances against one data directory.
- LOGS / METRICS日志默认滚动并脱敏;将
/metrics保留在内网、回环地址或 VPN 中,不要直接暴露到公网。Logs rotate and redact secrets by default. Keep/metricson loopback, a private network or VPN rather than exposing it publicly.