magmascript 1.0.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 (48) hide show
  1. magmascript-1.0.0/LICENSE +21 -0
  2. magmascript-1.0.0/PKG-INFO +140 -0
  3. magmascript-1.0.0/README.md +107 -0
  4. magmascript-1.0.0/magmascript/__init__.py +41 -0
  5. magmascript-1.0.0/magmascript/cli.py +628 -0
  6. magmascript-1.0.0/magmascript/core/__init__.py +40 -0
  7. magmascript-1.0.0/magmascript/core/cache.py +193 -0
  8. magmascript-1.0.0/magmascript/core/config.py +150 -0
  9. magmascript-1.0.0/magmascript/core/exceptions.py +59 -0
  10. magmascript-1.0.0/magmascript/core/github.py +179 -0
  11. magmascript-1.0.0/magmascript/core/output.py +136 -0
  12. magmascript-1.0.0/magmascript/core/registry.py +31 -0
  13. magmascript-1.0.0/magmascript/core/rpc.py +184 -0
  14. magmascript-1.0.0/magmascript/domains/__init__.py +10 -0
  15. magmascript-1.0.0/magmascript/domains/gh/__init__.py +15 -0
  16. magmascript-1.0.0/magmascript/domains/gh/client.py +212 -0
  17. magmascript-1.0.0/magmascript/domains/gh/tools.py +116 -0
  18. magmascript-1.0.0/magmascript/domains/mcp/__init__.py +35 -0
  19. magmascript-1.0.0/magmascript/domains/mcp/client.py +251 -0
  20. magmascript-1.0.0/magmascript/domains/mcp/tools.py +411 -0
  21. magmascript-1.0.0/magmascript/domains/media/__init__.py +21 -0
  22. magmascript-1.0.0/magmascript/domains/media/client.py +202 -0
  23. magmascript-1.0.0/magmascript/domains/media/providers/__init__.py +33 -0
  24. magmascript-1.0.0/magmascript/domains/media/providers/archive.py +89 -0
  25. magmascript-1.0.0/magmascript/domains/media/providers/met_museum.py +110 -0
  26. magmascript-1.0.0/magmascript/domains/media/providers/openverse.py +90 -0
  27. magmascript-1.0.0/magmascript/domains/media/providers/pexels.py +106 -0
  28. magmascript-1.0.0/magmascript/domains/media/providers/pixabay.py +116 -0
  29. magmascript-1.0.0/magmascript/domains/media/providers/smithsonian.py +94 -0
  30. magmascript-1.0.0/magmascript/domains/media/tools.py +53 -0
  31. magmascript-1.0.0/magmascript/domains/pi/__init__.py +19 -0
  32. magmascript-1.0.0/magmascript/domains/pi/client.py +259 -0
  33. magmascript-1.0.0/magmascript/domains/pi/tools.py +98 -0
  34. magmascript-1.0.0/magmascript/domains/scores/__init__.py +21 -0
  35. magmascript-1.0.0/magmascript/domains/scores/client.py +201 -0
  36. magmascript-1.0.0/magmascript/domains/scores/tools.py +55 -0
  37. magmascript-1.0.0/magmascript.egg-info/PKG-INFO +140 -0
  38. magmascript-1.0.0/magmascript.egg-info/SOURCES.txt +46 -0
  39. magmascript-1.0.0/magmascript.egg-info/dependency_links.txt +1 -0
  40. magmascript-1.0.0/magmascript.egg-info/entry_points.txt +2 -0
  41. magmascript-1.0.0/magmascript.egg-info/requires.txt +13 -0
  42. magmascript-1.0.0/magmascript.egg-info/top_level.txt +1 -0
  43. magmascript-1.0.0/pyproject.toml +59 -0
  44. magmascript-1.0.0/setup.cfg +4 -0
  45. magmascript-1.0.0/tests/test_cache.py +82 -0
  46. magmascript-1.0.0/tests/test_cli.py +62 -0
  47. magmascript-1.0.0/tests/test_mcp_client.py +164 -0
  48. magmascript-1.0.0/tests/test_rpc.py +157 -0
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Jake McCoy
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,140 @@
1
+ Metadata-Version: 2.4
2
+ Name: magmascript
3
+ Version: 1.0.0
4
+ Summary: Scripting toolkit with domain-first subcommands
5
+ Author: Jake McCoy
6
+ License-Expression: MIT
7
+ Project-URL: Homepage, https://github.com/magmacrunchmedia/magmascript
8
+ Project-URL: Repository, https://github.com/magmacrunchmedia/magmascript
9
+ Keywords: mcp,scripting,cli,magmacrunch
10
+ Classifier: Development Status :: 3 - Alpha
11
+ Classifier: Environment :: Console
12
+ Classifier: Intended Audience :: Developers
13
+ Classifier: Programming Language :: Python :: 3
14
+ Classifier: Programming Language :: Python :: 3.11
15
+ Classifier: Programming Language :: Python :: 3.12
16
+ Classifier: Programming Language :: Python :: 3.13
17
+ Classifier: Programming Language :: Python :: 3.14
18
+ Classifier: Topic :: Software Development :: Libraries
19
+ Requires-Python: >=3.11
20
+ Description-Content-Type: text/markdown
21
+ License-File: LICENSE
22
+ Requires-Dist: httpx>=0.27
23
+ Provides-Extra: cli
24
+ Requires-Dist: rich>=13.0; extra == "cli"
25
+ Provides-Extra: dev
26
+ Requires-Dist: pytest>=7.0; extra == "dev"
27
+ Requires-Dist: pytest-cov>=4.0; extra == "dev"
28
+ Requires-Dist: build>=0.10; extra == "dev"
29
+ Requires-Dist: twine>=4.0; extra == "dev"
30
+ Provides-Extra: all
31
+ Requires-Dist: magmascript[cli,dev]; extra == "all"
32
+ Dynamic: license-file
33
+
34
+ # magmascript
35
+
36
+ Scripting toolkit with domain-first subcommands for managing magmacrunch.com infrastructure.
37
+
38
+ ## Install
39
+
40
+ ```bash
41
+ git clone https://github.com/magmacrunchmedia/magmascript.git
42
+ cd magmascript
43
+ python3 -m venv .venv
44
+ .venv/bin/pip install -e ".[all]"
45
+ ```
46
+
47
+ ## Configure
48
+
49
+ ```bash
50
+ export MAGMA_API_KEY="your-mcp-key"
51
+ export GITHUB_TOKEN=$(gh auth token)
52
+ # pi domain works with no config (SSH key auth)
53
+ ```
54
+
55
+ Or use `~/.config/magmascript/config.toml`:
56
+
57
+ ```toml
58
+ [mcp]
59
+ url = "https://magmacrunch.duckdns.org/mcp"
60
+ api_key = "your-key"
61
+
62
+ [pi]
63
+ host = "192.168.1.16"
64
+ user = "jake"
65
+
66
+ [gh]
67
+ token = "ghp_..."
68
+ owner = "magmacrunchmedia"
69
+ repo = "magmacrunch.com"
70
+ ```
71
+
72
+ ## Usage
73
+
74
+ ### MCP Domain — MusicBrainz, scores, Discogs
75
+ ```bash
76
+ magmascript mcp scoreboards # game leaderboards
77
+ magmascript mcp scores tetris # tetris scores
78
+ magmascript mcp search "radiohead" # search MusicBrainz
79
+ magmascript mcp entities # all cached entities
80
+ magmascript mcp games # arcade games
81
+ ```
82
+
83
+ ### Pi Domain — Direct SSH to Raspberry Pi
84
+ ```bash
85
+ magmascript pi status # all service statuses
86
+ magmascript pi logs arcade-chat # service logs
87
+ magmascript pi restart arcade-chat # restart service
88
+ magmascript pi info # uptime, memory, temp
89
+ magmascript pi deploy arcade/chat-server.py # deploy files
90
+ ```
91
+
92
+ ### GitHub Domain — Direct API access
93
+ ```bash
94
+ magmascript gh workflows # all workflow statuses
95
+ magmascript gh trigger "Deploy to Pi" # trigger workflow
96
+ magmascript gh issues # list issues
97
+ magmascript gh file path/to/file.txt # read file
98
+ ```
99
+
100
+ ## Python Library
101
+
102
+ ```python
103
+ from magmascript import MCPClient, PIClient, GHClient
104
+
105
+ # MCP
106
+ with MCPClient() as mcp:
107
+ boards = mcp.scoreboards()
108
+
109
+ # Pi (direct SSH)
110
+ with PIClient() as pi:
111
+ status = pi.services()
112
+
113
+ # GitHub (direct API)
114
+ with GHClient() as gh:
115
+ workflows = gh.workflows()
116
+ ```
117
+
118
+ ## Shell Helpers
119
+
120
+ ```bash
121
+ source lib/magmascript.sh
122
+
123
+ mcp_scoreboards # MCP commands
124
+ pi_status # Pi commands
125
+ gh_workflows # GitHub commands
126
+ ```
127
+
128
+ ## Documentation
129
+
130
+ Full documentation on the [Wiki](https://github.com/magmacrunchmedia/magmascript/wiki):
131
+ - [Configuration](https://github.com/magmacrunchmedia/magmascript/wiki/Configuration)
132
+ - [MCP Domain](https://github.com/magmacrunchmedia/magmascript/wiki/MCP-Domain)
133
+ - [Pi Domain](https://github.com/magmacrunchmedia/magmascript/wiki/Pi-Domain)
134
+ - [GitHub Domain](https://github.com/magmacrunchmedia/magmascript/wiki/GitHub-Domain)
135
+ - [Architecture](https://github.com/magmacrunchmedia/magmascript/wiki/Architecture)
136
+ - [Shell Helpers](https://github.com/magmacrunchmedia/magmascript/wiki/Shell-Helpers)
137
+
138
+ ## License
139
+
140
+ MIT
@@ -0,0 +1,107 @@
1
+ # magmascript
2
+
3
+ Scripting toolkit with domain-first subcommands for managing magmacrunch.com infrastructure.
4
+
5
+ ## Install
6
+
7
+ ```bash
8
+ git clone https://github.com/magmacrunchmedia/magmascript.git
9
+ cd magmascript
10
+ python3 -m venv .venv
11
+ .venv/bin/pip install -e ".[all]"
12
+ ```
13
+
14
+ ## Configure
15
+
16
+ ```bash
17
+ export MAGMA_API_KEY="your-mcp-key"
18
+ export GITHUB_TOKEN=$(gh auth token)
19
+ # pi domain works with no config (SSH key auth)
20
+ ```
21
+
22
+ Or use `~/.config/magmascript/config.toml`:
23
+
24
+ ```toml
25
+ [mcp]
26
+ url = "https://magmacrunch.duckdns.org/mcp"
27
+ api_key = "your-key"
28
+
29
+ [pi]
30
+ host = "192.168.1.16"
31
+ user = "jake"
32
+
33
+ [gh]
34
+ token = "ghp_..."
35
+ owner = "magmacrunchmedia"
36
+ repo = "magmacrunch.com"
37
+ ```
38
+
39
+ ## Usage
40
+
41
+ ### MCP Domain — MusicBrainz, scores, Discogs
42
+ ```bash
43
+ magmascript mcp scoreboards # game leaderboards
44
+ magmascript mcp scores tetris # tetris scores
45
+ magmascript mcp search "radiohead" # search MusicBrainz
46
+ magmascript mcp entities # all cached entities
47
+ magmascript mcp games # arcade games
48
+ ```
49
+
50
+ ### Pi Domain — Direct SSH to Raspberry Pi
51
+ ```bash
52
+ magmascript pi status # all service statuses
53
+ magmascript pi logs arcade-chat # service logs
54
+ magmascript pi restart arcade-chat # restart service
55
+ magmascript pi info # uptime, memory, temp
56
+ magmascript pi deploy arcade/chat-server.py # deploy files
57
+ ```
58
+
59
+ ### GitHub Domain — Direct API access
60
+ ```bash
61
+ magmascript gh workflows # all workflow statuses
62
+ magmascript gh trigger "Deploy to Pi" # trigger workflow
63
+ magmascript gh issues # list issues
64
+ magmascript gh file path/to/file.txt # read file
65
+ ```
66
+
67
+ ## Python Library
68
+
69
+ ```python
70
+ from magmascript import MCPClient, PIClient, GHClient
71
+
72
+ # MCP
73
+ with MCPClient() as mcp:
74
+ boards = mcp.scoreboards()
75
+
76
+ # Pi (direct SSH)
77
+ with PIClient() as pi:
78
+ status = pi.services()
79
+
80
+ # GitHub (direct API)
81
+ with GHClient() as gh:
82
+ workflows = gh.workflows()
83
+ ```
84
+
85
+ ## Shell Helpers
86
+
87
+ ```bash
88
+ source lib/magmascript.sh
89
+
90
+ mcp_scoreboards # MCP commands
91
+ pi_status # Pi commands
92
+ gh_workflows # GitHub commands
93
+ ```
94
+
95
+ ## Documentation
96
+
97
+ Full documentation on the [Wiki](https://github.com/magmacrunchmedia/magmascript/wiki):
98
+ - [Configuration](https://github.com/magmacrunchmedia/magmascript/wiki/Configuration)
99
+ - [MCP Domain](https://github.com/magmacrunchmedia/magmascript/wiki/MCP-Domain)
100
+ - [Pi Domain](https://github.com/magmacrunchmedia/magmascript/wiki/Pi-Domain)
101
+ - [GitHub Domain](https://github.com/magmacrunchmedia/magmascript/wiki/GitHub-Domain)
102
+ - [Architecture](https://github.com/magmacrunchmedia/magmascript/wiki/Architecture)
103
+ - [Shell Helpers](https://github.com/magmacrunchmedia/magmascript/wiki/Shell-Helpers)
104
+
105
+ ## License
106
+
107
+ MIT
@@ -0,0 +1,41 @@
1
+ """magmascript — a scripting toolkit with domain-first subcommands."""
2
+
3
+ __version__ = "1.0.0"
4
+
5
+ from magmascript.core.config import Config, GHConfig, MediaConfig, PIConfig, get_config, load_config, set_config
6
+ from magmascript.core.registry import get_domain, list_domains, register_domain
7
+ from magmascript.core.rpc import RPCClient, RPCError, RPCResponse
8
+ from magmascript.core.output import format_output, format_table, format_json
9
+
10
+ # Import domains to trigger registration
11
+ from magmascript import domains # noqa: F401
12
+
13
+ # Convenience: expose clients at top level
14
+ from magmascript.domains.mcp import MCPClient
15
+ from magmascript.domains.pi import PIClient
16
+ from magmascript.domains.gh import GHClient
17
+ from magmascript.domains.media import MediaClient
18
+
19
+ __all__ = [
20
+ "__version__",
21
+ "Config",
22
+ "GHClient",
23
+ "GHConfig",
24
+ "MCPClient",
25
+ "MediaClient",
26
+ "MediaConfig",
27
+ "PIClient",
28
+ "PIConfig",
29
+ "RPCClient",
30
+ "RPCError",
31
+ "RPCResponse",
32
+ "format_output",
33
+ "format_json",
34
+ "format_table",
35
+ "get_config",
36
+ "get_domain",
37
+ "list_domains",
38
+ "load_config",
39
+ "register_domain",
40
+ "set_config",
41
+ ]