magmascript 3.3.0__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.3.0 → magmascript-4.0.0}/PKG-INFO +29 -30
- {magmascript-3.3.0 → magmascript-4.0.0}/README.md +28 -29
- {magmascript-3.3.0 → magmascript-4.0.0}/magmascript/__init__.py +1 -1
- {magmascript-3.3.0 → magmascript-4.0.0}/magmascript/cli.py +9 -27
- {magmascript-3.3.0 → magmascript-4.0.0}/magmascript/core/commands.py +8 -35
- {magmascript-3.3.0 → magmascript-4.0.0}/magmascript/core/config.py +1 -1
- {magmascript-3.3.0 → magmascript-4.0.0}/magmascript/core/github.py +1 -2
- {magmascript-3.3.0 → magmascript-4.0.0}/magmascript/core/registry.py +1 -1
- {magmascript-3.3.0 → magmascript-4.0.0}/magmascript/core/rpc.py +2 -2
- {magmascript-3.3.0 → magmascript-4.0.0}/magmascript/core/runner.py +1 -1
- {magmascript-3.3.0 → magmascript-4.0.0}/magmascript/domains/__init__.py +1 -1
- {magmascript-3.3.0 → magmascript-4.0.0}/magmascript/domains/archive/__init__.py +1 -1
- {magmascript-3.3.0 → magmascript-4.0.0}/magmascript/domains/archive/client.py +3 -130
- {magmascript-3.3.0 → magmascript-4.0.0}/magmascript/domains/gh/__init__.py +1 -1
- {magmascript-3.3.0 → magmascript-4.0.0}/magmascript/domains/gh/client.py +2 -2
- {magmascript-3.3.0 → magmascript-4.0.0}/magmascript/domains/lastfm/__init__.py +1 -1
- {magmascript-3.3.0 → magmascript-4.0.0}/magmascript/domains/lastfm/client.py +1 -1
- {magmascript-3.3.0 → magmascript-4.0.0}/magmascript/domains/mac/__init__.py +1 -1
- {magmascript-3.3.0 → magmascript-4.0.0}/magmascript/domains/mac/client.py +3 -3
- {magmascript-3.3.0 → magmascript-4.0.0}/magmascript/domains/mb/__init__.py +1 -1
- {magmascript-3.3.0 → magmascript-4.0.0}/magmascript/domains/mb/client.py +7 -7
- {magmascript-3.3.0 → magmascript-4.0.0}/magmascript/domains/mc1/__init__.py +1 -1
- {magmascript-3.3.0 → magmascript-4.0.0}/magmascript/domains/mc1/client.py +1 -1
- {magmascript-3.3.0 → magmascript-4.0.0}/magmascript/domains/mcp/__init__.py +1 -1
- {magmascript-3.3.0 → magmascript-4.0.0}/magmascript/domains/mcp/client.py +3 -3
- {magmascript-3.3.0 → magmascript-4.0.0}/magmascript/domains/media/__init__.py +1 -1
- {magmascript-3.3.0 → magmascript-4.0.0}/magmascript/domains/media/client.py +2 -2
- {magmascript-3.3.0 → magmascript-4.0.0}/magmascript/domains/pi/__init__.py +1 -1
- {magmascript-3.3.0 → magmascript-4.0.0}/magmascript/domains/pi/client.py +1 -1
- {magmascript-3.3.0 → magmascript-4.0.0}/magmascript/domains/rights/__init__.py +1 -1
- {magmascript-3.3.0 → magmascript-4.0.0}/magmascript/domains/rights/client.py +1 -1
- {magmascript-3.3.0 → magmascript-4.0.0}/magmascript/domains/scores/__init__.py +1 -1
- {magmascript-3.3.0 → magmascript-4.0.0}/magmascript/domains/search/__init__.py +1 -1
- {magmascript-3.3.0 → magmascript-4.0.0}/magmascript/domains/search/client.py +5 -5
- {magmascript-3.3.0 → magmascript-4.0.0}/magmascript/lang/domain_bridge.py +1 -1
- {magmascript-3.3.0 → magmascript-4.0.0}/magmascript/lang/interpreter.py +5 -5
- {magmascript-3.3.0 → magmascript-4.0.0}/magmascript/lang/lexer.py +1 -1
- {magmascript-3.3.0 → magmascript-4.0.0}/magmascript/lang/parser.py +1 -1
- {magmascript-3.3.0 → magmascript-4.0.0}/magmascript/repl.py +1 -1
- {magmascript-3.3.0 → magmascript-4.0.0}/magmascript.egg-info/PKG-INFO +29 -30
- {magmascript-3.3.0 → magmascript-4.0.0}/pyproject.toml +1 -1
- {magmascript-3.3.0 → magmascript-4.0.0}/tests/test_cli_regressions.py +1 -1
- {magmascript-3.3.0 → magmascript-4.0.0}/tests/test_commands.py +5 -18
- {magmascript-3.3.0 → magmascript-4.0.0}/LICENSE +0 -0
- {magmascript-3.3.0 → magmascript-4.0.0}/magmascript/codegen/__init__.py +0 -0
- {magmascript-3.3.0 → magmascript-4.0.0}/magmascript/codegen/c.py +0 -0
- {magmascript-3.3.0 → magmascript-4.0.0}/magmascript/core/__init__.py +0 -0
- {magmascript-3.3.0 → magmascript-4.0.0}/magmascript/core/cache.py +0 -0
- {magmascript-3.3.0 → magmascript-4.0.0}/magmascript/core/command_registry.py +0 -0
- {magmascript-3.3.0 → magmascript-4.0.0}/magmascript/core/exceptions.py +0 -0
- {magmascript-3.3.0 → magmascript-4.0.0}/magmascript/core/output.py +0 -0
- {magmascript-3.3.0 → magmascript-4.0.0}/magmascript/domains/gh/tools.py +0 -0
- {magmascript-3.3.0 → magmascript-4.0.0}/magmascript/domains/mac/tools.py +0 -0
- {magmascript-3.3.0 → magmascript-4.0.0}/magmascript/domains/mc1/tools.py +0 -0
- {magmascript-3.3.0 → magmascript-4.0.0}/magmascript/domains/mcp/tools.py +0 -0
- {magmascript-3.3.0 → magmascript-4.0.0}/magmascript/domains/media/providers/__init__.py +0 -0
- {magmascript-3.3.0 → magmascript-4.0.0}/magmascript/domains/media/providers/archive.py +0 -0
- {magmascript-3.3.0 → magmascript-4.0.0}/magmascript/domains/media/providers/met_museum.py +0 -0
- {magmascript-3.3.0 → magmascript-4.0.0}/magmascript/domains/media/providers/openverse.py +0 -0
- {magmascript-3.3.0 → magmascript-4.0.0}/magmascript/domains/media/providers/pexels.py +0 -0
- {magmascript-3.3.0 → magmascript-4.0.0}/magmascript/domains/media/providers/pixabay.py +0 -0
- {magmascript-3.3.0 → magmascript-4.0.0}/magmascript/domains/media/providers/smithsonian.py +0 -0
- {magmascript-3.3.0 → magmascript-4.0.0}/magmascript/domains/media/tools.py +0 -0
- {magmascript-3.3.0 → magmascript-4.0.0}/magmascript/domains/pi/tools.py +0 -0
- {magmascript-3.3.0 → magmascript-4.0.0}/magmascript/domains/rights/tools.py +0 -0
- {magmascript-3.3.0 → magmascript-4.0.0}/magmascript/domains/scores/client.py +0 -0
- {magmascript-3.3.0 → magmascript-4.0.0}/magmascript/domains/scores/tools.py +0 -0
- {magmascript-3.3.0 → magmascript-4.0.0}/magmascript/lang/__init__.py +0 -0
- {magmascript-3.3.0 → magmascript-4.0.0}/magmascript/lang/ast_nodes.py +0 -0
- {magmascript-3.3.0 → magmascript-4.0.0}/magmascript/lang/astheno/__init__.py +0 -0
- {magmascript-3.3.0 → magmascript-4.0.0}/magmascript/lang/astheno/arena.py +0 -0
- {magmascript-3.3.0 → magmascript-4.0.0}/magmascript/lang/astheno/dump.py +0 -0
- {magmascript-3.3.0 → magmascript-4.0.0}/magmascript/lang/astheno/floorplan.py +0 -0
- {magmascript-3.3.0 → magmascript-4.0.0}/magmascript/lang/astheno/numeric.py +0 -0
- {magmascript-3.3.0 → magmascript-4.0.0}/magmascript/lang/builtins.py +0 -0
- {magmascript-3.3.0 → magmascript-4.0.0}/magmascript/lang/environment.py +0 -0
- {magmascript-3.3.0 → magmascript-4.0.0}/magmascript/lang/hypnagogia.py +0 -0
- {magmascript-3.3.0 → magmascript-4.0.0}/magmascript/lang/pretty.py +0 -0
- {magmascript-3.3.0 → magmascript-4.0.0}/magmascript/lang/pygments_mgs.py +0 -0
- {magmascript-3.3.0 → magmascript-4.0.0}/magmascript/lang/tokens.py +0 -0
- {magmascript-3.3.0 → magmascript-4.0.0}/magmascript/lang/util.py +0 -0
- {magmascript-3.3.0 → magmascript-4.0.0}/magmascript/lang/visitor.py +0 -0
- {magmascript-3.3.0 → magmascript-4.0.0}/magmascript/scaffold/__init__.py +0 -0
- {magmascript-3.3.0 → magmascript-4.0.0}/magmascript.egg-info/SOURCES.txt +0 -0
- {magmascript-3.3.0 → magmascript-4.0.0}/magmascript.egg-info/dependency_links.txt +0 -0
- {magmascript-3.3.0 → magmascript-4.0.0}/magmascript.egg-info/entry_points.txt +0 -0
- {magmascript-3.3.0 → magmascript-4.0.0}/magmascript.egg-info/requires.txt +0 -0
- {magmascript-3.3.0 → magmascript-4.0.0}/magmascript.egg-info/top_level.txt +0 -0
- {magmascript-3.3.0 → magmascript-4.0.0}/setup.cfg +0 -0
- {magmascript-3.3.0 → magmascript-4.0.0}/tests/test_astheno.py +0 -0
- {magmascript-3.3.0 → magmascript-4.0.0}/tests/test_cache.py +0 -0
- {magmascript-3.3.0 → magmascript-4.0.0}/tests/test_classes.py +0 -0
- {magmascript-3.3.0 → magmascript-4.0.0}/tests/test_cli.py +0 -0
- {magmascript-3.3.0 → magmascript-4.0.0}/tests/test_domain_bridge.py +0 -0
- {magmascript-3.3.0 → magmascript-4.0.0}/tests/test_import.py +0 -0
- {magmascript-3.3.0 → magmascript-4.0.0}/tests/test_lang.py +0 -0
- {magmascript-3.3.0 → magmascript-4.0.0}/tests/test_mac.py +0 -0
- {magmascript-3.3.0 → magmascript-4.0.0}/tests/test_mc1.py +0 -0
- {magmascript-3.3.0 → magmascript-4.0.0}/tests/test_mcp_client.py +0 -0
- {magmascript-3.3.0 → magmascript-4.0.0}/tests/test_rpc.py +0 -0
- {magmascript-3.3.0 → magmascript-4.0.0}/tests/test_try_catch.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
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
|
|
@@ -214,11 +214,11 @@ throw fire toad("something went wrong")
|
|
|
214
214
|
```
|
|
215
215
|
|
|
216
216
|
MagmaCrunch error vocabulary:
|
|
217
|
-
- `haunter
|
|
218
|
-
- `fire toad
|
|
219
|
-
- `devastate
|
|
220
|
-
- `contemplate
|
|
221
|
-
- `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)
|
|
222
222
|
|
|
223
223
|
```magmascript
|
|
224
224
|
spooked("this is a warning")
|
|
@@ -368,13 +368,13 @@ See `scripts/examples/` for working examples:
|
|
|
368
368
|
| `astheno-packing.mgs` | The same struct fields, two orderings, two sizes |
|
|
369
369
|
| `astheno-faults.mgs` | Every memory fault, caught and named |
|
|
370
370
|
|
|
371
|
-
### The Asthenosphere
|
|
371
|
+
### The Asthenosphere: explicit memory
|
|
372
372
|
|
|
373
373
|
The layer beneath the lithosphere. A second tier where you manage memory
|
|
374
374
|
yourself: a real byte arena, pointers, structs with visible padding, and
|
|
375
375
|
integers that wrap like C's.
|
|
376
376
|
|
|
377
|
-
It is not faster than the dynamic tier
|
|
377
|
+
It is not faster than the dynamic tier: an `i32` add still costs a Python
|
|
378
378
|
dispatch. What it gives you instead is the thing C cannot: the interpreter sees
|
|
379
379
|
every memory operation, so it catches the use-after-free, names the line that
|
|
380
380
|
leaked, and hex-dumps a struct with its fields labelled. **C's behavior, but
|
|
@@ -397,7 +397,7 @@ scorch(p) // release it
|
|
|
397
397
|
```
|
|
398
398
|
|
|
399
399
|
Widths are `i8 i16 i32 i64 u8 u16 u32 u64 f32 f64`. There is no integer
|
|
400
|
-
promotion
|
|
400
|
+
promotion, `i32 + u8` is an error pointing you at `osmosis()`, and `/`
|
|
401
401
|
truncates toward zero on integer widths, as C does.
|
|
402
402
|
|
|
403
403
|
Mistakes are reported, not swallowed:
|
|
@@ -449,7 +449,7 @@ magmascript repl
|
|
|
449
449
|
|
|
450
450
|
## Domains
|
|
451
451
|
|
|
452
|
-
### MCP Domain
|
|
452
|
+
### MCP Domain: MusicBrainz, scores, Discogs, write operations
|
|
453
453
|
```bash
|
|
454
454
|
magmascript mcp scoreboards # game leaderboards
|
|
455
455
|
magmascript mcp scores tetris # tetris scores
|
|
@@ -461,7 +461,7 @@ magmascript mcp mb-release <mbid> # get release details
|
|
|
461
461
|
magmascript mcp mb-recording <mbid> # get recording details
|
|
462
462
|
```
|
|
463
463
|
|
|
464
|
-
### Pi Domain
|
|
464
|
+
### Pi Domain: Direct SSH to Raspberry Pi
|
|
465
465
|
```bash
|
|
466
466
|
magmascript pi status # all service statuses
|
|
467
467
|
magmascript pi logs arcade-chat # service logs
|
|
@@ -472,7 +472,7 @@ magmascript pi backup musicbrainz # backup + commit to GitHub
|
|
|
472
472
|
magmascript pi traffic # nginx traffic analysis
|
|
473
473
|
```
|
|
474
474
|
|
|
475
|
-
### MC1 Domain
|
|
475
|
+
### MC1 Domain: Windows PC management (via SSH)
|
|
476
476
|
```magmascript
|
|
477
477
|
// In a .mgs script
|
|
478
478
|
info = mc1.info()
|
|
@@ -491,15 +491,15 @@ Also on the CLI: `magmascript mc1 status`, `mc1 info`, `mc1 processes`,
|
|
|
491
491
|
`mc1 restart <service>`, `mc1 power`, `mc1 set-power-mode <always-on|sleep>`,
|
|
492
492
|
`mc1 wake <mac>`, `mc1 reboot`.
|
|
493
493
|
|
|
494
|
-
> **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
|
|
495
495
|
> will try to SSH into the configured host, which on MC1 means connecting to
|
|
496
496
|
> itself and hanging. Use these from your Mac, Pi, or any other machine.
|
|
497
497
|
|
|
498
|
-
### Mac Domain
|
|
498
|
+
### Mac Domain: Mac management (via SSH)
|
|
499
499
|
```magmascript
|
|
500
500
|
// In a .mgs script, or: magmascript mac info
|
|
501
501
|
info = mac.info()
|
|
502
|
-
print(f"{info.hostname}
|
|
502
|
+
print(f"{info.hostname}, {info.os_version}")
|
|
503
503
|
print(f"{info.cpu_name} ({info.cpu_cores} cores), {info.memory}")
|
|
504
504
|
|
|
505
505
|
// Keep a checkout in sync
|
|
@@ -510,7 +510,7 @@ mac.git_pull()
|
|
|
510
510
|
Also on the CLI: `magmascript mac info`, `mac processes`, `mac git-status`,
|
|
511
511
|
`mac git-pull`, `mac run "<cmd>"`.
|
|
512
512
|
|
|
513
|
-
### GitHub Domain
|
|
513
|
+
### GitHub Domain: Direct API access
|
|
514
514
|
```bash
|
|
515
515
|
magmascript gh workflows # all workflow statuses
|
|
516
516
|
magmascript gh trigger "Deploy to Pi" # trigger workflow
|
|
@@ -519,7 +519,7 @@ magmascript gh file path/to/file.txt # read file
|
|
|
519
519
|
magmascript gh sync # diff + commit all data files
|
|
520
520
|
```
|
|
521
521
|
|
|
522
|
-
### Scores Domain
|
|
522
|
+
### Scores Domain: Game high scores
|
|
523
523
|
```bash
|
|
524
524
|
magmascript scores list # all game leaderboards
|
|
525
525
|
magmascript scores get tetris # tetris scores
|
|
@@ -528,57 +528,56 @@ magmascript scores report --discord # Discord JSON payload
|
|
|
528
528
|
magmascript scores reset tetris # reset one game (backup created)
|
|
529
529
|
```
|
|
530
530
|
|
|
531
|
-
### Archive Domain
|
|
531
|
+
### Archive Domain: Archive page operations
|
|
532
532
|
```bash
|
|
533
533
|
magmascript archive check-format # validate HTML formatting
|
|
534
|
-
magmascript archive bake-cache # inline MusicBrainz cache into pages
|
|
535
534
|
magmascript archive generate-stubs # generate stub HTML for new entities
|
|
536
535
|
```
|
|
537
536
|
|
|
538
|
-
### MusicBrainz Domain
|
|
537
|
+
### MusicBrainz Domain: MusicBrainz API client
|
|
539
538
|
```bash
|
|
540
539
|
magmascript mb backup # full MusicBrainz backup
|
|
541
540
|
magmascript mb backup --dry-run # preview backup
|
|
542
541
|
magmascript mb backup --stale-only # only refresh stale caches
|
|
543
542
|
```
|
|
544
543
|
|
|
545
|
-
### Last.fm Domain
|
|
544
|
+
### Last.fm Domain: Last.fm API client
|
|
546
545
|
```bash
|
|
547
546
|
magmascript lastfm fetch # fetch play counts
|
|
548
547
|
magmascript lastfm fetch --skip-existing # skip cached artists
|
|
549
548
|
```
|
|
550
549
|
|
|
551
|
-
### Search Domain
|
|
550
|
+
### Search Domain: Site search index builder
|
|
552
551
|
```bash
|
|
553
552
|
magmascript search build-index # build search-index.json
|
|
554
553
|
magmascript search preview 10 # preview first 10 entries
|
|
555
554
|
```
|
|
556
555
|
|
|
557
|
-
### Rights Domain
|
|
556
|
+
### Rights Domain: Music rights metadata (ISRC, ISWC, ASCAP)
|
|
558
557
|
```bash
|
|
559
558
|
magmascript rights search "Farewell" # search by title, ISRC, ISWC, or ASCAP ID
|
|
560
559
|
magmascript rights catalog "C.P. Rutledge" # full rights catalog for an artist
|
|
561
560
|
magmascript rights export # TSV export for ASCAP forms
|
|
562
561
|
```
|
|
563
562
|
|
|
564
|
-
### Media Domain
|
|
563
|
+
### Media Domain: Multi-provider media search
|
|
565
564
|
```bash
|
|
566
565
|
magmascript media search "sunset" # search all providers
|
|
567
566
|
magmascript media providers # list available providers
|
|
568
567
|
```
|
|
569
568
|
|
|
570
|
-
### Cache Domain
|
|
569
|
+
### Cache Domain: Cache management
|
|
571
570
|
```bash
|
|
572
571
|
magmascript cache stats # show cache statistics
|
|
573
572
|
magmascript cache clear # clear all cache
|
|
574
573
|
```
|
|
575
574
|
|
|
576
|
-
### Magma
|
|
575
|
+
### Magma: System status dashboard
|
|
577
576
|
```bash
|
|
578
577
|
magmascript magma # version, domains, cache stats
|
|
579
578
|
```
|
|
580
579
|
|
|
581
|
-
### Crunch
|
|
580
|
+
### Crunch: Batch pipeline
|
|
582
581
|
```bash
|
|
583
582
|
magmascript crunch mb # MusicBrainz backup
|
|
584
583
|
magmascript crunch lastfm # Last.fm fetch
|
|
@@ -589,7 +588,7 @@ magmascript crunch gh # GitHub sync
|
|
|
589
588
|
magmascript crunch all # Run all targets
|
|
590
589
|
```
|
|
591
590
|
|
|
592
|
-
### Texas
|
|
591
|
+
### Texas: Full/heavy operation (same targets, no shortcuts)
|
|
593
592
|
```bash
|
|
594
593
|
magmascript texas mb # Full MusicBrainz backup
|
|
595
594
|
magmascript texas lastfm # Full Last.fm fetch
|
|
@@ -600,7 +599,7 @@ magmascript texas gh # Full GitHub sync
|
|
|
600
599
|
magmascript texas all # Full heavy run
|
|
601
600
|
```
|
|
602
601
|
|
|
603
|
-
### Toast
|
|
602
|
+
### Toast: Burn/clear caches
|
|
604
603
|
```bash
|
|
605
604
|
magmascript toast cache # Clear general cache
|
|
606
605
|
magmascript toast mb-cache # Clear MusicBrainz cache
|
|
@@ -637,7 +636,7 @@ g = tt.game({"title": "hello", "width": 400, "height": 300})
|
|
|
637
636
|
|
|
638
637
|
A package may register the same class under several names this way; nothing
|
|
639
638
|
stops it, and the clients stay independent. Note that none of this touches the
|
|
640
|
-
`magmascript toast` CLI verb, which still clears caches
|
|
639
|
+
`magmascript toast` CLI verb, which still clears caches, registry domains are
|
|
641
640
|
not dispatched as subcommands.
|
|
642
641
|
|
|
643
642
|
## Python Library
|
|
@@ -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:
|
|
@@ -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
|
|
@@ -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":
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"""Core commands
|
|
1
|
+
"""Core commands: magma, crunch, texas, toast."""
|
|
2
2
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
|
|
@@ -88,8 +88,6 @@ def crunch(target: str, *, dry_run: bool = False) -> CrunchResult:
|
|
|
88
88
|
return _crunch_lastfm(dry_run=dry_run)
|
|
89
89
|
elif target == "search":
|
|
90
90
|
return _crunch_search()
|
|
91
|
-
elif target == "archive":
|
|
92
|
-
return _crunch_archive(dry_run=dry_run)
|
|
93
91
|
elif target == "scores":
|
|
94
92
|
return _crunch_scores()
|
|
95
93
|
elif target == "gh":
|
|
@@ -97,7 +95,7 @@ def crunch(target: str, *, dry_run: bool = False) -> CrunchResult:
|
|
|
97
95
|
elif target == "all":
|
|
98
96
|
return _crunch_all(dry_run=dry_run)
|
|
99
97
|
else:
|
|
100
|
-
raise ValueError(f"Unknown crunch target: {target!r}. Available: mb, lastfm, search,
|
|
98
|
+
raise ValueError(f"Unknown crunch target: {target!r}. Available: mb, lastfm, search, scores, gh, all")
|
|
101
99
|
|
|
102
100
|
|
|
103
101
|
def _crunch_mb(*, dry_run: bool = False) -> CrunchResult:
|
|
@@ -148,20 +146,6 @@ def _crunch_search() -> CrunchResult:
|
|
|
148
146
|
)
|
|
149
147
|
|
|
150
148
|
|
|
151
|
-
def _crunch_archive(*, dry_run: bool = False) -> CrunchResult:
|
|
152
|
-
from magmascript.domains.archive import ArchiveClient
|
|
153
|
-
|
|
154
|
-
root = _get_project_root()
|
|
155
|
-
client = ArchiveClient(project_root=root)
|
|
156
|
-
result = client.bake_cache(dry_run=dry_run)
|
|
157
|
-
return CrunchResult(
|
|
158
|
-
target="archive",
|
|
159
|
-
completed=result.baked,
|
|
160
|
-
skipped=result.skipped,
|
|
161
|
-
errors=result.errors,
|
|
162
|
-
)
|
|
163
|
-
|
|
164
|
-
|
|
165
149
|
def _crunch_scores() -> CrunchResult:
|
|
166
150
|
from magmascript.domains.scores import ScoresClient
|
|
167
151
|
|
|
@@ -191,7 +175,7 @@ def _crunch_gh(*, dry_run: bool = False) -> CrunchResult:
|
|
|
191
175
|
|
|
192
176
|
|
|
193
177
|
def _crunch_all(*, dry_run: bool = False) -> CrunchResult:
|
|
194
|
-
targets = ["mb", "lastfm", "
|
|
178
|
+
targets = ["mb", "lastfm", "search", "gh"]
|
|
195
179
|
total_completed = 0
|
|
196
180
|
total_errors: list[str] = []
|
|
197
181
|
|
|
@@ -266,25 +250,15 @@ def _texas_lastfm(*, dry_run: bool = False) -> CrunchResult:
|
|
|
266
250
|
|
|
267
251
|
def _texas_search(*, dry_run: bool = False) -> CrunchResult:
|
|
268
252
|
from magmascript.domains.search import SearchClient
|
|
269
|
-
from magmascript.domains.archive import ArchiveClient
|
|
270
|
-
|
|
271
|
-
root = _get_project_root()
|
|
272
|
-
|
|
273
|
-
search_client = SearchClient(project_root=root)
|
|
274
|
-
search_result = search_client.build()
|
|
275
253
|
|
|
276
|
-
|
|
277
|
-
bake_result = archive_client.bake_cache(dry_run=dry_run)
|
|
254
|
+
search_result = SearchClient(project_root=_get_project_root()).build()
|
|
278
255
|
|
|
279
256
|
return CrunchResult(
|
|
280
257
|
target="search",
|
|
281
|
-
completed=search_result.total_entries
|
|
282
|
-
skipped=bake_result.skipped,
|
|
283
|
-
errors=bake_result.errors,
|
|
258
|
+
completed=search_result.total_entries,
|
|
284
259
|
details={
|
|
285
260
|
"search_entries": search_result.total_entries,
|
|
286
261
|
"deduplicated": search_result.deduplicated,
|
|
287
|
-
"baked": bake_result.baked,
|
|
288
262
|
},
|
|
289
263
|
)
|
|
290
264
|
|
|
@@ -295,15 +269,14 @@ def _texas_archive(*, dry_run: bool = False) -> CrunchResult:
|
|
|
295
269
|
root = _get_project_root()
|
|
296
270
|
client = ArchiveClient(project_root=root)
|
|
297
271
|
|
|
272
|
+
# No bake step: archive pages fetch archive/_cache at load time, and the
|
|
273
|
+
# website's CI refuses a page carrying an inline copy (retired 2026-10-18).
|
|
298
274
|
stubs = client.generate_stubs()
|
|
299
|
-
bake = client.bake_cache(dry_run=dry_run)
|
|
300
275
|
fmt = client.check_format()
|
|
301
276
|
|
|
302
277
|
return CrunchResult(
|
|
303
278
|
target="archive",
|
|
304
|
-
|
|
305
|
-
skipped=bake.skipped,
|
|
306
|
-
errors=bake.errors + (fmt.get("warnings", []) if isinstance(fmt, dict) else []),
|
|
279
|
+
errors=fmt.get("warnings", []) if isinstance(fmt, dict) else [],
|
|
307
280
|
details={"stubs": stubs, "format_warnings": fmt},
|
|
308
281
|
)
|
|
309
282
|
|
|
@@ -11,7 +11,7 @@ from pathlib import Path
|
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
# The MCP server is a public endpoint, so it stays a usable default. SSH
|
|
14
|
-
# host/user defaults are intentionally empty
|
|
14
|
+
# host/user defaults are intentionally empty: a fresh install must be told
|
|
15
15
|
# which machines to reach rather than probing someone else's network.
|
|
16
16
|
DEFAULT_MCP_URL = "https://magmacrunch.duckdns.org/mcp"
|
|
17
17
|
CONFIG_DIR = Path.home() / ".config" / "magmascript"
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"""Shared GitHub API client
|
|
1
|
+
"""Shared GitHub API client: used by the gh domain and potentially other domains."""
|
|
2
2
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
|
|
@@ -17,7 +17,6 @@ WORKFLOWS: dict[str, str] = {
|
|
|
17
17
|
"Check Pi Services": "check-services.yml",
|
|
18
18
|
"Rebuild Search Index": "rebuild-search-index.yml",
|
|
19
19
|
"Generate Archive Stubs": "generate-stubs.yml",
|
|
20
|
-
"Bake Cache": "bake-cache.yml",
|
|
21
20
|
"Weekly High Scores": "weekly-scores.yml",
|
|
22
21
|
"Arcade Smoke Test": "smoke-test.yml",
|
|
23
22
|
"MusicBrainz Backup": "backup-musicbrainz.yml",
|
|
@@ -82,12 +82,12 @@ class RPCClient:
|
|
|
82
82
|
|
|
83
83
|
content_type = resp.headers.get("content-type", "")
|
|
84
84
|
|
|
85
|
-
# application/json
|
|
85
|
+
# application/json, single response
|
|
86
86
|
if "application/json" in content_type:
|
|
87
87
|
data = resp.json()
|
|
88
88
|
return self._parse_response(data)
|
|
89
89
|
|
|
90
|
-
# text/event-stream
|
|
90
|
+
# text/event-stream, SSE with multiple events
|
|
91
91
|
if "text/event-stream" in content_type:
|
|
92
92
|
return self._parse_sse(resp.text)
|
|
93
93
|
|