Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions packages/visual-editor/src/a2/a2-registry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,15 @@ import searchEnterpriseInvoke, {
import codeExecutionInvoke, {
describe as codeExecutionDescribe,
} from "./tools/code-execution.js";
import userInputInvoke, {
describe as userInputDescribe,
} from "./a2/user-input.js";
import renderOutputsInvoke, {
describe as renderOutputsDescribe,
} from "./a2/render-outputs.js";
import generateInvoke, {
describe as generateDescribe,
} from "./generate/main.js";

export { A2_COMPONENTS, A2_TOOLS };

Expand Down Expand Up @@ -123,24 +132,40 @@ const A2_TOOLS: [string, StaticTool][] = [
* Static registry of A2 components that appear in the component picker.
* These are the step types available in the editor controls.
*/

// eslint-disable-next-line @typescript-eslint/no-explicit-any
type ComponentInvoke = (...args: any[]) => Promise<any>;
// eslint-disable-next-line @typescript-eslint/no-explicit-any
type ComponentDescribe = (...args: any[]) => Promise<any>;

type A2Component = {
url: string;
title: string;
description: string;
icon: string;
order: number;
category: "input" | "generate" | "output";
invoke: ComponentInvoke;
describe: ComponentDescribe;
/**
* Optional module URL alias. If present, requests for this component's URL
* should be redirected to this module URL for proper context wiring.
*/
moduleUrl?: string;
};

const A2_COMPONENTS: A2Component[] = [
{
url: "embed://a2/a2.bgl.json#21ee02e7-83fa-49d0-964c-0cab10eafc2c",
moduleUrl: "embed://a2/a2.bgl.json#module:user-input",
title: "User Input",
description:
"Allows asking user for input that could be then used in next steps",
icon: "ask-user",
order: 1,
category: "input",
invoke: userInputInvoke,
describe: userInputDescribe,
},
{
url: "embed://a2/generate.bgl.json#module:main",
Expand All @@ -149,6 +174,8 @@ const A2_COMPONENTS: A2Component[] = [
icon: "generative",
order: 1,
category: "generate",
invoke: generateInvoke,
describe: generateDescribe,
},
{
url: "embed://a2/a2.bgl.json#module:render-outputs",
Expand All @@ -157,5 +184,7 @@ const A2_COMPONENTS: A2Component[] = [
icon: "responsive_layout",
order: 100,
category: "output",
invoke: renderOutputsInvoke,
describe: renderOutputsDescribe,
},
];
33 changes: 0 additions & 33 deletions packages/visual-editor/src/a2/a2.ts

This file was deleted.

122 changes: 2 additions & 120 deletions packages/visual-editor/src/a2/a2/bgl.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,129 +52,11 @@
"#module:image-editor",
"#module:render-outputs",
"#module:audio-generator",
"#21ee02e7-83fa-49d0-964c-0cab10eafc2c",
"#module:user-input",
"#module:combine-outputs",
"#module:make-code"
],
"graphs": {
"21ee02e7-83fa-49d0-964c-0cab10eafc2c": {
"title": "Ask User",
"description": "A block of text as input or output",
"version": "0.0.1",
"nodes": [
{
"type": "input",
"id": "input",
"metadata": {
"visual": {
"x": 580.0000000000005,
"y": -539.9999999999994,
"collapsed": "expanded",
"outputHeight": 44
},
"title": "Waiting for user input",
"logLevel": "info"
},
"configuration": {}
},
{
"type": "output",
"id": "output",
"configuration": {
"schema": {
"properties": {
"context": {
"type": "array",
"title": "Context",
"items": {
"type": "object",
"behavior": ["llm-content"]
},
"default": "null"
}
},
"type": "object",
"required": []
}
},
"metadata": {
"visual": {
"x": 1240.0000000000005,
"y": -399.99999999999943,
"collapsed": "expanded",
"outputHeight": 44
}
}
},
{
"id": "board-64b2c3a8",
"type": "#module:text-entry",
"metadata": {
"visual": {
"x": 225.9030760391795,
"y": -646.8568148490385,
"collapsed": "expanded",
"outputHeight": 44
},
"title": "text-entry"
}
},
{
"id": "board-95a57400",
"type": "#module:text-main",
"metadata": {
"visual": {
"x": 900,
"y": -459.99999999999943,
"collapsed": "expanded",
"outputHeight": 44
},
"title": "text-main"
}
}
],
"edges": [
{
"from": "board-64b2c3a8",
"out": "toInput",
"to": "input",
"in": "schema"
},
{
"from": "board-64b2c3a8",
"out": "toMain",
"to": "board-95a57400",
"in": "request"
},
{
"from": "board-95a57400",
"to": "output",
"out": "context",
"in": "context"
},
{
"from": "board-64b2c3a8",
"to": "board-95a57400",
"out": "context",
"in": "context"
},
{
"from": "input",
"to": "board-95a57400",
"out": "request",
"in": "request"
}
],
"metadata": {
"visual": {
"minimized": false
},
"tags": [],
"describer": "module:text-entry",
"icon": "text"
}
}
},
"graphs": {},
"assets": {
"@@thumbnail": {
"metadata": {
Expand Down
6 changes: 2 additions & 4 deletions packages/visual-editor/src/a2/a2/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@ import * as a2Researcher from "./researcher.js";
import * as a2Settings from "./settings.js";
import * as a2StepExecutor from "./step-executor.js";
import * as a2Template from "./template.js";
import * as a2TextEntry from "./text-entry.js";
import * as a2TextMain from "./text-main.js";
import * as a2UserInput from "./user-input.js";
import * as a2ToolManager from "./tool-manager.js";
import * as a2Utils from "./utils.js";

Expand All @@ -49,8 +48,7 @@ export const exports = {
settings: a2Settings,
"step-executor": a2StepExecutor,
template: a2Template,
"text-entry": a2TextEntry,
"text-main": a2TextMain,
"user-input": a2UserInput,
"tool-manager": a2ToolManager,
utils: a2Utils,
};
Expand Down
58 changes: 0 additions & 58 deletions packages/visual-editor/src/a2/a2/text-main.ts

This file was deleted.

Loading
Loading