workflow-ai 1.0.30 → 1.0.31
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.
- package/package.json +1 -1
- package/src/runner.mjs +14 -0
package/package.json
CHANGED
package/src/runner.mjs
CHANGED
|
@@ -878,6 +878,7 @@ class StageExecutor {
|
|
|
878
878
|
}, timeout * 1000);
|
|
879
879
|
|
|
880
880
|
let stdoutBuffer = '';
|
|
881
|
+
let agentText = ''; // собираем текстовый вывод агента для лога
|
|
881
882
|
child.stdout.on('data', (data) => {
|
|
882
883
|
const chunk = data.toString();
|
|
883
884
|
stdout += chunk;
|
|
@@ -892,12 +893,14 @@ class StageExecutor {
|
|
|
892
893
|
// Claude: content_block_delta с delta.text
|
|
893
894
|
if (obj.type === 'content_block_delta' && obj.delta?.text) {
|
|
894
895
|
process.stdout.write(obj.delta.text);
|
|
896
|
+
agentText += obj.delta.text;
|
|
895
897
|
}
|
|
896
898
|
// Qwen/Claude: assistant message с content text
|
|
897
899
|
else if (obj.type === 'assistant' && obj.message?.content) {
|
|
898
900
|
for (const block of obj.message.content) {
|
|
899
901
|
if (block.type === 'text' && block.text) {
|
|
900
902
|
process.stdout.write(block.text);
|
|
903
|
+
agentText += block.text;
|
|
901
904
|
}
|
|
902
905
|
}
|
|
903
906
|
}
|
|
@@ -905,6 +908,7 @@ class StageExecutor {
|
|
|
905
908
|
} catch {
|
|
906
909
|
// не JSON — выводим как есть
|
|
907
910
|
process.stdout.write(line + '\n');
|
|
911
|
+
agentText += line + '\n';
|
|
908
912
|
}
|
|
909
913
|
}
|
|
910
914
|
});
|
|
@@ -934,6 +938,16 @@ class StageExecutor {
|
|
|
934
938
|
// Логгируем CLI вызов
|
|
935
939
|
if (this.logger) {
|
|
936
940
|
this.logger.cliCall(agent.command, args, code);
|
|
941
|
+
|
|
942
|
+
// Логгируем текстовый вывод агента
|
|
943
|
+
const trimmedOutput = agentText.trim();
|
|
944
|
+
if (trimmedOutput) {
|
|
945
|
+
this.logger.info(`OUTPUT ↓`, stageId);
|
|
946
|
+
for (const line of trimmedOutput.split('\n')) {
|
|
947
|
+
this.logger.info(` ${line}`, stageId);
|
|
948
|
+
}
|
|
949
|
+
this.logger.info(`OUTPUT ↑`, stageId);
|
|
950
|
+
}
|
|
937
951
|
}
|
|
938
952
|
|
|
939
953
|
// Парсим результат из вывода агента через ResultParser
|