optio-kimicode 0.1.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.
Files changed (49) hide show
  1. optio_kimicode-0.1.0/PKG-INFO +46 -0
  2. optio_kimicode-0.1.0/README.md +14 -0
  3. optio_kimicode-0.1.0/pyproject.toml +56 -0
  4. optio_kimicode-0.1.0/setup.cfg +4 -0
  5. optio_kimicode-0.1.0/src/optio_kimicode/__init__.py +60 -0
  6. optio_kimicode-0.1.0/src/optio_kimicode/conversation.py +658 -0
  7. optio_kimicode-0.1.0/src/optio_kimicode/conversation_listener.py +318 -0
  8. optio_kimicode-0.1.0/src/optio_kimicode/cred_watcher.py +156 -0
  9. optio_kimicode-0.1.0/src/optio_kimicode/fs_allowlist.py +81 -0
  10. optio_kimicode-0.1.0/src/optio_kimicode/host_actions.py +837 -0
  11. optio_kimicode-0.1.0/src/optio_kimicode/models.py +223 -0
  12. optio_kimicode-0.1.0/src/optio_kimicode/prompt.py +186 -0
  13. optio_kimicode-0.1.0/src/optio_kimicode/seed_manifest.py +95 -0
  14. optio_kimicode-0.1.0/src/optio_kimicode/session.py +1156 -0
  15. optio_kimicode-0.1.0/src/optio_kimicode/snapshots.py +323 -0
  16. optio_kimicode-0.1.0/src/optio_kimicode/types.py +370 -0
  17. optio_kimicode-0.1.0/src/optio_kimicode/verify.py +286 -0
  18. optio_kimicode-0.1.0/src/optio_kimicode.egg-info/PKG-INFO +46 -0
  19. optio_kimicode-0.1.0/src/optio_kimicode.egg-info/SOURCES.txt +47 -0
  20. optio_kimicode-0.1.0/src/optio_kimicode.egg-info/dependency_links.txt +1 -0
  21. optio_kimicode-0.1.0/src/optio_kimicode.egg-info/requires.txt +10 -0
  22. optio_kimicode-0.1.0/src/optio_kimicode.egg-info/top_level.txt +1 -0
  23. optio_kimicode-0.1.0/tests/test_conversation.py +661 -0
  24. optio_kimicode-0.1.0/tests/test_conversation_controls.py +317 -0
  25. optio_kimicode-0.1.0/tests/test_conversation_listener.py +290 -0
  26. optio_kimicode-0.1.0/tests/test_conversation_sandbox_enforce.py +115 -0
  27. optio_kimicode-0.1.0/tests/test_cred_watcher.py +419 -0
  28. optio_kimicode-0.1.0/tests/test_eof_shutdown.py +65 -0
  29. optio_kimicode-0.1.0/tests/test_fs_allowlist.py +224 -0
  30. optio_kimicode-0.1.0/tests/test_fs_isolation_e2e.py +117 -0
  31. optio_kimicode-0.1.0/tests/test_host_actions.py +201 -0
  32. optio_kimicode-0.1.0/tests/test_install.py +248 -0
  33. optio_kimicode-0.1.0/tests/test_models.py +105 -0
  34. optio_kimicode-0.1.0/tests/test_prompt.py +47 -0
  35. optio_kimicode-0.1.0/tests/test_real_binary_gates.py +70 -0
  36. optio_kimicode-0.1.0/tests/test_real_server_ready.py +129 -0
  37. optio_kimicode-0.1.0/tests/test_real_session_e2e.py +251 -0
  38. optio_kimicode-0.1.0/tests/test_recover_session.py +91 -0
  39. optio_kimicode-0.1.0/tests/test_resume_refresh.py +97 -0
  40. optio_kimicode-0.1.0/tests/test_sandbox_enforce.py +117 -0
  41. optio_kimicode-0.1.0/tests/test_seed_manifest.py +114 -0
  42. optio_kimicode-0.1.0/tests/test_seed_refresh.py +119 -0
  43. optio_kimicode-0.1.0/tests/test_session_conversation.py +494 -0
  44. optio_kimicode-0.1.0/tests/test_session_iframe.py +115 -0
  45. optio_kimicode-0.1.0/tests/test_session_remote.py +92 -0
  46. optio_kimicode-0.1.0/tests/test_session_resume.py +277 -0
  47. optio_kimicode-0.1.0/tests/test_snapshots.py +222 -0
  48. optio_kimicode-0.1.0/tests/test_types.py +348 -0
  49. optio_kimicode-0.1.0/tests/test_verify.py +340 -0
@@ -0,0 +1,46 @@
1
+ Metadata-Version: 2.4
2
+ Name: optio-kimicode
3
+ Version: 0.1.0
4
+ Summary: Run Kimi Code CLI as an optio task; local subprocess or remote via SSH; ttyd-served TUI iframe.
5
+ Author-email: Kristof Csillag <kristof.csillag@deai-labs.com>
6
+ License-Expression: Apache-2.0
7
+ Project-URL: Homepage, https://github.com/deai-network/optio
8
+ Project-URL: Repository, https://github.com/deai-network/optio
9
+ Project-URL: Issues, https://github.com/deai-network/optio/issues
10
+ Classifier: Development Status :: 4 - Beta
11
+ Classifier: Programming Language :: Python :: 3
12
+ Classifier: Programming Language :: Python :: 3.11
13
+ Classifier: Programming Language :: Python :: 3.12
14
+ Classifier: Programming Language :: Python :: 3.13
15
+ Classifier: Operating System :: POSIX :: Linux
16
+ Classifier: Operating System :: MacOS
17
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
18
+ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
19
+ Classifier: Topic :: Software Development :: Code Generators
20
+ Classifier: Framework :: AsyncIO
21
+ Requires-Python: >=3.11
22
+ Description-Content-Type: text/markdown
23
+ Requires-Dist: optio-core<0.4,>=0.3
24
+ Requires-Dist: optio-host<0.3,>=0.2
25
+ Requires-Dist: optio-agents<0.5,>=0.4
26
+ Requires-Dist: asyncssh>=2.14
27
+ Requires-Dist: aiohttp>=3.9
28
+ Provides-Extra: dev
29
+ Requires-Dist: pytest>=8.0; extra == "dev"
30
+ Requires-Dist: pytest-asyncio>=0.23; extra == "dev"
31
+ Requires-Dist: pytest-xdist>=3.6; extra == "dev"
32
+
33
+ # optio-kimicode
34
+
35
+ Run Kimi Code CLI as an `optio` task — either as a local subprocess
36
+ or on a remote host over SSH — with the interactive TUI embedded in the
37
+ optio dashboard via an iframe widget served by `ttyd`.
38
+
39
+ ## Install
40
+
41
+ ```bash
42
+ pip install optio-kimicode
43
+ ```
44
+
45
+ Requires Python 3.11+. Pulls `optio-core`, `optio-host`, `optio-agents`,
46
+ `asyncssh`, and `aiohttp`.
@@ -0,0 +1,14 @@
1
+ # optio-kimicode
2
+
3
+ Run Kimi Code CLI as an `optio` task — either as a local subprocess
4
+ or on a remote host over SSH — with the interactive TUI embedded in the
5
+ optio dashboard via an iframe widget served by `ttyd`.
6
+
7
+ ## Install
8
+
9
+ ```bash
10
+ pip install optio-kimicode
11
+ ```
12
+
13
+ Requires Python 3.11+. Pulls `optio-core`, `optio-host`, `optio-agents`,
14
+ `asyncssh`, and `aiohttp`.
@@ -0,0 +1,56 @@
1
+ [build-system]
2
+ requires = ["setuptools>=68.0", "wheel"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "optio-kimicode"
7
+ version = "0.1.0"
8
+ description = "Run Kimi Code CLI as an optio task; local subprocess or remote via SSH; ttyd-served TUI iframe."
9
+ readme = "README.md"
10
+ license = "Apache-2.0"
11
+ requires-python = ">=3.11"
12
+ authors = [
13
+ { name = "Kristof Csillag", email = "kristof.csillag@deai-labs.com" },
14
+ ]
15
+ classifiers = [
16
+ "Development Status :: 4 - Beta",
17
+ "Programming Language :: Python :: 3",
18
+ "Programming Language :: Python :: 3.11",
19
+ "Programming Language :: Python :: 3.12",
20
+ "Programming Language :: Python :: 3.13",
21
+ "Operating System :: POSIX :: Linux",
22
+ "Operating System :: MacOS",
23
+ "Topic :: Software Development :: Libraries :: Python Modules",
24
+ "Topic :: Scientific/Engineering :: Artificial Intelligence",
25
+ "Topic :: Software Development :: Code Generators",
26
+ "Framework :: AsyncIO",
27
+ ]
28
+ dependencies = [
29
+ "optio-core>=0.3,<0.4",
30
+ "optio-host>=0.2,<0.3",
31
+ "optio-agents>=0.4,<0.5",
32
+ "asyncssh>=2.14",
33
+ "aiohttp>=3.9",
34
+ ]
35
+
36
+ [project.optional-dependencies]
37
+ dev = [
38
+ "pytest>=8.0",
39
+ "pytest-asyncio>=0.23",
40
+ "pytest-xdist>=3.6",
41
+ ]
42
+
43
+ [project.urls]
44
+ Homepage = "https://github.com/deai-network/optio"
45
+ Repository = "https://github.com/deai-network/optio"
46
+ Issues = "https://github.com/deai-network/optio/issues"
47
+
48
+ [tool.setuptools.packages.find]
49
+ where = ["src"]
50
+
51
+ [tool.pytest.ini_options]
52
+ asyncio_mode = "auto"
53
+ testpaths = ["tests"]
54
+ markers = [
55
+ "serial: spawn-heavy, timing-fragile test that must run in a final non-parallel phase",
56
+ ]
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,60 @@
1
+ """optio-kimicode — run Kimi Code CLI as an optio task."""
2
+
3
+ import logging as _logging
4
+
5
+ from optio_agents import HookContext, HookContextProtocol
6
+ from optio_host import (
7
+ HostCommandError,
8
+ RunResult,
9
+ SSHConfig,
10
+ )
11
+
12
+ from optio_kimicode.seed_manifest import (
13
+ KIMI_CRED_MANIFEST,
14
+ KIMI_SEED_MANIFEST,
15
+ KIMI_SEED_SUFFIX,
16
+ delete_seed,
17
+ list_seeds,
18
+ purge_seed,
19
+ )
20
+ from optio_kimicode.session import create_kimicode_task, run_kimicode_session
21
+ from optio_kimicode.types import (
22
+ AllowedDir,
23
+ DeliverableCallback,
24
+ HookCallback,
25
+ KimiCodeTaskConfig,
26
+ PermissionMode,
27
+ SeedProvider,
28
+ SeedUnavailableError,
29
+ )
30
+ from optio_kimicode.verify import verify_and_refresh_seed
31
+
32
+
33
+ # asyncssh emits per-connection INFO lines that flood worker stdout once an
34
+ # SSH-backed session starts. Quiet by default.
35
+ _logging.getLogger("asyncssh").setLevel(_logging.WARNING)
36
+
37
+
38
+ __all__ = [
39
+ "create_kimicode_task",
40
+ "run_kimicode_session",
41
+ "KimiCodeTaskConfig",
42
+ "DeliverableCallback",
43
+ "HookCallback",
44
+ "PermissionMode",
45
+ "SSHConfig",
46
+ "HookContext",
47
+ "HookContextProtocol",
48
+ "HostCommandError",
49
+ "RunResult",
50
+ "SeedProvider",
51
+ "SeedUnavailableError",
52
+ "AllowedDir",
53
+ "KIMI_SEED_MANIFEST",
54
+ "KIMI_CRED_MANIFEST",
55
+ "KIMI_SEED_SUFFIX",
56
+ "delete_seed",
57
+ "list_seeds",
58
+ "purge_seed",
59
+ "verify_and_refresh_seed",
60
+ ]