-
Notifications
You must be signed in to change notification settings - Fork 7
Route kernel messages about language_info, execution_state, and execution count into ydoc #90
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
Merged
3coins
merged 9 commits into
jupyter-ai-contrib:main
from
Zsailer:kernel-client-doc-aware
Jun 3, 2025
Merged
Changes from 8 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
9efa737
Route kernel messages about language_info, execution_state, and execu…
Zsailer 768334a
Rename ABC to Abstract classes
Zsailer fcc69fa
Make ymeta public; PR cleanup
Zsailer 965acf6
Handle messages that don't have a cell id
Zsailer 22accc6
Removes existing msg with same cell id
3coins b330223
Added unit tests
3coins 9119c7a
Merge pull request #1 from 3coins/fix-duplicate-issue
Zsailer 02b2b99
Remove existing msg id for shell channel only
3coins 7a39220
Add breaks to avoid looping through all cells
Zsailer File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| import typing as t | ||
| from abc import ABC, abstractmethod | ||
|
|
||
| from jupyter_server_documents.rooms.yroom import YRoom | ||
|
|
||
|
|
||
| class AbstractKernelClient(ABC): | ||
|
|
||
| @abstractmethod | ||
| async def start_listening(self): | ||
| ... | ||
|
|
||
| @abstractmethod | ||
| async def stop_listening(self): | ||
| ... | ||
|
|
||
| @abstractmethod | ||
| def handle_incoming_message(self, channel_name: str, msg: list[bytes]): | ||
| ... | ||
|
|
||
| @abstractmethod | ||
| async def handle_outgoing_message(self, channel_name: str, msg: list[bytes]): | ||
| ... | ||
|
|
||
| @abstractmethod | ||
| def add_listener(self, callback: t.Callable[[str, list[bytes]], None]): | ||
| ... | ||
|
|
||
| @abstractmethod | ||
| def remove_listener(self, callback: t.Callable[[str, list[bytes]], None]): | ||
| ... | ||
|
|
||
|
|
||
| class AbstractDocumentAwareKernelClient(AbstractKernelClient): | ||
|
|
||
| @abstractmethod | ||
| async def add_yroom(self, yroom: YRoom): | ||
| ... | ||
|
|
||
| @abstractmethod | ||
| async def remove_yroom(self, yroom: YRoom): | ||
| ... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
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.
@Zsailer
PR 80 also passed
cellsas a second argument here, is this missing? I can't locate thefind_cellAPI in YNotebook or YBaseDoc to verify this.https://github.com/jupyter-ai-contrib/jupyter-server-documents/pull/81/files#diff-7c1b5e5cd83f31f24af67c439d6a9422528ddb74a5b20598b25230a798d613d7R252-R253
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.
I moved this API to the
ydocs.pymodule here. We don't need to pass the list of cells anymore, since that class already has the list as a property.