feat: remove capability execution status markers
This commit is contained in:
1 parent
e956ec9055
commit
d22468e29f
16 files changed
+25
-73
No files matched your search
+3
-15
@@ -2,21 +2,10 @@ import { app } from "electron";
|
||||
import fs from "node:fs";
|
||||
import path from "node:path";
|
||||
import type { Catalog, CatalogComponent } from "../shared/types";
|
||||
import { hasCapability } from "./engine/registry";
|
||||
|
||||
let cached: Catalog | null = null;
|
||||
let excludedIds: Set<string> | null = null;
|
||||
|
||||
const RUNTIME_CONTAINERS = new Set([
|
||||
"logic_control_if_else",
|
||||
"logic_control_count_for",
|
||||
"logic_control_array_for_v3",
|
||||
"logic_control_dictionary_for_v1",
|
||||
"logic_control_while",
|
||||
"infinite_loop",
|
||||
"logic_control_try_catch"
|
||||
]);
|
||||
|
||||
function resolveCatalogPath(): string {
|
||||
const candidates = [
|
||||
process.env.RPA_CATALOG_PATH,
|
||||
@@ -64,10 +53,9 @@ export function loadCatalog(): Catalog {
|
||||
const raw = fs.readFileSync(catalogPath(), "utf8");
|
||||
const catalog = JSON.parse(raw) as Catalog;
|
||||
const excluded = loadExcludedIds();
|
||||
catalog.components = catalog.components.filter((component) => !excluded.has(component.id)).map((component: CatalogComponent) => ({
|
||||
...component,
|
||||
implemented: RUNTIME_CONTAINERS.has(component.id) || hasCapability(component.id) || hasCapability(component.functionName)
|
||||
}));
|
||||
catalog.components = catalog.components
|
||||
.filter((component) => !excluded.has(component.id))
|
||||
.map((component: CatalogComponent) => component);
|
||||
catalog.counts.total = catalog.components.length;
|
||||
catalog.counts.vendor = catalog.components.filter((component) => component.kind === "vendor").length;
|
||||
catalog.counts.native = catalog.components.filter((component) => component.kind === "native").length;
|
||||
|
||||
@@ -8,8 +8,8 @@ function component(id: string): CatalogComponent {
|
||||
const value = {
|
||||
id, name: id, kind: "vendor", group: "data", categories: [], categorySignature: "", description: "",
|
||||
messageTemplate: "", baseType: id, functionName: id, functionCalls: [], version: "", tags: [], platformTag: null,
|
||||
icon: "data", risk: "low", fields: [], output: { label: "", key: "", suggestedName: "", valueTypes: [], fields: [] }, slots: [], implemented: true
|
||||
} as CatalogComponent;
|
||||
icon: "data", risk: "low", fields: [], output: { label: "", key: "", suggestedName: "", valueTypes: [], fields: [] }, slots: []
|
||||
} as unknown as CatalogComponent;
|
||||
components.set(id, value);
|
||||
return value;
|
||||
}
|
||||
|
||||
@@ -83,7 +83,6 @@ function testComponent(id: string): CatalogComponent {
|
||||
fields: [],
|
||||
output: { label: "", key: "", suggestedName: "", valueTypes: [], fields: [] },
|
||||
slots: [],
|
||||
implemented: true
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -265,7 +265,7 @@ async function executeNode(node: FlowNode, ctx: RunContext, states: Map<string,
|
||||
{
|
||||
nodeId: node.id,
|
||||
componentId: node.componentId,
|
||||
recommendation: "换用已接入组件;该能力已列入后续接入清单"
|
||||
recommendation: "请检查组件配置或重新添加节点"
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user