@litmusio/miravo 0.15.10 → 0.16.0
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.
- package/README.md +13 -47
- package/install.ps1 +14 -4
- package/install.sh +75 -7
- package/package.json +8 -8
package/README.md
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
<p align="center"><strong>Miravo</strong> (pronounced <code>mih-RAH-voh</code>) is an open-source factory simulator. Tell your agent the plant you need and it builds it, runs it and hands you the endpoints. Then break a machine and watch your software react.</p>
|
|
8
8
|
|
|
9
9
|
<p align="center">
|
|
10
|
-
<img src="https://miravo.litmus.dev/
|
|
10
|
+
<img src="https://miravo.litmus.dev/floors/smart-factory.webp" alt="Miravo factory floor" width="80%" />
|
|
11
11
|
</p>
|
|
12
12
|
|
|
13
13
|
---
|
|
@@ -20,7 +20,16 @@ Paste this into Claude Code, Codex or any agent that loads Agent Skills:
|
|
|
20
20
|
Set me up with Miravo. Fetch https://miravo.litmus.dev/agent-setup.md and follow it.
|
|
21
21
|
```
|
|
22
22
|
|
|
23
|
-
Your agent installs Miravo and
|
|
23
|
+
Your agent installs Miravo and offers you a running factory. Name your own plant in the prompt and it builds that instead.
|
|
24
|
+
|
|
25
|
+
Then ask in plain language:
|
|
26
|
+
|
|
27
|
+
- "Build a chocolate factory with tempering, enrobing, a cooling tunnel and a wrapper that jams every few hours. Then draw it live."
|
|
28
|
+
- "Simulate an offshore gas platform on OPC UA and make the export compressor surge."
|
|
29
|
+
- "Spin up 500 CNC machines on Modbus so I can load-test my historian."
|
|
30
|
+
- "Run a brewery for a simulated month at 1000x and tell me which pump fails first."
|
|
31
|
+
- "Trip a chiller in the data-center cooling plant and show me how fast the server rooms heat up."
|
|
32
|
+
- "Here's our P&ID. Build the plant from it and give me the OPC UA tags."
|
|
24
33
|
|
|
25
34
|
### Or install it yourself
|
|
26
35
|
|
|
@@ -56,55 +65,12 @@ docker run --rm -p 127.0.0.1:8080:8080 -p 127.0.0.1:1883:1883 -p 127.0.0.1:4840:
|
|
|
56
65
|
|
|
57
66
|
The Console is served at `http://127.0.0.1:8080`. The install scripts and the standalone binaries need neither Node.js nor Docker. [All install options](https://miravo.litmus.dev/docs#install-miravo-yourself)
|
|
58
67
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
## Use it with your agent
|
|
62
|
-
|
|
63
|
-
The [Miravo skill](https://miravo.litmus.dev/docs/agents) lets your agent build the plant, run it, break machines when you ask, check every endpoint and hand you the connection details. The setup prompt installs it. To add it yourself, run:
|
|
68
|
+
Add the agent skill, which drives the `miravo` CLI:
|
|
64
69
|
|
|
65
70
|
```shell
|
|
66
71
|
npx skills add litmusautomation/miravo --skill miravo
|
|
67
72
|
```
|
|
68
73
|
|
|
69
|
-
The skill drives the `miravo` CLI, so [install Miravo](https://miravo.litmus.dev/docs#install-miravo-yourself) first. Then ask in plain language:
|
|
70
|
-
|
|
71
|
-
- "Build me a cold-storage warehouse with ammonia compressors, evaporators and dock doors. Serve it on Modbus and draw it live."
|
|
72
|
-
- "Start the smart factory on MQTT, jam the press valve and show me everything that broke downstream."
|
|
73
|
-
- "Run the commercial building at 100x until a supply fan bearing fails, then tell me which value warned first."
|
|
74
|
-
|
|
75
|
-
## What you can do
|
|
76
|
-
|
|
77
|
-
- Start from one of six [built-in templates](https://miravo.litmus.dev/docs/templates) (smart factory, water treatment, commercial building, backup power, district heating, pharma cleanroom), or have your agent build the plant you describe from 19 built-in asset models and the new ones it writes.
|
|
78
|
-
- Break it on purpose. Inject a fault and watch it reach the machines around it, or run the clock faster to see months of wear in an afternoon.
|
|
79
|
-
- Connect over OPC UA, Modbus TCP, Siemens S7, MQTT and Sparkplug B to the same running factory, and watch each built-in factory run on a live floor in the Console.
|
|
80
|
-
- Repeat a run. A fresh run with the same Miravo build, models, template, seed, speed and tick gives the same values, for CI, demos and load tests.
|
|
81
|
-
- Connect [Litmus Edge](https://miravo.litmus.dev/docs/integrations/litmus-edge). It is a built-in integration: your agent exports the running factory, so every machine arrives connected and in context.
|
|
82
|
-
|
|
83
|
-
## See a fault spread
|
|
84
|
-
|
|
85
|
-
Start the Smart Factory machining line (CNC, unload robot, wash, press, test, packing robot) at 10× speed:
|
|
86
|
-
|
|
87
|
-
```shell
|
|
88
|
-
miravo start -t smart-factory --speed 10
|
|
89
|
-
```
|
|
90
|
-
|
|
91
|
-
Point your software at it:
|
|
92
|
-
|
|
93
|
-
| Protocol | Endpoint |
|
|
94
|
-
| ---------- | ------------------------------------------------------------------- |
|
|
95
|
-
| OPC UA | `opc.tcp://127.0.0.1:4840` |
|
|
96
|
-
| MQTT | `mqtt://127.0.0.1:1883`, topics under `MiravoWorks/smart-factory/#` |
|
|
97
|
-
| Modbus TCP | `127.0.0.1:1502`, holding registers |
|
|
98
|
-
|
|
99
|
-
Each station publishes `state`, `good_count`, `scrap_count`, cycle times and time spent per state. In a second terminal, jam a valve on the press and watch the line react:
|
|
100
|
-
|
|
101
|
-
```shell
|
|
102
|
-
miravo inject press-001 valve_stuck
|
|
103
|
-
miravo status --watch
|
|
104
|
-
```
|
|
105
|
-
|
|
106
|
-
The press stops. The wash station blocks as its buffer fills, the test station starves, and every station's counters and state times keep the record your OEE logic needs. Sparkplug B starts with `--sparkplug`. Siemens S7 needs `s7` in the template's `protocols` block. See [S7](https://miravo.litmus.dev/docs/protocols/s7) and [Sparkplug B](https://miravo.litmus.dev/docs/protocols/sparkplug).
|
|
107
|
-
|
|
108
74
|
## Who it's for
|
|
109
75
|
|
|
110
76
|
- Dashboards, historians, UNS pipelines, MES and OEE apps that need structured live data.
|
|
@@ -135,7 +101,7 @@ Miravo is a community-driven open-source project, not a supported Litmus commerc
|
|
|
135
101
|
|
|
136
102
|
## Credit
|
|
137
103
|
|
|
138
|
-
[Amine Amaach](https://www.linkedin.com/in/amine-amaach)
|
|
104
|
+
Miravo is the brainchild of [Amine Amaach](https://www.linkedin.com/in/amine-amaach), who architected and built this solution from the ground up here at Litmus. This project stands as a testament to his exceptional technical vision, software design, and problem-solving skills. We are incredibly proud to champion his work and officially open-source it under the Litmus Automation GitHub organization, ensuring his contributions can drive impact across the broader developer community.
|
|
139
105
|
|
|
140
106
|
## License
|
|
141
107
|
|
package/install.ps1
CHANGED
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
|
|
55
55
|
$dest = Join-Path $InstallDir "miravo.exe"
|
|
56
56
|
$installedVersion = ""
|
|
57
|
-
$payload = @("miravo.exe", "console-dist\index.html", "nodesets\Opc.Ua.NodeSet2.xml", "native\miravo-s7.node")
|
|
57
|
+
$payload = @("miravo.exe", "console-dist\index.html", "nodesets\Opc.Ua.NodeSet2.xml", "native\miravo-s7.node", "licenses\LICENSE")
|
|
58
58
|
$missing = @($payload | Where-Object { -not (Test-Path -LiteralPath (Join-Path $InstallDir $_) -PathType Leaf) })
|
|
59
59
|
if ($missing.Count -eq 0) {
|
|
60
60
|
$ErrorActionPreference = "Continue"
|
|
@@ -105,7 +105,10 @@
|
|
|
105
105
|
$entries = & $tar -tzf $tgz
|
|
106
106
|
if ($LASTEXITCODE -ne 0) { Fail "could not inspect the download." $Retry }
|
|
107
107
|
if ($entries | Where-Object { $_ -like "package/native/*" }) { $payloadDirs += "native" }
|
|
108
|
-
$
|
|
108
|
+
$licenseFiles = @(@("LICENSE", "NOTICE", "THIRD_PARTY_NOTICES.md", "THIRD_PARTY_LICENSES.txt") | Where-Object { $entries -contains "package/$_" })
|
|
109
|
+
$licenseTexts = [bool]($entries | Where-Object { $_ -like "package/licenses/*" })
|
|
110
|
+
$extractPaths = @("package/miravo.exe") + @($payloadDirs | ForEach-Object { "package/$_" }) + @($licenseFiles | ForEach-Object { "package/$_" })
|
|
111
|
+
if ($licenseTexts) { $extractPaths += "package/licenses" }
|
|
109
112
|
& $tar -xzf $tgz -C $work @extractPaths
|
|
110
113
|
if ($LASTEXITCODE -ne 0) { Fail "could not extract the download." "Retry; the download may be incomplete." }
|
|
111
114
|
$source = Join-Path $work "package"
|
|
@@ -115,6 +118,12 @@
|
|
|
115
118
|
}
|
|
116
119
|
}
|
|
117
120
|
|
|
121
|
+
$bundle = Join-Path $work "licenses"
|
|
122
|
+
New-Item -ItemType Directory -Path $bundle | Out-Null
|
|
123
|
+
foreach ($file in $licenseFiles) { Move-Item -Path (Join-Path $source $file) -Destination $bundle }
|
|
124
|
+
if ($licenseTexts) { Move-Item -Path (Join-Path $source "licenses") -Destination (Join-Path $bundle "licenses") }
|
|
125
|
+
$payloadDirs += "licenses"
|
|
126
|
+
|
|
118
127
|
New-Item -ItemType Directory -Force -Path $InstallDir | Out-Null
|
|
119
128
|
$dest = Join-Path $InstallDir "miravo.exe"
|
|
120
129
|
# Staged next to the old binary, so the final move is a same-volume rename.
|
|
@@ -134,7 +143,7 @@
|
|
|
134
143
|
Fail "the downloaded miravo does not run on this machine. Nothing was installed." "Install with npm (npm install -g $Package) or use the Docker image ghcr.io/litmusautomation/miravo."
|
|
135
144
|
}
|
|
136
145
|
|
|
137
|
-
# Swap console-dist and
|
|
146
|
+
# Swap console-dist, nodesets, native and licenses, keeping the old copies until the binary
|
|
138
147
|
# is in place so a failure leaves the previous install working.
|
|
139
148
|
$suffix = [IO.Path]::GetRandomFileName()
|
|
140
149
|
$moved = @()
|
|
@@ -145,7 +154,8 @@
|
|
|
145
154
|
Move-Item -Path $current -Destination "$current.old-$suffix"
|
|
146
155
|
$moved += $dir
|
|
147
156
|
}
|
|
148
|
-
|
|
157
|
+
$from = if ($dir -eq "licenses") { $bundle } else { Join-Path $source $dir }
|
|
158
|
+
Move-Item -Path $from -Destination $current
|
|
149
159
|
}
|
|
150
160
|
Move-Item -Force -Path $staged -Destination $dest
|
|
151
161
|
} catch {
|
package/install.sh
CHANGED
|
@@ -245,7 +245,7 @@ check_existing_version() {
|
|
|
245
245
|
installed_output="$("$INSTALL_DIR/$APP" --version 2>/dev/null)" || installed_output=""
|
|
246
246
|
installed_version="${installed_output%%$'\n'*}"
|
|
247
247
|
installed_version="${installed_version//[[:space:]]/}"
|
|
248
|
-
if [[ "$installed_version" == "$specific_version" && -f "$INSTALL_DIR/console-dist/index.html" && -f "$INSTALL_DIR/$STANDARD_NODESET_REL_PATH" && -f "$INSTALL_DIR/native/miravo-s7.node" ]]; then
|
|
248
|
+
if [[ "$installed_version" == "$specific_version" && -f "$INSTALL_DIR/console-dist/index.html" && -f "$INSTALL_DIR/$STANDARD_NODESET_REL_PATH" && -f "$INSTALL_DIR/native/miravo-s7.node" && -f "$INSTALL_DIR/licenses/LICENSE" ]]; then
|
|
249
249
|
print_message info "${MUTED}Version ${NC}$specific_version${MUTED} already installed${NC}"
|
|
250
250
|
exit 0
|
|
251
251
|
fi
|
|
@@ -277,6 +277,12 @@ shell_quote() {
|
|
|
277
277
|
printf "%s%s" "$value" "'"
|
|
278
278
|
}
|
|
279
279
|
|
|
280
|
+
fish_quote() {
|
|
281
|
+
local value=${1//\\/\\\\}
|
|
282
|
+
value=${value//\'/\\\'}
|
|
283
|
+
printf "'%s'" "$value"
|
|
284
|
+
}
|
|
285
|
+
|
|
280
286
|
validate_source_binary() {
|
|
281
287
|
local source_binary=$1
|
|
282
288
|
local origin=$2
|
|
@@ -422,12 +428,38 @@ replace_installed_payload() {
|
|
|
422
428
|
rm -rf "$old_console" "$old_nodesets" "$old_native"
|
|
423
429
|
}
|
|
424
430
|
|
|
431
|
+
install_licenses() {
|
|
432
|
+
local source_licenses=$1
|
|
433
|
+
local staged_licenses old_licenses
|
|
434
|
+
staged_licenses="$INSTALL_DIR/.licenses.tmp.$$"
|
|
435
|
+
old_licenses="$INSTALL_DIR/.licenses.old.$$"
|
|
436
|
+
rm -rf "$staged_licenses" "$old_licenses"
|
|
437
|
+
|
|
438
|
+
if [[ -n "$source_licenses" ]]; then
|
|
439
|
+
cp -RL "$source_licenses" "$staged_licenses" || die "Failed to stage licence files" "Check permissions for $INSTALL_DIR."
|
|
440
|
+
fi
|
|
441
|
+
|
|
442
|
+
if [[ -e "$INSTALL_DIR/licenses" || -L "$INSTALL_DIR/licenses" ]]; then
|
|
443
|
+
mv "$INSTALL_DIR/licenses" "$old_licenses" || {
|
|
444
|
+
rm -rf "$staged_licenses"
|
|
445
|
+
die "Failed to move existing licence files" "Check permissions for $INSTALL_DIR."
|
|
446
|
+
}
|
|
447
|
+
fi
|
|
448
|
+
if [[ -d "$staged_licenses" ]] && ! mv "$staged_licenses" "$INSTALL_DIR/licenses"; then
|
|
449
|
+
[[ ! -e "$old_licenses" ]] || mv "$old_licenses" "$INSTALL_DIR/licenses" || true
|
|
450
|
+
rm -rf "$staged_licenses"
|
|
451
|
+
die "Failed to install licence files" "Check permissions for $INSTALL_DIR."
|
|
452
|
+
fi
|
|
453
|
+
rm -rf "$old_licenses"
|
|
454
|
+
}
|
|
455
|
+
|
|
425
456
|
install_payload() {
|
|
426
457
|
local source_binary=$1
|
|
427
458
|
local source_console=$2
|
|
428
459
|
local source_nodesets=$3
|
|
429
460
|
local origin=$4
|
|
430
461
|
local allow_symlink=$5
|
|
462
|
+
local source_licenses=${6:-}
|
|
431
463
|
local staged_binary staged_console staged_nodesets staged_native source_native
|
|
432
464
|
|
|
433
465
|
validate_source_binary "$source_binary" "$origin" "$allow_symlink"
|
|
@@ -451,6 +483,7 @@ install_payload() {
|
|
|
451
483
|
fi
|
|
452
484
|
|
|
453
485
|
replace_installed_payload "$staged_binary" "$staged_console" "$staged_nodesets" "$staged_native"
|
|
486
|
+
install_licenses "$source_licenses"
|
|
454
487
|
}
|
|
455
488
|
|
|
456
489
|
validate_archive_contents() {
|
|
@@ -567,6 +600,17 @@ verify_integrity() {
|
|
|
567
600
|
fi
|
|
568
601
|
}
|
|
569
602
|
|
|
603
|
+
require_musl_runtime() {
|
|
604
|
+
local lib dir found
|
|
605
|
+
for lib in libstdc++.so.6 libgcc_s.so.1; do
|
|
606
|
+
found=""
|
|
607
|
+
for dir in /lib /usr/lib /usr/local/lib; do
|
|
608
|
+
[[ -e "$dir/$lib" ]] && found=1 && break
|
|
609
|
+
done
|
|
610
|
+
[[ -n "$found" ]] || die "Miravo on musl Linux needs $lib" "Install it, then rerun: apk add libstdc++ libgcc"
|
|
611
|
+
done
|
|
612
|
+
}
|
|
613
|
+
|
|
570
614
|
download_and_install() {
|
|
571
615
|
local platform_package label manifest tarball_url integrity archive_path
|
|
572
616
|
platform_package="@litmusio/miravo-cli-$target"
|
|
@@ -595,7 +639,15 @@ download_and_install() {
|
|
|
595
639
|
tar -xzf "$archive_path" -C "$WORK_DIR" || die "Failed to extract $label" "Install tar, then rerun."
|
|
596
640
|
reject_extracted_symlinks "$WORK_DIR/package"
|
|
597
641
|
|
|
598
|
-
|
|
642
|
+
local licenses_dir="$WORK_DIR/package-licenses" licence_file
|
|
643
|
+
mkdir -p "$licenses_dir"
|
|
644
|
+
for licence_file in LICENSE NOTICE THIRD_PARTY_NOTICES.md THIRD_PARTY_LICENSES.txt licenses; do
|
|
645
|
+
if [[ -e "$WORK_DIR/package/$licence_file" ]]; then
|
|
646
|
+
cp -R "$WORK_DIR/package/$licence_file" "$licenses_dir/$licence_file" || die "Failed to stage $licence_file" "Check free space in ${TMPDIR:-/tmp}."
|
|
647
|
+
fi
|
|
648
|
+
done
|
|
649
|
+
|
|
650
|
+
install_payload "$WORK_DIR/package/$APP" "$WORK_DIR/package/console-dist" "$WORK_DIR/package/nodesets" "Package $label" "false" "$licenses_dir"
|
|
599
651
|
}
|
|
600
652
|
|
|
601
653
|
add_to_path() {
|
|
@@ -618,7 +670,7 @@ add_to_path() {
|
|
|
618
670
|
}
|
|
619
671
|
|
|
620
672
|
update_path() {
|
|
621
|
-
local xdg_config_home current_shell config_file command quoted_install_dir
|
|
673
|
+
local xdg_config_home current_shell config_file command quoted_install_dir create_file raw_os
|
|
622
674
|
local -a config_files
|
|
623
675
|
if [[ "$no_modify_path" == "true" ]]; then
|
|
624
676
|
path_status="not modified"
|
|
@@ -642,6 +694,7 @@ update_path() {
|
|
|
642
694
|
"$xdg_config_home/zsh/.zshenv"
|
|
643
695
|
)
|
|
644
696
|
command="export PATH=$quoted_install_dir:\"\$PATH\""
|
|
697
|
+
create_file="${ZDOTDIR:-$INSTALL_HOME}/.zshrc"
|
|
645
698
|
;;
|
|
646
699
|
bash)
|
|
647
700
|
config_files=(
|
|
@@ -652,6 +705,16 @@ update_path() {
|
|
|
652
705
|
"$xdg_config_home/bash/.bashrc"
|
|
653
706
|
)
|
|
654
707
|
command="export PATH=$quoted_install_dir:\"\$PATH\""
|
|
708
|
+
raw_os="${_MIRAVO_INSTALL_OS:-$(uname -s)}"
|
|
709
|
+
case "$raw_os" in
|
|
710
|
+
Darwin | darwin) create_file="$INSTALL_HOME/.bash_profile" ;;
|
|
711
|
+
*) create_file="$INSTALL_HOME/.bashrc" ;;
|
|
712
|
+
esac
|
|
713
|
+
;;
|
|
714
|
+
fish)
|
|
715
|
+
config_files=("$xdg_config_home/fish/config.fish")
|
|
716
|
+
command="fish_add_path $(fish_quote "$INSTALL_DIR")"
|
|
717
|
+
create_file="$xdg_config_home/fish/config.fish"
|
|
655
718
|
;;
|
|
656
719
|
*)
|
|
657
720
|
path_status="manual update required"
|
|
@@ -670,10 +733,14 @@ update_path() {
|
|
|
670
733
|
done
|
|
671
734
|
|
|
672
735
|
if [[ -z "$config_file" ]]; then
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
736
|
+
if mkdir -p "$(dirname "$create_file")" && : >"$create_file"; then
|
|
737
|
+
config_file="$create_file"
|
|
738
|
+
else
|
|
739
|
+
path_status="manual update required"
|
|
740
|
+
print_message warning "Could not create $create_file. Add Miravo to PATH manually:"
|
|
741
|
+
print_message info " $command"
|
|
742
|
+
return 0
|
|
743
|
+
fi
|
|
677
744
|
fi
|
|
678
745
|
|
|
679
746
|
add_to_path "$config_file" "$command"
|
|
@@ -736,6 +803,7 @@ else
|
|
|
736
803
|
target="$(resolve_platform)"
|
|
737
804
|
fi
|
|
738
805
|
|
|
806
|
+
[[ "$target" != *-musl || -n "${_MIRAVO_INSTALL_LIBC:-}" ]] || require_musl_runtime
|
|
739
807
|
download_and_install
|
|
740
808
|
fi
|
|
741
809
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@litmusio/miravo",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.16.0",
|
|
4
4
|
"description": "Open-source factory simulator. Describe a plant and your agent builds it: machines that wear and fail on demand, live over OPC UA, Modbus TCP, S7, MQTT and Sparkplug B.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"factory simulator",
|
|
@@ -49,13 +49,13 @@
|
|
|
49
49
|
"node": ">=18"
|
|
50
50
|
},
|
|
51
51
|
"optionalDependencies": {
|
|
52
|
-
"@litmusio/miravo-cli-linux-x64": "0.
|
|
53
|
-
"@litmusio/miravo-cli-linux-arm64": "0.
|
|
54
|
-
"@litmusio/miravo-cli-linux-x64-musl": "0.
|
|
55
|
-
"@litmusio/miravo-cli-linux-arm64-musl": "0.
|
|
56
|
-
"@litmusio/miravo-cli-darwin-x64": "0.
|
|
57
|
-
"@litmusio/miravo-cli-darwin-arm64": "0.
|
|
58
|
-
"@litmusio/miravo-cli-windows-x64": "0.
|
|
52
|
+
"@litmusio/miravo-cli-linux-x64": "0.16.0",
|
|
53
|
+
"@litmusio/miravo-cli-linux-arm64": "0.16.0",
|
|
54
|
+
"@litmusio/miravo-cli-linux-x64-musl": "0.16.0",
|
|
55
|
+
"@litmusio/miravo-cli-linux-arm64-musl": "0.16.0",
|
|
56
|
+
"@litmusio/miravo-cli-darwin-x64": "0.16.0",
|
|
57
|
+
"@litmusio/miravo-cli-darwin-arm64": "0.16.0",
|
|
58
|
+
"@litmusio/miravo-cli-windows-x64": "0.16.0"
|
|
59
59
|
},
|
|
60
60
|
"exports": {
|
|
61
61
|
"./package.json": "./package.json"
|