diff --git a/src/app/models/flow.ts b/src/app/models/flow.ts index 28e5fc9..4a1383b 100644 --- a/src/app/models/flow.ts +++ b/src/app/models/flow.ts @@ -86,18 +86,3 @@ export type HumanInteractiveBlockConfiguration = { inputAsList: boolean; outputAsList: boolean; }; - -export type INodeModel = { - key: string; - name?: string; - position: { x: number, y: number } | null; - parameters?: Record | null; -} - -export type IConnectionModel = { - key: string; - sourceNode: string; - sourceField: string; - targetNode: string; - targetField: string; -} diff --git a/src/app/models/test.ts b/src/app/models/test.ts deleted file mode 100644 index 89dcdbd..0000000 --- a/src/app/models/test.ts +++ /dev/null @@ -1,62 +0,0 @@ -export const flowTest = { - "name" : "Test Flow", - "description" : "This is a test flow", - "blocks" : [ { - "id" : "cabd6f4e-5a05-41f8-9bf7-4de20391ac4e", - "sink" : false, - "name" : "first", - "inputs" : [ { - "name" : "name", - "type" : "TEXT", - "multiple" : false - } ], - "outputs" : [ { - "name" : "response", - "type" : "TEXT", - "multiple" : false - } ], - "specificConfiguration" : { - "type" : "LLMBlockConfiguration", - "name" : "first", - "llmDescriptor" : { - "provider" : "testProvider", - "model" : "testModel" - }, - "prompt" : "Make a question about ${{name}}" - }, - "typeName" : "LLMBlock" - }, { - "id" : "0063a3ec-3863-4045-bd3b-61eaf87b4604", - "sink" : true, - "name" : "interactive", - "inputs" : [ { - "name" : "input", - "type" : "TEXT", - "multiple" : false - } ], - "outputs" : [ { - "name" : "output", - "type" : "TEXT", - "multiple" : false - } ], - "specificConfiguration" : { - "type" : "HumanInteractiveBlockConfiguration", - "name" : "interactive", - "actionDescription" : "Answer the question in input", - "llmDescriptor" : { - "provider" : "testProvider", - "model" : "testModel" - }, - "inputAsList" : false, - "outputAsList" : false - }, - "typeName" : "HumanInteractionBlock" - } ], - "connections" : [ { - "id" : "8da696c2-dc03-4717-b2ce-18637ae6f7f8", - "sourceId" : "cabd6f4e-5a05-41f8-9bf7-4de20391ac4e", - "sourceName" : "response", - "targetId" : "0063a3ec-3863-4045-bd3b-61eaf87b4604", - "targetName" : "input" - } ] -}; diff --git a/src/app/shared/nodes/generic-node/generic-node.ts b/src/app/shared/nodes/generic-node/generic-node.ts index fe222f2..6ebc713 100644 --- a/src/app/shared/nodes/generic-node/generic-node.ts +++ b/src/app/shared/nodes/generic-node/generic-node.ts @@ -100,8 +100,6 @@ export class GenericNodeComponent { localEditorMaxLength: number | null = null; missingRequiredParams: string[] = []; - private missingRequiredPaths: string[] = []; - private blockSchema: Record | null = null; private editableFieldDefinitions: EditableFieldDefinition[] = []; private schemaRequirements: SchemaRequirements = { required: [], conditional: [] }; @@ -748,7 +746,6 @@ export class GenericNodeComponent { const missingFields = requiredFields .filter((field) => this.isMissingValue(this.getByPath(config, field.path))); - this.missingRequiredPaths = missingFields.map((field) => field.path); this.missingRequiredParams = missingFields.map((field) => field.label); if (!this.refreshingConditionalRequirements) { diff --git a/src/app/shared/sockets/input/input.ts b/src/app/shared/sockets/input/input.ts deleted file mode 100644 index 648a3b6..0000000 --- a/src/app/shared/sockets/input/input.ts +++ /dev/null @@ -1,44 +0,0 @@ -import { ChangeDetectorRef, Component, HostBinding, Input } from "@angular/core"; -import { ReteModule } from "rete-angular-plugin/21"; - -@Component({ - standalone: true, - imports: [ReteModule], - host: { - refComponent: '', - class: ` - cursor-crosshair relative -left-3 w-1 h-6 flex items-center justify-center rounded-full bg-green-500 shadow-[0_0_0_1px_rgb(34,197,94)] z-50 - ` - }, - template: `` -}) -export class InputSocket { - @Input() data!: any; - @Input() emit!: (data: any) => void; - @Input() rendered!: () => void; - - @HostBinding("title") get title() { - return this.data?.name ?? ""; - } - - ngOnInit(): void { - console.log("InputSocket ngOnInit", this.data); - } - - - ngAfterViewInit() { - requestAnimationFrame(() => { - this.rendered?.(); - }); -} - - constructor(private cdr: ChangeDetectorRef) { - this.cdr.detach(); - } - - ngOnChanges(): void { - this.cdr.detectChanges(); - requestAnimationFrame(() => this.rendered()); - } - -} diff --git a/src/app/shared/sockets/output/output.ts b/src/app/shared/sockets/output/output.ts deleted file mode 100644 index 3b9fa8d..0000000 --- a/src/app/shared/sockets/output/output.ts +++ /dev/null @@ -1,43 +0,0 @@ -import { ChangeDetectorRef, Component, HostBinding, Input } from '@angular/core'; -import { ReteModule } from 'rete-angular-plugin/21'; - -@Component({ - standalone: true, - imports: [ReteModule], - host: { - refComponent: '', - class: ` - cursor-crosshair relative -right-2 w-1 h-6 flex items-center justify-center rounded-full bg-red-500 - shadow-[0_0_0_1px_rgb(239,68,68)] - ` - }, - template: `` -}) -export class OutputSocket { - @Input() data!: any; - @Input() emit!: (data: any) => void; - @Input() rendered!: () => void; - - @HostBinding("title") get title() { - return this.data?.name ?? ""; - } - - ngOnInit(): void { - console.log("OutputSocket ngOnInit", this.data); - } - - ngAfterViewInit() { - requestAnimationFrame(() => { - this.rendered?.(); - }); -} - -constructor(private cdr: ChangeDetectorRef) { - this.cdr.detach(); - } - - ngOnChanges(): void { - this.cdr.detectChanges(); - requestAnimationFrame(() => this.rendered()); - } -} diff --git a/src/app/utilities/edit-flow.ts b/src/app/utilities/edit-flow.ts deleted file mode 100644 index e69de29..0000000 diff --git a/src/app/utilities/rete-editor.ts b/src/app/utilities/rete-editor.ts index 058f010..5ea85f2 100644 --- a/src/app/utilities/rete-editor.ts +++ b/src/app/utilities/rete-editor.ts @@ -38,7 +38,7 @@ export async function createEditor( render.addPreset( Presets.classic.setup({ customize: { - node(context) { + node(_context) { return nodeView === "execution" ? TaskStepNodeComponent : GenericNodeComponent; }, socket(context: any) {