Repository navigation
fix(deps): declare host-provided Pi packages as peers and adopt the Pi 0.99.1 host #1572
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
Changes from all commits
94d1803
c626fd7
2bbc897
111bba9
8d0332e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -38,7 +38,17 @@ interface PrivateEditor { | |
| exitHistoryBrowsing(): void; | ||
| } | ||
|
|
||
| const SUPPORTED_VERSIONS = new Set(["0.85.1", "0.87.1"]); | ||
| // Host Pi versions whose private editor layout this adapter has been verified | ||
| // against. This list is the single source of truth for the identity gate below and | ||
| // for resolveVimRuntime() in extensions/gentle-shell.ts, so a newly verified host | ||
| // is admitted in one place and the two checks cannot drift apart. | ||
| // | ||
| // 0.99.1 was admitted after auditing a real 0.99.1 Editor instance against every | ||
| // structural precondition asserted here (state.lines/cursorLine/cursorCol, pastes | ||
| // Map, pasteCounter, undoStack push/pop/stack/length, pushUndoSnapshot, undo, | ||
| // setCursorCol, cancelAutocomplete, exitHistoryBrowsing, layoutText, render, | ||
| // paddingX) and running the vim adapter suites against it. | ||
| export const SUPPORTED_VERSIONS = new Set(["0.85.1", "0.87.1", "0.99.1"]); | ||
| const importedTuiMetadata: unknown = createRequire(import.meta.url)("@earendil-works/pi-tui/package.json"); | ||
| const IMPORTED_TUI_VERSION = typeof importedTuiMetadata === "object" && importedTuiMetadata !== null && | ||
| "version" in importedTuiMetadata ? importedTuiMetadata.version : undefined; | ||
|
|
@@ -47,8 +57,9 @@ const IMPORTED_TUI_VERSION = typeof importedTuiMetadata === "object" && imported | |
| // as the version metadata. An arbitrary object with matching fields is not an editor. | ||
| function hasEditorIdentity(value: unknown, version: string, editorClass: typeof Editor, verifiedVersion?: string): boolean { | ||
| if (!SUPPORTED_VERSIONS.has(version) || typeof value !== "object" || value === null || | ||
| (verifiedVersion !== undefined ? version !== verifiedVersion : | ||
| editorClass === Editor ? version !== IMPORTED_TUI_VERSION : version !== "0.87.1") || !(value instanceof editorClass)) return false; | ||
| (verifiedVersion !== undefined ? version !== verifiedVersion | ||
| : editorClass === Editor && version !== IMPORTED_TUI_VERSION) || | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win Require version verification for non-imported editor classes. When Require 🤖 Prompt for AI Agents |
||
| !(value instanceof editorClass)) return false; | ||
| let prototype: unknown = Object.getPrototypeOf(value); | ||
| for (let depth = 0; depth < 3; depth++) { | ||
| if (prototype === editorClass.prototype) return true; | ||
|
|
||
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.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
🔎 Supported by static analysis
🏁 Script executed:
Repository: Gentleman-Programming/gentle-shell
Length of output: 7559
🤖 get_repo_knowledge executed:
get_repo_knowledge Gentleman-Programming/gentle-shell /tmp/coderabbit-repo-knowledge/gentleman-programming-gentle-shell-df9b0da1/conventionsLength of output: 2128
🏁 Script executed:
Repository: Gentleman-Programming/gentle-shell
Length of output: 42079
Add coverage for parser-supported palette strings.
lib/theme-customization.tsnow normalizes string colors withpiTui.parseColorandpiTui.colorToHex. The changed tests do not exercise this path. Add one focused test with a value such as#abc; the existing#123456assertion only covers the pre-existing hex path.Suggested fix
🤖 Prompt for AI Agents