optio-cursor 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 (47) hide show
  1. optio_cursor-0.1.0/PKG-INFO +70 -0
  2. optio_cursor-0.1.0/README.md +39 -0
  3. optio_cursor-0.1.0/pyproject.toml +52 -0
  4. optio_cursor-0.1.0/setup.cfg +4 -0
  5. optio_cursor-0.1.0/src/optio_cursor/__init__.py +56 -0
  6. optio_cursor-0.1.0/src/optio_cursor/conversation.py +516 -0
  7. optio_cursor-0.1.0/src/optio_cursor/conversation_listener.py +321 -0
  8. optio_cursor-0.1.0/src/optio_cursor/cred_watcher.py +126 -0
  9. optio_cursor-0.1.0/src/optio_cursor/fs_allowlist.py +124 -0
  10. optio_cursor-0.1.0/src/optio_cursor/host_actions.py +1453 -0
  11. optio_cursor-0.1.0/src/optio_cursor/model_probe.py +149 -0
  12. optio_cursor-0.1.0/src/optio_cursor/models.py +157 -0
  13. optio_cursor-0.1.0/src/optio_cursor/prompt.py +188 -0
  14. optio_cursor-0.1.0/src/optio_cursor/seed_manifest.py +82 -0
  15. optio_cursor-0.1.0/src/optio_cursor/session.py +895 -0
  16. optio_cursor-0.1.0/src/optio_cursor/snapshots.py +100 -0
  17. optio_cursor-0.1.0/src/optio_cursor/types.py +308 -0
  18. optio_cursor-0.1.0/src/optio_cursor/verify.py +142 -0
  19. optio_cursor-0.1.0/src/optio_cursor.egg-info/PKG-INFO +70 -0
  20. optio_cursor-0.1.0/src/optio_cursor.egg-info/SOURCES.txt +45 -0
  21. optio_cursor-0.1.0/src/optio_cursor.egg-info/dependency_links.txt +1 -0
  22. optio_cursor-0.1.0/src/optio_cursor.egg-info/requires.txt +9 -0
  23. optio_cursor-0.1.0/src/optio_cursor.egg-info/top_level.txt +1 -0
  24. optio_cursor-0.1.0/tests/test_config.py +25 -0
  25. optio_cursor-0.1.0/tests/test_conversation.py +356 -0
  26. optio_cursor-0.1.0/tests/test_conversation_listener.py +201 -0
  27. optio_cursor-0.1.0/tests/test_cred_watcher.py +204 -0
  28. optio_cursor-0.1.0/tests/test_cursor_cache.py +220 -0
  29. optio_cursor-0.1.0/tests/test_file_download.py +180 -0
  30. optio_cursor-0.1.0/tests/test_file_upload.py +126 -0
  31. optio_cursor-0.1.0/tests/test_fs_allowlist.py +91 -0
  32. optio_cursor-0.1.0/tests/test_host_actions.py +229 -0
  33. optio_cursor-0.1.0/tests/test_import.py +4 -0
  34. optio_cursor-0.1.0/tests/test_model_probe.py +96 -0
  35. optio_cursor-0.1.0/tests/test_models.py +168 -0
  36. optio_cursor-0.1.0/tests/test_prompt.py +8 -0
  37. optio_cursor-0.1.0/tests/test_sandbox_enforce.py +180 -0
  38. optio_cursor-0.1.0/tests/test_seed_manifest.py +44 -0
  39. optio_cursor-0.1.0/tests/test_session_conversation.py +276 -0
  40. optio_cursor-0.1.0/tests/test_session_fs_isolation.py +133 -0
  41. optio_cursor-0.1.0/tests/test_session_lease.py +145 -0
  42. optio_cursor-0.1.0/tests/test_session_local.py +66 -0
  43. optio_cursor-0.1.0/tests/test_session_remote.py +130 -0
  44. optio_cursor-0.1.0/tests/test_session_resume.py +146 -0
  45. optio_cursor-0.1.0/tests/test_session_seed.py +128 -0
  46. optio_cursor-0.1.0/tests/test_snapshots.py +80 -0
  47. optio_cursor-0.1.0/tests/test_verify.py +145 -0
@@ -0,0 +1,70 @@
1
+ Metadata-Version: 2.4
2
+ Name: optio-cursor
3
+ Version: 0.1.0
4
+ Summary: Run Cursor CLI (cursor-agent) 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.4,>=0.3
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
+
32
+ # optio-cursor
33
+
34
+ Run Cursor CLI (`cursor-agent`) as an `optio` task — either as a local
35
+ subprocess or on a remote host over SSH — with the interactive TUI
36
+ embedded in the optio dashboard via an iframe widget served by `ttyd`.
37
+
38
+ ## Install
39
+
40
+ ```bash
41
+ pip install optio-cursor
42
+ ```
43
+
44
+ Requires Python 3.11+. Pulls `optio-core`, `optio-host`, `optio-agents`,
45
+ `asyncssh`, and `aiohttp`.
46
+
47
+ ## What it does
48
+
49
+ Cursor CLI is a near-twin of Grok Build / Claude Code. optio-cursor
50
+ adapts the `optio-grok` machinery: it launches `cursor-agent` inside a
51
+ detached tmux session, serves the TUI over `ttyd`, and coordinates with
52
+ the host harness through the `optio.log` keyword channel (STATUS /
53
+ DELIVERABLE / DONE / ERROR). The agent reads its task from an
54
+ `AGENTS.md` file planted in the workdir.
55
+
56
+ ### Isolation
57
+
58
+ Each task runs under an isolated `HOME` (`<workdir>/home`) with the XDG
59
+ base dirs (`XDG_CONFIG_HOME`, `XDG_CACHE_HOME`, `XDG_DATA_HOME`) pinned
60
+ under it, so cursor's `~/.cursor` and `~/.cache` state never touches the
61
+ operator's real home. Permission rules are config-planted (cursor has no
62
+ `--allow`/`--deny` argv): they go into `<home>/.cursor/cli-config.json`.
63
+ At login cursor spawns `xdg-open` for the auth URL; the redirect
64
+ browser-shim (front of PATH) captures it and surfaces the URL to the
65
+ operator on a `BROWSER:` line instead of a browser popping on the host.
66
+
67
+ ## Status
68
+
69
+ Stage 0 (MVP): iframe/ttyd mode, local host. Resume, seeds,
70
+ conversation mode, and filesystem isolation arrive in later stages.
@@ -0,0 +1,39 @@
1
+ # optio-cursor
2
+
3
+ Run Cursor CLI (`cursor-agent`) as an `optio` task — either as a local
4
+ subprocess or on a remote host over SSH — with the interactive TUI
5
+ embedded in the optio dashboard via an iframe widget served by `ttyd`.
6
+
7
+ ## Install
8
+
9
+ ```bash
10
+ pip install optio-cursor
11
+ ```
12
+
13
+ Requires Python 3.11+. Pulls `optio-core`, `optio-host`, `optio-agents`,
14
+ `asyncssh`, and `aiohttp`.
15
+
16
+ ## What it does
17
+
18
+ Cursor CLI is a near-twin of Grok Build / Claude Code. optio-cursor
19
+ adapts the `optio-grok` machinery: it launches `cursor-agent` inside a
20
+ detached tmux session, serves the TUI over `ttyd`, and coordinates with
21
+ the host harness through the `optio.log` keyword channel (STATUS /
22
+ DELIVERABLE / DONE / ERROR). The agent reads its task from an
23
+ `AGENTS.md` file planted in the workdir.
24
+
25
+ ### Isolation
26
+
27
+ Each task runs under an isolated `HOME` (`<workdir>/home`) with the XDG
28
+ base dirs (`XDG_CONFIG_HOME`, `XDG_CACHE_HOME`, `XDG_DATA_HOME`) pinned
29
+ under it, so cursor's `~/.cursor` and `~/.cache` state never touches the
30
+ operator's real home. Permission rules are config-planted (cursor has no
31
+ `--allow`/`--deny` argv): they go into `<home>/.cursor/cli-config.json`.
32
+ At login cursor spawns `xdg-open` for the auth URL; the redirect
33
+ browser-shim (front of PATH) captures it and surfaces the URL to the
34
+ operator on a `BROWSER:` line instead of a browser popping on the host.
35
+
36
+ ## Status
37
+
38
+ Stage 0 (MVP): iframe/ttyd mode, local host. Resume, seeds,
39
+ conversation mode, and filesystem isolation arrive in later stages.
@@ -0,0 +1,52 @@
1
+ [build-system]
2
+ requires = ["setuptools>=68.0", "wheel"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "optio-cursor"
7
+ version = "0.1.0"
8
+ description = "Run Cursor CLI (cursor-agent) 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.3,<0.4",
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
+ ]
41
+
42
+ [project.urls]
43
+ Homepage = "https://github.com/deai-network/optio"
44
+ Repository = "https://github.com/deai-network/optio"
45
+ Issues = "https://github.com/deai-network/optio/issues"
46
+
47
+ [tool.setuptools.packages.find]
48
+ where = ["src"]
49
+
50
+ [tool.pytest.ini_options]
51
+ asyncio_mode = "auto"
52
+ testpaths = ["tests"]
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,56 @@
1
+ """optio-cursor — run Cursor CLI (cursor-agent) 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_cursor.seed_manifest import (
13
+ CURSOR_CRED_MANIFEST,
14
+ CURSOR_SEED_MANIFEST,
15
+ CURSOR_SEED_SUFFIX,
16
+ delete_seed,
17
+ list_seeds,
18
+ purge_seed,
19
+ )
20
+ from optio_cursor.session import create_cursor_task, run_cursor_session
21
+ from optio_cursor.types import (
22
+ CursorTaskConfig,
23
+ DeliverableCallback,
24
+ HookCallback,
25
+ SeedProvider,
26
+ SeedUnavailableError,
27
+ )
28
+ from optio_cursor.verify import verify_and_refresh_seed
29
+
30
+
31
+ # asyncssh emits per-connection INFO lines that flood worker stdout
32
+ # once an SSH-backed session starts. Quiet by default.
33
+ _logging.getLogger("asyncssh").setLevel(_logging.WARNING)
34
+
35
+
36
+ __all__ = [
37
+ "create_cursor_task",
38
+ "run_cursor_session",
39
+ "CursorTaskConfig",
40
+ "DeliverableCallback",
41
+ "HookCallback",
42
+ "SSHConfig",
43
+ "HookContext",
44
+ "HookContextProtocol",
45
+ "HostCommandError",
46
+ "RunResult",
47
+ "CURSOR_SEED_MANIFEST",
48
+ "CURSOR_CRED_MANIFEST",
49
+ "CURSOR_SEED_SUFFIX",
50
+ "delete_seed",
51
+ "list_seeds",
52
+ "purge_seed",
53
+ "SeedProvider",
54
+ "SeedUnavailableError",
55
+ "verify_and_refresh_seed",
56
+ ]