@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.
@@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+ import { JupyterFrontEnd } from '@jupyterlab/application';
3
+ import { IActiveDocumentInfo } from './tokens';
4
+ type MarkdownRendererProps = {
5
+ children: string;
6
+ getApp: () => JupyterFrontEnd;
7
+ getActiveDocumentInfo(): IActiveDocumentInfo;
8
+ };
9
+ export declare function MarkdownRenderer({ children: markdown, getApp, getActiveDocumentInfo }: MarkdownRendererProps): React.JSX.Element;
10
+ export {};
@@ -0,0 +1,60 @@
1
+ // Copyright (c) Mehmet Bektas <mbektasgh@outlook.com>
2
+ import React from 'react';
3
+ import Markdown from 'react-markdown';
4
+ import remarkGfm from 'remark-gfm';
5
+ import { Prism as SyntaxHighlighter } from 'react-syntax-highlighter';
6
+ import { oneLight, oneDark } from 'react-syntax-highlighter/dist/cjs/styles/prism';
7
+ import { VscNewFile, VscInsert, VscCopy, VscNotebook, VscAdd } from 'react-icons/vsc';
8
+ import { isDarkTheme } from './utils';
9
+ export function MarkdownRenderer({ children: markdown, getApp, getActiveDocumentInfo }) {
10
+ const app = getApp();
11
+ const activeDocumentInfo = getActiveDocumentInfo();
12
+ const isNotebook = activeDocumentInfo.filename.endsWith('.ipynb');
13
+ return (React.createElement(Markdown, { remarkPlugins: [remarkGfm], components: {
14
+ code({ node, inline, className, children, getApp, ...props }) {
15
+ const match = /language-(\w+)/.exec(className || '');
16
+ const codeString = String(children).replace(/\n$/, '');
17
+ const language = match ? match[1] : 'text';
18
+ const handleCopyClick = () => {
19
+ navigator.clipboard.writeText(codeString);
20
+ };
21
+ const handleInsertAtCursorClick = () => {
22
+ app.commands.execute('notebook-intelligence:insert-at-cursor', {
23
+ language,
24
+ code: codeString
25
+ });
26
+ };
27
+ const handleAddCodeAsNewCell = () => {
28
+ app.commands.execute('notebook-intelligence:add-code-as-new-cell', {
29
+ language,
30
+ code: codeString
31
+ });
32
+ };
33
+ const handleCreateNewFileClick = () => {
34
+ app.commands.execute('notebook-intelligence:create-new-file', {
35
+ language,
36
+ code: codeString
37
+ });
38
+ };
39
+ const handleCreateNewNotebookClick = () => {
40
+ app.commands.execute('notebook-intelligence:create-new-notebook-from-py', { language, code: codeString });
41
+ };
42
+ return !inline && match ? (React.createElement("div", null,
43
+ React.createElement("div", { className: "code-block-header" },
44
+ React.createElement("div", { className: "code-block-header-language" },
45
+ React.createElement("span", null, language)),
46
+ React.createElement("div", { className: "code-block-header-button", onClick: () => handleCopyClick() },
47
+ React.createElement(VscCopy, { size: 16, title: "Copy to clipboard" }),
48
+ React.createElement("span", null, "Copy")),
49
+ React.createElement("div", { className: "code-block-header-button", onClick: () => handleInsertAtCursorClick() },
50
+ React.createElement(VscInsert, { size: 16, title: "Insert at cursor" })),
51
+ isNotebook && (React.createElement("div", { className: "code-block-header-button", onClick: () => handleAddCodeAsNewCell() },
52
+ React.createElement(VscAdd, { size: 16, title: "Add as new cell" }))),
53
+ React.createElement("div", { className: "code-block-header-button", onClick: () => handleCreateNewFileClick() },
54
+ React.createElement(VscNewFile, { size: 16, title: "New file" })),
55
+ language === 'python' && (React.createElement("div", { className: "code-block-header-button", onClick: () => handleCreateNewNotebookClick() },
56
+ React.createElement(VscNotebook, { size: 16, title: "New notebook" })))),
57
+ React.createElement(SyntaxHighlighter, { style: isDarkTheme() ? oneDark : oneLight, PreTag: "div", language: language, ...props }, codeString))) : (React.createElement("code", { className: className, ...props }, children));
58
+ }
59
+ } }, markdown));
60
+ }
@@ -0,0 +1,93 @@
1
+ import { Widget } from '@lumino/widgets';
2
+ import { CodeEditor } from '@jupyterlab/codeeditor';
3
+ import { Token } from '@lumino/coreutils';
4
+ export interface IActiveDocumentInfo {
5
+ activeWidget: Widget | null;
6
+ language: string;
7
+ filename: string;
8
+ filePath: string;
9
+ activeCellIndex: number;
10
+ selection?: CodeEditor.IRange;
11
+ }
12
+ export interface IChatCompletionResponseEmitter {
13
+ emit: (response: any) => void;
14
+ }
15
+ export declare enum RequestDataType {
16
+ ChatRequest = "chat-request",
17
+ ChatUserInput = "chat-user-input",
18
+ ClearChatHistory = "clear-chat-history",
19
+ RunUICommandResponse = "run-ui-command-response",
20
+ GenerateCode = "generate-code",
21
+ CancelChatRequest = "cancel-chat-request",
22
+ InlineCompletionRequest = "inline-completion-request",
23
+ CancelInlineCompletionRequest = "cancel-inline-completion-request"
24
+ }
25
+ export declare enum BackendMessageType {
26
+ StreamMessage = "stream-message",
27
+ StreamEnd = "stream-end",
28
+ RunUICommand = "run-ui-command"
29
+ }
30
+ export declare enum ResponseStreamDataType {
31
+ LLMRaw = "llm-raw",
32
+ Markdown = "markdown",
33
+ MarkdownPart = "markdown-part",
34
+ HTMLFrame = "html-frame",
35
+ Button = "button",
36
+ Anchor = "anchor",
37
+ Progress = "progress",
38
+ Confirmation = "confirmation"
39
+ }
40
+ export declare enum ContextType {
41
+ Custom = "custom",
42
+ CurrentFile = "current-file"
43
+ }
44
+ export interface IContextItem {
45
+ type: ContextType;
46
+ content: string;
47
+ currentCellContents: ICellContents;
48
+ filePath?: string;
49
+ cellIndex?: number;
50
+ startLine?: number;
51
+ endLine?: number;
52
+ }
53
+ export interface ICellContents {
54
+ input: string;
55
+ output: string;
56
+ }
57
+ export interface IChatParticipant {
58
+ id: string;
59
+ name: string;
60
+ description: string;
61
+ iconPath: string;
62
+ commands: string[];
63
+ }
64
+ export declare const GITHUB_COPILOT_PROVIDER_ID = "github-copilot";
65
+ export declare enum TelemetryEventType {
66
+ InlineCompletionRequest = "inline-completion-request",
67
+ ExplainThisRequest = "explain-this-request",
68
+ FixThisCodeRequest = "fix-this-code-request",
69
+ ExplainThisOutputRequest = "explain-this-output-request",
70
+ TroubleshootThisOutputRequest = "troubleshoot-this-output-request",
71
+ GenerateCodeRequest = "generate-code-request",
72
+ ChatRequest = "chat-request",
73
+ InlineChatRequest = "inline-chat-request",
74
+ ChatResponse = "chat-response",
75
+ InlineChatResponse = "inline-chat-response",
76
+ InlineCompletionResponse = "inline-completion-response"
77
+ }
78
+ export interface ITelemetryEvent {
79
+ type: TelemetryEventType;
80
+ data?: any;
81
+ }
82
+ export interface ITelemetryListener {
83
+ get name(): string;
84
+ onTelemetryEvent: (event: ITelemetryEvent) => void;
85
+ }
86
+ export interface ITelemetryEmitter {
87
+ emitTelemetryEvent(event: ITelemetryEvent): void;
88
+ }
89
+ export declare const INotebookIntelligence: Token<INotebookIntelligence>;
90
+ export interface INotebookIntelligence {
91
+ registerTelemetryListener: (listener: ITelemetryListener) => void;
92
+ unregisterTelemetryListener: (listener: ITelemetryListener) => void;
93
+ }
package/lib/tokens.js ADDED
@@ -0,0 +1,51 @@
1
+ // Copyright (c) Mehmet Bektas <mbektasgh@outlook.com>
2
+ import { Token } from '@lumino/coreutils';
3
+ export var RequestDataType;
4
+ (function (RequestDataType) {
5
+ RequestDataType["ChatRequest"] = "chat-request";
6
+ RequestDataType["ChatUserInput"] = "chat-user-input";
7
+ RequestDataType["ClearChatHistory"] = "clear-chat-history";
8
+ RequestDataType["RunUICommandResponse"] = "run-ui-command-response";
9
+ RequestDataType["GenerateCode"] = "generate-code";
10
+ RequestDataType["CancelChatRequest"] = "cancel-chat-request";
11
+ RequestDataType["InlineCompletionRequest"] = "inline-completion-request";
12
+ RequestDataType["CancelInlineCompletionRequest"] = "cancel-inline-completion-request";
13
+ })(RequestDataType || (RequestDataType = {}));
14
+ export var BackendMessageType;
15
+ (function (BackendMessageType) {
16
+ BackendMessageType["StreamMessage"] = "stream-message";
17
+ BackendMessageType["StreamEnd"] = "stream-end";
18
+ BackendMessageType["RunUICommand"] = "run-ui-command";
19
+ })(BackendMessageType || (BackendMessageType = {}));
20
+ export var ResponseStreamDataType;
21
+ (function (ResponseStreamDataType) {
22
+ ResponseStreamDataType["LLMRaw"] = "llm-raw";
23
+ ResponseStreamDataType["Markdown"] = "markdown";
24
+ ResponseStreamDataType["MarkdownPart"] = "markdown-part";
25
+ ResponseStreamDataType["HTMLFrame"] = "html-frame";
26
+ ResponseStreamDataType["Button"] = "button";
27
+ ResponseStreamDataType["Anchor"] = "anchor";
28
+ ResponseStreamDataType["Progress"] = "progress";
29
+ ResponseStreamDataType["Confirmation"] = "confirmation";
30
+ })(ResponseStreamDataType || (ResponseStreamDataType = {}));
31
+ export var ContextType;
32
+ (function (ContextType) {
33
+ ContextType["Custom"] = "custom";
34
+ ContextType["CurrentFile"] = "current-file";
35
+ })(ContextType || (ContextType = {}));
36
+ export const GITHUB_COPILOT_PROVIDER_ID = 'github-copilot';
37
+ export var TelemetryEventType;
38
+ (function (TelemetryEventType) {
39
+ TelemetryEventType["InlineCompletionRequest"] = "inline-completion-request";
40
+ TelemetryEventType["ExplainThisRequest"] = "explain-this-request";
41
+ TelemetryEventType["FixThisCodeRequest"] = "fix-this-code-request";
42
+ TelemetryEventType["ExplainThisOutputRequest"] = "explain-this-output-request";
43
+ TelemetryEventType["TroubleshootThisOutputRequest"] = "troubleshoot-this-output-request";
44
+ TelemetryEventType["GenerateCodeRequest"] = "generate-code-request";
45
+ TelemetryEventType["ChatRequest"] = "chat-request";
46
+ TelemetryEventType["InlineChatRequest"] = "inline-chat-request";
47
+ TelemetryEventType["ChatResponse"] = "chat-response";
48
+ TelemetryEventType["InlineChatResponse"] = "inline-chat-response";
49
+ TelemetryEventType["InlineCompletionResponse"] = "inline-completion-response";
50
+ })(TelemetryEventType || (TelemetryEventType = {}));
51
+ export const INotebookIntelligence = new Token('@notebook-intelligence/notebook-intelligence', 'AI coding assistant for JupyterLab.');
package/lib/utils.d.ts ADDED
@@ -0,0 +1,17 @@
1
+ import { CodeCell } from '@jupyterlab/cells';
2
+ import { CodeEditor } from '@jupyterlab/codeeditor';
3
+ import { NotebookPanel } from '@jupyterlab/notebook';
4
+ export declare function removeAnsiChars(str: string): string;
5
+ export declare function waitForDuration(duration: number): Promise<void>;
6
+ export declare function moveCodeSectionBoundaryMarkersToNewLine(source: string): string;
7
+ export declare function extractLLMGeneratedCode(code: string): string;
8
+ export declare function isDarkTheme(): boolean;
9
+ export declare function markdownToComment(source: string): string;
10
+ export declare function cellOutputAsText(cell: CodeCell): string;
11
+ export declare function getTokenCount(source: string): number;
12
+ export declare function compareSelectionPoints(lhs: CodeEditor.IPosition, rhs: CodeEditor.IPosition): boolean;
13
+ export declare function compareSelections(lhs: CodeEditor.IRange, rhs: CodeEditor.IRange): boolean;
14
+ export declare function isSelectionEmpty(selection: CodeEditor.IRange): boolean;
15
+ export declare function getSelectionInEditor(editor: CodeEditor.IEditor): string;
16
+ export declare function getWholeNotebookContent(np: NotebookPanel): string;
17
+ export declare function applyCodeToSelectionInEditor(editor: CodeEditor.IEditor, code: string): void;
package/lib/utils.js ADDED
@@ -0,0 +1,163 @@
1
+ // Copyright (c) Mehmet Bektas <mbektasgh@outlook.com>
2
+ import { encoding_for_model } from 'tiktoken';
3
+ const tiktoken_encoding = encoding_for_model('gpt-4o');
4
+ export function removeAnsiChars(str) {
5
+ return str.replace(
6
+ // eslint-disable-next-line no-control-regex
7
+ /[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/g, '');
8
+ }
9
+ export async function waitForDuration(duration) {
10
+ return new Promise(resolve => {
11
+ setTimeout(() => {
12
+ resolve();
13
+ }, duration);
14
+ });
15
+ }
16
+ export function moveCodeSectionBoundaryMarkersToNewLine(source) {
17
+ const existingLines = source.split('\n');
18
+ const newLines = [];
19
+ for (const line of existingLines) {
20
+ if (line.length > 3 && line.startsWith('```')) {
21
+ newLines.push('```');
22
+ let remaining = line.substring(3);
23
+ if (remaining.startsWith('python')) {
24
+ if (remaining.length === 6) {
25
+ continue;
26
+ }
27
+ remaining = remaining.substring(6);
28
+ }
29
+ if (remaining.endsWith('```')) {
30
+ newLines.push(remaining.substring(0, remaining.length - 3));
31
+ newLines.push('```');
32
+ }
33
+ else {
34
+ newLines.push(remaining);
35
+ }
36
+ }
37
+ else if (line.length > 3 && line.endsWith('```')) {
38
+ newLines.push(line.substring(0, line.length - 3));
39
+ newLines.push('```');
40
+ }
41
+ else {
42
+ newLines.push(line);
43
+ }
44
+ }
45
+ return newLines.join('\n');
46
+ }
47
+ export function extractLLMGeneratedCode(code) {
48
+ if (code.endsWith('```')) {
49
+ code = code.slice(0, -3);
50
+ }
51
+ const lines = code.split('\n');
52
+ if (lines.length < 2) {
53
+ return code;
54
+ }
55
+ const numLines = lines.length;
56
+ let startLine = -1;
57
+ let endLine = numLines;
58
+ for (let i = 0; i < numLines; i++) {
59
+ if (startLine === -1) {
60
+ if (lines[i].trimStart().startsWith('```')) {
61
+ startLine = i;
62
+ continue;
63
+ }
64
+ }
65
+ else {
66
+ if (lines[i].trimStart().startsWith('```')) {
67
+ endLine = i;
68
+ break;
69
+ }
70
+ }
71
+ }
72
+ if (startLine !== -1) {
73
+ return lines.slice(startLine + 1, endLine).join('\n');
74
+ }
75
+ return code;
76
+ }
77
+ export function isDarkTheme() {
78
+ return document.body.getAttribute('data-jp-theme-light') === 'false';
79
+ }
80
+ export function markdownToComment(source) {
81
+ return source
82
+ .split('\n')
83
+ .map(line => `# ${line}`)
84
+ .join('\n');
85
+ }
86
+ export function cellOutputAsText(cell) {
87
+ let content = '';
88
+ const outputs = cell.outputArea.model.toJSON();
89
+ for (const output of outputs) {
90
+ if (output.output_type === 'execute_result') {
91
+ content +=
92
+ typeof output.data === 'object' && output.data !== null
93
+ ? output.data['text/plain']
94
+ : '' + '\n';
95
+ }
96
+ else if (output.output_type === 'stream') {
97
+ content += output.text + '\n';
98
+ }
99
+ else if (output.output_type === 'error') {
100
+ if (Array.isArray(output.traceback)) {
101
+ content += output.ename + ': ' + output.evalue + '\n';
102
+ content +=
103
+ output.traceback
104
+ .map(item => removeAnsiChars(item))
105
+ .join('\n') + '\n';
106
+ }
107
+ }
108
+ }
109
+ return content;
110
+ }
111
+ export function getTokenCount(source) {
112
+ const tokens = tiktoken_encoding.encode(source);
113
+ return tokens.length;
114
+ }
115
+ export function compareSelectionPoints(lhs, rhs) {
116
+ return lhs.line === rhs.line && lhs.column === rhs.column;
117
+ }
118
+ export function compareSelections(lhs, rhs) {
119
+ // if one undefined
120
+ if ((!lhs || !rhs) && !(!lhs && !rhs)) {
121
+ return true;
122
+ }
123
+ return (lhs === rhs ||
124
+ (compareSelectionPoints(lhs.start, rhs.start) &&
125
+ compareSelectionPoints(lhs.end, rhs.end)));
126
+ }
127
+ export function isSelectionEmpty(selection) {
128
+ return (selection.start.line === selection.end.line &&
129
+ selection.start.column === selection.end.column);
130
+ }
131
+ export function getSelectionInEditor(editor) {
132
+ const selection = editor.getSelection();
133
+ const startOffset = editor.getOffsetAt(selection.start);
134
+ const endOffset = editor.getOffsetAt(selection.end);
135
+ return editor.model.sharedModel.getSource().substring(startOffset, endOffset);
136
+ }
137
+ export function getWholeNotebookContent(np) {
138
+ let content = '';
139
+ for (const cell of np.content.widgets) {
140
+ const cellModel = cell.model.sharedModel;
141
+ if (cellModel.cell_type === 'code') {
142
+ content += cellModel.source + '\n';
143
+ }
144
+ else if (cellModel.cell_type === 'markdown') {
145
+ content += markdownToComment(cellModel.source) + '\n';
146
+ }
147
+ }
148
+ return content;
149
+ }
150
+ export function applyCodeToSelectionInEditor(editor, code) {
151
+ var _a;
152
+ const selection = editor.getSelection();
153
+ const startOffset = editor.getOffsetAt(selection.start);
154
+ const endOffset = editor.getOffsetAt(selection.end);
155
+ editor.model.sharedModel.updateSource(startOffset, endOffset, code);
156
+ const numAddedLines = code.split('\n').length;
157
+ const cursorLine = Math.min(selection.start.line + numAddedLines - 1, editor.lineCount - 1);
158
+ const cursorColumn = ((_a = editor.getLine(cursorLine)) === null || _a === void 0 ? void 0 : _a.length) || 0;
159
+ editor.setCursorPosition({
160
+ line: cursorLine,
161
+ column: cursorColumn
162
+ });
163
+ }
package/package.json ADDED
@@ -0,0 +1,219 @@
1
+ {
2
+ "name": "@notebook-intelligence/notebook-intelligence",
3
+ "version": "1.2.2",
4
+ "description": "AI coding assistant for JupyterLab",
5
+ "keywords": [
6
+ "AI",
7
+ "notebook",
8
+ "intelligence",
9
+ "jupyter",
10
+ "jupyterlab",
11
+ "jupyterlab-extension"
12
+ ],
13
+ "homepage": "https://github.com/notebook-intelligence/notebook-intelligence",
14
+ "bugs": {
15
+ "url": "https://github.com/notebook-intelligence/notebook-intelligence/issues"
16
+ },
17
+ "license": "GPL-3.0",
18
+ "author": {
19
+ "name": "Mehmet Bektas",
20
+ "email": "mbektasgh@outlook.com"
21
+ },
22
+ "files": [
23
+ "lib/**/*.{d.ts,eot,gif,html,jpg,js,js.map,json,png,svg,woff2,ttf}",
24
+ "style/**/*.{css,js,eot,gif,html,jpg,json,png,svg,woff2,ttf}",
25
+ "src/**/*.{ts,tsx}",
26
+ "schema/*.json"
27
+ ],
28
+ "main": "lib/index.js",
29
+ "types": "lib/index.d.ts",
30
+ "style": "style/index.css",
31
+ "repository": {
32
+ "type": "git",
33
+ "url": "https://github.com/notebook-intelligence/notebook-intelligence.git"
34
+ },
35
+ "scripts": {
36
+ "build": "jlpm build:lib && jlpm build:labextension:dev",
37
+ "build:prod": "jlpm clean && jlpm build:lib:prod && jlpm build:labextension",
38
+ "build:labextension": "jupyter labextension build .",
39
+ "build:labextension:dev": "jupyter labextension build --development True .",
40
+ "build:lib": "tsc --sourceMap",
41
+ "build:lib:prod": "tsc",
42
+ "clean": "jlpm clean:lib",
43
+ "clean:lib": "rimraf lib tsconfig.tsbuildinfo",
44
+ "clean:lintcache": "rimraf .eslintcache .stylelintcache",
45
+ "clean:labextension": "rimraf notebook_intelligence/labextension notebook_intelligence/_version.py",
46
+ "clean:all": "jlpm clean:lib && jlpm clean:labextension && jlpm clean:lintcache",
47
+ "eslint": "jlpm eslint:check --fix",
48
+ "eslint:check": "eslint . --cache --ext .ts,.tsx",
49
+ "install:extension": "jlpm build",
50
+ "lint": "jlpm stylelint && jlpm prettier && jlpm eslint",
51
+ "lint:check": "jlpm stylelint:check && jlpm prettier:check && jlpm eslint:check",
52
+ "prettier": "jlpm prettier:base --write --list-different",
53
+ "prettier:base": "prettier \"**/*{.ts,.tsx,.js,.jsx,.css,.json,.md}\"",
54
+ "prettier:check": "jlpm prettier:base --check",
55
+ "stylelint": "jlpm stylelint:check --fix",
56
+ "stylelint:check": "stylelint --cache \"style/**/*.css\"",
57
+ "watch": "run-p watch:src watch:labextension",
58
+ "watch:src": "tsc -w --sourceMap",
59
+ "watch:labextension": "jupyter labextension watch ."
60
+ },
61
+ "dependencies": {
62
+ "@jupyterlab/application": "^4.0.0",
63
+ "@jupyterlab/completer": "^4.0.0",
64
+ "@jupyterlab/coreutils": "^6.0.0",
65
+ "@jupyterlab/fileeditor": "^4.0.0",
66
+ "@jupyterlab/mainmenu": "^4.0.0",
67
+ "@jupyterlab/notebook": "^4.0.0",
68
+ "@jupyterlab/services": "^7.0.0",
69
+ "@jupyterlab/settingregistry": "^4.0.0",
70
+ "monaco-editor": "0.21.3",
71
+ "react-icons": "^5.4.0",
72
+ "react-markdown": "^9.0.1",
73
+ "react-syntax-highlighter": "^15.4.4",
74
+ "remark-gfm": "4.0.0",
75
+ "tiktoken": "1.0.18"
76
+ },
77
+ "devDependencies": {
78
+ "@jupyterlab/builder": "^4.0.0",
79
+ "@types/json-schema": "^7.0.11",
80
+ "@types/react": "^18.0.26",
81
+ "@types/react-addons-linked-state-mixin": "^0.14.22",
82
+ "@types/react-syntax-highlighter": "^15.5.13",
83
+ "@typescript-eslint/eslint-plugin": "^6.1.0",
84
+ "@typescript-eslint/parser": "^6.1.0",
85
+ "css-loader": "^6.7.1",
86
+ "eslint": "^8.36.0",
87
+ "eslint-config-prettier": "^8.8.0",
88
+ "eslint-plugin-prettier": "^5.0.0",
89
+ "mkdirp": "^1.0.3",
90
+ "monaco-editor-webpack-plugin": "^2.0.0",
91
+ "npm-run-all": "^4.1.5",
92
+ "prettier": "^3.0.0",
93
+ "rimraf": "^5.0.1",
94
+ "source-map-loader": "^1.0.2",
95
+ "style-loader": "^3.3.1",
96
+ "stylelint": "^15.10.1",
97
+ "stylelint-config-recommended": "^13.0.0",
98
+ "stylelint-config-standard": "^34.0.0",
99
+ "stylelint-csstree-validator": "^3.0.0",
100
+ "stylelint-prettier": "^4.0.0",
101
+ "typescript": "~5.0.2",
102
+ "yjs": "^13.5.0"
103
+ },
104
+ "sideEffects": [
105
+ "style/*.css",
106
+ "style/index.js"
107
+ ],
108
+ "styleModule": "style/index.js",
109
+ "publishConfig": {
110
+ "access": "public"
111
+ },
112
+ "jupyterlab": {
113
+ "discovery": {
114
+ "server": {
115
+ "managers": [
116
+ "pip"
117
+ ],
118
+ "base": {
119
+ "name": "notebook_intelligence"
120
+ }
121
+ }
122
+ },
123
+ "extension": true,
124
+ "outputDir": "notebook_intelligence/labextension",
125
+ "schemaDir": "schema",
126
+ "webpackConfig": "./webpack.config.js"
127
+ },
128
+ "eslintIgnore": [
129
+ "node_modules",
130
+ "dist",
131
+ "coverage",
132
+ "**/*.d.ts"
133
+ ],
134
+ "eslintConfig": {
135
+ "extends": [
136
+ "eslint:recommended",
137
+ "plugin:@typescript-eslint/eslint-recommended",
138
+ "plugin:@typescript-eslint/recommended",
139
+ "plugin:prettier/recommended"
140
+ ],
141
+ "parser": "@typescript-eslint/parser",
142
+ "parserOptions": {
143
+ "project": "tsconfig.json",
144
+ "sourceType": "module"
145
+ },
146
+ "plugins": [
147
+ "@typescript-eslint"
148
+ ],
149
+ "rules": {
150
+ "@typescript-eslint/naming-convention": [
151
+ "error",
152
+ {
153
+ "selector": "interface",
154
+ "format": [
155
+ "PascalCase"
156
+ ],
157
+ "custom": {
158
+ "regex": "^I[A-Z]",
159
+ "match": true
160
+ }
161
+ }
162
+ ],
163
+ "@typescript-eslint/no-unused-vars": [
164
+ "warn",
165
+ {
166
+ "args": "none"
167
+ }
168
+ ],
169
+ "@typescript-eslint/no-explicit-any": "off",
170
+ "@typescript-eslint/no-namespace": "off",
171
+ "@typescript-eslint/no-use-before-define": "off",
172
+ "@typescript-eslint/quotes": [
173
+ "error",
174
+ "single",
175
+ {
176
+ "avoidEscape": true,
177
+ "allowTemplateLiterals": false
178
+ }
179
+ ],
180
+ "curly": [
181
+ "error",
182
+ "all"
183
+ ],
184
+ "eqeqeq": "error",
185
+ "prefer-arrow-callback": "error"
186
+ }
187
+ },
188
+ "prettier": {
189
+ "singleQuote": true,
190
+ "trailingComma": "none",
191
+ "arrowParens": "avoid",
192
+ "endOfLine": "auto",
193
+ "overrides": [
194
+ {
195
+ "files": "package.json",
196
+ "options": {
197
+ "tabWidth": 4
198
+ }
199
+ }
200
+ ]
201
+ },
202
+ "stylelint": {
203
+ "extends": [
204
+ "stylelint-config-recommended",
205
+ "stylelint-config-standard",
206
+ "stylelint-prettier/recommended"
207
+ ],
208
+ "plugins": [
209
+ "stylelint-csstree-validator"
210
+ ],
211
+ "rules": {
212
+ "csstree/validator": true,
213
+ "property-no-vendor-prefix": null,
214
+ "selector-class-pattern": "^([a-z][A-z\\d]*)(-[A-z\\d]+)*$",
215
+ "selector-no-vendor-prefix": null,
216
+ "value-no-vendor-prefix": null
217
+ }
218
+ }
219
+ }
@@ -0,0 +1,42 @@
1
+ {
2
+ "title": "Notebook Intelligence",
3
+ "description": "Notebook Intelligence settings",
4
+ "type": "object",
5
+ "properties": {},
6
+ "additionalProperties": false,
7
+ "jupyter.lab.toolbars": {
8
+ "Cell": [
9
+ {
10
+ "name": "notebook-intelligence:editor-generate-code",
11
+ "command": "notebook-intelligence:editor-generate-code",
12
+ "icon": "notebook-intelligence:sparkles-icon",
13
+ "caption": "Generate code",
14
+ "rank": 0
15
+ }
16
+ ]
17
+ },
18
+ "jupyter.lab.shortcuts": [
19
+ {
20
+ "command": "notebook-intelligence:editor-generate-code",
21
+ "keys": ["Accel G"],
22
+ "selector": ".jp-Editor",
23
+ "preventDefault": true
24
+ },
25
+ {
26
+ "command": "notebook-intelligence:editor-generate-code",
27
+ "keys": ["Accel G"],
28
+ "selector": ".jp-CodeCell",
29
+ "preventDefault": true
30
+ },
31
+ {
32
+ "command": "inline-completer:accept",
33
+ "selector": ".jp-mod-inline-completer-active",
34
+ "keys": ["Tab"]
35
+ },
36
+ {
37
+ "command": "inline-completer:accept",
38
+ "selector": ".jp-Notebook.jp-mod-editMode .jp-mod-completer-enabled",
39
+ "keys": ["Tab"]
40
+ }
41
+ ]
42
+ }