mandala-computer 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. mandala_computer-0.1.0/.claude/linear-sync.json +9 -0
  2. mandala_computer-0.1.0/.github/workflows/ci.yml +61 -0
  3. mandala_computer-0.1.0/.github/workflows/release.yml +62 -0
  4. mandala_computer-0.1.0/.gitignore +28 -0
  5. mandala_computer-0.1.0/LICENSE +21 -0
  6. mandala_computer-0.1.0/PKG-INFO +1904 -0
  7. mandala_computer-0.1.0/README.md +1858 -0
  8. mandala_computer-0.1.0/SECURITY.md +34 -0
  9. mandala_computer-0.1.0/pyproject.toml +64 -0
  10. mandala_computer-0.1.0/scripts/check_surface.py +541 -0
  11. mandala_computer-0.1.0/scripts/smoke_events.py +281 -0
  12. mandala_computer-0.1.0/scripts/surface_text.py +178 -0
  13. mandala_computer-0.1.0/src/mandala_computer/__init__.py +279 -0
  14. mandala_computer-0.1.0/src/mandala_computer/_agent.py +248 -0
  15. mandala_computer-0.1.0/src/mandala_computer/_api.py +1573 -0
  16. mandala_computer-0.1.0/src/mandala_computer/_async_computer.py +1776 -0
  17. mandala_computer-0.1.0/src/mandala_computer/_async_resources.py +650 -0
  18. mandala_computer-0.1.0/src/mandala_computer/_cli.py +994 -0
  19. mandala_computer-0.1.0/src/mandala_computer/_client.py +1312 -0
  20. mandala_computer-0.1.0/src/mandala_computer/_computer.py +2813 -0
  21. mandala_computer-0.1.0/src/mandala_computer/_events.py +2267 -0
  22. mandala_computer-0.1.0/src/mandala_computer/_exceptions.py +749 -0
  23. mandala_computer-0.1.0/src/mandala_computer/_models.py +2365 -0
  24. mandala_computer-0.1.0/src/mandala_computer/_resources.py +1000 -0
  25. mandala_computer-0.1.0/src/mandala_computer/_sse.py +182 -0
  26. mandala_computer-0.1.0/src/mandala_computer/_webhooks.py +193 -0
  27. mandala_computer-0.1.0/src/mandala_computer/py.typed +1 -0
  28. mandala_computer-0.1.0/tests/surface_inventory.py +267 -0
  29. mandala_computer-0.1.0/tests/surface_tables.py +258 -0
  30. mandala_computer-0.1.0/tests/test_adversarial_values.py +261 -0
  31. mandala_computer-0.1.0/tests/test_agent.py +921 -0
  32. mandala_computer-0.1.0/tests/test_async_building.py +151 -0
  33. mandala_computer-0.1.0/tests/test_async_client.py +1001 -0
  34. mandala_computer-0.1.0/tests/test_building.py +249 -0
  35. mandala_computer-0.1.0/tests/test_check_surface.py +222 -0
  36. mandala_computer-0.1.0/tests/test_cli.py +1369 -0
  37. mandala_computer-0.1.0/tests/test_client.py +4238 -0
  38. mandala_computer-0.1.0/tests/test_events.py +2558 -0
  39. mandala_computer-0.1.0/tests/test_moves.py +495 -0
  40. mandala_computer-0.1.0/tests/test_parity.py +203 -0
  41. mandala_computer-0.1.0/tests/test_retention.py +85 -0
  42. mandala_computer-0.1.0/tests/test_sse.py +226 -0
  43. mandala_computer-0.1.0/tests/test_surface.py +1111 -0
  44. mandala_computer-0.1.0/tests/test_surface_inventory.py +250 -0
  45. mandala_computer-0.1.0/tests/test_templates.py +2866 -0
  46. mandala_computer-0.1.0/tests/test_usage.py +269 -0
  47. mandala_computer-0.1.0/tests/test_webhooks.py +772 -0
@@ -0,0 +1,9 @@
1
+ {
2
+ "$schema": "https://raw.githubusercontent.com/b-open-io/linear-sync/main/schema/linear-sync.json",
3
+ "_warning": "AUTO-MANAGED by linear-sync. Manual edits may break issue sync, commit hooks, and branch naming.",
4
+ "workspace": "openprotocollabs",
5
+ "project": "Mandala Computer",
6
+ "team": "OPL",
7
+ "label": "repo:mandala-computer-python",
8
+ "github_org": "mandalacomputer"
9
+ }
@@ -0,0 +1,61 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ pull_request:
7
+
8
+ concurrency:
9
+ group: ci-${{ github.ref }}
10
+ cancel-in-progress: true
11
+
12
+ jobs:
13
+ # Lint and types are version-independent: running them once keeps the matrix
14
+ # below about what actually differs between interpreters.
15
+ lint:
16
+ # Hosted runners: with the repository public, minutes are free and the
17
+ # matrix runs genuinely in parallel. A runner of our own on a public repo
18
+ # would execute any fork's pull request on our own machine.
19
+ runs-on: ubuntu-latest
20
+ steps:
21
+ - uses: actions/checkout@v4
22
+ - uses: actions/setup-python@v5
23
+ with:
24
+ python-version: "3.12"
25
+ cache: pip
26
+ - run: pip install -e ".[dev]"
27
+ - run: ruff check .
28
+ - run: ruff format --check .
29
+ - run: mypy
30
+
31
+ test:
32
+ runs-on: ubuntu-latest
33
+ strategy:
34
+ fail-fast: false
35
+ matrix:
36
+ # The floor is what pyproject claims (>=3.10); the ceiling is what
37
+ # people are actually on. A claim nobody tests is the same kind of
38
+ # unchecked mirror as the route allowlist.
39
+ python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
40
+ steps:
41
+ - uses: actions/checkout@v4
42
+ - uses: actions/setup-python@v5
43
+ with:
44
+ python-version: ${{ matrix.python-version }}
45
+ cache: pip
46
+ - run: pip install -e ".[dev]"
47
+ - run: pytest -q
48
+
49
+ build:
50
+ runs-on: ubuntu-latest
51
+ steps:
52
+ - uses: actions/checkout@v4
53
+ - uses: actions/setup-python@v5
54
+ with:
55
+ python-version: "3.12"
56
+ cache: pip
57
+ - run: pip install build twine
58
+ - run: python -m build
59
+ # Catches the metadata that only fails at upload time — a malformed
60
+ # README or a URL PyPI will not take.
61
+ - run: twine check dist/*
@@ -0,0 +1,62 @@
1
+ name: Release
2
+
3
+ # A tag `vX.Y.Z` pushed to this repository publishes X.Y.Z to PyPI. Nothing
4
+ # else does: there is no token anywhere, PyPI trusts this workflow file in this
5
+ # repository through OpenID Connect (a "trusted publisher"), and it trusts it
6
+ # only when the run carries the `pypi` environment below.
7
+ #
8
+ # The tag has to agree with pyproject.toml and __version__ before anything is
9
+ # built; a mismatch fails the run rather than publishing one version under
10
+ # another's name. Tests run again here because CI runs on branches and this
11
+ # workflow runs on tags.
12
+
13
+ on:
14
+ push:
15
+ tags: ["v[0-9]+.[0-9]+.[0-9]+*"]
16
+
17
+ permissions:
18
+ contents: read
19
+
20
+ jobs:
21
+ verify:
22
+ runs-on: ubuntu-latest
23
+ steps:
24
+ - uses: actions/checkout@v4
25
+ - uses: actions/setup-python@v5
26
+ with:
27
+ python-version: "3.12"
28
+ cache: pip
29
+ - name: Tag matches the declared version
30
+ run: |
31
+ tag="${GITHUB_REF_NAME#v}"
32
+ declared=$(python -c 'import tomllib; print(tomllib.load(open("pyproject.toml","rb"))["project"]["version"])')
33
+ dunder=$(python -c 'import re; print(re.search(r"__version__ = \"([^\"]+)\"", open("src/mandala_computer/__init__.py").read()).group(1))')
34
+ echo "tag=$tag pyproject=$declared __version__=$dunder"
35
+ [ "$tag" = "$declared" ] && [ "$tag" = "$dunder" ]
36
+ - run: pip install -e ".[dev]"
37
+ - run: ruff check .
38
+ - run: mypy
39
+ - run: pytest -q
40
+
41
+ publish:
42
+ needs: verify
43
+ runs-on: ubuntu-latest
44
+ environment:
45
+ name: pypi
46
+ url: https://pypi.org/project/mandala-computer/${{ github.ref_name }}
47
+ permissions:
48
+ id-token: write # the OIDC token PyPI exchanges for a publish
49
+ contents: write # the GitHub release below
50
+ steps:
51
+ - uses: actions/checkout@v4
52
+ - uses: actions/setup-python@v5
53
+ with:
54
+ python-version: "3.12"
55
+ - run: pip install build twine
56
+ - run: python -m build
57
+ - run: twine check dist/*
58
+ - uses: pypa/gh-action-pypi-publish@release/v1
59
+ - name: GitHub release
60
+ env:
61
+ GH_TOKEN: ${{ github.token }}
62
+ run: gh release create "$GITHUB_REF_NAME" dist/* --verify-tag --generate-notes --title "$GITHUB_REF_NAME"
@@ -0,0 +1,28 @@
1
+ __pycache__/
2
+ *.py[cod]
3
+ .venv/
4
+ venv/
5
+ build/
6
+ dist/
7
+ *.egg-info/
8
+ .pytest_cache/
9
+ .mypy_cache/
10
+ .ruff_cache/
11
+ .coverage
12
+ htmlcov/
13
+ .env
14
+ .DS_Store
15
+
16
+ # Everything under .claude/ is local — settings.local.json is per-machine — with
17
+ # one exception. linear-sync.json is repo configuration, not preference: it is
18
+ # what says this repo belongs to the OPL team and the Mandala Computer project,
19
+ # and both sibling SDKs carry theirs.
20
+ #
21
+ # `.claude/*` rather than `.claude/`, and the difference matters: git will not
22
+ # re-include a file whose parent DIRECTORY is excluded, so a negation under a
23
+ # bare `.claude/` does nothing at all and the file below stays invisible.
24
+ .claude/*
25
+ !.claude/linear-sync.json
26
+
27
+ # Reports written by the /grok-bug-hunt skill.
28
+ .grok-bug-hunt/
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Mandala Computer
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.