Skip to content

Added support for the JetBrains AI Assistant#241

Open
befresh-mweimerskirch wants to merge 3 commits intorobinebers:mainfrom
befresh-mweimerskirch:feature/jetbrains-ai-assistant
Open

Added support for the JetBrains AI Assistant#241
befresh-mweimerskirch wants to merge 3 commits intorobinebers:mainfrom
befresh-mweimerskirch:feature/jetbrains-ai-assistant

Conversation

@befresh-mweimerskirch
Copy link

@befresh-mweimerskirch befresh-mweimerskirch commented Feb 25, 2026

Description

This PR adds support for displaying the quota from the JetBrains AI Assistant.

Type of Change

  • Bug fix
  • New feature
  • New provider plugin
  • Documentation
  • Performance improvement
  • Other (describe below)

Testing

  • I ran bun run build and it succeeded
  • I ran bun run test and all tests pass
  • I tested the change locally with bun tauri dev

Screenshots

Screenshot 2026-02-25 at 20 18 35

Checklist

  • I read CONTRIBUTING.md
  • My PR targets the main branch
  • I did not introduce new dependencies without justification

Summary by cubic

Added a JetBrains AI Assistant provider plugin that reads the local IDE quota cache and shows quota, used, remaining, and reset timing.

  • New Features
    • Reads AIAssistantQuotaManager2.xml from JetBrains IDE config dirs on macOS, Linux, and Windows; refined macOS platform checks.
    • Picks the latest window; breaks ties by usage; fills missing fields.
    • Supports tariff/top-up buckets and converts JetBrains units (1e-5) to credits.
    • Shows Quota (percent with reset), Used, and Remaining; sets periodDurationMs when available.
    • Adds host.fs.listDir to the plugin API with safer error handling (throws on open, skips bad entries); updates docs and README.
    • Unit tests for parsing, scaling, path discovery (incl. Windows), duration parsing, and error cases.

Written for commit f56e13d. Summary will update on new commits.

@github-actions github-actions bot added rust Pull requests that update rust code plugin docs labels Feb 25, 2026
@befresh-mweimerskirch befresh-mweimerskirch force-pushed the feature/jetbrains-ai-assistant branch from 8bd336e to 5750ab4 Compare February 25, 2026 19:21
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

1 issue found across 9 files

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="plugins/jetbrains-ai-assistant/plugin.json">

<violation number="1" location="plugins/jetbrains-ai-assistant/plugin.json:7">
P3: plugin.json references icon.svg but there is no icon.svg in the plugin directory (or anywhere under plugins/), so the icon path will not resolve at runtime.</violation>
</file>

Since this is your first cubic review, here's how it works:

  • cubic automatically reviews your code and comments on bugs and improvements
  • Teach cubic by replying to its comments. cubic learns from your replies and gets better over time
  • Add one-off context when rerunning by tagging @cubic-dev-ai with guidance or docs links (including llms.txt)
  • Ask questions if you need clarification on any suggestion

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

davidarny
davidarny previously approved these changes Feb 25, 2026
Copy link
Collaborator

@davidarny davidarny left a comment

Choose a reason for hiding this comment

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

Thanks! LGTM!

Copy link
Contributor

Copilot AI left a 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 a new provider plugin to surface JetBrains AI Assistant quota by reading the local JetBrains IDE quota cache, and extends the plugin host filesystem API to support directory discovery needed for locating the quota file.

Changes:

  • Added jetbrains-ai-assistant provider plugin (implementation, manifest, icon) to parse AIAssistantQuotaManager2.xml and emit Quota/Used/Remaining lines.
  • Extended the plugin Host FS API with host.fs.listDir() and updated plugin API docs accordingly.
  • Added unit tests for parsing, selection logic, scaling, duration parsing, and error cases; documented the new provider and linked it from the README.

Reviewed changes

Copilot reviewed 8 out of 9 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
src-tauri/src/plugin_engine/host_api.rs Exposes host.fs.listDir() to plugins (with ~ expansion) to support filesystem discovery.
plugins/test-helpers.js Enhances test FS mocks to emulate directory existence and implement listDir() for plugin tests.
plugins/jetbrains-ai-assistant/plugin.test.js Adds Vitest coverage for parsing/selection/scaling/duration/error handling for the new plugin.
plugins/jetbrains-ai-assistant/plugin.json Registers the new provider plugin metadata and declared UI lines.
plugins/jetbrains-ai-assistant/plugin.js Implements JetBrains quota discovery + XML/JSON parsing and line generation.
plugins/jetbrains-ai-assistant/icon.svg Adds provider icon asset referenced by the plugin manifest.
docs/providers/jetbrains-ai-assistant.md Documents data sources, parsed fields, displayed lines, and error messages for the provider.
docs/plugins/api.md Documents the new host.fs.listDir() API and provides a usage example.
README.md Adds JetBrains AI Assistant to the list of supported providers.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Collaborator

@validatedev validatedev left a comment

Choose a reason for hiding this comment

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

LGTM!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs plugin rust Pull requests that update rust code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants