标签必须独立!`;
// 一起听功能提示词模板
export const LISTEN_TOGETHER_PROMPT_TEMPLATE = `##【一起听歌场景】
diff --git a/history-logs.js b/history-logs.js
index 8d0d480..a67b60d 100644
--- a/history-logs.js
+++ b/history-logs.js
@@ -351,7 +351,7 @@ export function renderToyHistory(contact) {
${targetText}
-
+
diff --git a/main.js b/main.js
index 4b0d755..9542fda 100644
--- a/main.js
+++ b/main.js
@@ -167,10 +167,10 @@ function renderHistoryContent(contact, tabType) {
html += ``;
diff --git a/style.css b/style.css
index b4a486b..15cfcbf 100644
--- a/style.css
+++ b/style.css
@@ -6888,6 +6888,7 @@
.wechat-moment-images.grid-2 {
grid-template-columns: repeat(2, 1fr);
+ max-width: 280px;
}
.wechat-moment-images.grid-3,
@@ -10674,9 +10675,9 @@
justify-content: center;
width: 20px;
height: 20px;
- margin-right: 6px;
cursor: pointer;
flex-shrink: 0;
+ align-self: center;
}
.wechat-blocked-exclamation-icon {
@@ -10709,8 +10710,8 @@
justify-content: center;
width: 20px;
height: 20px;
- margin-left: 6px;
flex-shrink: 0;
+ align-self: center;
}
/* 手机弹窗样式 */
@@ -10898,14 +10899,17 @@
background: none;
border: none;
cursor: pointer;
- font-size: 14px;
- padding: 2px 4px;
- opacity: 0.5;
- transition: opacity 0.2s;
+ font-size: 18px;
+ color: #999;
+ padding: 0 4px;
+ line-height: 1;
+ opacity: 0.7;
+ transition: opacity 0.2s, color 0.2s;
}
.wechat-history-delete-btn:hover {
opacity: 1;
+ color: #ff4d4f;
}
.wechat-toy-history-card-actions {
diff --git a/summary.js b/summary.js
index a51d29e..28e509f 100644
--- a/summary.js
+++ b/summary.js
@@ -307,7 +307,7 @@ export function generateSummaryPrompt(allChats, cupNumber) {
// 如果有自定义模板,使用自定义模板
let prompt;
if (settings.customSummaryTemplate && settings.customSummaryTemplate.trim()) {
- prompt = settings.customSummaryTemplate.trim() + '\n\n【线上聊天记录】\n';
+ prompt = settings.customSummaryTemplate.trim() + '\n\n以下是线上聊天记录:\n\n【线上聊天记录】\n';
} else {
// 使用默认模板(纯对话记录模式)
prompt = `你的任务是将这段【线上聊天记录】原样整理成JSON格式。
@@ -328,6 +328,8 @@ export function generateSummaryPrompt(allChats, cupNumber) {
【JSON示例】
{"keys":["公园","约会","周末"],"content":"{{user}}: 今天去哪玩?\\n{{char}}: 去公园吧\\n{{user}}: 好呀\\n{{char}}: 那我们下午2点见","comment":"${getCupName(cupNumber)}"}
+以下是线上聊天记录:
+
【线上聊天记录】
`;
}
diff --git a/video-call.js b/video-call.js
index 2667914..38de636 100644
--- a/video-call.js
+++ b/video-call.js
@@ -655,6 +655,18 @@ function bindVideoCallEvents() {
}
});
+ // 移动端键盘收起后重置滚动位置
+ document.getElementById('wechat-video-call-input')?.addEventListener('blur', () => {
+ setTimeout(() => {
+ window.scrollTo(0, 0);
+ const page = document.getElementById('wechat-video-call-page');
+ if (page) {
+ page.style.transform = '';
+ page.style.top = '0';
+ }
+ }, 100);
+ });
+
// AI来电界面事件
document.getElementById('wechat-video-call-incoming-accept')?.addEventListener('click', acceptIncomingCall);
document.getElementById('wechat-video-call-incoming-decline')?.addEventListener('click', declineIncomingCall);
@@ -724,6 +736,21 @@ async function triggerAIVideoGreeting() {
if (/^\[(?:表情|照片|分享音乐|音乐)[::]/.test(reply)) continue;
reply = reply.replace(/\[.*?\]/g, '').trim();
+ // 过滤掉泄露的提示词或内部指令
+ reply = reply.replace(/^-\d+\s*.*/gm, '').trim();
+ if (/我需要.*(回复|做出|扮演|以.*身份)/.test(reply)) {
+ const dashMatch = reply.match(/---+\s*(.+)$/);
+ if (dashMatch) {
+ reply = dashMatch[1].trim();
+ } else {
+ continue;
+ }
+ }
+ if (reply.includes('---')) {
+ const parts2 = reply.split(/---+/);
+ reply = parts2[parts2.length - 1].trim();
+ }
+
if (reply) {
// 分离场景描述和说话内容
// 提取所有括号内的场景描述
@@ -798,6 +825,21 @@ async function triggerCameraToggleReaction() {
if (/^\[(?:表情|照片|分享音乐|音乐)[::]/.test(reply)) continue;
reply = reply.replace(/\[.*?\]/g, '').trim();
+ // 过滤掉泄露的提示词或内部指令
+ reply = reply.replace(/^-\d+\s*.*/gm, '').trim();
+ if (/我需要.*(回复|做出|扮演|以.*身份)/.test(reply)) {
+ const dashMatch = reply.match(/---+\s*(.+)$/);
+ if (dashMatch) {
+ reply = dashMatch[1].trim();
+ } else {
+ continue;
+ }
+ }
+ if (reply.includes('---')) {
+ const parts2 = reply.split(/---+/);
+ reply = parts2[parts2.length - 1].trim();
+ }
+
if (reply) {
// 分离场景描述和说话内容
const sceneMatches = reply.match(/([^)]+)/g);
@@ -906,6 +948,21 @@ ${lastMessages}
if (/^\[(?:表情|照片|分享音乐|音乐)[::]/.test(reply)) continue;
reply = reply.replace(/\[.*?\]/g, '').trim();
+ // 过滤掉泄露的提示词或内部指令
+ reply = reply.replace(/^-\d+\s*.*/gm, '').trim();
+ if (/我需要.*(回复|做出|扮演|以.*身份)/.test(reply)) {
+ const dashMatch = reply.match(/---+\s*(.+)$/);
+ if (dashMatch) {
+ reply = dashMatch[1].trim();
+ } else {
+ continue;
+ }
+ }
+ if (reply.includes('---')) {
+ const parts2 = reply.split(/---+/);
+ reply = parts2[parts2.length - 1].trim();
+ }
+
if (reply) {
// 保存到聊天历史
const now = new Date();
diff --git a/voice-call.js b/voice-call.js
index 7c5165b..84a62d8 100644
--- a/voice-call.js
+++ b/voice-call.js
@@ -632,6 +632,20 @@ function bindCallEvents() {
sendCallMessage();
}
});
+
+ // 移动端键盘收起后重置滚动位置
+ document.getElementById('wechat-voice-call-input')?.addEventListener('blur', () => {
+ // 延迟执行以等待键盘完全收起
+ setTimeout(() => {
+ window.scrollTo(0, 0);
+ // 重置可能被移动的元素
+ const page = document.getElementById('wechat-voice-call-page');
+ if (page) {
+ page.style.transform = '';
+ page.style.top = '0';
+ }
+ }, 100);
+ });
}
// 接听来电
@@ -803,7 +817,7 @@ ${lastMessages}
hideTypingIndicator();
}
- // 按 ||| 分割,并将特殊标签与文本分离,避免“文字+表情包”混在同一条
+ // 按 ||| 分割,并将特殊标签与文本分离,避免"文字+表情包"混在同一条
const parts = splitAIMessages(aiResponse);
for (const part of parts) {
@@ -815,6 +829,25 @@ ${lastMessages}
// 移除可能的特殊标记
reply = reply.replace(/\[.*?\]/g, '').trim();
+ // 过滤掉泄露的提示词或内部指令
+ // 1. 以负数开头的行(如 -5000)
+ reply = reply.replace(/^-\d+\s*.*/gm, '').trim();
+ // 2. 包含"我需要"+"回复/做出/扮演"等指令性内容
+ if (/我需要.*(回复|做出|扮演|以.*身份)/.test(reply)) {
+ // 尝试提取 --- 后面的实际内容
+ const dashMatch = reply.match(/---+\s*(.+)$/);
+ if (dashMatch) {
+ reply = dashMatch[1].trim();
+ } else {
+ continue; // 跳过这条消息
+ }
+ }
+ // 3. 移除 --- 分隔符前面的内容(如果有的话)
+ if (reply.includes('---')) {
+ const parts2 = reply.split(/---+/);
+ reply = parts2[parts2.length - 1].trim();
+ }
+
if (reply) {
// 保存到聊天历史
const now = new Date();