-
Notifications
You must be signed in to change notification settings - Fork 9
feat: implement Logic Script component with dynamic ports and URL imports #182
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| // 5. Execute | ||
| const vmResult = vm.evalCode(userScriptWrapped); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Enforce an execution limit on sandboxed scripts
The QuickJS context is created and vm.evalCode(...) is called without any time/interrupt limit, so a user script containing an infinite loop (e.g., while(true){}) will block the worker thread indefinitely and stall the workflow runner. Because this component is intended for untrusted user logic, the lack of a timeout or instruction budget is a production-stopping risk; consider wiring a deadline/interrupt handler or running the VM with an execution limit so the worker can recover.
Useful? React with 👍 / 👎.
Signed-off-by: betterclever <paliwal.pranjal83@gmail.com>
Signed-off-by: betterclever <paliwal.pranjal83@gmail.com>
Signed-off-by: betterclever <paliwal.pranjal83@gmail.com>
- Add @dnd-kit/core, @dnd-kit/sortable, @dnd-kit/utilities dependencies - Create SimpleVariableListEditor component with DnD reordering - Add 'list' type support to logic-script component - Implement dynamic outputs resolution in ConfigPanel - Add dynamicOutputs to FrontendNodeData interface - Update WorkflowNode to render dynamic output ports from nodeData Signed-off-by: betterclever <paliwal.pranjal83@gmail.com>
… url import support - Switched logic script execution from QuickJS to high-performance Docker (Bun)\n- Implemented custom Bun HTTP loader plugin for recursive URL imports (Unpkg/esm.sh)\n- Removed sucrase dependency for logic execution (native TS support)\n- Improved sandbox isolation with 256MB RAM and 0.5 CPU limits\n- Added documentation and examples for external packages in the frontend editor Signed-off-by: betterclever <paliwal.pranjal83@gmail.com>
6e62e04 to
fcd78d0
Compare
- Fixed regex that was causing double 'export' in logic scripts\n- Updated unit tests to match Docker/Bun execution format\n- Fixed mock ExecutionContext in tests to match package-sdk interfaces Signed-off-by: betterclever <paliwal.pranjal83@gmail.com>
e9a8839 to
360a01c
Compare
4f76dae to
476beaa
Compare
Signed-off-by: betterclever <paliwal.pranjal83@gmail.com>
476beaa to
f36cf6a
Compare
This PR introduces the Logic Script component, a powerful new node type that allows users to execute custom TypeScript logic within a secure, high-performance sandbox.
🚀 Key Highlights
🛠️ Technical Implementation