@ai-setting/roy-agent-cli 1.5.57 → 1.5.59

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.
@@ -207,8 +207,9 @@ ${COLORS.system("[已中断]")}
207
207
  process.stdout.write(COLORS.reasoning(delta));
208
208
  return;
209
209
  }
210
- if (this.reasoningClosedByText)
211
- return;
210
+ if (this.reasoningClosedByText) {
211
+ this.reasoningClosedByText = false;
212
+ }
212
213
  this.reasoningBuffer += delta;
213
214
  if (this.reasoningBuffer.length >= 15) {
214
215
  this.flushReasoningBuffer();
@@ -7319,7 +7320,7 @@ var require_dist = __commonJS((exports) => {
7319
7320
  var require_package = __commonJS((exports, module) => {
7320
7321
  module.exports = {
7321
7322
  name: "@ai-setting/roy-agent-cli",
7322
- version: "1.5.57",
7323
+ version: "1.5.59",
7323
7324
  type: "module",
7324
7325
  description: "CLI for roy-agent - Non-interactive command execution",
7325
7326
  main: "./dist/index.js",
@@ -7346,7 +7347,7 @@ var require_package = __commonJS((exports, module) => {
7346
7347
  },
7347
7348
  dependencies: {
7348
7349
  "@ai-setting/roy-agent-coder-harness": "^1.5.48",
7349
- "@ai-setting/roy-agent-core": "^1.5.56",
7350
+ "@ai-setting/roy-agent-core": "^1.5.58",
7350
7351
  "@ai-setting/roy-agent-ontology-harness": "^1.5.47",
7351
7352
  chalk: "^5.6.2",
7352
7353
  commander: "^14.0.3",
@@ -8842,6 +8843,9 @@ class QueryExecutor {
8842
8843
  getFullText() {
8843
8844
  return this.streamService?.getFullText() ?? "";
8844
8845
  }
8846
+ resetStream() {
8847
+ this.streamService?.reset();
8848
+ }
8845
8849
  async compact(sessionId) {
8846
8850
  try {
8847
8851
  const envCore = this.env.getComponent("core");
@@ -8949,7 +8953,12 @@ class EventMessageFormatter {
8949
8953
  const desc = payload.description || "未命名任务";
8950
8954
  const progress = payload.progress !== undefined ? `${payload.progress}%` : "";
8951
8955
  const message = payload.progressMessage || "";
8952
- let result = `${this.prefix} \uD83D\uDD04 后台任务「${desc}」进度更新`;
8956
+ const taskId = payload.associatedTaskId;
8957
+ let result = `${this.prefix} \uD83D\uDD04 后台任务「${desc}」`;
8958
+ if (taskId !== undefined) {
8959
+ result += `[Task #${taskId}] `;
8960
+ }
8961
+ result += `进度更新`;
8953
8962
  if (progress)
8954
8963
  result += `: ${progress}`;
8955
8964
  if (message)
@@ -8960,7 +8969,17 @@ class EventMessageFormatter {
8960
8969
  const desc = payload.description || "未命名任务";
8961
8970
  const result = payload.result;
8962
8971
  const time = payload.executionTimeMs ? `(${this.formatDuration(payload.executionTimeMs)})` : "";
8972
+ const bgProcessId = payload.backgroundTaskId || "";
8973
+ const taskId = payload.associatedTaskId;
8963
8974
  let message = `${this.prefix} ✅ 后台任务「${desc}」已完成 ${time}`;
8975
+ if (bgProcessId) {
8976
+ message += `
8977
+ bgprocess: ${bgProcessId}`;
8978
+ }
8979
+ if (taskId !== undefined) {
8980
+ message += `
8981
+ Task #${taskId}`;
8982
+ }
8964
8983
  if (result) {
8965
8984
  const truncatedResult = result.length > 1e4 ? result.substring(0, 100) + "...[TRUNCATED]" : result;
8966
8985
  message += `
@@ -8972,7 +8991,17 @@ class EventMessageFormatter {
8972
8991
  const desc = payload.description || "未命名任务";
8973
8992
  const error = payload.error || "未知错误";
8974
8993
  const time = payload.executionTimeMs ? `(${this.formatDuration(payload.executionTimeMs)})` : "";
8994
+ const bgProcessId = payload.backgroundTaskId || "";
8995
+ const taskId = payload.associatedTaskId;
8975
8996
  let message = `${this.prefix} ❌ 后台任务「${desc}」失败 ${time}`;
8997
+ if (bgProcessId) {
8998
+ message += `
8999
+ bgprocess: ${bgProcessId}`;
9000
+ }
9001
+ if (taskId !== undefined) {
9002
+ message += `
9003
+ Task #${taskId}`;
9004
+ }
8976
9005
  if (error) {
8977
9006
  const truncatedError = error.length > 100 ? error.substring(0, 100) + "..." : error;
8978
9007
  message += `
@@ -8983,12 +9012,34 @@ class EventMessageFormatter {
8983
9012
  formatTaskTimeout(payload) {
8984
9013
  const desc = payload.description || "未命名任务";
8985
9014
  const time = payload.executionTimeMs ? `(${this.formatDuration(payload.executionTimeMs)})` : "";
8986
- return `${this.prefix} ⏱️ 后台任务「${desc}」超时 ${time}`;
9015
+ const bgProcessId = payload.backgroundTaskId || "";
9016
+ const taskId = payload.associatedTaskId;
9017
+ let message = `${this.prefix} ⏱️ 后台任务「${desc}」超时 ${time}`;
9018
+ if (bgProcessId) {
9019
+ message += `
9020
+ bgprocess: ${bgProcessId}`;
9021
+ }
9022
+ if (taskId !== undefined) {
9023
+ message += `
9024
+ Task #${taskId}`;
9025
+ }
9026
+ return message;
8987
9027
  }
8988
9028
  formatTaskStopped(payload) {
8989
9029
  const desc = payload.description || "未命名任务";
8990
9030
  const time = payload.executionTimeMs ? `(${this.formatDuration(payload.executionTimeMs)})` : "";
8991
- return `${this.prefix} \uD83D\uDED1 后台任务「${desc}」已停止 ${time}`;
9031
+ const bgProcessId = payload.backgroundTaskId || "";
9032
+ const taskId = payload.associatedTaskId;
9033
+ let message = `${this.prefix} \uD83D\uDED1 后台任务「${desc}」已停止 ${time}`;
9034
+ if (bgProcessId) {
9035
+ message += `
9036
+ bgprocess: ${bgProcessId}`;
9037
+ }
9038
+ if (taskId !== undefined) {
9039
+ message += `
9040
+ Task #${taskId}`;
9041
+ }
9042
+ return message;
8992
9043
  }
8993
9044
  formatGeneric(event) {
8994
9045
  return `${this.prefix} 收到事件: ${event.type}`;
package/dist/index.js CHANGED
@@ -206,8 +206,9 @@ ${COLORS.system("[已中断]")}
206
206
  process.stdout.write(COLORS.reasoning(delta));
207
207
  return;
208
208
  }
209
- if (this.reasoningClosedByText)
210
- return;
209
+ if (this.reasoningClosedByText) {
210
+ this.reasoningClosedByText = false;
211
+ }
211
212
  this.reasoningBuffer += delta;
212
213
  if (this.reasoningBuffer.length >= 15) {
213
214
  this.flushReasoningBuffer();
@@ -7318,7 +7319,7 @@ var require_dist = __commonJS((exports) => {
7318
7319
  var require_package = __commonJS((exports, module) => {
7319
7320
  module.exports = {
7320
7321
  name: "@ai-setting/roy-agent-cli",
7321
- version: "1.5.57",
7322
+ version: "1.5.59",
7322
7323
  type: "module",
7323
7324
  description: "CLI for roy-agent - Non-interactive command execution",
7324
7325
  main: "./dist/index.js",
@@ -7345,7 +7346,7 @@ var require_package = __commonJS((exports, module) => {
7345
7346
  },
7346
7347
  dependencies: {
7347
7348
  "@ai-setting/roy-agent-coder-harness": "^1.5.48",
7348
- "@ai-setting/roy-agent-core": "^1.5.56",
7349
+ "@ai-setting/roy-agent-core": "^1.5.58",
7349
7350
  "@ai-setting/roy-agent-ontology-harness": "^1.5.47",
7350
7351
  chalk: "^5.6.2",
7351
7352
  commander: "^14.0.3",
@@ -8841,6 +8842,9 @@ class QueryExecutor {
8841
8842
  getFullText() {
8842
8843
  return this.streamService?.getFullText() ?? "";
8843
8844
  }
8845
+ resetStream() {
8846
+ this.streamService?.reset();
8847
+ }
8844
8848
  async compact(sessionId) {
8845
8849
  try {
8846
8850
  const envCore = this.env.getComponent("core");
@@ -8948,7 +8952,12 @@ class EventMessageFormatter {
8948
8952
  const desc = payload.description || "未命名任务";
8949
8953
  const progress = payload.progress !== undefined ? `${payload.progress}%` : "";
8950
8954
  const message = payload.progressMessage || "";
8951
- let result = `${this.prefix} \uD83D\uDD04 后台任务「${desc}」进度更新`;
8955
+ const taskId = payload.associatedTaskId;
8956
+ let result = `${this.prefix} \uD83D\uDD04 后台任务「${desc}」`;
8957
+ if (taskId !== undefined) {
8958
+ result += `[Task #${taskId}] `;
8959
+ }
8960
+ result += `进度更新`;
8952
8961
  if (progress)
8953
8962
  result += `: ${progress}`;
8954
8963
  if (message)
@@ -8959,7 +8968,17 @@ class EventMessageFormatter {
8959
8968
  const desc = payload.description || "未命名任务";
8960
8969
  const result = payload.result;
8961
8970
  const time = payload.executionTimeMs ? `(${this.formatDuration(payload.executionTimeMs)})` : "";
8971
+ const bgProcessId = payload.backgroundTaskId || "";
8972
+ const taskId = payload.associatedTaskId;
8962
8973
  let message = `${this.prefix} ✅ 后台任务「${desc}」已完成 ${time}`;
8974
+ if (bgProcessId) {
8975
+ message += `
8976
+ bgprocess: ${bgProcessId}`;
8977
+ }
8978
+ if (taskId !== undefined) {
8979
+ message += `
8980
+ Task #${taskId}`;
8981
+ }
8963
8982
  if (result) {
8964
8983
  const truncatedResult = result.length > 1e4 ? result.substring(0, 100) + "...[TRUNCATED]" : result;
8965
8984
  message += `
@@ -8971,7 +8990,17 @@ class EventMessageFormatter {
8971
8990
  const desc = payload.description || "未命名任务";
8972
8991
  const error = payload.error || "未知错误";
8973
8992
  const time = payload.executionTimeMs ? `(${this.formatDuration(payload.executionTimeMs)})` : "";
8993
+ const bgProcessId = payload.backgroundTaskId || "";
8994
+ const taskId = payload.associatedTaskId;
8974
8995
  let message = `${this.prefix} ❌ 后台任务「${desc}」失败 ${time}`;
8996
+ if (bgProcessId) {
8997
+ message += `
8998
+ bgprocess: ${bgProcessId}`;
8999
+ }
9000
+ if (taskId !== undefined) {
9001
+ message += `
9002
+ Task #${taskId}`;
9003
+ }
8975
9004
  if (error) {
8976
9005
  const truncatedError = error.length > 100 ? error.substring(0, 100) + "..." : error;
8977
9006
  message += `
@@ -8982,12 +9011,34 @@ class EventMessageFormatter {
8982
9011
  formatTaskTimeout(payload) {
8983
9012
  const desc = payload.description || "未命名任务";
8984
9013
  const time = payload.executionTimeMs ? `(${this.formatDuration(payload.executionTimeMs)})` : "";
8985
- return `${this.prefix} ⏱️ 后台任务「${desc}」超时 ${time}`;
9014
+ const bgProcessId = payload.backgroundTaskId || "";
9015
+ const taskId = payload.associatedTaskId;
9016
+ let message = `${this.prefix} ⏱️ 后台任务「${desc}」超时 ${time}`;
9017
+ if (bgProcessId) {
9018
+ message += `
9019
+ bgprocess: ${bgProcessId}`;
9020
+ }
9021
+ if (taskId !== undefined) {
9022
+ message += `
9023
+ Task #${taskId}`;
9024
+ }
9025
+ return message;
8986
9026
  }
8987
9027
  formatTaskStopped(payload) {
8988
9028
  const desc = payload.description || "未命名任务";
8989
9029
  const time = payload.executionTimeMs ? `(${this.formatDuration(payload.executionTimeMs)})` : "";
8990
- return `${this.prefix} \uD83D\uDED1 后台任务「${desc}」已停止 ${time}`;
9030
+ const bgProcessId = payload.backgroundTaskId || "";
9031
+ const taskId = payload.associatedTaskId;
9032
+ let message = `${this.prefix} \uD83D\uDED1 后台任务「${desc}」已停止 ${time}`;
9033
+ if (bgProcessId) {
9034
+ message += `
9035
+ bgprocess: ${bgProcessId}`;
9036
+ }
9037
+ if (taskId !== undefined) {
9038
+ message += `
9039
+ Task #${taskId}`;
9040
+ }
9041
+ return message;
8991
9042
  }
8992
9043
  formatGeneric(event) {
8993
9044
  return `${this.prefix} 收到事件: ${event.type}`;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ai-setting/roy-agent-cli",
3
- "version": "1.5.57",
3
+ "version": "1.5.59",
4
4
  "type": "module",
5
5
  "description": "CLI for roy-agent - Non-interactive command execution",
6
6
  "main": "./dist/index.js",
@@ -27,7 +27,7 @@
27
27
  },
28
28
  "dependencies": {
29
29
  "@ai-setting/roy-agent-coder-harness": "^1.5.48",
30
- "@ai-setting/roy-agent-core": "^1.5.56",
30
+ "@ai-setting/roy-agent-core": "^1.5.58",
31
31
  "@ai-setting/roy-agent-ontology-harness": "^1.5.47",
32
32
  "chalk": "^5.6.2",
33
33
  "commander": "^14.0.3",