Skip to content

Implement Plugin-Based Exporter System#38

Open
simwai wants to merge 9 commits into
masterfrom
feat/exporter-plugin-system-5404153873182433504
Open

Implement Plugin-Based Exporter System#38
simwai wants to merge 9 commits into
masterfrom
feat/exporter-plugin-system-5404153873182433504

Conversation

@simwai
Copy link
Copy Markdown
Owner

@simwai simwai commented Jun 1, 2026

This PR implements a robust, file-based plugin system for conversation exporters. Previously, the Markdown format was hardcoded into the FileWriter. Now, the system dynamically scans src/exporters/ for .ts or .js files that implement the ConversationExporter interface.

Key changes:

  1. Exporter Interface: Defined a clear contract for new output formats.
  2. Discovery Logic: FileWriter now asynchronously initializes by scanning the filesystem and importing active plugins.
  3. Structured Data: The extraction model was enhanced to include a messages array, enabling exporters to generate structured files like JSON or CSV without parsing raw Markdown.
  4. Backwards Compatibility: The system defaults to the existing Markdown behavior if no configuration is provided.
  5. Documentation: Detailed the process for adding and activating new exporters in the README.

PR created automatically by Jules for task 5404153873182433504 started by @simwai

- Added `ConversationExporter` interface for custom output formats.
- Refactored `FileWriter` to dynamically discover and load exporters from `src/exporters/`.
- Migrated default Markdown logic to a built-in `markdown.exporter.ts`.
- Enhanced `ExtractedConversation` with structured `messages` for better serialization.
- Added `ENABLED_EXPORTERS` environment variable for activating plugins.
- Provided a CSV exporter example and updated documentation.

Co-authored-by: simwai <16225108+simwai@users.noreply.github.com>
@google-labs-jules
Copy link
Copy Markdown
Contributor

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

google-labs-jules Bot and others added 8 commits June 1, 2026 23:33
- Added `ConversationExporter` interface in `exporter-interface.ts`.
- Refactored `FileWriter` to dynamically discover exporters.
- Implemented `markdown-exporter.ts` as the default output format.
- Enhanced `ExtractedConversation` with structured `messages`.
- Added support for `ENABLED_EXPORTERS` environment variable.
- Provided a `custom-exporter.ts-example` for users.
- Ensured all new files follow kebab-case naming convention.

Co-authored-by: simwai <16225108+simwai@users.noreply.github.com>
- Added `ConversationExporter` interface in `exporter.interface.ts`.
- Refactored `FileWriter` to dynamically discover exporters using `.exporter.ts` pattern.
- Implemented `markdown.exporter.ts` as the default output format.
- Enhanced `ExtractedConversation` with structured `messages` array.
- Added support for `ENABLED_EXPORTERS` environment variable.
- Provided a `custom.exporter.ts.example` for plugin developers.
- Maintained kebab-case for core files while using dot notation for plugin discovery.

Co-authored-by: simwai <16225108+simwai@users.noreply.github.com>
- Added `ConversationExporter` interface in `exporter.interface.ts` with `serialize` method.
- Refactored `FileWriter` to dynamically discover and load exporters from `src/exporters/`.
- Migrated default Markdown formatting to `markdown.exporter.ts`.
- Enhanced `ExtractedConversation` with a structured `messages` array for improved serialization.
- Introduced `ENABLED_EXPORTERS` env var for granular plugin activation.
- Provided `custom.exporter.ts.example` for community extensions.
- Replaced reserved-keyword-adjacent identifiers (`serialize` instead of `export`, `exporterModule` instead of `module`).
- Ensured kebab-case for core files while utilizing dot notation for plugin discovery.

Co-authored-by: simwai <16225108+simwai@users.noreply.github.com>
- Introduced `ExportOrchestrator` to replace the hardcoded `FileWriter`.
- Added `ExportStrategy` interface for dynamic output format registration.
- Migrated default Markdown logic to `markdown.strategy.ts`.
- Enhanced `ExtractedConversation` with structured `messages` array.
- Enabled granular activation via `ENABLED_STRATEGIES` environment variable.
- Provided a `custom.strategy.ts.example` for CSV/JSON plugin development.
- Adhered to Uncle Bob's Clean Code naming principles and project file conventions.
- Renamed identifiers to avoid collision with reserved keywords.

Co-authored-by: simwai <16225108+simwai@users.noreply.github.com>
- Introduced `ExportOrchestrator` and `ExportStrategy` (Clean Code naming).
- Dynamic plugin discovery for `*.strategy.ts` files in `src/exporters/`.
- Enhanced `ExtractedConversation` with structured `messages` array.
- Renamed `ENABLED_STRATEGIES` to `EXPORT_STRATEGIES` for better clarity.
- Migrated default Markdown logic to a built-in strategy.
- Provided documentation and CSV example for custom strategies.
- Ensured keyword-safe identifiers and kebab-case file naming (with dot notation for plugins).

Co-authored-by: simwai <16225108+simwai@users.noreply.github.com>
- Replaced `FileWriter` with `ExportOrchestrator` using Strategy pattern.
- Dynamic discovery for `*.strategy.ts` plugins in `src/exporters/`.
- Modernized path resolution using `import.meta.dirname` and `import path from 'node:path'`.
- Enhanced `ExtractedConversation` with structured `messages` array.
- Configurable activation via `EXPORT_STRATEGIES` environment variable.
- Clean Code naming conventions (Uncle Bob) applied codebase-wide.
- Keyword-safe identifiers and automated bash-based renamings.

Co-authored-by: simwai <16225108+simwai@users.noreply.github.com>
- Introduced `ExportOrchestrator` and `ExportStrategy` (Uncle Bob naming).
- Dynamic discovery for plugins using modern `import.meta.dirname`.
- Replaced `FileWriter` with an extensible Strategy pattern.
- Enhanced `ExtractedConversation` with structured `messages`.
- Refactored all path resolutions to use named imports (`join`, `resolve`, `dirname`).
- Configurable via `EXPORT_STRATEGIES` environment variable.
- Improved error handling and file integrity checks.
- Comprehensive documentation and CSV plugin example.

Co-authored-by: simwai <16225108+simwai@users.noreply.github.com>
- Introduced `ExportOrchestrator` and `ExportStrategy` using Strategy pattern.
- Dynamic plugin discovery in `src/exporters/` using `import.meta.dirname`.
- Enhanced `ExtractedConversation` with structured `messages` array.
- Refactored all path resolutions to use named imports (`join`, `resolve`, `dirname`).
- Configurable via `EXPORT_STRATEGIES` environment variable.
- Follows Clean Code naming principles (nouns for classes, verbs for methods).
- Keyword-safe identifiers and automated variable renamings.
- Verified zero circular dependencies with Madge.

Co-authored-by: simwai <16225108+simwai@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant