clikernel 0.2.1__tar.gz → 0.2.2__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.
@@ -2,6 +2,13 @@
2
2
 
3
3
  <!-- do not remove -->
4
4
 
5
+ ## 0.2.2
6
+
7
+ ### New Features
8
+
9
+ - skip AST inspectors on nested `run_cell` so tool-replayed cells (e.g. %nbrun) are not treated as user-typed input ([#32](https://github.com/AnswerDotAI/clikernel/issues/32))
10
+
11
+
5
12
  ## 0.2.1
6
13
 
7
14
  ### New Features
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: clikernel
3
- Version: 0.2.1
3
+ Version: 0.2.2
4
4
  Summary: Serve persistent Jupyter kernels to LLMs as concise text, over MCP or a plain stream protocol
5
5
  Author: clikernel contributors
6
6
  License: Apache-2.0
@@ -8,4 +8,4 @@ Modules:
8
8
  - `clikernel.skill`: Use the persistent `clikernel` MCP session as the default workspace for any task advanced through live Python execution -- stateful inspection, file-editing workflows, debugging, experiments, API probes, data transforms, or notebook-style work. Read this before writing, running, or debugging Python code in a session with `clikernel` connected.
9
9
  - `clikernel.stream`: Streaming JSON-lines worker protocol: nbformat-shaped output events, and a supervisor for select-based UIs."""
10
10
 
11
- __version__ = "0.2.1"
11
+ __version__ = "0.2.2"
@@ -47,6 +47,7 @@ finally: del __file__'''
47
47
  # %% ../nbs/00_core.ipynb #3dbf4cb6
48
48
  _INSP_RUNNER = r'''
49
49
  import inspect as _clik_inspect
50
+ import sys as _clik_sys
50
51
  from IPython.core.error import InputRejected
51
52
  class RuleBlock(InputRejected):
52
53
  "Raise from an inspector to deliberately block a cell; any other inspector exception is a bug, and fails open"
@@ -55,6 +56,11 @@ class _ClikInspect:
55
56
  "Calls each inspector once per cell: 1-arg get the AST, 2-arg also the raw source"
56
57
  def __init__(self, fs): self.fs = fs
57
58
  def visit(self, tree):
59
+ fr, n = _clik_sys._getframe(), 0
60
+ while fr:
61
+ n += fr.f_code.co_name == 'run_cell_async'
62
+ fr = fr.f_back
63
+ if n > 1: return tree # nested run_cell: cell replayed by a tool (%nbrun etc.), not typed
58
64
  for f in self.fs:
59
65
  try:
60
66
  note = f(tree, _clik_src) if len(_clik_inspect.signature(f).parameters) > 1 else f(tree)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: clikernel
3
- Version: 0.2.1
3
+ Version: 0.2.2
4
4
  Summary: Serve persistent Jupyter kernels to LLMs as concise text, over MCP or a plain stream protocol
5
5
  Author: clikernel contributors
6
6
  License: Apache-2.0
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes