jupyterlab_claude_code_extension 1.0.57 → 1.0.59
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/README.md +1 -0
- package/lib/widget.js +40 -4
- package/package.json +1 -1
- package/src/widget.ts +49 -4
package/README.md
CHANGED
|
@@ -18,6 +18,7 @@ Browse, resume, and manage your Claude Code sessions from a JupyterLab side pane
|
|
|
18
18
|
- **Live indicator** - a green dot marks sessions that are currently running somewhere
|
|
19
19
|
- **One-click resume** - click a row to jump back into that session in a terminal. If a terminal for the project is already open, it's reused instead of duplicated
|
|
20
20
|
- **Favorites** - star projects you keep coming back to via the right-click menu
|
|
21
|
+
- **Remove** - drop a project's Claude history from the panel via the right-click menu; the history folder is moved to the trash (it honours JupyterLab's "move files to trash" setting), not deleted permanently
|
|
21
22
|
- **Search** - fuzzy filter at the top of the panel
|
|
22
23
|
- **Presentation modes** - label rows by session name, folder name, or path relative to the JupyterLab root
|
|
23
24
|
- **Hover tooltip** with project path, last activity, message count, branch, and session id
|
package/lib/widget.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { Dialog, showDialog } from '@jupyterlab/apputils';
|
|
1
|
+
import { Clipboard, Dialog, Notification, showDialog } from '@jupyterlab/apputils';
|
|
2
|
+
import { terminalIcon } from '@jupyterlab/ui-components';
|
|
2
3
|
import { CommandRegistry } from '@lumino/commands';
|
|
3
4
|
import { Menu, Widget } from '@lumino/widgets';
|
|
4
5
|
import { requestAPI } from './request';
|
|
@@ -85,9 +86,14 @@ export class ClaudeCodeSessionsWidget extends Widget {
|
|
|
85
86
|
refresh() {
|
|
86
87
|
this._showLoading();
|
|
87
88
|
this._setRefreshSpinning(true);
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
89
|
+
// `_fetch` is filesystem-fast, so without a floor the refresh icon would
|
|
90
|
+
// spin for a single frame and read as "nothing happened". Hold the
|
|
91
|
+
// spinner for at least ~500 ms so the click visibly registers.
|
|
92
|
+
const minSpin = new Promise(resolve => window.setTimeout(resolve, 500));
|
|
93
|
+
Promise.all([
|
|
94
|
+
this._fetch().catch(err => this._showError(err)),
|
|
95
|
+
minSpin
|
|
96
|
+
]).finally(() => this._setRefreshSpinning(false));
|
|
91
97
|
}
|
|
92
98
|
/** Choose how rows are labelled: by session name, folder name, or path. */
|
|
93
99
|
setPresentationMode(mode) {
|
|
@@ -807,6 +813,32 @@ export class ClaudeCodeSessionsWidget extends Widget {
|
|
|
807
813
|
}
|
|
808
814
|
}
|
|
809
815
|
});
|
|
816
|
+
this._commands.addCommand('claude-code-sessions:open-terminal', {
|
|
817
|
+
label: 'Open Terminal',
|
|
818
|
+
icon: terminalIcon,
|
|
819
|
+
execute: () => {
|
|
820
|
+
if (!this._activeSession) {
|
|
821
|
+
return;
|
|
822
|
+
}
|
|
823
|
+
// JupyterLab's built-in command - spawns a fresh pty with the user's
|
|
824
|
+
// shell at the given cwd. No claude, no waiter wrapper, no reuse;
|
|
825
|
+
// for when the user wants a plain shell at the project folder.
|
|
826
|
+
void this._app.commands.execute('terminal:create-new', {
|
|
827
|
+
cwd: this._activeSession.project_path
|
|
828
|
+
});
|
|
829
|
+
}
|
|
830
|
+
});
|
|
831
|
+
this._commands.addCommand('claude-code-sessions:copy-path', {
|
|
832
|
+
label: 'Copy Path',
|
|
833
|
+
execute: () => {
|
|
834
|
+
if (!this._activeSession) {
|
|
835
|
+
return;
|
|
836
|
+
}
|
|
837
|
+
const path = this._activeSession.project_path;
|
|
838
|
+
Clipboard.copyToSystem(path);
|
|
839
|
+
Notification.success(`Copied: ${path}`, { autoClose: 2000 });
|
|
840
|
+
}
|
|
841
|
+
});
|
|
810
842
|
this._commands.addCommand('claude-code-sessions:remove', {
|
|
811
843
|
label: 'Remove from Claude',
|
|
812
844
|
icon: removeIcon,
|
|
@@ -822,9 +854,13 @@ export class ClaudeCodeSessionsWidget extends Widget {
|
|
|
822
854
|
this._contextMenu.addItem({
|
|
823
855
|
command: 'claude-code-sessions:resume-dangerous'
|
|
824
856
|
});
|
|
857
|
+
this._contextMenu.addItem({
|
|
858
|
+
command: 'claude-code-sessions:open-terminal'
|
|
859
|
+
});
|
|
825
860
|
this._contextMenu.addItem({
|
|
826
861
|
command: 'claude-code-sessions:toggle-favourite'
|
|
827
862
|
});
|
|
863
|
+
this._contextMenu.addItem({ command: 'claude-code-sessions:copy-path' });
|
|
828
864
|
this._contextMenu.addItem({ type: 'separator' });
|
|
829
865
|
this._contextMenu.addItem({ command: 'claude-code-sessions:remove' });
|
|
830
866
|
this._contextMenu.aboutToClose.connect(() => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "jupyterlab_claude_code_extension",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.59",
|
|
4
4
|
"description": "Browse, resume, and manage your Claude Code CLI sessions from a JupyterLab side panel. One click reactivates the right terminal - no duplicate tabs, live remote-control indicator, and favourites for the projects you keep coming back to.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"jupyter",
|
package/src/widget.ts
CHANGED
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
import { JupyterFrontEnd } from '@jupyterlab/application';
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
Clipboard,
|
|
4
|
+
Dialog,
|
|
5
|
+
Notification,
|
|
6
|
+
showDialog
|
|
7
|
+
} from '@jupyterlab/apputils';
|
|
3
8
|
import { ServerConnection } from '@jupyterlab/services';
|
|
4
9
|
import { ITerminalTracker } from '@jupyterlab/terminal';
|
|
10
|
+
import { terminalIcon } from '@jupyterlab/ui-components';
|
|
5
11
|
import { CommandRegistry } from '@lumino/commands';
|
|
6
12
|
import { Menu, Widget } from '@lumino/widgets';
|
|
7
13
|
import { Message } from '@lumino/messaging';
|
|
@@ -113,9 +119,16 @@ export class ClaudeCodeSessionsWidget extends Widget {
|
|
|
113
119
|
refresh(): void {
|
|
114
120
|
this._showLoading();
|
|
115
121
|
this._setRefreshSpinning(true);
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
122
|
+
// `_fetch` is filesystem-fast, so without a floor the refresh icon would
|
|
123
|
+
// spin for a single frame and read as "nothing happened". Hold the
|
|
124
|
+
// spinner for at least ~500 ms so the click visibly registers.
|
|
125
|
+
const minSpin = new Promise<void>(resolve =>
|
|
126
|
+
window.setTimeout(resolve, 500)
|
|
127
|
+
);
|
|
128
|
+
Promise.all([
|
|
129
|
+
this._fetch().catch(err => this._showError(err)),
|
|
130
|
+
minSpin
|
|
131
|
+
]).finally(() => this._setRefreshSpinning(false));
|
|
119
132
|
}
|
|
120
133
|
|
|
121
134
|
/** Choose how rows are labelled: by session name, folder name, or path. */
|
|
@@ -940,6 +953,34 @@ export class ClaudeCodeSessionsWidget extends Widget {
|
|
|
940
953
|
}
|
|
941
954
|
});
|
|
942
955
|
|
|
956
|
+
this._commands.addCommand('claude-code-sessions:open-terminal', {
|
|
957
|
+
label: 'Open Terminal',
|
|
958
|
+
icon: terminalIcon,
|
|
959
|
+
execute: () => {
|
|
960
|
+
if (!this._activeSession) {
|
|
961
|
+
return;
|
|
962
|
+
}
|
|
963
|
+
// JupyterLab's built-in command - spawns a fresh pty with the user's
|
|
964
|
+
// shell at the given cwd. No claude, no waiter wrapper, no reuse;
|
|
965
|
+
// for when the user wants a plain shell at the project folder.
|
|
966
|
+
void this._app.commands.execute('terminal:create-new', {
|
|
967
|
+
cwd: this._activeSession.project_path
|
|
968
|
+
});
|
|
969
|
+
}
|
|
970
|
+
});
|
|
971
|
+
|
|
972
|
+
this._commands.addCommand('claude-code-sessions:copy-path', {
|
|
973
|
+
label: 'Copy Path',
|
|
974
|
+
execute: () => {
|
|
975
|
+
if (!this._activeSession) {
|
|
976
|
+
return;
|
|
977
|
+
}
|
|
978
|
+
const path = this._activeSession.project_path;
|
|
979
|
+
Clipboard.copyToSystem(path);
|
|
980
|
+
Notification.success(`Copied: ${path}`, { autoClose: 2000 });
|
|
981
|
+
}
|
|
982
|
+
});
|
|
983
|
+
|
|
943
984
|
this._commands.addCommand('claude-code-sessions:remove', {
|
|
944
985
|
label: 'Remove from Claude',
|
|
945
986
|
icon: removeIcon,
|
|
@@ -956,9 +997,13 @@ export class ClaudeCodeSessionsWidget extends Widget {
|
|
|
956
997
|
this._contextMenu.addItem({
|
|
957
998
|
command: 'claude-code-sessions:resume-dangerous'
|
|
958
999
|
});
|
|
1000
|
+
this._contextMenu.addItem({
|
|
1001
|
+
command: 'claude-code-sessions:open-terminal'
|
|
1002
|
+
});
|
|
959
1003
|
this._contextMenu.addItem({
|
|
960
1004
|
command: 'claude-code-sessions:toggle-favourite'
|
|
961
1005
|
});
|
|
1006
|
+
this._contextMenu.addItem({ command: 'claude-code-sessions:copy-path' });
|
|
962
1007
|
this._contextMenu.addItem({ type: 'separator' });
|
|
963
1008
|
this._contextMenu.addItem({ command: 'claude-code-sessions:remove' });
|
|
964
1009
|
|