kodelet-subagent 0.4.0__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.
- kodelet_subagent-0.4.0/LICENSE +21 -0
- kodelet_subagent-0.4.0/PKG-INFO +64 -0
- kodelet_subagent-0.4.0/README.md +48 -0
- kodelet_subagent-0.4.0/pyproject.toml +77 -0
- kodelet_subagent-0.4.0/pyproject.toml.orig +52 -0
- kodelet_subagent-0.4.0/src/kodelet_subagent/__init__.py +13 -0
- kodelet_subagent-0.4.0/src/kodelet_subagent/__main__.py +13 -0
- kodelet_subagent-0.4.0/src/kodelet_subagent/cli.py +46 -0
- kodelet_subagent-0.4.0/src/kodelet_subagent/extension.py +727 -0
- kodelet_subagent-0.4.0/src/kodelet_subagent/install.py +74 -0
- kodelet_subagent-0.4.0/src/kodelet_subagent/persistence/__init__.py +74 -0
- kodelet_subagent-0.4.0/src/kodelet_subagent/persistence/database.py +257 -0
- kodelet_subagent-0.4.0/src/kodelet_subagent/persistence/migrations/__init__.py +1 -0
- kodelet_subagent-0.4.0/src/kodelet_subagent/persistence/migrations/env.py +28 -0
- kodelet_subagent-0.4.0/src/kodelet_subagent/persistence/migrations/script.py.mako +25 -0
- kodelet_subagent-0.4.0/src/kodelet_subagent/persistence/migrations/versions/0001_initial.py +161 -0
- kodelet_subagent-0.4.0/src/kodelet_subagent/persistence/migrations/versions/__init__.py +1 -0
- kodelet_subagent-0.4.0/src/kodelet_subagent/persistence/models.py +117 -0
- kodelet_subagent-0.4.0/src/kodelet_subagent/persistence/store.py +984 -0
- kodelet_subagent-0.4.0/src/kodelet_subagent/py.typed +0 -0
- kodelet_subagent-0.4.0/src/kodelet_subagent/runtime.py +889 -0
- kodelet_subagent-0.4.0/src/kodelet_subagent/ui.py +119 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Jingkai He
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: kodelet-subagent
|
|
3
|
+
Version: 0.4.0
|
|
4
|
+
Summary: Durable background-agent extension for Kodelet
|
|
5
|
+
Keywords: kodelet,extension,agents,background-tasks
|
|
6
|
+
Author: Jingkai He
|
|
7
|
+
Author-email: Jingkai He <jingkai@hey.com>
|
|
8
|
+
License-Expression: MIT
|
|
9
|
+
License-File: LICENSE
|
|
10
|
+
Requires-Dist: alembic>=1.16,<2
|
|
11
|
+
Requires-Dist: kodelet-sdk>=0.1.21,<0.2
|
|
12
|
+
Requires-Python: >=3.11
|
|
13
|
+
Project-URL: Repository, https://github.com/jingkaihe/kodelet-subagent
|
|
14
|
+
Project-URL: Issues, https://github.com/jingkaihe/kodelet-subagent/issues
|
|
15
|
+
Description-Content-Type: text/markdown
|
|
16
|
+
|
|
17
|
+
# Kodelet subagent
|
|
18
|
+
|
|
19
|
+
Durable background agents for Kodelet, implemented as a normal Python library and exposed through a Kodelet extension.
|
|
20
|
+
|
|
21
|
+
The extension provides six tools:
|
|
22
|
+
|
|
23
|
+
- `spawn_agent` starts a named background agent from a fork of the current conversation or from fresh context.
|
|
24
|
+
- `wait_agent` waits for a specific run while forwarding live child-tool progress when available.
|
|
25
|
+
- `list_agents` reports persisted agents owned by the current conversation.
|
|
26
|
+
- `followup_agent` resumes a completed, failed, or interrupted agent.
|
|
27
|
+
- `steer_agent` queues guidance for a running agent.
|
|
28
|
+
- `cancel_agent` persists cancellation and fences the active worker.
|
|
29
|
+
|
|
30
|
+
Agent identity, run history, leases, and steering messages are stored in SQLite. The extension initializes and upgrades its database automatically before serving tools.
|
|
31
|
+
|
|
32
|
+
## Installation
|
|
33
|
+
|
|
34
|
+
Requirements: Kodelet with extension background-task support, Python 3.11 or newer, and `uv`.
|
|
35
|
+
|
|
36
|
+
Run the package's installer directly with `uvx`:
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
uvx kodelet-subagent install
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
Or install directly from GitHub:
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
uvx --from git+https://github.com/jingkaihe/kodelet-subagent kodelet-subagent install
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
The GitHub form pins the resolved commit in the generated extension wrapper.
|
|
49
|
+
|
|
50
|
+
This installs the extension wrapper at:
|
|
51
|
+
|
|
52
|
+
```text
|
|
53
|
+
~/.kodelet/plugins/jingkaihe@kodelet-subagent/extensions/subagent/kodelet-extension-subagent
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
Verify discovery after restarting Kodelet:
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
kodelet extension inspect jingkaihe@kodelet-subagent/subagent
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
## License
|
|
63
|
+
|
|
64
|
+
Licensed under the MIT License. See `LICENSE`.
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# Kodelet subagent
|
|
2
|
+
|
|
3
|
+
Durable background agents for Kodelet, implemented as a normal Python library and exposed through a Kodelet extension.
|
|
4
|
+
|
|
5
|
+
The extension provides six tools:
|
|
6
|
+
|
|
7
|
+
- `spawn_agent` starts a named background agent from a fork of the current conversation or from fresh context.
|
|
8
|
+
- `wait_agent` waits for a specific run while forwarding live child-tool progress when available.
|
|
9
|
+
- `list_agents` reports persisted agents owned by the current conversation.
|
|
10
|
+
- `followup_agent` resumes a completed, failed, or interrupted agent.
|
|
11
|
+
- `steer_agent` queues guidance for a running agent.
|
|
12
|
+
- `cancel_agent` persists cancellation and fences the active worker.
|
|
13
|
+
|
|
14
|
+
Agent identity, run history, leases, and steering messages are stored in SQLite. The extension initializes and upgrades its database automatically before serving tools.
|
|
15
|
+
|
|
16
|
+
## Installation
|
|
17
|
+
|
|
18
|
+
Requirements: Kodelet with extension background-task support, Python 3.11 or newer, and `uv`.
|
|
19
|
+
|
|
20
|
+
Run the package's installer directly with `uvx`:
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
uvx kodelet-subagent install
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
Or install directly from GitHub:
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
uvx --from git+https://github.com/jingkaihe/kodelet-subagent kodelet-subagent install
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
The GitHub form pins the resolved commit in the generated extension wrapper.
|
|
33
|
+
|
|
34
|
+
This installs the extension wrapper at:
|
|
35
|
+
|
|
36
|
+
```text
|
|
37
|
+
~/.kodelet/plugins/jingkaihe@kodelet-subagent/extensions/subagent/kodelet-extension-subagent
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
Verify discovery after restarting Kodelet:
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
kodelet extension inspect jingkaihe@kodelet-subagent/subagent
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
## License
|
|
47
|
+
|
|
48
|
+
Licensed under the MIT License. See `LICENSE`.
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "kodelet-subagent"
|
|
3
|
+
version = "0.4.0"
|
|
4
|
+
description = "Durable background-agent extension for Kodelet"
|
|
5
|
+
readme = "README.md"
|
|
6
|
+
requires-python = ">=3.11"
|
|
7
|
+
license = "MIT"
|
|
8
|
+
license-files = ["LICENSE"]
|
|
9
|
+
keywords = [
|
|
10
|
+
"kodelet",
|
|
11
|
+
"extension",
|
|
12
|
+
"agents",
|
|
13
|
+
"background-tasks",
|
|
14
|
+
]
|
|
15
|
+
dependencies = [
|
|
16
|
+
"alembic>=1.16,<2",
|
|
17
|
+
"kodelet-sdk>=0.1.21,<0.2",
|
|
18
|
+
]
|
|
19
|
+
|
|
20
|
+
[[project.authors]]
|
|
21
|
+
name = "Jingkai He"
|
|
22
|
+
email = "jingkai@hey.com"
|
|
23
|
+
|
|
24
|
+
[project.urls]
|
|
25
|
+
Repository = "https://github.com/jingkaihe/kodelet-subagent"
|
|
26
|
+
Issues = "https://github.com/jingkaihe/kodelet-subagent/issues"
|
|
27
|
+
|
|
28
|
+
[project.scripts]
|
|
29
|
+
kodelet-extension-subagent = "kodelet_subagent.__main__:main"
|
|
30
|
+
kodelet-subagent = "kodelet_subagent.cli:main"
|
|
31
|
+
|
|
32
|
+
[build-system]
|
|
33
|
+
requires = ["uv_build>=0.9.18,<0.10.0"]
|
|
34
|
+
build-backend = "uv_build"
|
|
35
|
+
|
|
36
|
+
[dependency-groups]
|
|
37
|
+
dev = [
|
|
38
|
+
"pytest>=8",
|
|
39
|
+
"pytest-asyncio>=0.24",
|
|
40
|
+
"ruff>=0.14",
|
|
41
|
+
"ty>=0.0.1a21",
|
|
42
|
+
]
|
|
43
|
+
|
|
44
|
+
[tool.pytest.ini_options]
|
|
45
|
+
asyncio_mode = "auto"
|
|
46
|
+
testpaths = ["tests"]
|
|
47
|
+
|
|
48
|
+
[tool.ruff]
|
|
49
|
+
line-length = 100
|
|
50
|
+
src = [
|
|
51
|
+
"src",
|
|
52
|
+
"tests",
|
|
53
|
+
]
|
|
54
|
+
|
|
55
|
+
[tool.ruff.lint]
|
|
56
|
+
select = [
|
|
57
|
+
"E",
|
|
58
|
+
"F",
|
|
59
|
+
"I",
|
|
60
|
+
"UP",
|
|
61
|
+
"B",
|
|
62
|
+
"ASYNC",
|
|
63
|
+
"C90",
|
|
64
|
+
"RUF",
|
|
65
|
+
]
|
|
66
|
+
ignore = [
|
|
67
|
+
"RUF001",
|
|
68
|
+
"RUF002",
|
|
69
|
+
"RUF003",
|
|
70
|
+
]
|
|
71
|
+
|
|
72
|
+
[tool.ty.environment]
|
|
73
|
+
python-version = "3.11"
|
|
74
|
+
root = [
|
|
75
|
+
"src",
|
|
76
|
+
"tests",
|
|
77
|
+
]
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "kodelet-subagent"
|
|
3
|
+
version = "0.4.0"
|
|
4
|
+
description = "Durable background-agent extension for Kodelet"
|
|
5
|
+
readme = "README.md"
|
|
6
|
+
authors = [
|
|
7
|
+
{ name = "Jingkai He", email = "jingkai@hey.com" }
|
|
8
|
+
]
|
|
9
|
+
requires-python = ">=3.11"
|
|
10
|
+
license = "MIT"
|
|
11
|
+
license-files = ["LICENSE"]
|
|
12
|
+
keywords = ["kodelet", "extension", "agents", "background-tasks"]
|
|
13
|
+
dependencies = [
|
|
14
|
+
"alembic>=1.16,<2",
|
|
15
|
+
"kodelet-sdk>=0.1.21,<0.2",
|
|
16
|
+
]
|
|
17
|
+
|
|
18
|
+
[project.urls]
|
|
19
|
+
Repository = "https://github.com/jingkaihe/kodelet-subagent"
|
|
20
|
+
Issues = "https://github.com/jingkaihe/kodelet-subagent/issues"
|
|
21
|
+
|
|
22
|
+
[project.scripts]
|
|
23
|
+
kodelet-extension-subagent = "kodelet_subagent.__main__:main"
|
|
24
|
+
kodelet-subagent = "kodelet_subagent.cli:main"
|
|
25
|
+
|
|
26
|
+
[build-system]
|
|
27
|
+
requires = ["uv_build>=0.9.18,<0.10.0"]
|
|
28
|
+
build-backend = "uv_build"
|
|
29
|
+
|
|
30
|
+
[dependency-groups]
|
|
31
|
+
dev = [
|
|
32
|
+
"pytest>=8",
|
|
33
|
+
"pytest-asyncio>=0.24",
|
|
34
|
+
"ruff>=0.14",
|
|
35
|
+
"ty>=0.0.1a21",
|
|
36
|
+
]
|
|
37
|
+
|
|
38
|
+
[tool.pytest.ini_options]
|
|
39
|
+
asyncio_mode = "auto"
|
|
40
|
+
testpaths = ["tests"]
|
|
41
|
+
|
|
42
|
+
[tool.ruff]
|
|
43
|
+
line-length = 100
|
|
44
|
+
src = ["src", "tests"]
|
|
45
|
+
|
|
46
|
+
[tool.ruff.lint]
|
|
47
|
+
select = ["E", "F", "I", "UP", "B", "ASYNC", "C90", "RUF"]
|
|
48
|
+
ignore = ["RUF001", "RUF002", "RUF003"]
|
|
49
|
+
|
|
50
|
+
[tool.ty.environment]
|
|
51
|
+
python-version = "3.11"
|
|
52
|
+
root = ["src", "tests"]
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"""Durable background-agent support for Kodelet."""
|
|
2
|
+
|
|
3
|
+
from importlib.metadata import PackageNotFoundError, version
|
|
4
|
+
|
|
5
|
+
try:
|
|
6
|
+
__version__ = version("kodelet-subagent")
|
|
7
|
+
except PackageNotFoundError: # pragma: no cover - source tree without installation
|
|
8
|
+
__version__ = "0.4.0"
|
|
9
|
+
|
|
10
|
+
from .persistence import AgentStore
|
|
11
|
+
from .runtime import RuntimeState
|
|
12
|
+
|
|
13
|
+
__all__ = ["AgentStore", "RuntimeState", "__version__"]
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"""Maintenance commands for the subagent extension."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
import argparse
|
|
6
|
+
from collections.abc import Sequence
|
|
7
|
+
from pathlib import Path
|
|
8
|
+
|
|
9
|
+
from .install import install_plugin
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
def build_parser() -> argparse.ArgumentParser:
|
|
13
|
+
parser = argparse.ArgumentParser(prog="kodelet-subagent")
|
|
14
|
+
subcommands = parser.add_subparsers(dest="command", required=True)
|
|
15
|
+
|
|
16
|
+
install = subcommands.add_parser(
|
|
17
|
+
"install",
|
|
18
|
+
help="Install the Kodelet plugin wrapper in ~/.kodelet/plugins",
|
|
19
|
+
)
|
|
20
|
+
install.add_argument(
|
|
21
|
+
"--home",
|
|
22
|
+
type=Path,
|
|
23
|
+
help="Override the home directory used for installation",
|
|
24
|
+
)
|
|
25
|
+
|
|
26
|
+
migrate = subcommands.add_parser(
|
|
27
|
+
"migrate",
|
|
28
|
+
help="Upgrade a subagent SQLite database to the latest Alembic revision",
|
|
29
|
+
)
|
|
30
|
+
migrate.add_argument("database", type=Path)
|
|
31
|
+
return parser
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
def main(argv: Sequence[str] | None = None) -> int:
|
|
35
|
+
args = build_parser().parse_args(argv)
|
|
36
|
+
if args.command == "install":
|
|
37
|
+
executable = install_plugin(home=args.home)
|
|
38
|
+
print(f"Installed Kodelet subagent extension at {executable}")
|
|
39
|
+
return 0
|
|
40
|
+
|
|
41
|
+
from .persistence import migrate_database
|
|
42
|
+
|
|
43
|
+
database = args.database.expanduser().resolve()
|
|
44
|
+
migrate_database(database)
|
|
45
|
+
print(f"Migrated {database}")
|
|
46
|
+
return 0
|