schematex 0.9.4 → 0.9.5
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 +26 -0
- package/dist/ai/ai-sdk.cjs +8 -8
- package/dist/ai/ai-sdk.d.cts +3 -3
- package/dist/ai/ai-sdk.d.ts +3 -3
- package/dist/ai/ai-sdk.js +3 -3
- package/dist/ai/index.cjs +17 -17
- package/dist/ai/index.d.cts +4 -4
- package/dist/ai/index.d.ts +4 -4
- package/dist/ai/index.js +4 -4
- package/dist/{api-1xoGiseb.d.cts → api-BOJJlNb1.d.ts} +2 -2
- package/dist/{api-CgXRSnCn.d.ts → api-v9t1T1v6.d.cts} +2 -2
- package/dist/browser.cjs +9 -9
- package/dist/browser.d.cts +3 -3
- package/dist/browser.d.ts +3 -3
- package/dist/browser.js +3 -3
- package/dist/{chunk-TX3YWZZX.cjs → chunk-7EWP4OD7.cjs} +186 -6
- package/dist/chunk-7EWP4OD7.cjs.map +1 -0
- package/dist/{chunk-PFZKW3HE.js → chunk-II4GLKGF.js} +2 -2
- package/dist/chunk-II4GLKGF.js.map +1 -0
- package/dist/{chunk-UFXDAIDD.js → chunk-LMNWUZMD.js} +1255 -602
- package/dist/chunk-LMNWUZMD.js.map +1 -0
- package/dist/{chunk-WJXLF42K.cjs → chunk-N3HU635X.cjs} +2 -2
- package/dist/chunk-N3HU635X.cjs.map +1 -0
- package/dist/{chunk-NIYB6CHH.js → chunk-N524SY5D.js} +184 -4
- package/dist/chunk-N524SY5D.js.map +1 -0
- package/dist/{chunk-GTCAJPQR.cjs → chunk-Q7CWX6HA.cjs} +1256 -602
- package/dist/chunk-Q7CWX6HA.cjs.map +1 -0
- package/dist/{diagnostics-CDwnQ65n.d.cts → diagnostics-5bVLlGNj.d.cts} +1 -1
- package/dist/{diagnostics-CDwnQ65n.d.ts → diagnostics-5bVLlGNj.d.ts} +1 -1
- package/dist/diagrams/blockdiagram/index.d.cts +1 -1
- package/dist/diagrams/blockdiagram/index.d.ts +1 -1
- package/dist/diagrams/circuit/index.d.cts +1 -1
- package/dist/diagrams/circuit/index.d.ts +1 -1
- package/dist/diagrams/ecomap/index.d.cts +1 -1
- package/dist/diagrams/ecomap/index.d.ts +1 -1
- package/dist/diagrams/entity/index.d.cts +1 -1
- package/dist/diagrams/entity/index.d.ts +1 -1
- package/dist/diagrams/fishbone/index.d.cts +1 -1
- package/dist/diagrams/fishbone/index.d.ts +1 -1
- package/dist/diagrams/flowchart/index.d.cts +2 -2
- package/dist/diagrams/flowchart/index.d.ts +2 -2
- package/dist/diagrams/genogram/index.d.cts +1 -1
- package/dist/diagrams/genogram/index.d.ts +1 -1
- package/dist/diagrams/ladder/index.d.cts +1 -1
- package/dist/diagrams/ladder/index.d.ts +1 -1
- package/dist/diagrams/logic/index.d.cts +1 -1
- package/dist/diagrams/logic/index.d.ts +1 -1
- package/dist/diagrams/orgchart/index.d.cts +1 -1
- package/dist/diagrams/orgchart/index.d.ts +1 -1
- package/dist/diagrams/pedigree/index.d.cts +1 -1
- package/dist/diagrams/pedigree/index.d.ts +1 -1
- package/dist/diagrams/phylo/index.d.cts +1 -1
- package/dist/diagrams/phylo/index.d.ts +1 -1
- package/dist/diagrams/sld/index.cjs +7 -7
- package/dist/diagrams/sld/index.d.cts +1 -1
- package/dist/diagrams/sld/index.d.ts +1 -1
- package/dist/diagrams/sld/index.js +1 -1
- package/dist/diagrams/sociogram/index.d.cts +1 -1
- package/dist/diagrams/sociogram/index.d.ts +1 -1
- package/dist/diagrams/timing/index.d.cts +1 -1
- package/dist/diagrams/timing/index.d.ts +1 -1
- package/dist/diagrams/venn/index.d.cts +1 -1
- package/dist/diagrams/venn/index.d.ts +1 -1
- package/dist/{index-DNOoLmYX.d.cts → index-Cmf4Rcve.d.cts} +1 -1
- package/dist/{index-CYSH3_ca.d.ts → index-syc0E5Ss.d.ts} +1 -1
- package/dist/index.cjs +41 -37
- package/dist/index.d.cts +7 -5
- package/dist/index.d.ts +7 -5
- package/dist/index.js +4 -4
- package/dist/react.cjs +3 -3
- package/dist/react.d.cts +2 -2
- package/dist/react.d.ts +2 -2
- package/dist/react.js +2 -2
- package/dist/{tools-CbYmQ3hH.d.cts → tools-B98iarLm.d.cts} +2 -2
- package/dist/{tools-BhTti-oG.d.ts → tools-CCZ1IcIN.d.ts} +2 -2
- package/package.json +1 -1
- package/dist/chunk-GTCAJPQR.cjs.map +0 -1
- package/dist/chunk-NIYB6CHH.js.map +0 -1
- package/dist/chunk-PFZKW3HE.js.map +0 -1
- package/dist/chunk-TX3YWZZX.cjs.map +0 -1
- package/dist/chunk-UFXDAIDD.js.map +0 -1
- package/dist/chunk-WJXLF42K.cjs.map +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkQ7CWX6HA_cjs = require('./chunk-Q7CWX6HA.cjs');
|
|
4
4
|
|
|
5
5
|
// src/ai/registry.ts
|
|
6
6
|
var DIAGRAM_REGISTRY = [
|
|
@@ -389,6 +389,34 @@ var DIAGRAM_REGISTRY = [
|
|
|
389
389
|
"IEC 60812"
|
|
390
390
|
]
|
|
391
391
|
},
|
|
392
|
+
{
|
|
393
|
+
type: "rbd",
|
|
394
|
+
name: "Reliability Block Diagram (RBD)",
|
|
395
|
+
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.",
|
|
396
|
+
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.',
|
|
397
|
+
cluster: "risk-reliability",
|
|
398
|
+
standard: "IEC 61078:2016 \xB7 MIL-HDBK-338B; see 50-RBD-STANDARD.md",
|
|
399
|
+
syntaxKey: "rbd",
|
|
400
|
+
aliases: [
|
|
401
|
+
"RBD",
|
|
402
|
+
"Reliability Block Diagram",
|
|
403
|
+
"reliability diagram",
|
|
404
|
+
"availability block diagram",
|
|
405
|
+
"\u53EF\u9760\u6027\u6846\u56FE"
|
|
406
|
+
],
|
|
407
|
+
keywords: [
|
|
408
|
+
"IEC 61078",
|
|
409
|
+
"system reliability",
|
|
410
|
+
"redundancy",
|
|
411
|
+
"series parallel",
|
|
412
|
+
"k-out-of-n",
|
|
413
|
+
"high availability",
|
|
414
|
+
"RAMS",
|
|
415
|
+
"Birnbaum importance",
|
|
416
|
+
"single point of failure",
|
|
417
|
+
"fault tolerance"
|
|
418
|
+
]
|
|
419
|
+
},
|
|
392
420
|
// ── Systems thinking / stochastic ────────────────────────────
|
|
393
421
|
{
|
|
394
422
|
type: "causalloop",
|
|
@@ -692,7 +720,9 @@ var DIAGRAM_SINCE = {
|
|
|
692
720
|
// 0.9.3
|
|
693
721
|
floorplan: "0.9.3",
|
|
694
722
|
// 0.9.4 — multi-sport playbook (football X&O / basketball / soccer)
|
|
695
|
-
playbook: "0.9.4"
|
|
723
|
+
playbook: "0.9.4",
|
|
724
|
+
// 0.9.5 — reliability block diagram (IEC 61078)
|
|
725
|
+
rbd: "0.9.5"
|
|
696
726
|
};
|
|
697
727
|
function getDiagramSince(type) {
|
|
698
728
|
const resolved = resolveDiagramType(type);
|
|
@@ -3453,6 +3483,114 @@ If the LED doesn't light up, three things to check, in order: LED polarity (the
|
|
|
3453
3483
|
"dsl": "prisma\nmode: 2020-single\ntitle: Effect of exercise on chronic low-back pain \u2014 SR\n\nidentification:\n databases:\n n: 1418\n sources: PubMed=600, Embase=450, Cochrane=184, Web of Science=184\n duplicates-removed: 318\n\nscreening:\n records-screened: 1100\n excluded:\n n: 870\n reasons: irrelevant title=750, non-English=120\n\neligibility:\n full-text-assessed: 230\n excluded:\n n: 195\n reasons: wrong population=80, wrong intervention=60, wrong outcome=55\n\nincluded:\n studies: 35\n reports: 38",
|
|
3454
3484
|
"notes": '## Scenario\n\nA research librarian produces the PRISMA 2020 flow diagram for a Cochrane review submission. The journal **requires** the diagram in the exact four-row structure \u2014 Identification \u2192 Screening \u2192 Eligibility \u2192 Included \u2014 with the count `(n = \u2026)` shown in every box and the excluded boxes itemizing reasons. With the dedicated `prisma` engine the librarian writes only counts and reasons; the rigid layout, the "Records removed before screening" side-box, and the exclusion side-boxes are produced automatically and are correct by construction.\n\n## Annotation key\n\n- **`mode: 2020-single`** \u2014 one Identification column (databases & registers). Use `mode: 2020-dual` to add the "other methods" column.\n- **`identification.databases`** \u2014 `n:` is the mandatory total; `sources:` renders the per-database breakdown; `duplicates-removed:` splits out into the right-column "Records removed before screening" box automatically.\n- **`screening` / `eligibility` `excluded:` blocks** \u2014 each has its own `n:` total and an optional `reasons:` breakdown rendered in a side-box to the right, connected by a horizontal arrow.\n- **`included.studies` / `reports`** \u2014 one study can yield several reports, so both counts render.\n\n## How to read\n\nTop to bottom mirrors the PRISMA 2020 template exactly. The left capsule bands label the three canonical stages; the orange bar spans the Identification column group. Counts reconcile across stages (1418 \u2212 318 = 1100 screened; 1100 \u2212 870 = 230 assessed; 230 \u2212 195 = 35 included) \u2014 the engine warns if they don\'t.\n\n## Standard reference\n\nPage MJ, McKenzie JE, Bossuyt PM, et al. *The PRISMA 2020 statement: an updated guideline for reporting systematic reviews.* BMJ 2021;372:n71. Template: [prisma-statement.org/prisma-2020-flow-diagram](https://www.prisma-statement.org/prisma-2020-flow-diagram).'
|
|
3455
3485
|
},
|
|
3486
|
+
{
|
|
3487
|
+
"slug": "rbd-data-center-tier-iii",
|
|
3488
|
+
"diagram": "rbd",
|
|
3489
|
+
"title": "Data-center availability (Tier III power, cooling, network, storage)",
|
|
3490
|
+
"description": "A four-stage reliability block diagram for a Tier III data center \u2014 dual-source power (utility in parallel with a generator-plus-ATS chain), N+1 (2-of-3) CRAC cooling, dual core switches, and mirrored storage. The engine reduces the whole nested structure to one availability figure.",
|
|
3491
|
+
"standard": "IEC 61078 / Uptime Institute Tier III",
|
|
3492
|
+
"tags": [
|
|
3493
|
+
"rbd",
|
|
3494
|
+
"reliability",
|
|
3495
|
+
"availability",
|
|
3496
|
+
"data-center",
|
|
3497
|
+
"redundancy",
|
|
3498
|
+
"n-plus-1",
|
|
3499
|
+
"k-of-n",
|
|
3500
|
+
"series-parallel"
|
|
3501
|
+
],
|
|
3502
|
+
"complexity": 4,
|
|
3503
|
+
"featured": true,
|
|
3504
|
+
"dsl": 'rbd "Data Center Tier III Availability"\n series {\n parallel {\n block UTIL "Utility feed" R=0.999\n series {\n block GEN "Diesel generator" R=0.98\n block ATS "Transfer switch" R=0.995\n }\n }\n kofn 2/3 {\n block CRAC1 "CRAC unit 1" R=0.97\n block CRAC2 "CRAC unit 2" R=0.97\n block CRAC3 "CRAC unit 3" R=0.97\n }\n parallel {\n block SW1 "Core switch A" R=0.995\n block SW2 "Core switch B" R=0.995\n }\n parallel {\n block ST1 "Storage node A" R=0.99\n block ST2 "Storage node B" R=0.99\n }\n }',
|
|
3505
|
+
"notes": "## What this shows\n\nA realistic Tier III topology where the whole facility is a **series** of four subsystems, each internally redundant. The **power** stage is the interesting one: the utility feed runs in **parallel** with a backup *chain* \u2014 a generator that only helps if its transfer switch also works (a nested `series`). Cooling is **N+1** (`2-of-3` CRAC units), and both the network and storage tiers are mirrored pairs.\n\n**The engine reduces the nesting to one number.** It rolls the generator chain (`0.98 \xB7 0.995`) into the power parallel, evaluates the 2-of-3 cooling exactly, and multiplies the four series stages to a **facility availability of \u2248 0.9972**. No single point of failure survives \u2014 every stage has redundancy \u2014 and the Birnbaum importance ranks which subsystem to harden first. This is the kind of nested success logic a generic diagram tool draws but never computes."
|
|
3506
|
+
},
|
|
3507
|
+
{
|
|
3508
|
+
"slug": "rbd-dual-channel-safety",
|
|
3509
|
+
"diagram": "rbd",
|
|
3510
|
+
"title": "Dual-channel safety system (redundant chains)",
|
|
3511
|
+
"description": "A reliability block diagram of a 1-out-of-2 safety instrumented function \u2014 two independent sensor\u2192logic\u2192actuator channels in parallel, each a series chain. Shows how a parallel of series strings removes every single point of failure.",
|
|
3512
|
+
"standard": "IEC 61078",
|
|
3513
|
+
"tags": [
|
|
3514
|
+
"rbd",
|
|
3515
|
+
"reliability",
|
|
3516
|
+
"safety",
|
|
3517
|
+
"redundancy",
|
|
3518
|
+
"1oo2",
|
|
3519
|
+
"series-parallel"
|
|
3520
|
+
],
|
|
3521
|
+
"complexity": 2,
|
|
3522
|
+
"featured": false,
|
|
3523
|
+
"dsl": 'rbd "Dual-channel trip (1oo2)"\n parallel {\n series {\n block S1 "Sensor A" R=0.97\n block L1 "Logic A" R=0.995\n block V1 "Valve A" R=0.98\n }\n series {\n block S2 "Sensor B" R=0.97\n block L2 "Logic B" R=0.995\n block V2 "Valve B" R=0.98\n }\n }',
|
|
3524
|
+
"notes": "## What this shows\n\nA **1-out-of-2 (1oo2)** safety architecture: two complete sensor\u2192logic\u2192valve channels run in parallel, so the trip still fires if either channel works end-to-end. Each channel is itself a **series** chain \u2014 a channel needs all three of its elements.\n\n**Redundancy removes the single points of failure.** Each channel alone has reliability `0.97\xB70.995\xB70.98 \u2248 0.946`; in parallel the system reaches `1 \u2212 (1\u22120.946)\xB2 \u2248 0.997`. Because no single block's failure drops the system to zero, the engine reports **no single point of failure** \u2014 the structural goal of a redundant safety function, proven by computation rather than asserted."
|
|
3525
|
+
},
|
|
3526
|
+
{
|
|
3527
|
+
"slug": "rbd-flight-control",
|
|
3528
|
+
"diagram": "rbd",
|
|
3529
|
+
"title": "Fly-by-wire flight control (triple-redundant)",
|
|
3530
|
+
"description": "A reliability block diagram of a fly-by-wire flight-control system \u2014 2-of-3 voting flight-control computers, triple-redundant hydraulics, and dual electrical buses, all in series. The engine computes the six-nines-class system reliability the architecture is designed to hit.",
|
|
3531
|
+
"standard": "IEC 61078 / ARP4761",
|
|
3532
|
+
"tags": [
|
|
3533
|
+
"rbd",
|
|
3534
|
+
"reliability",
|
|
3535
|
+
"aerospace",
|
|
3536
|
+
"fly-by-wire",
|
|
3537
|
+
"redundancy",
|
|
3538
|
+
"k-of-n",
|
|
3539
|
+
"2oo3",
|
|
3540
|
+
"triple-redundant"
|
|
3541
|
+
],
|
|
3542
|
+
"complexity": 3,
|
|
3543
|
+
"featured": false,
|
|
3544
|
+
"dsl": 'rbd "Fly-by-wire Flight Control"\n series {\n kofn 2/3 {\n block FCC1 "Flight computer 1" R=0.9995\n block FCC2 "Flight computer 2" R=0.9995\n block FCC3 "Flight computer 3" R=0.9995\n }\n parallel {\n block HYDG "Hydraulics green" R=0.998\n block HYDB "Hydraulics blue" R=0.998\n block HYDY "Hydraulics yellow" R=0.998\n }\n parallel {\n block AC1 "AC bus 1" R=0.999\n block AC2 "AC bus 2" R=0.999\n }\n }',
|
|
3545
|
+
"notes": `## What this shows
|
|
3546
|
+
|
|
3547
|
+
A textbook fly-by-wire architecture, the kind certified under ARP4761: **2-out-of-3** voting flight-control computers (a single computer can fail or disagree without losing control), **three independent hydraulic systems** (the green/blue/yellow split of a modern airliner), and **dual electrical buses** \u2014 all in **series** because the aircraft needs computing, hydraulics, and power simultaneously.
|
|
3548
|
+
|
|
3549
|
+
**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.`
|
|
3550
|
+
},
|
|
3551
|
+
{
|
|
3552
|
+
"slug": "rbd-redundant-server",
|
|
3553
|
+
"diagram": "rbd",
|
|
3554
|
+
"title": "Redundant server reliability (series + parallel + k-of-n)",
|
|
3555
|
+
"description": "A computed reliability block diagram for a server \u2014 a single power supply in series with a redundant fan pair and a 2-of-3 disk array. The engine reduces the success logic to one system-reliability figure and flags the power supply as the single point of failure.",
|
|
3556
|
+
"standard": "IEC 61078",
|
|
3557
|
+
"tags": [
|
|
3558
|
+
"rbd",
|
|
3559
|
+
"reliability",
|
|
3560
|
+
"redundancy",
|
|
3561
|
+
"series-parallel",
|
|
3562
|
+
"k-of-n",
|
|
3563
|
+
"spof",
|
|
3564
|
+
"availability"
|
|
3565
|
+
],
|
|
3566
|
+
"complexity": 2,
|
|
3567
|
+
"featured": true,
|
|
3568
|
+
"dsl": 'rbd "Redundant Server"\n series {\n block PSU "Power Supply" R=0.99\n parallel {\n block FAN1 "Fan A" R=0.95\n block FAN2 "Fan B" R=0.95\n }\n kofn 2/3 {\n block D1 "Disk 1" R=0.97\n block D2 "Disk 2" R=0.97\n block D3 "Disk 3" R=0.97\n }\n }',
|
|
3569
|
+
"notes": "## What this shows\n\nThe three building blocks of reliability success logic in one diagram. The **single power supply** sits in series \u2014 everything depends on it. The **two fans** are in parallel, so the cooling subsystem survives either one failing. The **three disks** form a **2-of-3** array that tolerates one loss.\n\n**The number is computed, not drawn.** The engine reduces each group \u2014 fans to `1 \u2212 0.05\xB2 = 0.9975`, the disk array to `3\xB70.97\xB2\xB70.03 + 0.97\xB3 = 0.99735`, then multiplies the series chain \u2014 to a **system reliability of \u2248 0.9849**. It also derives each block's Birnbaum importance and flags the **power supply as the single point of failure** (red border): with no redundancy in series, its failure alone takes down the whole system, and it carries the highest importance \u2014 the first place to add redundancy."
|
|
3570
|
+
},
|
|
3571
|
+
{
|
|
3572
|
+
"slug": "rbd-sif-emergency-shutdown",
|
|
3573
|
+
"diagram": "rbd",
|
|
3574
|
+
"title": "Safety instrumented function (SIF) \u2014 emergency shutdown",
|
|
3575
|
+
"description": "A reliability block diagram of an IEC 61511 emergency-shutdown loop \u2014 2-of-3 voting pressure transmitters, a redundant logic solver, and 1-out-of-2 shutdown valves. The classic sensor \u2192 logic \u2192 final-element SIF architecture, with the engine computing the loop reliability.",
|
|
3576
|
+
"standard": "IEC 61078 / IEC 61511 (SIF)",
|
|
3577
|
+
"tags": [
|
|
3578
|
+
"rbd",
|
|
3579
|
+
"reliability",
|
|
3580
|
+
"safety",
|
|
3581
|
+
"sif",
|
|
3582
|
+
"sil",
|
|
3583
|
+
"iec-61511",
|
|
3584
|
+
"k-of-n",
|
|
3585
|
+
"2oo3",
|
|
3586
|
+
"1oo2",
|
|
3587
|
+
"redundancy"
|
|
3588
|
+
],
|
|
3589
|
+
"complexity": 3,
|
|
3590
|
+
"featured": false,
|
|
3591
|
+
"dsl": 'rbd "Emergency Shutdown SIF (SIL 2)"\n series {\n kofn 2/3 {\n block PT1 "Pressure Tx 1" R=0.98\n block PT2 "Pressure Tx 2" R=0.98\n block PT3 "Pressure Tx 3" R=0.98\n }\n parallel {\n block LS1 "Logic solver A" R=0.999\n block LS2 "Logic solver B" R=0.999\n }\n parallel {\n block SDV1 "Shutdown valve A" R=0.96\n block SDV2 "Shutdown valve B" R=0.96\n }\n }',
|
|
3592
|
+
"notes": "## What this shows\n\nThe canonical safety-instrumented-function architecture from IEC 61511, laid out as a **series** of three subsystems: **sensing**, **logic**, and **final elements**. Sensing uses **2-out-of-3** voting transmitters (tolerates one failure *and* rejects one spurious trip); the **logic solver** is a redundant pair; the **final elements** are two shutdown valves in a **1-out-of-2** (parallel) arrangement so either can close the line.\n\n**The reliability is computed across the loop.** The engine evaluates the 2oo3 sensor group exactly, the two parallel pairs as `1 \u2212 (1\u2212R)\xB2`, and the series chain \u2014 giving a loop reliability of **\u2248 0.9972**. Because every subsystem is redundant, there's **no single point of failure**, and the importance ranking points at the valves (the lowest-reliability stage) as the place a SIL upgrade buys the most. The success-space companion to the fault tree a safety case also needs."
|
|
3593
|
+
},
|
|
3456
3594
|
{
|
|
3457
3595
|
"slug": "sequence-combined-fragments-gallery",
|
|
3458
3596
|
"diagram": "sequence",
|
|
@@ -4386,6 +4524,10 @@ var SYNTAX = {
|
|
|
4386
4524
|
"playbook": {
|
|
4387
4525
|
"title": "Sports playbook",
|
|
4388
4526
|
"content": '## 1. Your first play\n\nEvery diagram starts with a header naming the **sport**, then a **formation** (which places the players), then **assignments**:\n\n```\nplaybook "Give & Go" sport basketball\nset 5-out\npass 1 2\ncut 1 rim\npass 2 1\n```\n\n`pass 1 2` draws a pass from player 1 to player 2; `cut 1 rim` sends player 1 to the rim. Basketball draws passes **dashed** and cuts **solid** \u2014 the convention on every coaching whiteboard.\n\n---\n\n## 2. The three sports\n\nPick the sport in the header (`sport football|basketball|soccer`). Each uses its real unit and the conventional coaching viewpoint:\n\n| Sport | Unit | View | Surface |\n|---|---|---|---|\n| `football` | yards | offense at the bottom attacking **up**; downfield = up | green field with yard lines, hashes, end zone |\n| `basketball` | feet | NBA **half-court**; baseline + hoop at the top | light maple hardwood |\n| `soccer` | metres | full **105 \xD7 68 m** pitch (attack toward the right); or `view half` | green pitch with IFAB markings |\n\n---\n\n## 3. Players & formations\n\nThe fastest way to place players is a **formation** (football/soccer) or **set** (basketball):\n\n- **Football** \u2014 `formation i-form | shotgun | singleback | pistol | spread | trips | empty | goal-line | wishbone` with optional strength `left`/`right`. Receivers are `X Z H Y` (Y = tight end), backs `QB RB FB`, line `LT LG C RG RT`.\n- **Basketball** \u2014 `set horns | 1-4-high | 1-4-low | box | spread-pnr | 4-out | 5-out`. Players are numbered `1`\u2013`5`.\n- **Soccer** \u2014 `formation 4-3-3 | 4-4-2 | 4-2-3-1 | 4-5-1 | 4-4-1-1 | 3-5-2 | 3-4-3`. Players are numbered `1` (GK) \u2026 `11`.\n\nFor set-pieces or free-form diagrams, place players individually and crop to a half:\n\n```\nplaybook "Overlap & Cross" sport soccer\nview half\nplayer 7 o at 75,12 label 7\nplayer 2 o at 60,15 label 2\nplayer 9 o at 88,30 label 9\nplayer 11 o at 85,52 label 11\nplayer 10 o at 80,38 label 10\ndribble 7 to 82,20\nrun 2 to 90,8\npass 7 to 90,8\npass 2 to 102,34\nrun 9 to 101,31\nrun 11 to 101,40\n```\n\n---\n\n## 4. Movement verbs & line styles\n\nThe same line style means different things in different sports \u2014 Schematex draws each sport\'s own convention, and the legend always matches:\n\n| Verb | Football | Basketball | Soccer |\n|---|---|---|---|\n| `pass` | dashed (throw) | **dashed** | **solid** |\n| `run` / `cut` | solid | **solid** (cut) | **dashed** (run) |\n| `dribble` | \u2014 | wavy | wavy |\n| `screen` / `block` | T-bar \u22A5 | T-bar \u22A5 (screen) | T-bar \u22A5 |\n| `shot` | \u2014 | solid | double line |\n\n**Note the inversion:** basketball draws a pass *dashed* and a cut *solid*; soccer draws a pass *solid* and a run *dashed*. That is how the two coaching communities actually diagram \u2014 Schematex honours each.\n\nMove targets can be a **player id**, a **landmark** name, or explicit **coordinates** (`to x,y`).\n\n---\n\n## 5. Football \u2014 routes, runs, defense\n\nPass routes use the **route tree**: `go fly streak slant flat hitch out in dig curl comeback corner post wheel cross drag seam`. Run concepts: `dive iso power counter sweep toss draw trap`. Blocking uses `block`, `pull`, and `handoff`. Set `goal N` to draw the end zone and goalposts:\n\n```\nplaybook "Red Zone \u2014 Play-Action Fade" sport football\nfield down 1 distance 5 los 5 goal 5 hash nfl\nformation i-form right\ndefense cover-1\nhandoff QB RB\nroute Z corner 4\nroute X slant\nroute Y out 3\nrun RB dive right\n```\n\n`defense cover-0/1/2/3/4/6` draws the coverage shell; `defense 4-3 | 3-4 | nickel | dime` sets the front. `hash nfl|college|none` controls the hash marks.\n\n---\n\n## 6. Basketball \u2014 sets, landmarks, screens\n\nCuts and passes target **named landmarks** \u2014 `rim elbow wing corner short-corner block slot top high-post dunker` (prefix `l`/`r` for left/right). `screen A B` draws a ball-screen (T-bar) for player B; `dribble` is a wavy line:\n\n```\nplaybook "Spread Pick & Roll" sport basketball\nset spread-pnr\nscreen 5 1\ndribble 1 to 11,17\ncut 5 rim\npass 1 2\n```\n\n`defense man` matches each defender to a man; `defense zone-2-3 | zone-3-2 | zone-1-3-1` draws a zone front.\n\n---\n\n## 7. Soccer \u2014 shapes, runs, build-up\n\nA formation alone draws the team shape. Add `pass` (solid), `run` (dashed), and `dribble` (wavy) to show a phase of play:\n\n```\nplaybook "Build-Up From the Back" sport soccer\nformation 4-3-3\npass 1 4\npass 4 2\nrun 2 to 40,10\npass 4 6\nrun 6 to 62,24\n```\n\nLandmarks include `box top-box d penalty-spot near-post far-post six-yard center`. `defense low-block | mid-block | high-press` overlays the opponent\'s shape. Soccer renders daylight-only \u2014 `theme: dark` falls back to the default pitch.\n\n---\n\n## 8. Validation\n\nThe engine rejects the mistakes models actually make and lists the valid options:\n\n- unknown `sport`, `formation` / `set`, `defense`, or named route;\n- a move referencing an undeclared player id;\n- a malformed coordinate or a missing `to` target.\n\nSofter issues (e.g. a zero-length move) render with a warning rather than failing.\n\n---\n\n## 9. Grammar (EBNF)\n\n```text\nplaybook = "playbook" string "sport" sport NL { stmt NL } ;\nsport = "football" | "basketball" | "soccer" ;\nstmt = field | formation | defense | player | move | zone | "view" view ;\nfield = "field" { "down" num | "distance" num | "los" num\n | "goal" num | "hash" hash | "view" view } ;\nformation = ( "formation" | "set" ) name [ "left" | "right" ] ;\ndefense = "defense" scheme ;\nplayer = "player" id pos "at" coord "label" text ;\nmove = route | run | pass | cut | dribble | screen\n | shot | motion | handoff | pull | block ;\nroute = "route" id namedRoute [ num ] [ "left" | "right" ] ;\nrun = "run" id ( concept [ "left" | "right" ] | "to" coord ) ;\npass = "pass" id ( id | landmark | "to" coord ) ;\ncut = "cut" id ( landmark | "to" coord ) ;\ndribble = "dribble" id "to" coord ;\nscreen = "screen" id id ;\nshot = "shot" id [ "to" coord ] ;\nzone = "zone" coord coord string ;\ncoord = num "," num ;\nview = "full" | "half" ;\nhash = "nfl" | "college" | "none" ;\n```\n\n---\n\n## Related examples\n\nFive canonical plays per sport ship as examples \u2014 Four Verticals, Mesh, Smash, Power O, and a Red-Zone fade for football; Pick & Roll, Horns, Give & Go, Floppy, and a Backdoor cut for basketball; 4-3-3 shape, Build-Up, Overlap, High Press, and Counter-Attack for soccer.'
|
|
4527
|
+
},
|
|
4528
|
+
"rbd": {
|
|
4529
|
+
"title": "Reliability Block Diagram",
|
|
4530
|
+
"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## 6. 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.'
|
|
4389
4531
|
}
|
|
4390
4532
|
};
|
|
4391
4533
|
|
|
@@ -5645,6 +5787,44 @@ var PROFILES = {
|
|
|
5645
5787
|
"'has no effect/cause' -> every failure mode needs at least one effect and one cause."
|
|
5646
5788
|
]
|
|
5647
5789
|
},
|
|
5790
|
+
rbd: {
|
|
5791
|
+
type: "rbd",
|
|
5792
|
+
header: 'rbd "Title"',
|
|
5793
|
+
mode: "brace-nested success logic: series/parallel/kofn groups wrapping `block` leaves",
|
|
5794
|
+
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, or R=99%) \xB7 engine computes system reliability + Birnbaum importance + SPOF',
|
|
5795
|
+
forms: [
|
|
5796
|
+
'rbd "Redundant Server"',
|
|
5797
|
+
"series {",
|
|
5798
|
+
' block PSU "Power Supply" R=0.99',
|
|
5799
|
+
" parallel {",
|
|
5800
|
+
' block FAN1 "Fan A" R=0.95',
|
|
5801
|
+
' block FAN2 "Fan B" R=0.95',
|
|
5802
|
+
" }",
|
|
5803
|
+
" kofn 2/3 {",
|
|
5804
|
+
' block D1 "Disk 1" R=0.97',
|
|
5805
|
+
' block D2 "Disk 2" R=0.97',
|
|
5806
|
+
' block D3 "Disk 3" R=0.97',
|
|
5807
|
+
" }",
|
|
5808
|
+
"}"
|
|
5809
|
+
],
|
|
5810
|
+
prefer: [
|
|
5811
|
+
"Single-word keyword is `rbd` (alias `reliability`). Nest `series`/`parallel`/`kofn k/n` groups with braces around `block` leaves.",
|
|
5812
|
+
"Give every block a reliability: `R=0.99` (or failure prob `p=0.01`, or `R=99%`); the engine then computes system reliability.",
|
|
5813
|
+
"Use `parallel { \u2026 }` for full redundancy and `kofn 2/3 { \u2026 }` for k-out-of-n voting redundancy.",
|
|
5814
|
+
"Groups nest freely \u2014 e.g. a `parallel` of two `series` strings models redundant chains.",
|
|
5815
|
+
"A bare top-level list of blocks (no outer group) is treated as a series chain."
|
|
5816
|
+
],
|
|
5817
|
+
avoid: [
|
|
5818
|
+
"Don't omit the `block` keyword's reliability if you want a number \u2014 a block with no R leaves the system reliability symbolic.",
|
|
5819
|
+
"Don't forget to close every `{` with a `}` \u2014 groups are brace-delimited, not indentation-driven.",
|
|
5820
|
+
"Don't write `kofn` without a `k/n` threshold (e.g. `kofn 2/3 { \u2026 }`)."
|
|
5821
|
+
],
|
|
5822
|
+
repair: [
|
|
5823
|
+
"'needs a k/n threshold' -> write `kofn 2/3 { \u2026 }` with the threshold before the brace.",
|
|
5824
|
+
"'Unclosed group' -> add the missing `}`.",
|
|
5825
|
+
"If system reliability shows 'n/a', a block is missing its `R=`/`p=`."
|
|
5826
|
+
]
|
|
5827
|
+
},
|
|
5648
5828
|
causalloop: {
|
|
5649
5829
|
type: "causalloop",
|
|
5650
5830
|
header: 'causalloop "Title"',
|
|
@@ -6036,7 +6216,7 @@ function getExamples(type, opts = {}) {
|
|
|
6036
6216
|
function validateDsl(type, dsl) {
|
|
6037
6217
|
const resolvedType = type ? resolveDiagramType(type) : void 0;
|
|
6038
6218
|
const config = type ? { type: resolvedType ?? type } : void 0;
|
|
6039
|
-
const result =
|
|
6219
|
+
const result = chunkQ7CWX6HA_cjs.parseResult(dsl, config);
|
|
6040
6220
|
if (result.ok) {
|
|
6041
6221
|
return {
|
|
6042
6222
|
ok: true,
|
|
@@ -6062,7 +6242,7 @@ function renderDsl(type, dsl, options = {}) {
|
|
|
6062
6242
|
...options,
|
|
6063
6243
|
...type ? { type: resolvedType ?? type } : {}
|
|
6064
6244
|
};
|
|
6065
|
-
const result =
|
|
6245
|
+
const result = chunkQ7CWX6HA_cjs.renderResult(dsl, config);
|
|
6066
6246
|
if (result.ok) {
|
|
6067
6247
|
return {
|
|
6068
6248
|
ok: true,
|
|
@@ -6124,5 +6304,5 @@ exports.listDiagrams = listDiagrams;
|
|
|
6124
6304
|
exports.renderDsl = renderDsl;
|
|
6125
6305
|
exports.resolveDiagramType = resolveDiagramType;
|
|
6126
6306
|
exports.validateDsl = validateDsl;
|
|
6127
|
-
//# sourceMappingURL=chunk-
|
|
6128
|
-
//# sourceMappingURL=chunk-
|
|
6307
|
+
//# sourceMappingURL=chunk-7EWP4OD7.cjs.map
|
|
6308
|
+
//# sourceMappingURL=chunk-7EWP4OD7.cjs.map
|