clikernel 0.2.12__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.
- {clikernel-0.2.12 → clikernel-0.2.14}/CHANGELOG.md +14 -0
- {clikernel-0.2.12/clikernel.egg-info → clikernel-0.2.14}/PKG-INFO +6 -5
- {clikernel-0.2.12 → clikernel-0.2.14}/README.md +2 -2
- {clikernel-0.2.12 → clikernel-0.2.14}/clikernel/__init__.py +1 -1
- {clikernel-0.2.12 → clikernel-0.2.14}/clikernel/cli.py +1 -1
- {clikernel-0.2.12 → clikernel-0.2.14}/clikernel/mcp.py +8 -4
- {clikernel-0.2.12 → clikernel-0.2.14}/clikernel/skill.py +3 -3
- {clikernel-0.2.12 → clikernel-0.2.14/clikernel.egg-info}/PKG-INFO +6 -5
- {clikernel-0.2.12 → clikernel-0.2.14}/clikernel.egg-info/requires.txt +2 -1
- {clikernel-0.2.12 → clikernel-0.2.14}/pyproject.toml +4 -3
- {clikernel-0.2.12 → clikernel-0.2.14}/LICENSE +0 -0
- {clikernel-0.2.12 → clikernel-0.2.14}/MANIFEST.in +0 -0
- {clikernel-0.2.12 → clikernel-0.2.14}/clikernel/_modidx.py +0 -0
- {clikernel-0.2.12 → clikernel-0.2.14}/clikernel/core.py +0 -0
- {clikernel-0.2.12 → clikernel-0.2.14}/clikernel/stream.py +0 -0
- {clikernel-0.2.12 → clikernel-0.2.14}/clikernel.egg-info/SOURCES.txt +0 -0
- {clikernel-0.2.12 → clikernel-0.2.14}/clikernel.egg-info/dependency_links.txt +0 -0
- {clikernel-0.2.12 → clikernel-0.2.14}/clikernel.egg-info/entry_points.txt +0 -0
- {clikernel-0.2.12 → clikernel-0.2.14}/clikernel.egg-info/top_level.txt +0 -0
- {clikernel-0.2.12 → clikernel-0.2.14}/setup.cfg +0 -0
- {clikernel-0.2.12 → clikernel-0.2.14}/tests/test_stream.py +0 -0
|
@@ -2,6 +2,20 @@
|
|
|
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
|
+
|
|
12
|
+
## 0.2.13
|
|
13
|
+
|
|
14
|
+
### New Features
|
|
15
|
+
|
|
16
|
+
- Switch ipymini to py ([#52](https://github.com/AnswerDotAI/clikernel/issues/52))
|
|
17
|
+
|
|
18
|
+
|
|
5
19
|
## 0.2.12
|
|
6
20
|
|
|
7
21
|
### New Features
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: clikernel
|
|
3
|
-
Version: 0.2.
|
|
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
|
|
@@ -15,7 +15,8 @@ Requires-Dist: fastcore>=2.2.2
|
|
|
15
15
|
Requires-Dist: jupyasyncclient>=0.2.10
|
|
16
16
|
Requires-Dist: jupywire>=0.1.9
|
|
17
17
|
Requires-Dist: mcpmini>=0.0.5
|
|
18
|
-
Requires-Dist: rustygate>=0.1.
|
|
18
|
+
Requires-Dist: rustygate>=0.1.22
|
|
19
|
+
Requires-Dist: ipymini>=0.1.23
|
|
19
20
|
Requires-Dist: httpx
|
|
20
21
|
Provides-Extra: dev
|
|
21
22
|
Requires-Dist: fastship; extra == "dev"
|
|
@@ -55,11 +56,11 @@ claude mcp add clikernel -- clikernel-mcp
|
|
|
55
56
|
Choose a kernel, then execute code:
|
|
56
57
|
|
|
57
58
|
``` python
|
|
58
|
-
create(kernel="
|
|
59
|
+
create(kernel="py")
|
|
59
60
|
exec(code="6*7")
|
|
60
61
|
```
|
|
61
62
|
|
|
62
|
-
Use `kernel="luau"` for bundled Luau, or `kernel="
|
|
63
|
+
Use `kernel="luau"` for bundled Luau, or `kernel="apl"` for APL when `basedpl` is installed in the gateway’s environment. `create` accepts any kernelspec the gateway finds. `exec` never creates or switches kernels. See [MCP](https://AnswerDotAI.github.io/clikernel/mcp.html) for named gateways, dialog bindings, and other tools.
|
|
63
64
|
|
|
64
65
|
## Configuration
|
|
65
66
|
|
|
@@ -32,11 +32,11 @@ claude mcp add clikernel -- clikernel-mcp
|
|
|
32
32
|
Choose a kernel, then execute code:
|
|
33
33
|
|
|
34
34
|
``` python
|
|
35
|
-
create(kernel="
|
|
35
|
+
create(kernel="py")
|
|
36
36
|
exec(code="6*7")
|
|
37
37
|
```
|
|
38
38
|
|
|
39
|
-
Use `kernel="luau"` for bundled Luau, or `kernel="
|
|
39
|
+
Use `kernel="luau"` for bundled Luau, or `kernel="apl"` for APL when `basedpl` is installed in the gateway’s environment. `create` accepts any kernelspec the gateway finds. `exec` never creates or switches kernels. See [MCP](https://AnswerDotAI.github.io/clikernel/mcp.html) for named gateways, dialog bindings, and other tools.
|
|
40
40
|
|
|
41
41
|
## Configuration
|
|
42
42
|
|
|
@@ -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.
|
|
11
|
+
__version__ = "0.2.14"
|
|
@@ -139,7 +139,7 @@ def main(
|
|
|
139
139
|
url, token, verify = resolve(host)
|
|
140
140
|
return await Gateway(url, token, verify).initialize(session_defaults(local=False)), None
|
|
141
141
|
g, child = run(_open())
|
|
142
|
-
info = run(g.text('use_kernel', kernel=kernel) if kernel else g.text('create', kernel='
|
|
142
|
+
info = run(g.text('use_kernel', kernel=kernel) if kernel else g.text('create', kernel='py'))
|
|
143
143
|
stop = False
|
|
144
144
|
def execute(code):
|
|
145
145
|
nonlocal stop
|
|
@@ -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
|
-
|
|
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
|
|
|
@@ -4,9 +4,9 @@ Prefer it over one-off Python scripts (`python -c`, shell heredocs). Prefer in-k
|
|
|
4
4
|
|
|
5
5
|
# Starting and stopping
|
|
6
6
|
|
|
7
|
-
Call `create(kernel="
|
|
7
|
+
Call `create(kernel="py")` before executing Python code. Creation reports what startup imported: read that banner, it says what to do next. New kernels require an explicit implementation. Add `dlgname` to bind a kernel to a dialog. Omit `kernel` only to reuse an existing binding. An explicit implementation must match that binding.
|
|
8
8
|
|
|
9
|
-
A kernel this conversation creates stops when the conversation ends, unless created with `autoclose=false`. Use `create(kernel="
|
|
9
|
+
A kernel this conversation creates stops when the conversation ends, unless created with `autoclose=false`. Use `create(kernel="py", dlgname="work", autoclose=false)` when a kernel should stay running afterwards, and tell the user its id. This requires a gateway that keeps running. Mention it if the reply shows a conversation-started gateway.
|
|
10
10
|
|
|
11
11
|
To continue earlier work, or to use the user's solveit kernel, `list_kernels` then `use_kernel` with the id. Attaching runs no setup and claims no ownership: the kernel's live state is the point, and it is never stopped for you.
|
|
12
12
|
|
|
@@ -18,7 +18,7 @@ Remote gateways are the same tools with a `host` argument on `list_kernels`, `us
|
|
|
18
18
|
|
|
19
19
|
Run code with `exec(code=...)` in the selected kernel. For native Luau work, select `create(kernel="luau")` first. The same execution tool and autoclose rules apply to every implementation. A `dlgname` execution override uses an existing binding for that call without changing the current selection. These rules also apply on named remote gateways.
|
|
20
20
|
|
|
21
|
-
For APL, use `create(kernel="
|
|
21
|
+
For APL, use `create(kernel="apl")` then `exec(code="avg←+/÷≢ ⋄ avg 2 4 9")`. `basedpl` must be installed in the gateway's environment. It provides the `apl` kernelspec. Python startup and inspectors do not run in APL.
|
|
22
22
|
|
|
23
23
|
Start native work with `exec(code="help()")` for the bundled guide and examples, or `exec(code='help("ex.edit_file")')` for function details.
|
|
24
24
|
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: clikernel
|
|
3
|
-
Version: 0.2.
|
|
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
|
|
@@ -15,7 +15,8 @@ Requires-Dist: fastcore>=2.2.2
|
|
|
15
15
|
Requires-Dist: jupyasyncclient>=0.2.10
|
|
16
16
|
Requires-Dist: jupywire>=0.1.9
|
|
17
17
|
Requires-Dist: mcpmini>=0.0.5
|
|
18
|
-
Requires-Dist: rustygate>=0.1.
|
|
18
|
+
Requires-Dist: rustygate>=0.1.22
|
|
19
|
+
Requires-Dist: ipymini>=0.1.23
|
|
19
20
|
Requires-Dist: httpx
|
|
20
21
|
Provides-Extra: dev
|
|
21
22
|
Requires-Dist: fastship; extra == "dev"
|
|
@@ -55,11 +56,11 @@ claude mcp add clikernel -- clikernel-mcp
|
|
|
55
56
|
Choose a kernel, then execute code:
|
|
56
57
|
|
|
57
58
|
``` python
|
|
58
|
-
create(kernel="
|
|
59
|
+
create(kernel="py")
|
|
59
60
|
exec(code="6*7")
|
|
60
61
|
```
|
|
61
62
|
|
|
62
|
-
Use `kernel="luau"` for bundled Luau, or `kernel="
|
|
63
|
+
Use `kernel="luau"` for bundled Luau, or `kernel="apl"` for APL when `basedpl` is installed in the gateway’s environment. `create` accepts any kernelspec the gateway finds. `exec` never creates or switches kernels. See [MCP](https://AnswerDotAI.github.io/clikernel/mcp.html) for named gateways, dialog bindings, and other tools.
|
|
63
64
|
|
|
64
65
|
## Configuration
|
|
65
66
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
[build-system]
|
|
2
|
-
requires = ["setuptools>=
|
|
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 =
|
|
11
|
+
license = "Apache-2.0"
|
|
12
12
|
authors = [{ name = "clikernel contributors" }]
|
|
13
13
|
classifiers = [
|
|
14
14
|
"Programming Language :: Python :: 3",
|
|
@@ -20,7 +20,8 @@ dependencies = [
|
|
|
20
20
|
"jupyasyncclient>=0.2.10",
|
|
21
21
|
"jupywire>=0.1.9",
|
|
22
22
|
"mcpmini>=0.0.5",
|
|
23
|
-
"rustygate>=0.1.
|
|
23
|
+
"rustygate>=0.1.22",
|
|
24
|
+
"ipymini>=0.1.23",
|
|
24
25
|
"httpx",
|
|
25
26
|
]
|
|
26
27
|
|
|
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
|
|
File without changes
|
|
File without changes
|