@zqagent/core 0.2.14 → 0.2.16

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.
@@ -1225,6 +1225,21 @@ var TurnEngine = class _TurnEngine {
1225
1225
  queueSteering(text) {
1226
1226
  this._steering.push(text);
1227
1227
  }
1228
+ /**
1229
+ * 撤销一条尚未注入的 steering。
1230
+ *
1231
+ * 按文本删第一条匹配项:调用方(SessionManager)已按索引删掉了自己那份队列,
1232
+ * 这里只需保证引擎不再注入同样的内容。用文本而非索引,是因为引擎会在迭代
1233
+ * 间隙批量清空 `_steering`,索引可能已经漂移;文本相同则删哪条都等价。
1234
+ *
1235
+ * @returns 是否真的删掉了(已注入的项返回 false,调用方据此提示用户)
1236
+ */
1237
+ removeSteering(text) {
1238
+ const i = this._steering.indexOf(text);
1239
+ if (i < 0) return false;
1240
+ this._steering.splice(i, 1);
1241
+ return true;
1242
+ }
1228
1243
  // ===================== 主入口 =====================
1229
1244
  /**
1230
1245
  * 运行一轮 Turn