@mesantosrai/pipeline-canvas 1.0.0
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/LICENSE +21 -0
- package/README.md +545 -0
- package/dist/_virtual/dynamic-import-helper.mjs +17 -0
- package/dist/_virtual/dynamic-import-helper.mjs.map +1 -0
- package/dist/components/CustomHandle.d.ts +9 -0
- package/dist/components/CustomHandle.d.ts.map +1 -0
- package/dist/components/CustomHandle.mjs +18 -0
- package/dist/components/CustomHandle.mjs.map +1 -0
- package/dist/components/ExecutionLogsPanel.d.ts +3 -0
- package/dist/components/ExecutionLogsPanel.d.ts.map +1 -0
- package/dist/components/ExecutionLogsPanel.mjs +189 -0
- package/dist/components/ExecutionLogsPanel.mjs.map +1 -0
- package/dist/components/NodeContextMenu.d.ts +15 -0
- package/dist/components/NodeContextMenu.d.ts.map +1 -0
- package/dist/components/NodeContextMenu.mjs +110 -0
- package/dist/components/NodeContextMenu.mjs.map +1 -0
- package/dist/components/PipelineCanvas.d.ts +4 -0
- package/dist/components/PipelineCanvas.d.ts.map +1 -0
- package/dist/components/PipelineCanvas.mjs +1016 -0
- package/dist/components/PipelineCanvas.mjs.map +1 -0
- package/dist/components/PipelineCanvasProvider.d.ts +30 -0
- package/dist/components/PipelineCanvasProvider.d.ts.map +1 -0
- package/dist/components/PipelineCanvasProvider.mjs +7 -0
- package/dist/components/PipelineCanvasProvider.mjs.map +1 -0
- package/dist/components/PipelineExecution.d.ts +16 -0
- package/dist/components/PipelineExecution.d.ts.map +1 -0
- package/dist/components/PipelineExecution.mjs +310 -0
- package/dist/components/PipelineExecution.mjs.map +1 -0
- package/dist/components/PipelineManager.d.ts +8 -0
- package/dist/components/PipelineManager.d.ts.map +1 -0
- package/dist/components/PipelineManager.mjs +143 -0
- package/dist/components/PipelineManager.mjs.map +1 -0
- package/dist/components/PipelineNodeConfig.d.ts +11 -0
- package/dist/components/PipelineNodeConfig.d.ts.map +1 -0
- package/dist/components/PipelineNodeConfig.mjs +1808 -0
- package/dist/components/PipelineNodeConfig.mjs.map +1 -0
- package/dist/components/PipelineNodePalette.d.ts +3 -0
- package/dist/components/PipelineNodePalette.d.ts.map +1 -0
- package/dist/components/PipelineNodePalette.mjs +87 -0
- package/dist/components/PipelineNodePalette.mjs.map +1 -0
- package/dist/components/SavePipelineDialog.d.ts +9 -0
- package/dist/components/SavePipelineDialog.d.ts.map +1 -0
- package/dist/components/SavePipelineDialog.mjs +140 -0
- package/dist/components/SavePipelineDialog.mjs.map +1 -0
- package/dist/components/SavedPipelinesList.d.ts +3 -0
- package/dist/components/SavedPipelinesList.d.ts.map +1 -0
- package/dist/components/SavedPipelinesList.mjs +172 -0
- package/dist/components/SavedPipelinesList.mjs.map +1 -0
- package/dist/components/index.d.ts +8 -0
- package/dist/components/index.d.ts.map +1 -0
- package/dist/components/ui/alert.d.ts +9 -0
- package/dist/components/ui/alert.d.ts.map +1 -0
- package/dist/components/ui/alert.mjs +51 -0
- package/dist/components/ui/alert.mjs.map +1 -0
- package/dist/components/ui/button.d.ts +12 -0
- package/dist/components/ui/button.d.ts.map +1 -0
- package/dist/components/ui/button.mjs +45 -0
- package/dist/components/ui/button.mjs.map +1 -0
- package/dist/components/ui/dialog.d.ts +20 -0
- package/dist/components/ui/dialog.d.ts.map +1 -0
- package/dist/components/ui/dialog.mjs +99 -0
- package/dist/components/ui/dialog.mjs.map +1 -0
- package/dist/components/ui/index.d.ts +8 -0
- package/dist/components/ui/index.d.ts.map +1 -0
- package/dist/components/ui/input.d.ts +6 -0
- package/dist/components/ui/input.d.ts.map +1 -0
- package/dist/components/ui/input.mjs +22 -0
- package/dist/components/ui/input.mjs.map +1 -0
- package/dist/components/ui/label.d.ts +6 -0
- package/dist/components/ui/label.d.ts.map +1 -0
- package/dist/components/ui/label.mjs +20 -0
- package/dist/components/ui/label.mjs.map +1 -0
- package/dist/components/ui/select.d.ts +14 -0
- package/dist/components/ui/select.d.ts.map +1 -0
- package/dist/components/ui/select.mjs +121 -0
- package/dist/components/ui/select.mjs.map +1 -0
- package/dist/components/ui/tooltip.d.ts +8 -0
- package/dist/components/ui/tooltip.d.ts.map +1 -0
- package/dist/components/ui/tooltip.mjs +24 -0
- package/dist/components/ui/tooltip.mjs.map +1 -0
- package/dist/context/PipelineContext.d.ts +50 -0
- package/dist/context/PipelineContext.d.ts.map +1 -0
- package/dist/context/PipelineContext.mjs +36 -0
- package/dist/context/PipelineContext.mjs.map +1 -0
- package/dist/index.d.ts +12 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.mjs +45 -0
- package/dist/index.mjs.map +1 -0
- package/dist/lib/utils.d.ts +3 -0
- package/dist/lib/utils.d.ts.map +1 -0
- package/dist/lib/utils.mjs +9 -0
- package/dist/lib/utils.mjs.map +1 -0
- package/dist/node_modules/zustand/esm/middleware.mjs +256 -0
- package/dist/node_modules/zustand/esm/middleware.mjs.map +1 -0
- package/dist/nodes/alphafold_node/node.json.mjs +82 -0
- package/dist/nodes/alphafold_node/node.json.mjs.map +1 -0
- package/dist/nodes/http_request_node/node.json.mjs +383 -0
- package/dist/nodes/http_request_node/node.json.mjs.map +1 -0
- package/dist/nodes/input_node/node.json.mjs +51 -0
- package/dist/nodes/input_node/node.json.mjs.map +1 -0
- package/dist/nodes/message_input_node/node.json.mjs +90 -0
- package/dist/nodes/message_input_node/node.json.mjs.map +1 -0
- package/dist/nodes/proteinmpnn_node/node.json.mjs +83 -0
- package/dist/nodes/proteinmpnn_node/node.json.mjs.map +1 -0
- package/dist/nodes/rfdiffusion_node/node.json.mjs +281 -0
- package/dist/nodes/rfdiffusion_node/node.json.mjs.map +1 -0
- package/dist/store/pipelineStore.d.ts +108 -0
- package/dist/store/pipelineStore.d.ts.map +1 -0
- package/dist/store/pipelineStore.mjs +633 -0
- package/dist/store/pipelineStore.mjs.map +1 -0
- package/dist/style.css +1 -0
- package/dist/types/dependencies.d.ts +93 -0
- package/dist/types/dependencies.d.ts.map +1 -0
- package/dist/types/index.d.ts +56 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/logger.d.ts +67 -0
- package/dist/types/logger.d.ts.map +1 -0
- package/dist/types/logger.mjs +22 -0
- package/dist/types/logger.mjs.map +1 -0
- package/dist/utils/executionEngine.d.ts +27 -0
- package/dist/utils/executionEngine.d.ts.map +1 -0
- package/dist/utils/executionEngine.mjs +461 -0
- package/dist/utils/executionEngine.mjs.map +1 -0
- package/dist/utils/index.d.ts +6 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/logger.d.ts +23 -0
- package/dist/utils/logger.d.ts.map +1 -0
- package/dist/utils/logger.mjs +29 -0
- package/dist/utils/logger.mjs.map +1 -0
- package/dist/utils/nodeLoader.d.ts +76 -0
- package/dist/utils/nodeLoader.d.ts.map +1 -0
- package/dist/utils/nodeLoader.mjs +48 -0
- package/dist/utils/nodeLoader.mjs.map +1 -0
- package/dist/utils/templateResolver.d.ts +10 -0
- package/dist/utils/templateResolver.d.ts.map +1 -0
- package/dist/utils/templateResolver.mjs +64 -0
- package/dist/utils/templateResolver.mjs.map +1 -0
- package/dist/utils/topologicalSort.d.ts +10 -0
- package/dist/utils/topologicalSort.d.ts.map +1 -0
- package/dist/utils/topologicalSort.mjs +25 -0
- package/dist/utils/topologicalSort.mjs.map +1 -0
- package/nodes/alphafold_node/node.json +77 -0
- package/nodes/http_request_node/node.json +311 -0
- package/nodes/input_node/node.json +47 -0
- package/nodes/message_input_node/node.json +56 -0
- package/nodes/proteinmpnn_node/node.json +78 -0
- package/nodes/rfdiffusion_node/node.json +231 -0
- package/package.json +94 -0
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Logging utilities for pipeline canvas library
|
|
3
|
+
* Provides helper functions to use logger from context with fallback
|
|
4
|
+
*/
|
|
5
|
+
import { Logger, ErrorReporter } from '../types/logger';
|
|
6
|
+
/**
|
|
7
|
+
* Get logger from context or use default
|
|
8
|
+
* Creates default logger on first use
|
|
9
|
+
*/
|
|
10
|
+
export declare const getLogger: (logger?: Logger) => Logger;
|
|
11
|
+
/**
|
|
12
|
+
* Get error reporter from context
|
|
13
|
+
*/
|
|
14
|
+
export declare const getErrorReporter: (errorReporter?: ErrorReporter) => ErrorReporter | undefined;
|
|
15
|
+
/**
|
|
16
|
+
* Log error with error reporter if available
|
|
17
|
+
*/
|
|
18
|
+
export declare const logError: (message: string, error: Error, context?: Record<string, any>, logger?: Logger, errorReporter?: ErrorReporter) => void;
|
|
19
|
+
/**
|
|
20
|
+
* Log message with error reporter if available
|
|
21
|
+
*/
|
|
22
|
+
export declare const logMessage: (message: string, level?: "info" | "warning" | "error", context?: Record<string, any>, logger?: Logger, errorReporter?: ErrorReporter) => void;
|
|
23
|
+
//# sourceMappingURL=logger.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../utils/logger.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,EAAE,aAAa,EAAuB,MAAM,iBAAiB,CAAC;AAI7E;;;GAGG;AACH,eAAO,MAAM,SAAS,GAAI,SAAS,MAAM,KAAG,MAU3C,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,gBAAgB,GAAI,gBAAgB,aAAa,KAAG,aAAa,GAAG,SAEhF,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,QAAQ,GACnB,SAAS,MAAM,EACf,OAAO,KAAK,EACZ,UAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAM,EACjC,SAAS,MAAM,EACf,gBAAgB,aAAa,SAW9B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,UAAU,GACrB,SAAS,MAAM,EACf,QAAO,MAAM,GAAG,SAAS,GAAG,OAAgB,EAC5C,UAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAM,EACjC,SAAS,MAAM,EACf,gBAAgB,aAAa,SAmB9B,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { createDefaultLogger as g } from "../types/logger.mjs";
|
|
2
|
+
let n = null;
|
|
3
|
+
const c = (r) => r || (n || (n = g()), n), u = (r) => r, s = (r, o, e = {}, t, f) => {
|
|
4
|
+
c(t).error(r, o, e), f && f.captureException(o, {
|
|
5
|
+
message: r,
|
|
6
|
+
...e
|
|
7
|
+
});
|
|
8
|
+
}, L = (r, o = "info", e = {}, t, f) => {
|
|
9
|
+
const i = c(t);
|
|
10
|
+
switch (o) {
|
|
11
|
+
case "info":
|
|
12
|
+
i.info(r, e);
|
|
13
|
+
break;
|
|
14
|
+
case "warning":
|
|
15
|
+
i.warn(r, e);
|
|
16
|
+
break;
|
|
17
|
+
case "error":
|
|
18
|
+
i.error(r, void 0, e);
|
|
19
|
+
break;
|
|
20
|
+
}
|
|
21
|
+
f && o !== "info" && f.captureMessage(r, o, e);
|
|
22
|
+
};
|
|
23
|
+
export {
|
|
24
|
+
u as getErrorReporter,
|
|
25
|
+
c as getLogger,
|
|
26
|
+
s as logError,
|
|
27
|
+
L as logMessage
|
|
28
|
+
};
|
|
29
|
+
//# sourceMappingURL=logger.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logger.mjs","sources":["../../utils/logger.ts"],"sourcesContent":["/**\n * Logging utilities for pipeline canvas library\n * Provides helper functions to use logger from context with fallback\n */\n\nimport { Logger, ErrorReporter, createDefaultLogger } from '../types/logger';\n\nlet defaultLogger: Logger | null = null;\n\n/**\n * Get logger from context or use default\n * Creates default logger on first use\n */\nexport const getLogger = (logger?: Logger): Logger => {\n if (logger) {\n return logger;\n }\n \n if (!defaultLogger) {\n defaultLogger = createDefaultLogger();\n }\n \n return defaultLogger;\n};\n\n/**\n * Get error reporter from context\n */\nexport const getErrorReporter = (errorReporter?: ErrorReporter): ErrorReporter | undefined => {\n return errorReporter;\n};\n\n/**\n * Log error with error reporter if available\n */\nexport const logError = (\n message: string,\n error: Error,\n context: Record<string, any> = {},\n logger?: Logger,\n errorReporter?: ErrorReporter\n) => {\n const effectiveLogger = getLogger(logger);\n effectiveLogger.error(message, error, context);\n \n if (errorReporter) {\n errorReporter.captureException(error, {\n message,\n ...context,\n });\n }\n};\n\n/**\n * Log message with error reporter if available\n */\nexport const logMessage = (\n message: string,\n level: 'info' | 'warning' | 'error' = 'info',\n context: Record<string, any> = {},\n logger?: Logger,\n errorReporter?: ErrorReporter\n) => {\n const effectiveLogger = getLogger(logger);\n \n switch (level) {\n case 'info':\n effectiveLogger.info(message, context);\n break;\n case 'warning':\n effectiveLogger.warn(message, context);\n break;\n case 'error':\n effectiveLogger.error(message, undefined, context);\n break;\n }\n \n if (errorReporter && level !== 'info') {\n errorReporter.captureMessage(message, level, context);\n }\n};\n"],"names":["defaultLogger","getLogger","logger","createDefaultLogger","getErrorReporter","errorReporter","logError","message","error","context","logMessage","level","effectiveLogger"],"mappings":";AAOA,IAAIA,IAA+B;AAM5B,MAAMC,IAAY,CAACC,MACpBA,MAICF,MACHA,IAAgBG,EAAA,IAGXH,IAMII,IAAmB,CAACC,MACxBA,GAMIC,IAAW,CACtBC,GACAC,GACAC,IAA+B,CAAA,GAC/BP,GACAG,MACG;AAEH,EADwBJ,EAAUC,CAAM,EACxB,MAAMK,GAASC,GAAOC,CAAO,GAEzCJ,KACFA,EAAc,iBAAiBG,GAAO;AAAA,IACpC,SAAAD;AAAA,IACA,GAAGE;AAAA,EAAA,CACJ;AAEL,GAKaC,IAAa,CACxBH,GACAI,IAAsC,QACtCF,IAA+B,CAAA,GAC/BP,GACAG,MACG;AACH,QAAMO,IAAkBX,EAAUC,CAAM;AAExC,UAAQS,GAAA;AAAA,IACN,KAAK;AACH,MAAAC,EAAgB,KAAKL,GAASE,CAAO;AACrC;AAAA,IACF,KAAK;AACH,MAAAG,EAAgB,KAAKL,GAASE,CAAO;AACrC;AAAA,IACF,KAAK;AACH,MAAAG,EAAgB,MAAML,GAAS,QAAWE,CAAO;AACjD;AAAA,EAAA;AAGJ,EAAIJ,KAAiBM,MAAU,UAC7BN,EAAc,eAAeE,GAASI,GAAOF,CAAO;AAExD;"}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { NodeType } from '../types/index';
|
|
2
|
+
export interface NodeMetadata {
|
|
3
|
+
type: NodeType;
|
|
4
|
+
label: string;
|
|
5
|
+
icon: string;
|
|
6
|
+
color: string;
|
|
7
|
+
borderColor: string;
|
|
8
|
+
bgColor: string;
|
|
9
|
+
description: string;
|
|
10
|
+
}
|
|
11
|
+
export interface FieldSchema {
|
|
12
|
+
type: 'string' | 'number' | 'boolean' | 'select' | 'json' | 'textarea';
|
|
13
|
+
required?: boolean;
|
|
14
|
+
default?: any;
|
|
15
|
+
placeholder?: string;
|
|
16
|
+
label: string;
|
|
17
|
+
helpText?: string;
|
|
18
|
+
min?: number;
|
|
19
|
+
max?: number;
|
|
20
|
+
step?: number;
|
|
21
|
+
options?: Array<{
|
|
22
|
+
value: string;
|
|
23
|
+
label: string;
|
|
24
|
+
}>;
|
|
25
|
+
validation?: {
|
|
26
|
+
pattern?: string;
|
|
27
|
+
message?: string;
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
export interface NodeSchema {
|
|
31
|
+
[key: string]: FieldSchema;
|
|
32
|
+
}
|
|
33
|
+
export interface HandleDefinition {
|
|
34
|
+
id: string;
|
|
35
|
+
type: 'source' | 'target';
|
|
36
|
+
position: 'left' | 'right';
|
|
37
|
+
dataType?: string;
|
|
38
|
+
}
|
|
39
|
+
export interface ExecutionConfig {
|
|
40
|
+
type: string;
|
|
41
|
+
endpoint?: string | null;
|
|
42
|
+
method?: string;
|
|
43
|
+
queryParams?: string | Record<string, any>;
|
|
44
|
+
headers?: Record<string, any>;
|
|
45
|
+
payload?: Record<string, any>;
|
|
46
|
+
message?: string;
|
|
47
|
+
code?: string;
|
|
48
|
+
[key: string]: any;
|
|
49
|
+
}
|
|
50
|
+
export interface NodeDefinition {
|
|
51
|
+
metadata: NodeMetadata;
|
|
52
|
+
schema: NodeSchema;
|
|
53
|
+
handles: {
|
|
54
|
+
inputs: HandleDefinition[];
|
|
55
|
+
outputs: HandleDefinition[];
|
|
56
|
+
};
|
|
57
|
+
execution: ExecutionConfig;
|
|
58
|
+
defaultConfig: Record<string, any>;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Loads a node configuration from its JSON file
|
|
62
|
+
*/
|
|
63
|
+
export declare function loadNodeConfig(nodeType: NodeType): Promise<NodeDefinition>;
|
|
64
|
+
/**
|
|
65
|
+
* Loads all node configurations
|
|
66
|
+
*/
|
|
67
|
+
export declare function loadAllNodeConfigs(): Promise<Map<NodeType, NodeDefinition>>;
|
|
68
|
+
/**
|
|
69
|
+
* Gets node metadata for a node type
|
|
70
|
+
*/
|
|
71
|
+
export declare function getNodeMetadata(nodeType: NodeType): Promise<NodeMetadata>;
|
|
72
|
+
/**
|
|
73
|
+
* Gets the default configuration for a node type
|
|
74
|
+
*/
|
|
75
|
+
export declare function getDefaultNodeConfig(nodeType: NodeType): Promise<Record<string, any>>;
|
|
76
|
+
//# sourceMappingURL=nodeLoader.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nodeLoader.d.ts","sourceRoot":"","sources":["../../utils/nodeLoader.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAE1C,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,QAAQ,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,QAAQ,GAAG,QAAQ,GAAG,SAAS,GAAG,QAAQ,GAAG,MAAM,GAAG,UAAU,CAAC;IACvE,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OA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B,QAAQ,EAAE,YAAY,CAAC;IACvB,MAAM,EAAE,UAAU,CAAC;IACnB,OAAO,EAAE;QACP,MAAM,EAAE,gBAAgB,EAAE,CAAC;QAC3B,OAAO,EAAE,gBAAgB,EAAE,CAAC;KAC7B,CAAC;IACF,SAAS,EAAE,eAAe,CAAC;IAC3B,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CACpC;AAKD;;GAEG;AACH,wBAAsB,cAAc,CAAC,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAAC,cAAc,CAAC,CAqBhF;AA+BD;;GAEG;AACH,wBAAsB,kBAAkB,IAAI,OAAO,CAAC,GAAG,CAAC,QAAQ,EAAE,cAAc,CAAC,CAAC,CAWjF;AAED;;GAEG;AACH,wBAAsB,eAAe,CAAC,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAAC,YAAY,CAAC,CAG/E;AAED;;GAEG;AACH,wBAAsB,oBAAoB,CAAC,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,CAG3F"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import a from "../_virtual/dynamic-import-helper.mjs";
|
|
2
|
+
const t = /* @__PURE__ */ new Map();
|
|
3
|
+
async function e(o) {
|
|
4
|
+
if (t.has(o))
|
|
5
|
+
return t.get(o);
|
|
6
|
+
try {
|
|
7
|
+
const n = await a(/* @__PURE__ */ Object.assign({ "../nodes/alphafold_node/node.json": () => import("../nodes/alphafold_node/node.json.mjs"), "../nodes/http_request_node/node.json": () => import("../nodes/http_request_node/node.json.mjs"), "../nodes/input_node/node.json": () => import("../nodes/input_node/node.json.mjs"), "../nodes/message_input_node/node.json": () => import("../nodes/message_input_node/node.json.mjs"), "../nodes/proteinmpnn_node/node.json": () => import("../nodes/proteinmpnn_node/node.json.mjs"), "../nodes/rfdiffusion_node/node.json": () => import("../nodes/rfdiffusion_node/node.json.mjs") }), `../nodes/${o}/node.json`, 4), i = n.default || n;
|
|
8
|
+
return s(i, o), t.set(o, i), i;
|
|
9
|
+
} catch (n) {
|
|
10
|
+
throw new Error(`Failed to load node config for ${o}: ${n}`);
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
function s(o, n) {
|
|
14
|
+
if (!o.metadata)
|
|
15
|
+
throw new Error(`Node config for ${n} is missing metadata`);
|
|
16
|
+
if (o.metadata.type !== n)
|
|
17
|
+
throw new Error(`Node config type mismatch: expected ${n}, got ${o.metadata.type}`);
|
|
18
|
+
if (!o.schema)
|
|
19
|
+
throw new Error(`Node config for ${n} is missing schema`);
|
|
20
|
+
if (!o.handles)
|
|
21
|
+
throw new Error(`Node config for ${n} is missing handles`);
|
|
22
|
+
if (!o.execution)
|
|
23
|
+
throw new Error(`Node config for ${n} is missing execution config`);
|
|
24
|
+
if (!o.defaultConfig)
|
|
25
|
+
throw new Error(`Node config for ${n} is missing defaultConfig`);
|
|
26
|
+
}
|
|
27
|
+
async function f() {
|
|
28
|
+
const o = ["input_node", "rfdiffusion_node", "proteinmpnn_node", "alphafold_node", "message_input_node"], n = await Promise.all(
|
|
29
|
+
o.map(async (i) => {
|
|
30
|
+
const r = await e(i);
|
|
31
|
+
return [i, r];
|
|
32
|
+
})
|
|
33
|
+
);
|
|
34
|
+
return new Map(n);
|
|
35
|
+
}
|
|
36
|
+
async function c(o) {
|
|
37
|
+
return (await e(o)).metadata;
|
|
38
|
+
}
|
|
39
|
+
async function m(o) {
|
|
40
|
+
return { ...(await e(o)).defaultConfig };
|
|
41
|
+
}
|
|
42
|
+
export {
|
|
43
|
+
m as getDefaultNodeConfig,
|
|
44
|
+
c as getNodeMetadata,
|
|
45
|
+
f as loadAllNodeConfigs,
|
|
46
|
+
e as loadNodeConfig
|
|
47
|
+
};
|
|
48
|
+
//# sourceMappingURL=nodeLoader.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nodeLoader.mjs","sources":["../../utils/nodeLoader.ts"],"sourcesContent":["import { NodeType } from '../types/index';\n\nexport interface NodeMetadata {\n type: NodeType;\n label: string;\n icon: string;\n color: string;\n borderColor: string;\n bgColor: string;\n description: string;\n}\n\nexport interface FieldSchema {\n type: 'string' | 'number' | 'boolean' | 'select' | 'json' | 'textarea';\n required?: boolean;\n default?: any;\n placeholder?: string;\n label: string;\n helpText?: string;\n min?: number;\n max?: number;\n step?: number;\n options?: Array<{ value: string; label: string }>; // For select type\n validation?: {\n pattern?: string;\n message?: string;\n };\n}\n\nexport interface NodeSchema {\n [key: string]: FieldSchema;\n}\n\nexport interface HandleDefinition {\n id: string;\n type: 'source' | 'target';\n position: 'left' | 'right';\n dataType?: string;\n}\n\nexport interface ExecutionConfig {\n type: string;\n endpoint?: string | null;\n method?: string;\n queryParams?: string | Record<string, any>;\n headers?: Record<string, any>;\n payload?: Record<string, any>;\n message?: string; // For log execution type\n code?: string; // For code execution type\n [key: string]: any; // Allow additional properties\n}\n\nexport interface NodeDefinition {\n metadata: NodeMetadata;\n schema: NodeSchema;\n handles: {\n inputs: HandleDefinition[];\n outputs: HandleDefinition[];\n };\n execution: ExecutionConfig;\n defaultConfig: Record<string, any>;\n}\n\n// Cache for loaded node configs\nconst nodeConfigCache: Map<NodeType, NodeDefinition> = new Map();\n\n/**\n * Loads a node configuration from its JSON file\n */\nexport async function loadNodeConfig(nodeType: NodeType): Promise<NodeDefinition> {\n // Check cache first\n if (nodeConfigCache.has(nodeType)) {\n return nodeConfigCache.get(nodeType)!;\n }\n\n try {\n // Dynamically import the JSON file\n const config = await import(`../nodes/${nodeType}/node.json`);\n const nodeConfig: NodeDefinition = config.default || config;\n \n // Validate the config\n validateNodeConfig(nodeConfig, nodeType);\n \n // Cache it\n nodeConfigCache.set(nodeType, nodeConfig);\n \n return nodeConfig;\n } catch (error) {\n throw new Error(`Failed to load node config for ${nodeType}: ${error}`);\n }\n}\n\n/**\n * Validates a node configuration\n */\nfunction validateNodeConfig(config: any, expectedType: NodeType): void {\n if (!config.metadata) {\n throw new Error(`Node config for ${expectedType} is missing metadata`);\n }\n \n if (config.metadata.type !== expectedType) {\n throw new Error(`Node config type mismatch: expected ${expectedType}, got ${config.metadata.type}`);\n }\n \n if (!config.schema) {\n throw new Error(`Node config for ${expectedType} is missing schema`);\n }\n \n if (!config.handles) {\n throw new Error(`Node config for ${expectedType} is missing handles`);\n }\n \n if (!config.execution) {\n throw new Error(`Node config for ${expectedType} is missing execution config`);\n }\n \n if (!config.defaultConfig) {\n throw new Error(`Node config for ${expectedType} is missing defaultConfig`);\n }\n}\n\n/**\n * Loads all node configurations\n */\nexport async function loadAllNodeConfigs(): Promise<Map<NodeType, NodeDefinition>> {\n const nodeTypes: NodeType[] = ['input_node', 'rfdiffusion_node', 'proteinmpnn_node', 'alphafold_node', 'message_input_node'];\n \n const configs = await Promise.all(\n nodeTypes.map(async (type) => {\n const config = await loadNodeConfig(type);\n return [type, config] as [NodeType, NodeDefinition];\n })\n );\n \n return new Map(configs);\n}\n\n/**\n * Gets node metadata for a node type\n */\nexport async function getNodeMetadata(nodeType: NodeType): Promise<NodeMetadata> {\n const config = await loadNodeConfig(nodeType);\n return config.metadata;\n}\n\n/**\n * Gets the default configuration for a node type\n */\nexport async function getDefaultNodeConfig(nodeType: NodeType): Promise<Record<string, any>> {\n const config = await loadNodeConfig(nodeType);\n return { ...config.defaultConfig };\n}\n\n"],"names":["nodeConfigCache","loadNodeConfig","nodeType","config","__variableDynamicImportRuntimeHelper","nodeConfig","validateNodeConfig","error","expectedType","loadAllNodeConfigs","nodeTypes","configs","type","getNodeMetadata","getDefaultNodeConfig"],"mappings":";AAgEA,MAAMA,wBAAqD,IAAA;AAK3D,eAAsBC,EAAeC,GAA6C;AAEhF,MAAIF,EAAgB,IAAIE,CAAQ;AAC9B,WAAOF,EAAgB,IAAIE,CAAQ;AAGrC,MAAI;AAEF,UAAMC,IAAS,MAAMC,EAAA,uBAAA,OAAA,EAAA,qCAAA,MAAA,OAAA,uCAAA,GAAA,wCA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C;AAE/E,UADe,MAAMD,EAAeC,CAAQ,GAC9B;AAChB;AAKA,eAAsBY,EAAqBZ,GAAkD;AAE3F,SAAO,EAAE,IADM,MAAMD,EAAeC,CAAQ,GACzB,cAAA;AACrB;"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { PipelineNode } from '../types/index';
|
|
2
|
+
/**
|
|
3
|
+
* Resolves template variables in strings like {{input.target}} or {{config.contigs}}
|
|
4
|
+
*/
|
|
5
|
+
export declare function resolveTemplate(template: string, node: PipelineNode, inputData: Record<string, any>): any;
|
|
6
|
+
/**
|
|
7
|
+
* Recursively resolves all template variables in an object
|
|
8
|
+
*/
|
|
9
|
+
export declare function resolveTemplates(obj: any, node: PipelineNode, inputData: Record<string, any>): any;
|
|
10
|
+
//# sourceMappingURL=templateResolver.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"templateResolver.d.ts","sourceRoot":"","sources":["../../utils/templateResolver.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C;;GAEG;AACH,wBAAgB,eAAe,CAC7B,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,YAAY,EAClB,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAC7B,GAAG,CAsFL;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAC9B,GAAG,EAAE,GAAG,EACR,IAAI,EAAE,YAAY,EAClB,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAC7B,GAAG,CAsBL"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
function g(r, e, s) {
|
|
2
|
+
var l;
|
|
3
|
+
if (typeof r != "string")
|
|
4
|
+
return r;
|
|
5
|
+
const i = /\{\{([^}]+)\}\}/g;
|
|
6
|
+
if (!i.test(r))
|
|
7
|
+
return r;
|
|
8
|
+
i.lastIndex = 0;
|
|
9
|
+
const u = r.match(/^\{\{([^}]+)\}\}$/);
|
|
10
|
+
if (u) {
|
|
11
|
+
const f = u[1].trim();
|
|
12
|
+
if (f.startsWith("input.")) {
|
|
13
|
+
const o = f.replace("input.", ""), t = s[o];
|
|
14
|
+
if (t == null)
|
|
15
|
+
throw new Error(`Input '${o}' not found for node ${e.id}`);
|
|
16
|
+
return t;
|
|
17
|
+
}
|
|
18
|
+
if (f.startsWith("config.")) {
|
|
19
|
+
const o = f.replace("config.", ""), t = (l = e.config) == null ? void 0 : l[o];
|
|
20
|
+
return t == null || t === "" ? "" : t;
|
|
21
|
+
}
|
|
22
|
+
if (f.startsWith("node.")) {
|
|
23
|
+
const o = f.replace("node.", "");
|
|
24
|
+
return e[o] || "";
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
return r.replace(i, (f, o) => {
|
|
28
|
+
var a;
|
|
29
|
+
const t = o.trim();
|
|
30
|
+
if (t.startsWith("input.")) {
|
|
31
|
+
const c = t.replace("input.", ""), n = s[c];
|
|
32
|
+
if (n == null)
|
|
33
|
+
throw new Error(`Input '${c}' not found for node ${e.id}`);
|
|
34
|
+
return typeof n == "object" ? JSON.stringify(n) : String(n);
|
|
35
|
+
}
|
|
36
|
+
if (t.startsWith("config.")) {
|
|
37
|
+
const c = t.replace("config.", ""), n = (a = e.config) == null ? void 0 : a[c];
|
|
38
|
+
return n == null || n === "" ? "" : String(n);
|
|
39
|
+
}
|
|
40
|
+
if (t.startsWith("node.")) {
|
|
41
|
+
const c = t.replace("node.", "");
|
|
42
|
+
return String(e[c] || "");
|
|
43
|
+
}
|
|
44
|
+
return f;
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
function d(r, e, s) {
|
|
48
|
+
if (typeof r == "string")
|
|
49
|
+
return r.includes("{{") ? g(r, e, s) : r;
|
|
50
|
+
if (Array.isArray(r))
|
|
51
|
+
return r.map((i) => d(i, e, s));
|
|
52
|
+
if (r && typeof r == "object") {
|
|
53
|
+
const i = {};
|
|
54
|
+
for (const [u, l] of Object.entries(r))
|
|
55
|
+
i[u] = d(l, e, s);
|
|
56
|
+
return i;
|
|
57
|
+
}
|
|
58
|
+
return r;
|
|
59
|
+
}
|
|
60
|
+
export {
|
|
61
|
+
g as resolveTemplate,
|
|
62
|
+
d as resolveTemplates
|
|
63
|
+
};
|
|
64
|
+
//# sourceMappingURL=templateResolver.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"templateResolver.mjs","sources":["../../utils/templateResolver.ts"],"sourcesContent":["import { PipelineNode } from '../types/index';\n\n/**\n * Resolves template variables in strings like {{input.target}} or {{config.contigs}}\n */\nexport function resolveTemplate(\n template: string,\n node: PipelineNode,\n inputData: Record<string, any>\n): any {\n if (typeof template !== 'string') {\n return template;\n }\n\n // Match {{variable}} patterns\n const templateRegex = /\\{\\{([^}]+)\\}\\}/g;\n \n // Check if template contains any variables\n if (!templateRegex.test(template)) {\n return template;\n }\n \n // Reset regex (test() advances the lastIndex)\n templateRegex.lastIndex = 0;\n \n // Check if the entire string is just a template variable (for preserving types)\n const fullMatch = template.match(/^\\{\\{([^}]+)\\}\\}$/);\n if (fullMatch) {\n const trimmedPath = fullMatch[1].trim();\n \n // Handle {{input.handleId}} - get data from input connections\n if (trimmedPath.startsWith('input.')) {\n const handleId = trimmedPath.replace('input.', '');\n const value = inputData[handleId];\n if (value === undefined || value === null) {\n throw new Error(`Input '${handleId}' not found for node ${node.id}`);\n }\n // Return value as-is to preserve type (object, number, etc.)\n return value;\n }\n \n // Handle {{config.fieldName}} - get from node config\n if (trimmedPath.startsWith('config.')) {\n const fieldName = trimmedPath.replace('config.', '');\n const value = node.config?.[fieldName];\n \n if (value === undefined || value === null || value === '') {\n return '';\n }\n // Return value as-is to preserve type (number, boolean, object, etc.)\n return value;\n }\n \n // Handle {{node.fieldName}} - get from node metadata\n if (trimmedPath.startsWith('node.')) {\n const fieldName = trimmedPath.replace('node.', '');\n return (node as any)[fieldName] || '';\n }\n }\n \n // For strings with embedded templates, use replace\n return template.replace(templateRegex, (match, path) => {\n const trimmedPath = path.trim();\n \n // Handle {{input.handleId}} - get data from input connections\n if (trimmedPath.startsWith('input.')) {\n const handleId = trimmedPath.replace('input.', '');\n const value = inputData[handleId];\n if (value === undefined || value === null) {\n throw new Error(`Input '${handleId}' not found for node ${node.id}`);\n }\n // For embedded templates, convert to string\n return typeof value === 'object' ? JSON.stringify(value) : String(value);\n }\n \n // Handle {{config.fieldName}} - get from node config\n if (trimmedPath.startsWith('config.')) {\n const fieldName = trimmedPath.replace('config.', '');\n const value = node.config?.[fieldName];\n \n if (value === undefined || value === null || value === '') {\n return '';\n }\n // For embedded templates, convert to string\n return String(value);\n }\n \n // Handle {{node.fieldName}} - get from node metadata\n if (trimmedPath.startsWith('node.')) {\n const fieldName = trimmedPath.replace('node.', '');\n return String((node as any)[fieldName] || '');\n }\n \n return match; // Return original if pattern not recognized\n });\n}\n\n/**\n * Recursively resolves all template variables in an object\n */\nexport function resolveTemplates(\n obj: any,\n node: PipelineNode,\n inputData: Record<string, any>\n): any {\n if (typeof obj === 'string') {\n // Check if it's a template string\n if (obj.includes('{{')) {\n return resolveTemplate(obj, node, inputData);\n }\n return obj;\n }\n \n if (Array.isArray(obj)) {\n return obj.map(item => resolveTemplates(item, node, inputData));\n }\n \n if (obj && typeof obj === 'object') {\n const resolved: Record<string, any> = {};\n for (const [key, value] of Object.entries(obj)) {\n resolved[key] = resolveTemplates(value, node, inputData);\n }\n return resolved;\n }\n \n return obj;\n}\n\n"],"names":["resolveTemplate","template","node","inputData","_a","templateRegex","fullMatch","trimmedPath","handleId","value","fieldName","match","path","resolveTemplates","obj","item","resolved","key"],"mappings":"AAKO,SAASA,EACdC,GACAC,GACAC,GACK;AAJA,MAAAC;AAKL,MAAI,OAAOH,KAAa;AACtB,WAAOA;AAIT,QAAMI,IAAgB;AAGtB,MAAI,CAACA,EAAc,KAAKJ,CAAQ;AAC9B,WAAOA;AAIT,EAAAI,EAAc,YAAY;AAG1B,QAAMC,IAAY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,IACrB;AAGA,QAAIF,EAAY,WAAW,OAAO,GAAG;AACnC,YAAMG,IAAYH,EAAY,QAAQ,SAAS,EAAE;AACjD,aAAO,OAAQL,EAAaQ,CAAS,KAAK,EAAE;AAAA,IAC9C;AAEA,WAAOC;AAAA,EACT,CAAC;AACH;AAKO,SAASE,EACdC,GACAZ,GACAC,GACK;AACL,MAAI,OAAOW,KAAQ;AAEjB,WAAIA,EAAI,SAAS,IAAI,IACZd,EAAgBc,GAAKZ,GAAMC,CAAS,IAEtCW;AAGT,MAAI,MAAM,QAAQA,CAAG;AACnB,WAAOA,EAAI,IAAI,CAAAC,MAAQF,EAAiBE,GAAMb,GAAMC,CAAS,CAAC;AAGhE,MAAIW,KAAO,OAAOA,KAAQ,UAAU;AAClC,UAAME,IAAgC,CAAA;AACtC,eAAW,CAACC,GAAKR,CAAK,KAAK,OAAO,QAAQK,CAAG;AAC3C,MAAAE,EAASC,CAAG,IAAIJ,EAAiBJ,GAAOP,GAAMC,CAAS;AAEzD,WAAOa;AAAA,EACT;AAEA,SAAOF;AACT;"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { PipelineNode } from '../types/index';
|
|
2
|
+
/**
|
|
3
|
+
* Performs topological sort on pipeline nodes based on their edges
|
|
4
|
+
* Returns an array of node IDs in execution order
|
|
5
|
+
*/
|
|
6
|
+
export declare function topologicalSort(nodes: PipelineNode[], edges: Array<{
|
|
7
|
+
source: string;
|
|
8
|
+
target: string;
|
|
9
|
+
}>): string[];
|
|
10
|
+
//# sourceMappingURL=topologicalSort.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"topologicalSort.d.ts","sourceRoot":"","sources":["../../utils/topologicalSort.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C;;;GAGG;AACH,wBAAgB,eAAe,CAC7B,KAAK,EAAE,YAAY,EAAE,EACrB,KAAK,EAAE,KAAK,CAAC;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC,GAC/C,MAAM,EAAE,CA4CV"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
function f(u, p) {
|
|
2
|
+
const o = new Set(u.map((t) => t.id)), s = /* @__PURE__ */ new Map(), n = /* @__PURE__ */ new Map();
|
|
3
|
+
o.forEach((t) => {
|
|
4
|
+
s.set(t, 0), n.set(t, []);
|
|
5
|
+
}), p.forEach((t) => {
|
|
6
|
+
o.has(t.source) && o.has(t.target) && (n.get(t.source).push(t.target), s.set(t.target, (s.get(t.target) || 0) + 1));
|
|
7
|
+
});
|
|
8
|
+
const e = [];
|
|
9
|
+
s.forEach((t, a) => {
|
|
10
|
+
t === 0 && e.push(a);
|
|
11
|
+
});
|
|
12
|
+
const c = [];
|
|
13
|
+
for (; e.length > 0; ) {
|
|
14
|
+
const t = e.shift();
|
|
15
|
+
c.push(t), (n.get(t) || []).forEach((r) => {
|
|
16
|
+
const h = (s.get(r) || 0) - 1;
|
|
17
|
+
s.set(r, h), h === 0 && e.push(r);
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
return c;
|
|
21
|
+
}
|
|
22
|
+
export {
|
|
23
|
+
f as topologicalSort
|
|
24
|
+
};
|
|
25
|
+
//# sourceMappingURL=topologicalSort.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"topologicalSort.mjs","sources":["../../utils/topologicalSort.ts"],"sourcesContent":["import { PipelineNode } from '../types/index';\n\n/**\n * Performs topological sort on pipeline nodes based on their edges\n * Returns an array of node IDs in execution order\n */\nexport function topologicalSort(\n nodes: PipelineNode[],\n edges: Array<{ source: string; target: string }>\n): string[] {\n const nodeIds = new Set(nodes.map((n) => n.id));\n const inDegree = new Map<string, number>();\n const graph = new Map<string, string[]>();\n \n // Initialize\n nodeIds.forEach((id) => {\n inDegree.set(id, 0);\n graph.set(id, []);\n });\n \n // Build graph and calculate in-degrees\n edges.forEach((edge) => {\n if (nodeIds.has(edge.source) && nodeIds.has(edge.target)) {\n graph.get(edge.source)!.push(edge.target);\n inDegree.set(edge.target, (inDegree.get(edge.target) || 0) + 1);\n }\n });\n \n // Find nodes with no incoming edges\n const queue: string[] = [];\n inDegree.forEach((degree, nodeId) => {\n if (degree === 0) {\n queue.push(nodeId);\n }\n });\n \n const result: string[] = [];\n \n while (queue.length > 0) {\n const nodeId = queue.shift()!;\n result.push(nodeId);\n \n const neighbors = graph.get(nodeId) || [];\n neighbors.forEach((neighbor) => {\n const newDegree = (inDegree.get(neighbor) || 0) - 1;\n inDegree.set(neighbor, newDegree);\n if (newDegree === 0) {\n queue.push(neighbor);\n }\n });\n }\n \n return result;\n}\n\n\n\n\n\n"],"names":["topologicalSort","nodes","edges","nodeIds","n","inDegree","graph","id","edge","queue","degree","nodeId","result","neighbor","newDegree"],"mappings":"AAMO,SAASA,EACdC,GACAC,GACU;AACV,QAAMC,IAAU,IAAI,IAAIF,EAAM,IAAI,CAACG,MAAMA,EAAE,EAAE,CAAC,GACxCC,wBAAe,IAAA,GACfC,wBAAY,IAAA;AAGlB,EAAAH,EAAQ,QAAQ,CAACI,MAAO;AACtB,IAAAF,EAAS,IAAIE,GAAI,CAAC,GAClBD,EAAM,IAAIC,GAAI,EAAE;AAAA,EAClB,CAAC,GAGDL,EAAM,QAAQ,CAACM,MAAS;AACtB,IAAIL,EAAQ,IAAIK,EAAK,MAAM,KAAKL,EAAQ,IAAIK,EAAK,MAAM,MACrDF,EAAM,IAAIE,EAAK,MAAM,EAAG,KAAKA,EAAK,MAAM,GACxCH,EAAS,IAAIG,EAAK,SAASH,EAAS,IAAIG,EAAK,MAAM,KAAK,KAAK,CAAC;AAAA,EAElE,CAAC;AAGD,QAAMC,IAAkB,CAAA;AACxB,EAAAJ,EAAS,QAAQ,CAACK,GAAQC,MAAW;AACnC,IAAID,MAAW,KACbD,EAAM,KAAKE,CAAM;AAAA,EAErB,CAAC;AAED,QAAMC,IAAmB,CAAA;AAEzB,SAAOH,EAAM,SAAS,KAAG;AACvB,UAAME,IAASF,EAAM,MAAA;AACrB,IAAAG,EAAO,KAAKD,CAAM,IAEAL,EAAM,IAAIK,CAAM,KAAK,CAAA,GAC7B,QAAQ,CAACE,MAAa;AAC9B,YAAMC,KAAaT,EAAS,IAAIQ,CAAQ,KAAK,KAAK;AAClD,MAAAR,EAAS,IAAIQ,GAAUC,CAAS,GAC5BA,MAAc,KAChBL,EAAM,KAAKI,CAAQ;AAAA,IAEvB,CAAC;AAAA,EACH;AAEA,SAAOD;AACT;"}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
{
|
|
2
|
+
"metadata": {
|
|
3
|
+
"type": "alphafold_node",
|
|
4
|
+
"label": "AlphaFold",
|
|
5
|
+
"icon": "Layers",
|
|
6
|
+
"color": "#f97316",
|
|
7
|
+
"borderColor": "border-orange-500",
|
|
8
|
+
"bgColor": "bg-orange-500",
|
|
9
|
+
"description": "Structure prediction"
|
|
10
|
+
},
|
|
11
|
+
"schema": {
|
|
12
|
+
"api_key": {
|
|
13
|
+
"type": "string",
|
|
14
|
+
"required": false,
|
|
15
|
+
"default": "",
|
|
16
|
+
"placeholder": "Enter API key (optional)",
|
|
17
|
+
"label": "API Key",
|
|
18
|
+
"helpText": "API key for AlphaFold. Leave empty to use global API key from settings."
|
|
19
|
+
},
|
|
20
|
+
"recycle_count": {
|
|
21
|
+
"type": "number",
|
|
22
|
+
"required": false,
|
|
23
|
+
"default": 3,
|
|
24
|
+
"min": 1,
|
|
25
|
+
"max": 20,
|
|
26
|
+
"label": "Recycle Count"
|
|
27
|
+
},
|
|
28
|
+
"num_relax": {
|
|
29
|
+
"type": "number",
|
|
30
|
+
"required": false,
|
|
31
|
+
"default": 0,
|
|
32
|
+
"min": 0,
|
|
33
|
+
"max": 10,
|
|
34
|
+
"label": "Number of Relax Steps"
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
"handles": {
|
|
38
|
+
"inputs": [
|
|
39
|
+
{
|
|
40
|
+
"id": "target",
|
|
41
|
+
"type": "target",
|
|
42
|
+
"position": "left",
|
|
43
|
+
"dataType": "sequence"
|
|
44
|
+
}
|
|
45
|
+
],
|
|
46
|
+
"outputs": [
|
|
47
|
+
{
|
|
48
|
+
"id": "source",
|
|
49
|
+
"type": "source",
|
|
50
|
+
"position": "right",
|
|
51
|
+
"dataType": "pdb_file"
|
|
52
|
+
}
|
|
53
|
+
]
|
|
54
|
+
},
|
|
55
|
+
"execution": {
|
|
56
|
+
"type": "api_call",
|
|
57
|
+
"endpoint": "/alphafold/run",
|
|
58
|
+
"method": "POST",
|
|
59
|
+
"headers": {
|
|
60
|
+
"Authorization": "Bearer {{config.api_key}}"
|
|
61
|
+
},
|
|
62
|
+
"payload": {
|
|
63
|
+
"sequence": "{{input.target}}",
|
|
64
|
+
"recycle_count": "{{config.recycle_count}}",
|
|
65
|
+
"num_relax": "{{config.num_relax}}"
|
|
66
|
+
}
|
|
67
|
+
},
|
|
68
|
+
"defaultConfig": {
|
|
69
|
+
"api_key": "",
|
|
70
|
+
"recycle_count": 3,
|
|
71
|
+
"num_relax": 0
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
|