magmascript 3.2.4__tar.gz → 4.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.
- {magmascript-3.2.4 → magmascript-4.0.0}/PKG-INFO +49 -52
- {magmascript-3.2.4 → magmascript-4.0.0}/README.md +47 -48
- {magmascript-3.2.4 → magmascript-4.0.0}/magmascript/__init__.py +1 -1
- {magmascript-3.2.4 → magmascript-4.0.0}/magmascript/cli.py +9 -27
- {magmascript-3.2.4 → magmascript-4.0.0}/magmascript/core/commands.py +8 -35
- {magmascript-3.2.4 → magmascript-4.0.0}/magmascript/core/config.py +1 -1
- {magmascript-3.2.4 → magmascript-4.0.0}/magmascript/core/github.py +1 -2
- {magmascript-3.2.4 → magmascript-4.0.0}/magmascript/core/registry.py +1 -1
- {magmascript-3.2.4 → magmascript-4.0.0}/magmascript/core/rpc.py +2 -2
- {magmascript-3.2.4 → magmascript-4.0.0}/magmascript/core/runner.py +1 -1
- {magmascript-3.2.4 → magmascript-4.0.0}/magmascript/domains/__init__.py +1 -1
- {magmascript-3.2.4 → magmascript-4.0.0}/magmascript/domains/archive/__init__.py +1 -1
- {magmascript-3.2.4 → magmascript-4.0.0}/magmascript/domains/archive/client.py +3 -130
- {magmascript-3.2.4 → magmascript-4.0.0}/magmascript/domains/gh/__init__.py +1 -1
- {magmascript-3.2.4 → magmascript-4.0.0}/magmascript/domains/gh/client.py +2 -2
- {magmascript-3.2.4 → magmascript-4.0.0}/magmascript/domains/lastfm/__init__.py +1 -1
- {magmascript-3.2.4 → magmascript-4.0.0}/magmascript/domains/lastfm/client.py +1 -1
- {magmascript-3.2.4 → magmascript-4.0.0}/magmascript/domains/mac/__init__.py +1 -1
- {magmascript-3.2.4 → magmascript-4.0.0}/magmascript/domains/mac/client.py +3 -3
- {magmascript-3.2.4 → magmascript-4.0.0}/magmascript/domains/mb/__init__.py +1 -1
- {magmascript-3.2.4 → magmascript-4.0.0}/magmascript/domains/mb/client.py +7 -7
- {magmascript-3.2.4 → magmascript-4.0.0}/magmascript/domains/mc1/__init__.py +1 -1
- {magmascript-3.2.4 → magmascript-4.0.0}/magmascript/domains/mc1/client.py +104 -15
- {magmascript-3.2.4 → magmascript-4.0.0}/magmascript/domains/mcp/__init__.py +1 -1
- {magmascript-3.2.4 → magmascript-4.0.0}/magmascript/domains/mcp/client.py +3 -3
- {magmascript-3.2.4 → magmascript-4.0.0}/magmascript/domains/media/__init__.py +1 -1
- {magmascript-3.2.4 → magmascript-4.0.0}/magmascript/domains/media/client.py +2 -2
- {magmascript-3.2.4 → magmascript-4.0.0}/magmascript/domains/pi/__init__.py +1 -1
- {magmascript-3.2.4 → magmascript-4.0.0}/magmascript/domains/pi/client.py +1 -1
- {magmascript-3.2.4 → magmascript-4.0.0}/magmascript/domains/rights/__init__.py +1 -1
- {magmascript-3.2.4 → magmascript-4.0.0}/magmascript/domains/rights/client.py +1 -1
- {magmascript-3.2.4 → magmascript-4.0.0}/magmascript/domains/scores/__init__.py +1 -1
- {magmascript-3.2.4 → magmascript-4.0.0}/magmascript/domains/search/__init__.py +1 -1
- {magmascript-3.2.4 → magmascript-4.0.0}/magmascript/domains/search/client.py +5 -5
- {magmascript-3.2.4 → magmascript-4.0.0}/magmascript/lang/domain_bridge.py +1 -1
- {magmascript-3.2.4 → magmascript-4.0.0}/magmascript/lang/interpreter.py +5 -5
- {magmascript-3.2.4 → magmascript-4.0.0}/magmascript/lang/lexer.py +1 -1
- {magmascript-3.2.4 → magmascript-4.0.0}/magmascript/lang/parser.py +1 -1
- {magmascript-3.2.4 → magmascript-4.0.0}/magmascript/repl.py +1 -1
- {magmascript-3.2.4 → magmascript-4.0.0}/magmascript.egg-info/PKG-INFO +49 -52
- {magmascript-3.2.4 → magmascript-4.0.0}/pyproject.toml +14 -4
- {magmascript-3.2.4 → magmascript-4.0.0}/tests/test_cli_regressions.py +1 -1
- {magmascript-3.2.4 → magmascript-4.0.0}/tests/test_commands.py +5 -18
- {magmascript-3.2.4 → magmascript-4.0.0}/tests/test_mc1.py +122 -0
- {magmascript-3.2.4 → magmascript-4.0.0}/LICENSE +0 -0
- {magmascript-3.2.4 → magmascript-4.0.0}/magmascript/codegen/__init__.py +0 -0
- {magmascript-3.2.4 → magmascript-4.0.0}/magmascript/codegen/c.py +0 -0
- {magmascript-3.2.4 → magmascript-4.0.0}/magmascript/core/__init__.py +0 -0
- {magmascript-3.2.4 → magmascript-4.0.0}/magmascript/core/cache.py +0 -0
- {magmascript-3.2.4 → magmascript-4.0.0}/magmascript/core/command_registry.py +0 -0
- {magmascript-3.2.4 → magmascript-4.0.0}/magmascript/core/exceptions.py +0 -0
- {magmascript-3.2.4 → magmascript-4.0.0}/magmascript/core/output.py +0 -0
- {magmascript-3.2.4 → magmascript-4.0.0}/magmascript/domains/gh/tools.py +0 -0
- {magmascript-3.2.4 → magmascript-4.0.0}/magmascript/domains/mac/tools.py +0 -0
- {magmascript-3.2.4 → magmascript-4.0.0}/magmascript/domains/mc1/tools.py +0 -0
- {magmascript-3.2.4 → magmascript-4.0.0}/magmascript/domains/mcp/tools.py +0 -0
- {magmascript-3.2.4 → magmascript-4.0.0}/magmascript/domains/media/providers/__init__.py +0 -0
- {magmascript-3.2.4 → magmascript-4.0.0}/magmascript/domains/media/providers/archive.py +0 -0
- {magmascript-3.2.4 → magmascript-4.0.0}/magmascript/domains/media/providers/met_museum.py +0 -0
- {magmascript-3.2.4 → magmascript-4.0.0}/magmascript/domains/media/providers/openverse.py +0 -0
- {magmascript-3.2.4 → magmascript-4.0.0}/magmascript/domains/media/providers/pexels.py +0 -0
- {magmascript-3.2.4 → magmascript-4.0.0}/magmascript/domains/media/providers/pixabay.py +0 -0
- {magmascript-3.2.4 → magmascript-4.0.0}/magmascript/domains/media/providers/smithsonian.py +0 -0
- {magmascript-3.2.4 → magmascript-4.0.0}/magmascript/domains/media/tools.py +0 -0
- {magmascript-3.2.4 → magmascript-4.0.0}/magmascript/domains/pi/tools.py +0 -0
- {magmascript-3.2.4 → magmascript-4.0.0}/magmascript/domains/rights/tools.py +0 -0
- {magmascript-3.2.4 → magmascript-4.0.0}/magmascript/domains/scores/client.py +0 -0
- {magmascript-3.2.4 → magmascript-4.0.0}/magmascript/domains/scores/tools.py +0 -0
- {magmascript-3.2.4 → magmascript-4.0.0}/magmascript/lang/__init__.py +0 -0
- {magmascript-3.2.4 → magmascript-4.0.0}/magmascript/lang/ast_nodes.py +0 -0
- {magmascript-3.2.4 → magmascript-4.0.0}/magmascript/lang/astheno/__init__.py +0 -0
- {magmascript-3.2.4 → magmascript-4.0.0}/magmascript/lang/astheno/arena.py +0 -0
- {magmascript-3.2.4 → magmascript-4.0.0}/magmascript/lang/astheno/dump.py +0 -0
- {magmascript-3.2.4 → magmascript-4.0.0}/magmascript/lang/astheno/floorplan.py +0 -0
- {magmascript-3.2.4 → magmascript-4.0.0}/magmascript/lang/astheno/numeric.py +0 -0
- {magmascript-3.2.4 → magmascript-4.0.0}/magmascript/lang/builtins.py +0 -0
- {magmascript-3.2.4 → magmascript-4.0.0}/magmascript/lang/environment.py +0 -0
- {magmascript-3.2.4 → magmascript-4.0.0}/magmascript/lang/hypnagogia.py +0 -0
- {magmascript-3.2.4 → magmascript-4.0.0}/magmascript/lang/pretty.py +0 -0
- {magmascript-3.2.4 → magmascript-4.0.0}/magmascript/lang/pygments_mgs.py +0 -0
- {magmascript-3.2.4 → magmascript-4.0.0}/magmascript/lang/tokens.py +0 -0
- {magmascript-3.2.4 → magmascript-4.0.0}/magmascript/lang/util.py +0 -0
- {magmascript-3.2.4 → magmascript-4.0.0}/magmascript/lang/visitor.py +0 -0
- {magmascript-3.2.4 → magmascript-4.0.0}/magmascript/scaffold/__init__.py +0 -0
- {magmascript-3.2.4 → magmascript-4.0.0}/magmascript.egg-info/SOURCES.txt +0 -0
- {magmascript-3.2.4 → magmascript-4.0.0}/magmascript.egg-info/dependency_links.txt +0 -0
- {magmascript-3.2.4 → magmascript-4.0.0}/magmascript.egg-info/entry_points.txt +0 -0
- {magmascript-3.2.4 → magmascript-4.0.0}/magmascript.egg-info/requires.txt +0 -0
- {magmascript-3.2.4 → magmascript-4.0.0}/magmascript.egg-info/top_level.txt +0 -0
- {magmascript-3.2.4 → magmascript-4.0.0}/setup.cfg +0 -0
- {magmascript-3.2.4 → magmascript-4.0.0}/tests/test_astheno.py +0 -0
- {magmascript-3.2.4 → magmascript-4.0.0}/tests/test_cache.py +0 -0
- {magmascript-3.2.4 → magmascript-4.0.0}/tests/test_classes.py +0 -0
- {magmascript-3.2.4 → magmascript-4.0.0}/tests/test_cli.py +0 -0
- {magmascript-3.2.4 → magmascript-4.0.0}/tests/test_domain_bridge.py +0 -0
- {magmascript-3.2.4 → magmascript-4.0.0}/tests/test_import.py +0 -0
- {magmascript-3.2.4 → magmascript-4.0.0}/tests/test_lang.py +0 -0
- {magmascript-3.2.4 → magmascript-4.0.0}/tests/test_mac.py +0 -0
- {magmascript-3.2.4 → magmascript-4.0.0}/tests/test_mcp_client.py +0 -0
- {magmascript-3.2.4 → magmascript-4.0.0}/tests/test_rpc.py +0 -0
- {magmascript-3.2.4 → magmascript-4.0.0}/tests/test_try_catch.py +0 -0
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: magmascript
|
|
3
|
-
Version:
|
|
3
|
+
Version: 4.0.0
|
|
4
4
|
Summary: Scripting toolkit with domain-first subcommands
|
|
5
5
|
Author: Jake McCoy
|
|
6
6
|
License-Expression: MIT
|
|
7
7
|
Project-URL: Homepage, https://magmacrunch.com/ware/magmascript/
|
|
8
|
-
Project-URL: Documentation, https://
|
|
9
|
-
Project-URL: Repository, https://github.com/magmacrunch-media/magmascript
|
|
10
|
-
Project-URL: Changelog, https://github.com/magmacrunch-media/magmascript/blob/main/CHANGELOG.md
|
|
8
|
+
Project-URL: Documentation, https://magmacrunch.com/ware/magmascript/
|
|
11
9
|
Project-URL: Funding, https://github.com/sponsors/magmacrunch-media
|
|
12
10
|
Keywords: mcp,scripting,cli,magmacrunch
|
|
13
11
|
Classifier: Development Status :: 3 - Alpha
|
|
@@ -216,11 +214,11 @@ throw fire toad("something went wrong")
|
|
|
216
214
|
```
|
|
217
215
|
|
|
218
216
|
MagmaCrunch error vocabulary:
|
|
219
|
-
- `haunter
|
|
220
|
-
- `fire toad
|
|
221
|
-
- `devastate
|
|
222
|
-
- `contemplate
|
|
223
|
-
- `spooked
|
|
217
|
+
- `haunter`: syntax/parse errors
|
|
218
|
+
- `fire toad`: runtime errors
|
|
219
|
+
- `devastate`: undefined variable errors
|
|
220
|
+
- `contemplate`: type errors
|
|
221
|
+
- `spooked`: warnings (non-fatal, prints to stderr)
|
|
224
222
|
|
|
225
223
|
```magmascript
|
|
226
224
|
spooked("this is a warning")
|
|
@@ -370,13 +368,13 @@ See `scripts/examples/` for working examples:
|
|
|
370
368
|
| `astheno-packing.mgs` | The same struct fields, two orderings, two sizes |
|
|
371
369
|
| `astheno-faults.mgs` | Every memory fault, caught and named |
|
|
372
370
|
|
|
373
|
-
### The Asthenosphere
|
|
371
|
+
### The Asthenosphere: explicit memory
|
|
374
372
|
|
|
375
373
|
The layer beneath the lithosphere. A second tier where you manage memory
|
|
376
374
|
yourself: a real byte arena, pointers, structs with visible padding, and
|
|
377
375
|
integers that wrap like C's.
|
|
378
376
|
|
|
379
|
-
It is not faster than the dynamic tier
|
|
377
|
+
It is not faster than the dynamic tier: an `i32` add still costs a Python
|
|
380
378
|
dispatch. What it gives you instead is the thing C cannot: the interpreter sees
|
|
381
379
|
every memory operation, so it catches the use-after-free, names the line that
|
|
382
380
|
leaked, and hex-dumps a struct with its fields labelled. **C's behavior, but
|
|
@@ -399,7 +397,7 @@ scorch(p) // release it
|
|
|
399
397
|
```
|
|
400
398
|
|
|
401
399
|
Widths are `i8 i16 i32 i64 u8 u16 u32 u64 f32 f64`. There is no integer
|
|
402
|
-
promotion
|
|
400
|
+
promotion, `i32 + u8` is an error pointing you at `osmosis()`, and `/`
|
|
403
401
|
truncates toward zero on integer widths, as C does.
|
|
404
402
|
|
|
405
403
|
Mistakes are reported, not swallowed:
|
|
@@ -421,7 +419,7 @@ this ground was scorched at line 3 (garrisoned at line 1)
|
|
|
421
419
|
|
|
422
420
|
`floorplan` is the only new reserved word; everything else is a shadowable
|
|
423
421
|
builtin, so existing scripts are unaffected. Full reference on the
|
|
424
|
-
[Asthenosphere wiki page](
|
|
422
|
+
[Asthenosphere wiki page](wiki/Asthenosphere.md).
|
|
425
423
|
|
|
426
424
|
### REPL
|
|
427
425
|
|
|
@@ -451,7 +449,7 @@ magmascript repl
|
|
|
451
449
|
|
|
452
450
|
## Domains
|
|
453
451
|
|
|
454
|
-
### MCP Domain
|
|
452
|
+
### MCP Domain: MusicBrainz, scores, Discogs, write operations
|
|
455
453
|
```bash
|
|
456
454
|
magmascript mcp scoreboards # game leaderboards
|
|
457
455
|
magmascript mcp scores tetris # tetris scores
|
|
@@ -463,7 +461,7 @@ magmascript mcp mb-release <mbid> # get release details
|
|
|
463
461
|
magmascript mcp mb-recording <mbid> # get recording details
|
|
464
462
|
```
|
|
465
463
|
|
|
466
|
-
### Pi Domain
|
|
464
|
+
### Pi Domain: Direct SSH to Raspberry Pi
|
|
467
465
|
```bash
|
|
468
466
|
magmascript pi status # all service statuses
|
|
469
467
|
magmascript pi logs arcade-chat # service logs
|
|
@@ -474,7 +472,7 @@ magmascript pi backup musicbrainz # backup + commit to GitHub
|
|
|
474
472
|
magmascript pi traffic # nginx traffic analysis
|
|
475
473
|
```
|
|
476
474
|
|
|
477
|
-
### MC1 Domain
|
|
475
|
+
### MC1 Domain: Windows PC management (via SSH)
|
|
478
476
|
```magmascript
|
|
479
477
|
// In a .mgs script
|
|
480
478
|
info = mc1.info()
|
|
@@ -493,15 +491,15 @@ Also on the CLI: `magmascript mc1 status`, `mc1 info`, `mc1 processes`,
|
|
|
493
491
|
`mc1 restart <service>`, `mc1 power`, `mc1 set-power-mode <always-on|sleep>`,
|
|
494
492
|
`mc1 wake <mac>`, `mc1 reboot`.
|
|
495
493
|
|
|
496
|
-
> **Note:** MC1 commands connect over SSH. Don't run them on MC1 itself
|
|
494
|
+
> **Note:** MC1 commands connect over SSH. Don't run them on MC1 itself: they
|
|
497
495
|
> will try to SSH into the configured host, which on MC1 means connecting to
|
|
498
496
|
> itself and hanging. Use these from your Mac, Pi, or any other machine.
|
|
499
497
|
|
|
500
|
-
### Mac Domain
|
|
498
|
+
### Mac Domain: Mac management (via SSH)
|
|
501
499
|
```magmascript
|
|
502
500
|
// In a .mgs script, or: magmascript mac info
|
|
503
501
|
info = mac.info()
|
|
504
|
-
print(f"{info.hostname}
|
|
502
|
+
print(f"{info.hostname}, {info.os_version}")
|
|
505
503
|
print(f"{info.cpu_name} ({info.cpu_cores} cores), {info.memory}")
|
|
506
504
|
|
|
507
505
|
// Keep a checkout in sync
|
|
@@ -512,7 +510,7 @@ mac.git_pull()
|
|
|
512
510
|
Also on the CLI: `magmascript mac info`, `mac processes`, `mac git-status`,
|
|
513
511
|
`mac git-pull`, `mac run "<cmd>"`.
|
|
514
512
|
|
|
515
|
-
### GitHub Domain
|
|
513
|
+
### GitHub Domain: Direct API access
|
|
516
514
|
```bash
|
|
517
515
|
magmascript gh workflows # all workflow statuses
|
|
518
516
|
magmascript gh trigger "Deploy to Pi" # trigger workflow
|
|
@@ -521,7 +519,7 @@ magmascript gh file path/to/file.txt # read file
|
|
|
521
519
|
magmascript gh sync # diff + commit all data files
|
|
522
520
|
```
|
|
523
521
|
|
|
524
|
-
### Scores Domain
|
|
522
|
+
### Scores Domain: Game high scores
|
|
525
523
|
```bash
|
|
526
524
|
magmascript scores list # all game leaderboards
|
|
527
525
|
magmascript scores get tetris # tetris scores
|
|
@@ -530,57 +528,56 @@ magmascript scores report --discord # Discord JSON payload
|
|
|
530
528
|
magmascript scores reset tetris # reset one game (backup created)
|
|
531
529
|
```
|
|
532
530
|
|
|
533
|
-
### Archive Domain
|
|
531
|
+
### Archive Domain: Archive page operations
|
|
534
532
|
```bash
|
|
535
533
|
magmascript archive check-format # validate HTML formatting
|
|
536
|
-
magmascript archive bake-cache # inline MusicBrainz cache into pages
|
|
537
534
|
magmascript archive generate-stubs # generate stub HTML for new entities
|
|
538
535
|
```
|
|
539
536
|
|
|
540
|
-
### MusicBrainz Domain
|
|
537
|
+
### MusicBrainz Domain: MusicBrainz API client
|
|
541
538
|
```bash
|
|
542
539
|
magmascript mb backup # full MusicBrainz backup
|
|
543
540
|
magmascript mb backup --dry-run # preview backup
|
|
544
541
|
magmascript mb backup --stale-only # only refresh stale caches
|
|
545
542
|
```
|
|
546
543
|
|
|
547
|
-
### Last.fm Domain
|
|
544
|
+
### Last.fm Domain: Last.fm API client
|
|
548
545
|
```bash
|
|
549
546
|
magmascript lastfm fetch # fetch play counts
|
|
550
547
|
magmascript lastfm fetch --skip-existing # skip cached artists
|
|
551
548
|
```
|
|
552
549
|
|
|
553
|
-
### Search Domain
|
|
550
|
+
### Search Domain: Site search index builder
|
|
554
551
|
```bash
|
|
555
552
|
magmascript search build-index # build search-index.json
|
|
556
553
|
magmascript search preview 10 # preview first 10 entries
|
|
557
554
|
```
|
|
558
555
|
|
|
559
|
-
### Rights Domain
|
|
556
|
+
### Rights Domain: Music rights metadata (ISRC, ISWC, ASCAP)
|
|
560
557
|
```bash
|
|
561
558
|
magmascript rights search "Farewell" # search by title, ISRC, ISWC, or ASCAP ID
|
|
562
559
|
magmascript rights catalog "C.P. Rutledge" # full rights catalog for an artist
|
|
563
560
|
magmascript rights export # TSV export for ASCAP forms
|
|
564
561
|
```
|
|
565
562
|
|
|
566
|
-
### Media Domain
|
|
563
|
+
### Media Domain: Multi-provider media search
|
|
567
564
|
```bash
|
|
568
565
|
magmascript media search "sunset" # search all providers
|
|
569
566
|
magmascript media providers # list available providers
|
|
570
567
|
```
|
|
571
568
|
|
|
572
|
-
### Cache Domain
|
|
569
|
+
### Cache Domain: Cache management
|
|
573
570
|
```bash
|
|
574
571
|
magmascript cache stats # show cache statistics
|
|
575
572
|
magmascript cache clear # clear all cache
|
|
576
573
|
```
|
|
577
574
|
|
|
578
|
-
### Magma
|
|
575
|
+
### Magma: System status dashboard
|
|
579
576
|
```bash
|
|
580
577
|
magmascript magma # version, domains, cache stats
|
|
581
578
|
```
|
|
582
579
|
|
|
583
|
-
### Crunch
|
|
580
|
+
### Crunch: Batch pipeline
|
|
584
581
|
```bash
|
|
585
582
|
magmascript crunch mb # MusicBrainz backup
|
|
586
583
|
magmascript crunch lastfm # Last.fm fetch
|
|
@@ -591,7 +588,7 @@ magmascript crunch gh # GitHub sync
|
|
|
591
588
|
magmascript crunch all # Run all targets
|
|
592
589
|
```
|
|
593
590
|
|
|
594
|
-
### Texas
|
|
591
|
+
### Texas: Full/heavy operation (same targets, no shortcuts)
|
|
595
592
|
```bash
|
|
596
593
|
magmascript texas mb # Full MusicBrainz backup
|
|
597
594
|
magmascript texas lastfm # Full Last.fm fetch
|
|
@@ -602,7 +599,7 @@ magmascript texas gh # Full GitHub sync
|
|
|
602
599
|
magmascript texas all # Full heavy run
|
|
603
600
|
```
|
|
604
601
|
|
|
605
|
-
### Toast
|
|
602
|
+
### Toast: Burn/clear caches
|
|
606
603
|
```bash
|
|
607
604
|
magmascript toast cache # Clear general cache
|
|
608
605
|
magmascript toast mb-cache # Clear MusicBrainz cache
|
|
@@ -639,7 +636,7 @@ g = tt.game({"title": "hello", "width": 400, "height": 300})
|
|
|
639
636
|
|
|
640
637
|
A package may register the same class under several names this way; nothing
|
|
641
638
|
stops it, and the clients stay independent. Note that none of this touches the
|
|
642
|
-
`magmascript toast` CLI verb, which still clears caches
|
|
639
|
+
`magmascript toast` CLI verb, which still clears caches, registry domains are
|
|
643
640
|
not dispatched as subcommands.
|
|
644
641
|
|
|
645
642
|
## Python Library
|
|
@@ -678,24 +675,24 @@ gh_workflows # GitHub commands
|
|
|
678
675
|
|
|
679
676
|
## Documentation
|
|
680
677
|
|
|
681
|
-
Full documentation on the [Wiki](
|
|
682
|
-
- [MagmaScript Language](
|
|
683
|
-
- [Configuration](
|
|
684
|
-
- [MCP Domain](
|
|
685
|
-
- [Pi Domain](
|
|
686
|
-
- [MC1 Domain](
|
|
687
|
-
- [Mac Domain](
|
|
688
|
-
- [GitHub Domain](
|
|
689
|
-
- [Scores Domain](
|
|
690
|
-
- [Rights Domain](
|
|
691
|
-
- [Archive Domain](
|
|
692
|
-
- [Last.fm Domain](
|
|
693
|
-
- [MusicBrainz Domain](
|
|
694
|
-
- [Search Domain](
|
|
695
|
-
- [Media Domain](
|
|
696
|
-
- [Example Scripts](
|
|
697
|
-
- [Asthenosphere](
|
|
698
|
-
- [Architecture](
|
|
678
|
+
Full documentation on the [Wiki](wiki/):
|
|
679
|
+
- [MagmaScript Language](wiki/MagmaScript-Language.md)
|
|
680
|
+
- [Configuration](wiki/Configuration.md)
|
|
681
|
+
- [MCP Domain](wiki/MCP-Domain.md)
|
|
682
|
+
- [Pi Domain](wiki/Pi-Domain.md)
|
|
683
|
+
- [MC1 Domain](wiki/MC1-Domain.md)
|
|
684
|
+
- [Mac Domain](wiki/Mac-Domain.md)
|
|
685
|
+
- [GitHub Domain](wiki/GitHub-Domain.md)
|
|
686
|
+
- [Scores Domain](wiki/Scores-Domain.md)
|
|
687
|
+
- [Rights Domain](wiki/Rights-Domain.md)
|
|
688
|
+
- [Archive Domain](wiki/Archive-Domain.md)
|
|
689
|
+
- [Last.fm Domain](wiki/Last.fm-Domain.md)
|
|
690
|
+
- [MusicBrainz Domain](wiki/MusicBrainz-Domain.md)
|
|
691
|
+
- [Search Domain](wiki/Search-Domain.md)
|
|
692
|
+
- [Media Domain](wiki/Media-Domain.md)
|
|
693
|
+
- [Example Scripts](wiki/Example-Scripts.md)
|
|
694
|
+
- [Asthenosphere](wiki/Asthenosphere.md)
|
|
695
|
+
- [Architecture](wiki/Architecture.md)
|
|
699
696
|
|
|
700
697
|
## Support This Project
|
|
701
698
|
|
|
@@ -178,11 +178,11 @@ throw fire toad("something went wrong")
|
|
|
178
178
|
```
|
|
179
179
|
|
|
180
180
|
MagmaCrunch error vocabulary:
|
|
181
|
-
- `haunter
|
|
182
|
-
- `fire toad
|
|
183
|
-
- `devastate
|
|
184
|
-
- `contemplate
|
|
185
|
-
- `spooked
|
|
181
|
+
- `haunter`: syntax/parse errors
|
|
182
|
+
- `fire toad`: runtime errors
|
|
183
|
+
- `devastate`: undefined variable errors
|
|
184
|
+
- `contemplate`: type errors
|
|
185
|
+
- `spooked`: warnings (non-fatal, prints to stderr)
|
|
186
186
|
|
|
187
187
|
```magmascript
|
|
188
188
|
spooked("this is a warning")
|
|
@@ -332,13 +332,13 @@ See `scripts/examples/` for working examples:
|
|
|
332
332
|
| `astheno-packing.mgs` | The same struct fields, two orderings, two sizes |
|
|
333
333
|
| `astheno-faults.mgs` | Every memory fault, caught and named |
|
|
334
334
|
|
|
335
|
-
### The Asthenosphere
|
|
335
|
+
### The Asthenosphere: explicit memory
|
|
336
336
|
|
|
337
337
|
The layer beneath the lithosphere. A second tier where you manage memory
|
|
338
338
|
yourself: a real byte arena, pointers, structs with visible padding, and
|
|
339
339
|
integers that wrap like C's.
|
|
340
340
|
|
|
341
|
-
It is not faster than the dynamic tier
|
|
341
|
+
It is not faster than the dynamic tier: an `i32` add still costs a Python
|
|
342
342
|
dispatch. What it gives you instead is the thing C cannot: the interpreter sees
|
|
343
343
|
every memory operation, so it catches the use-after-free, names the line that
|
|
344
344
|
leaked, and hex-dumps a struct with its fields labelled. **C's behavior, but
|
|
@@ -361,7 +361,7 @@ scorch(p) // release it
|
|
|
361
361
|
```
|
|
362
362
|
|
|
363
363
|
Widths are `i8 i16 i32 i64 u8 u16 u32 u64 f32 f64`. There is no integer
|
|
364
|
-
promotion
|
|
364
|
+
promotion, `i32 + u8` is an error pointing you at `osmosis()`, and `/`
|
|
365
365
|
truncates toward zero on integer widths, as C does.
|
|
366
366
|
|
|
367
367
|
Mistakes are reported, not swallowed:
|
|
@@ -383,7 +383,7 @@ this ground was scorched at line 3 (garrisoned at line 1)
|
|
|
383
383
|
|
|
384
384
|
`floorplan` is the only new reserved word; everything else is a shadowable
|
|
385
385
|
builtin, so existing scripts are unaffected. Full reference on the
|
|
386
|
-
[Asthenosphere wiki page](
|
|
386
|
+
[Asthenosphere wiki page](wiki/Asthenosphere.md).
|
|
387
387
|
|
|
388
388
|
### REPL
|
|
389
389
|
|
|
@@ -413,7 +413,7 @@ magmascript repl
|
|
|
413
413
|
|
|
414
414
|
## Domains
|
|
415
415
|
|
|
416
|
-
### MCP Domain
|
|
416
|
+
### MCP Domain: MusicBrainz, scores, Discogs, write operations
|
|
417
417
|
```bash
|
|
418
418
|
magmascript mcp scoreboards # game leaderboards
|
|
419
419
|
magmascript mcp scores tetris # tetris scores
|
|
@@ -425,7 +425,7 @@ magmascript mcp mb-release <mbid> # get release details
|
|
|
425
425
|
magmascript mcp mb-recording <mbid> # get recording details
|
|
426
426
|
```
|
|
427
427
|
|
|
428
|
-
### Pi Domain
|
|
428
|
+
### Pi Domain: Direct SSH to Raspberry Pi
|
|
429
429
|
```bash
|
|
430
430
|
magmascript pi status # all service statuses
|
|
431
431
|
magmascript pi logs arcade-chat # service logs
|
|
@@ -436,7 +436,7 @@ magmascript pi backup musicbrainz # backup + commit to GitHub
|
|
|
436
436
|
magmascript pi traffic # nginx traffic analysis
|
|
437
437
|
```
|
|
438
438
|
|
|
439
|
-
### MC1 Domain
|
|
439
|
+
### MC1 Domain: Windows PC management (via SSH)
|
|
440
440
|
```magmascript
|
|
441
441
|
// In a .mgs script
|
|
442
442
|
info = mc1.info()
|
|
@@ -455,15 +455,15 @@ Also on the CLI: `magmascript mc1 status`, `mc1 info`, `mc1 processes`,
|
|
|
455
455
|
`mc1 restart <service>`, `mc1 power`, `mc1 set-power-mode <always-on|sleep>`,
|
|
456
456
|
`mc1 wake <mac>`, `mc1 reboot`.
|
|
457
457
|
|
|
458
|
-
> **Note:** MC1 commands connect over SSH. Don't run them on MC1 itself
|
|
458
|
+
> **Note:** MC1 commands connect over SSH. Don't run them on MC1 itself: they
|
|
459
459
|
> will try to SSH into the configured host, which on MC1 means connecting to
|
|
460
460
|
> itself and hanging. Use these from your Mac, Pi, or any other machine.
|
|
461
461
|
|
|
462
|
-
### Mac Domain
|
|
462
|
+
### Mac Domain: Mac management (via SSH)
|
|
463
463
|
```magmascript
|
|
464
464
|
// In a .mgs script, or: magmascript mac info
|
|
465
465
|
info = mac.info()
|
|
466
|
-
print(f"{info.hostname}
|
|
466
|
+
print(f"{info.hostname}, {info.os_version}")
|
|
467
467
|
print(f"{info.cpu_name} ({info.cpu_cores} cores), {info.memory}")
|
|
468
468
|
|
|
469
469
|
// Keep a checkout in sync
|
|
@@ -474,7 +474,7 @@ mac.git_pull()
|
|
|
474
474
|
Also on the CLI: `magmascript mac info`, `mac processes`, `mac git-status`,
|
|
475
475
|
`mac git-pull`, `mac run "<cmd>"`.
|
|
476
476
|
|
|
477
|
-
### GitHub Domain
|
|
477
|
+
### GitHub Domain: Direct API access
|
|
478
478
|
```bash
|
|
479
479
|
magmascript gh workflows # all workflow statuses
|
|
480
480
|
magmascript gh trigger "Deploy to Pi" # trigger workflow
|
|
@@ -483,7 +483,7 @@ magmascript gh file path/to/file.txt # read file
|
|
|
483
483
|
magmascript gh sync # diff + commit all data files
|
|
484
484
|
```
|
|
485
485
|
|
|
486
|
-
### Scores Domain
|
|
486
|
+
### Scores Domain: Game high scores
|
|
487
487
|
```bash
|
|
488
488
|
magmascript scores list # all game leaderboards
|
|
489
489
|
magmascript scores get tetris # tetris scores
|
|
@@ -492,57 +492,56 @@ magmascript scores report --discord # Discord JSON payload
|
|
|
492
492
|
magmascript scores reset tetris # reset one game (backup created)
|
|
493
493
|
```
|
|
494
494
|
|
|
495
|
-
### Archive Domain
|
|
495
|
+
### Archive Domain: Archive page operations
|
|
496
496
|
```bash
|
|
497
497
|
magmascript archive check-format # validate HTML formatting
|
|
498
|
-
magmascript archive bake-cache # inline MusicBrainz cache into pages
|
|
499
498
|
magmascript archive generate-stubs # generate stub HTML for new entities
|
|
500
499
|
```
|
|
501
500
|
|
|
502
|
-
### MusicBrainz Domain
|
|
501
|
+
### MusicBrainz Domain: MusicBrainz API client
|
|
503
502
|
```bash
|
|
504
503
|
magmascript mb backup # full MusicBrainz backup
|
|
505
504
|
magmascript mb backup --dry-run # preview backup
|
|
506
505
|
magmascript mb backup --stale-only # only refresh stale caches
|
|
507
506
|
```
|
|
508
507
|
|
|
509
|
-
### Last.fm Domain
|
|
508
|
+
### Last.fm Domain: Last.fm API client
|
|
510
509
|
```bash
|
|
511
510
|
magmascript lastfm fetch # fetch play counts
|
|
512
511
|
magmascript lastfm fetch --skip-existing # skip cached artists
|
|
513
512
|
```
|
|
514
513
|
|
|
515
|
-
### Search Domain
|
|
514
|
+
### Search Domain: Site search index builder
|
|
516
515
|
```bash
|
|
517
516
|
magmascript search build-index # build search-index.json
|
|
518
517
|
magmascript search preview 10 # preview first 10 entries
|
|
519
518
|
```
|
|
520
519
|
|
|
521
|
-
### Rights Domain
|
|
520
|
+
### Rights Domain: Music rights metadata (ISRC, ISWC, ASCAP)
|
|
522
521
|
```bash
|
|
523
522
|
magmascript rights search "Farewell" # search by title, ISRC, ISWC, or ASCAP ID
|
|
524
523
|
magmascript rights catalog "C.P. Rutledge" # full rights catalog for an artist
|
|
525
524
|
magmascript rights export # TSV export for ASCAP forms
|
|
526
525
|
```
|
|
527
526
|
|
|
528
|
-
### Media Domain
|
|
527
|
+
### Media Domain: Multi-provider media search
|
|
529
528
|
```bash
|
|
530
529
|
magmascript media search "sunset" # search all providers
|
|
531
530
|
magmascript media providers # list available providers
|
|
532
531
|
```
|
|
533
532
|
|
|
534
|
-
### Cache Domain
|
|
533
|
+
### Cache Domain: Cache management
|
|
535
534
|
```bash
|
|
536
535
|
magmascript cache stats # show cache statistics
|
|
537
536
|
magmascript cache clear # clear all cache
|
|
538
537
|
```
|
|
539
538
|
|
|
540
|
-
### Magma
|
|
539
|
+
### Magma: System status dashboard
|
|
541
540
|
```bash
|
|
542
541
|
magmascript magma # version, domains, cache stats
|
|
543
542
|
```
|
|
544
543
|
|
|
545
|
-
### Crunch
|
|
544
|
+
### Crunch: Batch pipeline
|
|
546
545
|
```bash
|
|
547
546
|
magmascript crunch mb # MusicBrainz backup
|
|
548
547
|
magmascript crunch lastfm # Last.fm fetch
|
|
@@ -553,7 +552,7 @@ magmascript crunch gh # GitHub sync
|
|
|
553
552
|
magmascript crunch all # Run all targets
|
|
554
553
|
```
|
|
555
554
|
|
|
556
|
-
### Texas
|
|
555
|
+
### Texas: Full/heavy operation (same targets, no shortcuts)
|
|
557
556
|
```bash
|
|
558
557
|
magmascript texas mb # Full MusicBrainz backup
|
|
559
558
|
magmascript texas lastfm # Full Last.fm fetch
|
|
@@ -564,7 +563,7 @@ magmascript texas gh # Full GitHub sync
|
|
|
564
563
|
magmascript texas all # Full heavy run
|
|
565
564
|
```
|
|
566
565
|
|
|
567
|
-
### Toast
|
|
566
|
+
### Toast: Burn/clear caches
|
|
568
567
|
```bash
|
|
569
568
|
magmascript toast cache # Clear general cache
|
|
570
569
|
magmascript toast mb-cache # Clear MusicBrainz cache
|
|
@@ -601,7 +600,7 @@ g = tt.game({"title": "hello", "width": 400, "height": 300})
|
|
|
601
600
|
|
|
602
601
|
A package may register the same class under several names this way; nothing
|
|
603
602
|
stops it, and the clients stay independent. Note that none of this touches the
|
|
604
|
-
`magmascript toast` CLI verb, which still clears caches
|
|
603
|
+
`magmascript toast` CLI verb, which still clears caches, registry domains are
|
|
605
604
|
not dispatched as subcommands.
|
|
606
605
|
|
|
607
606
|
## Python Library
|
|
@@ -640,24 +639,24 @@ gh_workflows # GitHub commands
|
|
|
640
639
|
|
|
641
640
|
## Documentation
|
|
642
641
|
|
|
643
|
-
Full documentation on the [Wiki](
|
|
644
|
-
- [MagmaScript Language](
|
|
645
|
-
- [Configuration](
|
|
646
|
-
- [MCP Domain](
|
|
647
|
-
- [Pi Domain](
|
|
648
|
-
- [MC1 Domain](
|
|
649
|
-
- [Mac Domain](
|
|
650
|
-
- [GitHub Domain](
|
|
651
|
-
- [Scores Domain](
|
|
652
|
-
- [Rights Domain](
|
|
653
|
-
- [Archive Domain](
|
|
654
|
-
- [Last.fm Domain](
|
|
655
|
-
- [MusicBrainz Domain](
|
|
656
|
-
- [Search Domain](
|
|
657
|
-
- [Media Domain](
|
|
658
|
-
- [Example Scripts](
|
|
659
|
-
- [Asthenosphere](
|
|
660
|
-
- [Architecture](
|
|
642
|
+
Full documentation on the [Wiki](wiki/):
|
|
643
|
+
- [MagmaScript Language](wiki/MagmaScript-Language.md)
|
|
644
|
+
- [Configuration](wiki/Configuration.md)
|
|
645
|
+
- [MCP Domain](wiki/MCP-Domain.md)
|
|
646
|
+
- [Pi Domain](wiki/Pi-Domain.md)
|
|
647
|
+
- [MC1 Domain](wiki/MC1-Domain.md)
|
|
648
|
+
- [Mac Domain](wiki/Mac-Domain.md)
|
|
649
|
+
- [GitHub Domain](wiki/GitHub-Domain.md)
|
|
650
|
+
- [Scores Domain](wiki/Scores-Domain.md)
|
|
651
|
+
- [Rights Domain](wiki/Rights-Domain.md)
|
|
652
|
+
- [Archive Domain](wiki/Archive-Domain.md)
|
|
653
|
+
- [Last.fm Domain](wiki/Last.fm-Domain.md)
|
|
654
|
+
- [MusicBrainz Domain](wiki/MusicBrainz-Domain.md)
|
|
655
|
+
- [Search Domain](wiki/Search-Domain.md)
|
|
656
|
+
- [Media Domain](wiki/Media-Domain.md)
|
|
657
|
+
- [Example Scripts](wiki/Example-Scripts.md)
|
|
658
|
+
- [Asthenosphere](wiki/Asthenosphere.md)
|
|
659
|
+
- [Architecture](wiki/Architecture.md)
|
|
661
660
|
|
|
662
661
|
## Support This Project
|
|
663
662
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"""magmascript
|
|
1
|
+
"""magmascript: a scripting toolkit with domain-first subcommands."""
|
|
2
2
|
|
|
3
3
|
# The version lives in pyproject.toml alone. It was also a literal here, and the
|
|
4
4
|
# two drifted: 3.2.3 shipped reporting itself as 3.2.2, in the REPL banner and
|
|
@@ -279,7 +279,7 @@ Options:
|
|
|
279
279
|
|
|
280
280
|
|
|
281
281
|
def usage():
|
|
282
|
-
print("""magmascript
|
|
282
|
+
print("""magmascript, scripting toolkit with domain-first subcommands
|
|
283
283
|
|
|
284
284
|
Usage:
|
|
285
285
|
magmascript <script.mgs> [args...] Run a MagmaScript file directly
|
|
@@ -385,7 +385,6 @@ Rights:
|
|
|
385
385
|
|
|
386
386
|
Archive:
|
|
387
387
|
check-format Validate archive HTML formatting
|
|
388
|
-
bake-cache [--dry-run] Inlines MusicBrainz cache into HTML pages
|
|
389
388
|
generate-stubs Generate stub HTML for new archive entities
|
|
390
389
|
|
|
391
390
|
MusicBrainz:
|
|
@@ -1119,7 +1118,7 @@ def _dispatch_scores(action: str, args: list[str], client, fmt: str):
|
|
|
1119
1118
|
else:
|
|
1120
1119
|
# Generate markdown report
|
|
1121
1120
|
report = client.report()
|
|
1122
|
-
lines = [f"# Weekly High Scores
|
|
1121
|
+
lines = [f"# Weekly High Scores: {report.generated_at}", ""]
|
|
1123
1122
|
lines.append("## Leaderboards")
|
|
1124
1123
|
lines.append("")
|
|
1125
1124
|
for board in report.scoreboards:
|
|
@@ -1166,7 +1165,7 @@ def _dispatch_scores(action: str, args: list[str], client, fmt: str):
|
|
|
1166
1165
|
gh = GHClient(config)
|
|
1167
1166
|
try:
|
|
1168
1167
|
date = datetime.now().strftime("%Y-%m-%d")
|
|
1169
|
-
title = f"Weekly High Scores
|
|
1168
|
+
title = f"Weekly High Scores: {date}"
|
|
1170
1169
|
result = gh.create_discussion(title, markdown, "high-scores")
|
|
1171
1170
|
print(result)
|
|
1172
1171
|
finally:
|
|
@@ -1335,8 +1334,6 @@ def _dispatch_archive(action: str, args: list[str], client, fmt: str):
|
|
|
1335
1334
|
|
|
1336
1335
|
Usage:
|
|
1337
1336
|
magmascript archive check-format Validate archive HTML formatting
|
|
1338
|
-
magmascript archive bake-cache Inlines MusicBrainz cache into HTML pages
|
|
1339
|
-
magmascript archive bake-cache --dry-run Preview changes without writing
|
|
1340
1337
|
magmascript archive generate-stubs Generate stub HTML for new archive entities
|
|
1341
1338
|
""")
|
|
1342
1339
|
sys.exit(0)
|
|
@@ -1356,20 +1353,6 @@ Usage:
|
|
|
1356
1353
|
if warnings:
|
|
1357
1354
|
sys.exit(1)
|
|
1358
1355
|
|
|
1359
|
-
elif action == "bake-cache":
|
|
1360
|
-
dry_run = "--dry-run" in args
|
|
1361
|
-
result = client.bake_cache(dry_run=dry_run)
|
|
1362
|
-
if fmt == "json":
|
|
1363
|
-
print(json.dumps({"baked": result.baked, "skipped": result.skipped, "errors": result.errors}, indent=2))
|
|
1364
|
-
else:
|
|
1365
|
-
print(f"\nDone! {result.baked} pages baked, {result.skipped} skipped.")
|
|
1366
|
-
if dry_run:
|
|
1367
|
-
print("(dry run — no files were written)")
|
|
1368
|
-
if result.errors:
|
|
1369
|
-
print(f"\nErrors:")
|
|
1370
|
-
for err in result.errors:
|
|
1371
|
-
print(f" {err}")
|
|
1372
|
-
|
|
1373
1356
|
elif action == "generate-stubs":
|
|
1374
1357
|
result = client.generate_stubs()
|
|
1375
1358
|
if fmt == "json":
|
|
@@ -1708,7 +1691,7 @@ Usage:
|
|
|
1708
1691
|
|
|
1709
1692
|
|
|
1710
1693
|
def _dispatch_magma(action: str, fmt: str):
|
|
1711
|
-
"""Dispatch magma subcommands
|
|
1694
|
+
"""Dispatch magma subcommands: system status dashboard."""
|
|
1712
1695
|
from magmascript.core.commands import magma
|
|
1713
1696
|
|
|
1714
1697
|
if not action or action == "--help":
|
|
@@ -1752,7 +1735,7 @@ def _format_size(size_bytes: int) -> str:
|
|
|
1752
1735
|
|
|
1753
1736
|
|
|
1754
1737
|
def _dispatch_crunch(action: str, args: list[str], fmt: str):
|
|
1755
|
-
"""Dispatch crunch subcommands
|
|
1738
|
+
"""Dispatch crunch subcommands: pipeline runner."""
|
|
1756
1739
|
from magmascript.core.commands import crunch, CrunchResult
|
|
1757
1740
|
|
|
1758
1741
|
if not action or action == "--help":
|
|
@@ -1766,7 +1749,6 @@ Targets:
|
|
|
1766
1749
|
mb MusicBrainz backup
|
|
1767
1750
|
lastfm Last.fm play count fetch
|
|
1768
1751
|
search Search index rebuild
|
|
1769
|
-
archive Bake MB cache into HTML stubs
|
|
1770
1752
|
scores Generate scores report
|
|
1771
1753
|
gh Diff + commit local vs GitHub
|
|
1772
1754
|
all Run all pipelines sequentially
|
|
@@ -1785,7 +1767,7 @@ Targets:
|
|
|
1785
1767
|
|
|
1786
1768
|
|
|
1787
1769
|
def _dispatch_texas(action: str, args: list[str], fmt: str):
|
|
1788
|
-
"""Dispatch texas subcommands
|
|
1770
|
+
"""Dispatch texas subcommands: full/heavy operations."""
|
|
1789
1771
|
from magmascript.core.commands import texas
|
|
1790
1772
|
|
|
1791
1773
|
if not action or action == "--help":
|
|
@@ -1798,8 +1780,8 @@ Usage:
|
|
|
1798
1780
|
Targets:
|
|
1799
1781
|
mb Full MB backup (no skip-existing, no stale-only)
|
|
1800
1782
|
lastfm Full Last.fm fetch (no skip-existing)
|
|
1801
|
-
search Search index rebuild
|
|
1802
|
-
archive Full pipeline: stubs ->
|
|
1783
|
+
search Search index rebuild
|
|
1784
|
+
archive Full pipeline: stubs -> format check
|
|
1803
1785
|
scores Full report (post to Discussion + Discord)
|
|
1804
1786
|
gh Full sync with custom message
|
|
1805
1787
|
all Everything, no shortcuts
|
|
@@ -1818,7 +1800,7 @@ Targets:
|
|
|
1818
1800
|
|
|
1819
1801
|
|
|
1820
1802
|
def _dispatch_toast(action: str, args: list[str], fmt: str):
|
|
1821
|
-
"""Dispatch toast subcommands
|
|
1803
|
+
"""Dispatch toast subcommands: burn/clear caches."""
|
|
1822
1804
|
from magmascript.core.commands import toast
|
|
1823
1805
|
|
|
1824
1806
|
if not action or action == "--help":
|