Conversation
📝 WalkthroughWalkthroughThis PR bumps the package version from 0.8.4 to 0.8.5 across manifests, type definitions, and version constants. Export/import compatibility checks and tests are updated to recognize the new version. The changelog documents JSON-RPC transport fixes for notification handling and request ID validation. Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (2)
src/functions/export-import.ts (1)
178-178: Centralize supported export versions to prevent future drift.The inline version list works, but keeping this list in multiple files is error-prone.
♻️ Suggested refactor
- const supportedVersions = new Set(["0.3.0", "0.4.0", "0.5.0", "0.6.0", "0.6.1", "0.7.0", "0.7.2", "0.7.3", "0.7.4", "0.7.5", "0.7.6", "0.7.7", "0.7.9", "0.8.0", "0.8.1", "0.8.2", "0.8.3", "0.8.4", "0.8.5"]); + const supportedVersions = new Set(SUPPORTED_EXPORT_VERSIONS);And expose
SUPPORTED_EXPORT_VERSIONSfrom a shared source (e.g.,src/version.ts) to reuse in both runtime checks and type definitions.Based on learnings: "When bumping version, update: ... src/functions/export-import.ts supportedVersions set ...".
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/functions/export-import.ts` at line 178, Extract the inline supportedVersions Set into a single shared constant (e.g., SUPPORTED_EXPORT_VERSIONS) exported from a central module (suggested name: src/version.ts) and replace the local Set usage in export-import.ts with an import of SUPPORTED_EXPORT_VERSIONS; update any other files that currently duplicate the list to import the same constant so version bumps happen in one place and ensure the exported constant is typed (string[] or ReadonlySet<string>) to be usable in runtime checks and type definitions.src/version.ts (1)
1-1: Consider narrowingVERSIONtoas constinstead of maintaining a long union here.The current literal union is easy to desync from other version sources.
✂️ Simplify and reduce drift risk
-export const VERSION: "0.3.0" | "0.4.0" | "0.5.0" | "0.6.0" | "0.6.1" | "0.7.0" | "0.7.2" | "0.7.3" | "0.7.4" | "0.7.5" | "0.7.6" | "0.8.1" | "0.8.2" | "0.8.3" | "0.8.4" | "0.8.5" = "0.8.5"; +export const VERSION = "0.8.5" as const;Based on learnings: "When bumping version, update: ... src/version.ts VERSION constant and type union ...".
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/version.ts` at line 1, The VERSION export currently uses a long literal union that easily drifts; replace it with a single constant assertion by changing the declaration of VERSION to a single string literal (e.g., "0.8.5") with an as const assertion and remove the large union type — keep or add a derived type if needed via typeof VERSION (e.g., export type Version = typeof VERSION) so callers can still use the type safely; update references to use the new VERSION and derived type if they relied on the union.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@src/types.ts`:
- Line 255: ExportData.version's string union is missing "0.7.7", causing
type/runtime mismatch; update the ExportData type's version union to include
"0.7.7" (i.e., add the literal "0.7.7" to the existing union in src/types.ts
where ExportData.version is declared) and then run type checks to ensure imports
that accept "0.7.7" now type-check correctly.
---
Nitpick comments:
In `@src/functions/export-import.ts`:
- Line 178: Extract the inline supportedVersions Set into a single shared
constant (e.g., SUPPORTED_EXPORT_VERSIONS) exported from a central module
(suggested name: src/version.ts) and replace the local Set usage in
export-import.ts with an import of SUPPORTED_EXPORT_VERSIONS; update any other
files that currently duplicate the list to import the same constant so version
bumps happen in one place and ensure the exported constant is typed (string[] or
ReadonlySet<string>) to be usable in runtime checks and type definitions.
In `@src/version.ts`:
- Line 1: The VERSION export currently uses a long literal union that easily
drifts; replace it with a single constant assertion by changing the declaration
of VERSION to a single string literal (e.g., "0.8.5") with an as const assertion
and remove the large union type — keep or add a derived type if needed via
typeof VERSION (e.g., export type Version = typeof VERSION) so callers can still
use the type safely; update references to use the new VERSION and derived type
if they relied on the union.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 38f900b7-1c4a-4a46-bf80-7ecd245f4bf5
⛔ Files ignored due to path filters (1)
package-lock.jsonis excluded by!**/package-lock.json
📒 Files selected for processing (7)
CHANGELOG.mdpackage.jsonplugin/.claude-plugin/plugin.jsonsrc/functions/export-import.tssrc/types.tssrc/version.tstest/export-import.test.ts
|
|
||
| export interface ExportData { | ||
| version: "0.3.0" | "0.4.0" | "0.5.0" | "0.6.0" | "0.6.1" | "0.7.0" | "0.7.2" | "0.7.3" | "0.7.4" | "0.7.5" | "0.7.6" | "0.7.9" | "0.8.0" | "0.8.1" | "0.8.2" | "0.8.3" | "0.8.4"; | ||
| version: "0.3.0" | "0.4.0" | "0.5.0" | "0.6.0" | "0.6.1" | "0.7.0" | "0.7.2" | "0.7.3" | "0.7.4" | "0.7.5" | "0.7.6" | "0.7.9" | "0.8.0" | "0.8.1" | "0.8.2" | "0.8.3" | "0.8.4" | "0.8.5"; |
There was a problem hiding this comment.
ExportData.version is missing "0.7.7" even though import accepts it.
This creates a type/runtime mismatch for valid imports.
✅ Minimal fix
- version: "0.3.0" | "0.4.0" | "0.5.0" | "0.6.0" | "0.6.1" | "0.7.0" | "0.7.2" | "0.7.3" | "0.7.4" | "0.7.5" | "0.7.6" | "0.7.9" | "0.8.0" | "0.8.1" | "0.8.2" | "0.8.3" | "0.8.4" | "0.8.5";
+ version: "0.3.0" | "0.4.0" | "0.5.0" | "0.6.0" | "0.6.1" | "0.7.0" | "0.7.2" | "0.7.3" | "0.7.4" | "0.7.5" | "0.7.6" | "0.7.7" | "0.7.9" | "0.8.0" | "0.8.1" | "0.8.2" | "0.8.3" | "0.8.4" | "0.8.5";Based on learnings: "When bumping version, update: ... src/types.ts ExportData version union ...".
📝 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.
| version: "0.3.0" | "0.4.0" | "0.5.0" | "0.6.0" | "0.6.1" | "0.7.0" | "0.7.2" | "0.7.3" | "0.7.4" | "0.7.5" | "0.7.6" | "0.7.9" | "0.8.0" | "0.8.1" | "0.8.2" | "0.8.3" | "0.8.4" | "0.8.5"; | |
| version: "0.3.0" | "0.4.0" | "0.5.0" | "0.6.0" | "0.6.1" | "0.7.0" | "0.7.2" | "0.7.3" | "0.7.4" | "0.7.5" | "0.7.6" | "0.7.7" | "0.7.9" | "0.8.0" | "0.8.1" | "0.8.2" | "0.8.3" | "0.8.4" | "0.8.5"; |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@src/types.ts` at line 255, ExportData.version's string union is missing
"0.7.7", causing type/runtime mismatch; update the ExportData type's version
union to include "0.7.7" (i.e., add the literal "0.7.7" to the existing union in
src/types.ts where ExportData.version is declared) and then run type checks to
ensure imports that accept "0.7.7" now type-check correctly.
Bumps to 0.8.5 with the MCP notifications + id-type validation fix from #131.
Summary
idfield). Fixes Codex CLI v0.120.0 "Transport closed" error. Claude Code and other tolerant clients are unaffected.isValidId()helper enforces JSON-RPC 2.0 §4 id-type rules (string | number | null | undefined). Bad-id requests ({},[],true) get-32600withid: nullbefore the handler runs.Version bumps (8 files)
Verification
npm run build— cleannpm test— 698 passing (60 files)Test plan
Summary by CodeRabbit
Bug Fixes
Tests