jupyterlab-kernel-terminal-workspace-culler-extension 1.0.21__py3-none-any.whl

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 (23) hide show
  1. jupyterlab_kernel_terminal_workspace_culler_extension/__init__.py +54 -0
  2. jupyterlab_kernel_terminal_workspace_culler_extension/_version.py +4 -0
  3. jupyterlab_kernel_terminal_workspace_culler_extension/cli.py +430 -0
  4. jupyterlab_kernel_terminal_workspace_culler_extension/culler.py +499 -0
  5. jupyterlab_kernel_terminal_workspace_culler_extension/routes.py +176 -0
  6. jupyterlab_kernel_terminal_workspace_culler_extension/tests/__init__.py +1 -0
  7. jupyterlab_kernel_terminal_workspace_culler_extension/tests/test_culler.py +269 -0
  8. jupyterlab_kernel_terminal_workspace_culler_extension/tests/test_routes.py +17 -0
  9. jupyterlab_kernel_terminal_workspace_culler_extension-1.0.21.data/data/etc/jupyter/jupyter_server_config.d/jupyterlab_kernel_terminal_workspace_culler_extension.json +7 -0
  10. jupyterlab_kernel_terminal_workspace_culler_extension-1.0.21.data/data/share/jupyter/labextensions/jupyterlab_kernel_terminal_workspace_culler_extension/install.json +5 -0
  11. jupyterlab_kernel_terminal_workspace_culler_extension-1.0.21.data/data/share/jupyter/labextensions/jupyterlab_kernel_terminal_workspace_culler_extension/package.json +219 -0
  12. jupyterlab_kernel_terminal_workspace_culler_extension-1.0.21.data/data/share/jupyter/labextensions/jupyterlab_kernel_terminal_workspace_culler_extension/schemas/jupyterlab_kernel_terminal_workspace_culler_extension/package.json.orig +214 -0
  13. jupyterlab_kernel_terminal_workspace_culler_extension-1.0.21.data/data/share/jupyter/labextensions/jupyterlab_kernel_terminal_workspace_culler_extension/schemas/jupyterlab_kernel_terminal_workspace_culler_extension/plugin.json +64 -0
  14. jupyterlab_kernel_terminal_workspace_culler_extension-1.0.21.data/data/share/jupyter/labextensions/jupyterlab_kernel_terminal_workspace_culler_extension/static/728.b056947597422f9e496c.js +1 -0
  15. jupyterlab_kernel_terminal_workspace_culler_extension-1.0.21.data/data/share/jupyter/labextensions/jupyterlab_kernel_terminal_workspace_culler_extension/static/750.b2aa372edac477cffcb9.js +1 -0
  16. jupyterlab_kernel_terminal_workspace_culler_extension-1.0.21.data/data/share/jupyter/labextensions/jupyterlab_kernel_terminal_workspace_culler_extension/static/remoteEntry.61977aac2cfde9b88947.js +1 -0
  17. jupyterlab_kernel_terminal_workspace_culler_extension-1.0.21.data/data/share/jupyter/labextensions/jupyterlab_kernel_terminal_workspace_culler_extension/static/style.js +4 -0
  18. jupyterlab_kernel_terminal_workspace_culler_extension-1.0.21.data/data/share/jupyter/labextensions/jupyterlab_kernel_terminal_workspace_culler_extension/static/third-party-licenses.json +16 -0
  19. jupyterlab_kernel_terminal_workspace_culler_extension-1.0.21.dist-info/METADATA +208 -0
  20. jupyterlab_kernel_terminal_workspace_culler_extension-1.0.21.dist-info/RECORD +23 -0
  21. jupyterlab_kernel_terminal_workspace_culler_extension-1.0.21.dist-info/WHEEL +4 -0
  22. jupyterlab_kernel_terminal_workspace_culler_extension-1.0.21.dist-info/entry_points.txt +2 -0
  23. jupyterlab_kernel_terminal_workspace_culler_extension-1.0.21.dist-info/licenses/LICENSE +29 -0
@@ -0,0 +1,214 @@
1
+ {
2
+ "name": "jupyterlab_kernel_terminal_workspace_culler_extension",
3
+ "version": "1.0.21",
4
+ "description": "Jupyterlab extension to kill unused kernels, terminals and workspaces. User can configure the idle time (minutes) after which the resource will be released automatically. This helps with the locked memory, insane number of terminals opened etc.",
5
+ "keywords": [
6
+ "jupyter",
7
+ "jupyterlab",
8
+ "jupyterlab-extension"
9
+ ],
10
+ "homepage": "https://github.com/stellarshenson/jupyterlab_kernel_terminal_workspace_culler_extension",
11
+ "bugs": {
12
+ "url": "https://github.com/stellarshenson/jupyterlab_kernel_terminal_workspace_culler_extension/issues"
13
+ },
14
+ "license": "BSD-3-Clause",
15
+ "author": {
16
+ "name": "Stellars Henson",
17
+ "email": "konrad.jelen@gmail.com"
18
+ },
19
+ "files": [
20
+ "lib/**/*.{d.ts,eot,gif,html,jpg,js,js.map,json,png,svg,woff2,ttf}",
21
+ "style/**/*.{css,js,eot,gif,html,jpg,json,png,svg,woff2,ttf}",
22
+ "src/**/*.{ts,tsx}",
23
+ "schema/*.json"
24
+ ],
25
+ "main": "lib/index.js",
26
+ "types": "lib/index.d.ts",
27
+ "style": "style/index.css",
28
+ "repository": {
29
+ "type": "git",
30
+ "url": "https://github.com/stellarshenson/jupyterlab_kernel_terminal_workspace_culler_extension.git"
31
+ },
32
+ "scripts": {
33
+ "build": "jlpm build:lib && jlpm build:labextension:dev",
34
+ "build:prod": "jlpm clean && jlpm build:lib:prod && jlpm build:labextension",
35
+ "build:labextension": "jupyter labextension build .",
36
+ "build:labextension:dev": "jupyter labextension build --development True .",
37
+ "build:lib": "tsc --sourceMap",
38
+ "build:lib:prod": "tsc",
39
+ "clean": "jlpm clean:lib",
40
+ "clean:lib": "rimraf lib tsconfig.tsbuildinfo",
41
+ "clean:lintcache": "rimraf .eslintcache .stylelintcache",
42
+ "clean:labextension": "rimraf jupyterlab_kernel_terminal_workspace_culler_extension/labextension jupyterlab_kernel_terminal_workspace_culler_extension/_version.py",
43
+ "clean:all": "jlpm clean:lib && jlpm clean:labextension && jlpm clean:lintcache",
44
+ "eslint": "jlpm eslint:check --fix",
45
+ "eslint:check": "eslint . --cache --ext .ts,.tsx",
46
+ "install:extension": "jlpm build",
47
+ "lint": "jlpm stylelint && jlpm prettier && jlpm eslint",
48
+ "lint:check": "jlpm stylelint:check && jlpm prettier:check && jlpm eslint:check",
49
+ "prettier": "jlpm prettier:base --write --list-different",
50
+ "prettier:base": "prettier \"**/*{.ts,.tsx,.js,.jsx,.css,.json,.md}\"",
51
+ "prettier:check": "jlpm prettier:base --check",
52
+ "stylelint": "jlpm stylelint:check --fix",
53
+ "stylelint:check": "stylelint --cache \"style/**/*.css\"",
54
+ "test": "jest --coverage",
55
+ "watch": "run-p watch:src watch:labextension",
56
+ "watch:src": "tsc -w --sourceMap",
57
+ "watch:labextension": "jupyter labextension watch ."
58
+ },
59
+ "dependencies": {
60
+ "@jupyterlab/application": "^4.0.0",
61
+ "@jupyterlab/coreutils": "^6.0.0",
62
+ "@jupyterlab/services": "^7.0.0",
63
+ "@jupyterlab/settingregistry": "^4.0.0",
64
+ "@jupyterlab/terminal": "^4.0.0"
65
+ },
66
+ "devDependencies": {
67
+ "@jupyterlab/builder": "^4.0.0",
68
+ "@jupyterlab/testutils": "^4.0.0",
69
+ "@types/jest": "^29.2.0",
70
+ "@types/json-schema": "^7.0.11",
71
+ "@types/react": "^18.0.26",
72
+ "@types/react-addons-linked-state-mixin": "^0.14.22",
73
+ "@typescript-eslint/eslint-plugin": "^6.1.0",
74
+ "@typescript-eslint/parser": "^6.1.0",
75
+ "css-loader": "^6.7.1",
76
+ "eslint": "^8.36.0",
77
+ "eslint-config-prettier": "^8.8.0",
78
+ "eslint-plugin-prettier": "^5.0.0",
79
+ "jest": "^29.2.0",
80
+ "mkdirp": "^1.0.3",
81
+ "npm-run-all2": "^7.0.1",
82
+ "prettier": "^3.0.0",
83
+ "rimraf": "^5.0.10",
84
+ "source-map-loader": "^1.0.2",
85
+ "style-loader": "^3.3.1",
86
+ "stylelint": "^15.10.1",
87
+ "stylelint-config-recommended": "^13.0.0",
88
+ "stylelint-config-standard": "^34.0.0",
89
+ "stylelint-csstree-validator": "^3.0.0",
90
+ "stylelint-prettier": "^4.0.0",
91
+ "typescript": "~5.5.4",
92
+ "yjs": "^13.5.0"
93
+ },
94
+ "resolutions": {
95
+ "lib0": "0.2.111"
96
+ },
97
+ "sideEffects": [
98
+ "style/*.css",
99
+ "style/index.js"
100
+ ],
101
+ "styleModule": "style/index.js",
102
+ "publishConfig": {
103
+ "access": "public"
104
+ },
105
+ "jupyterlab": {
106
+ "discovery": {
107
+ "server": {
108
+ "managers": [
109
+ "pip"
110
+ ],
111
+ "base": {
112
+ "name": "jupyterlab_kernel_terminal_workspace_culler_extension"
113
+ }
114
+ }
115
+ },
116
+ "extension": true,
117
+ "outputDir": "jupyterlab_kernel_terminal_workspace_culler_extension/labextension",
118
+ "schemaDir": "schema"
119
+ },
120
+ "eslintIgnore": [
121
+ "node_modules",
122
+ "dist",
123
+ "coverage",
124
+ "**/*.d.ts",
125
+ "tests",
126
+ "**/__tests__",
127
+ "ui-tests"
128
+ ],
129
+ "eslintConfig": {
130
+ "extends": [
131
+ "eslint:recommended",
132
+ "plugin:@typescript-eslint/eslint-recommended",
133
+ "plugin:@typescript-eslint/recommended",
134
+ "plugin:prettier/recommended"
135
+ ],
136
+ "parser": "@typescript-eslint/parser",
137
+ "parserOptions": {
138
+ "project": "tsconfig.json",
139
+ "sourceType": "module"
140
+ },
141
+ "plugins": [
142
+ "@typescript-eslint"
143
+ ],
144
+ "rules": {
145
+ "@typescript-eslint/naming-convention": [
146
+ "error",
147
+ {
148
+ "selector": "interface",
149
+ "format": [
150
+ "PascalCase"
151
+ ],
152
+ "custom": {
153
+ "regex": "^I[A-Z]",
154
+ "match": true
155
+ }
156
+ }
157
+ ],
158
+ "@typescript-eslint/no-unused-vars": [
159
+ "warn",
160
+ {
161
+ "args": "none"
162
+ }
163
+ ],
164
+ "@typescript-eslint/no-explicit-any": "off",
165
+ "@typescript-eslint/no-namespace": "off",
166
+ "@typescript-eslint/no-use-before-define": "off",
167
+ "@typescript-eslint/quotes": [
168
+ "error",
169
+ "single",
170
+ {
171
+ "avoidEscape": true,
172
+ "allowTemplateLiterals": false
173
+ }
174
+ ],
175
+ "curly": [
176
+ "error",
177
+ "all"
178
+ ],
179
+ "eqeqeq": "error",
180
+ "prefer-arrow-callback": "error"
181
+ }
182
+ },
183
+ "prettier": {
184
+ "singleQuote": true,
185
+ "trailingComma": "none",
186
+ "arrowParens": "avoid",
187
+ "endOfLine": "auto",
188
+ "overrides": [
189
+ {
190
+ "files": "package.json",
191
+ "options": {
192
+ "tabWidth": 4
193
+ }
194
+ }
195
+ ]
196
+ },
197
+ "stylelint": {
198
+ "extends": [
199
+ "stylelint-config-recommended",
200
+ "stylelint-config-standard",
201
+ "stylelint-prettier/recommended"
202
+ ],
203
+ "plugins": [
204
+ "stylelint-csstree-validator"
205
+ ],
206
+ "rules": {
207
+ "csstree/validator": true,
208
+ "property-no-vendor-prefix": null,
209
+ "selector-class-pattern": "^([a-z][A-z\\d]*)(-[A-z\\d]+)*$",
210
+ "selector-no-vendor-prefix": null,
211
+ "value-no-vendor-prefix": null
212
+ }
213
+ }
214
+ }
@@ -0,0 +1,64 @@
1
+ {
2
+ "jupyter.lab.shortcuts": [],
3
+ "title": "Resource Culler",
4
+ "description": "Automatic culling of idle kernels, terminals, and workspaces",
5
+ "type": "object",
6
+ "properties": {
7
+ "kernelCullEnabled": {
8
+ "type": "boolean",
9
+ "title": "Enable Kernel Culling",
10
+ "default": true
11
+ },
12
+ "kernelCullIdleTimeout": {
13
+ "type": "integer",
14
+ "title": "Kernel Idle Timeout (minutes)",
15
+ "description": "Default: 1 hour (60 minutes)",
16
+ "default": 60,
17
+ "minimum": 1
18
+ },
19
+ "terminalCullEnabled": {
20
+ "type": "boolean",
21
+ "title": "Enable Terminal Culling",
22
+ "default": true
23
+ },
24
+ "terminalCullIdleTimeout": {
25
+ "type": "integer",
26
+ "title": "Terminal Idle Timeout (minutes)",
27
+ "description": "Default: 1 hour (60 minutes)",
28
+ "default": 60,
29
+ "minimum": 1
30
+ },
31
+ "terminalCullDisconnectedOnly": {
32
+ "type": "boolean",
33
+ "title": "Only Cull Disconnected Terminals",
34
+ "description": "When enabled, only cull terminals with no active browser tab. Terminals with open tabs are kept even if idle.",
35
+ "default": true
36
+ },
37
+ "workspaceCullEnabled": {
38
+ "type": "boolean",
39
+ "title": "Enable Workspace Culling",
40
+ "description": "Cull unused JupyterLab workspaces (auto-0, auto-k, etc.). The default workspace is never culled.",
41
+ "default": true
42
+ },
43
+ "workspaceCullIdleTimeout": {
44
+ "type": "integer",
45
+ "title": "Workspace Idle Timeout (minutes)",
46
+ "description": "Default: 7 days (10080 minutes). Based on last_modified timestamp.",
47
+ "default": 10080,
48
+ "minimum": 1
49
+ },
50
+ "cullCheckInterval": {
51
+ "type": "integer",
52
+ "title": "Check Interval (minutes)",
53
+ "default": 5,
54
+ "minimum": 1
55
+ },
56
+ "showNotifications": {
57
+ "type": "boolean",
58
+ "title": "Show Notifications",
59
+ "description": "Display summary notification when resources are culled",
60
+ "default": true
61
+ }
62
+ },
63
+ "additionalProperties": false
64
+ }
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunkjupyterlab_kernel_terminal_workspace_culler_extension=self.webpackChunkjupyterlab_kernel_terminal_workspace_culler_extension||[]).push([[728],{56(e,t,n){e.exports=function(e){var t=n.nc;t&&e.setAttribute("nonce",t)}},72(e){var t=[];function n(e){for(var n=-1,r=0;r<t.length;r++)if(t[r].identifier===e){n=r;break}return n}function r(e,r){for(var a={},s=[],c=0;c<e.length;c++){var i=e[c],u=r.base?i[0]+r.base:i[0],l=a[u]||0,p="".concat(u," ").concat(l);a[u]=l+1;var f=n(p),d={css:i[1],media:i[2],sourceMap:i[3],supports:i[4],layer:i[5]};if(-1!==f)t[f].references++,t[f].updater(d);else{var v=o(d,r);r.byIndex=c,t.splice(c,0,{identifier:p,updater:v,references:1})}s.push(p)}return s}function o(e,t){var n=t.domAPI(t);return n.update(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap&&t.supports===e.supports&&t.layer===e.layer)return;n.update(e=t)}else n.remove()}}e.exports=function(e,o){var a=r(e=e||[],o=o||{});return function(e){e=e||[];for(var s=0;s<a.length;s++){var c=n(a[s]);t[c].references--}for(var i=r(e,o),u=0;u<a.length;u++){var l=n(a[u]);0===t[l].references&&(t[l].updater(),t.splice(l,1))}a=i}}},113(e){e.exports=function(e,t){if(t.styleSheet)t.styleSheet.cssText=e;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(e))}}},314(e){e.exports=function(e){var t=[];return t.toString=function(){return this.map(function(t){var n="",r=void 0!==t[5];return t[4]&&(n+="@supports (".concat(t[4],") {")),t[2]&&(n+="@media ".concat(t[2]," {")),r&&(n+="@layer".concat(t[5].length>0?" ".concat(t[5]):""," {")),n+=e(t),r&&(n+="}"),t[2]&&(n+="}"),t[4]&&(n+="}"),n}).join("")},t.i=function(e,n,r,o,a){"string"==typeof e&&(e=[[null,e,void 0]]);var s={};if(r)for(var c=0;c<this.length;c++){var i=this[c][0];null!=i&&(s[i]=!0)}for(var u=0;u<e.length;u++){var l=[].concat(e[u]);r&&s[l[0]]||(void 0!==a&&(void 0===l[5]||(l[1]="@layer".concat(l[5].length>0?" ".concat(l[5]):""," {").concat(l[1],"}")),l[5]=a),n&&(l[2]?(l[1]="@media ".concat(l[2]," {").concat(l[1],"}"),l[2]=n):l[2]=n),o&&(l[4]?(l[1]="@supports (".concat(l[4],") {").concat(l[1],"}"),l[4]=o):l[4]="".concat(o)),t.push(l))}},t}},475(e,t,n){n.d(t,{A:()=>c});var r=n(601),o=n.n(r),a=n(314),s=n.n(a)()(o());s.push([e.id,"/*\n See the JupyterLab Developer Guide for useful CSS Patterns:\n\n https://jupyterlab.readthedocs.io/en/stable/developer/css.html\n*/\n",""]);const c=s},540(e){e.exports=function(e){var t=document.createElement("style");return e.setAttributes(t,e.attributes),e.insert(t,e.options),t}},601(e){e.exports=function(e){return e[1]}},659(e){var t={};e.exports=function(e,n){var r=function(e){if(void 0===t[e]){var n=document.querySelector(e);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(e){n=null}t[e]=n}return t[e]}(e);if(!r)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");r.appendChild(n)}},728(e,t,n){var r=n(72),o=n.n(r),a=n(825),s=n.n(a),c=n(659),i=n.n(c),u=n(56),l=n.n(u),p=n(540),f=n.n(p),d=n(113),v=n.n(d),h=n(475),m={};m.styleTagTransform=v(),m.setAttributes=l(),m.insert=i().bind(null,"head"),m.domAPI=s(),m.insertStyleElement=f(),o()(h.A,m),h.A&&h.A.locals&&h.A.locals},825(e){e.exports=function(e){if("undefined"==typeof document)return{update:function(){},remove:function(){}};var t=e.insertStyleElement(e);return{update:function(n){!function(e,t,n){var r="";n.supports&&(r+="@supports (".concat(n.supports,") {")),n.media&&(r+="@media ".concat(n.media," {"));var o=void 0!==n.layer;o&&(r+="@layer".concat(n.layer.length>0?" ".concat(n.layer):""," {")),r+=n.css,o&&(r+="}"),n.media&&(r+="}"),n.supports&&(r+="}");var a=n.sourceMap;a&&"undefined"!=typeof btoa&&(r+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(a))))," */")),t.styleTagTransform(r,e,t.options)}(t,e,n)},remove:function(){!function(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e)}(t)}}}}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunkjupyterlab_kernel_terminal_workspace_culler_extension=self.webpackChunkjupyterlab_kernel_terminal_workspace_culler_extension||[]).push([[750],{750(e,n,t){t.r(n),t.d(n,{default:()=>k});var l=t(490),o=t(167),r=t(469),s=t(830);async function a(e="",n={}){const t=s.ServerConnection.makeSettings(),l=r.URLExt.join(t.baseUrl,"jupyterlab-kernel-terminal-workspace-culler-extension",e);let o;try{o=await s.ServerConnection.makeRequest(l,n,t)}catch(e){throw new s.ServerConnection.NetworkError(e)}let a=await o.text();if(a.length>0)try{a=JSON.parse(a)}catch(e){console.log("Not a JSON response body.",o)}if(!o.ok)throw new s.ServerConnection.ResponseError(o,a.message||a);return a}let c=!0,i=5,u=null,d=null;async function p(e,n,t){var l,o;const r=e.composite;c=null===(l=r.showNotifications)||void 0===l||l;const s=null!==(o=r.cullCheckInterval)&&void 0!==o?o:5,u=s!==i;i=s;try{await a("settings",{method:"POST",body:JSON.stringify(r)})}catch(e){console.error("[Culler] Failed to sync settings to backend:",e)}u&&(console.log(`[Culler] Cull check interval changed to ${i} minutes`),v(n,t))}function v(e,n){const t=60*i*1e3;null!==u&&clearInterval(u),null!==d&&clearInterval(d),u=setInterval(()=>async function(e){var n,t,l,o,r,s;try{const i=await a("cull-result"),u=null!==(t=null===(n=i.kernels_culled)||void 0===n?void 0:n.length)&&void 0!==t?t:0,d=null!==(o=null===(l=i.terminals_culled)||void 0===l?void 0:l.length)&&void 0!==o?o:0,p=null!==(s=null===(r=i.workspaces_culled)||void 0===r?void 0:r.length)&&void 0!==s?s:0;if(c&&(u>0||d>0||p>0)){const n=["Idle resources culled:"];u>0&&n.push(`Kernels: ${u}`),d>0&&n.push(`Terminals: ${d}`),p>0&&n.push(`Workspaces: ${p}`),e.commands.hasCommand("jupyterlab-notifications:send")?await e.commands.execute("jupyterlab-notifications:send",{message:n.join("\n"),type:"info",autoClose:5e3}):console.info("[Culler]",n.join(" | "))}}catch(e){}}(e),t),n&&(d=setInterval(()=>h(n),t)),console.log(`[Culler] Intervals set to ${i} minutes (${t}ms)`)}async function h(e){const n=[];e.forEach(e=>{var t;const l=null===(t=e.content.session)||void 0===t?void 0:t.name;l&&e.isAttached&&!e.isDisposed&&n.push(l)});try{await a("active-terminals",{method:"POST",body:JSON.stringify({terminals:n})})}catch(e){console.debug("[Culler] Failed to report active terminals:",e)}}const m={id:"jupyterlab_kernel_terminal_workspace_culler_extension:plugin",description:"JupyterLab extension to automatically cull idle kernels, terminals, and workspaces.",autoStart:!0,optional:[l.ISettingRegistry,o.ITerminalTracker],activate:(e,n,t)=>{console.log("JupyterLab extension jupyterlab_kernel_terminal_workspace_culler_extension is activated!"),n?n.load(m.id).then(n=>{var l;console.log("[Culler] Settings loaded:",n.composite);const o=n.composite;i=null!==(l=o.cullCheckInterval)&&void 0!==l?l:5,p(n,e,t),v(e,t),n.changed.connect(()=>p(n,e,t))}).catch(n=>{console.error("[Culler] Failed to load settings:",n),v(e,t)}):v(e,t),t&&(t.currentChanged.connect(()=>{h(t)}),t.widgetAdded.connect(()=>{h(t)}),h(t))}},k=m}}]);
@@ -0,0 +1 @@
1
+ var _JUPYTERLAB;(()=>{"use strict";var e,r,t,n,o,a,i,l,u,s,f,p,c,d,h,v,b,g,m,y={971(e,r,t){var n={"./index":()=>t.e(750).then(()=>()=>t(750)),"./extension":()=>t.e(750).then(()=>()=>t(750)),"./style":()=>t.e(728).then(()=>()=>t(728))},o=(e,r)=>(t.R=r,r=t.o(n,e)?n[e]():Promise.resolve().then(()=>{throw new Error('Module "'+e+'" does not exist in container.')}),t.R=void 0,r),a=(e,r)=>{if(t.S){var n="default",o=t.S[n];if(o&&o!==e)throw new Error("Container initialization failed as it has already been initialized with a different share scope");return t.S[n]=e,t.I(n,r)}};t.d(r,{get:()=>o,init:()=>a})}},_={};function w(e){var r=_[e];if(void 0!==r)return r.exports;var t=_[e]={id:e,exports:{}};return y[e](t,t.exports,w),t.exports}w.m=y,w.c=_,w.n=e=>{var r=e&&e.__esModule?()=>e.default:()=>e;return w.d(r,{a:r}),r},w.d=(e,r)=>{for(var t in r)w.o(r,t)&&!w.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})},w.f={},w.e=e=>Promise.all(Object.keys(w.f).reduce((r,t)=>(w.f[t](e,r),r),[])),w.u=e=>e+"."+{728:"b056947597422f9e496c",750:"b2aa372edac477cffcb9"}[e]+".js?v="+{728:"b056947597422f9e496c",750:"b2aa372edac477cffcb9"}[e],w.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),w.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),e={},r="jupyterlab_kernel_terminal_workspace_culler_extension:",w.l=(t,n,o,a)=>{if(e[t])e[t].push(n);else{var i,l;if(void 0!==o)for(var u=document.getElementsByTagName("script"),s=0;s<u.length;s++){var f=u[s];if(f.getAttribute("src")==t||f.getAttribute("data-webpack")==r+o){i=f;break}}i||(l=!0,(i=document.createElement("script")).charset="utf-8",w.nc&&i.setAttribute("nonce",w.nc),i.setAttribute("data-webpack",r+o),i.src=t),e[t]=[n];var p=(r,n)=>{i.onerror=i.onload=null,clearTimeout(c);var o=e[t];if(delete e[t],i.parentNode&&i.parentNode.removeChild(i),o&&o.forEach(e=>e(n)),r)return r(n)},c=setTimeout(p.bind(null,void 0,{type:"timeout",target:i}),12e4);i.onerror=p.bind(null,i.onerror),i.onload=p.bind(null,i.onload),l&&document.head.appendChild(i)}},w.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{w.S={};var e={},r={};w.I=(t,n)=>{n||(n=[]);var o=r[t];if(o||(o=r[t]={}),!(n.indexOf(o)>=0)){if(n.push(o),e[t])return e[t];w.o(w.S,t)||(w.S[t]={});var a=w.S[t],i="jupyterlab_kernel_terminal_workspace_culler_extension",l=[];return"default"===t&&((e,r,t,n)=>{var o=a[e]=a[e]||{},l=o[r];(!l||!l.loaded&&(1!=!l.eager?n:i>l.from))&&(o[r]={get:()=>w.e(750).then(()=>()=>w(750)),from:i,eager:!1})})("jupyterlab_kernel_terminal_workspace_culler_extension","1.0.21"),e[t]=l.length?Promise.all(l).then(()=>e[t]=1):1}}})(),(()=>{var e;w.g.importScripts&&(e=w.g.location+"");var r=w.g.document;if(!e&&r&&(r.currentScript&&"SCRIPT"===r.currentScript.tagName.toUpperCase()&&(e=r.currentScript.src),!e)){var t=r.getElementsByTagName("script");if(t.length)for(var n=t.length-1;n>-1&&(!e||!/^http(s?):/.test(e));)e=t[n--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),w.p=e})(),t=e=>{var r=e=>e.split(".").map(e=>+e==e?+e:e),t=/^([^-+]+)?(?:-([^+]+))?(?:\+(.+))?$/.exec(e),n=t[1]?r(t[1]):[];return t[2]&&(n.length++,n.push.apply(n,r(t[2]))),t[3]&&(n.push([]),n.push.apply(n,r(t[3]))),n},n=(e,r)=>{e=t(e),r=t(r);for(var n=0;;){if(n>=e.length)return n<r.length&&"u"!=(typeof r[n])[0];var o=e[n],a=(typeof o)[0];if(n>=r.length)return"u"==a;var i=r[n],l=(typeof i)[0];if(a!=l)return"o"==a&&"n"==l||"s"==l||"u"==a;if("o"!=a&&"u"!=a&&o!=i)return o<i;n++}},o=e=>{var r=e[0],t="";if(1===e.length)return"*";if(r+.5){t+=0==r?">=":-1==r?"<":1==r?"^":2==r?"~":r>0?"=":"!=";for(var n=1,a=1;a<e.length;a++)n--,t+="u"==(typeof(l=e[a]))[0]?"-":(n>0?".":"")+(n=2,l);return t}var i=[];for(a=1;a<e.length;a++){var l=e[a];i.push(0===l?"not("+u()+")":1===l?"("+u()+" || "+u()+")":2===l?i.pop()+" "+i.pop():o(l))}return u();function u(){return i.pop().replace(/^\((.+)\)$/,"$1")}},a=(e,r)=>{if(0 in e){r=t(r);var n=e[0],o=n<0;o&&(n=-n-1);for(var i=0,l=1,u=!0;;l++,i++){var s,f,p=l<e.length?(typeof e[l])[0]:"";if(i>=r.length||"o"==(f=(typeof(s=r[i]))[0]))return!u||("u"==p?l>n&&!o:""==p!=o);if("u"==f){if(!u||"u"!=p)return!1}else if(u)if(p==f)if(l<=n){if(s!=e[l])return!1}else{if(o?s>e[l]:s<e[l])return!1;s!=e[l]&&(u=!1)}else if("s"!=p&&"n"!=p){if(o||l<=n)return!1;u=!1,l--}else{if(l<=n||f<p!=o)return!1;u=!1}else"s"!=p&&"n"!=p&&(u=!1,l--)}}var c=[],d=c.pop.bind(c);for(i=1;i<e.length;i++){var h=e[i];c.push(1==h?d()|d():2==h?d()&d():h?a(h,r):!d())}return!!d()},i=(e,r)=>e&&w.o(e,r),l=e=>(e.loaded=1,e.get()),u=e=>Object.keys(e).reduce((r,t)=>(e[t].eager&&(r[t]=e[t]),r),{}),s=(e,r,t)=>{var o=t?u(e[r]):e[r];return Object.keys(o).reduce((e,r)=>!e||!o[e].loaded&&n(e,r)?r:e,0)},f=(e,r,t,n)=>"Unsatisfied version "+t+" from "+(t&&e[r][t].from)+" of shared singleton module "+r+" (required "+o(n)+")",p=e=>{throw new Error(e)},c=e=>{"undefined"!=typeof console&&console.warn&&console.warn(e)},d=(e,r,t)=>t?t():((e,r)=>p("Shared module "+r+" doesn't exist in shared scope "+e))(e,r),h=(e=>function(r,t,n,o,a){var i=w.I(r);return i&&i.then&&!n?i.then(e.bind(e,r,w.S[r],t,!1,o,a)):e(r,w.S[r],t,n,o,a)})((e,r,t,n,o,u)=>{if(!i(r,t))return d(e,t,u);var p=s(r,t,n);return a(o,p)||c(f(r,t,p,o)),l(r[t][p])}),v={},b={167:()=>h("default","@jupyterlab/terminal",!1,[1,4,5,2]),469:()=>h("default","@jupyterlab/coreutils",!1,[1,6,5,2]),490:()=>h("default","@jupyterlab/settingregistry",!1,[1,4,5,2]),830:()=>h("default","@jupyterlab/services",!1,[1,7,5,2])},g={750:[167,469,490,830]},m={},w.f.consumes=(e,r)=>{w.o(g,e)&&g[e].forEach(e=>{if(w.o(v,e))return r.push(v[e]);if(!m[e]){var t=r=>{v[e]=0,w.m[e]=t=>{delete w.c[e],t.exports=r()}};m[e]=!0;var n=r=>{delete v[e],w.m[e]=t=>{throw delete w.c[e],r}};try{var o=b[e]();o.then?r.push(v[e]=o.then(t).catch(n)):t(o)}catch(e){n(e)}}})},(()=>{var e={666:0};w.f.j=(r,t)=>{var n=w.o(e,r)?e[r]:void 0;if(0!==n)if(n)t.push(n[2]);else{var o=new Promise((t,o)=>n=e[r]=[t,o]);t.push(n[2]=o);var a=w.p+w.u(r),i=new Error;w.l(a,t=>{if(w.o(e,r)&&(0!==(n=e[r])&&(e[r]=void 0),n)){var o=t&&("load"===t.type?"missing":t.type),a=t&&t.target&&t.target.src;i.message="Loading chunk "+r+" failed.\n("+o+": "+a+")",i.name="ChunkLoadError",i.type=o,i.request=a,n[1](i)}},"chunk-"+r,r)}};var r=(r,t)=>{var n,o,[a,i,l]=t,u=0;if(a.some(r=>0!==e[r])){for(n in i)w.o(i,n)&&(w.m[n]=i[n]);l&&l(w)}for(r&&r(t);u<a.length;u++)o=a[u],w.o(e,o)&&e[o]&&e[o][0](),e[o]=0},t=self.webpackChunkjupyterlab_kernel_terminal_workspace_culler_extension=self.webpackChunkjupyterlab_kernel_terminal_workspace_culler_extension||[];t.forEach(r.bind(null,0)),t.push=r.bind(null,t.push.bind(t))})(),w.nc=void 0;var k=w(971);(_JUPYTERLAB=void 0===_JUPYTERLAB?{}:_JUPYTERLAB).jupyterlab_kernel_terminal_workspace_culler_extension=k})();
@@ -0,0 +1,4 @@
1
+ /* This is a generated file of CSS imports */
2
+ /* It was generated by @jupyterlab/builder in Build.ensureAssets() */
3
+
4
+ import 'jupyterlab_kernel_terminal_workspace_culler_extension/style/index.js';
@@ -0,0 +1,16 @@
1
+ {
2
+ "packages": [
3
+ {
4
+ "name": "css-loader",
5
+ "versionInfo": "6.11.0",
6
+ "licenseId": "MIT",
7
+ "extractedText": "Copyright JS Foundation and other contributors\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n'Software'), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\nTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\nSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n"
8
+ },
9
+ {
10
+ "name": "style-loader",
11
+ "versionInfo": "3.3.4",
12
+ "licenseId": "MIT",
13
+ "extractedText": "Copyright JS Foundation and other contributors\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n'Software'), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\nTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\nSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n"
14
+ }
15
+ ]
16
+ }
@@ -0,0 +1,208 @@
1
+ Metadata-Version: 2.4
2
+ Name: jupyterlab_kernel_terminal_workspace_culler_extension
3
+ Version: 1.0.21
4
+ Summary: Jupyterlab extension to kill unused kernels, terminals and workspaces. User can configure the idle time (minutes) after which the resource will be released automatically. This helps with the locked memory, insane number of terminals opened etc.
5
+ Project-URL: Homepage, https://github.com/stellarshenson/jupyterlab_kernel_terminal_workspace_culler_extension
6
+ Project-URL: Bug Tracker, https://github.com/stellarshenson/jupyterlab_kernel_terminal_workspace_culler_extension/issues
7
+ Project-URL: Repository, https://github.com/stellarshenson/jupyterlab_kernel_terminal_workspace_culler_extension.git
8
+ Author-email: Stellars Henson <konrad.jelen@gmail.com>
9
+ License: BSD 3-Clause License
10
+
11
+ Copyright (c) 2026, Stellars Henson
12
+ All rights reserved.
13
+
14
+ Redistribution and use in source and binary forms, with or without
15
+ modification, are permitted provided that the following conditions are met:
16
+
17
+ 1. Redistributions of source code must retain the above copyright notice, this
18
+ list of conditions and the following disclaimer.
19
+
20
+ 2. Redistributions in binary form must reproduce the above copyright notice,
21
+ this list of conditions and the following disclaimer in the documentation
22
+ and/or other materials provided with the distribution.
23
+
24
+ 3. Neither the name of the copyright holder nor the names of its
25
+ contributors may be used to endorse or promote products derived from
26
+ this software without specific prior written permission.
27
+
28
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
29
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
30
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
31
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
32
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
33
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
34
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
35
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
36
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
37
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
38
+ License-File: LICENSE
39
+ Keywords: jupyter,jupyterlab,jupyterlab-extension
40
+ Classifier: Framework :: Jupyter
41
+ Classifier: Framework :: Jupyter :: JupyterLab
42
+ Classifier: Framework :: Jupyter :: JupyterLab :: 4
43
+ Classifier: Framework :: Jupyter :: JupyterLab :: Extensions
44
+ Classifier: Framework :: Jupyter :: JupyterLab :: Extensions :: Prebuilt
45
+ Classifier: License :: OSI Approved :: BSD License
46
+ Classifier: Programming Language :: Python
47
+ Classifier: Programming Language :: Python :: 3
48
+ Classifier: Programming Language :: Python :: 3.10
49
+ Classifier: Programming Language :: Python :: 3.11
50
+ Classifier: Programming Language :: Python :: 3.12
51
+ Classifier: Programming Language :: Python :: 3.13
52
+ Classifier: Programming Language :: Python :: 3.14
53
+ Requires-Python: >=3.10
54
+ Requires-Dist: jupyter-server<3,>=2.4.0
55
+ Requires-Dist: requests>=2.20.0
56
+ Provides-Extra: dev
57
+ Requires-Dist: jupyterlab>=4; extra == 'dev'
58
+ Provides-Extra: notifications
59
+ Requires-Dist: jupyterlab-notifications-extension; extra == 'notifications'
60
+ Provides-Extra: test
61
+ Requires-Dist: coverage; extra == 'test'
62
+ Requires-Dist: pytest; extra == 'test'
63
+ Requires-Dist: pytest-asyncio; extra == 'test'
64
+ Requires-Dist: pytest-cov; extra == 'test'
65
+ Requires-Dist: pytest-jupyter[server]>=0.6.0; extra == 'test'
66
+ Description-Content-Type: text/markdown
67
+
68
+ # jupyterlab_kernel_terminal_workspace_culler_extension
69
+
70
+ [![GitHub Actions](https://github.com/stellarshenson/jupyterlab_kernel_terminal_workspace_culler_extension/actions/workflows/build.yml/badge.svg)](https://github.com/stellarshenson/jupyterlab_kernel_terminal_workspace_culler_extension/actions/workflows/build.yml)
71
+ [![npm version](https://img.shields.io/npm/v/jupyterlab_kernel_terminal_workspace_culler_extension.svg)](https://www.npmjs.com/package/jupyterlab_kernel_terminal_workspace_culler_extension)
72
+ [![PyPI version](https://img.shields.io/pypi/v/jupyterlab-kernel-terminal-workspace-culler-extension.svg)](https://pypi.org/project/jupyterlab-kernel-terminal-workspace-culler-extension/)
73
+ [![Total PyPI downloads](https://static.pepy.tech/badge/jupyterlab-kernel-terminal-workspace-culler-extension)](https://pepy.tech/project/jupyterlab-kernel-terminal-workspace-culler-extension)
74
+ [![JupyterLab 4](https://img.shields.io/badge/JupyterLab-4-orange.svg)](https://jupyterlab.readthedocs.io/en/stable/)
75
+ [![Brought To You By KOLOMOLO](https://img.shields.io/badge/Brought%20To%20You%20By-KOLOMOLO-00ffff?style=flat)](https://kolomolo.com)
76
+ [![Donate PayPal](https://img.shields.io/badge/Donate-PayPal-blue?style=flat)](https://www.paypal.com/donate/?hosted_button_id=B4KPBJDLLXTSA)
77
+
78
+ Automatically cull idle kernels, terminals, and workspaces after configurable timeout periods. Helps manage system resources by cleaning up unused resources that accumulate during long JupyterLab usage.
79
+
80
+ ## Features
81
+
82
+ - **Idle kernel culling** - Shut down kernels idle beyond timeout (checks `execution_state` and `last_activity`)
83
+ - **Idle terminal culling** - Close terminals with no WebSocket activity beyond timeout
84
+ - **Workspace culling** - Remove stale JupyterLab workspaces (auto-0, auto-k, etc.) based on last modified time
85
+ - **Configurable timeouts** - All timeouts adjustable via JupyterLab Settings
86
+ - **Notifications** - Optional toast notifications when resources are culled (requires `jupyterlab-notifications`)
87
+ - **Server-side detection** - Uses tornado PeriodicCallback for accurate activity tracking
88
+
89
+ ## Default Settings
90
+
91
+ | Setting | Default | Description |
92
+ | ----------------- | ------------------ | --------------------------------------------------- |
93
+ | Kernel timeout | 60 min (1 hour) | Idle kernels culled after this period |
94
+ | Terminal timeout | 60 min (1 hour) | Inactive terminals culled after this period |
95
+ | Disconnected only | enabled | Only cull terminals with no open browser tab |
96
+ | Workspace culling | enabled | Cull stale workspaces (default workspace protected) |
97
+ | Workspace timeout | 10080 min (7 days) | Stale workspaces culled after this period |
98
+ | Check interval | 5 min | How often the culler checks for idle resources |
99
+ | Notifications | enabled | Show notification when resources are culled |
100
+
101
+ ## How Idle Detection Works
102
+
103
+ **Kernels**: Checked for `execution_state` (busy kernels are never culled) and `last_activity` timestamp. A kernel is idle when it's not executing and hasn't had activity beyond the timeout.
104
+
105
+ **Terminals**: By default, only terminals with no active browser tab are culled (controlled by "Only Cull Disconnected Terminals" setting). When a terminal tab is open, it maintains a WebSocket connection and won't be culled regardless of idle time. Once the tab is closed, the terminal becomes eligible for culling after the idle timeout.
106
+
107
+ **Workspaces**: Based on the workspace file's `last_modified` timestamp. JupyterLab creates auto-named workspaces (auto-0, auto-k, etc.) when you open multiple windows. The default workspace is never culled.
108
+
109
+ > **Note**: Terminal culling sends SIGHUP to the terminal process. Processes started with `nohup` will survive culling.
110
+
111
+ ## Installation
112
+
113
+ Requires JupyterLab 4.0.0 or higher.
114
+
115
+ ```bash
116
+ pip install jupyterlab-kernel-terminal-workspace-culler-extension
117
+ ```
118
+
119
+ ## Configuration
120
+
121
+ Open JupyterLab Settings (`Settings` -> `Settings Editor`) and search for "Resource Culler" to adjust timeouts and enable/disable culling for each resource type.
122
+
123
+ ## Logs
124
+
125
+ Culling actions are logged at INFO level with `[Culler]` prefix:
126
+
127
+ ```
128
+ [Culler] CULLING KERNEL abc123 - idle 65.2 minutes (threshold: 60)
129
+ [Culler] Kernel abc123 culled successfully
130
+ [Culler] CULLING TERMINAL 1 - idle 62.1 minutes (threshold: 60)
131
+ [Culler] Terminal 1 culled successfully
132
+ ```
133
+
134
+ Run JupyterLab with `--log-level=INFO` to see culling activity.
135
+
136
+ ## FAQ
137
+
138
+ **Q: My long-running calculation was killed. How do I prevent this?**
139
+
140
+ Two options:
141
+
142
+ 1. **Increase timeout**: Go to `Settings` -> `Settings Editor` -> `Resource Culler` and increase the kernel/terminal timeout
143
+ 2. **Use a terminal multiplexer**: Run calculations inside `screen` or `tmux` - these survive terminal culling
144
+
145
+ ```bash
146
+ # Using screen
147
+ screen -S mysession
148
+ python long_calculation.py
149
+ # Detach with Ctrl+A, D
150
+
151
+ # Using tmux
152
+ tmux new -s mysession
153
+ python long_calculation.py
154
+ # Detach with Ctrl+B, D
155
+ ```
156
+
157
+ **Q: Will closing my browser tab kill my running process?**
158
+
159
+ For terminals: By default, terminals are only culled when the browser tab is closed (disconnected). After closing the tab, the terminal will be culled once the idle timeout expires. Foreground processes receive SIGHUP. Use `nohup`, `screen`, or `tmux` for processes that must survive.
160
+
161
+ For kernels: The kernel continues running. Activity is tracked server-side, so a busy kernel won't be culled even if the browser is closed.
162
+
163
+ **Q: What happens to processes started with `nohup`?**
164
+
165
+ They survive terminal culling. `nohup` makes processes ignore SIGHUP, which is the signal sent when a terminal closes.
166
+
167
+ **Q: How do I disable culling entirely?**
168
+
169
+ Go to `Settings` -> `Settings Editor` -> `Resource Culler` and uncheck "Enable Kernel Culling" and "Enable Terminal Culling".
170
+
171
+ **Q: Can I see when resources were culled?**
172
+
173
+ Yes. Run JupyterLab with `--log-level=INFO` to see `[Culler]` log messages. If you have `jupyterlab-notifications` installed, you'll also see toast notifications.
174
+
175
+ ## CLI
176
+
177
+ The extension includes a command-line tool for listing and culling resources from the terminal.
178
+
179
+ ```bash
180
+ # Show help
181
+ jupyterlab_kernel_terminal_workspace_culler
182
+
183
+ # List all resources and their idle times
184
+ jupyterlab_kernel_terminal_workspace_culler list
185
+
186
+ # List as JSON
187
+ jupyterlab_kernel_terminal_workspace_culler list --json
188
+
189
+ # Show what would be culled (dry run)
190
+ jupyterlab_kernel_terminal_workspace_culler cull --dry-run
191
+
192
+ # Cull idle resources
193
+ jupyterlab_kernel_terminal_workspace_culler cull
194
+
195
+ # Custom timeouts
196
+ jupyterlab_kernel_terminal_workspace_culler cull --kernel-timeout 30 --terminal-timeout 120
197
+ ```
198
+
199
+ The CLI auto-discovers running Jupyter servers. You can also set environment variables:
200
+
201
+ - `JUPYTER_SERVER_URL` - server URL (e.g., `http://localhost:8888/`)
202
+ - `JUPYTER_TOKEN` - authentication token
203
+
204
+ ## Uninstall
205
+
206
+ ```bash
207
+ pip uninstall jupyterlab-kernel-terminal-workspace-culler-extension
208
+ ```
@@ -0,0 +1,23 @@
1
+ jupyterlab_kernel_terminal_workspace_culler_extension/__init__.py,sha256=r5ZF2NpwEDdsYfWR6vfx-a-sLqSfKiKqzy_vgfXQR7o,1751
2
+ jupyterlab_kernel_terminal_workspace_culler_extension/_version.py,sha256=pfBhe86hXpfxbVJaJORycqD4XzhoXYgh9qx0ZZTz5Bk,172
3
+ jupyterlab_kernel_terminal_workspace_culler_extension/cli.py,sha256=0iL1qUTA_LwGCYntD7A0nseJMvPKG9Ov9v4nqJK5T6Q,16455
4
+ jupyterlab_kernel_terminal_workspace_culler_extension/culler.py,sha256=Ba7sQrJzQdR8tZYVwWLwo27IT-ydyAKDBNurZ1_gBTE,20272
5
+ jupyterlab_kernel_terminal_workspace_culler_extension/routes.py,sha256=90oi0AlEYT4Hzs_kGJE3qYyGC0DMzRnzYrwyH8eaihM,5827
6
+ jupyterlab_kernel_terminal_workspace_culler_extension/tests/__init__.py,sha256=yliykFGwH_VsIuTkC_qNnM2a6f5UHm_gs5Ulv76o_hQ,83
7
+ jupyterlab_kernel_terminal_workspace_culler_extension/tests/test_culler.py,sha256=NRvlJfkQZ-L7RRQWVh52Ia1J0Ss3bI4gIIvXR3z5hcM,9900
8
+ jupyterlab_kernel_terminal_workspace_culler_extension/tests/test_routes.py,sha256=Uay3HllRF3QDiGdshGa7Lm_e99TD_MttcHYpm0IIFkY,496
9
+ jupyterlab_kernel_terminal_workspace_culler_extension-1.0.21.data/data/etc/jupyter/jupyter_server_config.d/jupyterlab_kernel_terminal_workspace_culler_extension.json,sha256=xJnwhUyXquBONGYe4mMe1P2SKKeI-pFGvU0h-yuNdao,128
10
+ jupyterlab_kernel_terminal_workspace_culler_extension-1.0.21.data/data/share/jupyter/labextensions/jupyterlab_kernel_terminal_workspace_culler_extension/package.json,sha256=ArVRD_ndcIRPQf5ec-53M_zUepiGJ2PA4kyIwwZjla4,6724
11
+ jupyterlab_kernel_terminal_workspace_culler_extension-1.0.21.data/data/share/jupyter/labextensions/jupyterlab_kernel_terminal_workspace_culler_extension/schemas/jupyterlab_kernel_terminal_workspace_culler_extension/package.json.orig,sha256=zZSHRM3l_rQu-LX_R5AVBqqbUTC4rGqxIAYkWGWra9E,7580
12
+ jupyterlab_kernel_terminal_workspace_culler_extension-1.0.21.data/data/share/jupyter/labextensions/jupyterlab_kernel_terminal_workspace_culler_extension/schemas/jupyterlab_kernel_terminal_workspace_culler_extension/plugin.json,sha256=KtzjglHS_-pyo7RFVDcnI5JXZCgvulLiNqihe30rRq4,1992
13
+ jupyterlab_kernel_terminal_workspace_culler_extension-1.0.21.data/data/share/jupyter/labextensions/jupyterlab_kernel_terminal_workspace_culler_extension/static/728.b056947597422f9e496c.js,sha256=sFaUdZdCL55JbF5K4gOVDQe28AUzNc4uauWFiV3TDIU,4059
14
+ jupyterlab_kernel_terminal_workspace_culler_extension-1.0.21.data/data/share/jupyter/labextensions/jupyterlab_kernel_terminal_workspace_culler_extension/static/750.b2aa372edac477cffcb9.js,sha256=sqo3LtrEd8_8uUCEk0YdCX2vUZsYLSV0lzeeLwuqDNs,3056
15
+ jupyterlab_kernel_terminal_workspace_culler_extension-1.0.21.data/data/share/jupyter/labextensions/jupyterlab_kernel_terminal_workspace_culler_extension/static/remoteEntry.61977aac2cfde9b88947.js,sha256=YZd6rCz96biJR0QHDlflNcRv-3S4UeGVmxwImLo4gaA,6987
16
+ jupyterlab_kernel_terminal_workspace_culler_extension-1.0.21.data/data/share/jupyter/labextensions/jupyterlab_kernel_terminal_workspace_culler_extension/static/style.js,sha256=lkGBrVLTVM6OfkgLnTTywlNh55EoypU7fUxMBkrdP7o,196
17
+ jupyterlab_kernel_terminal_workspace_culler_extension-1.0.21.data/data/share/jupyter/labextensions/jupyterlab_kernel_terminal_workspace_culler_extension/static/third-party-licenses.json,sha256=W6N2sSD7tQihMqQk64F9xMd1Flfr2KO97esAiHUOYdM,2453
18
+ jupyterlab_kernel_terminal_workspace_culler_extension-1.0.21.data/data/share/jupyter/labextensions/jupyterlab_kernel_terminal_workspace_culler_extension/install.json,sha256=1AtzkqQaikPfJ6fFodcVJxVDqmD7OrWOYyrTxXwflDY,267
19
+ jupyterlab_kernel_terminal_workspace_culler_extension-1.0.21.dist-info/METADATA,sha256=MZZahyvWdu5ZxW3j6xWcN2xGqqVFnCuUXapusvSuuVo,10849
20
+ jupyterlab_kernel_terminal_workspace_culler_extension-1.0.21.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
21
+ jupyterlab_kernel_terminal_workspace_culler_extension-1.0.21.dist-info/entry_points.txt,sha256=1V59bowv5KU_kK9VRCm80aV4QXibtFTTDqsNpqaYp-M,127
22
+ jupyterlab_kernel_terminal_workspace_culler_extension-1.0.21.dist-info/licenses/LICENSE,sha256=5WO6BCE6llvhQT-r4BgmmbzCtABwpeGuJse1ab3HXFo,1523
23
+ jupyterlab_kernel_terminal_workspace_culler_extension-1.0.21.dist-info/RECORD,,
@@ -0,0 +1,4 @@
1
+ Wheel-Version: 1.0
2
+ Generator: hatchling 1.28.0
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ jupyterlab_kernel_terminal_workspace_culler = jupyterlab_kernel_terminal_workspace_culler_extension.cli:main
@@ -0,0 +1,29 @@
1
+ BSD 3-Clause License
2
+
3
+ Copyright (c) 2026, Stellars Henson
4
+ All rights reserved.
5
+
6
+ Redistribution and use in source and binary forms, with or without
7
+ modification, are permitted provided that the following conditions are met:
8
+
9
+ 1. Redistributions of source code must retain the above copyright notice, this
10
+ list of conditions and the following disclaimer.
11
+
12
+ 2. Redistributions in binary form must reproduce the above copyright notice,
13
+ this list of conditions and the following disclaimer in the documentation
14
+ and/or other materials provided with the distribution.
15
+
16
+ 3. Neither the name of the copyright holder nor the names of its
17
+ contributors may be used to endorse or promote products derived from
18
+ this software without specific prior written permission.
19
+
20
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
23
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
24
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
26
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
27
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
28
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.