kodelet-subagent 0.4.0__py3-none-any.whl
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/__init__.py +13 -0
- kodelet_subagent/__main__.py +13 -0
- kodelet_subagent/cli.py +46 -0
- kodelet_subagent/extension.py +727 -0
- kodelet_subagent/install.py +74 -0
- kodelet_subagent/persistence/__init__.py +74 -0
- kodelet_subagent/persistence/database.py +257 -0
- kodelet_subagent/persistence/migrations/__init__.py +1 -0
- kodelet_subagent/persistence/migrations/env.py +28 -0
- kodelet_subagent/persistence/migrations/script.py.mako +25 -0
- kodelet_subagent/persistence/migrations/versions/0001_initial.py +161 -0
- kodelet_subagent/persistence/migrations/versions/__init__.py +1 -0
- kodelet_subagent/persistence/models.py +117 -0
- kodelet_subagent/persistence/store.py +984 -0
- kodelet_subagent/py.typed +0 -0
- kodelet_subagent/runtime.py +889 -0
- kodelet_subagent/ui.py +119 -0
- kodelet_subagent-0.4.0.dist-info/METADATA +64 -0
- kodelet_subagent-0.4.0.dist-info/RECORD +22 -0
- kodelet_subagent-0.4.0.dist-info/WHEEL +4 -0
- kodelet_subagent-0.4.0.dist-info/entry_points.txt +4 -0
- kodelet_subagent-0.4.0.dist-info/licenses/LICENSE +21 -0
|
@@ -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__"]
|
kodelet_subagent/cli.py
ADDED
|
@@ -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
|