Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions openless-all/app/src-tauri/src/asr/frame.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#![cfg_attr(target_os = "linux", allow(dead_code, unused_variables))]
//! 火山引擎大模型流式 ASR 二进制帧编解码。
//!
//! 帧结构通常为:4 字节 header + 可选 sequence + 4 字节大端 payload size + payload。
Expand Down
1 change: 1 addition & 0 deletions openless-all/app/src-tauri/src/asr/local/cache.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#![cfg_attr(target_os = "linux", allow(dead_code, unused_imports, unused_variables))]
//! 本地 Qwen3-ASR 引擎缓存。
//!
//! 用途:避免每次 dictation 都重加载 1.2GB+ 模型。引擎一次 load 后驻留在内存,
Expand Down
2 changes: 1 addition & 1 deletion openless-all/app/src-tauri/src/asr/local/download.rs
Original file line number Diff line number Diff line change
Expand Up @@ -566,7 +566,7 @@ pub(crate) async fn download_one(

// 1. 计算 chunk 计划
let chunks: Vec<(usize, u64, u64)> = chunk_plan(total_size);
let total_chunks = chunks.len();
let _total_chunks = chunks.len();

// 2. 读已完成的 chunk 索引
let done_set = read_idx(&idx_path);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#![allow(dead_code)] // Task 6 接入 coordinator 后这些路径会变成运行时路径。
#![allow(dead_code, unused_variables)] // Task 6 接入 coordinator 后这些路径会变成运行时路径。

#[cfg(target_os = "windows")]
use std::fs::{self, OpenOptions};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#![cfg_attr(target_os = "linux", allow(dead_code, unused_variables))]
#[cfg(target_os = "windows")]
#[allow(dead_code)]
mod imp {
Expand Down
1 change: 1 addition & 0 deletions openless-all/app/src-tauri/src/asr/local/sherpa.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#![allow(dead_code, unused_imports, unused_variables)]
//! Windows sherpa-onnx 本地 ASR 的常量、catalog 与事件载荷。
//!
//! 当前 catalog 覆盖 Windows offline batch 模型和实验 online streaming 模型;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#![allow(dead_code, unused_imports, unused_variables)]
use std::collections::HashMap;
use std::path::{Path, PathBuf};
use std::sync::atomic::{AtomicBool, AtomicU64, Ordering};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#![allow(dead_code, unused_imports, unused_variables)]
//! sherpa-onnx 本地 ASR provider(Windows offline batch + online streaming)。
//!
//! 形状与 `foundry_provider.rs` 对齐:
Expand Down
1 change: 1 addition & 0 deletions openless-all/app/src-tauri/src/asr/local/sherpa_runtime.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#![allow(dead_code, unused_imports, unused_variables)]
//! sherpa-onnx 本地 ASR runtime(Windows offline batch + online streaming)。
//!
//! 设计与 `foundry_runtime.rs` 对齐:runtime 是模型/会话/生命周期的单一持有者,
Expand Down
5 changes: 4 additions & 1 deletion openless-all/app/src-tauri/src/asr/local/test_run.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#![cfg_attr(target_os = "linux", allow(dead_code, unused_variables))]
//! 本地 Qwen3-ASR 一键"加载 + 测试"实现。
//!
//! 流程:
Expand All @@ -17,7 +18,9 @@ use std::time::Instant;
use anyhow::Result;
use serde::Serialize;

use super::models::{model_dir, ModelId};
use super::models::ModelId;
#[cfg(target_os = "macos")]
use super::models::model_dir;

/// 内嵌测试音频。原始文件 `vendor/qwen-asr/samples/test_speech.wav`
/// 内容:"Hello. This is a test of the Voxtrail speech-to-text system."
Expand Down
1 change: 1 addition & 0 deletions openless-all/app/src-tauri/src/asr/volcengine.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#![cfg_attr(target_os = "linux", allow(dead_code, unused_variables))]
//! Volcengine SAUC bigmodel streaming ASR client.
//!
//! Direct port of the Swift `VolcengineStreamingASR`. Battle-tested protocol
Expand Down
1 change: 1 addition & 0 deletions openless-all/app/src-tauri/src/commands.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#![cfg_attr(target_os = "linux", allow(dead_code, unused_variables))]
//! Tauri command surface — every IPC entry the React UI invokes lives here.

use std::sync::Arc;
Expand Down
4 changes: 4 additions & 0 deletions openless-all/app/src-tauri/src/coordinator.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#![cfg_attr(target_os = "linux", allow(dead_code, unused_imports, unused_variables))]
//! Dictation coordinator.
//!
//! Mirrors the Swift `DictationCoordinator` state machine. Single owner of
Expand Down Expand Up @@ -5081,6 +5082,8 @@ fn emit_capsule(
{
return;
}
#[cfg(not(target_os = "linux"))]
{

// 三平台统一:Done / Cancelled / Error 状态保留 ~1.5s toast
// (schedule_capsule_idle 之后会回 Idle 隐藏)。
Expand Down Expand Up @@ -5119,6 +5122,7 @@ fn emit_capsule(
hide_capsule_window_if_present();
let _ = window.hide();
}
}
});

let _ = app.emit_to("capsule", "capsule:state", payload);
Expand Down
1 change: 1 addition & 0 deletions openless-all/app/src-tauri/src/hotkey.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#![cfg_attr(target_os = "linux", allow(dead_code))]
//! 全局热键监听:发送按下 / 抬起 / 取消三类边沿事件。
//!
//! - macOS:原生 CGEventTap(core-foundation + core-graphics FFI),与 Swift
Expand Down
6 changes: 4 additions & 2 deletions openless-all/app/src-tauri/src/insertion.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#![cfg_attr(target_os = "linux", allow(dead_code, unused_variables))]
//! 跨平台光标位置文本插入。
//!
//! 通用步骤:先写剪贴板(模拟失败时用户能手动粘贴)→ 模拟粘贴快捷键。
Expand Down Expand Up @@ -57,6 +58,7 @@ impl TextInserter {
}
}
}
#[cfg(not(target_os = "linux"))]
insert_with_clipboard_restore(text, restore_clipboard_after_paste, paste_shortcut)
}

Expand Down Expand Up @@ -89,8 +91,8 @@ impl TextInserter {
pub fn insert(
&self,
text: &str,
_restore_clipboard_after_paste: bool,
_paste_shortcut: PasteShortcut,
restore_clipboard_after_paste: bool,
paste_shortcut: PasteShortcut,
) -> InsertStatus {
if text.is_empty() {
return InsertStatus::CopiedFallback;
Expand Down
1 change: 1 addition & 0 deletions openless-all/app/src-tauri/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#![cfg_attr(target_os = "linux", allow(dead_code, unused_imports, unused_variables))]
//! OpenLess Tauri backend.
//!
//! Modules mirror the original Swift libraries (one purpose per file):
Expand Down
1 change: 1 addition & 0 deletions openless-all/app/src-tauri/src/linux_fcitx.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#![cfg_attr(target_os = "linux", allow(dead_code, unused_variables))]
//! Linux fcitx5 插件 DBus 客户端。
//!
//! 封装对 `org.fcitx.Fcitx.OpenLess1` 接口的调用,
Expand Down
1 change: 1 addition & 0 deletions openless-all/app/src-tauri/src/permissions.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#![cfg_attr(target_os = "linux", allow(dead_code, unused_variables))]
//! 系统权限请求 / 检查(macOS / Windows)。
//!
//! 与 Swift `Sources/OpenLessHotkey/AccessibilityPermission.swift` +
Expand Down
1 change: 1 addition & 0 deletions openless-all/app/src-tauri/src/persistence.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#![cfg_attr(target_os = "linux", allow(dead_code, unused_variables))]
//! Local persistence: history JSON, user preferences JSON, vocab JSON, and
//! platform-backed credentials vault.
//!
Expand Down
1 change: 1 addition & 0 deletions openless-all/app/src-tauri/src/polish.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#![cfg_attr(target_os = "linux", allow(dead_code, unused_variables))]
//! OpenAI-compatible chat completions client + polish prompts.
//!
//! 提示词在 `prompts` 模块中维护:使用 `# 角色 / # 任务 / # 通用规则 / # 输出 / # 示例`
Expand Down
1 change: 1 addition & 0 deletions openless-all/app/src-tauri/src/selection.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#![cfg_attr(target_os = "linux", allow(dead_code, unused_imports, unused_variables))]
//! 跨平台「划词捕获」工具:在用户触发 QA 快捷键时尝试拿到当前前台 app 的选区文本。
//!
//! 三级 fallback:
Expand Down
1 change: 1 addition & 0 deletions openless-all/app/src-tauri/src/types.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#![cfg_attr(target_os = "linux", allow(dead_code, unused_variables))]
//! Shared value types crossing the IPC boundary.

use serde::{Deserialize, Serialize};
Expand Down
1 change: 1 addition & 0 deletions openless-all/app/src-tauri/src/unicode_keystroke.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#![cfg_attr(target_os = "linux", allow(dead_code, unused_variables))]
//! 跨平台 Unicode keystroke 合成(流式输入用)。
//!
//! 公开 API 三件套:
Expand Down
1 change: 1 addition & 0 deletions openless-all/app/src-tauri/src/windows_ime_ipc.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#![allow(dead_code, unused_imports, unused_variables)]
use std::time::Duration;

use crate::windows_ime_protocol::ImeSubmitStatus;
Expand Down
1 change: 1 addition & 0 deletions openless-all/app/src-tauri/src/windows_ime_profile.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#![allow(dead_code, unused_imports, unused_variables)]
pub const OPENLESS_TSF_LANG_ID: u16 = 0x0804;
pub const OPENLESS_TEXT_SERVICE_CLSID_BRACED: &str = "{6B9F3F4F-5EE7-42D6-9C61-9F80B03A5D7D}";
pub const OPENLESS_PROFILE_GUID_BRACED: &str = "{9B5F5E04-23F6-47DA-9A26-D221F6C3F02E}";
Expand Down
1 change: 1 addition & 0 deletions openless-all/app/src-tauri/src/windows_ime_protocol.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#![allow(dead_code, unused_imports, unused_variables)]
use serde::{Deserialize, Serialize};

pub const OPENLESS_IME_PROTOCOL_VERSION: u32 = 1;
Expand Down
1 change: 1 addition & 0 deletions openless-all/app/src-tauri/src/windows_ime_session.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#![allow(dead_code, unused_imports, unused_variables)]
use crate::types::InsertStatus;
use crate::windows_ime_ipc::{ImeSubmitRequest, WindowsImeIpcServer};
use crate::windows_ime_profile::{
Expand Down
Loading