Skip to content
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

feat(katana): extract RpcOptions from ServerOptions #3084

Merged
merged 8 commits into from
Mar 11, 2025
Merged

Conversation

notV4l
Copy link
Collaborator

@notV4l notV4l commented Mar 7, 2025

Summary by CodeRabbit

  • New Features
    • Introduced dedicated RPC configuration options that allow users to customize HTTP modules and connection parameters independently.
    • Enhanced the configuration merging process to provide improved default values and seamless integration when using a configuration file.
    • Added support for SQL-related command-line arguments and configuration options, enhancing the application's configurability.
    • Introduced new modules for resources, tools, and types within the MCP package, promoting organized code structure.
    • Enhanced the Relay functionality to manage peer connections effectively and improve message handling.
    • Added new constants and methods for improved handling of JSON-RPC messages and server-sent events (SSE).
    • Added a new optional field to support RPC options in the node configuration, now always present regardless of feature flags.
    • Updated command-line interface to recognize http.api as an alternative to rpc.api for specifying modules.

@notV4l notV4l changed the title [katana] extract RpcOptions from ServerOptions feat(katana) extract RpcOptions from ServerOptions Mar 7, 2025
@notV4l notV4l changed the title feat(katana) extract RpcOptions from ServerOptions feat(katana): extract RpcOptions from ServerOptions Mar 7, 2025
Copy link

coderabbitai bot commented Mar 7, 2025

Ohayo sensei! Below is the detailed breakdown of the pull request:

Walkthrough

This PR involves the removal of the conditional compilation attribute #[cfg(feature = "server")] from the rpc_config method in the NodeArgs implementation, allowing it to be executed regardless of the server feature's status. The rpc field in the NodeArgsConfig struct is now always present, and the handling of HTTP configuration has been adjusted to provide default values when the server feature is not enabled. Additionally, new fields and methods related to SQL options and peer management have been introduced across various modules.

Changes

File(s) Change Summary
crates/katana/cli/src/args.rs Removed conditional compilation from rpc_config method in NodeArgs, making it always executable.
crates/katana/cli/src/file.rs Modified NodeArgsConfig to always include rpc: Option<RpcOptions>; updated conversion logic for NodeArgs to NodeArgsConfig.
crates/katana/cli/src/options.rs Removed conditional compilation from several functions and struct definitions in RpcOptions, making them always available.
Cargo.toml Added new dependency torii-mcp = { path = "crates/torii/mcp" }.
crates/torii/cli/src/args.rs Added public field sql: SqlOptions to ToriiArgs; added optional field sql: Option<SqlOptions> to ToriiArgsConfig.
crates/torii/cli/src/options.rs Introduced SqlOptions struct; added peers: Vec<String> to RelayOptions; added fields to SqlOptions.
crates/torii/libp2p/Cargo.toml Updated features and dependencies, adding libp2p-webrtc and rand.
crates/torii/libp2p/src/client/mod.rs Enhanced transport configurations for RelayClient in both non-WASM and WASM targets.
crates/torii/libp2p/src/constants.rs Added new constant PEERS_MESSAGING_TOPIC.
crates/torii/libp2p/src/server/mod.rs Added new_with_peers method to Relay struct; updated existing new method to initialize with an empty vector for peers.
crates/torii/mcp/Cargo.toml Introduced new Cargo.toml for torii-mcp with dependencies.
crates/torii/mcp/src/lib.rs Added new public modules: resources, tools, and types.
crates/torii/mcp/src/resources/mod.rs Introduced Resource struct and get_resources function.
crates/torii/mcp/src/tools/mod.rs Added Tool struct and get_tools function.
crates/torii/mcp/src/tools/query.rs Implemented SQL query execution functionality with structured error handling.
crates/torii/mcp/src/tools/schema.rs Added functionality for retrieving database schema in a JSON-RPC context.
crates/torii/mcp/src/types/mod.rs Introduced structures and enums for handling JSON-RPC messages.
crates/torii/runner/src/lib.rs Updated Runner to use new SqlConfig and new_with_peers method.
crates/torii/server/Cargo.toml Added new dependencies: torii-mcp, tokio-stream, and uuid.
crates/torii/server/src/handlers/mcp.rs Refactored McpHandler to simplify JSON-RPC handling and added new methods for resource and SSE connections.
crates/torii/server/src/handlers/sql.rs Removed map_row_to_json function and updated imports.
crates/torii/sqlite/src/lib.rs Introduced SqlConfig struct and updated Sql methods for better configuration management.
crates/torii/sqlite/src/types.rs Added new struct ModelIndices for handling model indices.
crates/torii/sqlite/src/utils.rs Introduced map_row_to_json function for converting SQLite rows to JSON values.
crates/torii/libp2p/src/test.rs Adjusted sleep durations in the test_client_messaging function to modify the timing of operations.
crates/dojo/bindgen/src/plugins/typescript/generator/enum.rs Added methods for generating TypeScript enum definitions and introduced a new dependency on convert_case.
crates/dojo/bindgen/src/plugins/typescript/generator/mod.rs Introduced functions to check for inner composite types and custom enums, enhancing token handling logic.

Possibly related PRs

  • fix(katana-cli): ensure compilation without server feature #2896: The changes in the main PR are related to the modifications in the rpc_config method in the NodeArgs implementation, as both PRs involve adjustments to the handling of server-related features and the conditional compilation logic in the same file.
  • feat(torii): update cli to match katana's #2672: The changes in the main PR, which involve modifications to the rpc_config method in NodeArgs, are related to the adjustments made in the retrieved PR regarding the handling of server options in the Args struct, as both involve restructuring command-line argument handling for server-related configurations.
  • fix(katana): merging server args from file #3044: The changes in the main PR are related to those in the retrieved PR as both modify the rpc_config method in the NodeArgs implementation, focusing on the handling of server configuration options.

Suggested reviewers

  • kariy

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (1)
crates/katana/cli/src/args.rs (1)

253-253: Consider moving CORS origins to RpcOptions as well.

While you've migrated most RPC-related configurations, CORS origins are still accessed from self.server. For complete separation of concerns, consider moving this field to the RpcOptions struct in a future update.

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro (Legacy)

📥 Commits

Reviewing files that changed from the base of the PR and between 85aa3e3 and 0bcf892.

📒 Files selected for processing (1)
  • crates/katana/cli/src/args.rs (5 hunks)
🔇 Additional comments (6)
crates/katana/cli/src/args.rs (6)

106-108: Ohayo! The separation of RPC options looks good.

Adding a dedicated RpcOptions struct helps maintain a clear separation of concerns between server configuration and RPC-specific functionality, making the codebase more modular and maintainable.


230-230: Nice migration from server to rpc options, sensei!

The code now correctly uses self.rpc.http_modules instead of self.server.http_modules, maintaining functionality while improving the architecture.


278-284: Great migration of RPC parameters, sensei!

You've correctly updated all the relevant parameters to reference the new rpc field instead of server, which aligns with the separation of concerns.


433-433: Properly handling config file merging - ohayo!

Added the necessary merge call for the new RPC options when loading from a config file.


716-723: Test documentation updated correctly!

The test comments have been updated to reflect the new command structure with --rpc.api instead of the previous naming.


731-731: Accurate test case update!

The error test case has been properly migrated to use the new --rpc.api parameter naming.

Copy link

codecov bot commented Mar 7, 2025

Codecov Report

Attention: Patch coverage is 67.85714% with 18 lines in your changes missing coverage. Please review.

Project coverage is 57.22%. Comparing base (2cc5eab) to head (6598e79).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
crates/katana/cli/src/options.rs 19.04% 17 Missing ⚠️
crates/katana/cli/src/file.rs 0.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3084   +/-   ##
=======================================
  Coverage   57.22%   57.22%           
=======================================
  Files         446      446           
  Lines       60547    60564   +17     
=======================================
+ Hits        34648    34658   +10     
- Misses      25899    25906    +7     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Collaborator

@glihm glihm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, @kariy when talking with @notV4l the idea of that is to ensure the different RPC options are modifiable from the configuration without impacting internal deployments.

I'll update slot CLI on this once validated here. 👍

/// API's offered over the HTTP-RPC interface.
#[arg(long = "http.api", value_name = "MODULES")]
#[arg(long = "rpc.api", value_name = "MODULES", alias = "http.api")]
Copy link
Member

@kariy kariy Mar 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added an alias here to make sure it's backward compatible. We may remove it in the future.

@glihm
Copy link
Collaborator

glihm commented Mar 11, 2025

Fixing the Torii test issue.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Inline review comments failed to post. This is likely due to GitHub's limits when posting large numbers of comments. If you are seeing this consistently it is likely a permissions issue. Please check "Moderation" -> "Code review limits" under your organization settings.

Actionable comments posted: 3

🧹 Nitpick comments (17)
crates/torii/mcp/src/resources/mod.rs (1)

6-8: Consider adding documentation for future resources, sensei!

The get_resources() function currently returns an empty vector with a comment indicating resources can be added later. Consider adding a doc comment to explain how resources should be structured when added in the future.

+/// Returns a list of available resources.
+/// 
+/// This function will be populated with resources as they are implemented.
 pub fn get_resources() -> Vec<Resource> {
     vec![] // Add resources as needed
 }
crates/torii/mcp/src/tools/mod.rs (1)

13-15: Simple tool aggregation - nice approach!

The current implementation works well for the current set of tools. For future extensibility, you might consider implementing a registry pattern if the number of tools grows significantly.

-pub fn get_tools() -> Vec<Tool> {
-    vec![query::get_tool(), schema::get_tool()]
-}
+pub fn get_tools() -> Vec<Tool> {
+    // This approach scales better when adding many tools
+    let mut tools = Vec::new();
+    tools.push(query::get_tool());
+    tools.push(schema::get_tool());
+    // Easy to add more tools here
+    tools
+}
crates/torii/mcp/src/tools/schema.rs (2)

33-51: Refactor duplicate SQL queries

Ohayo! I notice the schema queries in the match arms are almost identical, with only the WHERE clause for table filtering being different. Consider refactoring to reduce duplication:

- let schema_query = match table_filter {
-    Some(_table) => "SELECT 
-            m.name as table_name,
-            p.* 
-        FROM sqlite_master m
-        JOIN pragma_table_info(m.name) p
-        WHERE m.type = 'table'
-        AND m.name = ?
-        ORDER BY m.name, p.cid"
-        .to_string(),
-    _ => "SELECT 
-            m.name as table_name,
-            p.* 
-        FROM sqlite_master m
-        JOIN pragma_table_info(m.name) p
-        WHERE m.type = 'table'
-        ORDER BY m.name, p.cid"
-        .to_string(),
-};
+ let mut schema_query = "SELECT 
+         m.name as table_name,
+         p.* 
+     FROM sqlite_master m
+     JOIN pragma_table_info(m.name) p
+     WHERE m.type = 'table'".to_string();
+ 
+ if table_filter.is_some() {
+     schema_query.push_str("\n        AND m.name = ?");
+ }
+ 
+ schema_query.push_str("\n    ORDER BY m.name, p.cid");

This makes the code more maintainable and reduces duplication.


53-56: Consider table name validation

Sensei, while using parameterized queries is good for preventing SQL injection, it would be even better to validate the table name parameter. SQLite table names follow specific rules, and validating the input would provide an additional layer of security.

Consider adding a validation check for the table name before executing the query.

crates/torii/sqlite/src/utils.rs (1)

189-228: Well-implemented row to JSON conversion with improvement opportunities

Nice implementation of the SQLite row to JSON conversion! The function handles different data types appropriately and includes fallback mechanisms.

Consider these improvements:

  1. Error handling: Replace unwrap() with proper error handling to prevent potential panics:
- let table_name: String = row.try_get("table_name").unwrap();
+ let table_name: String = row.try_get("table_name")
+     .map_err(|e| format!("Failed to get table_name: {}", e))?;
  1. Type fallback optimization: The fallback type handling could be simplified using a helper function:
fn get_value_as_json<T: serde::Serialize>(row: &sqlx::sqlite::SqliteRow, i: usize) -> serde_json::Value 
where 
    T: for<'a> sqlx::decode::Decode<'a, sqlx::sqlite::Sqlite> + sqlx::types::Type<sqlx::sqlite::Sqlite>
{
    match row.try_get::<T, _>(i) {
        Ok(val) => serde_json::to_value(val).unwrap_or(serde_json::Value::Null),
        Err(_) => serde_json::Value::Null,
    }
}

This would make the fallback section cleaner and more maintainable.

crates/torii/sqlite/src/lib.rs (5)

51-51: Ohayo sensei! Include a note on mutability constraints.

Storing config within Sql is convenient but be mindful when performing updates at runtime, as concurrency handling might be required if the configuration changes.


759-769: Ohayo sensei! Single source of truth for is_key.

When invoking add_columns_recursive with false, ensure that keys are consistently handled later, to avoid hidden indexing issues.


805-815: Ohayo sensei! This function is large and intricate.

A single method with multiple nested match arms can grow complex. Consider splitting out smaller helper functions for readability.


901-934: Ohayo sensei! Decomposition for tuple elements.

Index-based naming can sometimes confuse debugging. Document the generated columns or add logs for clarity.


935-1009: Ohayo sensei! Pay attention to Ty::Enum constraints.

Your custom check constraints are helpful, but dynamic expansions of permissible enum variants might break older data rows if not carefully tested.

crates/torii/libp2p/src/server/mod.rs (2)

86-96: Ohayo sensei! The peers parameter helps with auto-dialing.

Dialing known peers on initialization fosters immediate connectivity. Just consider a fallback if a peer is offline.


365-372: Ohayo sensei! Logging invalid signatures as a warning.

A crisp separation of message authenticity from normal flow. Just ensure repeated invalid submissions aren’t spammy.

crates/torii/server/src/handlers/mcp.rs (3)

59-70: Ohayo sensei! Enhanced handle_initialize includes resource subscription capabilities.

Advertising features in capabilities ensures better client discovery. Keep the version info updated.


136-155: Ohayo sensei! Solid SSE session creation.

Generating a unique session ID with Uuid is a good pattern. Just be mindful of session cleanup if a client disconnects.


308-341: Ohayo sensei! Unified SSE and regular requests in handle method.

Graceful fallback to SSE or normal route. This is neat. Confirm timeouts or keep-alive pings if sessions remain idle.

crates/torii/mcp/src/types/mod.rs (2)

25-30: Ohayo sensei, consider consistent naming for notification fields.

The fields _jsonrpc, _method, and _params with leading underscores may cause confusion about intended usage. If they’re truly needed, consider removing the underscore or adding a brief comment clarifying their purpose.


73-78: Ohayo sensei, consider clarifying the session identifier usage.

_session_id indicates it might be unused or only for logging/debugging. If necessary, rename it or add a brief doc comment clarifying its purpose.

🛑 Comments failed to post (3)
crates/torii/runner/src/lib.rs (1)

153-158: 🛠️ Refactor suggestion

Ohayo sensei! Consider enforcing exclusive usage.
When all_model_indices is true, specifying specific model_indices can cause confusion. Either override them automatically or prompt the user.

 if self.args.sql.all_model_indices && self.args.sql.model_indices.is_some() {
     warn!(
         target: LOG_TARGET,
         "all_model_indices is true, which will override any specific indices in model_indices"
     );
+    // Possibly clear self.args.sql.model_indices to avoid confusion
+    // self.args.sql.model_indices = None;
 }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

        if self.args.sql.all_model_indices && self.args.sql.model_indices.is_some() {
            warn!(
                target: LOG_TARGET,
                "all_model_indices is true, which will override any specific indices in model_indices"
            );
            // Possibly clear self.args.sql.model_indices to avoid confusion
            // self.args.sql.model_indices = None;
        }
crates/torii/libp2p/src/server/mod.rs (1)

194-198: 🛠️ Refactor suggestion

Ohayo sensei! swarm.dial(peer.parse()?); usage.

Safe unwrapping can crash if parse fails. Consider more explicit error checks to avoid runtime panic.

- swarm.dial(peer.parse::<Multiaddr>().unwrap())?;
+ if let Ok(addr) = peer.parse::<Multiaddr>() {
+     swarm.dial(addr)?;
+ } else {
+     warn!("Failed to parse peer multiaddr: {}", peer);
+ }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

        // We dial all of our peers. Our server will then broadcast
        // all incoming offchain messages to all of our peers.
        for peer in peers {
            if let Ok(addr) = peer.parse::<Multiaddr>() {
                swarm.dial(addr)?;
            } else {
                warn!("Failed to parse peer multiaddr: {}", peer);
            }
        }
crates/torii/server/src/handlers/mcp.rs (1)

287-299: 🛠️ Refactor suggestion

Ohayo sensei! Reading resources stub.

Currently defaults to method_not_found. Ensure future expansions handle reading logic or partial errors gracefully.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (1)
crates/katana/cli/src/args.rs (1)

230-230: Ohayo sensei! Potential duplication in module assignment.

Line 230 redefines a local modules variable in rpc_config. Ensure there's no unintentional shadowing or confusion with the existing code.

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro (Legacy)

📥 Commits

Reviewing files that changed from the base of the PR and between 9a35161 and 6598e79.

📒 Files selected for processing (11)
  • crates/katana/cli/src/args.rs (4 hunks)
  • crates/katana/cli/src/file.rs (2 hunks)
  • crates/katana/cli/src/options.rs (3 hunks)
  • crates/katana/cli/src/args.rs (1 hunks)
  • crates/katana/cli/src/args.rs (0 hunks)
  • crates/katana/cli/src/options.rs (1 hunks)
  • crates/dojo/bindgen/src/plugins/typescript/generator/enum.rs (6 hunks)
  • crates/dojo/bindgen/src/plugins/typescript/generator/mod.rs (1 hunks)
  • crates/katana/cli/src/args.rs (3 hunks)
  • crates/katana/cli/src/file.rs (2 hunks)
  • crates/katana/cli/src/options.rs (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (7)
  • crates/katana/cli/src/file.rs
  • crates/katana/cli/src/options.rs
  • crates/katana/cli/src/args.rs
  • crates/katana/cli/src/args.rs
  • crates/katana/cli/src/args.rs
  • crates/katana/cli/src/file.rs
  • crates/katana/cli/src/options.rs
🔇 Additional comments (16)
crates/katana/cli/src/args.rs (2)

106-109: Ohayo sensei! New rpc field introduced under feature flag.

This addition looks correct for separating RPC-specific configurations. Verify that usage outside of server feature is handled or guarded properly.

Do you need any additional checks for scenarios when #[cfg(feature = "server")] is not enabled?


278-285: Ohayo sensei! Confirm defaults are handled properly.

You're assigning these RPC-related configs as Some(...). If users don't provide values, these fields might remain at their defaults. Double-check that the rest of the code properly handles None vs. Some(0 or default).

crates/dojo/bindgen/src/plugins/typescript/generator/mod.rs (2)

51-60: Ohayo sensei! Mind potential deep nesting.

token_has_inner_composite checks for one level of array/tuple. For arrays of arrays, ensure to_composite() recursion covers deeper nesting if needed.


68-73: Ohayo sensei! Straightforward enum detection.

token_is_custom_enum logic is concise and correct. Nicely done.

crates/katana/cli/src/options.rs (5)

102-114: Ohayo sensei! Removal of ServerOptions default implementation.

Confirm if removing or altering the Default trait won’t break external code that may rely on it.


115-130: Ohayo sensei! Verify removal of merge in ServerOptions.

Double-check existing callers of merge to ensure no breakage occurs.


132-141: Ohayo sensei! New RpcOptions structure.

This new struct effectively separates RPC concerns. The approach looks good.


174-176: Ohayo sensei! Double-check uninitialized fields in Default.

max_request_body_size and max_response_body_size might need defaults for consistency.


189-209: Ohayo sensei! Partial merge could lead to leftover defaults.

If the caller sets certain fields but not others, confirm that the final result is intentional. Great approach for a flexible configuration, though.

crates/dojo/bindgen/src/plugins/typescript/generator/enum.rs (7)

2-2: Ohayo sensei, new dependency usage recognized.
The newly introduced convert_case crate enables standardized naming conventions across your generated code. Good stuff!


5-5: Ohayo sensei, imports look on point.
Bringing in token_is_custom_enum and token_is_enum aligns nicely with the upcoming logic updates.


26-45: Ohayo sensei, your generate_simple_enum method is tidy.
Its straightforward design for enumerating variants into a TypeScript array and type meets the goal neatly.


47-78: Ohayo sensei, the generate_custom_enum method is equally robust.
Handling each variant’s typed data paves the way for more flexible enum structures in TypeScript.


79-90: Ohayo sensei, the logic in generate is smooth sailing.
Neatly checks for enum-type composites and routes to the correct generation function, preventing duplication.


176-190: Ohayo sensei, test_custom_enum is comprehensive.
The test effectively ensures correctness of the generated definitions, confirming your new function’s behavior.


220-254: Ohayo sensei, create_custom_enum_token is a solid test fixture.
This function nicely demonstrates nested enum tokens and ensures your generator can handle deeper structures.

@glihm glihm merged commit 649cc54 into main Mar 11, 2025
16 checks passed
@glihm glihm deleted the katana_rpc_options branch March 11, 2025 18:13
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.

3 participants