@notebook-intelligence/notebook-intelligence 1.2.2
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 +674 -0
- package/README.md +151 -0
- package/lib/api.d.ts +47 -0
- package/lib/api.js +246 -0
- package/lib/chat-sidebar.d.ts +80 -0
- package/lib/chat-sidebar.js +1277 -0
- package/lib/handler.d.ts +8 -0
- package/lib/handler.js +36 -0
- package/lib/index.d.ts +7 -0
- package/lib/index.js +1078 -0
- package/lib/markdown-renderer.d.ts +10 -0
- package/lib/markdown-renderer.js +60 -0
- package/lib/tokens.d.ts +93 -0
- package/lib/tokens.js +51 -0
- package/lib/utils.d.ts +17 -0
- package/lib/utils.js +163 -0
- package/package.json +219 -0
- package/schema/plugin.json +42 -0
- package/src/api.ts +333 -0
- package/src/chat-sidebar.tsx +2171 -0
- package/src/handler.ts +51 -0
- package/src/index.ts +1398 -0
- package/src/markdown-renderer.tsx +140 -0
- package/src/svg.d.ts +4 -0
- package/src/tokens.ts +114 -0
- package/src/utils.ts +204 -0
- package/style/base.css +590 -0
- package/style/icons/copilot-warning.svg +1 -0
- package/style/icons/copilot.svg +1 -0
- package/style/icons/copy.svg +1 -0
- package/style/icons/sparkles.svg +1 -0
- package/style/index.css +1 -0
- package/style/index.js +1 -0
package/lib/handler.d.ts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Call the API extension
|
|
3
|
+
*
|
|
4
|
+
* @param endPoint API REST end point for the extension
|
|
5
|
+
* @param init Initial values for the request
|
|
6
|
+
* @returns The response body interpreted as JSON
|
|
7
|
+
*/
|
|
8
|
+
export declare function requestAPI<T>(endPoint?: string, init?: RequestInit): Promise<T>;
|
package/lib/handler.js
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
// Copyright (c) Mehmet Bektas <mbektasgh@outlook.com>
|
|
2
|
+
import { URLExt } from '@jupyterlab/coreutils';
|
|
3
|
+
import { ServerConnection } from '@jupyterlab/services';
|
|
4
|
+
/**
|
|
5
|
+
* Call the API extension
|
|
6
|
+
*
|
|
7
|
+
* @param endPoint API REST end point for the extension
|
|
8
|
+
* @param init Initial values for the request
|
|
9
|
+
* @returns The response body interpreted as JSON
|
|
10
|
+
*/
|
|
11
|
+
export async function requestAPI(endPoint = '', init = {}) {
|
|
12
|
+
// Make request to Jupyter API
|
|
13
|
+
const settings = ServerConnection.makeSettings();
|
|
14
|
+
const requestUrl = URLExt.join(settings.baseUrl, 'notebook-intelligence', // API Namespace
|
|
15
|
+
endPoint);
|
|
16
|
+
let response;
|
|
17
|
+
try {
|
|
18
|
+
response = await ServerConnection.makeRequest(requestUrl, init, settings);
|
|
19
|
+
}
|
|
20
|
+
catch (error) {
|
|
21
|
+
throw new ServerConnection.NetworkError(error);
|
|
22
|
+
}
|
|
23
|
+
let data = await response.text();
|
|
24
|
+
if (data.length > 0) {
|
|
25
|
+
try {
|
|
26
|
+
data = JSON.parse(data);
|
|
27
|
+
}
|
|
28
|
+
catch (error) {
|
|
29
|
+
console.log('Not a JSON response body.', response);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
if (!response.ok) {
|
|
33
|
+
throw new ServerConnection.ResponseError(response, data.message || data.error || data);
|
|
34
|
+
}
|
|
35
|
+
return data;
|
|
36
|
+
}
|
package/lib/index.d.ts
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { JupyterFrontEndPlugin } from '@jupyterlab/application';
|
|
2
|
+
import { INotebookIntelligence } from './tokens';
|
|
3
|
+
/**
|
|
4
|
+
* Initialization data for the @notebook-intelligence/notebook-intelligence extension.
|
|
5
|
+
*/
|
|
6
|
+
declare const plugin: JupyterFrontEndPlugin<INotebookIntelligence>;
|
|
7
|
+
export default plugin;
|