schematex 0.9.6 → 0.9.7
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/dist/ai/ai-sdk.cjs +7 -7
- package/dist/ai/ai-sdk.js +2 -2
- package/dist/ai/index.cjs +16 -16
- package/dist/ai/index.js +3 -3
- package/dist/browser.cjs +8 -8
- package/dist/browser.js +2 -2
- package/dist/{chunk-4W75FGWO.js → chunk-3K4WCRVI.js} +89 -20
- package/dist/chunk-3K4WCRVI.js.map +1 -0
- package/dist/{chunk-KH5GRKUM.cjs → chunk-6X7MVZZT.cjs} +89 -20
- package/dist/chunk-6X7MVZZT.cjs.map +1 -0
- package/dist/{chunk-CVTHUOAM.js → chunk-DVRB64CN.js} +33 -8
- package/dist/chunk-DVRB64CN.js.map +1 -0
- package/dist/{chunk-HX64QWB6.cjs → chunk-ECHPMEZX.cjs} +35 -10
- package/dist/chunk-ECHPMEZX.cjs.map +1 -0
- package/dist/index.cjs +34 -34
- package/dist/index.js +2 -2
- package/dist/react.cjs +2 -2
- package/dist/react.js +1 -1
- package/package.json +3 -1
- package/dist/chunk-4W75FGWO.js.map +0 -1
- package/dist/chunk-CVTHUOAM.js.map +0 -1
- package/dist/chunk-HX64QWB6.cjs.map +0 -1
- package/dist/chunk-KH5GRKUM.cjs.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { parseResult, renderResult } from './chunk-
|
|
1
|
+
import { parseResult, renderResult } from './chunk-3K4WCRVI.js';
|
|
2
2
|
|
|
3
3
|
// src/ai/registry.ts
|
|
4
4
|
var DIAGRAM_REGISTRY = [
|
|
@@ -413,7 +413,7 @@ var DIAGRAM_REGISTRY = [
|
|
|
413
413
|
type: "rbd",
|
|
414
414
|
name: "Reliability Block Diagram (RBD)",
|
|
415
415
|
tagline: "The success-logic diagram that computes its own system reliability \u2014 series/parallel/k-of-n reduction, Birnbaum importance, and single-point-of-failure detection.",
|
|
416
|
-
useWhen: 'Use to model whether a system *works* from the reliability of its components, and to compute the overall figure \u2014 RAMS analysis, redundancy/high-availability design, fault-tolerance trade studies. Header `rbd`; nest `series { \u2026 }`, `parallel { \u2026 }`, and `kofn k/n { \u2026 }` success-logic groups around `block ID "Label" R=0.99` leaves (`p=0.01` failure prob or `R=99%` also accepted). The engine computes system reliability (\u220F for series, 1\u2212\u220F(1\u2212R\u1D62) for parallel, exact k-of-n), the Birnbaum reliability-importance of every block, and flags blocks whose failure alone fails the system (SPOF, drawn in red). Sibling of fault tree (\xA737) in the risk-reliability cluster.',
|
|
416
|
+
useWhen: 'Use to model whether a system *works* from the reliability of its components, and to compute the overall figure \u2014 RAMS analysis, redundancy/high-availability design, fault-tolerance trade studies. Header `rbd`; nest `series { \u2026 }`, `parallel { \u2026 }`, and `kofn k/n { \u2026 }` success-logic groups around `block ID "Label" R=0.99` leaves (`p=0.01` failure prob or `R=99%` also accepted). The engine computes system reliability (\u220F for series, 1\u2212\u220F(1\u2212R\u1D62) for parallel, exact k-of-n), the Birnbaum reliability-importance of every block, and flags blocks whose failure alone fails the system (SPOF, drawn in red). For reliability over a mission, add `mission: <t>` and give blocks a distribution \u2014 `rate=\u03BB`/`mtbf=N` (exponential) or `weibull=\u03B2,\u03B7` \u2014 and the engine evaluates R(t). Sibling of fault tree (\xA737) in the risk-reliability cluster.',
|
|
417
417
|
cluster: "risk-reliability",
|
|
418
418
|
standard: "IEC 61078:2016 \xB7 MIL-HDBK-338B; see 50-RBD-STANDARD.md",
|
|
419
419
|
syntaxKey: "rbd",
|
|
@@ -434,7 +434,11 @@ var DIAGRAM_REGISTRY = [
|
|
|
434
434
|
"RAMS",
|
|
435
435
|
"Birnbaum importance",
|
|
436
436
|
"single point of failure",
|
|
437
|
-
"fault tolerance"
|
|
437
|
+
"fault tolerance",
|
|
438
|
+
"MTBF",
|
|
439
|
+
"Weibull",
|
|
440
|
+
"mission time reliability",
|
|
441
|
+
"reliability over time"
|
|
438
442
|
]
|
|
439
443
|
},
|
|
440
444
|
// ── Systems thinking / stochastic ────────────────────────────
|
|
@@ -3607,6 +3611,26 @@ A textbook fly-by-wire architecture, the kind certified under ARP4761: **2-out-o
|
|
|
3607
3611
|
|
|
3608
3612
|
**The architecture's whole point is a number, and the engine computes it.** Each subsystem is driven so close to 1 that the product still lands at a system reliability of **\u2248 0.999998** \u2014 and Schematex prints the nines rather than rounding to "1", because in this domain the nines *are* the answer. No single point of failure remains, which is exactly the design intent the diagram now proves rather than merely asserts.`
|
|
3609
3613
|
},
|
|
3614
|
+
{
|
|
3615
|
+
"slug": "rbd-pump-station-mission",
|
|
3616
|
+
"diagram": "rbd",
|
|
3617
|
+
"title": "Pump station reliability over a 1-year mission (R(t))",
|
|
3618
|
+
"description": "A reliability block diagram evaluated at a mission time \u2014 two redundant pumps with exponential (MTBF) and Weibull failure distributions. The engine computes R(t) for each block from its distribution and rolls it up to the system reliability at t = 8760 hours.",
|
|
3619
|
+
"standard": "IEC 61078 (RBD) + IEC 61810 / MIL-HDBK-217 (R(t))",
|
|
3620
|
+
"tags": [
|
|
3621
|
+
"rbd",
|
|
3622
|
+
"reliability",
|
|
3623
|
+
"mission-time",
|
|
3624
|
+
"mtbf",
|
|
3625
|
+
"weibull",
|
|
3626
|
+
"redundancy",
|
|
3627
|
+
"availability"
|
|
3628
|
+
],
|
|
3629
|
+
"complexity": 3,
|
|
3630
|
+
"featured": false,
|
|
3631
|
+
"dsl": 'rbd "Pump Station \u2014 1-year mission"\n mission: 8760\n series {\n block CTRL "Controller" mtbf=50000\n parallel {\n block A "Pump A" mtbf=10000\n block B "Pump B" weibull=1.5,12000\n }\n }',
|
|
3632
|
+
"notes": "## What this shows\n\nStatic reliabilities are the entry point; real RAMS work is **reliability over a mission**. Here `mission: 8760` (one year in hours) turns each block's failure distribution into an **R(t)**: the controller and Pump A use an exponential model from their **MTBF**, while Pump B uses a **Weibull** (\u03B2 = 1.5, so a gently increasing hazard \u2014 wear-out).\n\n**The engine evaluates R(t) per block and composes it.** Pump A's `e^(\u22128760/10000) \u2248 0.42` and Pump B's `e^(\u2212(8760/12000)^1.5) \u2248 0.54` combine in parallel to \u2248 0.73, then multiply by the controller in series \u2014 the headline reads `R(t=8760) = \u2026`. Change the mission time and every figure, and the importance ranking, recomputes. Constant `R=` blocks still work and mix freely with distributions."
|
|
3633
|
+
},
|
|
3610
3634
|
{
|
|
3611
3635
|
"slug": "rbd-redundant-server",
|
|
3612
3636
|
"diagram": "rbd",
|
|
@@ -4586,7 +4610,7 @@ var SYNTAX = {
|
|
|
4586
4610
|
},
|
|
4587
4611
|
"rbd": {
|
|
4588
4612
|
"title": "Reliability Block Diagram",
|
|
4589
|
-
"content": '## 1. Your first diagram\n\nEvery document starts with the `rbd` keyword (alias `reliability`), an optional title, then nested success-logic groups around `block` leaves:\n\n```\nrbd "Two redundant pumps"\n parallel {\n block A "Pump A" R=0.9\n block B "Pump B" R=0.9\n }\n```\n\nThe engine draws the two pumps on parallel rails between a split node and a join node, computes the system reliability `1 \u2212 (1\u22120.9)(1\u22120.9) = 0.99`, and prints it as the headline. A bare top-level list of blocks (no outer group) is treated as a **series** chain.\n\n## 2. Blocks\n\nA `block` is one component on a success path:\n\n```\nblock ID "Label" R=0.99\n```\n\n- `ID` \u2014 a short identifier (shown when no label is given).\n- `"Label"` \u2014 an optional display name (CJK quotes welcome).\n- Reliability is given as **`R=0.99`** (reliability/availability), **`p=0.01`** (probability of *failure*, \u2192 R = 1\u2212p), or a percentage **`R=99%`**. A block with no reliability leaves the system figure symbolic (`n/a`).\n\n## 3. Success-logic groups\n\nGroups nest freely, so you can model redundant chains, voting banks, and standby pairs:\n\n| Group | Succeeds when | Reliability |\n|-------|---------------|-------------|\n| `series { \u2026 }` | **every** child works | \u220F R\u1D62 |\n| `parallel { \u2026 }` | **any** child works | 1 \u2212 \u220F(1 \u2212 R\u1D62) |\n| `kofn k/n { \u2026 }` | **\u2265 k of n** children work | exact state enumeration |\n\n```\nseries {\n block CTRL "Controller" R=0.995\n parallel {\n series { block P1 "Path 1 sensor" R=0.97\n block A1 "Path 1 actuator" R=0.98 }\n series { block P2 "Path 2 sensor" R=0.97\n block A2 "Path 2 actuator" R=0.98 }\n }\n}\n```\n\n## 4. Computed reliability, importance & SPOF\n\nAfter parsing, the engine computes:\n\n- **System reliability** \u2014 the headline figure, by recursive series/parallel/k-of-n reduction.\n- **Birnbaum importance** `I\u1D2E(i) = R_sys(R\u1D62=1) \u2212 R_sys(R\u1D62=0)` for every block; the highest-importance block (the improvement target) is accented.\n- **Single points of failure** \u2014 any block where `R_sys(R\u1D62=0) = 0` (its failure alone fails the system) is drawn with a red border. A non-redundant block in series is always a SPOF.\n\n## 5. Validation\n\nThe parser reports non-fatal warnings rather than failing:\n\n- a `kofn k/n` threshold with `k > n` is clamped to `n` (and `k < 1` to `1`);\n- a reliability outside `0..1` is clamped;\n- a duplicate block id is flagged.\n\n##
|
|
4613
|
+
"content": '## 1. Your first diagram\n\nEvery document starts with the `rbd` keyword (alias `reliability`), an optional title, then nested success-logic groups around `block` leaves:\n\n```\nrbd "Two redundant pumps"\n parallel {\n block A "Pump A" R=0.9\n block B "Pump B" R=0.9\n }\n```\n\nThe engine draws the two pumps on parallel rails between a split node and a join node, computes the system reliability `1 \u2212 (1\u22120.9)(1\u22120.9) = 0.99`, and prints it as the headline. A bare top-level list of blocks (no outer group) is treated as a **series** chain.\n\n## 2. Blocks\n\nA `block` is one component on a success path:\n\n```\nblock ID "Label" R=0.99\n```\n\n- `ID` \u2014 a short identifier (shown when no label is given).\n- `"Label"` \u2014 an optional display name (CJK quotes welcome).\n- Reliability is given as **`R=0.99`** (reliability/availability), **`p=0.01`** (probability of *failure*, \u2192 R = 1\u2212p), or a percentage **`R=99%`**. A block with no reliability leaves the system figure symbolic (`n/a`).\n\n## 3. Success-logic groups\n\nGroups nest freely, so you can model redundant chains, voting banks, and standby pairs:\n\n| Group | Succeeds when | Reliability |\n|-------|---------------|-------------|\n| `series { \u2026 }` | **every** child works | \u220F R\u1D62 |\n| `parallel { \u2026 }` | **any** child works | 1 \u2212 \u220F(1 \u2212 R\u1D62) |\n| `kofn k/n { \u2026 }` | **\u2265 k of n** children work | exact state enumeration |\n\n```\nseries {\n block CTRL "Controller" R=0.995\n parallel {\n series { block P1 "Path 1 sensor" R=0.97\n block A1 "Path 1 actuator" R=0.98 }\n series { block P2 "Path 2 sensor" R=0.97\n block A2 "Path 2 actuator" R=0.98 }\n }\n}\n```\n\n## 4. Computed reliability, importance & SPOF\n\nAfter parsing, the engine computes:\n\n- **System reliability** \u2014 the headline figure, by recursive series/parallel/k-of-n reduction.\n- **Birnbaum importance** `I\u1D2E(i) = R_sys(R\u1D62=1) \u2212 R_sys(R\u1D62=0)` for every block; the highest-importance block (the improvement target) is accented.\n- **Criticality importance** `I_C(i) = I\u1D2E(i)\xB7(1\u2212R\u1D62)/(1\u2212R_sys)` \u2014 the probability block i is failed *and* critical, given the system is failed.\n- **Single points of failure** \u2014 any block where `R_sys(R\u1D62=0) = 0` (its failure alone fails the system) is drawn with a red border. A non-redundant block in series is always a SPOF.\n\n## 5. Time-dependent reliability \u2014 R(t)\n\nA static `R=` is the entry point; in practice reliability is a function of mission time. Set a **`mission: <t>`** and give blocks a failure distribution instead of a constant \u2014 the engine evaluates **R(t)** and rolls it up exactly as before. Use **consistent time units** across `mission` and the rates.\n\n| Block attribute | Model | R(t) |\n|-----------------|-------|------|\n| `rate=0.0001` | exponential (constant hazard \u03BB) | e^(\u2212\u03BBt) |\n| `mtbf=10000` | exponential (\u03BB = 1/MTBF) | e^(\u2212t/MTBF) |\n| `weibull=2,10000` | Weibull(\u03B2 shape, \u03B7 scale) | e^(\u2212(t/\u03B7)^\u03B2) |\n\n```\nrbd "Pump station \u2014 1-year mission"\n mission: 8760 # hours\n parallel {\n block A "Pump A" mtbf=10000\n block B "Pump B" weibull=1.5,12000\n }\n```\n\nThe headline becomes `R(t=8760) = \u2026`. A block with a distribution but no `mission:` warns and falls back to its constant `R=` (if any).\n\n## 6. Validation\n\nThe parser reports non-fatal warnings rather than failing:\n\n- a `kofn k/n` threshold with `k > n` is clamped to `n` (and `k < 1` to `1`);\n- a reliability outside `0..1` is clamped;\n- a duplicate block id is flagged.\n\n## 7. Theming\n\n`theme: default` uses the shared risk-reliability palette (neutral blocks, blue reliability numerals, red single-point-of-failure borders). `theme: monochrome` renders a black-and-white print version (SPOF by border weight); `theme: dark` is the Catppuccin dark variant.'
|
|
4590
4614
|
}
|
|
4591
4615
|
};
|
|
4592
4616
|
|
|
@@ -5859,7 +5883,7 @@ var PROFILES = {
|
|
|
5859
5883
|
type: "rbd",
|
|
5860
5884
|
header: 'rbd "Title"',
|
|
5861
5885
|
mode: "brace-nested success logic: series/parallel/kofn groups wrapping `block` leaves",
|
|
5862
|
-
keywords: 'header: rbd | reliability \xB7 groups: series { \u2026 } | parallel { \u2026 } | kofn k/n { \u2026 } (nestable) \xB7 leaf: block ID "Label" R=0.99 (also p=0.01 failure prob,
|
|
5886
|
+
keywords: 'header: rbd | reliability \xB7 groups: series { \u2026 } | parallel { \u2026 } | kofn k/n { \u2026 } (nestable) \xB7 leaf: block ID "Label" R=0.99 (also p=0.01 failure prob, R=99%) \xB7 time-dependent: mission: <t> + block rate=\u03BB | mtbf=N | weibull=\u03B2,\u03B7 \u2192 R(t) \xB7 engine computes system reliability + Birnbaum & criticality importance + SPOF',
|
|
5863
5887
|
forms: [
|
|
5864
5888
|
'rbd "Redundant Server"',
|
|
5865
5889
|
"series {",
|
|
@@ -5880,7 +5904,8 @@ var PROFILES = {
|
|
|
5880
5904
|
"Give every block a reliability: `R=0.99` (or failure prob `p=0.01`, or `R=99%`); the engine then computes system reliability.",
|
|
5881
5905
|
"Use `parallel { \u2026 }` for full redundancy and `kofn 2/3 { \u2026 }` for k-out-of-n voting redundancy.",
|
|
5882
5906
|
"Groups nest freely \u2014 e.g. a `parallel` of two `series` strings models redundant chains.",
|
|
5883
|
-
"A bare top-level list of blocks (no outer group) is treated as a series chain."
|
|
5907
|
+
"A bare top-level list of blocks (no outer group) is treated as a series chain.",
|
|
5908
|
+
"For reliability over a mission, add `mission: <t>` and give blocks a distribution \u2014 `rate=\u03BB` or `mtbf=N` (exponential) or `weibull=\u03B2,\u03B7` \u2014 and the engine computes R(t); keep mission and rates in the same time units."
|
|
5884
5909
|
],
|
|
5885
5910
|
avoid: [
|
|
5886
5911
|
"Don't omit the `block` keyword's reliability if you want a number \u2014 a block with no R leaves the system reliability symbolic.",
|
|
@@ -6362,5 +6387,5 @@ function matchRepair(repairs, message) {
|
|
|
6362
6387
|
}
|
|
6363
6388
|
|
|
6364
6389
|
export { DIAGRAM_REGISTRY, DIAGRAM_SINCE, getAllDiagramTypes, getDiagramMeta, getDiagramSince, getExamples, getSyntax, listDiagrams, renderDsl, resolveDiagramType, validateDsl };
|
|
6365
|
-
//# sourceMappingURL=chunk-
|
|
6366
|
-
//# sourceMappingURL=chunk-
|
|
6390
|
+
//# sourceMappingURL=chunk-DVRB64CN.js.map
|
|
6391
|
+
//# sourceMappingURL=chunk-DVRB64CN.js.map
|