Skip to content

[Components] rumi_ai - new components #16950

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

jcortes
Copy link
Collaborator

@jcortes jcortes commented Jun 3, 2025

WHY

Resolves #16847

Summary by CodeRabbit

  • New Features
    • Introduced Rumi AI integration with multiple new actions for session creation, access management, AI querying, and retrieving session, meeting, and user data.
    • Added a new event source to detect completed sessions.
  • Chores
    • Updated dependencies and internal configuration for improved structure and compatibility.
    • Enhanced .gitignore to exclude additional files.

@jcortes jcortes self-assigned this Jun 3, 2025
Copy link

vercel bot commented Jun 3, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

3 Skipped Deployments
Name Status Preview Comments Updated (UTC)
docs-v2 ⬜️ Ignored (Inspect) Visit Preview Jun 9, 2025 0:08am
pipedream-docs ⬜️ Ignored (Inspect) Jun 9, 2025 0:08am
pipedream-docs-redirect-do-not-edit ⬜️ Ignored (Inspect) Jun 9, 2025 0:08am

Copy link
Contributor

coderabbitai bot commented Jun 3, 2025

"""

Walkthrough

This update introduces a comprehensive Rumi AI integration, adding new actions for session creation, access management, AI queries, session retrieval, and meeting type listing. It also implements a polling source for completed sessions, enhances the app module with extensive property definitions and API methods, and updates package dependencies and configuration.

Changes

File(s) Change Summary
.gitignore Added .cursor to ignored files.
components/rumi_ai/actions/add-session-access/...
remove-session-access/...
Added actions to add or remove user access to sessions.
components/rumi_ai/actions/create-session/... Added action to create a new session/meeting.
components/rumi_ai/actions/ai-stream-query/... Added action to send streaming AI queries.
components/rumi_ai/actions/get-current-user/... Added action to retrieve current authenticated user info.
components/rumi_ai/actions/get-future-sessions/...
get-past-sessions/...
Added actions to retrieve future and past sessions.
components/rumi_ai/actions/get-memory-threads/... Added action to retrieve AI memory threads.
components/rumi_ai/actions/get-meeting-types/... Added action to retrieve available meeting types.
components/rumi_ai/common/constants.mjs Introduced a constants module with DEFAULT_LIMIT.
components/rumi_ai/package.json Updated version, added @pipedream/platform dependency, fixed JSON structure.
components/rumi_ai/rumi_ai.app.mjs Expanded with detailed prop definitions and full API client implementation for all required endpoints.
components/rumi_ai/sources/new-session-completed/... Added polling source to emit events for newly completed sessions.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant Action
    participant RumiAIApp
    participant RumiAIAPI

    User->>Action: Trigger action (e.g., create session)
    Action->>RumiAIApp: Call method with parameters
    RumiAIApp->>RumiAIAPI: Make HTTP request
    RumiAIAPI-->>RumiAIApp: Return response
    RumiAIApp-->>Action: Return processed data
    Action-->>User: Output summary/response
Loading
sequenceDiagram
    participant Source
    participant RumiAIApp
    participant RumiAIAPI
    participant EventStream

    Source->>RumiAIApp: Poll getPastSessions
    RumiAIApp->>RumiAIAPI: HTTP GET /sessions/past
    RumiAIAPI-->>RumiAIApp: Return sessions
    RumiAIApp-->>Source: Sessions data
    Source->>EventStream: Emit event for each new session
Loading

Assessment against linked issues

Objective Addressed Explanation
Implement create-session action (16847)
Implement ai-stream-query action (16847)
Implement add-session-access and remove-session-access actions (16847)
Implement get-past-sessions, get-future-sessions, get-memory-threads, get-meeting-types actions (16847)
Implement polling source for completed sessions (new-past-session) (16847)

Assessment against linked issues: Out-of-scope changes

No out-of-scope changes were found.

Poem

In the warren of code, new features appear,
Rumi AI actions—now crystal clear!
Sessions created, memories retrieved,
Access controlled, and meetings conceived.
With every poll, a session’s tale—
This bunny hops, leaving a sparkling trail!
🐇✨
"""

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

components/rumi_ai/actions/add-session-access/add-session-access.mjs

Oops! Something went wrong! :(

ESLint: 8.57.1

Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'jsonc-eslint-parser' imported from /eslint.config.mjs
at Object.getPackageJSONURL (node:internal/modules/package_json_reader:255:9)
at packageResolve (node:internal/modules/esm/resolve:767:81)
at moduleResolve (node:internal/modules/esm/resolve:853:18)
at defaultResolve (node:internal/modules/esm/resolve:983:11)
at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:799:12)
at #cachedDefaultResolve (node:internal/modules/esm/loader:723:25)
at ModuleLoader.resolve (node:internal/modules/esm/loader:706:38)
at ModuleLoader.getModuleJobForImport (node:internal/modules/esm/loader:307:38)
at #link (node:internal/modules/esm/module_job:170:49)


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 56fc253 and 96490a7.

📒 Files selected for processing (1)
  • components/rumi_ai/actions/add-session-access/add-session-access.mjs (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • components/rumi_ai/actions/add-session-access/add-session-access.mjs
⏰ Context from checks skipped due to timeout of 90000ms (4)
  • GitHub Check: Publish TypeScript components
  • GitHub Check: pnpm publish
  • GitHub Check: Lint Code Base
  • GitHub Check: Verify TypeScript components
✨ Finishing Touches
  • 📝 Generate Docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 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.
    • Explain this complex logic.
    • 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 explain this code block.
    • @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 explain its main purpose.
    • @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.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

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 generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this 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.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

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
Contributor

@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: 8

🧹 Nitpick comments (6)
.gitignore (1)

23-24: Add .cursor ignore entry
This entry prevents committing local .cursor files (likely transient cursor state). Consider adding a brief comment to explain what tool generates these files and grouping this pattern with other editor/runtime artifacts (e.g., .vercel, .eslintcache) for consistency.

components/rumi_ai/actions/get-memory-threads/get-memory-threads.mjs (1)

31-31: Improve error handling in summary export.

The summary export could fail if the response structure is unexpected. Consider using a fallback value.

-$.export("$summary", `Successfully retrieved \`${response?.data?.threads?.length}\` memory thread(s)`);
+$.export("$summary", `Successfully retrieved \`${response?.data?.threads?.length || 0}\` memory thread(s)`);
components/rumi_ai/actions/get-past-sessions/get-past-sessions.mjs (2)

20-21: Minor formatting inconsistency.

The destructuring formatting differs slightly from the get-memory-threads action. Consider maintaining consistency.

-    const {
-      app, limit,
-    } = this;
+    const {
+      app,
+      limit,
+    } = this;

30-30: Improve error handling in summary export.

Same issue as in get-memory-threads - the summary export could fail if the response structure is unexpected.

-$.export("$summary", `Successfully retrieved \`${response?.data?.sessions?.length}\` past session(s)`);
+$.export("$summary", `Successfully retrieved \`${response?.data?.sessions?.length || 0}\` past session(s)`);
components/rumi_ai/actions/remove-session-access/remove-session-access.mjs (1)

43-43: Consider making the access type configurable.

The type: "email" is hardcoded, which may limit flexibility if the API supports other access types in the future.

Consider adding a prop for the access type:

+    accessType: {
+      type: "string",
+      label: "Access Type",
+      description: "The type of access rule to remove",
+      options: ["email"],
+      default: "email",
+    },

Then use it in the data payload:

-        type: "email",
+        type: accessType,
components/rumi_ai/actions/create-session/create-session.mjs (1)

89-104: Consider making hardcoded session settings configurable.

Several settings are hardcoded (dataVisibility, accessStatus, preferredLanguages, recurring, post-session recipients) which may limit flexibility.

Consider adding props for these settings to make the action more flexible:

+    dataVisibility: {
+      type: "string",
+      label: "Data Visibility",
+      description: "Session data visibility setting",
+      options: ["team-visible", "private", "public"],
+      default: "team-visible",
+    },
+    accessStatus: {
+      type: "string", 
+      label: "Access Status",
+      description: "Session access status",
+      options: ["unlocked", "locked"],
+      default: "unlocked",
+    },
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a7211d1 and 16807bc.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (14)
  • .gitignore (1 hunks)
  • components/rumi_ai/actions/add-session-access/add-session-access.mjs (1 hunks)
  • components/rumi_ai/actions/ai-stream-query/ai-stream-query.mjs (1 hunks)
  • components/rumi_ai/actions/create-session/create-session.mjs (1 hunks)
  • components/rumi_ai/actions/get-current-user/get-current-user.mjs (1 hunks)
  • components/rumi_ai/actions/get-future-sessions/get-future-sessions.mjs (1 hunks)
  • components/rumi_ai/actions/get-meeting-types/get-meeting-types.mjs (1 hunks)
  • components/rumi_ai/actions/get-memory-threads/get-memory-threads.mjs (1 hunks)
  • components/rumi_ai/actions/get-past-sessions/get-past-sessions.mjs (1 hunks)
  • components/rumi_ai/actions/remove-session-access/remove-session-access.mjs (1 hunks)
  • components/rumi_ai/common/constants.mjs (1 hunks)
  • components/rumi_ai/package.json (2 hunks)
  • components/rumi_ai/rumi_ai.app.mjs (1 hunks)
  • components/rumi_ai/sources/new-past-session/new-past-session.mjs (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (4)
  • GitHub Check: Verify TypeScript components
  • GitHub Check: pnpm publish
  • GitHub Check: Lint Code Base
  • GitHub Check: Publish TypeScript components
🔇 Additional comments (13)
components/rumi_ai/package.json (2)

3-3: LGTM: Appropriate version bump for new functionality.

The version bump from 0.0.1 to 0.1.0 correctly reflects the addition of new action components and expanded functionality.


15-17: LGTM: Standard Pipedream dependency addition.

The addition of @pipedream/platform dependency is necessary and correctly versioned for the new action components.

components/rumi_ai/common/constants.mjs (1)

1-5: LGTM: Well-structured constants module.

The implementation correctly centralizes the default limit constant and follows standard export conventions. The value of 20 is reasonable for API pagination.

components/rumi_ai/actions/get-memory-threads/get-memory-threads.mjs (1)

1-17: LGTM: Standard Pipedream action structure.

The action follows Pipedream conventions correctly with proper app integration, prop definitions, and documentation links.

components/rumi_ai/actions/get-past-sessions/get-past-sessions.mjs (1)

1-17: LGTM: Consistent action structure.

The action follows the same good patterns as other actions in this PR with proper Pipedream conventions.

components/rumi_ai/actions/add-session-access/add-session-access.mjs (1)

63-63: Good use of optional chaining.

The optional chaining (?.) in the summary export shows defensive programming practices, anticipating potential variations in the API response structure.

components/rumi_ai/actions/get-meeting-types/get-meeting-types.mjs (1)

1-22: LGTM! Well-structured action component.

The implementation follows Pipedream conventions correctly with proper use of safe navigation operators for defensive programming. The metadata and structure are consistent with standard action patterns.

components/rumi_ai/actions/get-current-user/get-current-user.mjs (1)

1-22: LGTM! Consistent action implementation.

The component follows the standard Pipedream action pattern with proper structure and metadata. The static summary message is appropriate for user information retrieval.

components/rumi_ai/sources/new-past-session/new-past-session.mjs (1)

1-40: LGTM! Well-implemented polling source component.

The source component correctly implements the polling pattern with:

  • Proper timer configuration using platform defaults
  • Safe data extraction with defensive programming
  • Correct event emission structure with unique IDs for deduplication
  • Appropriate use of session metadata for event summaries
components/rumi_ai/actions/get-future-sessions/get-future-sessions.mjs (1)

1-22: LGTM! Consistent with other session-related actions.

The implementation follows the established pattern with proper safe navigation for data extraction and dynamic summary generation. The structure is consistent with other actions in the Rumi AI integration.

components/rumi_ai/rumi_ai.app.mjs (3)

1-7: LGTM! Standard Pipedream app structure.

The imports and app initialization follow Pipedream conventions correctly.


131-167: Well-structured HTTP client implementation.

The HTTP helper methods follow good patterns with proper abstraction and OAuth authentication handling.


168-222: Clean and consistent API method implementations.

The API methods are well-organized with clear naming that indicates their purpose. They properly utilize the HTTP helper methods.

Copy link
Collaborator

@GTFalcao GTFalcao left a comment

Choose a reason for hiding this comment

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

Hi @jcortes , I left a few comments for you to check out - let me know if you agree!

Comment on lines 66 to 69
startDate,
startTime,
endDate,
endTime,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is there a reason to use separate props for date and time in this app? We normally do date-time strings in a single prop

accessRuleId: {
type: "string",
label: "Access Rule ID",
description: "The ID of the access rule to remove. This is given when you add access to a session.",
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can this use async options?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Unfortunately there is no api endpoint to support the async options here

Copy link
Contributor

@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: 3

♻️ Duplicate comments (4)
components/rumi_ai/rumi_ai.app.mjs (4)

56-56: Remove hardcoded default date that will become outdated.

The default value "2025-06-15T09:00:00" is hardcoded and will become outdated. This issue was flagged in previous reviews but remains unresolved.


62-62: Remove hardcoded default date that will become outdated.

The default value "2025-06-15T10:00:00" is hardcoded and will become outdated. This issue was flagged in previous reviews but remains unresolved.


95-103: Limited timezone coverage needs expansion.

The timezone options are still limited to only 7 entries, excluding many major global regions. This issue was flagged in previous reviews but remains unresolved.


105-110: JSON string array format creates poor user experience.

Requiring users to input JSON strings for sessions is still error-prone and inconvenient. This issue was flagged in previous reviews but remains unresolved.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 63d36b0 and 56fc253.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (14)
  • .gitignore (1 hunks)
  • components/rumi_ai/actions/add-session-access/add-session-access.mjs (1 hunks)
  • components/rumi_ai/actions/ai-stream-query/ai-stream-query.mjs (1 hunks)
  • components/rumi_ai/actions/create-session/create-session.mjs (1 hunks)
  • components/rumi_ai/actions/get-current-user/get-current-user.mjs (1 hunks)
  • components/rumi_ai/actions/get-future-sessions/get-future-sessions.mjs (1 hunks)
  • components/rumi_ai/actions/get-meeting-types/get-meeting-types.mjs (1 hunks)
  • components/rumi_ai/actions/get-memory-threads/get-memory-threads.mjs (1 hunks)
  • components/rumi_ai/actions/get-past-sessions/get-past-sessions.mjs (1 hunks)
  • components/rumi_ai/actions/remove-session-access/remove-session-access.mjs (1 hunks)
  • components/rumi_ai/common/constants.mjs (1 hunks)
  • components/rumi_ai/package.json (2 hunks)
  • components/rumi_ai/rumi_ai.app.mjs (1 hunks)
  • components/rumi_ai/sources/new-session-completed/new-session-completed.mjs (1 hunks)
✅ Files skipped from review due to trivial changes (2)
  • components/rumi_ai/package.json
  • components/rumi_ai/common/constants.mjs
🚧 Files skipped from review as they are similar to previous changes (10)
  • .gitignore
  • components/rumi_ai/actions/get-memory-threads/get-memory-threads.mjs
  • components/rumi_ai/actions/get-past-sessions/get-past-sessions.mjs
  • components/rumi_ai/actions/add-session-access/add-session-access.mjs
  • components/rumi_ai/actions/remove-session-access/remove-session-access.mjs
  • components/rumi_ai/actions/ai-stream-query/ai-stream-query.mjs
  • components/rumi_ai/actions/create-session/create-session.mjs
  • components/rumi_ai/actions/get-current-user/get-current-user.mjs
  • components/rumi_ai/actions/get-meeting-types/get-meeting-types.mjs
  • components/rumi_ai/actions/get-future-sessions/get-future-sessions.mjs
⏰ Context from checks skipped due to timeout of 90000ms (4)
  • GitHub Check: Publish TypeScript components
  • GitHub Check: pnpm publish
  • GitHub Check: Lint Code Base
  • GitHub Check: Verify TypeScript components
🔇 Additional comments (5)
components/rumi_ai/sources/new-session-completed/new-session-completed.mjs (1)

30-36: LGTM! Clean event emission logic.

The event emission logic correctly uses sessionID for deduplication, provides meaningful summaries with fallback to "Untitled", and uses the appropriate timestamp field.

components/rumi_ai/rumi_ai.app.mjs (4)

120-128: LGTM! Clean URL and header construction methods.

The URL construction and header management methods are well-implemented with proper authentication token handling.


129-137: LGTM! Well-structured centralized request method.

The _makeRequest method provides a clean abstraction for HTTP requests with proper URL and header construction.


138-155: LGTM! Appropriate HTTP method wrappers.

The POST, DELETE, and PUT method wrappers correctly delegate to the centralized request method with proper HTTP method specification.


192-196:

❓ Verification inconclusive

Verify AI streaming endpoint implementation.

The streamAiQuery method uses POST to /memory/ai-stream. Ensure this endpoint actually supports streaming responses and that callers handle the stream appropriately.


🏁 Script executed:

#!/bin/bash
# Search for usages of streamAiQuery to verify proper stream handling
ast-grep --pattern 'streamAiQuery($_)'

Length of output: 40


🏁 Script executed:

#!/bin/bash
# Find all usages of streamAiQuery in the codebase
rg "streamAiQuery" -R

# Locate the server-side implementation of the /memory/ai-stream endpoint
rg "/memory/ai-stream" -R

Length of output: 857


🏁 Script executed:

#!/bin/bash
# Search for usages of streamAiQuery in the repository
rg 'streamAiQuery'

# Search for references to the AI streaming endpoint path
rg '/memory/ai-stream'

# Look for server-side route definitions that handle ai-stream (e.g., Express, Next.js)
rg 'ai-stream' -A 3 -B 3 --glob '*.js'

Length of output: 326


#!/bin/bash
# Inspect the caller implementation of streamAiQuery
sed -n '1,200p' components/rumi_ai/actions/ai-stream-query/ai-stream-query.mjs

# Search for server route handling of ai-stream on all JS/MJS/TS files
rg "memory/ai-stream" --glob "*.{js,mjs,ts}"
rg "post.*memory/ai-stream" --glob "*.{js,mjs,ts}"

Confirm AI streaming endpoint /memory/ai-stream supports streaming

I didn’t find a server-side handler for this path in the repo—please verify that:

  • The backend route at /memory/ai-stream actually returns a streaming response (e.g., chunked or SSE)
  • The caller in components/rumi_ai/actions/ai-stream-query/ai-stream-query.mjs fully consumes the stream
  • Error and termination conditions are handled correctly

Key locations to review:

  • components/rumi_ai/rumi_ai.app.mjs → streamAiQuery(args = {})
  • components/rumi_ai/actions/ai-stream-query/ai-stream-query.mjs → usage of app.streamAiQuery
  • Server-side implementation of /memory/ai-stream (not found in JS/TS files)

luancazarine
luancazarine previously approved these changes Jun 6, 2025
Copy link
Collaborator

@luancazarine luancazarine left a comment

Choose a reason for hiding this comment

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

Hi @jcortes, LGTM! Ready for QA!

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.

[Components] rumi_ai
4 participants