This guide covers setting up the development environment, building the project, and contributing to NebulaFlow. For architectural details, see Technical Architecture.
git clone https://github.com/PriNova/nebulaflow.git
cd nebulaflow
npm install
This installs both runtime dependencies and dev dependencies (TypeScript, Biome, Vite, etc.).
The extension requires API keys for LLM nodes. Set these in your shell before launching VS Code:
export AMP_API_KEY="your-amp-key"
export OPENROUTER_API_KEY="your-openrouter-key"
Alternatively, add them to a .env file in the project root (ignored by Git). The extension reads these at runtime.
The Amp SDK is vendored as a tarball in vendor/amp-sdk/amp-sdk.tgz and referenced as a file dependency in package.json. No external linking is required; npm install will copy the SDK into node_modules/@prinova/amp-sdk. The build process bundles the SDK directly into the extension.
NebulaFlow consists of two main parts:
Build both parts and run type checking:
npm run build
This executes:
npm run typecheck – TypeScript validationnpm run build:webview – Vite bundles the React app into dist/webviews/npm run build:ext – esbuild bundles the extension + SDK into dist/extension.jsnpm run build:webviewnpm run build:extnpm run build:electron (builds the main process)npm run watch:webviewnpm run watch:ext (requires VS Code reload)npm run watch (runs webview watcher; extension changes need reload)Create a VSIX package for distribution:
npm run package:vsix
The .vsix file appears in dist/.
If you see a missing webview assets error, run npm run build or ensure the watcher is running.
Run TypeScript type checking for both extension and webview:
npm run typecheck
NebulaFlow uses Biome for linting and formatting.
npm run check (typecheck + lint)npm run lintnpm run biome (also aliased as npm run format)src/extension.ts or workflow/ files.AMP_API_KEY and OPENROUTER_API_KEY are set before launching the extension host.NEBULAFLOW_SHELL_MAX_OUTPUT (max shell output chars), NEBULAFLOW_DEBUG_LLM (enable LLM debug logging), NEBULAFLOW_FILTER_PAUSE_SEEDS (filter pause seeds).Currently, there are no automated unit tests. Manual testing is performed by creating workflows with various node types and verifying execution, streaming, approvals, and pause/resume.
Manual test checklist:
To add a new node type:
workflow/Core/models.ts (add a new NodeType and its data interface).workflow/Web/components/nodes/ (follow the pattern of existing nodes).workflow/Web/components/nodes/Nodes.tsx:
NodeType to the enum (must match the one defined in models.ts).nodeTypes mapping.nodeTypeDisplayLabel mapping.workflow/WorkflowExecution/Application/node-runners/ (e.g., run-my-node.ts) that exports an async execution function.ExecuteWorkflow.ts (see runAccumulator and runVariable).NodeImplementations in workflow/WorkflowExecution/Application/handlers/NodeDispatch.ts.NodeType in the routeNodeExecution switch.workflow/WorkflowExecution/Application/handlers/ExecuteWorkflow.ts (and ExecuteSingleNode.ts for single-node mode), add the runner to the callbacks object passed to routeNodeExecution.workflow/Web/components/sidebar/WorkflowSidebar.tsx (add to the appropriate category).docs/user-guide/nodes/index.md and docs/api-reference/node-types.md.NebulaFlow follows a Vertical Slice Architecture (VSA). Key slices:
workflow/Web/): React UI, React Flow graph, node components, sidebars.workflow/Application/): Message handling, command orchestration, lifecycle.workflow/Core/): Pure types, models, validation.workflow/DataAccess/): File system and shell adapters.workflow/WorkflowExecution/): Graph execution engine, node runners.workflow/LLMIntegration/): SDK integration, workspace configuration.workflow/Shared/): Generic primitives (Host, Infrastructure).For details, see Technical Architecture.
npm run check.node: protocol for Node.js built‑ins.lowerCamelCase for variables/functions, PascalCase for components/types.Follow Conventional Commits. Example:
feat(llm-node): add support for custom model parameters
NebulaFlow uses GitHub Actions for continuous integration.
.github/workflows/build.yml):
main and dev branches.npm run check (typecheck + lint).npm run package:vsix)..github/workflows/deploy-docs.yml):
You can run the same steps locally to verify your changes.
| Issue | Solution |
|---|---|
| Amp SDK not available | The SDK is vendored; ensure vendor/amp-sdk/amp-sdk.tgz exists. |
| AMP_API_KEY is not set | Set the environment variable before launching VS Code. |
| Webview assets don’t load | Run npm run build or start the webview watcher (npm run watch:webview). |
| Type errors | Run npm run typecheck and fix diagnostics. |
| Lint/format issues | Run npm run check or npm run biome. |
| Extension fails to load | Check VS Code version ≥ 1.90.0; reload the window. |
| CLI node approval not showing | Ensure the node’s needsUserApproval flag is true; check webview console for errors. |