spawnllm 0.1.0__tar.gz → 0.1.2__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: spawnllm
3
- Version: 0.1.0
3
+ Version: 0.1.2
4
4
  Summary: Subshell + MLX LLM-calling backends (Claude/Codex CLI, local MLX) shared across tools.
5
5
  Keywords:
6
6
  Author: Yasyf Mohamedali
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "spawnllm"
3
- version = "0.1.0"
3
+ version = "0.1.2"
4
4
  description = "Subshell + MLX LLM-calling backends (Claude/Codex CLI, local MLX) shared across tools."
5
5
  readme = "README.md"
6
6
  license = "MIT"
@@ -94,7 +94,9 @@ class ClaudeCliBackend(LlmBackend):
94
94
  return parse_structured_output(raw, response_model)
95
95
 
96
96
  def env(self) -> dict[str, str]:
97
- return {"CLAUDE_CODE_SIMPLE": "1"}
97
+ # CLAUDE_CODE_SIMPLE=1 breaks claude.ai keychain auth ("Not logged in")
98
+ # on current CLIs; --setting-sources ""/--strict-mcp-config already trim startup.
99
+ return {}
98
100
 
99
101
  def build_argv(self, content: str, *, model: str) -> list[str]:
100
102
  """Build the inline ``-p`` argv for the sentiment/pushback scoring path."""
@@ -6,7 +6,7 @@ import json
6
6
  import os
7
7
  import subprocess
8
8
  import tempfile
9
- from typing import TYPE_CHECKING, Any, cast
9
+ from typing import TYPE_CHECKING, Any, cast, overload
10
10
 
11
11
  from spawnllm.backends.codex import CodexCliBackend
12
12
 
@@ -39,7 +39,7 @@ def resolve_schema_path(backend: LlmBackend, schema: str | None) -> str | None:
39
39
  return schema
40
40
 
41
41
 
42
- def extract_structured(events: list[dict[str, Any]], model: type[BaseModel]) -> BaseModel | None:
42
+ def extract_structured[M: BaseModel](events: list[dict[str, Any]], model: type[M]) -> M | None:
43
43
  """Return the validated ``structured_output`` from a stream-json event list, if present."""
44
44
  for e in events:
45
45
  if e.get("type") == "result" and "structured_output" in e:
@@ -47,7 +47,11 @@ def extract_structured(events: list[dict[str, Any]], model: type[BaseModel]) ->
47
47
  return None
48
48
 
49
49
 
50
- def parse_structured_output(raw: str, response_model: type[BaseModel] | None) -> str | BaseModel:
50
+ @overload
51
+ def parse_structured_output(raw: str, response_model: None) -> str: ...
52
+ @overload
53
+ def parse_structured_output[M: BaseModel](raw: str, response_model: type[M]) -> M: ...
54
+ def parse_structured_output[M: BaseModel](raw: str, response_model: type[M] | None) -> str | M:
51
55
  if not response_model:
52
56
  return raw
53
57
  data = json.loads(raw)
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