clikernel 0.2.13__tar.gz → 0.2.14__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.14
6
+
7
+ ### Bugs Squashed
8
+
9
+ - Open a new gateway session after rustygate restarts ([#53](https://github.com/AnswerDotAI/clikernel/pull/53)), thanks to [@jph00](https://github.com/jph00)
10
+
11
+
5
12
  ## 0.2.13
6
13
 
7
14
  ### New Features
@@ -1,9 +1,9 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: clikernel
3
- Version: 0.2.13
3
+ Version: 0.2.14
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
- License: Apache-2.0
6
+ License-Expression: Apache-2.0
7
7
  Project-URL: Repository, https://github.com/AnswerDotAI/clikernel
8
8
  Project-URL: Documentation, https://AnswerDotAI.github.io/clikernel/
9
9
  Classifier: Programming Language :: Python :: 3
@@ -8,4 +8,4 @@ Modules:
8
8
  - `clikernel.skill`: Use the `clikernel` MCP session as the default workspace for Python work: reading and changing files, notebook work, trying things out, checking how a library behaves, and reshaping data. One session stays open, so imports and variables carry between calls. 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.13"
11
+ __version__ = "0.2.14"
@@ -14,14 +14,13 @@ Docs: https://AnswerDotAI.github.io/clikernel/mcp.html.md"""
14
14
  __all__ = ['HOST_PARAM', 'HOSTED', 'Router', 'main']
15
15
 
16
16
  # %% ../nbs/01_mcp.ipynb #28c42902
17
- import asyncio
17
+ import asyncio, httpx
18
18
  from fastcore.utils import *
19
19
  from fastcore.script import call_parse, store_true
20
20
  from mcpmini.core import serve_stdio, jresp, jerr
21
21
  from .core import Gateway, default_gateway, resolve, session_defaults
22
22
  from . import __version__
23
23
 
24
-
25
24
  # %% ../nbs/01_mcp.ipynb #76e2d782
26
25
  HOST_PARAM = {'type': 'string', 'description': 'Gateway to target: a gateways.toml name, or empty for the default local gateway'}
27
26
  HOSTED = ('list_kernels', 'use_kernel', 'create')
@@ -72,9 +71,14 @@ async def dispatch(self:Router, msg, requester=None):
72
71
  args = msg['params'].setdefault('arguments', {})
73
72
  has_host = 'host' in args
74
73
  host = args.pop('host', '') or ''
75
- s = await self.session(host if has_host else self.cur)
74
+ h = host if has_host else self.cur
75
+ s = await self.session(h)
76
76
  if has_host and msg['params']['name'] in ('use_kernel', 'create'): self.cur = host
77
- return await s.tr.send(msg)
77
+ try: return await s.tr.send(msg)
78
+ except httpx.HTTPStatusError as e:
79
+ if e.response.status_code != 404: raise
80
+ del self.sessions[h] # a restarted gateway answers 404 for a session id it no longer knows
81
+ return await (await self.session(h)).tr.send(msg)
78
82
  return jerr(id, -32601, f'method not found: {method}')
79
83
  except Exception as e: return None if id is None else jerr(id, -32603, str(e))
80
84
 
@@ -1,9 +1,9 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: clikernel
3
- Version: 0.2.13
3
+ Version: 0.2.14
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
- License: Apache-2.0
6
+ License-Expression: Apache-2.0
7
7
  Project-URL: Repository, https://github.com/AnswerDotAI/clikernel
8
8
  Project-URL: Documentation, https://AnswerDotAI.github.io/clikernel/
9
9
  Classifier: Programming Language :: Python :: 3
@@ -1,5 +1,5 @@
1
1
  [build-system]
2
- requires = ["setuptools>=68", "wheel"]
2
+ requires = ["setuptools>=77", "wheel"]
3
3
  build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
@@ -8,7 +8,7 @@ dynamic = ["version"]
8
8
  description = "Serve persistent Jupyter kernels to LLMs as concise text, over MCP or a plain stream protocol"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.11"
11
- license = { text = "Apache-2.0" }
11
+ license = "Apache-2.0"
12
12
  authors = [{ name = "clikernel contributors" }]
13
13
  classifiers = [
14
14
  "Programming Language :: Python :: 3",
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes