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
15 changes: 1 addition & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,20 +78,7 @@ Visit [http://localhost:3000](http://localhost:3000) to get started.

### Action Nodes

<!-- PLUGINS:START - Do not remove. Auto-generated by discover-plugins -->
- **AI Gateway**: Generate Text, Generate Image
- **Blob**: Put Blob, List Blobs
- **fal.ai**: Generate Image, Generate Video, Upscale Image, Remove Background, Image to Image
- **Firecrawl**: Scrape URL, Search Web
- **GitHub**: Create Issue, List Issues, Get Issue, Update Issue
- **Linear**: Create Ticket, Find Issues
- **Perplexity**: Search Web, Ask Question, Research Topic
- **Resend**: Send Email
- **Slack**: Send Slack Message
- **Stripe**: Create Customer, Get Customer, Create Invoice
- **Superagent**: Guard, Redact
- **v0**: Create Chat, Send Message
<!-- PLUGINS:END -->
See the `plugins/` directory for available integrations. Each plugin provides one or more actions that can be used in workflows. Run `pnpm create-plugin` to create a new integration.

## Code Generation

Expand Down
58 changes: 4 additions & 54 deletions scripts/discover-plugins.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@
* Plugin Auto-Discovery Script
*
* Automatically discovers all plugins in the plugins/ directory and generates
* the plugins/index.ts file with imports. Also updates the README.md with
* the current list of available actions.
* the plugins/index.ts file with imports.
*
* Additionally generates codegen templates from step files that have
* a stepHandler function.
Expand All @@ -31,9 +30,6 @@ const OUTPUT_FILE = join(PLUGINS_DIR, "index.ts");
const TYPES_FILE = join(process.cwd(), "lib", "types", "integration.ts");
const STEP_REGISTRY_FILE = join(process.cwd(), "lib", "step-registry.ts");
const CODEGEN_REGISTRY_FILE = join(process.cwd(), "lib", "codegen-registry.ts");
const README_FILE = join(process.cwd(), "README.md");
const PLUGINS_MARKER_REGEX =
/<!-- PLUGINS:START[^>]*-->[\s\S]*?<!-- PLUGINS:END -->/;

// System integrations that don't have plugins
const SYSTEM_INTEGRATION_TYPES = ["database"] as const;
Expand Down Expand Up @@ -148,52 +144,6 @@ export {

writeFileSync(OUTPUT_FILE, content, "utf-8");
}

/**
* Update the README.md with the current list of actions
*/
async function updateReadme(): Promise<void> {
// Dynamically import the plugins to populate the registry
// This works because we already generated plugins/index.ts above
await import("@/plugins/index");

// Now import the registry utilities
const { getAllIntegrations } = await import("@/plugins/registry");

const integrations = getAllIntegrations();

if (integrations.length === 0) {
console.log("No integrations found, skipping README update");
return;
}

// Generate markdown list grouped by integration
const actionsList = integrations
.map((integration) => {
const actionLabels = integration.actions.map((a) => a.label).join(", ");
return `- **${integration.label}**: ${actionLabels}`;
})
.join("\n");

// Read current README
const readme = readFileSync(README_FILE, "utf-8");

// Check if markers exist
if (!readme.includes("<!-- PLUGINS:START")) {
console.log("README markers not found, skipping README update");
return;
}

// Replace content between markers
const updated = readme.replace(
PLUGINS_MARKER_REGEX,
`<!-- PLUGINS:START - Do not remove. Auto-generated by discover-plugins -->\n${actionsList}\n<!-- PLUGINS:END -->`
);

writeFileSync(README_FILE, updated, "utf-8");
console.log(`Updated README.md with ${integrations.length} integration(s)`);
}

/**
* Generate the lib/types/integration.ts file with dynamic types
*/
Expand All @@ -204,6 +154,9 @@ async function generateTypesFile(): Promise<void> {
mkdirSync(typesDir, { recursive: true });
}

// Import plugins to populate the registry
await import("@/plugins/index");

// Get plugin types from registry
const { getIntegrationTypes } = await import("@/plugins/registry");
const pluginTypes = getIntegrationTypes();
Expand Down Expand Up @@ -755,9 +708,6 @@ async function main(): Promise<void> {
console.log("\nGenerating plugins/index.ts...");
generateIndexFile(plugins);

console.log("Updating README.md...");
await updateReadme();

console.log("Generating lib/types/integration.ts...");
await generateTypesFile();

Expand Down