-
Notifications
You must be signed in to change notification settings - Fork 83
Feature/firebender support #249
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
Feature/firebender support #249
Conversation
Introduces the FirebenderAgent implementation, updates agent registry, and documents Firebender usage in the README. Includes unit tests for FirebenderAgent and minor type fix in propagateOpenHandsMcp.
Introduces handling of MCP server configuration in FirebenderAgent, allowing merging or overwriting of MCP servers in firebender.json based on strategy. Updates support flags for MCP, adds related methods, and provides comprehensive unit tests for MCP configuration scenarios.
Introduced explicit TypeScript interfaces for Firebender and OpenHands configuration structures to improve type safety and code clarity. Updated method signatures and internal logic in FirebenderAgent and propagateOpenHandsMcp to use these new types.
@barisatalay why the change to |
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.
Pull Request Overview
Adds Firebender agent support, enabling Ruler to generate and manage firebender.json, including rules and MCP server configuration. Key changes:
- New FirebenderAgent with rule processing, MCP merge/overwrite strategies, and file operations (backups, custom paths).
- Registration of FirebenderAgent and documentation updates to include it in CLI options and usage.
- Type-safety refactor in propagateOpenHandsMcp via an OpenHandsConfig interface.
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 5 comments.
Show a summary per file
File | Description |
---|---|
src/agents/FirebenderAgent.ts | Implements FirebenderAgent: rules parsing, deduplication, MCP server merge/overwrite, backups, output path resolution. |
tests/unit/agents/FirebenderAgent.test.ts | Unit tests covering rules (plain and file-based), deduplication, MCP strategies, backups, and malformed JSON handling. |
src/agents/index.ts | Registers FirebenderAgent in the agent registry. |
src/mcp/propagateOpenHandsMcp.ts | Introduces OpenHandsConfig and uses it for config parsing. |
README.md | Documents Firebender agent, CLI usage, and availability in --agents and revert lists. |
@barisatalay also why so much new code in |
@barisatalay also see the comments from Copilot, they are all valid (except for one that I resolved). |
refactor: rollback propagateOpenHandsMcp development
You’re right, that was my mistake — I rolled it back.
Thanks for highlighting these, I’ll go ahead and fix them 👍
Actually "AbstractAgent" is really good but in "Firebender" rule definition and mcp definition system is a little more complicated than other tools. For example: All definitions in one
Thanks for pointing this out — there might be things I’ve overlooked, and your feedback is really valuable 🙏 |
Updated the Firebender configuration file path from `.firebender.json` to `firebender.json` in the documentation for accuracy.
Previously, object rules were deduplicated only by rulesPaths, causing valid distinct rules with different filePathMatches to be incorrectly removed. Now uses `filePathMatches::rulesPaths` composite key. Includes test case for the fix.
…adFile Use async I/O with ENOENT handling instead of existsSync/readFileSync for better consistency and non-blocking operations.
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.
Pull Request Overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
Prevent malicious HTML comments from accessing files outside project directory via path traversal attacks.
Replace unsafe type assertion with type guard function Add isFirebenderRule() for safe FirebenderRule validation Addresses PR review feedback on type checking
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.
Pull Request Overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
Co-authored-by: Copilot <[email protected]>
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.
Pull Request Overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated 5 comments.
This pull request adds support for the Firebender agent to the project, allowing Ruler to generate and manage configuration for Firebender via a new adapter. It updates documentation, the agent registry, and includes comprehensive unit tests to ensure correct behavior for rule processing, MCP server configuration, and file operations.
Firebender: https://firebender.com/
Docs: https://docs.firebender.com/context/configurations
Firebender agent support:
FirebenderAgent
class insrc/agents/FirebenderAgent.ts
that implements theIAgent
interface. This agent generates and updatesfirebender.json
with rules and MCP server configuration, supports merging or overwriting MCP servers, and handles both plain text and file-based rules.src/agents/index.ts
) by importing and addingFirebenderAgent
to theallAgents
array. [1] [2]Documentation updates:
README.md
to document Firebender as a supported agent, including its output file, usage in--agents
, and example commands for applying rules to Firebender. [1] [2] [3] [4]Testing and robustness:
FirebenderAgent
intests/unit/agents/FirebenderAgent.test.ts
, covering rule creation, merging, deduplication, MCP configuration strategies, file operations, and error handling.Type safety improvements:
OpenHandsConfig
interface insrc/mcp/propagateOpenHandsMcp.ts
and using it for config parsing. [1] [2]Implementation
Identifier: firebender
Output file: firebender.json (in project root)
MCP support: Enabled (in firebender.json)
Usage
Users can now target the Firebender agent specifically:
The agent can also be configured in ruler.toml: