jbc-dssi 1.1.141 → 1.1.142

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.
@@ -117,14 +117,20 @@ export function readPendingTasks(filePath, ttlMs = 24 * 60 * 60 * 1000, now = Da
117
117
  }
118
118
  }
119
119
 
120
- /** 标记这批待续任务"已呈现"(同一次重启只呈现一次;下次重启不再重复刷)。 */
120
+ /**
121
+ * 标记这批待续任务"已呈现"——**呈现即从队列删除**(2026-11-18 老谢定)。
122
+ *
123
+ * 事故:重启接续那行的「待续任务」里贴出一条 11.6 小时前问过、早已处理完的老问题。
124
+ * 根因:原实现只给条目打 `presentedAt` 标记、不删条目,一直躺到 24h TTL 才清。
125
+ * 口径:呈现 = 已尽力接续,删掉才对;真没处理完的,下一轮用户消息会重新入队,不会丢。
126
+ */
121
127
  export function markPendingTasksPresented(filePath, taskIds, now = Date.now()) {
122
128
  if (!Array.isArray(taskIds) || taskIds.length === 0) return false;
123
129
  try {
124
130
  const parsed = JSON.parse(readFileSync(filePath, 'utf8'));
125
131
  const tasks = Array.isArray(parsed?.tasks) ? parsed.tasks : [];
126
132
  const set = new Set(taskIds);
127
- const next = tasks.map((t) => (t && set.has(t.taskId) ? { ...t, presentedAt: now } : t));
133
+ const next = tasks.filter((t) => !(t && set.has(t.taskId)));
128
134
  writeFileSync(filePath, `${JSON.stringify({ v: 1, tasks: next }, null, 2)}\n`, 'utf8');
129
135
  return true;
130
136
  } catch {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jbc-dssi",
3
- "version": "1.1.141",
3
+ "version": "1.1.142",
4
4
  "type": "module",
5
5
  "description": "鲸编程 - 不只是手机遥控操作电脑,而是将电脑级的Agent能力装进手机",
6
6
  "keywords": [