spawnllm 0.17.9__tar.gz → 0.18.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.
- {spawnllm-0.17.9 → spawnllm-0.18.0}/PKG-INFO +2 -2
- {spawnllm-0.17.9 → spawnllm-0.18.0}/README.md +1 -1
- {spawnllm-0.17.9 → spawnllm-0.18.0}/pyproject.toml +1 -1
- {spawnllm-0.17.9 → spawnllm-0.18.0}/pyproject.toml.orig +1 -1
- {spawnllm-0.17.9 → spawnllm-0.18.0}/spawnllm/__init__.py +2 -0
- {spawnllm-0.17.9 → spawnllm-0.18.0}/spawnllm/_core/spawnllm_core.wasm +0 -0
- {spawnllm-0.17.9 → spawnllm-0.18.0}/spawnllm/backends/__init__.py +2 -0
- spawnllm-0.18.0/spawnllm/backends/cursor_agent.py +40 -0
- {spawnllm-0.17.9 → spawnllm-0.18.0}/spawnllm/backends/registry.py +2 -0
- {spawnllm-0.17.9 → spawnllm-0.18.0}/spawnllm/types.py +3 -1
- {spawnllm-0.17.9 → spawnllm-0.18.0}/LICENSE +0 -0
- {spawnllm-0.17.9 → spawnllm-0.18.0}/spawnllm/__main__.py +0 -0
- {spawnllm-0.17.9 → spawnllm-0.18.0}/spawnllm/_core/__init__.py +0 -0
- {spawnllm-0.17.9 → spawnllm-0.18.0}/spawnllm/backends/apple.py +0 -0
- {spawnllm-0.17.9 → spawnllm-0.18.0}/spawnllm/backends/base.py +0 -0
- {spawnllm-0.17.9 → spawnllm-0.18.0}/spawnllm/backends/claude.py +0 -0
- {spawnllm-0.17.9 → spawnllm-0.18.0}/spawnllm/backends/claude_sdk.py +0 -0
- {spawnllm-0.17.9 → spawnllm-0.18.0}/spawnllm/backends/codex.py +0 -0
- {spawnllm-0.17.9 → spawnllm-0.18.0}/spawnllm/backends/gemini.py +0 -0
- {spawnllm-0.17.9 → spawnllm-0.18.0}/spawnllm/backends/mlx.py +0 -0
- {spawnllm-0.17.9 → spawnllm-0.18.0}/spawnllm/backends/openai_endpoint.py +0 -0
- {spawnllm-0.17.9 → spawnllm-0.18.0}/spawnllm/call.py +0 -0
- {spawnllm-0.17.9 → spawnllm-0.18.0}/spawnllm/cli.py +0 -0
- {spawnllm-0.17.9 → spawnllm-0.18.0}/spawnllm/decide.py +0 -0
- {spawnllm-0.17.9 → spawnllm-0.18.0}/spawnllm/extract.py +0 -0
- {spawnllm-0.17.9 → spawnllm-0.18.0}/spawnllm/mlx/__init__.py +0 -0
- {spawnllm-0.17.9 → spawnllm-0.18.0}/spawnllm/mlx/codec.py +0 -0
- {spawnllm-0.17.9 → spawnllm-0.18.0}/spawnllm/mlx/engine.py +0 -0
- {spawnllm-0.17.9 → spawnllm-0.18.0}/spawnllm/mlx/fuse.py +0 -0
- {spawnllm-0.17.9 → spawnllm-0.18.0}/spawnllm/mlx/patches.py +0 -0
- {spawnllm-0.17.9 → spawnllm-0.18.0}/spawnllm/proc.py +0 -0
- {spawnllm-0.17.9 → spawnllm-0.18.0}/spawnllm/py.typed +0 -0
- {spawnllm-0.17.9 → spawnllm-0.18.0}/spawnllm/response.py +0 -0
- {spawnllm-0.17.9 → spawnllm-0.18.0}/spawnllm/run.py +0 -0
- {spawnllm-0.17.9 → spawnllm-0.18.0}/spawnllm/spec.py +0 -0
- {spawnllm-0.17.9 → spawnllm-0.18.0}/spawnllm/structured.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: spawnllm
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.18.0
|
|
4
4
|
Summary: Delete your subprocess wrappers around claude, codex, and gemini.
|
|
5
5
|
Keywords:
|
|
6
6
|
Author: Yasyf Mohamedali
|
|
@@ -123,7 +123,7 @@ from spawnllm import call_sync
|
|
|
123
123
|
print(call_sync("Reply with just the word: pong"))
|
|
124
124
|
```
|
|
125
125
|
|
|
126
|
-
Prints `pong`, billed to your Claude plan even with `ANTHROPIC_API_KEY` exported. Pass `api_auth=True` to opt back into key auth. The same guard covers codex (`OPENAI_API_KEY`/`CODEX_API_KEY`) and the Gemini family, in Python, Go, and Rust alike; an explicit `RunSpec.env` entry always wins.
|
|
126
|
+
Prints `pong`, billed to your Claude plan even with `ANTHROPIC_API_KEY` exported. Pass `api_auth=True` to opt back into key auth. The same guard covers codex (`OPENAI_API_KEY`/`CODEX_API_KEY`), cursor-agent (`CURSOR_API_KEY`), and the Gemini family, in Python, Go, and Rust alike; an explicit `RunSpec.env` entry always wins.
|
|
127
127
|
|
|
128
128
|
### Call Claude with zero installs
|
|
129
129
|
|
|
@@ -71,7 +71,7 @@ from spawnllm import call_sync
|
|
|
71
71
|
print(call_sync("Reply with just the word: pong"))
|
|
72
72
|
```
|
|
73
73
|
|
|
74
|
-
Prints `pong`, billed to your Claude plan even with `ANTHROPIC_API_KEY` exported. Pass `api_auth=True` to opt back into key auth. The same guard covers codex (`OPENAI_API_KEY`/`CODEX_API_KEY`) and the Gemini family, in Python, Go, and Rust alike; an explicit `RunSpec.env` entry always wins.
|
|
74
|
+
Prints `pong`, billed to your Claude plan even with `ANTHROPIC_API_KEY` exported. Pass `api_auth=True` to opt back into key auth. The same guard covers codex (`OPENAI_API_KEY`/`CODEX_API_KEY`), cursor-agent (`CURSOR_API_KEY`), and the Gemini family, in Python, Go, and Rust alike; an explicit `RunSpec.env` entry always wins.
|
|
75
75
|
|
|
76
76
|
### Call Claude with zero installs
|
|
77
77
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "spawnllm"
|
|
3
3
|
# Inert sentinel: the real version is set from the release tag (uv version --frozen).
|
|
4
|
-
version = "0.
|
|
4
|
+
version = "0.18.0"
|
|
5
5
|
description = "Delete your subprocess wrappers around claude, codex, and gemini."
|
|
6
6
|
readme = "README.md"
|
|
7
7
|
license = "MIT"
|
|
@@ -23,6 +23,7 @@ from spawnllm.backends import (
|
|
|
23
23
|
ClaudeSdkBackend,
|
|
24
24
|
CliBackend,
|
|
25
25
|
CodexCliBackend,
|
|
26
|
+
CursorAgentCliBackend,
|
|
26
27
|
GeminiCliBackend,
|
|
27
28
|
LlmBackend,
|
|
28
29
|
LlmBackends,
|
|
@@ -74,6 +75,7 @@ __all__ = [
|
|
|
74
75
|
"CliBackend",
|
|
75
76
|
"CodexCliBackend",
|
|
76
77
|
"CodexConfig",
|
|
78
|
+
"CursorAgentCliBackend",
|
|
77
79
|
"DecideError",
|
|
78
80
|
"DecideKeyMissing",
|
|
79
81
|
"Decision",
|
|
Binary file
|
|
@@ -16,6 +16,7 @@ from spawnllm.backends.base import (
|
|
|
16
16
|
from spawnllm.backends.claude import ClaudeCliBackend
|
|
17
17
|
from spawnllm.backends.claude_sdk import ClaudeSdkBackend
|
|
18
18
|
from spawnllm.backends.codex import CodexCliBackend
|
|
19
|
+
from spawnllm.backends.cursor_agent import CursorAgentCliBackend
|
|
19
20
|
from spawnllm.backends.gemini import AntigravityCliBackend, GeminiCliBackend
|
|
20
21
|
from spawnllm.backends.mlx import MlxBackend
|
|
21
22
|
from spawnllm.backends.openai_endpoint import OpenAiEndpointBackend
|
|
@@ -34,6 +35,7 @@ __all__ = [
|
|
|
34
35
|
"ClaudeSdkBackend",
|
|
35
36
|
"CliBackend",
|
|
36
37
|
"CodexCliBackend",
|
|
38
|
+
"CursorAgentCliBackend",
|
|
37
39
|
"GeminiCliBackend",
|
|
38
40
|
"LlmBackend",
|
|
39
41
|
"LlmBackends",
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"""CliBackend for Cursor's `cursor-agent` CLI."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from typing import TYPE_CHECKING, ClassVar
|
|
6
|
+
|
|
7
|
+
from spawnllm.backends.base import CliBackend
|
|
8
|
+
|
|
9
|
+
if TYPE_CHECKING:
|
|
10
|
+
from spawnllm.types import ProviderName, TModel
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
class CursorAgentCliBackend(CliBackend):
|
|
14
|
+
"""`CliBackend` for Cursor's `cursor-agent` CLI.
|
|
15
|
+
|
|
16
|
+
The core plans a `cursor-agent --print --output-format json --trust`
|
|
17
|
+
invocation with the prompt delivered over stdin, passing `--mode ask` for
|
|
18
|
+
read-only runs and `--force` when `agent=True`. Structured output appends
|
|
19
|
+
the JSON schema and an instruction to emit only conforming JSON. By default
|
|
20
|
+
`CURSOR_API_KEY` is stripped so the CLI authenticates through the logged-in
|
|
21
|
+
Cursor subscription (`cursor-agent status`); set `api_auth=True` to inherit
|
|
22
|
+
`CURSOR_API_KEY`.
|
|
23
|
+
|
|
24
|
+
Attributes:
|
|
25
|
+
models: Mapping from abstract model size to a Cursor model name.
|
|
26
|
+
|
|
27
|
+
Example:
|
|
28
|
+
>>> from spawnllm.spec import RunSpec
|
|
29
|
+
>>> CursorAgentCliBackend().invocation(RunSpec(prompt="hi", model="composer-2.5-fast")).argv[:5]
|
|
30
|
+
['cursor-agent', '--print', '--output-format', 'json', '--trust']
|
|
31
|
+
"""
|
|
32
|
+
|
|
33
|
+
models: ClassVar[dict[TModel, str]] = {
|
|
34
|
+
"small": "composer-2.5-fast",
|
|
35
|
+
"medium": "composer-2.5",
|
|
36
|
+
"large": "claude-opus-5-5-high",
|
|
37
|
+
}
|
|
38
|
+
provider: ClassVar[ProviderName] = "cursor-agent"
|
|
39
|
+
binary: ClassVar[str] = "cursor-agent"
|
|
40
|
+
install_hint: ClassVar[str] = "curl https://cursor.com/install -fsS | bash"
|
|
@@ -10,6 +10,7 @@ from spawnllm.backends.base import BackendReady, BackendUnavailable, LlmBackend
|
|
|
10
10
|
from spawnllm.backends.claude import ClaudeCliBackend
|
|
11
11
|
from spawnllm.backends.claude_sdk import ClaudeSdkBackend
|
|
12
12
|
from spawnllm.backends.codex import CodexCliBackend
|
|
13
|
+
from spawnllm.backends.cursor_agent import CursorAgentCliBackend
|
|
13
14
|
from spawnllm.backends.gemini import AntigravityCliBackend, GeminiCliBackend
|
|
14
15
|
|
|
15
16
|
if TYPE_CHECKING:
|
|
@@ -20,6 +21,7 @@ BACKENDS_BY_NAME: dict[str, LlmBackend] = {
|
|
|
20
21
|
"claude": ClaudeCliBackend(),
|
|
21
22
|
"codex": CodexCliBackend(),
|
|
22
23
|
"antigravity": AntigravityCliBackend(),
|
|
24
|
+
"cursor-agent": CursorAgentCliBackend(),
|
|
23
25
|
"gemini": GeminiCliBackend(),
|
|
24
26
|
"apple": AppleBackend(),
|
|
25
27
|
}
|
|
@@ -18,5 +18,7 @@ TModel = Literal["small", "medium", "large"]
|
|
|
18
18
|
TReasoningEffort = Literal["none", "minimal", "low", "medium", "high", "xhigh"]
|
|
19
19
|
"""A `reasoning_effort` an OpenAI-compatible endpoint accepts; `OpenAiEndpointBackend` sends it with every request."""
|
|
20
20
|
|
|
21
|
-
ProviderName = Literal[
|
|
21
|
+
ProviderName = Literal[
|
|
22
|
+
"claude", "claude-sdk", "codex", "cursor-agent", "gemini", "antigravity", "mlx", "apple", "openai_endpoint"
|
|
23
|
+
]
|
|
22
24
|
"""Backend provider identifier; keys the per-backend `provider_configs` on a `RunSpec`."""
|
|
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
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|