@plmbr/notebook-intelligence 5.0.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 +674 -0
- package/README.md +412 -0
- package/lib/api.d.ts +288 -0
- package/lib/api.js +927 -0
- package/lib/cell-output-bundle.d.ts +25 -0
- package/lib/cell-output-bundle.js +129 -0
- package/lib/cell-output-toolbar.d.ts +26 -0
- package/lib/cell-output-toolbar.js +188 -0
- package/lib/chat-progress-feedback.d.ts +3 -0
- package/lib/chat-progress-feedback.js +27 -0
- package/lib/chat-sidebar.d.ts +92 -0
- package/lib/chat-sidebar.js +3452 -0
- package/lib/command-ids.d.ts +39 -0
- package/lib/command-ids.js +44 -0
- package/lib/components/ask-user-question.d.ts +2 -0
- package/lib/components/ask-user-question.js +85 -0
- package/lib/components/checkbox.d.ts +2 -0
- package/lib/components/checkbox.js +30 -0
- package/lib/components/claude-mcp-panel.d.ts +2 -0
- package/lib/components/claude-mcp-panel.js +275 -0
- package/lib/components/claude-mcp-paste.d.ts +7 -0
- package/lib/components/claude-mcp-paste.js +104 -0
- package/lib/components/claude-session-picker.d.ts +8 -0
- package/lib/components/claude-session-picker.js +127 -0
- package/lib/components/form-dialog.d.ts +25 -0
- package/lib/components/form-dialog.js +35 -0
- package/lib/components/launcher-picker.d.ts +6 -0
- package/lib/components/launcher-picker.js +135 -0
- package/lib/components/mcp-util.d.ts +2 -0
- package/lib/components/mcp-util.js +37 -0
- package/lib/components/notebook-generation-popover.d.ts +7 -0
- package/lib/components/notebook-generation-popover.js +60 -0
- package/lib/components/pill.d.ts +2 -0
- package/lib/components/pill.js +5 -0
- package/lib/components/plugins-panel.d.ts +3 -0
- package/lib/components/plugins-panel.js +466 -0
- package/lib/components/settings-panel.d.ts +11 -0
- package/lib/components/settings-panel.js +742 -0
- package/lib/components/skills-panel.d.ts +2 -0
- package/lib/components/skills-panel.js +1264 -0
- package/lib/handler.d.ts +8 -0
- package/lib/handler.js +36 -0
- package/lib/icons.d.ts +45 -0
- package/lib/icons.js +54 -0
- package/lib/index.d.ts +8 -0
- package/lib/index.js +2079 -0
- package/lib/markdown-renderer.d.ts +10 -0
- package/lib/markdown-renderer.js +64 -0
- package/lib/notebook-generation-toolbar.d.ts +16 -0
- package/lib/notebook-generation-toolbar.js +197 -0
- package/lib/notebook-generation.d.ts +8 -0
- package/lib/notebook-generation.js +12 -0
- package/lib/open-file-refresh-watcher-env.d.ts +4 -0
- package/lib/open-file-refresh-watcher-env.js +33 -0
- package/lib/open-file-refresh-watcher.d.ts +97 -0
- package/lib/open-file-refresh-watcher.js +190 -0
- package/lib/shell-utils.d.ts +6 -0
- package/lib/shell-utils.js +9 -0
- package/lib/task-target-notebook.d.ts +2 -0
- package/lib/task-target-notebook.js +28 -0
- package/lib/terminal-drag-format.d.ts +9 -0
- package/lib/terminal-drag-format.js +23 -0
- package/lib/terminal-drag.d.ts +12 -0
- package/lib/terminal-drag.js +268 -0
- package/lib/tokens.d.ts +149 -0
- package/lib/tokens.js +88 -0
- package/lib/tour/tour-anchors.d.ts +18 -0
- package/lib/tour/tour-anchors.js +18 -0
- package/lib/tour/tour-config.d.ts +66 -0
- package/lib/tour/tour-config.js +99 -0
- package/lib/tour/tour-defaults.json +58 -0
- package/lib/tour/tour-events.d.ts +19 -0
- package/lib/tour/tour-events.js +30 -0
- package/lib/tour/tour-overlay.d.ts +6 -0
- package/lib/tour/tour-overlay.js +350 -0
- package/lib/tour/tour-state.d.ts +20 -0
- package/lib/tour/tour-state.js +81 -0
- package/lib/tour/tour-steps.d.ts +33 -0
- package/lib/tour/tour-steps.js +216 -0
- package/lib/utils.d.ts +53 -0
- package/lib/utils.js +385 -0
- package/package.json +258 -0
- package/schema/plugin.json +42 -0
- package/src/api.ts +1424 -0
- package/src/cell-output-bundle.ts +176 -0
- package/src/cell-output-toolbar.ts +232 -0
- package/src/chat-progress-feedback.ts +35 -0
- package/src/chat-sidebar.tsx +5147 -0
- package/src/command-ids.ts +67 -0
- package/src/components/ask-user-question.tsx +151 -0
- package/src/components/checkbox.tsx +62 -0
- package/src/components/claude-mcp-panel.tsx +543 -0
- package/src/components/claude-mcp-paste.ts +132 -0
- package/src/components/claude-session-picker.tsx +214 -0
- package/src/components/form-dialog.tsx +75 -0
- package/src/components/launcher-picker.tsx +237 -0
- package/src/components/mcp-util.ts +53 -0
- package/src/components/notebook-generation-popover.tsx +127 -0
- package/src/components/pill.tsx +15 -0
- package/src/components/plugins-panel.tsx +774 -0
- package/src/components/settings-panel.tsx +1631 -0
- package/src/components/skills-panel.tsx +2084 -0
- package/src/handler.ts +51 -0
- package/src/icons.ts +71 -0
- package/src/index.ts +2583 -0
- package/src/markdown-renderer.tsx +153 -0
- package/src/notebook-generation-toolbar.tsx +281 -0
- package/src/notebook-generation.ts +23 -0
- package/src/open-file-refresh-watcher-env.ts +52 -0
- package/src/open-file-refresh-watcher.ts +260 -0
- package/src/shell-utils.ts +10 -0
- package/src/svg.d.ts +4 -0
- package/src/task-target-notebook.ts +37 -0
- package/src/terminal-drag-format.ts +29 -0
- package/src/terminal-drag.ts +382 -0
- package/src/tokens.ts +171 -0
- package/src/tour/tour-anchors.ts +21 -0
- package/src/tour/tour-config.ts +160 -0
- package/src/tour/tour-events.ts +34 -0
- package/src/tour/tour-overlay.tsx +474 -0
- package/src/tour/tour-state.ts +87 -0
- package/src/tour/tour-steps.ts +281 -0
- package/src/utils.ts +455 -0
- package/style/base.css +3238 -0
- package/style/icons/cell-toolbar-bug.svg +5 -0
- package/style/icons/cell-toolbar-chat.svg +5 -0
- package/style/icons/cell-toolbar-sparkle.svg +5 -0
- package/style/icons/claude.svg +1 -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/openai.svg +1 -0
- package/style/icons/opencode.svg +1 -0
- package/style/icons/sparkles-warning.svg +5 -0
- package/style/icons/sparkles.svg +1 -0
- package/style/index.css +1 -0
- package/style/index.js +1 -0
package/README.md
ADDED
|
@@ -0,0 +1,412 @@
|
|
|
1
|
+
# Notebook Intelligence
|
|
2
|
+
|
|
3
|
+
Notebook Intelligence (NBI) is an AI coding assistant and extensible AI framework for JupyterLab. It adds chat, inline edit, auto-complete, and an agent that can drive notebooks — backed by GitHub Copilot, an OpenAI-compatible or LiteLLM-compatible endpoint, local [Ollama](https://ollama.com/) models, or Anthropic's Claude Code CLI.
|
|
4
|
+
|
|
5
|
+
NBI is free and open-source. Connect it to a free or paid LLM provider of your choice — GitHub Copilot, any OpenAI- or LiteLLM-compatible endpoint, Ollama (local), or Anthropic Claude (via the Claude Code CLI). Provider charges, when applicable, are paid directly to the provider.
|
|
6
|
+
|
|
7
|
+
## Contents
|
|
8
|
+
|
|
9
|
+
- [Requirements](#requirements)
|
|
10
|
+
- [Quick start](#quick-start)
|
|
11
|
+
- [Concepts](#concepts)
|
|
12
|
+
- [Feature highlights](#feature-highlights)
|
|
13
|
+
- [Claude mode](#claude-mode)
|
|
14
|
+
- [Agent mode](#agent-mode)
|
|
15
|
+
- [Code generation with inline chat](#code-generation-with-inline-chat)
|
|
16
|
+
- [Auto-complete](#auto-complete)
|
|
17
|
+
- [Chat interface](#chat-interface)
|
|
18
|
+
- [Cell output actions](#cell-output-actions)
|
|
19
|
+
- [Notebook toolbar generation](#notebook-toolbar-generation)
|
|
20
|
+
- [Reload open files when changed on disk](#reload-open-files-when-changed-on-disk)
|
|
21
|
+
- [Configuration](#configuration)
|
|
22
|
+
- [Configuration files](#configuration-files)
|
|
23
|
+
- [Remembering GitHub Copilot login](#remembering-github-copilot-login)
|
|
24
|
+
- [Built-in tools](#built-in-tools)
|
|
25
|
+
- [Model Context Protocol (MCP) support](#model-context-protocol-mcp-support)
|
|
26
|
+
- [MCP config example](#mcp-config-example)
|
|
27
|
+
- [Rulesets](#rulesets)
|
|
28
|
+
- [Claude Skills](#claude-skills)
|
|
29
|
+
- [Claude MCP Servers](#claude-mcp-servers)
|
|
30
|
+
- [Claude Plugins](#claude-plugins)
|
|
31
|
+
- [Chat feedback](#chat-feedback)
|
|
32
|
+
- [Documentation](#documentation)
|
|
33
|
+
- [Further reading](#further-reading)
|
|
34
|
+
- [Roadmap](#roadmap)
|
|
35
|
+
- [License](#license)
|
|
36
|
+
|
|
37
|
+
## Requirements
|
|
38
|
+
|
|
39
|
+
- Python 3.10+
|
|
40
|
+
- JupyterLab 4.x
|
|
41
|
+
- Node.js — only required for [Claude mode](#claude-mode) (the Claude Code CLI) and for MCP servers that launch via `npx`.
|
|
42
|
+
- A fresh virtualenv or conda env is recommended so NBI doesn't conflict with system Python.
|
|
43
|
+
|
|
44
|
+
## Quick start
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
pip install notebook-intelligence
|
|
48
|
+
jupyter lab # restart JupyterLab if it was already running
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
After restart:
|
|
52
|
+
|
|
53
|
+
1. Click the NBI icon in the left sidebar to open the chat panel.
|
|
54
|
+
2. Open NBI Settings (gear icon in the chat panel, or _Settings → Notebook Intelligence Settings_).
|
|
55
|
+
3. Sign into your provider — for GitHub Copilot, click _Sign in_; for an OpenAI- or LiteLLM-compatible endpoint, paste an API key; for Ollama, point at your local daemon. To use Claude, enable Claude mode (see below).
|
|
56
|
+
4. Type a message in the chat panel and press Enter.
|
|
57
|
+
|
|
58
|
+
If the panel stays empty or login does nothing, see [Troubleshooting](docs/troubleshooting.md).
|
|
59
|
+
|
|
60
|
+
## Concepts
|
|
61
|
+
|
|
62
|
+
A short glossary you'll see referenced throughout these docs.
|
|
63
|
+
|
|
64
|
+
- **LLM Provider** — the service that runs the model. NBI ships with four provider adapters: GitHub Copilot, OpenAI-compatible, LiteLLM-compatible, and Ollama. Anthropic Claude is available through [Claude mode](#claude-mode), not as a top-level provider.
|
|
65
|
+
- **Chat Participant** — a `@mention`-able persona inside the chat panel (`@workspace`, `@mcp`, …). Participants route the request to a specific tool surface.
|
|
66
|
+
- **Default mode vs Claude mode** — _Default_ uses the configured LLM Provider for chat, inline chat, and auto-complete. _Claude mode_ uses the Claude Code CLI for the chat panel (gaining its tools, skills, MCP servers, and custom commands) and Claude models via the Anthropic API for inline chat and auto-complete. Requires the Claude Code CLI on `PATH`.
|
|
67
|
+
- **Claude Code vs the Anthropic API** — the _Anthropic API_ (`api.anthropic.com`) is the HTTPS endpoint NBI calls directly for inline chat and auto-complete in Claude mode. _Claude Code_ is Anthropic's local CLI agent that NBI shells out to for the chat panel; it talks to Anthropic itself.
|
|
68
|
+
- **MCP** — [Model Context Protocol](https://modelcontextprotocol.io/). A way for the LLM to call out to external tools (read files, hit APIs, run scripts).
|
|
69
|
+
- **Ruleset** — markdown files in `~/.jupyter/nbi/rules/` that get injected into the system prompt to enforce conventions, coding standards, or domain rules.
|
|
70
|
+
- **Skill**: a directory under `~/.claude/skills/` (or `<project>/.claude/skills/`) holding a `SKILL.md` plus helper files. Claude can invoke it like a callable plugin scoped to a workspace.
|
|
71
|
+
- **Claude plugin**: a unit packaged for `claude plugin install`, distributed through a **marketplace** (typically a GitHub repo that publishes a manifest of plugins). Distinct from NBI's own labextension; plugins run inside Claude Code sessions.
|
|
72
|
+
|
|
73
|
+
## Feature highlights
|
|
74
|
+
|
|
75
|
+
### Claude mode
|
|
76
|
+
|
|
77
|
+
NBI provides a dedicated mode for [Claude Code](https://code.claude.com/) integration. In **Claude mode**, NBI uses the Claude Code CLI for the chat panel, and Claude models (via the Anthropic API) for inline chat and auto-complete suggestions. This brings Claude Code's tools, skills, MCP servers, and custom commands into JupyterLab.
|
|
78
|
+
|
|
79
|
+
<img src="media/claude-chat.png" alt="Claude mode" width=500 />
|
|
80
|
+
|
|
81
|
+
Configure via the NBI Settings dialog (gear icon in the chat panel, or _Settings → Notebook Intelligence Settings_). Toggle _Enable Claude mode_, then:
|
|
82
|
+
|
|
83
|
+
- **Chat model** — the Claude model used for the chat panel and inline chat.
|
|
84
|
+
- **Auto-complete model** — the Claude model used for auto-complete suggestions.
|
|
85
|
+
- **Chat Agent setting sources** — user, project, or both, mirroring [Claude Code's settings](https://code.claude.com/docs/en/settings).
|
|
86
|
+
- **Chat Agent tools** — which tool sets to activate. _Claude Code tools_ are always on. _Jupyter UI tools_ are NBI's own (authoring notebooks, running cells, etc.).
|
|
87
|
+
- **API key** and **Base URL** — point at Anthropic or a self-hosted endpoint.
|
|
88
|
+
|
|
89
|
+
If the Claude Code CLI is on `PATH`, NBI launches it automatically. To override the location, set the `NBI_CLAUDE_CLI_PATH` environment variable before starting JupyterLab.
|
|
90
|
+
|
|
91
|
+
<img src="media/claude-settings.png" alt="Claude settings" width=700 />
|
|
92
|
+
|
|
93
|
+
#### Resuming a previous Claude session
|
|
94
|
+
|
|
95
|
+
When Claude mode is on, the chat sidebar shows a history icon next to the gear. Click it to list the Claude Code sessions recorded for the current working directory (the same transcripts the Claude Code CLI stores under `~/.claude/projects/`). Selecting a session reconnects via `resume`, so the next message you send continues that transcript with full prior context. A **New chat session** button next to the gear restarts the SDK client without typing `/clear`.
|
|
96
|
+
|
|
97
|
+
Long Claude turns surface an elapsed-time counter, a heartbeat-driven pulse with a "may be slow" copy flip after 30 seconds, and inline tool-call narration so the sidebar reflects what the agent is doing rather than appearing stuck.
|
|
98
|
+
|
|
99
|
+
In Claude mode, workspace files attached as chat context arrive as `@`-mention pointers rather than inlined file contents. Claude's Read tool fetches them on demand, which means images, large files, and notebooks (cell-aware) now work where the older content-injection path silently truncated or skipped them.
|
|
100
|
+
|
|
101
|
+
#### Claude Code launcher tile
|
|
102
|
+
|
|
103
|
+
When the Claude CLI is on `PATH`, the JupyterLab launcher (the panel that opens with new tabs) shows a **Claude Code** tile alongside the standard kernel launchers. Clicking it opens a session picker; search across past transcripts and resume one in a fresh terminal, or start a new session in the file browser's active subdirectory. Session IDs are copyable from the picker for paste into a `claude --resume <id>` command.
|
|
104
|
+
|
|
105
|
+
#### Other coding-agent launcher tiles
|
|
106
|
+
|
|
107
|
+
When any of the following CLIs are on `PATH`, the launcher adds a tile for each. Clicking a tile opens a terminal at the file browser's current directory and runs the CLI:
|
|
108
|
+
|
|
109
|
+
- **opencode** (override path with `NBI_OPENCODE_CLI_PATH`)
|
|
110
|
+
- **Pi** (override path with `NBI_PI_CLI_PATH`)
|
|
111
|
+
- **GitHub Copilot CLI** (override path with `NBI_GITHUB_COPILOT_CLI_PATH`)
|
|
112
|
+
- **OpenAI Codex** (override path with `NBI_CODEX_CLI_PATH`)
|
|
113
|
+
|
|
114
|
+
Tiles add and remove themselves as CLIs become available or unavailable; they do not require Claude mode. Clicking any tile (or **New Session** from the Claude resume dialog) prompts for a start directory, so the terminal opens where you want rather than always at the file-browser cwd.
|
|
115
|
+
|
|
116
|
+
### Agent mode
|
|
117
|
+
|
|
118
|
+
In Agent mode, the built-in AI agent creates, edits, and executes notebooks for you interactively. It can detect issues in cells and fix them.
|
|
119
|
+
|
|
120
|
+

|
|
121
|
+
|
|
122
|
+
### Code generation with inline chat
|
|
123
|
+
|
|
124
|
+
Use the sparkle icon on the cell toolbar or the keyboard shortcut to show the inline chat popover.
|
|
125
|
+
|
|
126
|
+
`Ctrl+G` / `Cmd+G` opens the popover. `Ctrl+Enter` / `Cmd+Enter` accepts the suggestion. `Esc` closes it. The accept shortcut overrides JupyterLab's default _run cell_ binding **only while the popover is open** — outside the popover, `Ctrl+Enter` / `Cmd+Enter` still runs the active cell.
|
|
127
|
+
|
|
128
|
+

|
|
129
|
+
|
|
130
|
+
### Auto-complete
|
|
131
|
+
|
|
132
|
+
Auto-complete suggestions are shown as you type. `Tab` accepts. NBI provides auto-complete in code cells and Python file editors.
|
|
133
|
+
|
|
134
|
+
<img src="media/inline-completion.gif" alt="Auto-complete" width=700 />
|
|
135
|
+
|
|
136
|
+
### Chat interface
|
|
137
|
+
|
|
138
|
+
<img src="media/copilot-chat.gif" alt="Chat interface" width=600 />
|
|
139
|
+
|
|
140
|
+
You can paste or attach images alongside a chat prompt — the image goes to the model as input when the active model supports vision.
|
|
141
|
+
|
|
142
|
+
### Cell output actions
|
|
143
|
+
|
|
144
|
+
Right-click a cell output (or hover for the toolbar) to send it straight into the chat as context:
|
|
145
|
+
|
|
146
|
+
- **Explain cell errors** — surfaces a "Troubleshoot errors in output" entry on cells that raised; opens a chat turn with the traceback attached.
|
|
147
|
+
- **Ask about cell outputs** — attaches the output as structured context for a follow-up question. Includes images for vision-capable models.
|
|
148
|
+
- **Show output toolbar** — the floating toolbar above each output with quick **Explain** / **Ask** / **Troubleshoot** actions.
|
|
149
|
+
|
|
150
|
+
Each is per-user toggleable from Settings (saved as `enable_explain_error`, `enable_output_followup`, `enable_output_toolbar` in `config.json`, default on) and admin-lockable via `NBI_EXPLAIN_ERROR_POLICY` / `NBI_OUTPUT_FOLLOWUP_POLICY` / `NBI_OUTPUT_TOOLBAR_POLICY`.
|
|
151
|
+
|
|
152
|
+
### Notebook toolbar generation
|
|
153
|
+
|
|
154
|
+
Active notebooks show a sparkle icon on the toolbar. Click it to open a popover that scopes the generation request to that specific notebook — handy for multi-notebook sessions where you don't want the chat sidebar to compete for context.
|
|
155
|
+
|
|
156
|
+
### Reload open files when changed on disk
|
|
157
|
+
|
|
158
|
+
NBI reloads open document tabs when their files change on disk, so edits an AI agent makes via its Read/Write tools appear in the editor without a manual refresh. Tabs with unsaved local edits are skipped so user work is never clobbered. Toggle via the **NBI Settings dialog → External changes → "Refresh open files when changed on disk"** (default on).
|
|
159
|
+
|
|
160
|
+
## Configuration
|
|
161
|
+
|
|
162
|
+
Configure your provider, model, and API key from NBI Settings — the gear icon in the chat panel, the `/settings` chat command, or the JupyterLab command palette. For background, see the [provider blog post](https://notebook-intelligence.github.io/notebook-intelligence/blog/2025/03/05/support-for-any-llm-provider.html).
|
|
163
|
+
|
|
164
|
+
<img src="media/provider-list.png" alt="Settings dialog" width=500 />
|
|
165
|
+
|
|
166
|
+
### Configuration files
|
|
167
|
+
|
|
168
|
+
NBI saves configuration at `~/.jupyter/nbi/config.json`. It also supports an environment-wide base configuration at `<env-prefix>/share/jupyter/nbi/config.json` — organizations can ship default configuration there, and user changes save as overrides on top.
|
|
169
|
+
|
|
170
|
+
These config files store provider, model, and MCP configuration. **API keys for custom LLM providers are also stored here in plaintext** — never commit `~/.jupyter/nbi/config.json` to git, share it, or sync it across users. If a key leaks, rotate it at the provider immediately.
|
|
171
|
+
|
|
172
|
+
> Manual edits to `config.json` require a JupyterLab restart to take effect. Edits via the Settings dialog are picked up live.
|
|
173
|
+
|
|
174
|
+
### Admin policies
|
|
175
|
+
|
|
176
|
+
Most settings panel toggles can be locked by org administrators. Two shapes:
|
|
177
|
+
|
|
178
|
+
**Boolean policies** use the `*_POLICY` suffix and accept three values: `user-choice` (default — user toggles freely), `force-on` (locked enabled), `force-off` (locked disabled). When forced, the panel control is disabled with a "Locked by your administrator" tooltip and any client-side write is ignored.
|
|
179
|
+
|
|
180
|
+
| Env var | Locks the Settings panel control for |
|
|
181
|
+
| ---------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- |
|
|
182
|
+
| `NBI_EXPLAIN_ERROR_POLICY` | "Explain cell errors" |
|
|
183
|
+
| `NBI_OUTPUT_FOLLOWUP_POLICY` | "Ask about cell outputs" |
|
|
184
|
+
| `NBI_OUTPUT_TOOLBAR_POLICY` | "Show output toolbar" |
|
|
185
|
+
| `NBI_CLAUDE_MODE_POLICY` | "Enable Claude mode" |
|
|
186
|
+
| `NBI_CLAUDE_CONTINUE_CONVERSATION_POLICY` | "Remember conversation history" |
|
|
187
|
+
| `NBI_CLAUDE_CODE_TOOLS_POLICY` | "Claude Code tools" |
|
|
188
|
+
| `NBI_CLAUDE_JUPYTER_UI_TOOLS_POLICY` | "Jupyter UI tools" |
|
|
189
|
+
| `NBI_CLAUDE_SETTING_SOURCE_USER_POLICY` | Setting source: User |
|
|
190
|
+
| `NBI_CLAUDE_SETTING_SOURCE_PROJECT_POLICY` | Setting source: Project |
|
|
191
|
+
| `NBI_STORE_GITHUB_ACCESS_TOKEN_POLICY` | "Remember my GitHub Copilot access token" |
|
|
192
|
+
| `NBI_SKILLS_MANAGEMENT_POLICY` | The Skills tab (force-off hides it and 403s the API; also disables the managed-skills reconciler) |
|
|
193
|
+
| `NBI_CLAUDE_MCP_MANAGEMENT_POLICY` | The Claude-mode MCP Servers tab (force-off hides it and 403s `/claude-mcp/*`; independent of the non-Claude MCP Servers tab) |
|
|
194
|
+
| `NBI_CLAUDE_PLUGINS_MANAGEMENT_POLICY` | The Claude-mode Plugins tab (force-off hides it and 403s `/plugins/*`) |
|
|
195
|
+
| `NBI_TERMINAL_DRAG_DROP_POLICY` | Terminal drag-drop file attach feature |
|
|
196
|
+
| `NBI_REFRESH_OPEN_FILES_ON_DISK_CHANGE_POLICY` | "Refresh open files when changed on disk" |
|
|
197
|
+
|
|
198
|
+
The first three also have matching traitlets on `NotebookIntelligence` (`explain_error_policy`, `output_followup_policy`, `output_toolbar_policy`); add the others as needed in the same shape:
|
|
199
|
+
|
|
200
|
+
```python
|
|
201
|
+
c.NotebookIntelligence.claude_mode_policy = "force-on"
|
|
202
|
+
c.NotebookIntelligence.claude_jupyter_ui_tools_policy = "force-off"
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
Per-user preferences (default on for the cell-output features) live in `config.json` as `enable_explain_error`, `enable_output_followup`, `enable_output_toolbar`.
|
|
206
|
+
|
|
207
|
+
**List-shaped denylists** (LLM providers, built-in tools, coding-agent launcher tiles) use traitlets rather than `*_POLICY` env vars. See [`docs/admin-guide.md`](docs/admin-guide.md#restricting-features-for-managed-deployments) for the `disabled_providers`, `disabled_tools`, and `disabled_coding_agent_launchers` recipes.
|
|
208
|
+
|
|
209
|
+
**Value-presence locks** for non-boolean settings: setting the env var to a non-empty value pins the control to that value and disables it. Empty/unset = user-choice.
|
|
210
|
+
|
|
211
|
+
| Env var | Pins |
|
|
212
|
+
| -------------------------------------- | ---------------------------------------------------------------------------- |
|
|
213
|
+
| `NBI_CHAT_MODEL_PROVIDER` | General → Chat model → Provider |
|
|
214
|
+
| `NBI_CHAT_MODEL_ID` | General → Chat model → Model |
|
|
215
|
+
| `NBI_INLINE_COMPLETION_MODEL_PROVIDER` | General → Auto-complete model → Provider |
|
|
216
|
+
| `NBI_INLINE_COMPLETION_MODEL_ID` | General → Auto-complete model → Model |
|
|
217
|
+
| `NBI_CLAUDE_CHAT_MODEL` | Claude → Chat model |
|
|
218
|
+
| `NBI_CLAUDE_INLINE_COMPLETION_MODEL` | Claude → Auto-complete model |
|
|
219
|
+
| `ANTHROPIC_API_KEY` | Claude → API Key (input is locked + blanked; the SDK reads the env directly) |
|
|
220
|
+
| `ANTHROPIC_BASE_URL` | Claude → Base URL |
|
|
221
|
+
|
|
222
|
+
Provider IDs: `github-copilot`, `openai-compatible`, `litellm-compatible`, `ollama`, `none`. The `*_MODEL_ID` value is whatever the chosen provider exposes (e.g. `gpt-4o`, `llama3:latest`). Claude model IDs are the literal IDs from the Anthropic API (e.g. `claude-opus-4-7`, `claude-sonnet-4-6`); empty string = "Default (recommended)"; `NBI_CLAUDE_INLINE_COMPLETION_MODEL` also accepts `none` (no inline completion in Claude mode) or `inherit` (use the General-tab Auto-complete model).
|
|
223
|
+
|
|
224
|
+
**Upload tunables** govern the shared upload endpoint used by both chat-sidebar file attachments and terminal drag-drop:
|
|
225
|
+
|
|
226
|
+
| Env var | Default | Behavior |
|
|
227
|
+
| ---------------------------- | ------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
228
|
+
| `NBI_UPLOAD_MAX_MB` | `50` | Per-file size cap in megabytes. Requests over the cap return HTTP 413. Set to `0` to disable the cap entirely. |
|
|
229
|
+
| `NBI_UPLOAD_RETENTION_HOURS` | `24` | How long staged uploads survive in the temp directory before the next upload sweeps them. Set to `0` to keep only the atexit purge (uploads survive the session). |
|
|
230
|
+
|
|
231
|
+
The same values are also configurable via the `upload_max_mb` and `upload_retention_hours` traitlets on `NotebookIntelligence`.
|
|
232
|
+
|
|
233
|
+
### Remembering GitHub Copilot login
|
|
234
|
+
|
|
235
|
+
NBI can remember your GitHub Copilot login so you don't have to sign in again after a JupyterLab or system restart.
|
|
236
|
+
|
|
237
|
+
> [!CAUTION]
|
|
238
|
+
> If you enable this, NBI encrypts the token and stores it in `~/.jupyter/nbi/user-data.json`. Never share this file. The encryption uses a default password unless you set `NBI_GH_ACCESS_TOKEN_PASSWORD` to a custom value — on shared or multi-tenant systems, set a custom password before enabling this option.
|
|
239
|
+
|
|
240
|
+
```bash
|
|
241
|
+
NBI_GH_ACCESS_TOKEN_PASSWORD=my_custom_password
|
|
242
|
+
```
|
|
243
|
+
|
|
244
|
+
To enable, check _Remember my GitHub Copilot access token_ in the Settings dialog.
|
|
245
|
+
|
|
246
|
+
<img src="media/remember-gh-access-token.png" alt="Remember access token" width=500 />
|
|
247
|
+
|
|
248
|
+
If the stored token fails to authenticate (expired, revoked, password mismatch), NBI prompts you to sign in again.
|
|
249
|
+
|
|
250
|
+
## Built-in tools
|
|
251
|
+
|
|
252
|
+
These tools are available in Agent mode and to MCP-enabled chats.
|
|
253
|
+
|
|
254
|
+
| Tool | What it does |
|
|
255
|
+
| --------------------------------------------- | -------------------------------------------------------------------------------------- |
|
|
256
|
+
| **Notebook Edit** (`nbi-notebook-edit`) | Edit notebooks via the JupyterLab notebook editor. |
|
|
257
|
+
| **Notebook Execute** (`nbi-notebook-execute`) | Run notebooks in the JupyterLab UI. |
|
|
258
|
+
| **Python File Edit** (`nbi-python-file-edit`) | Edit Python files via the JupyterLab file editor. |
|
|
259
|
+
| **File Edit** (`nbi-file-edit`) | Edit files in the Jupyter root directory. |
|
|
260
|
+
| **File Read** (`nbi-file-read`) | Read files in the Jupyter root directory. |
|
|
261
|
+
| **Command Execute** (`nbi-command-execute`) | Execute shell commands using the embedded terminal in Agent UI or JupyterLab terminal. |
|
|
262
|
+
|
|
263
|
+
In multi-tenant deployments, `nbi-command-execute` and `nbi-file-edit` are effectively arbitrary code execution as the user. See [`docs/admin-guide.md`](docs/admin-guide.md#security-model) for guidance on disabling them.
|
|
264
|
+
|
|
265
|
+
## Model Context Protocol (MCP) support
|
|
266
|
+
|
|
267
|
+
NBI integrates with [MCP](https://modelcontextprotocol.io) servers. It supports both stdio and Streamable HTTP transports. **MCP server tools are supported; resources and prompts are not yet supported.**
|
|
268
|
+
|
|
269
|
+
Add MCP servers by editing `~/.jupyter/nbi/mcp.json`. An environment-wide base file at `<env-prefix>/share/jupyter/nbi/mcp.json` is also supported.
|
|
270
|
+
|
|
271
|
+
> [!NOTE]
|
|
272
|
+
> MCP requires an LLM model with tool-calling capability. All GitHub Copilot models in NBI support this. For other providers, choose a tool-calling-capable model.
|
|
273
|
+
|
|
274
|
+
> [!CAUTION]
|
|
275
|
+
> Most MCP servers run on the same machine as JupyterLab and can make irreversible changes or access private data. Only install MCP servers from trusted sources.
|
|
276
|
+
|
|
277
|
+
### MCP config example
|
|
278
|
+
|
|
279
|
+
```json
|
|
280
|
+
{
|
|
281
|
+
"mcpServers": {
|
|
282
|
+
"filesystem": {
|
|
283
|
+
"command": "npx",
|
|
284
|
+
"args": [
|
|
285
|
+
"-y",
|
|
286
|
+
"@modelcontextprotocol/server-filesystem",
|
|
287
|
+
"/Users/mbektas/mcp-test"
|
|
288
|
+
]
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
```
|
|
293
|
+
|
|
294
|
+
For stdio servers you can pass extra environment variables under `env`:
|
|
295
|
+
|
|
296
|
+
```json
|
|
297
|
+
"mcpServers": {
|
|
298
|
+
"servername": {
|
|
299
|
+
"command": "",
|
|
300
|
+
"args": [],
|
|
301
|
+
"env": {
|
|
302
|
+
"ENV_VAR_NAME": "ENV_VAR_VALUE"
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
```
|
|
307
|
+
|
|
308
|
+
For Streamable HTTP servers you can also specify request headers:
|
|
309
|
+
|
|
310
|
+
```json
|
|
311
|
+
"mcpServers": {
|
|
312
|
+
"remoteservername": {
|
|
313
|
+
"url": "http://127.0.0.1:8080/mcp",
|
|
314
|
+
"headers": {
|
|
315
|
+
"Authorization": "Bearer mysecrettoken"
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
```
|
|
320
|
+
|
|
321
|
+
To temporarily disable a configured server without removing it, set `"disabled": true`:
|
|
322
|
+
|
|
323
|
+
```json
|
|
324
|
+
"mcpServers": {
|
|
325
|
+
"servername2": {
|
|
326
|
+
"command": "",
|
|
327
|
+
"args": [],
|
|
328
|
+
"disabled": true
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
```
|
|
332
|
+
|
|
333
|
+
## Rulesets
|
|
334
|
+
|
|
335
|
+
NBI's ruleset system lets you define guidelines and best practices that get injected into AI prompts automatically — for consistent coding standards, project conventions, or domain knowledge. Rules are markdown files in `~/.jupyter/nbi/rules/` and can scope by file pattern, kernel, directory, or chat mode.
|
|
336
|
+
|
|
337
|
+
A two-line example:
|
|
338
|
+
|
|
339
|
+
```markdown
|
|
340
|
+
---
|
|
341
|
+
priority: 10
|
|
342
|
+
---
|
|
343
|
+
|
|
344
|
+
- Always use type hints in Python functions.
|
|
345
|
+
- Add docstrings to all public functions.
|
|
346
|
+
```
|
|
347
|
+
|
|
348
|
+
For full details (frontmatter reference, mode-specific rules, auto-reload), see [`docs/rulesets.md`](docs/rulesets.md).
|
|
349
|
+
|
|
350
|
+
## Claude Skills
|
|
351
|
+
|
|
352
|
+
The Settings panel exposes a top-level **Skills** tab for managing the skills that Claude can invoke. Skills are stored under `~/.claude/skills/` (user) or `<project>/.claude/skills/` (project). You can create and edit skills inline, duplicate, rename, delete (with undo), or import from a public GitHub repo. The tab is visible in any mode; when Claude mode is off, a hint banner notes that skills only take effect inside Claude sessions (handy for authoring skills now and using them when you turn Claude mode on later).
|
|
353
|
+
|
|
354
|
+
For organization-wide deployments, your admin can ship a curated manifest of skills and keep them in sync by setting `NBI_SKILLS_MANIFEST`. Skills installed this way are marked **Managed** and are read-only in the UI. Admins who want to keep managed skills but disallow ad-hoc GitHub imports use `NBI_ALLOW_GITHUB_SKILL_IMPORT=false`.
|
|
355
|
+
|
|
356
|
+
For full details, see [`docs/skills.md`](docs/skills.md).
|
|
357
|
+
|
|
358
|
+
## Claude MCP Servers
|
|
359
|
+
|
|
360
|
+
When Claude mode is enabled and the Claude CLI is available, the Settings panel exposes an **MCP Servers** tab that manages the user, project, and local-scope MCP entries Claude Code reads from `~/.claude.json` and the project's `.mcp.json`. This is a different tab from NBI's own MCP Servers tab (which manages the servers used by the non-Claude chat path); the two never appear together, and the Settings dialog shows whichever one applies to your current mode.
|
|
361
|
+
|
|
362
|
+
Reads come from Claude's JSON config files directly. Writes (add and remove) shell out to `claude mcp add` and `claude mcp remove` so Claude remains the source of truth for any side effects (project-trust prompts, OAuth bookkeeping). Each server entry can be toggled on or off per workspace without removing it, and the **Add MCP server** dialog accepts a JSON-paste path that takes a Claude / Cursor / VS Code MCP config blob and pre-fills the form after validating the shape. Admins can lock the tab with `NBI_CLAUDE_MCP_MANAGEMENT_POLICY=force-off`.
|
|
363
|
+
|
|
364
|
+
## Claude Plugins
|
|
365
|
+
|
|
366
|
+
When Claude mode is enabled and the Claude CLI is available, the Settings panel exposes a **Plugins** tab wrapping `claude plugin` for install, uninstall, enable, disable, and marketplace add (for example: add a marketplace from a GitHub repo, then install plugins it publishes). Each installed plugin's description, author, version, and source render inline, and the tab surfaces a per-plugin **Update** button when a newer version is available upstream. A marketplace picker lets you browse the configured marketplaces and install plugins directly from there. Marketplaces hosted on GitHub reuse the same `GITHUB_TOKEN` / `GH_TOKEN` / `gh auth token` precedence as Skills imports; the token is passed via env to the subprocess and never appears in argv or DEBUG logs. See Anthropic's [plugin docs](https://code.claude.com/docs/en/plugins) for what a plugin is and how marketplaces work.
|
|
367
|
+
|
|
368
|
+
Admins can lock the entire tab with `NBI_CLAUDE_PLUGINS_MANAGEMENT_POLICY=force-off`, or keep the tab and block only GitHub-sourced marketplaces with `NBI_ALLOW_GITHUB_PLUGIN_IMPORT=false`.
|
|
369
|
+
|
|
370
|
+
## Chat feedback
|
|
371
|
+
|
|
372
|
+
Enable thumbs-up/down feedback on AI responses by setting:
|
|
373
|
+
|
|
374
|
+
```python
|
|
375
|
+
c.NotebookIntelligence.enable_chat_feedback = True
|
|
376
|
+
```
|
|
377
|
+
|
|
378
|
+
…or via CLI:
|
|
379
|
+
|
|
380
|
+
```bash
|
|
381
|
+
jupyter lab --NotebookIntelligence.enable_chat_feedback=true
|
|
382
|
+
```
|
|
383
|
+
|
|
384
|
+
The feedback fires an in-process `telemetry` event. Nothing leaves the process by default — see the [admin guide](docs/admin-guide.md#chat-feedback-event-hook) for how to wire it into your observability stack.
|
|
385
|
+
|
|
386
|
+
<img src="media/chat-feedback.png" alt="Chat feedback" width=500 />
|
|
387
|
+
|
|
388
|
+
## Documentation
|
|
389
|
+
|
|
390
|
+
- [`docs/admin-guide.md`](docs/admin-guide.md) — deployment, env vars, security model, air-gap, multi-tenancy.
|
|
391
|
+
- [`docs/skills.md`](docs/skills.md) — Claude Skills management and the org-manifest reconciler.
|
|
392
|
+
- [`docs/rulesets.md`](docs/rulesets.md) — ruleset frontmatter and discovery.
|
|
393
|
+
- [`docs/troubleshooting.md`](docs/troubleshooting.md) — common problems with copy-pasteable fixes.
|
|
394
|
+
- [`PRIVACY.md`](PRIVACY.md) — what NBI sends to which provider, and the egress allowlist.
|
|
395
|
+
- [`SECURITY.md`](SECURITY.md) — how to report a vulnerability.
|
|
396
|
+
- [`CHANGELOG.md`](CHANGELOG.md) — release history.
|
|
397
|
+
- [`CONTRIBUTING.md`](CONTRIBUTING.md) — building NBI from source. Skip this if you just want to use NBI.
|
|
398
|
+
|
|
399
|
+
## Further reading
|
|
400
|
+
|
|
401
|
+
- [Introducing Notebook Intelligence!](https://notebook-intelligence.github.io/notebook-intelligence/blog/2025/01/08/introducing-notebook-intelligence.html)
|
|
402
|
+
- [Building AI Extensions for JupyterLab](https://notebook-intelligence.github.io/notebook-intelligence/blog/2025/02/05/building-ai-extensions-for-jupyterlab.html)
|
|
403
|
+
- [Building AI Agents for JupyterLab](https://notebook-intelligence.github.io/notebook-intelligence/blog/2025/02/09/building-ai-agents-for-jupyterlab.html)
|
|
404
|
+
- [Notebook Intelligence now supports any LLM Provider and AI Model!](https://notebook-intelligence.github.io/notebook-intelligence/blog/2025/03/05/support-for-any-llm-provider.html)
|
|
405
|
+
|
|
406
|
+
## Roadmap
|
|
407
|
+
|
|
408
|
+
NBI 5.x is stable. New features land in minor releases (5.1, 5.2, …); breaking changes are reserved for the next major (6.x) and will be announced in the [changelog](CHANGELOG.md). Upgrading from 4.x? See the [5.0.0 migration note](CHANGELOG.md#migration-note) for the `fastmcp` → `mcp` dependency swap, the new path sandboxes, and the workspace-file-attach behavior change.
|
|
409
|
+
|
|
410
|
+
## License
|
|
411
|
+
|
|
412
|
+
Licensed under [GPL-3.0](LICENSE).
|