@ww_nero/mini-cli 1.0.103 → 1.0.104

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/chat.js +3 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ww_nero/mini-cli",
3
- "version": "1.0.103",
3
+ "version": "1.0.104",
4
4
  "description": "极简的 AI 命令行助手",
5
5
  "bin": {
6
6
  "mini": "bin/mini.js"
package/src/chat.js CHANGED
@@ -1230,7 +1230,9 @@ const startChatSession = async ({
1230
1230
  if (!conversationAdvanced) {
1231
1231
  const lastMessage = messages[messages.length - 1];
1232
1232
  if (lastMessage && lastMessage.role === 'user') {
1233
- messages.pop();
1233
+ // 用户中断时,添加assistant消息标记中断,保留用户问题
1234
+ messages.push({ role: 'assistant', content: '已被用户中断' });
1235
+ persistHistorySafely();
1234
1236
  }
1235
1237
  }
1236
1238
  if (isAbortError) {