codebind 0.6.4__tar.gz → 0.6.6__tar.gz

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 (32) hide show
  1. codebind-0.6.6/PKG-INFO +135 -0
  2. codebind-0.6.6/README.md +107 -0
  3. {codebind-0.6.4 → codebind-0.6.6}/data/share/jupyter/labextensions/codebind-jupyterlab/package.json +2 -2
  4. codebind-0.6.4/data/share/jupyter/labextensions/codebind-jupyterlab/static/remoteEntry.e6950b0910a94bc0.js → codebind-0.6.6/data/share/jupyter/labextensions/codebind-jupyterlab/static/remoteEntry.c10098fb6e87897c.js +1 -1
  5. {codebind-0.6.4 → codebind-0.6.6}/jupyterlab/package.json +1 -1
  6. {codebind-0.6.4 → codebind-0.6.6}/pyproject.toml +3 -2
  7. {codebind-0.6.4 → codebind-0.6.6}/pyproject.toml.orig +3 -2
  8. {codebind-0.6.4 → codebind-0.6.6}/src/codebind/execution.py +59 -7
  9. {codebind-0.6.4 → codebind-0.6.6}/src/codebind/extension.py +8 -0
  10. codebind-0.6.6/src/codebind/terminal.py +99 -0
  11. codebind-0.6.4/PKG-INFO +0 -116
  12. codebind-0.6.4/README.md +0 -89
  13. {codebind-0.6.4 → codebind-0.6.6}/LICENSE +0 -0
  14. {codebind-0.6.4 → codebind-0.6.6}/data/share/jupyter/labextensions/codebind-jupyterlab/install.json +0 -0
  15. {codebind-0.6.4 → codebind-0.6.6}/data/share/jupyter/labextensions/codebind-jupyterlab/static/590.dae4561c5427a855.js +0 -0
  16. {codebind-0.6.4 → codebind-0.6.6}/data/share/jupyter/labextensions/codebind-jupyterlab/static/style.js +0 -0
  17. {codebind-0.6.4 → codebind-0.6.6}/data/share/jupyter/labextensions/codebind-jupyterlab/static/third-party-licenses.json +0 -0
  18. {codebind-0.6.4 → codebind-0.6.6}/jupyterlab/.yarnrc.yml +0 -0
  19. {codebind-0.6.4 → codebind-0.6.6}/jupyterlab/install.json +0 -0
  20. {codebind-0.6.4 → codebind-0.6.6}/jupyterlab/src/index.ts +0 -0
  21. {codebind-0.6.4 → codebind-0.6.6}/jupyterlab/tsconfig.json +0 -0
  22. {codebind-0.6.4 → codebind-0.6.6}/jupyterlab/yarn.lock +0 -0
  23. {codebind-0.6.4 → codebind-0.6.6}/src/codebind/__init__.py +0 -0
  24. {codebind-0.6.4 → codebind-0.6.6}/src/codebind/cli.py +0 -0
  25. {codebind-0.6.4 → codebind-0.6.6}/src/codebind/configuration.py +0 -0
  26. {codebind-0.6.4 → codebind-0.6.6}/src/codebind/conversation.py +0 -0
  27. {codebind-0.6.4 → codebind-0.6.6}/src/codebind/display.py +0 -0
  28. {codebind-0.6.4 → codebind-0.6.6}/src/codebind/images.py +0 -0
  29. {codebind-0.6.4 → codebind-0.6.6}/src/codebind/instructions.md +0 -0
  30. {codebind-0.6.4 → codebind-0.6.6}/src/codebind/jupyter.py +0 -0
  31. {codebind-0.6.4 → codebind-0.6.6}/src/codebind/py.typed +0 -0
  32. {codebind-0.6.4 → codebind-0.6.6}/src/codebind/session.py +0 -0
@@ -0,0 +1,135 @@
1
+ Metadata-Version: 2.4
2
+ Name: codebind
3
+ Version: 0.6.6
4
+ Summary: A frontend-neutral model loop for persistent IPython sessions.
5
+ Keywords: ai,ipython,llm,repl,agents
6
+ Author: Giovanni Gravili
7
+ Author-email: Giovanni Gravili <ghovax@users.noreply.github.com>
8
+ License-Expression: MIT
9
+ License-File: LICENSE
10
+ Classifier: Development Status :: 3 - Alpha
11
+ Classifier: Framework :: Jupyter :: JupyterLab :: Extensions :: Prebuilt
12
+ Classifier: Intended Audience :: Developers
13
+ Classifier: Operating System :: OS Independent
14
+ Classifier: Programming Language :: Python :: 3
15
+ Classifier: Programming Language :: Python :: 3.13
16
+ Classifier: Programming Language :: Python :: 3.14
17
+ Classifier: Typing :: Typed
18
+ Requires-Dist: ipython>=9.17
19
+ Requires-Dist: langchain-core>=1.0
20
+ Requires-Dist: models-provider>=0.1.2
21
+ Requires-Dist: pillow>=11
22
+ Requires-Dist: resvg-py>=0.5
23
+ Requires-Dist: rich>=14.1
24
+ Requires-Python: >=3.13
25
+ Project-URL: Repository, https://github.com/ghovax/codebind
26
+ Project-URL: Issues, https://github.com/ghovax/codebind/issues
27
+ Description-Content-Type: text/markdown
28
+
29
+ # Codebind
30
+
31
+ Codebind turns an ordinary IPython session into a durable model harness with one tool: an IPython cell executed in the active session. IPython owns execution, namespace, history, magics, tracebacks, and rich display; Codebind owns conversation state and model orchestration.
32
+
33
+ ## Installation
34
+
35
+ ```console
36
+ uvx codebind
37
+ ```
38
+
39
+ Or install it with any Python package installer:
40
+
41
+ ```console
42
+ pip install codebind
43
+ ```
44
+
45
+ ## Configuration
46
+
47
+ Codebind reads its private model choice from `$XDG_CONFIG_HOME/codebind/configuration.json`, or `~/.config/codebind/configuration.json` when `XDG_CONFIG_HOME` is unset:
48
+
49
+ ```json
50
+ {
51
+ "model": "openai/gpt-5.6-luna",
52
+ "parameters": {
53
+ "reasoning_effort": "medium"
54
+ }
55
+ }
56
+ ```
57
+
58
+ Provider credentials use the same XDG directory in `models.json`. Keep both files readable only by their owner. Loading Codebind does not add `chat`, `model`, `models`, `Models`, or any other variable to the IPython namespace.
59
+
60
+ ## Terminal IPython
61
+
62
+ Start a new conversation:
63
+
64
+ ```console
65
+ uvx codebind
66
+ ```
67
+
68
+ Ask through ordinary IPython magic syntax:
69
+
70
+ ```python
71
+ %%question
72
+ Inspect this project and tell me what to implement first.
73
+ ```
74
+
75
+ Terminal conversations remain live for the current IPython process. Durable automatic resumption belongs to notebooks, where the notebook file provides an unambiguous conversation identity.
76
+ Model-executed cells appear with IPython's native input counter, syntax highlighting, output prompts, streams, and tracebacks. Assistant Markdown is rendered through IPython's terminal MIME renderer. A terminal is a stream rather than a notebook document, so these displays are not editable notebook cells.
77
+
78
+ ## JupyterLab
79
+
80
+ ```console
81
+ uvx --from jupyterlab --with codebind --with 'nbconvert[webpdf]' jupyter lab
82
+ ```
83
+
84
+ When running an unpublished local checkout, expose both its editable Python source and its current prebuilt frontend:
85
+
86
+ ```console
87
+ JUPYTER_PATH=/path/to/codebind/data/share/jupyter \
88
+ uvx --refresh --from jupyterlab --with-editable /path/to/codebind \
89
+ --with 'nbconvert[webpdf]' jupyter-lab
90
+ ```
91
+
92
+ Load Codebind in a notebook:
93
+
94
+ ```python
95
+ %load_ext codebind
96
+ ```
97
+
98
+ That is the complete setup. **Question** is a native toolbar toggle:
99
+
100
+ - Turning it on converts the selected cell into a Question and makes each newly created user cell a Question until the toggle is turned off.
101
+ - Codebind-generated instruction, tool, and answer cells are never converted.
102
+ - Write ordinary Markdown and press `Shift+Enter`.
103
+
104
+ ### Instructions and notebook context
105
+
106
+ - Loading the extension adds a locked Markdown cell containing Codebind's packaged instructions. Its exact text becomes the conversation's immutable system message and remains stable when the server or kernel restarts.
107
+ - The whole notebook is model context. Before each Question, Codebind snapshots ordinary Markdown, raw, and code cells—including visible text and image outputs, but never the live Python namespace.
108
+ - Images displayed by the model's IPython tool are included in that tool's result. PNG, JPEG, WebP, GIF, and SVG renditions are prepared as model-visible images; unsupported or oversized images are reported as omissions.
109
+ - The first turn records the snapshot. Later turns append only new, changed, removed, or reordered cells. Existing Questions, tool calls, tool results, and answers in the conversation ledger are not duplicated.
110
+ - Image bytes travel in the relevant message; notebook snapshots contain only stable image descriptors. This append-only representation keeps the prior model prefix unchanged for provider caching.
111
+
112
+ ### Persistence and notebook behavior
113
+
114
+ - Codebind stores the complete LangChain message, notebook-context, and turn ledger in notebook metadata. Reopening the notebook, restarting its kernel, and loading the extension restores the accumulated context automatically.
115
+ - Each assistant Markdown segment is buffered and inserted as one complete native cell as soon as it finishes, before a following tool call completes.
116
+ - Tool executions and assistant answers are appended to the notebook end without changing the user's selection or scroll position. Tool outputs are collapsed by default and expandable through JupyterLab's native output control.
117
+
118
+ ### Reliability and editing
119
+
120
+ - The conversation ledger validates its structure and each assistant tool call against its single matching result, without a version gate.
121
+ - Interrupted saves finish before a turn is cancelled, preventing a restart from turning a partial write into an orphan tool result. An interrupted tool call is closed with an explicit interrupted result.
122
+ - Temporary model transport failures retry the same Question with a fresh connection; repeated WebSocket failures use HTTP. Invalid requests and authentication failures remain visible errors.
123
+ - If a provider stream is cancelled or fails, Codebind discards that provider session before the next Question while retaining the notebook conversation and stable prompt-cache identity.
124
+ - The instruction cell, sent Question cells, model-authored tool cells, and assistant Markdown cells are non-editable and non-deletable. Draft Questions remain editable until sent. Jupyter's standard interrupt button cancels an active Codebind question.
125
+
126
+ ### Markdown and other frontends
127
+
128
+ - Question and assistant Markdown supports `$...$`, `$$...$$`, `\(...\)`, and `\[...\]` through JupyterLab's native MathJax renderer.
129
+ - Other IPython frontends retain standard MIME display, syntax-highlighted code, Markdown, stdout, tracebacks, rich results, and native IPython history.
130
+
131
+ ## ChatGPT account access
132
+
133
+ - Models Provider owns OpenAI account authorization and token refresh.
134
+ - Save the resulting provider-values object in Codebind's XDG `models.json`; Codebind loads it privately when the extension starts.
135
+ - ChatGPT subscription access is separate from the public, pay-as-you-go OpenAI API and may require compatibility updates when the account protocol changes.
@@ -0,0 +1,107 @@
1
+ # Codebind
2
+
3
+ Codebind turns an ordinary IPython session into a durable model harness with one tool: an IPython cell executed in the active session. IPython owns execution, namespace, history, magics, tracebacks, and rich display; Codebind owns conversation state and model orchestration.
4
+
5
+ ## Installation
6
+
7
+ ```console
8
+ uvx codebind
9
+ ```
10
+
11
+ Or install it with any Python package installer:
12
+
13
+ ```console
14
+ pip install codebind
15
+ ```
16
+
17
+ ## Configuration
18
+
19
+ Codebind reads its private model choice from `$XDG_CONFIG_HOME/codebind/configuration.json`, or `~/.config/codebind/configuration.json` when `XDG_CONFIG_HOME` is unset:
20
+
21
+ ```json
22
+ {
23
+ "model": "openai/gpt-5.6-luna",
24
+ "parameters": {
25
+ "reasoning_effort": "medium"
26
+ }
27
+ }
28
+ ```
29
+
30
+ Provider credentials use the same XDG directory in `models.json`. Keep both files readable only by their owner. Loading Codebind does not add `chat`, `model`, `models`, `Models`, or any other variable to the IPython namespace.
31
+
32
+ ## Terminal IPython
33
+
34
+ Start a new conversation:
35
+
36
+ ```console
37
+ uvx codebind
38
+ ```
39
+
40
+ Ask through ordinary IPython magic syntax:
41
+
42
+ ```python
43
+ %%question
44
+ Inspect this project and tell me what to implement first.
45
+ ```
46
+
47
+ Terminal conversations remain live for the current IPython process. Durable automatic resumption belongs to notebooks, where the notebook file provides an unambiguous conversation identity.
48
+ Model-executed cells appear with IPython's native input counter, syntax highlighting, output prompts, streams, and tracebacks. Assistant Markdown is rendered through IPython's terminal MIME renderer. A terminal is a stream rather than a notebook document, so these displays are not editable notebook cells.
49
+
50
+ ## JupyterLab
51
+
52
+ ```console
53
+ uvx --from jupyterlab --with codebind --with 'nbconvert[webpdf]' jupyter lab
54
+ ```
55
+
56
+ When running an unpublished local checkout, expose both its editable Python source and its current prebuilt frontend:
57
+
58
+ ```console
59
+ JUPYTER_PATH=/path/to/codebind/data/share/jupyter \
60
+ uvx --refresh --from jupyterlab --with-editable /path/to/codebind \
61
+ --with 'nbconvert[webpdf]' jupyter-lab
62
+ ```
63
+
64
+ Load Codebind in a notebook:
65
+
66
+ ```python
67
+ %load_ext codebind
68
+ ```
69
+
70
+ That is the complete setup. **Question** is a native toolbar toggle:
71
+
72
+ - Turning it on converts the selected cell into a Question and makes each newly created user cell a Question until the toggle is turned off.
73
+ - Codebind-generated instruction, tool, and answer cells are never converted.
74
+ - Write ordinary Markdown and press `Shift+Enter`.
75
+
76
+ ### Instructions and notebook context
77
+
78
+ - Loading the extension adds a locked Markdown cell containing Codebind's packaged instructions. Its exact text becomes the conversation's immutable system message and remains stable when the server or kernel restarts.
79
+ - The whole notebook is model context. Before each Question, Codebind snapshots ordinary Markdown, raw, and code cells—including visible text and image outputs, but never the live Python namespace.
80
+ - Images displayed by the model's IPython tool are included in that tool's result. PNG, JPEG, WebP, GIF, and SVG renditions are prepared as model-visible images; unsupported or oversized images are reported as omissions.
81
+ - The first turn records the snapshot. Later turns append only new, changed, removed, or reordered cells. Existing Questions, tool calls, tool results, and answers in the conversation ledger are not duplicated.
82
+ - Image bytes travel in the relevant message; notebook snapshots contain only stable image descriptors. This append-only representation keeps the prior model prefix unchanged for provider caching.
83
+
84
+ ### Persistence and notebook behavior
85
+
86
+ - Codebind stores the complete LangChain message, notebook-context, and turn ledger in notebook metadata. Reopening the notebook, restarting its kernel, and loading the extension restores the accumulated context automatically.
87
+ - Each assistant Markdown segment is buffered and inserted as one complete native cell as soon as it finishes, before a following tool call completes.
88
+ - Tool executions and assistant answers are appended to the notebook end without changing the user's selection or scroll position. Tool outputs are collapsed by default and expandable through JupyterLab's native output control.
89
+
90
+ ### Reliability and editing
91
+
92
+ - The conversation ledger validates its structure and each assistant tool call against its single matching result, without a version gate.
93
+ - Interrupted saves finish before a turn is cancelled, preventing a restart from turning a partial write into an orphan tool result. An interrupted tool call is closed with an explicit interrupted result.
94
+ - Temporary model transport failures retry the same Question with a fresh connection; repeated WebSocket failures use HTTP. Invalid requests and authentication failures remain visible errors.
95
+ - If a provider stream is cancelled or fails, Codebind discards that provider session before the next Question while retaining the notebook conversation and stable prompt-cache identity.
96
+ - The instruction cell, sent Question cells, model-authored tool cells, and assistant Markdown cells are non-editable and non-deletable. Draft Questions remain editable until sent. Jupyter's standard interrupt button cancels an active Codebind question.
97
+
98
+ ### Markdown and other frontends
99
+
100
+ - Question and assistant Markdown supports `$...$`, `$$...$$`, `\(...\)`, and `\[...\]` through JupyterLab's native MathJax renderer.
101
+ - Other IPython frontends retain standard MIME display, syntax-highlighted code, Markdown, stdout, tracebacks, rich results, and native IPython history.
102
+
103
+ ## ChatGPT account access
104
+
105
+ - Models Provider owns OpenAI account authorization and token refresh.
106
+ - Save the resulting provider-values object in Codebind's XDG `models.json`; Codebind loads it privately when the extension starts.
107
+ - ChatGPT subscription access is separate from the public, pay-as-you-go OpenAI API and may require compatibility updates when the account protocol changes.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "codebind-jupyterlab",
3
- "version": "0.6.4",
3
+ "version": "0.6.5",
4
4
  "description": "Native JupyterLab cells and Question cells for Codebind.",
5
5
  "license": "MIT",
6
6
  "main": "lib/index.js",
@@ -31,7 +31,7 @@
31
31
  "extension": true,
32
32
  "outputDir": "../data/share/jupyter/labextensions/codebind-jupyterlab",
33
33
  "_build": {
34
- "load": "static/remoteEntry.e6950b0910a94bc0.js",
34
+ "load": "static/remoteEntry.c10098fb6e87897c.js",
35
35
  "extension": "./extension"
36
36
  }
37
37
  }
@@ -1 +1 @@
1
- var _JUPYTERLAB;(()=>{"use strict";var e,n,r,t,o,i,u,a,l,c,s,f,p,d,h,g,v,y,b,m,S,k,j,w,E,x,T,M,P,V,q,A,C,O,D,_,L,N={457(e,n,r){var t={"./index":()=>r.e(590).then(()=>()=>r(509)),"./extension":()=>r.e(590).then(()=>()=>r(509))},o=function(e,n){return r.R=n,n=r.o(t,e)?t[e]():Promise.resolve().then(()=>{throw Error('Module "'+e+'" does not exist in container.')}),r.R=void 0,n},i=function(e,n){if(r.S){var t="default",o=r.S[t];if(o&&o!==e)throw Error("Container initialization failed as it has already been initialized with a different share scope");return r.S[t]=e,r.I(t,n)}};r.d(n,{get:()=>o,init:()=>i})}},$={};function z(e){var n=$[e];if(void 0!==n)return n.exports;var r=$[e]={exports:{}};return N[e](r,r.exports,z),r.exports}z.m=N,z.c=$,z.n=e=>{var n=e&&e.__esModule?()=>e.default:()=>e;return z.d(n,{a:n}),n},z.d=(e,n,r)=>{var t=(n,r)=>{for(var t in n)z.o(n,t)&&!z.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,[r]:n[t]})};t(n,"get"),t(r,"value")},z.f={},z.e=e=>Promise.all(Object.keys(z.f).reduce((n,r)=>(z.f[r](e,n),n),[])),z.u=e=>""+e+".dae4561c5427a855.js?v=dae4561c5427a855",z.g=(()=>{if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(e){if("object"==typeof window)return window}})(),z.o=(e,n)=>Object.prototype.hasOwnProperty.call(e,n),I={},z.l=function(e,n,r,t){if(I[e])return void I[e].push(n);if(void 0!==r)for(var o,i,u=document.getElementsByTagName("script"),a=0;a<u.length;a++){var l=u[a];if(l.getAttribute("src")==e||l.getAttribute("data-rspack")=="codebind-jupyterlab:"+r){o=l;break}}o||(i=!0,(o=document.createElement("script")).timeout=120,z.nc&&o.setAttribute("nonce",z.nc),o.setAttribute("data-rspack","codebind-jupyterlab:"+r),o.src=e),I[e]=[n];var c=function(n,r){o.onerror=o.onload=null,clearTimeout(s);var t=I[e];if(delete I[e],o.parentNode&&o.parentNode.removeChild(o),t&&t.forEach(function(e){return e(r)}),n)return n(r)},s=setTimeout(c.bind(null,void 0,{type:"timeout",target:o}),12e4);o.onerror=c.bind(null,o.onerror),o.onload=c.bind(null,o.onload),i&&document.head.appendChild(o)},z.r=e=>{"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},z.S={},z.initializeSharingData={scopeToSharingDataMapping:{default:[{name:"codebind-jupyterlab",version:"0.6.4",factory:()=>z.e(590).then(()=>()=>z(509)),eager:0,treeShakingMode:null}]},uniqueName:"codebind-jupyterlab"},R={},U={},z.I=function(e,n){n||(n=[]);var r=U[e];if(r||(r=U[e]={}),!(n.indexOf(r)>=0)){if(n.push(r),R[e])return R[e];z.o(z.S,e)||(z.S[e]={});var t=z.S[e],o=function(e){"u">typeof console&&console.warn&&console.warn(e)},i=z.initializeSharingData.uniqueName,u=function(e,n,r,o){var u=t[e]=t[e]||{},a=u[n];(!a||!a.loaded&&(!o!=!a.eager?o:i>a.from))&&(u[n]={get:r,from:i,eager:!!o})},a=function(r){var t=function(e){o("Initialization of sharing external failed: "+e)};try{var i=z(r);if(!i)return;var u=function(r){return r&&r.init&&r.init(z.S[e],n)};if(i.then)return l.push(i.then(u,t));var a=u(i);if(a&&a.then)return l.push(a.catch(t))}catch(e){t(e)}},l=[],c=z.initializeSharingData.scopeToSharingDataMapping;return(c[e]&&c[e].forEach(function(e){"object"==typeof e?u(e.name,e.version,e.factory,e.eager):a(e)}),l.length)?R[e]=Promise.all(l).then(function(){return R[e]=1}):R[e]=1}},z.g.importScripts&&(B=z.g.location+"");var I,R,U,B,K=z.g.document;if(!B&&K&&(K.currentScript&&"SCRIPT"===K.currentScript.tagName.toUpperCase()&&(B=K.currentScript.src),!B)){var J=K.getElementsByTagName("script");if(J.length)for(var Y=J.length-1;Y>-1&&(!B||!/^http(s?):/.test(B));)B=J[Y--].src}if(!B)throw Error("Automatic publicPath is not supported in this browser");z.p=B=B.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),z.consumesLoadingData={chunkMapping:{590:["511","343","99","171","241"]},moduleIdToConsumeDataMapping:{171:{shareScope:"default",shareKey:"@jupyterlab/notebook",import:null,requiredVersion:"^4.6.3",strictVersion:!1,singleton:!0,eager:!1,fallback:void 0,treeShakingMode:null},241:{shareScope:"default",shareKey:"@jupyterlab/services",import:null,requiredVersion:"^7.6.3",strictVersion:!1,singleton:!0,eager:!1,fallback:void 0,treeShakingMode:null},343:{shareScope:"default",shareKey:"@jupyterlab/cells",import:null,requiredVersion:"^4.6.3",strictVersion:!1,singleton:!1,eager:!1,fallback:void 0,treeShakingMode:null},511:{shareScope:"default",shareKey:"@jupyterlab/apputils",import:null,requiredVersion:"^4.7.3",strictVersion:!1,singleton:!0,eager:!1,fallback:void 0,treeShakingMode:null},99:{shareScope:"default",shareKey:"@jupyterlab/nbformat",import:null,requiredVersion:"^4.6.3",strictVersion:!1,singleton:!1,eager:!1,fallback:void 0,treeShakingMode:null}},initialConsumes:[]},e=function(e){return e.split(".").map(function(e){return+e==e?+e:e})},n=function(n){var r=function(n){var r=/^([^-+]+)?(?:-([^+]+))?(?:\+(.+))?$/.exec(n),t=r[1]?[0].concat(e(r[1])):[0];r[2]&&(t.length++,t.push.apply(t,e(r[2])));let o=t[t.length-1];for(;t.length&&(void 0===o||/^[*xX]$/.test(o));)t.pop(),o=t[t.length-1];return t},t=function(e){return 1===e.length?[0]:2===e.length?[1].concat(e.slice(1)):3===e.length?[2].concat(e.slice(1)):[e.length].concat(e.slice(1))},o=function(e){return[-e[0]-1].concat(e.slice(1))},i=function(e){let n=/^(\^|~|<=|<|>=|>|=|v|!)/.exec(e),i=n?n[0]:"",u=r(i.length?e.slice(i.length).trim():e.trim());switch(i){case"^":if(u.length>1&&0===u[1]){if(u.length>2&&0===u[2])return[3].concat(u.slice(1));return[2].concat(u.slice(1))}return[1].concat(u.slice(1));case"~":return[2].concat(u.slice(1));case">=":return u;case"=":case"v":case"":return t(u);case"<":return o(u);case">":return[,t(u),0,u,2];case"<=":return[,t(u),o(u),1];case"!":return[,t(u),0];default:throw Error("Unexpected start value")}},u=function(e,n){if(1===e.length)return e[0];let r=[];for(let n of e.slice().reverse())0 in n?r.push(n):r.push.apply(r,n.slice(1));return[,].concat(r,e.slice(1).map(()=>n))};return u(n.split(/\s*\|\|\s*/).map(function(e){let n=e.split(/\s+-\s+/);if(1===n.length){e=e.trim();let n=[],r=/[-0-9A-Za-z]\s+/g;for(var a,l=0;a=r.exec(e);){let r=a.index+1;n.push(i(e.slice(l,r).trim())),l=r}return n.push(i(e.slice(l).trim())),u(n,2)}let c=r(n[0]),s=r(n[1]);return[,t(s),o(s),1,c,2]}),1)},r=function(n){var r=/^([^-+]+)?(?:-([^+]+))?(?:\+(.+))?$/.exec(n),t=r[1]?e(r[1]):[];return r[2]&&(t.length++,t.push.apply(t,e(r[2]))),r[3]&&(t.push([]),t.push.apply(t,e(r[3]))),t},t=function(e,n){e=r(e),n=r(n);for(var t=0;;){if(t>=e.length)return t<n.length&&"u"!=(typeof n[t])[0];var o=e[t],i=(typeof o)[0];if(t>=n.length)return"u"==i;var u=n[t],a=(typeof u)[0];if(i==a){if("o"!=i&&"u"!=i&&o!=u)return o<u;t++}else{if("o"==i&&"n"==a)return!0;return"s"==a||"u"==i}}},o=function(e){var n=e[0],r="";if(1===e.length)return"*";if(n+.5){r+=0==n?">=":-1==n?"<":1==n?"^":2==n?"~":n>0?"=":"!=";for(var t=1,i=1;i<e.length;i++){var u=e[i],a=(typeof u)[0];t--,r+="u"==a?"-":(t>0?".":"")+(t=2,u)}return r}for(var l=[],i=1;i<e.length;i++){var u=e[i];l.push(0===u?"not("+c()+")":1===u?"("+c()+" || "+c()+")":2===u?l.pop()+" "+l.pop():o(u))}return c();function c(){return l.pop().replace(/^\((.+)\)$/,"$1")}},i=function(e,n){if(0 in e){n=r(n);var t=e[0],o=t<0;o&&(t=-t-1);for(var u=0,a=1,l=!0;;a++,u++){var c,s,f=a<e.length?(typeof e[a])[0]:"";if(u>=n.length||"o"==(s=(typeof(c=n[u]))[0])){if(!l)return!0;if("u"==f)return a>t&&!o;return""==f!=o}if("u"==s){if(!l||"u"!=f)return!1}else if(l)if(f==s)if(a<=t){if(c!=e[a])return!1}else{if(o?c>e[a]:c<e[a])return!1;c!=e[a]&&(l=!1)}else if("s"!=f&&"n"!=f){if(o||a<=t)return!1;l=!1,a--}else{if(a<=t||s<f!=o)return!1;l=!1}else"s"!=f&&"n"!=f&&(l=!1,a--)}}for(var p=[],d=p.pop.bind(p),u=1;u<e.length;u++){var h=e[u];p.push(1==h?d()|d():2==h?d()&d():h?i(h,n):!d())}return!!d()},u=function(e,n){var r=z.S[e];if(!r||!z.o(r,n))throw Error("Shared module "+n+" doesn't exist in shared scope "+e);return r},a=function(e,n){var r=e[n],n=Object.keys(r).reduce(function(e,n){return!e||t(e,n)?n:e},0);return n&&r[n]},l=function(e,n){var r=e[n];return Object.keys(r).reduce(function(e,n){return!e||!r[e].loaded&&t(e,n)?n:e},0)},c=function(e,n,r,t){return"Unsatisfied version "+r+" from "+(r&&e[n][r].from)+" of shared singleton module "+n+" (required "+o(t)+")"},s=function(e,n,r,t){var o=l(e,r);return b(e[r][o])},f=function(e,n,r,t){var o=l(e,r);return i(t,o)||v(c(e,r,o,t)),b(e[r][o])},p=function(e,n,r,t){var o=l(e,r);if(!i(t,o))throw Error(c(e,r,o,t));return b(e[r][o])},d=function(e,n,r){var o=e[n],n=Object.keys(o).reduce(function(e,n){return i(r,n)&&(!e||t(e,n))?n:e},0);return n&&o[n]},h=function(e,n,r,t){var i=e[r];return"No satisfying version ("+o(t)+") of shared module "+r+" found in shared scope "+n+".\nAvailable versions: "+Object.keys(i).map(function(e){return e+" from "+i[e].from}).join(", ")},g=function(e,n,r,t){var o=d(e,r,t);if(o)return b(o);throw Error(h(e,n,r,t))},v=function(e){"u">typeof console&&console.warn&&console.warn(e)},y=function(e,n,r,t){v(h(e,n,r,t))},b=function(e){return e.loaded=1,e.get()},S=(m=function(e){return function(n,r,t,o){var i=z.I(n);return i&&i.then?i.then(e.bind(e,n,z.S[n],r,t,o)):e(n,z.S[n],r,t,o)}})(function(e,n,r){return u(e,r),b(a(n,r))}),k=m(function(e,n,r,t){return n&&z.o(n,r)?b(a(n,r)):t()}),j=m(function(e,n,r,t){return u(e,r),b(d(n,r,t)||y(n,e,r,t)||a(n,r))}),w=m(function(e,n,r){return u(e,r),s(n,e,r)}),E=m(function(e,n,r,t){return u(e,r),f(n,e,r,t)}),x=m(function(e,n,r,t){return u(e,r),g(n,e,r,t)}),T=m(function(e,n,r,t){return u(e,r),p(n,e,r,t)}),M=m(function(e,n,r,t,o){return n&&z.o(n,r)?b(d(n,r,t)||y(n,e,r,t)||a(n,r)):o()}),P=m(function(e,n,r,t){return n&&z.o(n,r)?s(n,e,r):t()}),V=m(function(e,n,r,t,o){return n&&z.o(n,r)?f(n,e,r,t):o()}),q=m(function(e,n,r,t,o){var i=n&&z.o(n,r)&&d(n,r,t);return i?b(i):o()}),A=m(function(e,n,r,t,o){return n&&z.o(n,r)?p(n,e,r,t):o()}),C=function(e){var r=!1,t=!1,o=!1,i=!1,u=[e.shareScope,e.shareKey];return(e.requiredVersion?(e.strictVersion&&(r=!0),e.singleton&&(t=!0),u.push(n(e.requiredVersion)),o=!0):e.singleton&&(t=!0),e.fallback&&(i=!0,u.push(e.fallback)),r&&t&&o&&i)?function(){return A.apply(null,u)}:r&&o&&i?function(){return q.apply(null,u)}:t&&o&&i?function(){return V.apply(null,u)}:r&&t&&o?function(){return T.apply(null,u)}:t&&i?function(){return P.apply(null,u)}:o&&i?function(){return M.apply(null,u)}:r&&o?function(){return x.apply(null,u)}:t&&o?function(){return E.apply(null,u)}:t?function(){return w.apply(null,u)}:o?function(){return j.apply(null,u)}:i?function(){return k.apply(null,u)}:function(){return S.apply(null,u)}},O={},z.f.consumes=function(e,n){var r=z.consumesLoadingData.moduleIdToConsumeDataMapping,t=z.consumesLoadingData.chunkMapping;z.o(t,e)&&t[e].forEach(function(e){if(z.o(O,e))return n.push(O[e]);var t=function(n){O[e]=0,z.m[e]=function(r){delete z.c[e],r.exports=n()}},o=function(n){delete O[e],z.m[e]=function(r){throw delete z.c[e],n}};try{var i=C(r[e])();i.then?n.push(O[e]=i.then(t).catch(o)):t(i)}catch(e){o(e)}})},D={871:0},z.f.j=function(e,n){var r=z.o(D,e)?D[e]:void 0;if(0!==r)if(r)n.push(r[2]);else{var t=new Promise((n,t)=>r=D[e]=[n,t]);n.push(r[2]=t);var o=z.p+z.u(e),i=Error();z.l(o,function(n){if(z.o(D,e)&&(0!==(r=D[e])&&(D[e]=void 0),r)){var t=n&&("load"===n.type?"missing":n.type),o=n&&n.target&&n.target.src;i.message="Loading chunk "+e+" failed.\n("+t+": "+o+")",i.name="ChunkLoadError",i.type=t,i.request=o,r[1](i)}},"chunk-"+e,e)}},_=(e,n)=>{var r,t,[o,i,u]=n,a=0;if(o.some(e=>0!==D[e])){for(r in i)z.o(i,r)&&(z.m[r]=i[r]);u&&u(z)}for(e&&e(n);a<o.length;a++)t=o[a],z.o(D,t)&&D[t]&&D[t][0](),D[t]=0},(L=self.rspackChunkcodebind_jupyterlab=self.rspackChunkcodebind_jupyterlab||[]).forEach(_.bind(null,0)),L.push=_.bind(null,L.push.bind(L));var F=z(457);(_JUPYTERLAB=void 0===_JUPYTERLAB?{}:_JUPYTERLAB)["codebind-jupyterlab"]=F})();
1
+ var _JUPYTERLAB;(()=>{"use strict";var e,n,r,t,o,i,u,a,l,c,s,f,p,d,h,g,v,y,b,m,S,k,j,w,E,x,T,M,P,V,q,A,C,O,D,_,L,N={457(e,n,r){var t={"./index":()=>r.e(590).then(()=>()=>r(509)),"./extension":()=>r.e(590).then(()=>()=>r(509))},o=function(e,n){return r.R=n,n=r.o(t,e)?t[e]():Promise.resolve().then(()=>{throw Error('Module "'+e+'" does not exist in container.')}),r.R=void 0,n},i=function(e,n){if(r.S){var t="default",o=r.S[t];if(o&&o!==e)throw Error("Container initialization failed as it has already been initialized with a different share scope");return r.S[t]=e,r.I(t,n)}};r.d(n,{get:()=>o,init:()=>i})}},$={};function z(e){var n=$[e];if(void 0!==n)return n.exports;var r=$[e]={exports:{}};return N[e](r,r.exports,z),r.exports}z.m=N,z.c=$,z.n=e=>{var n=e&&e.__esModule?()=>e.default:()=>e;return z.d(n,{a:n}),n},z.d=(e,n,r)=>{var t=(n,r)=>{for(var t in n)z.o(n,t)&&!z.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,[r]:n[t]})};t(n,"get"),t(r,"value")},z.f={},z.e=e=>Promise.all(Object.keys(z.f).reduce((n,r)=>(z.f[r](e,n),n),[])),z.u=e=>""+e+".dae4561c5427a855.js?v=dae4561c5427a855",z.g=(()=>{if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(e){if("object"==typeof window)return window}})(),z.o=(e,n)=>Object.prototype.hasOwnProperty.call(e,n),I={},z.l=function(e,n,r,t){if(I[e])return void I[e].push(n);if(void 0!==r)for(var o,i,u=document.getElementsByTagName("script"),a=0;a<u.length;a++){var l=u[a];if(l.getAttribute("src")==e||l.getAttribute("data-rspack")=="codebind-jupyterlab:"+r){o=l;break}}o||(i=!0,(o=document.createElement("script")).timeout=120,z.nc&&o.setAttribute("nonce",z.nc),o.setAttribute("data-rspack","codebind-jupyterlab:"+r),o.src=e),I[e]=[n];var c=function(n,r){o.onerror=o.onload=null,clearTimeout(s);var t=I[e];if(delete I[e],o.parentNode&&o.parentNode.removeChild(o),t&&t.forEach(function(e){return e(r)}),n)return n(r)},s=setTimeout(c.bind(null,void 0,{type:"timeout",target:o}),12e4);o.onerror=c.bind(null,o.onerror),o.onload=c.bind(null,o.onload),i&&document.head.appendChild(o)},z.r=e=>{"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},z.S={},z.initializeSharingData={scopeToSharingDataMapping:{default:[{name:"codebind-jupyterlab",version:"0.6.5",factory:()=>z.e(590).then(()=>()=>z(509)),eager:0,treeShakingMode:null}]},uniqueName:"codebind-jupyterlab"},R={},U={},z.I=function(e,n){n||(n=[]);var r=U[e];if(r||(r=U[e]={}),!(n.indexOf(r)>=0)){if(n.push(r),R[e])return R[e];z.o(z.S,e)||(z.S[e]={});var t=z.S[e],o=function(e){"u">typeof console&&console.warn&&console.warn(e)},i=z.initializeSharingData.uniqueName,u=function(e,n,r,o){var u=t[e]=t[e]||{},a=u[n];(!a||!a.loaded&&(!o!=!a.eager?o:i>a.from))&&(u[n]={get:r,from:i,eager:!!o})},a=function(r){var t=function(e){o("Initialization of sharing external failed: "+e)};try{var i=z(r);if(!i)return;var u=function(r){return r&&r.init&&r.init(z.S[e],n)};if(i.then)return l.push(i.then(u,t));var a=u(i);if(a&&a.then)return l.push(a.catch(t))}catch(e){t(e)}},l=[],c=z.initializeSharingData.scopeToSharingDataMapping;return(c[e]&&c[e].forEach(function(e){"object"==typeof e?u(e.name,e.version,e.factory,e.eager):a(e)}),l.length)?R[e]=Promise.all(l).then(function(){return R[e]=1}):R[e]=1}},z.g.importScripts&&(B=z.g.location+"");var I,R,U,B,K=z.g.document;if(!B&&K&&(K.currentScript&&"SCRIPT"===K.currentScript.tagName.toUpperCase()&&(B=K.currentScript.src),!B)){var J=K.getElementsByTagName("script");if(J.length)for(var Y=J.length-1;Y>-1&&(!B||!/^http(s?):/.test(B));)B=J[Y--].src}if(!B)throw Error("Automatic publicPath is not supported in this browser");z.p=B=B.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),z.consumesLoadingData={chunkMapping:{590:["511","343","99","171","241"]},moduleIdToConsumeDataMapping:{171:{shareScope:"default",shareKey:"@jupyterlab/notebook",import:null,requiredVersion:"^4.6.3",strictVersion:!1,singleton:!0,eager:!1,fallback:void 0,treeShakingMode:null},241:{shareScope:"default",shareKey:"@jupyterlab/services",import:null,requiredVersion:"^7.6.3",strictVersion:!1,singleton:!0,eager:!1,fallback:void 0,treeShakingMode:null},343:{shareScope:"default",shareKey:"@jupyterlab/cells",import:null,requiredVersion:"^4.6.3",strictVersion:!1,singleton:!1,eager:!1,fallback:void 0,treeShakingMode:null},511:{shareScope:"default",shareKey:"@jupyterlab/apputils",import:null,requiredVersion:"^4.7.3",strictVersion:!1,singleton:!0,eager:!1,fallback:void 0,treeShakingMode:null},99:{shareScope:"default",shareKey:"@jupyterlab/nbformat",import:null,requiredVersion:"^4.6.3",strictVersion:!1,singleton:!1,eager:!1,fallback:void 0,treeShakingMode:null}},initialConsumes:[]},e=function(e){return e.split(".").map(function(e){return+e==e?+e:e})},n=function(n){var r=function(n){var r=/^([^-+]+)?(?:-([^+]+))?(?:\+(.+))?$/.exec(n),t=r[1]?[0].concat(e(r[1])):[0];r[2]&&(t.length++,t.push.apply(t,e(r[2])));let o=t[t.length-1];for(;t.length&&(void 0===o||/^[*xX]$/.test(o));)t.pop(),o=t[t.length-1];return t},t=function(e){return 1===e.length?[0]:2===e.length?[1].concat(e.slice(1)):3===e.length?[2].concat(e.slice(1)):[e.length].concat(e.slice(1))},o=function(e){return[-e[0]-1].concat(e.slice(1))},i=function(e){let n=/^(\^|~|<=|<|>=|>|=|v|!)/.exec(e),i=n?n[0]:"",u=r(i.length?e.slice(i.length).trim():e.trim());switch(i){case"^":if(u.length>1&&0===u[1]){if(u.length>2&&0===u[2])return[3].concat(u.slice(1));return[2].concat(u.slice(1))}return[1].concat(u.slice(1));case"~":return[2].concat(u.slice(1));case">=":return u;case"=":case"v":case"":return t(u);case"<":return o(u);case">":return[,t(u),0,u,2];case"<=":return[,t(u),o(u),1];case"!":return[,t(u),0];default:throw Error("Unexpected start value")}},u=function(e,n){if(1===e.length)return e[0];let r=[];for(let n of e.slice().reverse())0 in n?r.push(n):r.push.apply(r,n.slice(1));return[,].concat(r,e.slice(1).map(()=>n))};return u(n.split(/\s*\|\|\s*/).map(function(e){let n=e.split(/\s+-\s+/);if(1===n.length){e=e.trim();let n=[],r=/[-0-9A-Za-z]\s+/g;for(var a,l=0;a=r.exec(e);){let r=a.index+1;n.push(i(e.slice(l,r).trim())),l=r}return n.push(i(e.slice(l).trim())),u(n,2)}let c=r(n[0]),s=r(n[1]);return[,t(s),o(s),1,c,2]}),1)},r=function(n){var r=/^([^-+]+)?(?:-([^+]+))?(?:\+(.+))?$/.exec(n),t=r[1]?e(r[1]):[];return r[2]&&(t.length++,t.push.apply(t,e(r[2]))),r[3]&&(t.push([]),t.push.apply(t,e(r[3]))),t},t=function(e,n){e=r(e),n=r(n);for(var t=0;;){if(t>=e.length)return t<n.length&&"u"!=(typeof n[t])[0];var o=e[t],i=(typeof o)[0];if(t>=n.length)return"u"==i;var u=n[t],a=(typeof u)[0];if(i==a){if("o"!=i&&"u"!=i&&o!=u)return o<u;t++}else{if("o"==i&&"n"==a)return!0;return"s"==a||"u"==i}}},o=function(e){var n=e[0],r="";if(1===e.length)return"*";if(n+.5){r+=0==n?">=":-1==n?"<":1==n?"^":2==n?"~":n>0?"=":"!=";for(var t=1,i=1;i<e.length;i++){var u=e[i],a=(typeof u)[0];t--,r+="u"==a?"-":(t>0?".":"")+(t=2,u)}return r}for(var l=[],i=1;i<e.length;i++){var u=e[i];l.push(0===u?"not("+c()+")":1===u?"("+c()+" || "+c()+")":2===u?l.pop()+" "+l.pop():o(u))}return c();function c(){return l.pop().replace(/^\((.+)\)$/,"$1")}},i=function(e,n){if(0 in e){n=r(n);var t=e[0],o=t<0;o&&(t=-t-1);for(var u=0,a=1,l=!0;;a++,u++){var c,s,f=a<e.length?(typeof e[a])[0]:"";if(u>=n.length||"o"==(s=(typeof(c=n[u]))[0])){if(!l)return!0;if("u"==f)return a>t&&!o;return""==f!=o}if("u"==s){if(!l||"u"!=f)return!1}else if(l)if(f==s)if(a<=t){if(c!=e[a])return!1}else{if(o?c>e[a]:c<e[a])return!1;c!=e[a]&&(l=!1)}else if("s"!=f&&"n"!=f){if(o||a<=t)return!1;l=!1,a--}else{if(a<=t||s<f!=o)return!1;l=!1}else"s"!=f&&"n"!=f&&(l=!1,a--)}}for(var p=[],d=p.pop.bind(p),u=1;u<e.length;u++){var h=e[u];p.push(1==h?d()|d():2==h?d()&d():h?i(h,n):!d())}return!!d()},u=function(e,n){var r=z.S[e];if(!r||!z.o(r,n))throw Error("Shared module "+n+" doesn't exist in shared scope "+e);return r},a=function(e,n){var r=e[n],n=Object.keys(r).reduce(function(e,n){return!e||t(e,n)?n:e},0);return n&&r[n]},l=function(e,n){var r=e[n];return Object.keys(r).reduce(function(e,n){return!e||!r[e].loaded&&t(e,n)?n:e},0)},c=function(e,n,r,t){return"Unsatisfied version "+r+" from "+(r&&e[n][r].from)+" of shared singleton module "+n+" (required "+o(t)+")"},s=function(e,n,r,t){var o=l(e,r);return b(e[r][o])},f=function(e,n,r,t){var o=l(e,r);return i(t,o)||v(c(e,r,o,t)),b(e[r][o])},p=function(e,n,r,t){var o=l(e,r);if(!i(t,o))throw Error(c(e,r,o,t));return b(e[r][o])},d=function(e,n,r){var o=e[n],n=Object.keys(o).reduce(function(e,n){return i(r,n)&&(!e||t(e,n))?n:e},0);return n&&o[n]},h=function(e,n,r,t){var i=e[r];return"No satisfying version ("+o(t)+") of shared module "+r+" found in shared scope "+n+".\nAvailable versions: "+Object.keys(i).map(function(e){return e+" from "+i[e].from}).join(", ")},g=function(e,n,r,t){var o=d(e,r,t);if(o)return b(o);throw Error(h(e,n,r,t))},v=function(e){"u">typeof console&&console.warn&&console.warn(e)},y=function(e,n,r,t){v(h(e,n,r,t))},b=function(e){return e.loaded=1,e.get()},S=(m=function(e){return function(n,r,t,o){var i=z.I(n);return i&&i.then?i.then(e.bind(e,n,z.S[n],r,t,o)):e(n,z.S[n],r,t,o)}})(function(e,n,r){return u(e,r),b(a(n,r))}),k=m(function(e,n,r,t){return n&&z.o(n,r)?b(a(n,r)):t()}),j=m(function(e,n,r,t){return u(e,r),b(d(n,r,t)||y(n,e,r,t)||a(n,r))}),w=m(function(e,n,r){return u(e,r),s(n,e,r)}),E=m(function(e,n,r,t){return u(e,r),f(n,e,r,t)}),x=m(function(e,n,r,t){return u(e,r),g(n,e,r,t)}),T=m(function(e,n,r,t){return u(e,r),p(n,e,r,t)}),M=m(function(e,n,r,t,o){return n&&z.o(n,r)?b(d(n,r,t)||y(n,e,r,t)||a(n,r)):o()}),P=m(function(e,n,r,t){return n&&z.o(n,r)?s(n,e,r):t()}),V=m(function(e,n,r,t,o){return n&&z.o(n,r)?f(n,e,r,t):o()}),q=m(function(e,n,r,t,o){var i=n&&z.o(n,r)&&d(n,r,t);return i?b(i):o()}),A=m(function(e,n,r,t,o){return n&&z.o(n,r)?p(n,e,r,t):o()}),C=function(e){var r=!1,t=!1,o=!1,i=!1,u=[e.shareScope,e.shareKey];return(e.requiredVersion?(e.strictVersion&&(r=!0),e.singleton&&(t=!0),u.push(n(e.requiredVersion)),o=!0):e.singleton&&(t=!0),e.fallback&&(i=!0,u.push(e.fallback)),r&&t&&o&&i)?function(){return A.apply(null,u)}:r&&o&&i?function(){return q.apply(null,u)}:t&&o&&i?function(){return V.apply(null,u)}:r&&t&&o?function(){return T.apply(null,u)}:t&&i?function(){return P.apply(null,u)}:o&&i?function(){return M.apply(null,u)}:r&&o?function(){return x.apply(null,u)}:t&&o?function(){return E.apply(null,u)}:t?function(){return w.apply(null,u)}:o?function(){return j.apply(null,u)}:i?function(){return k.apply(null,u)}:function(){return S.apply(null,u)}},O={},z.f.consumes=function(e,n){var r=z.consumesLoadingData.moduleIdToConsumeDataMapping,t=z.consumesLoadingData.chunkMapping;z.o(t,e)&&t[e].forEach(function(e){if(z.o(O,e))return n.push(O[e]);var t=function(n){O[e]=0,z.m[e]=function(r){delete z.c[e],r.exports=n()}},o=function(n){delete O[e],z.m[e]=function(r){throw delete z.c[e],n}};try{var i=C(r[e])();i.then?n.push(O[e]=i.then(t).catch(o)):t(i)}catch(e){o(e)}})},D={871:0},z.f.j=function(e,n){var r=z.o(D,e)?D[e]:void 0;if(0!==r)if(r)n.push(r[2]);else{var t=new Promise((n,t)=>r=D[e]=[n,t]);n.push(r[2]=t);var o=z.p+z.u(e),i=Error();z.l(o,function(n){if(z.o(D,e)&&(0!==(r=D[e])&&(D[e]=void 0),r)){var t=n&&("load"===n.type?"missing":n.type),o=n&&n.target&&n.target.src;i.message="Loading chunk "+e+" failed.\n("+t+": "+o+")",i.name="ChunkLoadError",i.type=t,i.request=o,r[1](i)}},"chunk-"+e,e)}},_=(e,n)=>{var r,t,[o,i,u]=n,a=0;if(o.some(e=>0!==D[e])){for(r in i)z.o(i,r)&&(z.m[r]=i[r]);u&&u(z)}for(e&&e(n);a<o.length;a++)t=o[a],z.o(D,t)&&D[t]&&D[t][0](),D[t]=0},(L=self.rspackChunkcodebind_jupyterlab=self.rspackChunkcodebind_jupyterlab||[]).forEach(_.bind(null,0)),L.push=_.bind(null,L.push.bind(L));var F=z(457);(_JUPYTERLAB=void 0===_JUPYTERLAB?{}:_JUPYTERLAB)["codebind-jupyterlab"]=F})();
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "codebind-jupyterlab",
3
- "version": "0.6.4",
3
+ "version": "0.6.5",
4
4
  "description": "Native JupyterLab cells and Question cells for Codebind.",
5
5
  "license": "MIT",
6
6
  "main": "lib/index.js",
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "codebind"
3
- version = "0.6.4"
3
+ version = "0.6.6"
4
4
  description = "A frontend-neutral model loop for persistent IPython sessions."
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.13"
@@ -24,11 +24,12 @@ classifiers = [
24
24
  "Typing :: Typed",
25
25
  ]
26
26
  dependencies = [
27
- "ipython>=9.0",
27
+ "ipython>=9.17",
28
28
  "langchain-core>=1.0",
29
29
  "models-provider>=0.1.2",
30
30
  "pillow>=11",
31
31
  "resvg-py>=0.5",
32
+ "rich>=14.1",
32
33
  ]
33
34
 
34
35
  [[project.authors]]
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "codebind"
3
- version = "0.6.4"
3
+ version = "0.6.6"
4
4
  description = "A frontend-neutral model loop for persistent IPython sessions."
5
5
  readme = "README.md"
6
6
  authors = [
@@ -21,11 +21,12 @@ classifiers = [
21
21
  "Typing :: Typed",
22
22
  ]
23
23
  dependencies = [
24
- "ipython>=9.0",
24
+ "ipython>=9.17",
25
25
  "langchain-core>=1.0",
26
26
  "models-provider>=0.1.2",
27
27
  "pillow>=11",
28
28
  "resvg-py>=0.5",
29
+ "rich>=14.1",
29
30
  ]
30
31
 
31
32
  [project.urls]
@@ -10,11 +10,13 @@ from typing import Any, cast
10
10
 
11
11
  from IPython.core.displaypub import DisplayPublisher
12
12
  from IPython.core.interactiveshell import InteractiveShell
13
+ from IPython.terminal.interactiveshell import TerminalInteractiveShell
13
14
  from IPython.utils.capture import capture_output
14
15
 
15
16
  from .display import display_cell
16
17
  from .images import PreparedImage, prepare_mime_image
17
18
  from .jupyter import JupyterLabBridge
19
+ from .terminal import record_tool_output, show_input
18
20
 
19
21
 
20
22
  _MAXIMUM_IMAGES_PER_REPORT = 32
@@ -215,6 +217,12 @@ class IPythonExecutor:
215
217
  if not isinstance(cell, str) or not cell.strip():
216
218
  raise ValueError("cell must be a non-empty string")
217
219
 
220
+ if self.bridge is None and isinstance(self.shell, TerminalInteractiveShell):
221
+ show_input(self.shell, cell)
222
+ with record_tool_output(self.shell):
223
+ result = self.shell.run_cell(cell, store_history=True)
224
+ return self._native_report(result)
225
+
218
226
  bridge = self.bridge
219
227
  cell_id = bridge.start_code_cell(cell) if bridge is not None else None
220
228
  bridged = cell_id is not None
@@ -247,6 +255,26 @@ class IPythonExecutor:
247
255
  if not isinstance(cell, str) or not cell.strip():
248
256
  raise ValueError("cell must be a non-empty string")
249
257
 
258
+ if self.bridge is None and isinstance(self.shell, TerminalInteractiveShell):
259
+ show_input(self.shell, cell)
260
+ transformed = self.shell.transform_cell(cell)
261
+ result = None
262
+ with (
263
+ record_tool_output(self.shell),
264
+ self.shell._tee(channel="stdout"),
265
+ self.shell._tee(channel="stderr"),
266
+ ):
267
+ try:
268
+ result = await self.shell.run_cell_async(
269
+ cell,
270
+ store_history=True,
271
+ transformed_cell=transformed,
272
+ )
273
+ finally:
274
+ self.shell.events.trigger("post_execute")
275
+ self.shell.events.trigger("post_run_cell", result)
276
+ return self._native_report(result)
277
+
250
278
  bridge = self.bridge
251
279
  cell_id = bridge.start_code_cell(cell) if bridge is not None else None
252
280
  bridged = cell_id is not None
@@ -304,17 +332,41 @@ class IPythonExecutor:
304
332
  captured: Any,
305
333
  expression_outputs: list[dict[str, Any]],
306
334
  ) -> ExecutionReport:
307
- """Build the model-facing text and image projection of an IPython execution."""
308
-
309
- displays: list[str] = []
310
- images: list[PreparedImage] = []
311
- omissions: list[str] = []
335
+ """Build a report from a captured notebook or alternate frontend cell."""
312
336
  bundles = [getattr(output, "data", None) for output in captured.outputs]
313
337
  bundles.extend(output.get("data") for output in expression_outputs)
314
338
  if not expression_outputs and result.result is not None:
315
339
  data, _ = self.shell.display_formatter.format(result.result)
316
340
  if any(key.startswith("image/") for key in data):
317
341
  bundles.append(data)
342
+ return self._assemble_report(result, captured.stdout, captured.stderr, bundles)
343
+
344
+ def _native_report(self, result: Any) -> ExecutionReport:
345
+ """Read the exact output IPython recorded for a terminal execution."""
346
+ records = self.shell.history_manager.outputs.get(result.execution_count, ())
347
+ stdout: list[str] = []
348
+ stderr: list[str] = []
349
+ bundles: list[dict[str, Any]] = []
350
+ for record in records:
351
+ if record.output_type == "out_stream":
352
+ stdout.extend(record.bundle["stream"])
353
+ elif record.output_type == "err_stream":
354
+ stderr.extend(record.bundle["stream"])
355
+ elif record.output_type in {"display_data", "execute_result"}:
356
+ bundles.append(record.bundle)
357
+ return self._assemble_report(result, "".join(stdout), "".join(stderr), bundles)
358
+
359
+ @staticmethod
360
+ def _assemble_report(
361
+ result: Any,
362
+ stdout: str,
363
+ stderr: str,
364
+ bundles: list[Any],
365
+ ) -> ExecutionReport:
366
+ """Build the model-facing text and image projection of an IPython execution."""
367
+ displays: list[str] = []
368
+ images: list[PreparedImage] = []
369
+ omissions: list[str] = []
318
370
  for index, data in enumerate(bundles):
319
371
  if isinstance(data, dict) and "text/plain" in data:
320
372
  displays.append(str(data["text/plain"]))
@@ -340,8 +392,8 @@ class IPythonExecutor:
340
392
  )
341
393
  return ExecutionReport(
342
394
  ok=result.success,
343
- stdout=captured.stdout,
344
- stderr=captured.stderr,
395
+ stdout=stdout,
396
+ stderr=stderr,
345
397
  result=repr(result.result) if result.result is not None else None,
346
398
  displays=tuple(displays),
347
399
  error=error,
@@ -6,18 +6,23 @@ import asyncio
6
6
  from typing import Any
7
7
 
8
8
  from IPython.core.interactiveshell import InteractiveShell
9
+ from IPython.terminal.interactiveshell import TerminalInteractiveShell
9
10
  from langchain_core.language_models import BaseChatModel
10
11
 
11
12
  from .configuration import load_configuration, load_models
12
13
  from .conversation import MemoryConversationStore, NotebookConversationStore
13
14
  from .jupyter import JupyterLabBridge, TARGET_NAME
14
15
  from .session import Session
16
+ from .terminal import install_markdown_renderer
15
17
 
16
18
 
17
19
  _STATE_ATTRIBUTE = "_codebind_extension_state"
18
20
 
19
21
 
20
22
  def _close_state(state: dict[str, Any]) -> None:
23
+ restore_terminal_display = state.get("restore_terminal_display")
24
+ if callable(restore_terminal_display):
25
+ restore_terminal_display()
21
26
  manager = state.get("comm_manager")
22
27
  target = state.get("comm_target")
23
28
  if manager is not None and getattr(manager, "targets", {}).get(TARGET_NAME) is target:
@@ -72,10 +77,13 @@ def load_ipython_extension(ipython: InteractiveShell) -> None:
72
77
  "discard_model": discard_model,
73
78
  "comm_manager": manager,
74
79
  "comm_target": None,
80
+ "restore_terminal_display": None,
75
81
  }
76
82
 
77
83
  if manager is None:
78
84
  state["session"] = Session(shell=ipython, store=MemoryConversationStore())
85
+ if isinstance(ipython, TerminalInteractiveShell):
86
+ state["restore_terminal_display"] = install_markdown_renderer(ipython)
79
87
  else:
80
88
 
81
89
  def accept_comm(comm: Any, message: dict[str, Any]) -> None:
@@ -0,0 +1,99 @@
1
+ """Terminal presentation using IPython's prompts, history, and MIME renderers."""
2
+
3
+ from __future__ import annotations
4
+
5
+ import sys
6
+ from collections.abc import Callable, Iterator
7
+ from contextlib import contextmanager
8
+ from unittest.mock import patch
9
+
10
+ from IPython.terminal.interactiveshell import IPythonPTLexer, TerminalInteractiveShell
11
+ from prompt_toolkit.document import Document
12
+ from prompt_toolkit.formatted_text import FormattedText, PygmentsTokens
13
+ from prompt_toolkit.shortcuts import print_formatted_text
14
+ from rich.console import Console
15
+ from rich.markdown import Markdown
16
+
17
+
18
+ _MISSING = object()
19
+ _IMAGE_FORMATS = ("image/png", "image/jpeg", "image/svg+xml")
20
+
21
+
22
+ def show_input(shell: TerminalInteractiveShell, cell: str) -> None:
23
+ """Show a model cell with the shell's own input and continuation prompts."""
24
+ sys.stdout.write(shell.separate_in)
25
+ lines = cell.splitlines()
26
+ lexer = IPythonPTLexer().lex_document(Document(cell))
27
+ first_prompt = shell.prompts.in_prompt_tokens()
28
+ prompt_width = sum(len(text) for _, text in first_prompt)
29
+ style = shell.pt_app.app.style if shell.pt_app is not None else shell._style
30
+ for index, _ in enumerate(lines):
31
+ prompt = (
32
+ first_prompt
33
+ if index == 0
34
+ else shell.prompts.continuation_prompt_tokens(prompt_width, lineno=index - 1)
35
+ )
36
+ print_formatted_text(
37
+ PygmentsTokens(prompt),
38
+ FormattedText(lexer(index)),
39
+ sep="",
40
+ style=style,
41
+ color_depth=shell.color_depth,
42
+ )
43
+
44
+
45
+ def install_markdown_renderer(shell: TerminalInteractiveShell) -> Callable[[], None]:
46
+ """Render Codebind's Markdown MIME in the terminal, preserving shell settings."""
47
+ mime = "text/markdown"
48
+ formatter = shell.display_formatter.formatters[mime]
49
+ was_enabled = formatter.enabled
50
+ was_active = mime in shell.display_formatter.active_types
51
+ previous_renderer = shell.mime_renderers.get(mime, _MISSING)
52
+
53
+ def render(text: str, _metadata: object) -> None:
54
+ Console(file=sys.stdout, soft_wrap=True, no_color=shell.colors.lower() == "nocolor").print(
55
+ Markdown(text)
56
+ )
57
+
58
+ formatter.enabled = True
59
+ if not was_active:
60
+ shell.display_formatter.active_types.append(mime)
61
+ shell.mime_renderers[mime] = render
62
+
63
+ def restore() -> None:
64
+ if previous_renderer is _MISSING:
65
+ shell.mime_renderers.pop(mime, None)
66
+ else:
67
+ shell.mime_renderers[mime] = previous_renderer
68
+ if not was_active and mime in shell.display_formatter.active_types:
69
+ shell.display_formatter.active_types.remove(mime)
70
+ formatter.enabled = was_enabled
71
+
72
+ return restore
73
+
74
+
75
+ @contextmanager
76
+ def record_tool_output(shell: TerminalInteractiveShell) -> Iterator[None]:
77
+ """Keep image and shell-command output in IPython's native history."""
78
+ active = shell.display_formatter.active_types
79
+ previous_png_renderer = shell.mime_renderers.pop("image/png", _MISSING)
80
+ settings: list[tuple[str, bool, bool]] = []
81
+ for mime in _IMAGE_FORMATS:
82
+ formatter = shell.display_formatter.formatters[mime]
83
+ settings.append((mime, formatter.enabled, mime in active))
84
+ formatter.enabled = True
85
+ if mime not in active:
86
+ active.append(mime)
87
+ try:
88
+ with patch.object(shell, "system", shell.system_piped):
89
+ yield
90
+ finally:
91
+ for mime, was_enabled, was_active in settings:
92
+ if not was_active and mime in active:
93
+ active.remove(mime)
94
+ shell.display_formatter.formatters[mime].enabled = was_enabled
95
+ if previous_png_renderer is not _MISSING:
96
+ shell.mime_renderers["image/png"] = previous_png_renderer
97
+
98
+
99
+ __all__ = ["install_markdown_renderer", "record_tool_output", "show_input"]
codebind-0.6.4/PKG-INFO DELETED
@@ -1,116 +0,0 @@
1
- Metadata-Version: 2.4
2
- Name: codebind
3
- Version: 0.6.4
4
- Summary: A frontend-neutral model loop for persistent IPython sessions.
5
- Keywords: ai,ipython,llm,repl,agents
6
- Author: Giovanni Gravili
7
- Author-email: Giovanni Gravili <ghovax@users.noreply.github.com>
8
- License-Expression: MIT
9
- License-File: LICENSE
10
- Classifier: Development Status :: 3 - Alpha
11
- Classifier: Framework :: Jupyter :: JupyterLab :: Extensions :: Prebuilt
12
- Classifier: Intended Audience :: Developers
13
- Classifier: Operating System :: OS Independent
14
- Classifier: Programming Language :: Python :: 3
15
- Classifier: Programming Language :: Python :: 3.13
16
- Classifier: Programming Language :: Python :: 3.14
17
- Classifier: Typing :: Typed
18
- Requires-Dist: ipython>=9.0
19
- Requires-Dist: langchain-core>=1.0
20
- Requires-Dist: models-provider>=0.1.2
21
- Requires-Dist: pillow>=11
22
- Requires-Dist: resvg-py>=0.5
23
- Requires-Python: >=3.13
24
- Project-URL: Repository, https://github.com/ghovax/codebind
25
- Project-URL: Issues, https://github.com/ghovax/codebind/issues
26
- Description-Content-Type: text/markdown
27
-
28
- # Codebind
29
-
30
- Codebind turns an ordinary IPython session into a durable model harness with one tool: an IPython cell executed in the active session. IPython owns execution, namespace, history, magics, tracebacks, and rich display; Codebind owns conversation state and model orchestration.
31
-
32
- ## Installation
33
-
34
- ```console
35
- uvx codebind
36
- ```
37
-
38
- Or install it with any Python package installer:
39
-
40
- ```console
41
- pip install codebind
42
- ```
43
-
44
- ## Configuration
45
-
46
- Codebind reads its private model choice from `$XDG_CONFIG_HOME/codebind/configuration.json`, or `~/.config/codebind/configuration.json` when `XDG_CONFIG_HOME` is unset:
47
-
48
- ```json
49
- {
50
- "model": "openai/gpt-5.6-luna",
51
- "parameters": {
52
- "reasoning_effort": "medium"
53
- }
54
- }
55
- ```
56
-
57
- Provider credentials use the same XDG directory in `models.json`. Keep both files readable only by their owner. Loading Codebind does not add `chat`, `model`, `models`, `Models`, or any other variable to the IPython namespace.
58
-
59
- ## Terminal IPython
60
-
61
- Start a new conversation:
62
-
63
- ```console
64
- uvx codebind
65
- ```
66
-
67
- Ask through ordinary IPython magic syntax:
68
-
69
- ```python
70
- %%question
71
- Inspect this project and tell me what to implement first.
72
- ```
73
-
74
- Terminal conversations remain live for the current IPython process. Durable automatic resumption belongs to notebooks, where the notebook file provides an unambiguous conversation identity.
75
-
76
- ## JupyterLab
77
-
78
- ```console
79
- uvx --from jupyterlab --with codebind --with 'nbconvert[webpdf]' jupyter lab
80
- ```
81
-
82
- When running an unpublished local checkout, expose both its editable Python source and its current prebuilt frontend:
83
-
84
- ```console
85
- JUPYTER_PATH=/path/to/codebind/data/share/jupyter \
86
- uvx --refresh --from jupyterlab --with-editable /path/to/codebind \
87
- --with 'nbconvert[webpdf]' jupyter-lab
88
- ```
89
-
90
- Load Codebind in a notebook:
91
-
92
- ```python
93
- %load_ext codebind
94
- ```
95
-
96
- That is the complete setup. **Question** is a native toolbar toggle. Turning it on converts the selected cell into a Question and automatically makes each newly created user cell a Question until the toggle is turned off. Codebind-generated instruction, tool, and answer cells are never converted. Write ordinary Markdown and press `Shift+Enter`.
97
-
98
- Loading the extension adds a locked Markdown cell containing Codebind's packaged instructions. That exact text becomes the conversation's immutable system message and remains stable when the server or kernel restarts.
99
-
100
- The whole notebook is model context. Before each Question, Codebind takes a canonical snapshot of ordinary Markdown, raw, and code cells, including visible text and image outputs but never the live Python namespace. Images displayed by the model's IPython tool are included in that tool's result as well. PNG, JPEG, WebP, GIF, and SVG renditions are prepared as model-visible images; unsupported or oversized images are reported as omissions rather than silently discarded. The first turn records the snapshot; later turns append only new, changed, removed, or reordered cells. Questions, tool calls, tool results, and answers already present in the conversation ledger are not duplicated. Image bytes are carried in the relevant message, while notebook snapshots contain only stable image descriptors. This append-only representation keeps the prior model prefix unchanged for provider caching.
101
-
102
- Codebind stores the complete LangChain message, notebook-context, and turn ledger in notebook metadata. Reopening the notebook, restarting its kernel, and loading the extension restores the exact accumulated context automatically. Each assistant Markdown segment is buffered and inserted as one complete native cell as soon as that segment finishes, before a following tool call is complete. Tool executions and assistant answers are always appended to the notebook end without changing the user's current selection or scroll position. Tool outputs are collapsed by default and remain expandable through JupyterLab's native output control.
103
-
104
- The conversation ledger validates its structure and every assistant tool call against its single matching result, without a version gate. Interrupted saves finish before a turn is cancelled, so a restart cannot turn a partial write into an orphan tool result. Temporary model transport failures retry the same Question with a fresh connection; repeated WebSocket failures use HTTP. Invalid requests and authentication failures remain visible errors.
105
-
106
- An interrupted tool call is closed with an explicit interrupted result before the turn ends. If a provider stream is cancelled or fails, Codebind discards that provider session before the next Question while retaining the notebook conversation and its stable prompt-cache identity.
107
-
108
- The instruction cell, sent Question cells, model-authored tool cells, and assistant Markdown cells are non-editable and non-deletable. Draft Question cells remain editable until they are sent. Jupyter's standard interrupt button cancels an active Codebind question.
109
-
110
- Question and assistant Markdown supports `$...$`, `$$...$$`, `\(...\)`, and `\[...\]` through JupyterLab's native MathJax renderer.
111
-
112
- Other IPython frontends retain standard MIME display, syntax-highlighted code, Markdown, stdout, tracebacks, rich results, and native IPython history.
113
-
114
- ## ChatGPT account access
115
-
116
- Models Provider owns OpenAI account authorization and token refresh. Save the resulting provider-values object in Codebind's XDG `models.json`; Codebind loads it privately when the extension starts. ChatGPT subscription access is separate from the public, pay-as-you-go OpenAI API and may require compatibility updates when the account protocol changes.
codebind-0.6.4/README.md DELETED
@@ -1,89 +0,0 @@
1
- # Codebind
2
-
3
- Codebind turns an ordinary IPython session into a durable model harness with one tool: an IPython cell executed in the active session. IPython owns execution, namespace, history, magics, tracebacks, and rich display; Codebind owns conversation state and model orchestration.
4
-
5
- ## Installation
6
-
7
- ```console
8
- uvx codebind
9
- ```
10
-
11
- Or install it with any Python package installer:
12
-
13
- ```console
14
- pip install codebind
15
- ```
16
-
17
- ## Configuration
18
-
19
- Codebind reads its private model choice from `$XDG_CONFIG_HOME/codebind/configuration.json`, or `~/.config/codebind/configuration.json` when `XDG_CONFIG_HOME` is unset:
20
-
21
- ```json
22
- {
23
- "model": "openai/gpt-5.6-luna",
24
- "parameters": {
25
- "reasoning_effort": "medium"
26
- }
27
- }
28
- ```
29
-
30
- Provider credentials use the same XDG directory in `models.json`. Keep both files readable only by their owner. Loading Codebind does not add `chat`, `model`, `models`, `Models`, or any other variable to the IPython namespace.
31
-
32
- ## Terminal IPython
33
-
34
- Start a new conversation:
35
-
36
- ```console
37
- uvx codebind
38
- ```
39
-
40
- Ask through ordinary IPython magic syntax:
41
-
42
- ```python
43
- %%question
44
- Inspect this project and tell me what to implement first.
45
- ```
46
-
47
- Terminal conversations remain live for the current IPython process. Durable automatic resumption belongs to notebooks, where the notebook file provides an unambiguous conversation identity.
48
-
49
- ## JupyterLab
50
-
51
- ```console
52
- uvx --from jupyterlab --with codebind --with 'nbconvert[webpdf]' jupyter lab
53
- ```
54
-
55
- When running an unpublished local checkout, expose both its editable Python source and its current prebuilt frontend:
56
-
57
- ```console
58
- JUPYTER_PATH=/path/to/codebind/data/share/jupyter \
59
- uvx --refresh --from jupyterlab --with-editable /path/to/codebind \
60
- --with 'nbconvert[webpdf]' jupyter-lab
61
- ```
62
-
63
- Load Codebind in a notebook:
64
-
65
- ```python
66
- %load_ext codebind
67
- ```
68
-
69
- That is the complete setup. **Question** is a native toolbar toggle. Turning it on converts the selected cell into a Question and automatically makes each newly created user cell a Question until the toggle is turned off. Codebind-generated instruction, tool, and answer cells are never converted. Write ordinary Markdown and press `Shift+Enter`.
70
-
71
- Loading the extension adds a locked Markdown cell containing Codebind's packaged instructions. That exact text becomes the conversation's immutable system message and remains stable when the server or kernel restarts.
72
-
73
- The whole notebook is model context. Before each Question, Codebind takes a canonical snapshot of ordinary Markdown, raw, and code cells, including visible text and image outputs but never the live Python namespace. Images displayed by the model's IPython tool are included in that tool's result as well. PNG, JPEG, WebP, GIF, and SVG renditions are prepared as model-visible images; unsupported or oversized images are reported as omissions rather than silently discarded. The first turn records the snapshot; later turns append only new, changed, removed, or reordered cells. Questions, tool calls, tool results, and answers already present in the conversation ledger are not duplicated. Image bytes are carried in the relevant message, while notebook snapshots contain only stable image descriptors. This append-only representation keeps the prior model prefix unchanged for provider caching.
74
-
75
- Codebind stores the complete LangChain message, notebook-context, and turn ledger in notebook metadata. Reopening the notebook, restarting its kernel, and loading the extension restores the exact accumulated context automatically. Each assistant Markdown segment is buffered and inserted as one complete native cell as soon as that segment finishes, before a following tool call is complete. Tool executions and assistant answers are always appended to the notebook end without changing the user's current selection or scroll position. Tool outputs are collapsed by default and remain expandable through JupyterLab's native output control.
76
-
77
- The conversation ledger validates its structure and every assistant tool call against its single matching result, without a version gate. Interrupted saves finish before a turn is cancelled, so a restart cannot turn a partial write into an orphan tool result. Temporary model transport failures retry the same Question with a fresh connection; repeated WebSocket failures use HTTP. Invalid requests and authentication failures remain visible errors.
78
-
79
- An interrupted tool call is closed with an explicit interrupted result before the turn ends. If a provider stream is cancelled or fails, Codebind discards that provider session before the next Question while retaining the notebook conversation and its stable prompt-cache identity.
80
-
81
- The instruction cell, sent Question cells, model-authored tool cells, and assistant Markdown cells are non-editable and non-deletable. Draft Question cells remain editable until they are sent. Jupyter's standard interrupt button cancels an active Codebind question.
82
-
83
- Question and assistant Markdown supports `$...$`, `$$...$$`, `\(...\)`, and `\[...\]` through JupyterLab's native MathJax renderer.
84
-
85
- Other IPython frontends retain standard MIME display, syntax-highlighted code, Markdown, stdout, tracebacks, rich results, and native IPython history.
86
-
87
- ## ChatGPT account access
88
-
89
- Models Provider owns OpenAI account authorization and token refresh. Save the resulting provider-values object in Codebind's XDG `models.json`; Codebind loads it privately when the extension starts. ChatGPT subscription access is separate from the public, pay-as-you-go OpenAI API and may require compatibility updates when the account protocol changes.
File without changes
File without changes
File without changes
File without changes