swytchcode-runtime 1.1.3__tar.gz → 1.1.4__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 (30) hide show
  1. {swytchcode_runtime-1.1.3/swytchcode_runtime.egg-info → swytchcode_runtime-1.1.4}/PKG-INFO +1 -1
  2. {swytchcode_runtime-1.1.3 → swytchcode_runtime-1.1.4}/pyproject.toml +1 -1
  3. {swytchcode_runtime-1.1.3 → swytchcode_runtime-1.1.4}/swytchcode_runtime/exec.py +10 -0
  4. {swytchcode_runtime-1.1.3 → swytchcode_runtime-1.1.4}/swytchcode_runtime/schema.py +3 -1
  5. {swytchcode_runtime-1.1.3 → swytchcode_runtime-1.1.4/swytchcode_runtime.egg-info}/PKG-INFO +1 -1
  6. {swytchcode_runtime-1.1.3 → swytchcode_runtime-1.1.4}/LICENSE.md +0 -0
  7. {swytchcode_runtime-1.1.3 → swytchcode_runtime-1.1.4}/README.md +0 -0
  8. {swytchcode_runtime-1.1.3 → swytchcode_runtime-1.1.4}/setup.cfg +0 -0
  9. {swytchcode_runtime-1.1.3 → swytchcode_runtime-1.1.4}/swytchcode_runtime/__init__.py +0 -0
  10. {swytchcode_runtime-1.1.3 → swytchcode_runtime-1.1.4}/swytchcode_runtime/cli.py +0 -0
  11. {swytchcode_runtime-1.1.3 → swytchcode_runtime-1.1.4}/swytchcode_runtime/client.py +0 -0
  12. {swytchcode_runtime-1.1.3 → swytchcode_runtime-1.1.4}/swytchcode_runtime/discover.py +0 -0
  13. {swytchcode_runtime-1.1.3 → swytchcode_runtime-1.1.4}/swytchcode_runtime/errors.py +0 -0
  14. {swytchcode_runtime-1.1.3 → swytchcode_runtime-1.1.4}/swytchcode_runtime/manage.py +0 -0
  15. {swytchcode_runtime-1.1.3 → swytchcode_runtime-1.1.4}/swytchcode_runtime/prompts.py +0 -0
  16. {swytchcode_runtime-1.1.3 → swytchcode_runtime-1.1.4}/swytchcode_runtime/providers/__init__.py +0 -0
  17. {swytchcode_runtime-1.1.3 → swytchcode_runtime-1.1.4}/swytchcode_runtime/providers/anthropic.py +0 -0
  18. {swytchcode_runtime-1.1.3 → swytchcode_runtime-1.1.4}/swytchcode_runtime/providers/base.py +0 -0
  19. {swytchcode_runtime-1.1.3 → swytchcode_runtime-1.1.4}/swytchcode_runtime/providers/crewai.py +0 -0
  20. {swytchcode_runtime-1.1.3 → swytchcode_runtime-1.1.4}/swytchcode_runtime/providers/langgraph.py +0 -0
  21. {swytchcode_runtime-1.1.3 → swytchcode_runtime-1.1.4}/swytchcode_runtime/providers/openai_agents.py +0 -0
  22. {swytchcode_runtime-1.1.3 → swytchcode_runtime-1.1.4}/swytchcode_runtime/providers/vercel.py +0 -0
  23. {swytchcode_runtime-1.1.3 → swytchcode_runtime-1.1.4}/swytchcode_runtime.egg-info/SOURCES.txt +0 -0
  24. {swytchcode_runtime-1.1.3 → swytchcode_runtime-1.1.4}/swytchcode_runtime.egg-info/dependency_links.txt +0 -0
  25. {swytchcode_runtime-1.1.3 → swytchcode_runtime-1.1.4}/swytchcode_runtime.egg-info/top_level.txt +0 -0
  26. {swytchcode_runtime-1.1.3 → swytchcode_runtime-1.1.4}/tests/test_alias.py +0 -0
  27. {swytchcode_runtime-1.1.3 → swytchcode_runtime-1.1.4}/tests/test_exec_errors.py +0 -0
  28. {swytchcode_runtime-1.1.3 → swytchcode_runtime-1.1.4}/tests/test_nested_body.py +0 -0
  29. {swytchcode_runtime-1.1.3 → swytchcode_runtime-1.1.4}/tests/test_prompts.py +0 -0
  30. {swytchcode_runtime-1.1.3 → swytchcode_runtime-1.1.4}/tests/test_schema_routing.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: swytchcode-runtime
3
- Version: 1.1.3
3
+ Version: 1.1.4
4
4
  Summary: Thin runtime wrapper around the Swytchcode CLI
5
5
  Author: Swytchcode
6
6
  License: MIT
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "swytchcode-runtime"
7
- version = "1.1.3"
7
+ version = "1.1.4"
8
8
  description = "Thin runtime wrapper around the Swytchcode CLI"
9
9
  readme = "README.md"
10
10
  license = { text = "MIT" }
@@ -155,6 +155,16 @@ def exec_(
155
155
  stderr = result.stderr.decode("utf-8", errors="replace").strip()
156
156
  stdout = result.stdout.decode("utf-8", errors="replace")
157
157
 
158
+ if "demo_mode" in stderr or "data is simulated" in stderr:
159
+ demo_allowed = (env and env.get("SWYTCHCODE_DEMO") == "1") or os.environ.get(
160
+ "SWYTCHCODE_DEMO"
161
+ ) == "1"
162
+ if not demo_allowed:
163
+ raise SwytchcodeError(
164
+ f"Swytchcode CLI executed in simulated demo mode: {stderr}. "
165
+ "Initialize a project with `swytchcode init` or pass --demo explicitly."
166
+ )
167
+
158
168
  if result.returncode != 0:
159
169
  classified = _parse_classified_error(stderr)
160
170
  if classified:
@@ -102,6 +102,8 @@ def _expand(spec: Any) -> dict:
102
102
  items = spec["schema"].get("items")
103
103
  if isinstance(items, dict):
104
104
  out["items"] = _expand(items)
105
+ else:
106
+ out["items"] = {"type": "string"}
105
107
 
106
108
  return out
107
109
 
@@ -191,7 +193,7 @@ def to_pydantic_model(schema: dict, name: str = "ArgsSchema") -> Any:
191
193
  elif t == "boolean":
192
194
  field_type = bool
193
195
  elif t == "array":
194
- field_type = list
196
+ field_type = list[str]
195
197
  elif t == "object":
196
198
  # Only build a nested model when the object's fields are known.
197
199
  # A property-less object (freeform body) becomes a plain dict: an
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: swytchcode-runtime
3
- Version: 1.1.3
3
+ Version: 1.1.4
4
4
  Summary: Thin runtime wrapper around the Swytchcode CLI
5
5
  Author: Swytchcode
6
6
  License: MIT