jupyterlab-chat-extension 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,29 @@
1
+ BSD 3-Clause License
2
+
3
+ Copyright (c) 2024, Jupyter Development Team
4
+ All rights reserved.
5
+
6
+ Redistribution and use in source and binary forms, with or without
7
+ modification, are permitted provided that the following conditions are met:
8
+
9
+ 1. Redistributions of source code must retain the above copyright notice, this
10
+ list of conditions and the following disclaimer.
11
+
12
+ 2. Redistributions in binary form must reproduce the above copyright notice,
13
+ this list of conditions and the following disclaimer in the documentation
14
+ and/or other materials provided with the distribution.
15
+
16
+ 3. Neither the name of the copyright holder nor the names of its
17
+ contributors may be used to endorse or promote products derived from
18
+ this software without specific prior written permission.
19
+
20
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
23
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
24
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
26
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
27
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
28
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
package/README.md ADDED
@@ -0,0 +1,122 @@
1
+ # jupyterlab_chat
2
+
3
+ [![Github Actions Status](https://github.com/jupyterlab/jupyter-chat/workflows/Build/badge.svg)](https://github.com/jupyterlab/jupyter-chat/actions/workflows/build.yml)[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/jupyterlab/jupyter-chat/main?urlpath=lab)
4
+
5
+ A chat extension based on shared documents.
6
+
7
+ This extension is composed of a Python package named `jupyterlab_chat`
8
+ for the server extension and a NPM package named `jupyterlab-chat-extension`
9
+ for the frontend extension.
10
+
11
+ This extension registers a `YChat` shared document, and associate the document to a
12
+ chat widget in the front end.
13
+
14
+ ![screenshot](screenshot.gif 'jupyterlab chat extension')
15
+
16
+ ## Requirements
17
+
18
+ - JupyterLab >= 4.0.0
19
+
20
+ ## Install
21
+
22
+ To install the extension, execute:
23
+
24
+ ```bash
25
+ pip install jupyterlab_chat
26
+ ```
27
+
28
+ ## Uninstall
29
+
30
+ To remove the extension, execute:
31
+
32
+ ```bash
33
+ pip uninstall jupyterlab_chat
34
+ ```
35
+
36
+ ## Troubleshoot
37
+
38
+ If you are seeing the frontend extension, but it is not working, check
39
+ that the server extension is enabled:
40
+
41
+ ```bash
42
+ jupyter server extension list
43
+ ```
44
+
45
+ If the server extension is installed and enabled, but you are not seeing
46
+ the frontend extension, check the frontend extension is installed:
47
+
48
+ ```bash
49
+ jupyter labextension list
50
+ ```
51
+
52
+ ## Contributing
53
+
54
+ ### Development install
55
+
56
+ Note: You will need NodeJS to build the extension package.
57
+
58
+ The `jlpm` command is JupyterLab's pinned version of
59
+ [yarn](https://yarnpkg.com/) that is installed with JupyterLab. You may use
60
+ `yarn` or `npm` in lieu of `jlpm` below.
61
+
62
+ ```bash
63
+ # Clone the repo to your local environment
64
+ # Change directory to the jupyterlab_chat directory
65
+ # Install package in development mode
66
+ pip install -e ".[test]"
67
+ # Link your development version of the extension with JupyterLab
68
+ jupyter labextension develop . --overwrite
69
+ # Rebuild extension Typescript source after making changes
70
+ jlpm build
71
+ ```
72
+
73
+ You can watch the source directory and run JupyterLab at the same time in different terminals to watch for changes in the extension's source and automatically rebuild the extension.
74
+
75
+ ```bash
76
+ # Watch the source directory in one terminal, automatically rebuilding when needed
77
+ jlpm watch
78
+ # Run JupyterLab in another terminal
79
+ jupyter lab
80
+ ```
81
+
82
+ With the watch command running, every saved change will immediately be built locally and available in your running JupyterLab. Refresh JupyterLab to load the change in your browser (you may need to wait several seconds for the extension to be rebuilt).
83
+
84
+ By default, the `jlpm build` command generates the source maps for this extension to make it easier to debug using the browser dev tools. To also generate source maps for the JupyterLab core extensions, you can run the following command:
85
+
86
+ ```bash
87
+ jupyter lab build --minimize=False
88
+ ```
89
+
90
+ ### Development uninstall
91
+
92
+ ```bash
93
+ pip uninstall jupyterlab_chat
94
+ ```
95
+
96
+ In development mode, you will also need to remove the symlink created by `jupyter labextension develop`
97
+ command. To find its location, you can run `jupyter labextension list` to figure out where the `labextensions`
98
+ folder is located. Then you can remove the symlink named `jupyterlab-chat-extension` within that folder.
99
+
100
+ ### Testing the extension
101
+
102
+ #### Frontend tests
103
+
104
+ This extension is using [Jest](https://jestjs.io/) for JavaScript code testing.
105
+
106
+ To execute them, execute:
107
+
108
+ ```sh
109
+ jlpm
110
+ jlpm test
111
+ ```
112
+
113
+ #### Integration tests
114
+
115
+ This extension uses [Playwright](https://playwright.dev/docs/intro) for the integration tests (aka user level tests).
116
+ More precisely, the JupyterLab helper [Galata](https://github.com/jupyterlab/jupyterlab/tree/master/galata) is used to handle testing the extension in JupyterLab.
117
+
118
+ More information are provided within the [ui-tests](./ui-tests/README.md) README.
119
+
120
+ ### Packaging the extension
121
+
122
+ See [RELEASE](RELEASE.md)
package/lib/index.d.ts ADDED
@@ -0,0 +1,5 @@
1
+ import { IActiveCellManager, IAutocompletionRegistry, ISelectionWatcher } from '@jupyter/chat';
2
+ import { JupyterFrontEndPlugin } from '@jupyterlab/application';
3
+ import { ChatPanel, IChatFactory } from 'jupyterlab-chat';
4
+ declare const _default: (JupyterFrontEndPlugin<void> | JupyterFrontEndPlugin<IAutocompletionRegistry> | JupyterFrontEndPlugin<IChatFactory> | JupyterFrontEndPlugin<ChatPanel> | JupyterFrontEndPlugin<IActiveCellManager> | JupyterFrontEndPlugin<ISelectionWatcher>)[];
5
+ export default _default;