auragrid-api 4.3.0__py3-none-any.whl
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.
auragrid_api/__init__.py
ADDED
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
"""Canonical wire contract path and fixture loaders for ``auragrid-api``.
|
|
2
|
+
|
|
3
|
+
This package contains zero runtime business logic, HTTP servers, or network
|
|
4
|
+
clients. It exposes read-only accessors to canonical JSON Schemas, OpenAPI 3.1
|
|
5
|
+
specifications, and golden wire vectors shared across AuraGrid (.NET 10),
|
|
6
|
+
``auragrid-py``, and ``aurasprout``.
|
|
7
|
+
"""
|
|
8
|
+
|
|
9
|
+
from __future__ import annotations
|
|
10
|
+
|
|
11
|
+
import json
|
|
12
|
+
from pathlib import Path
|
|
13
|
+
from typing import Any
|
|
14
|
+
|
|
15
|
+
__version__ = "4.3.0"
|
|
16
|
+
|
|
17
|
+
_PACKAGE_DIR = Path(__file__).resolve().parent
|
|
18
|
+
_REPO_ROOT = _PACKAGE_DIR.parent.parent
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
def _resolve_root_dir(subdir: str) -> Path:
|
|
22
|
+
"""Resolve a data directory from bundled package data or the repository root."""
|
|
23
|
+
bundled = _PACKAGE_DIR / subdir
|
|
24
|
+
if bundled.is_dir():
|
|
25
|
+
return bundled
|
|
26
|
+
repo_dir = _REPO_ROOT / subdir
|
|
27
|
+
if repo_dir.is_dir():
|
|
28
|
+
return repo_dir
|
|
29
|
+
raise FileNotFoundError(
|
|
30
|
+
f"Contract directory '{subdir}' not found in '{bundled}' or '{repo_dir}'."
|
|
31
|
+
)
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
def _safe_child(base_dir: Path, name: str) -> Path:
|
|
35
|
+
"""Resolve a filename or relative subpath safely inside ``base_dir``."""
|
|
36
|
+
candidate = (base_dir / name).resolve()
|
|
37
|
+
resolved_base = base_dir.resolve()
|
|
38
|
+
try:
|
|
39
|
+
candidate.relative_to(resolved_base)
|
|
40
|
+
except ValueError as exc:
|
|
41
|
+
raise ValueError(f"Path '{name}' escapes contract directory '{resolved_base}'.") from exc
|
|
42
|
+
if not candidate.is_file():
|
|
43
|
+
raise FileNotFoundError(f"Contract file '{name}' not found under '{resolved_base}'.")
|
|
44
|
+
return candidate
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
def get_schema_path(name: str) -> Path:
|
|
48
|
+
"""Return the absolute path to a JSON Schema file in ``schemas/``."""
|
|
49
|
+
return _safe_child(_resolve_root_dir("schemas"), name)
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
def get_openapi_path(name: str) -> Path:
|
|
53
|
+
"""Return the absolute path to an OpenAPI specification file in ``openapi/``."""
|
|
54
|
+
return _safe_child(_resolve_root_dir("openapi"), name)
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
def get_fixture_path(name: str) -> Path:
|
|
58
|
+
"""Return the absolute path to a golden fixture file in ``fixtures/wire_vectors/``."""
|
|
59
|
+
return _safe_child(_resolve_root_dir("fixtures") / "wire_vectors", name)
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
def list_schemas() -> list[str]:
|
|
63
|
+
"""List all JSON Schema filenames shipped by ``auragrid-api``."""
|
|
64
|
+
return sorted(p.name for p in _resolve_root_dir("schemas").glob("*.json"))
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
def list_openapi_specs() -> list[str]:
|
|
68
|
+
"""List all OpenAPI specification filenames shipped by ``auragrid-api``."""
|
|
69
|
+
return sorted(p.name for p in _resolve_root_dir("openapi").glob("*.json"))
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
def list_wire_vectors() -> list[str]:
|
|
73
|
+
"""List all golden wire vector filenames shipped under ``fixtures/wire_vectors/``."""
|
|
74
|
+
vectors_dir = _resolve_root_dir("fixtures") / "wire_vectors"
|
|
75
|
+
return sorted(p.name for p in vectors_dir.glob("*.json"))
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
def load_schema(name: str) -> dict[str, Any]:
|
|
79
|
+
"""Load and parse a canonical JSON Schema dictionary."""
|
|
80
|
+
return json.loads(get_schema_path(name).read_text(encoding="utf-8"))
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
def load_openapi(name: str) -> dict[str, Any]:
|
|
84
|
+
"""Load and parse a canonical OpenAPI 3.1 specification dictionary."""
|
|
85
|
+
return json.loads(get_openapi_path(name).read_text(encoding="utf-8"))
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
def load_wire_vector(name: str) -> Any:
|
|
89
|
+
"""Load and parse a golden JSON wire vector."""
|
|
90
|
+
return json.loads(get_fixture_path(name).read_text(encoding="utf-8"))
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
__all__ = [
|
|
94
|
+
"__version__",
|
|
95
|
+
"get_fixture_path",
|
|
96
|
+
"get_openapi_path",
|
|
97
|
+
"get_schema_path",
|
|
98
|
+
"list_openapi_specs",
|
|
99
|
+
"list_schemas",
|
|
100
|
+
"list_wire_vectors",
|
|
101
|
+
"load_openapi",
|
|
102
|
+
"load_schema",
|
|
103
|
+
"load_wire_vector",
|
|
104
|
+
]
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: auragrid-api
|
|
3
|
+
Version: 4.3.0
|
|
4
|
+
Summary: Canonical wire contracts, JSON Schemas, OpenAPI 3.1 specifications, protocol docs, and golden test vectors for the AuraCore ecosystem
|
|
5
|
+
License: MIT
|
|
6
|
+
Requires-Python: >=3.10
|
|
7
|
+
Description-Content-Type: text/markdown
|
|
8
|
+
License-File: LICENSE
|
|
9
|
+
Provides-Extra: dev
|
|
10
|
+
Requires-Dist: pytest>=8.0; extra == "dev"
|
|
11
|
+
Requires-Dist: jsonschema>=4.20; extra == "dev"
|
|
12
|
+
Dynamic: license-file
|
|
13
|
+
|
|
14
|
+
# `auragrid-api`
|
|
15
|
+
|
|
16
|
+
Canonical JSON Schemas, OpenAPI 3.1 specifications, wire protocol documentation, and golden test vectors shared by:
|
|
17
|
+
- **AuraGrid** (.NET 10)
|
|
18
|
+
- **auragrid-py** (Python MAS SDK)
|
|
19
|
+
- **AuraSprout** (User-Space App Distribution & Collaborative Runtime)
|
|
20
|
+
|
|
21
|
+
## Package API
|
|
22
|
+
```python
|
|
23
|
+
from auragrid_api import get_schema_path, get_openapi_path, load_schema, load_openapi
|
|
24
|
+
|
|
25
|
+
manifest_schema = load_schema("app.manifest.schema.json")
|
|
26
|
+
ipc_spec = load_openapi("ipc-bridge.openapi.json")
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## Layout
|
|
30
|
+
- `schemas/` — `app.manifest.schema.json`, `service-descriptor.schema.json`, `catalog.schema.json`, `lease-collaboration.schema.json`
|
|
31
|
+
- `openapi/` — `ipc-bridge.openapi.json`, `aurasprout-management.openapi.json`
|
|
32
|
+
- `docs/` — `ipc-protocol.md`, `package-and-catalog-spec.md`, `collaborative-shared-processing.md`
|
|
33
|
+
- `fixtures/wire_vectors/` — Golden JSON payloads verified by `tests/test_schemas_and_vectors.py`
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
auragrid_api/__init__.py,sha256=GyMSB4LmXS05UTqvOpJSluIaKK5Ya3ClzQKyIGqm7uQ,3516
|
|
2
|
+
auragrid_api-4.3.0.dist-info/licenses/LICENSE,sha256=I9-Q5_KMrWVkGxKbQPR2TpdZ8priwbGgfyy_8BFrBD8,1073
|
|
3
|
+
auragrid_api-4.3.0.dist-info/METADATA,sha256=3HQtAgScAJfx9_ClIQMl4dFQ8iZBMeG71lRUVeoEwYk,1352
|
|
4
|
+
auragrid_api-4.3.0.dist-info/WHEEL,sha256=mOdXR9C3wMVov7cSY8PY-XCzo3SmmWCHvGQr5csJoao,91
|
|
5
|
+
auragrid_api-4.3.0.dist-info/top_level.txt,sha256=rD-xuFIHEBjpAtS_JcW06Qspj-u3hHROdsGdyJLaKCM,13
|
|
6
|
+
auragrid_api-4.3.0.dist-info/RECORD,,
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 AuraCoreDynamics
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
auragrid_api
|