Skip to content

Commit 7dadcc1

Browse files
committed
fix: 修复角色台词混串、MOD 加载失败 (v0.8.63)
- 修复台词混串:前端改为通过 IPC 加载当前角色专属 waifu_texts.json,不再全局共用 Pero 台词 - 修复 mods.hooks ModuleNotFoundError:补充缺失的 __init__.py - 新增 get_agent_waifu_texts IPC handler
1 parent e645c0f commit 7dadcc1

12 files changed

Lines changed: 44 additions & 10 deletions

File tree

backend/mods/__init__.py

Whitespace-only changes.

backend/mods/memory_tagger/__init__.py

Whitespace-only changes.

backend/nit_core/interpreter/rust_binding/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "nit_rust_runtime"
3-
version = "0.8.62"
3+
version = "0.8.63"
44
edition = "2021"
55

66
[lib]

backend/nit_core/interpreter/rust_binding/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "maturin"
44

55
[project]
66
name = "nit_rust_runtime"
7-
version = "0.8.62"
7+
version = "0.8.63"
88
description = "NIT Rust Runtime"
99
requires-python = ">=3.8"
1010
dependencies = []

backend/nit_core/nit_terminal_auditor/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "nit_terminal_auditor"
3-
version = "0.8.62"
3+
version = "0.8.63"
44
edition = "2021"
55

66
[lib]

backend/nit_core/tools/work/CodeSearcher/src/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "CodeSearcher"
3-
version = "0.8.62"
3+
version = "0.8.63"
44
edition = "2021"
55

66
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

backend/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "pero-backend"
3-
version = "0.8.62"
3+
version = "0.8.63"
44
description = "萌动链接:PeroperoChat! 后端服务"
55
requires-python = ">=3.10,<3.11"
66
dependencies = [

backend/vision_core/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "pero_vision_core"
3-
version = "0.8.62"
3+
version = "0.8.63"
44
edition = "2021"
55

66
[lib]

backend/vision_core/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "maturin"
44

55
[project]
66
name = "pero_vision_core"
7-
version = "0.8.62"
7+
version = "0.8.63"
88
description = "High-performance computer vision core for Pero using Rust"
99
license = { text = "Apache-2.0" }
1010
authors = [

electron/main/index.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -583,6 +583,18 @@ ipcMain.handle('get_backend_logs', () => getBackendLogs())
583583
ipcMain.handle('scan_local_agents', async () => {
584584
return await scanLocalAgents()
585585
})
586+
587+
// 根据角色 ID 获取该角色的交互台词
588+
ipcMain.handle('get_agent_waifu_texts', async (_, agentId: string) => {
589+
const root = isDev ? path.resolve(__dirname, '../../..') : paths.resources
590+
const waifuPath = path.join(root, 'backend/services/mdp/agents', agentId, 'waifu_texts.json')
591+
if (await fs.pathExists(waifuPath)) {
592+
return await fs.readJson(waifuPath)
593+
}
594+
// 找不到角色台词时返回空对象,前端会使用默认台词
595+
logger.warn('Main', `[Agents] 未找到角色 ${agentId} 的 waifu_texts.json: ${waifuPath}`)
596+
return {}
597+
})
586598
ipcMain.handle('check_napcat', async () => {
587599
const diag = await getDiagnostics()
588600
return diag.napcat_installed

0 commit comments

Comments
 (0)