Skip to content

宿主实现清单 ​

已确认开放的能力清单——别猜不存在的钩子,也别依赖未消费的槽位。 这份清单以 src/transbox/plugins/base.py 的 HostProtocol 与各 bridge Mixin 为准。


Host SPI ​

  • [x] 字幕:feed_direct_caption / feed_caption / 轻量字幕路径 / drop_noise / 按需 tts
  • [x] 翻译门面:translate / translate_batch(含 glossary_context)
  • [x] 热键:mod.json.hotkeys 声明 + 主线程注册 + 异步动作分发
  • [x] 配置:get_plugin_config / set_plugin_config_value / save_plugin_config(含 pluginConfigChanged 广播)
  • [x] 私有数据:数据目录 + KV 读写删
  • [x] 会话:get_recent_conversation / get_history_as_text
  • [x] 状态:get_pipeline_state / get_active_provider / list_installed_plugins / plugin_dir / has_plugin / runtime_dir / has_runtime / get_app_version / get_locale / log
  • [x] 模型:list_model_artifacts / inspect_model_artifact / download_model_artifact
  • [x] 事件:handle_host_event + subscribe_event / unsubscribe_event / unsubscribe_all_events
  • [x] 朗读:speak / stop_speak / is_speaking
  • [x] 提示:show_toast / show_error / set_window_excluded_from_capture / Copilot 窗口控制
  • [x] 浮窗:create_plugin_window 等(多开 / 定位 / 穿透 / 防录屏)
  • [x] 文件:pick_file / pick_files / pick_folder / pick_save_file
  • [x] 进度:begin_progress / update_progress / end_progress / cancel_progress / is_progress_cancelled / get_progress + pluginProgress 信号
  • [x] HostProtocol 类型标注(全量)

类型与生命周期 ​

  • [x] 正式支持 type: tool 与工坊分类(流水线工具)
  • [x] settings_view 不参与 UI 插槽互斥
  • [x] target_app_version 强校验(0.2 起:外部/工坊插件未声明 → 扫描、创建实例、工坊安装三处均拒绝)
  • [x] min_app_version 运行时门禁(1.0.0 = 不限制)
  • [x] 双轨分流 + 单例复用 + supports_concurrent_streams

引擎能力 ​

  • [x] MT 目标语种能力:mod.json.target_langs → 字幕「翻译语言」下拉(默认中英 + 用户激活;按各模型能力过滤)
  • [x] 只读能力探测 PluginRegistry.plugin_capabilities()(不创建实例 / 不启动服务)+ mod.json.capabilities
  • [x] 惰性加载闸门:只读路径(设置页状态 / 音色 / 模型卡)不创建实例;外部插件异步 initialize 可等待收敛
  • [x] TTS 音色 SPI:list_voices / register_voice / remove_voice + 设置页「注册克隆音色」(含软件内录制参考音频 1~30s,落 <数据目录>/voice_samples/)
  • [x] 宿主统一语速伸缩(插件未声明 supports_speed 时)
  • [x] check_ready() 就绪门禁 + requires_runtime / requires_plugins 依赖门禁

分发 ​

  • [x] 本地 extensions/ + %APPDATA%/transbox/extensions/ 扫描
  • [x] Steam 创意工坊(AppID 5521270 / Playtest 5227990)
  • [x] 官网插件工坊(仅自发行版):浏览 / 订阅 / 下载安装 / 更新检查 / 吊销 / 作者上传
  • [x] 宿主运行库:requires_runtime + host.runtime_dir() / host.has_runtime() (llama_runtime / whisper_runtime / audiocpp_runtime / tts_server_runtime 均 随安装包内置,落盘 data/local-runtime/runtimes/<名字>/; nv_pack_cu13 是 N 卡专属加速包,走单独下载通道)
  • [x] 官网工坊 / Steam 创意工坊 / 用户自制插件统一走 target_app_version 门禁 (未适配 0.2 的旧包不会自行装进来)

明确没有的东西(别找) ​

不存在说明
overlay_root / style_bar 插槽的 Loader声明了也不生效,勿依赖
config_schema 的 file 文件选择控件保留类型但按文本框渲染;要选文件自带 settings_view 或用 host.pick_file()
插件自行注册热键的底层 API必须走宿主 API(自调 ctypes.RegisterHotKey 会静默失效)
运行时 pip install严禁;用 libs/ / vendor/ 或外挂进程
沙箱 / 权限隔离无沙箱,插件与主程序同权限

相关 ​

TransBox - 赋能全人类无界限跨语言交流