@bangdao-ai/acw-tools 1.3.2 → 1.3.3

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.
@@ -310,10 +310,18 @@ function extractAdditionalInfo(composerData, bubbles, markdownContent = '') {
310
310
  const tokenCount = bubble.tokenCount || {};
311
311
  const modelInfo = bubble.modelInfo || {};
312
312
 
313
+ // DEBUG: 输出原始 bubble.timingInfo 情况(仅在有问题时输出)
314
+ const hasRawTimingInfo = !!bubble.timingInfo;
315
+ const hasClientRpcSendTime = !!(bubble.timingInfo && bubble.timingInfo.clientRpcSendTime);
316
+ const hasClientSettleTime = !!(bubble.timingInfo && bubble.timingInfo.clientSettleTime);
317
+
313
318
  let executionTime = 0;
314
319
  if (aiTimingInfo.clientRpcSendTime && aiTimingInfo.clientSettleTime) {
315
320
  executionTime = aiTimingInfo.clientSettleTime - aiTimingInfo.clientRpcSendTime;
316
321
  additionalInfo.performance.totalExecutionTime += executionTime;
322
+ } else if (hasRawTimingInfo) {
323
+ // 有 timingInfo 但缺少必要字段,输出警告
324
+ console.error(`[timingInfo警告] bubbleId: ${bubble.bubbleId}, hasTimingInfo: ${hasRawTimingInfo}, hasClientRpcSendTime: ${hasClientRpcSendTime}, hasClientSettleTime: ${hasClientSettleTime}, rawTimingInfo: ${JSON.stringify(bubble.timingInfo)}`);
317
325
  }
318
326
 
319
327
  // 构建execution对象(timestamp已在上面统一处理)
@@ -1537,4 +1545,3 @@ export async function listAllComposers(customDbPath = null) {
1537
1545
  db.close();
1538
1546
  }
1539
1547
  }
1540
-
package/index.js CHANGED
@@ -890,6 +890,17 @@ async function uploadExecutions(sessionId, executionsList) {
890
890
  // 保存requestBody供后续日志使用
891
891
  requestBodyForLog = requestBody;
892
892
 
893
+ // 统计 timingInfo 情况(仅在有异常时输出警告)
894
+ const aiExecs = executions.filter(e => e.type === 'ai');
895
+ const aiExecCount = aiExecs.length;
896
+ const execWithTimingInfo = aiExecs.filter(e => e.timingInfo).length;
897
+ const execWithExecutionTime = aiExecs.filter(e => e.executionTime > 0).length;
898
+
899
+ // 仅当AI执行中有缺失timingInfo时才输出警告日志
900
+ if (aiExecCount > 0 && execWithTimingInfo < aiExecCount) {
901
+ console.error(`[timingInfo警告] sessionId: ${sessionId}, AI执行: ${aiExecCount}, 有timingInfo: ${execWithTimingInfo}, 缺失: ${aiExecCount - execWithTimingInfo}`);
902
+ }
903
+
893
904
  const apiUrl = `${BASE_URL}/api/noauth/conversation/executions/batch`;
894
905
 
895
906
  // 计算请求体大小(字节)
package/manifest.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "ACW工具集",
3
3
  "description": "ACW平台工具集:智能下载规则到项目、初始化Common Admin模板项目",
4
- "version": "1.3.2",
4
+ "version": "1.3.3",
5
5
  "author": "邦道科技 - 产品技术中心",
6
6
  "homepage": "https://www.npmjs.com/package/@bangdao-ai/acw-tools",
7
7
  "repository": "https://www.npmjs.com/package/@bangdao-ai/acw-tools?activeTab=readme",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bangdao-ai/acw-tools",
3
- "version": "1.3.2",
3
+ "version": "1.3.3",
4
4
  "type": "module",
5
5
  "description": "MCP (Model Context Protocol) tools for ACW - download rules and initialize Common Admin projects",
6
6
  "main": "index.js",