@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/src/handler.ts ADDED
@@ -0,0 +1,51 @@
1
+ // Copyright (c) Mehmet Bektas <mbektasgh@outlook.com>
2
+
3
+ import { URLExt } from '@jupyterlab/coreutils';
4
+
5
+ import { ServerConnection } from '@jupyterlab/services';
6
+
7
+ /**
8
+ * Call the API extension
9
+ *
10
+ * @param endPoint API REST end point for the extension
11
+ * @param init Initial values for the request
12
+ * @returns The response body interpreted as JSON
13
+ */
14
+ export async function requestAPI<T>(
15
+ endPoint = '',
16
+ init: RequestInit = {}
17
+ ): Promise<T> {
18
+ // Make request to Jupyter API
19
+ const settings = ServerConnection.makeSettings();
20
+ const requestUrl = URLExt.join(
21
+ settings.baseUrl,
22
+ 'notebook-intelligence', // API Namespace
23
+ endPoint
24
+ );
25
+
26
+ let response: Response;
27
+ try {
28
+ response = await ServerConnection.makeRequest(requestUrl, init, settings);
29
+ } catch (error) {
30
+ throw new ServerConnection.NetworkError(error as any);
31
+ }
32
+
33
+ let data: any = await response.text();
34
+
35
+ if (data.length > 0) {
36
+ try {
37
+ data = JSON.parse(data);
38
+ } catch (error) {
39
+ console.log('Not a JSON response body.', response);
40
+ }
41
+ }
42
+
43
+ if (!response.ok) {
44
+ throw new ServerConnection.ResponseError(
45
+ response,
46
+ data.message || data.error || data
47
+ );
48
+ }
49
+
50
+ return data;
51
+ }
package/src/icons.ts ADDED
@@ -0,0 +1,71 @@
1
+ // Central re-export of react-icons we use, with React-18-compatible
2
+ // types. react-icons 5.5.0+ types its icons as returning React.ReactNode,
3
+ // which @types/react@18's JSX namespace rejects as a JSX-component
4
+ // return type (TS2786). The runtime is unaffected — this module just
5
+ // re-types the icons through `FC<IIconBaseProps>` so the JSX runtime
6
+ // accepts them under React 18.
7
+ //
8
+ // Import icons from this module (e.g. `import { VscThumbsup } from '../icons'`)
9
+ // rather than directly from `react-icons/vsc`/`react-icons/md`, so a future
10
+ // bump of @types/react to v19+ only requires deleting this shim.
11
+
12
+ import type { FC, SVGAttributes } from 'react';
13
+ import type { IconType } from 'react-icons/lib';
14
+ import * as Md from 'react-icons/md';
15
+ import * as Vsc from 'react-icons/vsc';
16
+
17
+ interface IIconBaseProps extends SVGAttributes<SVGElement> {
18
+ size?: string | number;
19
+ color?: string;
20
+ title?: string;
21
+ }
22
+
23
+ type IconLike = FC<IIconBaseProps>;
24
+
25
+ // Typed parameter (IconType, the upstream signature) so a typo in
26
+ // `Vsc.VscFooo` is caught at compile time. The `unknown` indirection
27
+ // is what the TS error message asks for when widening a return type
28
+ // across the React 18 → React 19 ReactNode boundary.
29
+ const asIcon = (Component: IconType): IconLike =>
30
+ Component as unknown as IconLike;
31
+
32
+ export const VscAdd = asIcon(Vsc.VscAdd);
33
+ export const VscArrowDown = asIcon(Vsc.VscArrowDown);
34
+ export const VscArrowUp = asIcon(Vsc.VscArrowUp);
35
+ export const VscAttach = asIcon(Vsc.VscAttach);
36
+ export const VscCheck = asIcon(Vsc.VscCheck);
37
+ export const VscChevronDown = asIcon(Vsc.VscChevronDown);
38
+ export const VscChevronRight = asIcon(Vsc.VscChevronRight);
39
+ export const VscChevronUp = asIcon(Vsc.VscChevronUp);
40
+ export const VscClose = asIcon(Vsc.VscClose);
41
+ export const VscCloudUpload = asIcon(Vsc.VscCloudUpload);
42
+ export const VscCopy = asIcon(Vsc.VscCopy);
43
+ export const VscEdit = asIcon(Vsc.VscEdit);
44
+ export const VscEye = asIcon(Vsc.VscEye);
45
+ export const VscEyeClosed = asIcon(Vsc.VscEyeClosed);
46
+ export const VscFile = asIcon(Vsc.VscFile);
47
+ export const VscHistory = asIcon(Vsc.VscHistory);
48
+ export const VscInsert = asIcon(Vsc.VscInsert);
49
+ export const VscLink = asIcon(Vsc.VscLink);
50
+ export const VscNewFile = asIcon(Vsc.VscNewFile);
51
+ export const VscNotebook = asIcon(Vsc.VscNotebook);
52
+ export const VscPassFilled = asIcon(Vsc.VscPassFilled);
53
+ export const VscRefresh = asIcon(Vsc.VscRefresh);
54
+ export const VscSend = asIcon(Vsc.VscSend);
55
+ export const VscSettingsGear = asIcon(Vsc.VscSettingsGear);
56
+ export const VscSparkle = asIcon(Vsc.VscSparkle);
57
+ export const VscStopCircle = asIcon(Vsc.VscStopCircle);
58
+ export const VscThumbsdown = asIcon(Vsc.VscThumbsdown);
59
+ export const VscThumbsdownFilled = asIcon(Vsc.VscThumbsdownFilled);
60
+ export const VscThumbsup = asIcon(Vsc.VscThumbsup);
61
+ export const VscThumbsupFilled = asIcon(Vsc.VscThumbsupFilled);
62
+ export const VscTools = asIcon(Vsc.VscTools);
63
+ export const VscTrash = asIcon(Vsc.VscTrash);
64
+ export const VscTriangleDown = asIcon(Vsc.VscTriangleDown);
65
+ export const VscTriangleRight = asIcon(Vsc.VscTriangleRight);
66
+ export const VscWarning = asIcon(Vsc.VscWarning);
67
+
68
+ export const MdCheckBox = asIcon(Md.MdCheckBox);
69
+ export const MdOutlineCheckBoxOutlineBlank = asIcon(
70
+ Md.MdOutlineCheckBoxOutlineBlank
71
+ );