@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.
Files changed (137) hide show
  1. package/LICENSE +674 -0
  2. package/README.md +412 -0
  3. package/lib/api.d.ts +288 -0
  4. package/lib/api.js +927 -0
  5. package/lib/cell-output-bundle.d.ts +25 -0
  6. package/lib/cell-output-bundle.js +129 -0
  7. package/lib/cell-output-toolbar.d.ts +26 -0
  8. package/lib/cell-output-toolbar.js +188 -0
  9. package/lib/chat-progress-feedback.d.ts +3 -0
  10. package/lib/chat-progress-feedback.js +27 -0
  11. package/lib/chat-sidebar.d.ts +92 -0
  12. package/lib/chat-sidebar.js +3452 -0
  13. package/lib/command-ids.d.ts +39 -0
  14. package/lib/command-ids.js +44 -0
  15. package/lib/components/ask-user-question.d.ts +2 -0
  16. package/lib/components/ask-user-question.js +85 -0
  17. package/lib/components/checkbox.d.ts +2 -0
  18. package/lib/components/checkbox.js +30 -0
  19. package/lib/components/claude-mcp-panel.d.ts +2 -0
  20. package/lib/components/claude-mcp-panel.js +275 -0
  21. package/lib/components/claude-mcp-paste.d.ts +7 -0
  22. package/lib/components/claude-mcp-paste.js +104 -0
  23. package/lib/components/claude-session-picker.d.ts +8 -0
  24. package/lib/components/claude-session-picker.js +127 -0
  25. package/lib/components/form-dialog.d.ts +25 -0
  26. package/lib/components/form-dialog.js +35 -0
  27. package/lib/components/launcher-picker.d.ts +6 -0
  28. package/lib/components/launcher-picker.js +135 -0
  29. package/lib/components/mcp-util.d.ts +2 -0
  30. package/lib/components/mcp-util.js +37 -0
  31. package/lib/components/notebook-generation-popover.d.ts +7 -0
  32. package/lib/components/notebook-generation-popover.js +60 -0
  33. package/lib/components/pill.d.ts +2 -0
  34. package/lib/components/pill.js +5 -0
  35. package/lib/components/plugins-panel.d.ts +3 -0
  36. package/lib/components/plugins-panel.js +466 -0
  37. package/lib/components/settings-panel.d.ts +11 -0
  38. package/lib/components/settings-panel.js +742 -0
  39. package/lib/components/skills-panel.d.ts +2 -0
  40. package/lib/components/skills-panel.js +1264 -0
  41. package/lib/handler.d.ts +8 -0
  42. package/lib/handler.js +36 -0
  43. package/lib/icons.d.ts +45 -0
  44. package/lib/icons.js +54 -0
  45. package/lib/index.d.ts +8 -0
  46. package/lib/index.js +2079 -0
  47. package/lib/markdown-renderer.d.ts +10 -0
  48. package/lib/markdown-renderer.js +64 -0
  49. package/lib/notebook-generation-toolbar.d.ts +16 -0
  50. package/lib/notebook-generation-toolbar.js +197 -0
  51. package/lib/notebook-generation.d.ts +8 -0
  52. package/lib/notebook-generation.js +12 -0
  53. package/lib/open-file-refresh-watcher-env.d.ts +4 -0
  54. package/lib/open-file-refresh-watcher-env.js +33 -0
  55. package/lib/open-file-refresh-watcher.d.ts +97 -0
  56. package/lib/open-file-refresh-watcher.js +190 -0
  57. package/lib/shell-utils.d.ts +6 -0
  58. package/lib/shell-utils.js +9 -0
  59. package/lib/task-target-notebook.d.ts +2 -0
  60. package/lib/task-target-notebook.js +28 -0
  61. package/lib/terminal-drag-format.d.ts +9 -0
  62. package/lib/terminal-drag-format.js +23 -0
  63. package/lib/terminal-drag.d.ts +12 -0
  64. package/lib/terminal-drag.js +268 -0
  65. package/lib/tokens.d.ts +149 -0
  66. package/lib/tokens.js +88 -0
  67. package/lib/tour/tour-anchors.d.ts +18 -0
  68. package/lib/tour/tour-anchors.js +18 -0
  69. package/lib/tour/tour-config.d.ts +66 -0
  70. package/lib/tour/tour-config.js +99 -0
  71. package/lib/tour/tour-defaults.json +58 -0
  72. package/lib/tour/tour-events.d.ts +19 -0
  73. package/lib/tour/tour-events.js +30 -0
  74. package/lib/tour/tour-overlay.d.ts +6 -0
  75. package/lib/tour/tour-overlay.js +350 -0
  76. package/lib/tour/tour-state.d.ts +20 -0
  77. package/lib/tour/tour-state.js +81 -0
  78. package/lib/tour/tour-steps.d.ts +33 -0
  79. package/lib/tour/tour-steps.js +216 -0
  80. package/lib/utils.d.ts +53 -0
  81. package/lib/utils.js +385 -0
  82. package/package.json +258 -0
  83. package/schema/plugin.json +42 -0
  84. package/src/api.ts +1424 -0
  85. package/src/cell-output-bundle.ts +176 -0
  86. package/src/cell-output-toolbar.ts +232 -0
  87. package/src/chat-progress-feedback.ts +35 -0
  88. package/src/chat-sidebar.tsx +5147 -0
  89. package/src/command-ids.ts +67 -0
  90. package/src/components/ask-user-question.tsx +151 -0
  91. package/src/components/checkbox.tsx +62 -0
  92. package/src/components/claude-mcp-panel.tsx +543 -0
  93. package/src/components/claude-mcp-paste.ts +132 -0
  94. package/src/components/claude-session-picker.tsx +214 -0
  95. package/src/components/form-dialog.tsx +75 -0
  96. package/src/components/launcher-picker.tsx +237 -0
  97. package/src/components/mcp-util.ts +53 -0
  98. package/src/components/notebook-generation-popover.tsx +127 -0
  99. package/src/components/pill.tsx +15 -0
  100. package/src/components/plugins-panel.tsx +774 -0
  101. package/src/components/settings-panel.tsx +1631 -0
  102. package/src/components/skills-panel.tsx +2084 -0
  103. package/src/handler.ts +51 -0
  104. package/src/icons.ts +71 -0
  105. package/src/index.ts +2583 -0
  106. package/src/markdown-renderer.tsx +153 -0
  107. package/src/notebook-generation-toolbar.tsx +281 -0
  108. package/src/notebook-generation.ts +23 -0
  109. package/src/open-file-refresh-watcher-env.ts +52 -0
  110. package/src/open-file-refresh-watcher.ts +260 -0
  111. package/src/shell-utils.ts +10 -0
  112. package/src/svg.d.ts +4 -0
  113. package/src/task-target-notebook.ts +37 -0
  114. package/src/terminal-drag-format.ts +29 -0
  115. package/src/terminal-drag.ts +382 -0
  116. package/src/tokens.ts +171 -0
  117. package/src/tour/tour-anchors.ts +21 -0
  118. package/src/tour/tour-config.ts +160 -0
  119. package/src/tour/tour-events.ts +34 -0
  120. package/src/tour/tour-overlay.tsx +474 -0
  121. package/src/tour/tour-state.ts +87 -0
  122. package/src/tour/tour-steps.ts +281 -0
  123. package/src/utils.ts +455 -0
  124. package/style/base.css +3238 -0
  125. package/style/icons/cell-toolbar-bug.svg +5 -0
  126. package/style/icons/cell-toolbar-chat.svg +5 -0
  127. package/style/icons/cell-toolbar-sparkle.svg +5 -0
  128. package/style/icons/claude.svg +1 -0
  129. package/style/icons/copilot-warning.svg +1 -0
  130. package/style/icons/copilot.svg +1 -0
  131. package/style/icons/copy.svg +1 -0
  132. package/style/icons/openai.svg +1 -0
  133. package/style/icons/opencode.svg +1 -0
  134. package/style/icons/sparkles-warning.svg +5 -0
  135. package/style/icons/sparkles.svg +1 -0
  136. package/style/index.css +1 -0
  137. package/style/index.js +1 -0
package/lib/api.d.ts ADDED
@@ -0,0 +1,288 @@
1
+ import { Signal } from '@lumino/signaling';
2
+ import { IChatCompletionResponseEmitter, IChatParticipant, IContextItem, ITelemetryEvent, IToolSelections, RequestDataType } from './tokens';
3
+ export declare enum GitHubCopilotLoginStatus {
4
+ NotLoggedIn = "NOT_LOGGED_IN",
5
+ ActivatingDevice = "ACTIVATING_DEVICE",
6
+ LoggingIn = "LOGGING_IN",
7
+ LoggedIn = "LOGGED_IN"
8
+ }
9
+ export interface IDeviceVerificationInfo {
10
+ verificationURI: string;
11
+ userCode: string;
12
+ }
13
+ export declare enum ClaudeModelType {
14
+ None = "none",
15
+ Inherit = "inherit",
16
+ Default = ""
17
+ }
18
+ export interface IClaudeModelInfo {
19
+ id: string;
20
+ name: string;
21
+ contextWindow: number;
22
+ }
23
+ export interface IClaudeSessionInfo {
24
+ session_id: string;
25
+ path: string;
26
+ modified_at: number;
27
+ created_at: number;
28
+ preview: string;
29
+ cwd: string;
30
+ }
31
+ export interface IClaudeSessionList {
32
+ sessions: IClaudeSessionInfo[];
33
+ currentCwd: string;
34
+ }
35
+ export type ClaudeSessionScope = 'cwd' | 'all';
36
+ export declare enum ClaudeToolType {
37
+ ClaudeCodeTools = "claude-code:built-in-tools",
38
+ JupyterUITools = "nbi:built-in-jupyter-ui-tools"
39
+ }
40
+ export type SkillScope = 'user' | 'project';
41
+ export type ClaudeMCPScope = 'user' | 'project' | 'local';
42
+ export type ClaudeMCPTransport = 'stdio' | 'sse' | 'http';
43
+ export type PluginScope = 'user' | 'project' | 'local';
44
+ export interface IPluginInfo {
45
+ id?: string;
46
+ name?: string;
47
+ scope?: PluginScope | string;
48
+ enabled?: boolean;
49
+ marketplace?: string;
50
+ version?: string;
51
+ description?: string;
52
+ [key: string]: unknown;
53
+ }
54
+ export interface IPluginMarketplaceInfo {
55
+ name?: string;
56
+ source?: string;
57
+ scope?: PluginScope | string;
58
+ description?: string;
59
+ version?: string;
60
+ plugin_count?: number;
61
+ plugin_names?: string[];
62
+ [key: string]: unknown;
63
+ }
64
+ export interface IPluginMarketplacePluginInfo extends IPluginInfo {
65
+ source?: unknown;
66
+ category?: string;
67
+ tags?: string[];
68
+ }
69
+ export interface IClaudeMCPServer {
70
+ name: string;
71
+ scope: ClaudeMCPScope;
72
+ transport: ClaudeMCPTransport | string;
73
+ command: string;
74
+ args: string[];
75
+ env: Record<string, string>;
76
+ url: string;
77
+ headers: Record<string, string>;
78
+ disabledForWorkspace: boolean;
79
+ }
80
+ export interface IClaudeMCPAddInput {
81
+ name: string;
82
+ scope: ClaudeMCPScope;
83
+ transport: ClaudeMCPTransport;
84
+ commandOrUrl: string;
85
+ args?: string[];
86
+ env?: Record<string, string>;
87
+ headers?: Record<string, string>;
88
+ }
89
+ export interface ISkillSummary {
90
+ scope: SkillScope;
91
+ name: string;
92
+ description: string;
93
+ allowedTools: string[];
94
+ rootPath: string;
95
+ files: string[];
96
+ source: string;
97
+ managed: boolean;
98
+ managedSource: string;
99
+ managedRef: string;
100
+ tracksUpstream: boolean;
101
+ trackingRef: string;
102
+ }
103
+ export interface IReconcileResult {
104
+ added: number;
105
+ updated: number;
106
+ removed: number;
107
+ unchanged: number;
108
+ errors: string[];
109
+ }
110
+ export interface ISkillDetail extends ISkillSummary {
111
+ body: string;
112
+ }
113
+ export interface ISkillsContext {
114
+ projectRoot: string;
115
+ projectName: string;
116
+ userSkillsDir: string;
117
+ projectSkillsDir: string;
118
+ }
119
+ export interface ISkillImportPreview {
120
+ name: string;
121
+ description: string;
122
+ allowedTools: string[];
123
+ body: string;
124
+ files: string[];
125
+ sourceUrl: string;
126
+ canonicalUrl: string;
127
+ existsInUserScope: boolean;
128
+ existsInProjectScope: boolean;
129
+ }
130
+ export declare function skillFromWire(wire: any): ISkillDetail;
131
+ export interface ISyncSkillResult {
132
+ updated: boolean;
133
+ ref: string;
134
+ }
135
+ export interface ISyncAllTrackingEntry {
136
+ scope: SkillScope;
137
+ name: string;
138
+ updated?: boolean;
139
+ ref?: string;
140
+ error?: string;
141
+ }
142
+ export interface ICellOutputFeatureFlag {
143
+ enabled: boolean;
144
+ locked: boolean;
145
+ }
146
+ export interface ICellOutputFeatures {
147
+ explain_error: ICellOutputFeatureFlag;
148
+ output_followup: ICellOutputFeatureFlag;
149
+ output_toolbar: ICellOutputFeatureFlag;
150
+ }
151
+ export type CellOutputActionFlag = Exclude<keyof ICellOutputFeatures, 'output_toolbar'>;
152
+ export type FeaturePolicyName = 'explain_error' | 'output_followup' | 'output_toolbar' | 'claude_mode' | 'claude_continue_conversation' | 'claude_code_tools' | 'claude_jupyter_ui_tools' | 'claude_setting_source_user' | 'claude_setting_source_project' | 'store_github_access_token' | 'skills_management' | 'claude_mcp_management' | 'claude_plugins_management' | 'terminal_drag_drop' | 'refresh_open_files_on_disk_change';
153
+ export type IFeaturePolicies = Record<FeaturePolicyName, ICellOutputFeatureFlag>;
154
+ export type SettingLockName = 'chat_model_provider' | 'chat_model_id' | 'inline_completion_model_provider' | 'inline_completion_model_id' | 'claude_chat_model' | 'claude_inline_completion_model' | 'claude_api_key' | 'claude_base_url';
155
+ export type ISettingLocks = Record<SettingLockName, {
156
+ locked: boolean;
157
+ }>;
158
+ export declare class NBIConfig {
159
+ get userHomeDir(): string;
160
+ get userConfigDir(): string;
161
+ get llmProviders(): [any];
162
+ get chatModels(): [any];
163
+ get inlineCompletionModels(): [any];
164
+ get defaultChatMode(): string;
165
+ get chatModel(): any;
166
+ get chatModelSupportsVision(): boolean;
167
+ get inlineCompletionModel(): any;
168
+ get usingGitHubCopilotModel(): boolean;
169
+ get storeGitHubAccessToken(): boolean;
170
+ get inlineCompletionDebouncerDelay(): number;
171
+ get toolConfig(): any;
172
+ get mcpServers(): any;
173
+ getMCPServer(serverId: string): any;
174
+ getMCPServerPrompt(serverId: string, promptName: string): any;
175
+ get mcpServerSettings(): any;
176
+ get claudeSettings(): any;
177
+ get claudeModels(): IClaudeModelInfo[];
178
+ get isInClaudeCodeMode(): boolean;
179
+ get isClaudeCliAvailable(): boolean;
180
+ get isOpenCodeCliAvailable(): boolean;
181
+ get isPiCliAvailable(): boolean;
182
+ get isGitHubCopilotCliAvailable(): boolean;
183
+ get isCodexCliAvailable(): boolean;
184
+ isCodingAgentLauncherDisabledByPolicy(launcherId: string): boolean;
185
+ get chatFeedbackEnabled(): boolean;
186
+ get tourOverrides(): Record<string, any>;
187
+ get allowGithubSkillImport(): boolean;
188
+ get additionalSkippedWorkspaceDirectories(): string[];
189
+ get allowGithubPluginImport(): boolean;
190
+ get cellOutputFeatures(): ICellOutputFeatures;
191
+ get featurePolicies(): IFeaturePolicies;
192
+ get settingLocks(): ISettingLocks;
193
+ capabilities: any;
194
+ chatParticipants: IChatParticipant[];
195
+ changed: Signal<this, void>;
196
+ }
197
+ export declare class NBIAPI {
198
+ static _loginStatus: GitHubCopilotLoginStatus;
199
+ static _deviceVerificationInfo: IDeviceVerificationInfo;
200
+ static _webSocket: WebSocket;
201
+ static _messageReceived: Signal<unknown, any>;
202
+ static config: NBIConfig;
203
+ static configChanged: Signal<NBIConfig, void>;
204
+ static githubLoginStatusChanged: Signal<unknown, void>;
205
+ static skillsReloaded: Signal<unknown, void>;
206
+ static claudeCodeHeartbeat: Signal<unknown, void>;
207
+ static initialize(): Promise<void>;
208
+ static initializeWebsocket(): Promise<void>;
209
+ static getLoginStatus(): GitHubCopilotLoginStatus;
210
+ static getDeviceVerificationInfo(): IDeviceVerificationInfo;
211
+ static getGHLoginRequired(): boolean;
212
+ static getChatEnabled(): any;
213
+ static getInlineCompletionEnabled(): any;
214
+ static loginToGitHub(): Promise<unknown>;
215
+ static logoutFromGitHub(): Promise<unknown>;
216
+ static updateGitHubLoginStatus(): Promise<void>;
217
+ static fetchCapabilities(): Promise<void>;
218
+ static setConfig(config: any): Promise<void>;
219
+ static updateOllamaModelList(): Promise<void>;
220
+ static updateClaudeModelList(): Promise<void>;
221
+ static getMCPConfigFile(): Promise<any>;
222
+ static setMCPConfigFile(config: any): Promise<any>;
223
+ static listSkills(): Promise<ISkillSummary[]>;
224
+ static getSkillsContext(): Promise<ISkillsContext>;
225
+ static readSkill(scope: SkillScope, name: string): Promise<ISkillDetail>;
226
+ static createSkill(payload: {
227
+ scope: SkillScope;
228
+ name: string;
229
+ description: string;
230
+ allowedTools: string[];
231
+ body: string;
232
+ }): Promise<ISkillDetail>;
233
+ static updateSkill(scope: SkillScope, name: string, payload: {
234
+ description?: string;
235
+ allowedTools?: string[];
236
+ body?: string;
237
+ tracksUpstream?: boolean;
238
+ }): Promise<ISkillDetail>;
239
+ static deleteSkill(scope: SkillScope, name: string): Promise<void>;
240
+ static previewSkillImport(url: string): Promise<ISkillImportPreview>;
241
+ static importSkill(payload: {
242
+ url: string;
243
+ scope: SkillScope;
244
+ name?: string;
245
+ overwrite?: boolean;
246
+ tracksUpstream?: boolean;
247
+ }): Promise<ISkillDetail>;
248
+ static syncTrackingSkill(scope: SkillScope, name: string): Promise<ISyncSkillResult>;
249
+ static syncAllTrackingSkills(): Promise<ISyncAllTrackingEntry[]>;
250
+ static listClaudeMCPServers(): Promise<IClaudeMCPServer[]>;
251
+ static addClaudeMCPServer(input: IClaudeMCPAddInput): Promise<IClaudeMCPServer>;
252
+ static removeClaudeMCPServer(name: string, scope: ClaudeMCPScope): Promise<void>;
253
+ static setClaudeMCPServerDisabled(name: string, scope: ClaudeMCPScope, disabled: boolean): Promise<IClaudeMCPServer>;
254
+ static listPlugins(): Promise<IPluginInfo[]>;
255
+ static installPlugin(plugin: string, scope?: PluginScope): Promise<void>;
256
+ static uninstallPlugin(plugin: string, scope?: PluginScope): Promise<void>;
257
+ static setPluginEnabled(plugin: string, scope: PluginScope, enabled: boolean): Promise<void>;
258
+ static listPluginMarketplaces(): Promise<IPluginMarketplaceInfo[]>;
259
+ static listPluginMarketplacePlugins(marketplace: string): Promise<IPluginMarketplacePluginInfo[]>;
260
+ static addPluginMarketplace(source: string, scope?: PluginScope): Promise<void>;
261
+ static removePluginMarketplace(name: string): Promise<void>;
262
+ static updatePluginMarketplace(name: string): Promise<void>;
263
+ static reconcileManagedSkills(): Promise<IReconcileResult>;
264
+ static renameSkill(scope: SkillScope, name: string, newName: string): Promise<ISkillDetail>;
265
+ static readBundleFile(scope: SkillScope, name: string, path: string): Promise<string>;
266
+ static writeBundleFile(scope: SkillScope, name: string, path: string, content: string): Promise<void>;
267
+ static deleteBundleFile(scope: SkillScope, name: string, path: string): Promise<void>;
268
+ static renameBundleFile(scope: SkillScope, name: string, from: string, to: string): Promise<void>;
269
+ /**
270
+ * Subscribe to inbound websocket messages for a single request, forwarding
271
+ * them to `responseEmitter`. The subscription auto-disconnects when the
272
+ * server emits StreamEnd, preventing per-request listener accumulation.
273
+ */
274
+ private static _subscribeUntilStreamEnd;
275
+ static chatRequest(messageId: string, chatId: string, prompt: string, language: string, currentDirectory: string, filename: string, additionalContext: IContextItem[], chatMode: string, toolSelections: IToolSelections, responseEmitter: IChatCompletionResponseEmitter): Promise<void>;
276
+ static reloadMCPServers(): Promise<any>;
277
+ static generateCode(messageId: string, chatId: string, prompt: string, prefix: string, suffix: string, existingCode: string, language: string, filename: string, responseEmitter: IChatCompletionResponseEmitter): Promise<void>;
278
+ static sendChatUserInput(messageId: string, data: any): Promise<void>;
279
+ static sendWebSocketMessage(messageId: string, messageType: RequestDataType, data: any): Promise<void>;
280
+ static inlineCompletionsRequest(chatId: string, messageId: string, prefix: string, suffix: string, language: string, filename: string, responseEmitter: IChatCompletionResponseEmitter): Promise<void>;
281
+ static uploadFile(file: File): Promise<{
282
+ serverPath: string;
283
+ filename: string;
284
+ }>;
285
+ static listClaudeSessions(scope?: ClaudeSessionScope): Promise<IClaudeSessionList>;
286
+ static resumeClaudeSession(sessionId: string): Promise<void>;
287
+ static emitTelemetryEvent(event: ITelemetryEvent): Promise<void>;
288
+ }