digitalsee-ai-flow-cli 0.9.10 → 0.9.15-beta
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/dist/api/flow-log.js +0 -6
- package/dist/commands/flow/log.js +16 -34
- package/package.json +1 -1
package/dist/api/flow-log.js
CHANGED
|
@@ -4,7 +4,6 @@ exports.getFlowLogList = getFlowLogList;
|
|
|
4
4
|
exports.getFlowLogBase = getFlowLogBase;
|
|
5
5
|
exports.getFlowLogLoopDetail = getFlowLogLoopDetail;
|
|
6
6
|
exports.getFlowLogConditionDetail = getFlowLogConditionDetail;
|
|
7
|
-
exports.getFlowLogSwitchDetail = getFlowLogSwitchDetail;
|
|
8
7
|
exports.getFlowLogNodeDetail = getFlowLogNodeDetail;
|
|
9
8
|
const client_1 = require("@/api/client");
|
|
10
9
|
function getFlowLogList(params) {
|
|
@@ -21,11 +20,6 @@ function getFlowLogConditionDetail(logId, baseId, contentId) {
|
|
|
21
20
|
contentId,
|
|
22
21
|
});
|
|
23
22
|
}
|
|
24
|
-
function getFlowLogSwitchDetail(logId, baseId, contentId) {
|
|
25
|
-
return (0, client_1.apiGet)(`/acm/flow/logBase/switch/${logId}/${baseId}`, {
|
|
26
|
-
contentId,
|
|
27
|
-
});
|
|
28
|
-
}
|
|
29
23
|
function getFlowLogNodeDetail(logId, baseId, contentId) {
|
|
30
24
|
return (0, client_1.apiGet)(`/acm/flow/logBase/ordinary/${logId}/${baseId}`, {
|
|
31
25
|
contentId,
|
|
@@ -190,14 +190,24 @@ function registerFlowLogShow(logCmd) {
|
|
|
190
190
|
});
|
|
191
191
|
return;
|
|
192
192
|
}
|
|
193
|
-
// Condition node — show
|
|
194
|
-
if (nodeType.includes('condition')
|
|
193
|
+
// Condition / Switch / Agent node — same detail endpoint, show input/output and children
|
|
194
|
+
if (nodeType.includes('condition') ||
|
|
195
|
+
nodeType.includes('switch') ||
|
|
196
|
+
nodeType.includes('agent')) {
|
|
197
|
+
const typeLabel = nodeType.includes('switch')
|
|
198
|
+
? '分支'
|
|
199
|
+
: nodeType.includes('agent')
|
|
200
|
+
? 'Agent'
|
|
201
|
+
: '条件';
|
|
195
202
|
if (!options.json) {
|
|
196
|
-
(0, output_1.printInfo)(
|
|
203
|
+
(0, output_1.printInfo)(`正在获取${typeLabel}节点详情: ${logId} -> ${options.child}`);
|
|
197
204
|
}
|
|
198
205
|
const result = (await (0, flow_log_1.getFlowLogConditionDetail)(logId, options.child, contentId));
|
|
199
|
-
const logContent = (result
|
|
200
|
-
|
|
206
|
+
const logContent = (result?.app_flow_log_content_vo ?? {
|
|
207
|
+
input: '',
|
|
208
|
+
output: '',
|
|
209
|
+
});
|
|
210
|
+
const children = (result?.app_flow_log_base_vos ?? []);
|
|
201
211
|
if (options.json) {
|
|
202
212
|
(0, output_1.printStructuredResult)({
|
|
203
213
|
ok: true,
|
|
@@ -214,7 +224,7 @@ function registerFlowLogShow(logCmd) {
|
|
|
214
224
|
(0, output_1.printHeader)('Output');
|
|
215
225
|
(0, output_1.printJson)((0, mask_1.maskJson)((0, common_1.safeParseJSON)(logContent.output, logContent.output)));
|
|
216
226
|
if (children.length > 0) {
|
|
217
|
-
(0, output_1.printSubHeader)(
|
|
227
|
+
(0, output_1.printSubHeader)(`${typeLabel}子节点 (共 ${children.length} 个)`);
|
|
218
228
|
const childRows = children.map((child) => [
|
|
219
229
|
String(child.base_id ?? ''),
|
|
220
230
|
String(child.node_name ?? child.name ?? '-'),
|
|
@@ -228,34 +238,6 @@ function registerFlowLogShow(logCmd) {
|
|
|
228
238
|
}
|
|
229
239
|
return;
|
|
230
240
|
}
|
|
231
|
-
// Switch node — show branch children
|
|
232
|
-
if (nodeType.includes('switch')) {
|
|
233
|
-
if (!options.json) {
|
|
234
|
-
(0, output_1.printInfo)(`正在获取分支节点详情: ${options.child}`);
|
|
235
|
-
}
|
|
236
|
-
const result = (await (0, flow_log_1.getFlowLogSwitchDetail)(logId, options.child, contentId));
|
|
237
|
-
const children = (result.app_flow_log_base_vos ?? []);
|
|
238
|
-
if (options.json) {
|
|
239
|
-
(0, output_1.printStructuredResult)({
|
|
240
|
-
ok: true,
|
|
241
|
-
data: (0, mask_1.maskJson)({ children }, { maskPatterns: false }),
|
|
242
|
-
});
|
|
243
|
-
return;
|
|
244
|
-
}
|
|
245
|
-
if (children.length > 0) {
|
|
246
|
-
(0, output_1.printSubHeader)(`分支子节点 (共 ${children.length} 个)`);
|
|
247
|
-
const childRows = children.map((child) => [
|
|
248
|
-
String(child.node_name ?? child.name ?? '-'),
|
|
249
|
-
String(child.node_type ?? '-'),
|
|
250
|
-
(0, helpers_2.formatFlowRunStatus)(child.status),
|
|
251
|
-
]);
|
|
252
|
-
(0, output_1.printTable)(['节点名称', '节点类型', '状态'], childRows, { wrapCols: [0] });
|
|
253
|
-
}
|
|
254
|
-
else {
|
|
255
|
-
(0, output_1.printInfo)('暂无子节点');
|
|
256
|
-
}
|
|
257
|
-
return;
|
|
258
|
-
}
|
|
259
241
|
// Default: ordinary node detail
|
|
260
242
|
if (!options.json) {
|
|
261
243
|
(0, output_1.printInfo)(`正在获取节点详情: ${options.child}`);
|