jmespath_extensions 0.7.0

Extended functions for JMESPath queries - 320+ functions for strings, arrays, dates, hashing, encoding, geo, and more
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
3594
3595
3596
3597
3598
3599
3600
3601
3602
3603
3604
3605
3606
3607
3608
3609
3610
3611
3612
3613
3614
3615
3616
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644
3645
3646
3647
3648
3649
3650
3651
3652
3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
3670
3671
3672
3673
3674
3675
3676
3677
3678
3679
3680
3681
3682
3683
3684
3685
3686
3687
3688
3689
3690
3691
3692
3693
3694
3695
3696
3697
3698
3699
3700
3701
3702
3703
3704
3705
3706
3707
3708
3709
3710
3711
3712
3713
3714
3715
3716
3717
3718
3719
3720
3721
3722
3723
3724
3725
3726
3727
3728
3729
3730
3731
3732
3733
3734
3735
3736
3737
3738
3739
3740
3741
3742
3743
3744
3745
3746
3747
3748
3749
3750
3751
3752
3753
3754
3755
3756
3757
3758
3759
3760
3761
3762
3763
3764
3765
3766
3767
3768
3769
3770
3771
3772
3773
3774
3775
3776
3777
3778
3779
3780
3781
3782
3783
3784
3785
3786
3787
3788
3789
3790
3791
3792
3793
3794
3795
3796
3797
3798
3799
3800
3801
3802
3803
3804
3805
3806
3807
3808
3809
3810
3811
3812
3813
3814
3815
3816
3817
3818
3819
3820
3821
3822
3823
3824
3825
3826
3827
3828
3829
3830
3831
3832
3833
3834
3835
3836
3837
3838
3839
3840
3841
3842
3843
3844
3845
3846
3847
3848
3849
3850
3851
3852
3853
3854
3855
3856
3857
3858
3859
3860
3861
3862
3863
3864
3865
3866
3867
3868
3869
3870
3871
3872
3873
3874
3875
3876
3877
3878
3879
3880
3881
3882
3883
3884
3885
3886
3887
3888
3889
3890
3891
3892
3893
3894
3895
3896
3897
3898
3899
3900
3901
3902
3903
3904
3905
3906
3907
3908
3909
3910
3911
3912
3913
3914
3915
3916
3917
3918
3919
3920
3921
3922
3923
3924
3925
3926
3927
3928
3929
3930
3931
3932
3933
3934
3935
3936
3937
3938
3939
3940
3941
3942
3943
3944
3945
3946
3947
3948
3949
3950
3951
3952
3953
3954
3955
3956
3957
3958
3959
3960
3961
3962
3963
3964
3965
3966
3967
3968
3969
3970
3971
3972
3973
3974
3975
3976
3977
3978
3979
3980
3981
3982
3983
3984
3985
3986
3987
3988
3989
3990
3991
3992
3993
3994
3995
3996
3997
3998
3999
4000
4001
4002
4003
4004
4005
4006
4007
4008
4009
4010
4011
4012
4013
4014
4015
4016
4017
4018
4019
4020
4021
4022
4023
4024
4025
4026
4027
4028
4029
4030
4031
4032
4033
4034
4035
4036
4037
4038
4039
4040
4041
4042
4043
4044
4045
4046
4047
4048
4049
4050
4051
4052
4053
4054
4055
4056
4057
4058
4059
4060
4061
4062
4063
4064
4065
4066
4067
4068
4069
4070
4071
4072
4073
4074
4075
4076
4077
4078
4079
4080
4081
4082
4083
4084
4085
4086
4087
4088
4089
4090
4091
4092
4093
4094
4095
4096
4097
4098
4099
4100
4101
4102
4103
4104
4105
4106
4107
4108
4109
4110
4111
4112
4113
4114
4115
4116
4117
4118
4119
4120
4121
4122
4123
4124
4125
4126
4127
4128
4129
4130
4131
4132
4133
4134
4135
4136
4137
4138
4139
4140
4141
4142
4143
4144
4145
4146
4147
4148
4149
4150
4151
4152
4153
4154
4155
4156
4157
4158
4159
4160
4161
4162
4163
4164
4165
4166
4167
4168
4169
4170
4171
4172
4173
4174
4175
4176
4177
4178
4179
4180
4181
4182
4183
4184
4185
4186
4187
4188
4189
4190
4191
4192
4193
4194
4195
4196
4197
4198
4199
4200
4201
4202
4203
4204
4205
4206
4207
4208
4209
4210
4211
4212
4213
4214
4215
4216
4217
4218
4219
4220
4221
4222
4223
4224
4225
4226
4227
4228
4229
4230
4231
4232
4233
4234
4235
4236
4237
4238
4239
4240
4241
4242
4243
4244
4245
4246
4247
4248
4249
4250
4251
4252
4253
4254
4255
4256
4257
4258
4259
4260
4261
4262
4263
4264
4265
4266
4267
4268
4269
4270
4271
4272
4273
4274
4275
4276
4277
4278
4279
4280
4281
4282
4283
4284
4285
4286
4287
4288
4289
4290
4291
4292
4293
4294
4295
4296
4297
4298
4299
4300
4301
4302
4303
4304
4305
4306
4307
4308
4309
4310
4311
4312
4313
4314
4315
4316
4317
4318
4319
# JMESPath Extensions Function Registry
#
# This file is the single source of truth for:
# - Function metadata (name, signature, description)
# - Rustdoc generation (via build.rs)
# - Runtime introspection (via registry.rs)
#
# To regenerate registry.rs and docs after editing:
#   cargo build  # build.rs will process this file

# =============================================================================
# ARRAY FUNCTIONS
# =============================================================================

[[functions]]
name = "chunk"
category = "array"
description = "Split array into chunks of size n"
signature = "array, number -> array"
examples = [
    { code = "chunk([1, 2, 3, 4], `2`) -> [[1, 2], [3, 4]]", description = "Basic chunking" },
    { code = "chunk([1, 2, 3, 4, 5], `2`) -> [[1, 2], [3, 4], [5]]", description = "Uneven chunks" },
    { code = "chunk([], `2`) -> []", description = "Empty array" },
]
features = ["core"]

[[functions]]
name = "compact"
category = "array"
description = "Remove null values from array"
signature = "array -> array"
examples = [
    { code = "compact([1, null, 2, null]) -> [1, 2]", description = "Remove nulls" },
    { code = "compact([null, null]) -> []", description = "All nulls" },
    { code = "compact([1, 2, 3]) -> [1, 2, 3]", description = "No nulls" },
]
features = ["core"]

[[functions]]
name = "difference"
category = "array"
description = "Elements in first array not in second"
signature = "array, array -> array"
examples = [
    { code = "difference([1, 2, 3], [2]) -> [1, 3]", description = "Remove matching elements" },
    { code = "difference([1, 2, 3], [4, 5]) -> [1, 2, 3]", description = "No overlap" },
    { code = "difference([1, 2], [1, 2]) -> []", description = "All removed" },
]
features = ["core"]

[[functions]]
name = "drop"
category = "array"
description = "Drop first n elements"
signature = "array, number -> array"
examples = [
    { code = "drop([1, 2, 3, 4], `2`) -> [3, 4]", description = "Drop first 2" },
    { code = "drop([1, 2, 3], `0`) -> [1, 2, 3]", description = "Drop none" },
    { code = "drop([1, 2], `5`) -> []", description = "Drop more than length" },
]
features = ["core"]

[[functions]]
name = "find_index"
category = "array"
description = "Find index of value in array"
signature = "array, any -> number | null"
examples = [
    { code = "find_index([1, 2, 3], `2`) -> 1", description = "Find existing value" },
    { code = "find_index(['a', 'b', 'c'], 'b') -> 1", description = "Find string" },
    { code = "find_index([1, 2, 3], `99`) -> null", description = "Value not found" },
]
features = ["core"]

[[functions]]
name = "first"
category = "array"
description = "Get first element of array"
signature = "array -> any"
examples = [
    { code = "first([1, 2, 3]) -> 1", description = "Get first number" },
    { code = "first(['a', 'b']) -> 'a'", description = "Get first string" },
    { code = "first([]) -> null", description = "Empty array returns null" },
]
features = ["core"]

[[functions]]
name = "flatten"
category = "array"
description = "Flatten array one level deep"
signature = "array -> array"
examples = [
    { code = "flatten([[1, 2], [3]]) -> [1, 2, 3]", description = "Flatten nested arrays" },
    { code = "flatten([[1, [2]], [3]]) -> [1, [2], 3]", description = "Only one level deep" },
    { code = "flatten([1, 2, 3]) -> [1, 2, 3]", description = "Already flat" },
]
features = ["core"]

[[functions]]
name = "flatten_deep"
category = "array"
description = "Recursively flatten nested arrays"
signature = "array -> array"
examples = [
    { code = "flatten_deep([[1, [2]], [3]]) -> [1, 2, 3]", description = "Deeply nested" },
    { code = "flatten_deep([[[1]], [[2]], [[3]]]) -> [1, 2, 3]", description = "Multiple levels" },
    { code = "flatten_deep([1, 2, 3]) -> [1, 2, 3]", description = "Already flat" },
]
features = ["core"]

[[functions]]
name = "frequencies"
category = "array"
description = "Count occurrences of each value"
signature = "array -> object"
examples = [
    { code = "frequencies(['a', 'b', 'a']) -> {a: 2, b: 1}", description = "Count strings" },
    { code = "frequencies([1, 2, 1, 1]) -> {1: 3, 2: 1}", description = "Count numbers" },
    { code = "frequencies([]) -> {}", description = "Empty array" },
]
features = ["core"]

[[functions]]
name = "group_by"
category = "array"
description = "Group array elements by key"
signature = "array, string -> object"
examples = [
    { code = "group_by([{t: 'a'}, {t: 'b'}, {t: 'a'}], 't') -> {a: [{t:'a'}, {t:'a'}], b: [{t:'b'}]}", description = "Group by field" },
    { code = "group_by(users, 'role') -> {admin: [...], user: [...]}", description = "Group users by role" },
    { code = "group_by([], 'key') -> {}", description = "Empty array returns empty object" },
]
features = ["core"]

[[functions]]
name = "includes"
category = "array"
description = "Check if array contains value"
signature = "array, any -> boolean"
examples = [
    { code = "includes([1, 2, 3], `2`) -> true", description = "Value found" },
    { code = "includes([1, 2, 3], `99`) -> false", description = "Value not found" },
    { code = "includes(['a', 'b'], 'a') -> true", description = "String value" },
]
features = ["core"]

[[functions]]
name = "index_at"
category = "array"
description = "Get element at index (supports negative)"
signature = "array, number -> any"
examples = [
    { code = "index_at([1, 2, 3], `0`) -> 1", description = "First element" },
    { code = "index_at([1, 2, 3], `-1`) -> 3", description = "Last element (negative index)" },
    { code = "index_at([1, 2, 3], `99`) -> null", description = "Out of bounds" },
]
features = ["core"]

[[functions]]
name = "intersection"
category = "array"
description = "Elements common to both arrays"
signature = "array, array -> array"
examples = [
    { code = "intersection([1, 2], [2, 3]) -> [2]", description = "Common elements" },
    { code = "intersection([1, 2], [3, 4]) -> []", description = "No overlap" },
    { code = "intersection([1, 2, 3], [1, 2, 3]) -> [1, 2, 3]", description = "Identical arrays" },
]
features = ["core"]

[[functions]]
name = "last"
category = "array"
description = "Get last element of array"
signature = "array -> any"
examples = [
    { code = "last([1, 2, 3]) -> 3", description = "Get last number" },
    { code = "last(['a', 'b']) -> 'b'", description = "Get last string" },
    { code = "last([]) -> null", description = "Empty array returns null" },
]
features = ["core"]

[[functions]]
name = "pairwise"
category = "array"
description = "Return adjacent pairs from array"
signature = "array -> array"
examples = [
    { code = "pairwise([1, 2, 3]) -> [[1, 2], [2, 3]]", description = "Adjacent pairs" },
    { code = "pairwise([1, 2]) -> [[1, 2]]", description = "Single pair" },
    { code = "pairwise([1]) -> []", description = "Too few elements" },
]
features = ["core"]

[[functions]]
name = "range"
category = "array"
description = "Generate array of numbers"
signature = "number, number -> array"
examples = [
    { code = "range(`1`, `5`) -> [1, 2, 3, 4]", description = "Range 1 to 4" },
    { code = "range(`0`, `3`) -> [0, 1, 2]", description = "Range from zero" },
    { code = "range(`5`, `5`) -> []", description = "Empty range" },
]
features = ["core"]

[[functions]]
name = "sliding_window"
category = "array"
description = "Create overlapping windows of size n (alias for window)"
signature = "array, number -> array"
examples = [
    { code = "sliding_window([1, 2, 3, 4], `2`) -> [[1, 2], [2, 3], [3, 4]]", description = "Size 2 windows" },
    { code = "sliding_window([1, 2, 3, 4], `3`) -> [[1, 2, 3], [2, 3, 4]]", description = "Size 3 windows" },
    { code = "sliding_window([1, 2], `3`) -> []", description = "Window larger than array" },
]
aliases = ["window"]
features = ["core"]

[[functions]]
name = "take"
category = "array"
description = "Take first n elements"
signature = "array, number -> array"
examples = [
    { code = "take([1, 2, 3, 4], `2`) -> [1, 2]", description = "Take first 2" },
    { code = "take([1, 2, 3], `0`) -> []", description = "Take none" },
    { code = "take([1, 2], `5`) -> [1, 2]", description = "Take more than length" },
]
features = ["core"]

[[functions]]
name = "transpose"
category = "array"
description = "Transpose a 2D array (swap rows and columns)"
signature = "array -> array"
examples = [
    { code = "transpose([[1, 2], [3, 4]]) -> [[1, 3], [2, 4]]", description = "Swap rows/columns" },
    { code = "transpose([[1, 2, 3], [4, 5, 6]]) -> [[1, 4], [2, 5], [3, 6]]", description = "2x3 to 3x2" },
    { code = "transpose([]) -> []", description = "Empty array" },
]
features = ["core"]

[[functions]]
name = "union"
category = "array"
description = "Unique elements from both arrays"
signature = "array, array -> array"
examples = [
    { code = "union([1, 2], [2, 3]) -> [1, 2, 3]", description = "Combine with dedup" },
    { code = "union([1, 2], [3, 4]) -> [1, 2, 3, 4]", description = "No overlap" },
    { code = "union([], [1, 2]) -> [1, 2]", description = "Empty first array" },
]
features = ["core"]

[[functions]]
name = "unique"
category = "array"
description = "Remove duplicate values"
signature = "array -> array"
examples = [
    { code = "unique([1, 2, 1, 3]) -> [1, 2, 3]", description = "Basic deduplication" },
    { code = "unique(['a', 'b', 'a']) -> ['a', 'b']", description = "String values" },
    { code = "unique([]) -> []", description = "Empty array" },
]
features = ["core"]

[[functions]]
name = "zip"
category = "array"
description = "Zip two arrays together"
signature = "array, array -> array"
examples = [
    { code = "zip([1, 2], ['a', 'b']) -> [[1, 'a'], [2, 'b']]", description = "Basic zip" },
    { code = "zip([1, 2, 3], ['a', 'b']) -> [[1, 'a'], [2, 'b']]", description = "Unequal lengths (truncates)" },
    { code = "zip([], []) -> []", description = "Empty arrays" },
]
jep = "JEP-013"
features = ["core", "jep"]

# =============================================================================
# COLOR FUNCTIONS
# =============================================================================

[[functions]]
name = "color_complement"
category = "color"
description = "Get complementary color"
signature = "string -> string"
examples = [
    { code = '''color_complement('#ff0000') -> \"#00ffff\"''', description = "Red to cyan" },
    { code = '''color_complement('#00ff00') -> \"#ff00ff\"''', description = "Green to magenta" },
    { code = '''color_complement('#0000ff') -> \"#ffff00\"''', description = "Blue to yellow" },
]
features = ["core"]

[[functions]]
name = "color_grayscale"
category = "color"
description = "Convert to grayscale"
signature = "string -> string"
examples = [
    { code = '''color_grayscale('#ff0000') -> \"#4c4c4c\"''', description = "Red to gray" },
    { code = '''color_grayscale('#00ff00') -> \"#969696\"''', description = "Green to gray" },
    { code = '''color_grayscale('#ffffff') -> \"#ffffff\"''', description = "White unchanged" },
]
features = ["core"]

[[functions]]
name = "color_invert"
category = "color"
description = "Invert a color"
signature = "string -> string"
examples = [
    { code = '''color_invert('#ff0000') -> \"#00ffff\"''', description = "Invert red" },
    { code = '''color_invert('#000000') -> \"#ffffff\"''', description = "Black to white" },
    { code = '''color_invert('#ffffff') -> \"#000000\"''', description = "White to black" },
]
features = ["core"]

[[functions]]
name = "color_mix"
category = "color"
description = "Mix two colors"
signature = "string, string, number -> string"
examples = [
    { code = '''color_mix('#ff0000', '#0000ff', `50`) -> \"#800080\"''', description = "Red and blue to purple" },
    { code = '''color_mix('#ff0000', '#00ff00', `50`) -> \"#808000\"''', description = "Red and green" },
    { code = '''color_mix('#000000', '#ffffff', `50`) -> \"#808080\"''', description = "Black and white to gray" },
]
features = ["core"]

[[functions]]
name = "darken"
category = "color"
description = "Darken a color by percentage"
signature = "string, number -> string"
examples = [
    { code = '''darken('#3366cc', `20`) -> \"#2952a3\"''', description = "Darken blue by 20%" },
    { code = '''darken('#ff0000', `50`) -> \"#800000\"''', description = "Darken red by 50%" },
    { code = '''darken('#ffffff', `100`) -> \"#000000\"''', description = "White to black" },
]
features = ["core"]

[[functions]]
name = "hex_to_rgb"
category = "color"
description = "Convert hex color to RGB"
signature = "string -> object"
examples = [
    { code = "hex_to_rgb('#ff5500') -> {b: 0, g: 85, r: 255}", description = "Orange" },
    { code = "hex_to_rgb('#000000') -> {b: 0, g: 0, r: 0}", description = "Black" },
    { code = "hex_to_rgb('#ffffff') -> {b: 255, g: 255, r: 255}", description = "White" },
]
features = ["core"]

[[functions]]
name = "lighten"
category = "color"
description = "Lighten a color by percentage"
signature = "string, number -> string"
examples = [
    { code = '''lighten('#3366cc', `20`) -> \"#5c85d6\"''', description = "Lighten blue by 20%" },
    { code = '''lighten('#800000', `50`) -> \"#ff0000\"''', description = "Lighten dark red" },
    { code = '''lighten('#000000', `100`) -> \"#ffffff\"''', description = "Black to white" },
]
features = ["core"]

[[functions]]
name = "rgb_to_hex"
category = "color"
description = "Convert RGB to hex color"
signature = "number, number, number -> string"
examples = [
    { code = '''rgb_to_hex(`255`, `85`, `0`) -> \"#ff5500\"''', description = "Orange" },
    { code = '''rgb_to_hex(`0`, `0`, `0`) -> \"#000000\"''', description = "Black" },
    { code = '''rgb_to_hex(`255`, `255`, `255`) -> \"#ffffff\"''', description = "White" },
]
features = ["core"]

# =============================================================================
# COMPUTING FUNCTIONS
# =============================================================================

[[functions]]
name = "bit_and"
category = "computing"
description = "Bitwise AND"
signature = "number, number -> number"
examples = [
    { code = "bit_and(`12`, `10`) -> 8", description = "1100 AND 1010 = 1000" },
    { code = "bit_and(`255`, `15`) -> 15", description = "Mask lower 4 bits" },
    { code = "bit_and(`7`, `3`) -> 3", description = "0111 AND 0011 = 0011" },
]
features = ["core"]

[[functions]]
name = "bit_not"
category = "computing"
description = "Bitwise NOT"
signature = "number -> number"
examples = [
    { code = "bit_not(`0`) -> -1", description = "Invert zero" },
    { code = "bit_not(`-1`) -> 0", description = "Invert all ones" },
    { code = "bit_not(`1`) -> -2", description = "Invert one" },
]
features = ["core"]

[[functions]]
name = "bit_or"
category = "computing"
description = "Bitwise OR"
signature = "number, number -> number"
examples = [
    { code = "bit_or(`12`, `10`) -> 14", description = "1100 OR 1010 = 1110" },
    { code = "bit_or(`1`, `2`) -> 3", description = "0001 OR 0010 = 0011" },
    { code = "bit_or(`0`, `255`) -> 255", description = "Zero OR any = any" },
]
features = ["core"]

[[functions]]
name = "bit_shift_left"
category = "computing"
description = "Bitwise left shift"
signature = "number, number -> number"
examples = [
    { code = "bit_shift_left(`1`, `4`) -> 16", description = "Shift 1 left by 4" },
    { code = "bit_shift_left(`1`, `0`) -> 1", description = "Shift by 0 unchanged" },
    { code = "bit_shift_left(`5`, `2`) -> 20", description = "Multiply by 4" },
]
features = ["core"]

[[functions]]
name = "bit_shift_right"
category = "computing"
description = "Bitwise right shift"
signature = "number, number -> number"
examples = [
    { code = "bit_shift_right(`16`, `2`) -> 4", description = "Divide by 4" },
    { code = "bit_shift_right(`255`, `4`) -> 15", description = "Shift right by 4" },
    { code = "bit_shift_right(`8`, `0`) -> 8", description = "Shift by 0 unchanged" },
]
features = ["core"]

[[functions]]
name = "bit_xor"
category = "computing"
description = "Bitwise XOR"
signature = "number, number -> number"
examples = [
    { code = "bit_xor(`12`, `10`) -> 6", description = "1100 XOR 1010 = 0110" },
    { code = "bit_xor(`255`, `255`) -> 0", description = "Same values = 0" },
    { code = "bit_xor(`5`, `3`) -> 6", description = "0101 XOR 0011 = 0110" },
]
features = ["core"]

[[functions]]
name = "format_bytes"
category = "computing"
description = "Format bytes (decimal)"
signature = "number -> string"
examples = [
    { code = '''format_bytes(`1500000000`) -> \"1.50 GB\"''', description = "Gigabytes" },
    { code = '''format_bytes(`1000`) -> \"1.00 KB\"''', description = "Kilobytes" },
    { code = '''format_bytes(`500`) -> \"500 B\"''', description = "Bytes" },
]
features = ["core"]

[[functions]]
name = "format_bytes_binary"
category = "computing"
description = "Format bytes (binary)"
signature = "number -> string"
examples = [
    { code = '''format_bytes_binary(`1073741824`) -> \"1.00 GiB\"''', description = "Gibibytes" },
    { code = '''format_bytes_binary(`1024`) -> \"1.00 KiB\"''', description = "Kibibytes" },
    { code = '''format_bytes_binary(`1048576`) -> \"1.00 MiB\"''', description = "Mebibytes" },
]
features = ["core"]

[[functions]]
name = "parse_bytes"
category = "computing"
description = "Parse byte size string"
signature = "string -> number"
examples = [
    { code = "parse_bytes('1.5 GB') -> 1500000000", description = "Gigabytes" },
    { code = "parse_bytes('1 KB') -> 1000", description = "Kilobytes" },
    { code = "parse_bytes('1 GiB') -> 1073741824", description = "Gibibytes" },
]
features = ["core"]

# =============================================================================
# DATETIME FUNCTIONS
# =============================================================================

[[functions]]
name = "business_days_between"
category = "datetime"
description = "Count business days (weekdays) between two timestamps"
signature = "number, number -> number"
examples = [
    { code = "business_days_between(`1704067200`, `1705276800`) -> 10", description = "Count weekdays" },
    { code = "business_days_between(start_ts, end_ts) -> count", description = "Between two timestamps" },
    { code = "business_days_between(`0`, `604800`) -> 5", description = "One week = 5 days" },
    { code = "business_days_between(`0`, `0`) -> 0", description = "Same day" },
]
features = ["core"]

[[functions]]
name = "date_add"
category = "datetime"
description = "Add time to timestamp"
signature = "number, number, string -> number"
examples = [
    { code = "date_add(`0`, `1`, 'days') -> 86400", description = "Add 1 day" },
    { code = "date_add(`0`, `2`, 'hours') -> 7200", description = "Add 2 hours" },
    { code = "date_add(timestamp, `7`, 'days') -> next week", description = "Add 1 week" },
    { code = "date_add(`0`, `30`, 'minutes') -> 1800", description = "Add 30 minutes" },
]
features = ["core"]

[[functions]]
name = "date_diff"
category = "datetime"
description = "Difference between timestamps"
signature = "number, number, string -> number"
examples = [
    { code = "date_diff(`86400`, `0`, 'days') -> 1", description = "Diff in days" },
    { code = "date_diff(`7200`, `0`, 'hours') -> 2", description = "Diff in hours" },
    { code = "date_diff(end_ts, start_ts, 'minutes') -> minutes", description = "Diff in minutes" },
    { code = "date_diff(`604800`, `0`, 'weeks') -> 1", description = "Diff in weeks" },
]
features = ["core"]

[[functions]]
name = "duration_since"
category = "datetime"
description = "Get detailed duration object from timestamp to now"
signature = "number|string -> object"
examples = [
    { code = "duration_since(`1702396800`) -> {days: 1, hours: 0, ...}", description = "From timestamp" },
    { code = "duration_since('2023-01-01') -> {days: N, ...}", description = "From date string" },
    { code = "duration_since(created_at) -> elapsed time", description = "Time since creation" },
    { code = "duration_since(now() - 3600) -> {hours: 1, ...}", description = "One hour ago" },
]
features = ["core"]

[[functions]]
name = "end_of_day"
category = "datetime"
description = "Get ISO 8601 string for end of day (23:59:59)"
signature = "number|string -> string"
examples = [
    { code = '''end_of_day('2023-12-13T15:30:00Z') -> \"2023-12-13T23:59:59Z\"''', description = "From ISO string" },
    { code = "end_of_day(`1702483200`) -> end of that day", description = "From timestamp" },
    { code = "end_of_day('2024-01-01') -> last second of day", description = "From date only" },
    { code = "end_of_day(now()) -> today end", description = "End of today" },
]
features = ["core"]

[[functions]]
name = "epoch_ms"
category = "datetime"
description = "Current Unix timestamp in milliseconds (alias for now_ms)"
signature = "-> number"
examples = [
    { code = "epoch_ms() -> 1702483200000", description = "Current time in ms" },
    { code = "epoch_ms() / `1000` -> seconds", description = "Convert to seconds" },
    { code = "epoch_ms() - start_ms -> elapsed", description = "Calculate duration" },
]
features = ["core"]

[[functions]]
name = "format_date"
category = "datetime"
description = "Format timestamp to string"
signature = "number, string -> string"
examples = [
    { code = '''format_date(`1705276800`, '%Y-%m-%d') -> \"2024-01-15\"''', description = "ISO date format" },
    { code = '''format_date(ts, '%B %d, %Y') -> \"January 15, 2024\"''', description = "Long date format" },
    { code = '''format_date(ts, '%H:%M:%S') -> \"10:30:00\"''', description = "Time only" },
    { code = '''format_date(ts, '%Y-%m-%dT%H:%M:%SZ') -> ISO string''', description = "Full ISO 8601" },
]
features = ["core"]

[[functions]]
name = "from_epoch"
category = "datetime"
description = "Convert Unix timestamp (seconds) to ISO 8601 string"
signature = "number -> string"
examples = [
    { code = '''from_epoch(`1702483200`) -> \"2023-12-13T16:00:00Z\"''', description = "Convert seconds" },
    { code = '''from_epoch(`0`) -> \"1970-01-01T00:00:00Z\"''', description = "Unix epoch" },
    { code = "from_epoch(created_at) -> ISO string", description = "Convert field" },
    { code = "from_epoch(now()) -> current ISO", description = "Current time" },
]
features = ["core"]

[[functions]]
name = "from_epoch_ms"
category = "datetime"
description = "Convert Unix timestamp (milliseconds) to ISO 8601 string"
signature = "number -> string"
examples = [
    { code = '''from_epoch_ms(`1702483200000`) -> \"2023-12-13T16:00:00Z\"''', description = "From milliseconds" },
    { code = '''from_epoch_ms(`0`) -> \"1970-01-01T00:00:00Z\"''', description = "Unix epoch" },
    { code = "from_epoch_ms(js_timestamp) -> ISO", description = "JS timestamp" },
    { code = "from_epoch_ms(epoch_ms()) -> current", description = "Current time" },
]
features = ["core"]

[[functions]]
name = "is_after"
category = "datetime"
description = "Check if first date is after second date (accepts timestamps or date strings)"
signature = "number|string, number|string -> boolean"
examples = [
    { code = "is_after('2024-07-15', '2024-01-01') -> true", description = "String comparison" },
    { code = "is_after(`1705276800`, `1704067200`) -> true", description = "Timestamp comparison" },
    { code = "is_after(end_date, start_date) -> true/false", description = "Field comparison" },
    { code = "is_after('2024-01-01', '2024-01-01') -> false", description = "Same date" },
]
features = ["core"]

[[functions]]
name = "is_before"
category = "datetime"
description = "Check if first date is before second date (accepts timestamps or date strings)"
signature = "number|string, number|string -> boolean"
examples = [
    { code = "is_before('2024-01-01', '2024-07-15') -> true", description = "String comparison" },
    { code = "is_before(`1704067200`, `1705276800`) -> true", description = "Timestamp comparison" },
    { code = "is_before(start_date, end_date) -> true/false", description = "Field comparison" },
    { code = "is_before('2024-01-01', '2024-01-01') -> false", description = "Same date" },
]
features = ["core"]

[[functions]]
name = "is_between"
category = "datetime"
description = "Check if date is between start and end (inclusive, accepts timestamps or date strings)"
signature = "number|string, number|string, number|string -> boolean"
examples = [
    { code = "is_between('2024-06-15', '2024-01-01', '2024-12-31') -> true", description = "Within range" },
    { code = "is_between('2023-06-15', '2024-01-01', '2024-12-31') -> false", description = "Before range" },
    { code = "is_between(event_date, start, end) -> true/false", description = "Check event date" },
    { code = "is_between('2024-01-01', '2024-01-01', '2024-12-31') -> true", description = "Inclusive start" },
]
features = ["core"]

[[functions]]
name = "is_same_day"
category = "datetime"
description = "Check if two timestamps/dates are on the same day"
signature = "number|string, number|string -> boolean"
examples = [
    { code = "is_same_day('2023-12-13T10:00:00Z', '2023-12-13T23:00:00Z') -> true", description = "Same day, different time" },
    { code = "is_same_day('2023-12-13', '2023-12-14') -> false", description = "Different days" },
    { code = "is_same_day(created_at, updated_at) -> true/false", description = "Compare fields" },
    { code = "is_same_day(now(), event_time) -> true/false", description = "Today check" },
]
features = ["core"]

[[functions]]
name = "is_weekday"
category = "datetime"
description = "Check if timestamp falls on weekday (Monday-Friday)"
signature = "number -> boolean"
examples = [
    { code = "is_weekday(`1705276800`) -> true", description = "Monday is weekday" },
    { code = "is_weekday(now()) -> true/false", description = "Check current day" },
    { code = "is_weekday(event_timestamp) -> true/false", description = "Check event day" },
    { code = "is_weekday(`1705104000`) -> false", description = "Saturday is not weekday" },
]
features = ["core"]

[[functions]]
name = "is_weekend"
category = "datetime"
description = "Check if timestamp falls on weekend (Saturday or Sunday)"
signature = "number -> boolean"
examples = [
    { code = "is_weekend(`1705104000`) -> true", description = "Saturday is weekend" },
    { code = "is_weekend(now()) -> true/false", description = "Check current day" },
    { code = "is_weekend(`1705276800`) -> false", description = "Monday is not weekend" },
    { code = "is_weekend(event_timestamp) -> true/false", description = "Check event day" },
]
features = ["core"]

[[functions]]
name = "parse_date"
category = "datetime"
description = "Parse date string to timestamp"
signature = "string, string? -> number"
examples = [
    { code = "parse_date('2024-01-15', '%Y-%m-%d') -> 1705276800", description = "ISO date format" },
    { code = "parse_date('01/15/2024', '%m/%d/%Y') -> timestamp", description = "US date format" },
    { code = "parse_date('15-Jan-2024', '%d-%b-%Y') -> timestamp", description = "Named month" },
    { code = "parse_date('2024-01-15T10:30:00', '%Y-%m-%dT%H:%M:%S') -> timestamp", description = "With time" },
]
features = ["core"]

[[functions]]
name = "quarter"
category = "datetime"
description = "Get quarter of year (1-4) from timestamp"
signature = "number -> number"
examples = [
    { code = "quarter(`1713139200`) -> 2", description = "April is Q2" },
    { code = "quarter(`1704067200`) -> 1", description = "January is Q1" },
    { code = "quarter(`1719792000`) -> 3", description = "July is Q3" },
    { code = "quarter(`1730419200`) -> 4", description = "November is Q4" },
]
features = ["core"]

[[functions]]
name = "relative_time"
category = "datetime"
description = "Human-readable relative time from timestamp"
signature = "number -> string"
examples = [
    { code = '''relative_time(now() - 3600) -> \"1 hour ago\"''', description = "One hour ago" },
    { code = '''relative_time(now() - 60) -> \"1 minute ago\"''', description = "One minute ago" },
    { code = '''relative_time(now() - 86400) -> \"1 day ago\"''', description = "One day ago" },
    { code = "relative_time(created_at) -> human readable", description = "From field" },
]
features = ["core"]

[[functions]]
name = "start_of_day"
category = "datetime"
description = "Get ISO 8601 string for start of day (00:00:00)"
signature = "number|string -> string"
examples = [
    { code = '''start_of_day('2023-12-13T15:30:00Z') -> \"2023-12-13T00:00:00Z\"''', description = "From ISO string" },
    { code = "start_of_day(`1702483200`) -> start of that day", description = "From timestamp" },
    { code = "start_of_day(now()) -> today midnight", description = "Today start" },
    { code = "start_of_day('2024-01-15') -> midnight", description = "From date only" },
]
features = ["core"]

[[functions]]
name = "start_of_month"
category = "datetime"
description = "Get ISO 8601 string for start of month"
signature = "number|string -> string"
examples = [
    { code = '''start_of_month('2023-12-13T15:30:00Z') -> \"2023-12-01T00:00:00Z\"''', description = "From ISO string" },
    { code = "start_of_month(now()) -> first of month", description = "Current month start" },
    { code = "start_of_month(`1702483200`) -> month start", description = "From timestamp" },
    { code = '''start_of_month('2024-03-15') -> \"2024-03-01T00:00:00Z\"''', description = "March start" },
]
features = ["core"]

[[functions]]
name = "start_of_week"
category = "datetime"
description = "Get ISO 8601 string for start of week (Monday 00:00:00)"
signature = "number|string -> string"
examples = [
    { code = '''start_of_week('2023-12-13T15:30:00Z') -> \"2023-12-11T00:00:00Z\"''', description = "Wednesday to Monday" },
    { code = "start_of_week(now()) -> this Monday", description = "Current week start" },
    { code = "start_of_week(`1702483200`) -> week start", description = "From timestamp" },
    { code = '''start_of_week('2024-01-15') -> \"2024-01-15T00:00:00Z\"''', description = "Monday stays Monday" },
]
features = ["core"]

[[functions]]
name = "start_of_year"
category = "datetime"
description = "Get ISO 8601 string for start of year"
signature = "number|string -> string"
examples = [
    { code = '''start_of_year('2023-12-13T15:30:00Z') -> \"2023-01-01T00:00:00Z\"''', description = "From ISO string" },
    { code = "start_of_year(now()) -> Jan 1st", description = "Current year start" },
    { code = "start_of_year(`1702483200`) -> year start", description = "From timestamp" },
    { code = '''start_of_year('2024-06-15') -> \"2024-01-01T00:00:00Z\"''', description = "Mid-year to Jan 1" },
]
features = ["core"]

[[functions]]
name = "time_ago"
category = "datetime"
description = "Human-readable time since date (accepts timestamps or date strings)"
signature = "number|string -> string"
examples = [
    { code = '''time_ago('2020-01-01') -> \"4 years ago\"''', description = "From date string" },
    { code = '''time_ago(now() - 3600) -> \"1 hour ago\"''', description = "One hour ago" },
    { code = "time_ago(created_at) -> human readable", description = "From field" },
    { code = '''time_ago('2023-12-01') -> \"X months ago\"''', description = "Months ago" },
]
features = ["core"]

[[functions]]
name = "timezone_convert"
category = "datetime"
description = "Convert timestamp between timezones (IANA timezone names)"
signature = "string, string, string -> string"
examples = [
    { code = '''timezone_convert('2024-01-15T10:00:00', 'America/New_York', 'Europe/London') -> \"2024-01-15T15:00:00\"''', description = "NY to London" },
    { code = "timezone_convert(time, 'UTC', 'America/Los_Angeles') -> PST time", description = "UTC to Pacific" },
    { code = "timezone_convert(time, 'Asia/Tokyo', 'UTC') -> UTC time", description = "Tokyo to UTC" },
    { code = "timezone_convert(time, 'Europe/Paris', 'America/Chicago') -> CST time", description = "Paris to Chicago" },
]
features = ["core"]

[[functions]]
name = "to_epoch"
category = "datetime"
description = "Convert date string or timestamp to Unix timestamp (seconds)"
signature = "number|string -> number"
examples = [
    { code = "to_epoch('2023-12-13T16:00:00Z') -> 1702483200", description = "From ISO string" },
    { code = "to_epoch('2024-01-01') -> timestamp", description = "From date only" },
    { code = "to_epoch(date_field) -> seconds", description = "Convert field" },
    { code = "to_epoch('1970-01-01T00:00:00Z') -> 0", description = "Unix epoch" },
]
features = ["core"]

[[functions]]
name = "to_epoch_ms"
category = "datetime"
description = "Convert date string or timestamp to Unix timestamp (milliseconds)"
signature = "number|string -> number"
examples = [
    { code = "to_epoch_ms('2023-12-13T16:00:00Z') -> 1702483200000", description = "From ISO string" },
    { code = "to_epoch_ms('2024-01-01') -> timestamp_ms", description = "From date only" },
    { code = "to_epoch_ms(date_field) -> milliseconds", description = "Convert field" },
    { code = "to_epoch_ms('1970-01-01T00:00:00Z') -> 0", description = "Unix epoch" },
]
features = ["core"]

# =============================================================================
# DURATION FUNCTIONS
# =============================================================================

[[functions]]
name = "duration_hours"
category = "duration"
description = "Convert seconds to hours"
signature = "number -> number"
examples = [
    { code = "duration_hours(`7200`) -> 2", description = "2 hours" },
    { code = "duration_hours(`3600`) -> 1", description = "1 hour" },
    { code = "duration_hours(`5400`) -> 1.5", description = "1.5 hours" },
]
features = ["core"]

[[functions]]
name = "duration_minutes"
category = "duration"
description = "Convert seconds to minutes"
signature = "number -> number"
examples = [
    { code = "duration_minutes(`120`) -> 2", description = "2 minutes" },
    { code = "duration_minutes(`60`) -> 1", description = "1 minute" },
    { code = "duration_minutes(`90`) -> 1.5", description = "1.5 minutes" },
]
features = ["core"]

[[functions]]
name = "duration_seconds"
category = "duration"
description = "Get seconds component"
signature = "number -> number"
examples = [
    { code = "duration_seconds(`65`) -> 5", description = "65 seconds mod 60" },
    { code = "duration_seconds(`120`) -> 0", description = "Exact minutes" },
    { code = "duration_seconds(`3661`) -> 1", description = "1 hour 1 min 1 sec" },
]
features = ["core"]

[[functions]]
name = "format_duration"
category = "duration"
description = "Format seconds as duration string"
signature = "number -> string"
examples = [
    { code = '''format_duration(`5400`) -> \"1h30m\"''', description = "1.5 hours" },
    { code = '''format_duration(`3661`) -> \"1h1m1s\"''', description = "1 hour 1 min 1 sec" },
    { code = '''format_duration(`60`) -> \"1m\"''', description = "1 minute" },
]
features = ["core"]

[[functions]]
name = "parse_duration"
category = "duration"
description = "Parse duration string to seconds"
signature = "string -> number"
examples = [
    { code = "parse_duration('1h30m') -> 5400", description = "1.5 hours" },
    { code = "parse_duration('2h') -> 7200", description = "2 hours" },
    { code = "parse_duration('30s') -> 30", description = "30 seconds" },
]
features = ["core"]

# =============================================================================
# ENCODING FUNCTIONS
# =============================================================================

[[functions]]
name = "base64_decode"
category = "encoding"
description = "Decode base64 string"
signature = "string -> string"
examples = [
    { code = '''base64_decode('aGVsbG8=') -> \"hello\"''', description = "Decode hello" },
    { code = '''base64_decode('dGVzdA==') -> \"test\"''', description = "Decode test" },
    { code = '''base64_decode('') -> \"\"''', description = "Empty string" },
]
features = ["core"]

[[functions]]
name = "base64_encode"
category = "encoding"
description = "Encode string to base64"
signature = "string -> string"
examples = [
    { code = '''base64_encode('hello') -> \"aGVsbG8=\"''', description = "Encode hello" },
    { code = '''base64_encode('test') -> \"dGVzdA==\"''', description = "Encode test" },
    { code = '''base64_encode('') -> \"\"''', description = "Empty string" },
]
features = ["core"]

[[functions]]
name = "hex_decode"
category = "encoding"
description = "Decode hex string"
signature = "string -> string"
examples = [
    { code = '''hex_decode('68656c6c6f') -> \"hello\"''', description = "Decode hello" },
    { code = '''hex_decode('74657374') -> \"test\"''', description = "Decode test" },
    { code = '''hex_decode('') -> \"\"''', description = "Empty string" },
]
features = ["core"]

[[functions]]
name = "hex_encode"
category = "encoding"
description = "Encode string to hex"
signature = "string -> string"
examples = [
    { code = '''hex_encode('hello') -> \"68656c6c6f\"''', description = "Encode hello" },
    { code = '''hex_encode('test') -> \"74657374\"''', description = "Encode test" },
    { code = '''hex_encode('') -> \"\"''', description = "Empty string" },
]
features = ["core"]

[[functions]]
name = "jwt_decode"
category = "encoding"
description = "Decode JWT payload (claims) without verification"
signature = "string -> object"
examples = [
    { code = '''jwt_decode('eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJ1c2VyXzEyMyJ9.sig').sub -> \"user_123\"''', description = "Extract subject claim" },
    { code = "jwt_decode('eyJhbGciOiJIUzI1NiJ9.eyJuYW1lIjoiSm9obiJ9.sig').name -> 'John'", description = "Extract name claim" },
]
features = ["core"]

[[functions]]
name = "jwt_header"
category = "encoding"
description = "Decode JWT header without verification"
signature = "string -> object"
examples = [
    { code = '''jwt_header('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.payload.sig').alg -> \"HS256\"''', description = "Extract algorithm" },
    { code = '''jwt_header('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.payload.sig').typ -> \"JWT\"''', description = "Extract type" },
]
features = ["core"]

[[functions]]
name = "html_escape"
category = "encoding"
description = "Escape HTML special characters"
signature = "string -> string"
examples = [
    { code = '''html_escape('<div>') -> \"&lt;div&gt;\"''', description = "Escape tags" },
    { code = '''html_escape('a & b') -> \"a &amp; b\"''', description = "Escape ampersand" },
    { code = '''html_escape('\"quoted\"') -> \"&quot;quoted&quot;\"''', description = "Escape quotes" },
    { code = "html_escape(user_input) -> safe for HTML", description = "Sanitize input" },
]
features = ["core"]

[[functions]]
name = "html_unescape"
category = "encoding"
description = "Unescape HTML entities"
signature = "string -> string"
examples = [
    { code = '''html_unescape('&lt;div&gt;') -> \"<div>\"''', description = "Unescape tags" },
    { code = '''html_unescape('a &amp; b') -> \"a & b\"''', description = "Unescape ampersand" },
    { code = '''html_unescape('&quot;quoted&quot;') -> \"\\\"quoted\\\"\"''', description = "Unescape quotes" },
    { code = "html_unescape(escaped) -> original", description = "Decode entities" },
]
features = ["core"]

# =============================================================================
# EXPRESSION FUNCTIONS
# =============================================================================

[[functions]]
name = "all_expr"
category = "expression"
description = "Return true if every element satisfies the expression (short-circuits on false)"
signature = "array, expression -> boolean"
examples = [
    { code = "all_expr([1, 2, 3], &@ > `0`) -> true", description = "All positive" },
    { code = "all_expr([1, 2, 3], &@ > `2`) -> false", description = "Not all > 2" },
    { code = "all_expr([], &@ > `0`) -> true", description = "Empty array is true" },
    { code = "all_expr(users, &age >= `18`) -> true/false", description = "Check all adults" },
]
aliases = ["every"]
features = ["core", "fp"]

[[functions]]
name = "any_expr"
category = "expression"
description = "Return true if any element satisfies the expression (short-circuits)"
signature = "array, expression -> boolean"
examples = [
    { code = "any_expr([1, 2, 3], &@ > `2`) -> true", description = "At least one > 2" },
    { code = "any_expr([1, 2, 3], &@ > `5`) -> false", description = "None > 5" },
    { code = "any_expr([], &@ > `0`) -> false", description = "Empty array is false" },
    { code = "any_expr(users, &status == 'active') -> true/false", description = "Any active user" },
]
aliases = ["some"]
features = ["core", "fp"]

[[functions]]
name = "apply"
category = "expression"
description = "Apply a partial function or invoke a function by name with arguments"
signature = "object|string, ...any -> any"
examples = [
    { code = '''apply(partial('join', `\"-\"`), `[\"a\", \"b\"]`) -> 'a-b' ''', description = "Apply partial function" },
    { code = "apply('length', 'hello') -> 5", description = "Call function by name" },
    { code = "apply('add', `1`, `2`) -> 3", description = "Call with multiple args" },
    { code = "apply(partial('contains', 'hello'), 'ell') -> true", description = "Partial with contains" },
]
features = ["core"]

[[functions]]
name = "count_by"
category = "expression"
description = "Count occurrences grouped by expression result"
signature = "string, array -> object"
examples = [
    { code = "count_by('type', [{type: 'a'}, {type: 'b'}, {type: 'a'}]) -> {a: 2, b: 1}", description = "Count by field" },
    { code = "count_by('status', orders) -> {pending: 5, shipped: 3}", description = "Count orders by status" },
    { code = "count_by('@ > `50`', [30, 60, 70, 40]) -> {true: 2, false: 2}", description = "Count by condition" },
    { code = "count_by('category', []) -> {}", description = "Empty array" },
]
features = ["core"]

[[functions]]
name = "count_expr"
category = "expression"
description = "Count how many elements satisfy the expression"
signature = "array, expression -> number"
examples = [
    { code = "count_expr([1, 2, 3], &@ > `1`) -> 2", description = "Count > 1" },
    { code = "count_expr([1, 2, 3], &@ > `5`) -> 0", description = "None match" },
    { code = "count_expr(users, &active == `true`) -> 5", description = "Count active users" },
    { code = "count_expr([], &@ > `0`) -> 0", description = "Empty array" },
]
features = ["core"]

[[functions]]
name = "drop_while"
category = "expression"
description = "Drop elements from array while expression is truthy"
signature = "string, array -> array"
examples = [
    { code = "drop_while('@ < `4`', [1, 2, 3, 5, 1]) -> [5, 1]", description = "Drop while < 4" },
    { code = "drop_while('@ < `0`', [1, 2, 3]) -> [1, 2, 3]", description = "None dropped" },
    { code = "drop_while('@ < `10`', [1, 2, 3]) -> []", description = "All dropped" },
    { code = "drop_while('length(@) < `3`', ['a', 'ab', 'abc', 'x']) -> ['abc', 'x']", description = "Drop short strings" },
]
features = ["core", "fp"]

[[functions]]
name = "every"
category = "expression"
description = "Check if all elements match (alias for all_expr)"
signature = "string, array -> boolean"
examples = [
    { code = "every('@ > `0`', [1, 2, 3]) -> true", description = "All positive" },
    { code = "every('@ > `2`', [1, 2, 3]) -> false", description = "Not all > 2" },
    { code = "every('length(@) > `0`', ['a', 'b']) -> true", description = "All non-empty" },
    { code = "every('@ > `0`', []) -> true", description = "Empty is vacuously true" },
]
features = ["core", "fp"]

[[functions]]
name = "filter_expr"
category = "expression"
description = "Keep elements where JMESPath expression evaluates to truthy value"
signature = "array, expression -> array"
examples = [
    { code = "filter_expr([1, 2, 3], &@ > `1`) -> [2, 3]", description = "Filter numbers" },
    { code = "filter_expr(users, &age >= `18`) -> [adult users]", description = "Filter objects by field" },
    { code = "filter_expr(['a', '', 'b'], &length(@) > `0`) -> ['a', 'b']", description = "Filter empty strings" },
    { code = "filter_expr([], &@ > `0`) -> []", description = "Empty array returns empty" },
]
aliases = ["filter"]
features = ["core", "fp"]

[[functions]]
name = "find_expr"
category = "expression"
description = "Return first element where expression is truthy, or null if none match"
signature = "array, expression -> any"
examples = [
    { code = "find_expr([1, 2, 3], &@ > `1`) -> 2", description = "First > 1" },
    { code = "find_expr([1, 2, 3], &@ > `5`) -> null", description = "None found" },
    { code = "find_expr(users, &name == 'alice') -> {name: 'alice', ...}", description = "Find user" },
    { code = "find_expr([], &@ > `0`) -> null", description = "Empty array" },
]
features = ["core"]

[[functions]]
name = "find_index_expr"
category = "expression"
description = "Return zero-based index of first matching element, or -1 if none match"
signature = "array, expression -> number | null"
examples = [
    { code = "find_index_expr([1, 2, 3], &@ > `1`) -> 1", description = "Index of first > 1" },
    { code = "find_index_expr([1, 2, 3], &@ > `5`) -> -1", description = "Not found" },
    { code = "find_index_expr([5, 10, 15], &@ == `10`) -> 1", description = "Exact match" },
    { code = "find_index_expr([], &@ > `0`) -> -1", description = "Empty array" },
]
features = ["core"]

[[functions]]
name = "flat_map_expr"
category = "expression"
description = "Apply expression to each element and flatten all results into one array"
signature = "array, expression -> array"
examples = [
    { code = "flat_map_expr([[1], [2]], &@) -> [1, 2]", description = "Flatten nested arrays" },
    { code = "flat_map_expr([1, 2], &[@, @ * `2`]) -> [1, 2, 2, 4]", description = "Duplicate and transform" },
    { code = "flat_map_expr(users, &tags) -> all tags flattened", description = "Flatten object arrays" },
    { code = "flat_map_expr([], &@) -> []", description = "Empty array" },
]
features = ["core"]

[[functions]]
name = "group_by_expr"
category = "expression"
description = "Group elements into object keyed by expression result"
signature = "array, expression -> object"
examples = [
    { code = "group_by_expr([{t: 'a'}, {t: 'b'}], &t) -> {a: [...], b: [...]}", description = "Group by field" },
    { code = "group_by_expr([1, 2, 3, 4], &@ > `2`) -> {true: [3, 4], false: [1, 2]}", description = "Group by condition" },
    { code = "group_by_expr(users, &department) -> {eng: [...], sales: [...]}", description = "Group users" },
    { code = "group_by_expr([], &@) -> {}", description = "Empty array" },
]
features = ["core"]

[[functions]]
name = "map_expr"
category = "expression"
description = "Apply a JMESPath expression to each element, returning transformed array"
signature = "array, expression -> array"
examples = [
    { code = "map_expr([1, 2], &@ * `2`) -> [2, 4]", description = "Double each number" },
    { code = "map_expr(users, &name) -> ['alice', 'bob']", description = "Extract field from objects" },
    { code = "map_expr(['hello', 'world'], &upper(@)) -> ['HELLO', 'WORLD']", description = "Transform strings" },
    { code = "map_expr([], &@ * `2`) -> []", description = "Empty array returns empty" },
]
features = ["core"]

[[functions]]
name = "map_keys"
category = "expression"
description = "Transform object keys using expression"
signature = "string, object -> object"
examples = [
    { code = "map_keys('upper(@)', {a: 1}) -> {A: 1}", description = "Uppercase keys" },
    { code = "map_keys('lower(@)', {A: 1, B: 2}) -> {a: 1, b: 2}", description = "Lowercase keys" },
    { code = "map_keys('concat(@, `\"_suffix\"`)', {x: 1}) -> {x_suffix: 1}", description = "Add suffix" },
    { code = "map_keys('upper(@)', {}) -> {}", description = "Empty object" },
]
features = ["core", "fp"]

[[functions]]
name = "map_values"
category = "expression"
description = "Transform object values using expression"
signature = "string, object -> object"
examples = [
    { code = "map_values('@ * `2`', {a: 1, b: 2}) -> {a: 2, b: 4}", description = "Double values" },
    { code = "map_values('upper(@)', {a: 'x', b: 'y'}) -> {a: 'X', b: 'Y'}", description = "Uppercase strings" },
    { code = "map_values('@ + `10`', {x: 5}) -> {x: 15}", description = "Add to values" },
    { code = "map_values('@ * `2`', {}) -> {}", description = "Empty object" },
]
features = ["core", "fp"]

[[functions]]
name = "max_by_expr"
category = "expression"
description = "Return element with largest expression result, or null for empty array"
signature = "array, expression -> any"
examples = [
    { code = "max_by_expr([{a: 2}, {a: 1}], &a) -> {a: 2}", description = "Max by field" },
    { code = "max_by_expr(['a', 'abc', 'ab'], &length(@)) -> 'abc'", description = "Longest string" },
    { code = "max_by_expr(products, &price) -> most expensive", description = "Max price product" },
    { code = "max_by_expr([], &a) -> null", description = "Empty array" },
]
features = ["core"]

[[functions]]
name = "min_by_expr"
category = "expression"
description = "Return element with smallest expression result, or null for empty array"
signature = "array, expression -> any"
examples = [
    { code = "min_by_expr([{a: 2}, {a: 1}], &a) -> {a: 1}", description = "Min by field" },
    { code = "min_by_expr(['a', 'abc', 'ab'], &length(@)) -> 'a'", description = "Shortest string" },
    { code = "min_by_expr(products, &price) -> cheapest", description = "Min price product" },
    { code = "min_by_expr([], &a) -> null", description = "Empty array" },
]
features = ["core"]

[[functions]]
name = "order_by"
category = "expression"
description = "Sort array by multiple fields with ascending/descending control"
signature = "array, array[[string, string]] -> array"
examples = [
    { code = "order_by(items, [['name', 'asc'], ['price', 'desc']]) -> sorted", description = "Multi-field sort" },
    { code = "order_by(users, [['age', 'asc']]) -> youngest first", description = "Single field ascending" },
    { code = "order_by(products, [['price', 'desc']]) -> most expensive first", description = "Descending sort" },
    { code = "order_by([], [['a', 'asc']]) -> []", description = "Empty array" },
]
features = ["core"]

[[functions]]
name = "partial"
category = "expression"
description = "Create a partial function with some arguments pre-filled"
signature = "string, ...any -> object"
examples = [
    { code = '''partial('contains', `\"hello\"`) -> {__partial__: true, ...}''', description = "Partial contains" },
    { code = "partial('add', `10`) -> partial add 10", description = "Partial addition" },
    { code = "partial('join', '-') -> partial join with dash", description = "Partial join" },
    { code = "partial('multiply', `2`) -> partial multiply by 2", description = "Partial multiply" },
]
features = ["core"]

[[functions]]
name = "partition_expr"
category = "expression"
description = "Split array into [matches, non-matches] based on expression"
signature = "array, expression -> array"
examples = [
    { code = "partition_expr([1, 2, 3], &@ > `1`) -> [[2, 3], [1]]", description = "Split by condition" },
    { code = "partition_expr([1, 2, 3, 4], &@ % `2` == `0`) -> [[2, 4], [1, 3]]", description = "Even vs odd" },
    { code = "partition_expr(users, &active) -> [active, inactive]", description = "Partition users" },
    { code = "partition_expr([], &@ > `0`) -> [[], []]", description = "Empty array" },
]
features = ["core"]

[[functions]]
name = "reduce_expr"
category = "expression"
description = "Reduce array to single value using accumulator expression"
signature = "string, array, any -> any"
examples = [
    { code = "reduce_expr('add(accumulator, current)', [1, 2, 3], `0`) -> 6", description = "Sum numbers" },
    { code = "reduce_expr('multiply(accumulator, current)', [2, 3, 4], `1`) -> 24", description = "Product" },
    { code = "reduce_expr('max(accumulator, current)', [3, 1, 4], `0`) -> 4", description = "Find max" },
    { code = "reduce_expr('concat(accumulator, current)', ['a', 'b'], '') -> 'ab'", description = "Concat strings" },
]
aliases = ["fold"]
features = ["core", "fp"]

[[functions]]
name = "reject"
category = "expression"
description = "Keep elements where expression is falsy (inverse of filter_expr)"
signature = "string, array -> array"
examples = [
    { code = "reject('@ > `2`', [1, 2, 3, 4]) -> [1, 2]", description = "Reject > 2" },
    { code = "reject('@ < `0`', [1, -1, 2, -2]) -> [1, 2]", description = "Reject negatives" },
    { code = "reject('active', users) -> inactive users", description = "Reject active users" },
    { code = "reject('@ > `0`', []) -> []", description = "Empty array" },
]
features = ["core", "fp"]

[[functions]]
name = "scan_expr"
category = "expression"
description = "Like reduce but returns array of intermediate accumulator values"
signature = "string, array, any -> array"
examples = [
    { code = "scan_expr('add(accumulator, current)', [1, 2, 3], `0`) -> [1, 3, 6]", description = "Running sum" },
    { code = "scan_expr('multiply(accumulator, current)', [2, 3, 4], `1`) -> [2, 6, 24]", description = "Running product" },
    { code = "scan_expr('max(accumulator, current)', [3, 1, 4], `0`) -> [3, 3, 4]", description = "Running max" },
    { code = "scan_expr('add(accumulator, current)', [], `0`) -> []", description = "Empty array" },
]
features = ["core", "fp"]

[[functions]]
name = "some"
category = "expression"
description = "Check if any element matches (alias for any_expr)"
signature = "string, array -> boolean"
examples = [
    { code = "some('@ > `2`', [1, 2, 3]) -> true", description = "Some > 2" },
    { code = "some('@ > `5`', [1, 2, 3]) -> false", description = "None > 5" },
    { code = "some('active', users) -> true/false", description = "Any active user" },
    { code = "some('@ > `0`', []) -> false", description = "Empty is false" },
]
features = ["core", "fp"]

[[functions]]
name = "sort_by_expr"
category = "expression"
description = "Sort array by expression result in ascending order"
signature = "array, expression -> array"
examples = [
    { code = "sort_by_expr([{a: 2}, {a: 1}], &a) -> [{a: 1}, {a: 2}]", description = "Sort by field" },
    { code = "sort_by_expr(['bb', 'a', 'ccc'], &length(@)) -> ['a', 'bb', 'ccc']", description = "Sort by length" },
    { code = "sort_by_expr(users, &name) -> alphabetical", description = "Sort users by name" },
    { code = "sort_by_expr([], &a) -> []", description = "Empty array" },
]
features = ["core"]

[[functions]]
name = "take_while"
category = "expression"
description = "Take elements from array while expression is truthy"
signature = "string, array -> array"
examples = [
    { code = "take_while('@ < `4`', [1, 2, 3, 5, 1]) -> [1, 2, 3]", description = "Take while < 4" },
    { code = "take_while('@ > `0`', [3, 2, 1, 0, 5]) -> [3, 2, 1]", description = "Take while positive" },
    { code = "take_while('length(@) < `3`', ['a', 'ab', 'abc']) -> ['a', 'ab']", description = "Take short strings" },
    { code = "take_while('@ < `0`', [1, 2, 3]) -> []", description = "None taken" },
]
features = ["core", "fp"]

[[functions]]
name = "unique_by_expr"
category = "expression"
description = "Remove duplicates by expression result, keeping first occurrence"
signature = "array, expression -> array"
examples = [
    { code = "unique_by_expr([{a: 1}, {a: 1}], &a) -> [{a: 1}]", description = "Unique by field" },
    { code = "unique_by_expr([{id: 1, v: 'a'}, {id: 1, v: 'b'}], &id) -> [{id: 1, v: 'a'}]", description = "First wins" },
    { code = "unique_by_expr(['aa', 'b', 'cc'], &length(@)) -> ['aa', 'b']", description = "Unique by length" },
    { code = "unique_by_expr([], &a) -> []", description = "Empty array" },
]
features = ["core"]

[[functions]]
name = "zip_with"
category = "expression"
description = "Zip two arrays with a custom combiner expression"
signature = "string, array, array -> array"
examples = [
    { code = "zip_with('add([0], [1])', [1, 2], [10, 20]) -> [11, 22]", description = "Add pairs" },
    { code = "zip_with('multiply([0], [1])', [2, 3], [4, 5]) -> [8, 15]", description = "Multiply pairs" },
    { code = "zip_with('concat([0], [1])', ['a', 'b'], ['1', '2']) -> ['a1', 'b2']", description = "Concat pairs" },
    { code = "zip_with('add([0], [1])', [], []) -> []", description = "Empty arrays" },
]
features = ["core", "fp"]

[[functions]]
name = "walk"
category = "expression"
description = "Recursively apply expression to all components of a value (bottom-up)"
signature = "string, any -> any"
examples = [
    { code = "walk('@', data) -> data unchanged", description = "Identity transform" },
    { code = "walk('type(@)', {a: 1}) -> 'object'", description = "Get type of result" },
    { code = "walk('length(@)', [[], []]) -> 2", description = "Lengths of nested arrays" },
    { code = "walk('keys(@)', {a: {b: 1}}) -> ['a']", description = "Keys at each level" },
]
features = ["core", "fp"]

# =============================================================================
# FUZZY FUNCTIONS
# =============================================================================

[[functions]]
name = "damerau_levenshtein"
category = "fuzzy"
description = "Damerau-Levenshtein distance"
signature = "string, string -> number"
examples = [
    { code = "damerau_levenshtein('ab', 'ba') -> 1", description = "Single transposition" },
    { code = "damerau_levenshtein('hello', 'hello') -> 0", description = "Identical strings" },
    { code = "damerau_levenshtein('ca', 'abc') -> 2", description = "Multiple edits" },
]
features = ["core"]

[[functions]]
name = "jaro"
category = "fuzzy"
description = "Jaro similarity (0-1)"
signature = "string, string -> number"
examples = [
    { code = "jaro('hello', 'hallo') -> 0.866...", description = "Similar words" },
    { code = "jaro('hello', 'hello') -> 1.0", description = "Identical strings" },
    { code = "jaro('abc', 'xyz') -> 0.0", description = "Completely different" },
]
features = ["core"]

[[functions]]
name = "jaro_winkler"
category = "fuzzy"
description = "Jaro-Winkler similarity (0-1)"
signature = "string, string -> number"
examples = [
    { code = "jaro_winkler('hello', 'hallo') -> 0.88", description = "Similar words" },
    { code = "jaro_winkler('hello', 'hello') -> 1.0", description = "Identical strings" },
    { code = "jaro_winkler('abc', 'xyz') -> 0.0", description = "Completely different" },
]
features = ["core"]

[[functions]]
name = "levenshtein"
category = "fuzzy"
description = "Levenshtein edit distance"
signature = "string, string -> number"
examples = [
    { code = "levenshtein('kitten', 'sitting') -> 3", description = "Classic example" },
    { code = "levenshtein('hello', 'hello') -> 0", description = "Identical strings" },
    { code = "levenshtein('abc', 'def') -> 3", description = "All different" },
]
features = ["core"]

[[functions]]
name = "normalized_levenshtein"
category = "fuzzy"
description = "Normalized Levenshtein (0-1)"
signature = "string, string -> number"
examples = [
    { code = "normalized_levenshtein('ab', 'abc') -> 0.666...", description = "One edit" },
    { code = "normalized_levenshtein('hello', 'hello') -> 0.0", description = "Identical" },
    { code = "normalized_levenshtein('abc', 'xyz') -> 1.0", description = "All different" },
]
features = ["core"]

[[functions]]
name = "sorensen_dice"
category = "fuzzy"
description = "Sorensen-Dice coefficient (0-1)"
signature = "string, string -> number"
examples = [
    { code = "sorensen_dice('night', 'nacht') -> 0.25", description = "Similar words" },
    { code = "sorensen_dice('hello', 'hello') -> 1.0", description = "Identical strings" },
    { code = "sorensen_dice('abc', 'xyz') -> 0.0", description = "No common bigrams" },
]
features = ["core"]

# =============================================================================
# GEO FUNCTIONS
# =============================================================================

[[functions]]
name = "geo_bearing"
category = "geo"
description = "Bearing between coordinates"
signature = "number, number, number, number -> number"
examples = [
    { code = "geo_bearing(`40.7128`, `-74.0060`, `51.5074`, `-0.1278`) -> 51.2", description = "NYC to London" },
    { code = "geo_bearing(`0`, `0`, `0`, `90`) -> 90.0", description = "Due east" },
    { code = "geo_bearing(`0`, `0`, `90`, `0`) -> 0.0", description = "Due north" },
]
features = ["core"]

[[functions]]
name = "geo_distance"
category = "geo"
description = "Haversine distance in meters"
signature = "number, number, number, number -> number"
examples = [
    { code = "geo_distance(`40.7128`, `-74.0060`, `51.5074`, `-0.1278`) -> 5570222", description = "NYC to London" },
    { code = "geo_distance(`34.0522`, `-118.2437`, `37.7749`, `-122.4194`) -> 559044", description = "LA to SF" },
    { code = "geo_distance(`0`, `0`, `0`, `0`) -> 0", description = "Same point" },
]
features = ["core"]

[[functions]]
name = "geo_distance_km"
category = "geo"
description = "Haversine distance in kilometers"
signature = "number, number, number, number -> number"
examples = [
    { code = "geo_distance_km(`40.7128`, `-74.0060`, `51.5074`, `-0.1278`) -> 5570.2", description = "NYC to London" },
    { code = "geo_distance_km(`34.0522`, `-118.2437`, `37.7749`, `-122.4194`) -> 559.0", description = "LA to SF" },
    { code = "geo_distance_km(`48.8566`, `2.3522`, `51.5074`, `-0.1278`) -> 343.5", description = "Paris to London" },
]
features = ["core"]

[[functions]]
name = "geo_distance_miles"
category = "geo"
description = "Haversine distance in miles"
signature = "number, number, number, number -> number"
examples = [
    { code = "geo_distance_miles(`40.7128`, `-74.0060`, `51.5074`, `-0.1278`) -> 3461.0", description = "NYC to London" },
    { code = "geo_distance_miles(`34.0522`, `-118.2437`, `37.7749`, `-122.4194`) -> 347.4", description = "LA to SF" },
    { code = "geo_distance_miles(`48.8566`, `2.3522`, `51.5074`, `-0.1278`) -> 213.4", description = "Paris to London" },
]
features = ["core"]

# =============================================================================
# HASH FUNCTIONS
# =============================================================================

[[functions]]
name = "crc32"
category = "hash"
description = "Calculate CRC32 checksum"
signature = "string -> number"
examples = [
    { code = "crc32('hello') -> 907060870", description = "Simple string" },
    { code = "crc32('') -> 0", description = "Empty string" },
    { code = "crc32('test data') -> 2706273274", description = "Data with space" },
]
features = ["core"]

[[functions]]
name = "hmac_md5"
category = "hash"
description = "Calculate HMAC-MD5 signature"
signature = "string, string -> string"
examples = [
    { code = '''hmac_md5('hello', 'secret') -> \"e17e4e4a205c55782dce5b6ff41e6e19\"''', description = "With secret key" },
    { code = '''hmac_md5('message', 'key') -> \"a24c903c3a7e7b741ea77bd467b98bca\"''', description = "Different message" },
]
features = ["core"]

[[functions]]
name = "hmac_sha1"
category = "hash"
description = "Calculate HMAC-SHA1 signature"
signature = "string, string -> string"
examples = [
    { code = '''hmac_sha1('hello', 'secret') -> \"5112055c36b16a6693045d75a054332e4555b52f\"''', description = "With secret key" },
    { code = '''hmac_sha1('data', 'key') -> \"104152c5bfdca07bc633eebd46199f0255c9f49d\"''', description = "Different data" },
]
features = ["core"]

[[functions]]
name = "hmac_sha256"
category = "hash"
description = "Calculate HMAC-SHA256 signature"
signature = "string, string -> string"
examples = [
    { code = '''hmac_sha256('hello', 'secret') -> \"88aab3ede8d3adf94d26ab90d3bafd4a2083070c3bcce9c014ee04a443847c0b\"''', description = "With secret key" },
    { code = '''hmac_sha256('data', 'key') -> \"5031fe3d989c6d1537a013fa6e739da23463fdaec3b70137d828e36ace221bd0\"''', description = "Different data" },
]
features = ["core"]

[[functions]]
name = "hmac_sha512"
category = "hash"
description = "Calculate HMAC-SHA512 signature"
signature = "string, string -> string"
examples = [
    { code = '''hmac_sha512('hello', 'secret') -> \"d05888a20ae...\"''', description = "With secret key" },
    { code = '''hmac_sha512('data', 'key') -> \"3c5953a18...\"''', description = "Different data" },
]
features = ["core"]

[[functions]]
name = "md5"
category = "hash"
description = "Calculate MD5 hash"
signature = "string -> string"
examples = [
    { code = '''md5('hello') -> \"5d41402abc4b2a76b9719d911017c592\"''', description = "Simple string" },
    { code = '''md5('') -> \"d41d8cd98f00b204e9800998ecf8427e\"''', description = "Empty string" },
    { code = '''md5('test') -> \"098f6bcd4621d373cade4e832627b4f6\"''', description = "Another string" },
]
features = ["core"]

[[functions]]
name = "sha1"
category = "hash"
description = "Calculate SHA-1 hash"
signature = "string -> string"
examples = [
    { code = '''sha1('hello') -> \"aaf4c61ddcc5e8a2dabede0f3b482cd9aea9434d\"''', description = "Simple string" },
    { code = '''sha1('') -> \"da39a3ee5e6b4b0d3255bfef95601890afd80709\"''', description = "Empty string" },
    { code = '''sha1('test') -> \"a94a8fe5ccb19ba61c4c0873d391e987982fbbd3\"''', description = "Another string" },
]
features = ["core"]

[[functions]]
name = "sha256"
category = "hash"
description = "Calculate SHA-256 hash"
signature = "string -> string"
examples = [
    { code = '''sha256('hello') -> \"2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824\"''', description = "Simple string" },
    { code = '''sha256('') -> \"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855\"''', description = "Empty string" },
    { code = '''sha256('test') -> \"9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08\"''', description = "Another string" },
]
features = ["core"]

[[functions]]
name = "sha512"
category = "hash"
description = "Calculate SHA-512 hash"
signature = "string -> string"
examples = [
    { code = '''sha512('hello') -> \"9b71d224bd62f3785d96d46ad3ea3d73319bfbc2890caadae2dff72519673ca72323c3d99ba5c11d7c7acc6e14b8c5da0c4663475c2e5c3adef46f73bcdec043\"''', description = "Simple string" },
    { code = '''sha512('test') -> \"ee26b0dd4af7e749aa1a8ee3c10ae9923f618980772e473f8819a5d4940e0db27ac185f8a0e1d5f84f88bc887fd67b143732c304cc5fa9ad8e6f57f50028a8ff\"''', description = "Another string" },
]
features = ["core"]

# =============================================================================
# IDS FUNCTIONS
# =============================================================================

[[functions]]
name = "nanoid"
category = "ids"
description = "Generate nanoid"
signature = "number? -> string"
examples = [
    { code = '''nanoid() -> \"V1StGXR8_Z5jdHi6B-myT\"''', description = "Default 21 chars" },
    { code = '''nanoid(`10`) -> \"IRFa-VaY2b\"''', description = "Custom length" },
]
features = ["core"]

[[functions]]
name = "ulid"
category = "ids"
description = "Generate ULID"
signature = "-> string"
examples = [
    { code = '''ulid() -> \"01ARZ3NDEKTSV4RRFFQ69G5FAV\"''', description = "Generate ULID" },
    { code = '''length(ulid()) -> 26''', description = "Always 26 chars" },
]
features = ["core"]

[[functions]]
name = "ulid_timestamp"
category = "ids"
description = "Extract timestamp from ULID"
signature = "string -> number"
examples = [
    { code = "ulid_timestamp('01ARZ3NDEKTSV4RRFFQ69G5FAV') -> 1469918176385", description = "Extract timestamp" },
    { code = "ulid_timestamp('01BX5ZZKBKACTAV9WEVGEMMVRY') -> 1484581420610", description = "Another ULID" },
]
features = ["core"]

# =============================================================================
# JSONPATCH FUNCTIONS
# =============================================================================

[[functions]]
name = "json_diff"
category = "jsonpatch"
description = "Generate JSON Patch (RFC 6902) that transforms first object into second"
signature = "object, object -> array"
examples = [
    { code = "json_diff({a: 1}, {a: 2}) -> [{op: 'replace', path: '/a', value: 2}]", description = "Replace value" },
    { code = "json_diff({a: 1}, {a: 1, b: 2}) -> [{op: 'add', path: '/b', value: 2}]", description = "Add field" },
    { code = "json_diff({a: 1, b: 2}, {a: 1}) -> [{op: 'remove', path: '/b'}]", description = "Remove field" },
]
features = ["core"]

[[functions]]
name = "json_merge_patch"
category = "jsonpatch"
description = "Apply JSON Merge Patch (RFC 7396) to an object"
signature = "object, object -> object"
examples = [
    { code = "json_merge_patch({a: 1, b: 2}, {b: 3, c: 4}) -> {a: 1, b: 3, c: 4}", description = "Merge objects" },
    { code = "json_merge_patch({a: 1}, {a: `null`}) -> {}", description = "Null removes field" },
    { code = "json_merge_patch({}, {a: 1}) -> {a: 1}", description = "Add to empty" },
]
features = ["core"]

[[functions]]
name = "json_patch"
category = "jsonpatch"
description = "Apply JSON Patch (RFC 6902) operations to an object"
signature = "object, array -> object"
examples = [
    { code = "json_patch({a: 1}, [{op: 'add', path: '/b', value: 2}]) -> {a: 1, b: 2}", description = "Add operation" },
    { code = "json_patch({a: 1}, [{op: 'replace', path: '/a', value: 2}]) -> {a: 2}", description = "Replace operation" },
    { code = "json_patch({a: 1, b: 2}, [{op: 'remove', path: '/b'}]) -> {a: 1}", description = "Remove operation" },
]
features = ["core"]

# =============================================================================
# MATH FUNCTIONS
# =============================================================================

[[functions]]
name = "abs_fn"
category = "math"
description = "Absolute value"
signature = "number -> number"
examples = [
    { code = "abs_fn(`-5`) -> 5", description = "Negative to positive" },
    { code = "abs_fn(`5`) -> 5", description = "Already positive" },
    { code = "abs_fn(`0`) -> 0", description = "Zero stays zero" },
    { code = "abs_fn(`-3.14`) -> 3.14", description = "Negative float" },
]
features = ["core"]

[[functions]]
name = "add"
category = "math"
description = "Add two numbers"
signature = "number, number -> number"
examples = [
    { code = "add(`2`, `3`) -> 5", description = "Add integers" },
    { code = "add(`1.5`, `2.5`) -> 4.0", description = "Add floats" },
    { code = "add(`-5`, `3`) -> -2", description = "With negative" },
    { code = "add(`0`, `10`) -> 10", description = "Add zero" },
]
features = ["core"]

[[functions]]
name = "ceil_fn"
category = "math"
description = "Round up to nearest integer"
signature = "number -> number"
examples = [
    { code = "ceil_fn(`3.2`) -> 4", description = "Round up fraction" },
    { code = "ceil_fn(`3.9`) -> 4", description = "Round up high fraction" },
    { code = "ceil_fn(`3.0`) -> 3", description = "Already integer" },
    { code = "ceil_fn(`-3.2`) -> -3", description = "Negative rounds toward zero" },
]
features = ["core"]

[[functions]]
name = "clamp"
category = "math"
description = "Clamp value to range"
signature = "number, number, number -> number"
examples = [
    { code = "clamp(`15`, `0`, `10`) -> 10", description = "Above max" },
    { code = "clamp(`-5`, `0`, `10`) -> 0", description = "Below min" },
    { code = "clamp(`5`, `0`, `10`) -> 5", description = "Within range" },
    { code = "clamp(`100`, `50`, `75`) -> 75", description = "Custom range" },
]
features = ["core"]

[[functions]]
name = "cos"
category = "math"
description = "Cosine function"
signature = "number -> number"
examples = [
    { code = "cos(`0`) -> 1", description = "Cos of 0" },
    { code = "cos(`3.14159`) -> -1", description = "Cos of pi" },
    { code = "cos(`1.5708`) -> ~0", description = "Cos of pi/2" },
    { code = "cos(`6.28318`) -> 1", description = "Cos of 2*pi" },
]
features = ["core"]

[[functions]]
name = "covariance"
category = "math"
description = "Covariance between two arrays"
signature = "array, array -> number"
examples = [
    { code = "covariance([1, 2, 3], [1, 2, 3]) -> 0.666...", description = "Perfect positive" },
    { code = "covariance([1, 2, 3], [3, 2, 1]) -> -0.666...", description = "Perfect negative" },
    { code = "covariance([1, 2, 3], [1, 1, 1]) -> 0", description = "No correlation" },
    { code = "covariance(x_values, y_values) -> number", description = "From arrays" },
]
features = ["core"]

[[functions]]
name = "divide"
category = "math"
description = "Divide first number by second"
signature = "number, number -> number"
examples = [
    { code = "divide(`10`, `2`) -> 5", description = "Integer division" },
    { code = "divide(`7`, `2`) -> 3.5", description = "Fractional result" },
    { code = "divide(`1`, `3`) -> 0.333...", description = "Repeating decimal" },
    { code = "divide(`-10`, `2`) -> -5", description = "Negative dividend" },
]
features = ["core"]

[[functions]]
name = "ewma"
category = "math"
description = "Exponential weighted moving average"
signature = "array, number -> array"
examples = [
    { code = "ewma([1, 2, 3, 4, 5], `0.5`) -> [1, 1.5, 2.25, ...]", description = "Alpha 0.5" },
    { code = "ewma(prices, `0.3`) -> smoothed prices", description = "Smooth stock prices" },
    { code = "ewma([10, 20, 30], `0.9`) -> fast response", description = "High alpha" },
    { code = "ewma([10, 20, 30], `0.1`) -> slow response", description = "Low alpha" },
]
features = ["core"]

[[functions]]
name = "floor_fn"
category = "math"
description = "Round down to nearest integer"
signature = "number -> number"
examples = [
    { code = "floor_fn(`3.7`) -> 3", description = "Round down high fraction" },
    { code = "floor_fn(`3.2`) -> 3", description = "Round down low fraction" },
    { code = "floor_fn(`3.0`) -> 3", description = "Already integer" },
    { code = "floor_fn(`-3.2`) -> -4", description = "Negative rounds away from zero" },
]
features = ["core"]

[[functions]]
name = "format_number"
category = "math"
description = "Format number with separators and optional suffix"
signature = "number, number?, string? -> string"
examples = [
    { code = '''format_number(`1234567`, `0`) -> \"1,234,567\"''', description = "With commas" },
    { code = '''format_number(`1234.56`, `2`) -> \"1,234.56\"''', description = "With decimals" },
    { code = '''format_number(`1000000`, `0`) -> \"1,000,000\"''', description = "Million" },
    { code = '''format_number(`99.9`, `1`) -> \"99.9\"''', description = "Small number" },
]
features = ["core"]

[[functions]]
name = "log"
category = "math"
description = "Natural logarithm"
signature = "number -> number"
examples = [
    { code = "log(`2.718`) -> ~1", description = "Log of e" },
    { code = "log(`1`) -> 0", description = "Log of 1" },
    { code = "log(`10`) -> 2.302...", description = "Log of 10" },
    { code = "log(`100`) -> 4.605...", description = "Log of 100" },
]
features = ["core"]

[[functions]]
name = "median"
category = "math"
description = "Calculate median of array"
signature = "array -> number"
examples = [
    { code = "median([1, 2, 3, 4, 5]) -> 3", description = "Odd count" },
    { code = "median([1, 2, 3, 4]) -> 2.5", description = "Even count" },
    { code = "median([10, 20, 30]) -> 20", description = "Middle value" },
    { code = "median([5]) -> 5", description = "Single element" },
]
features = ["core"]

[[functions]]
name = "mod_fn"
category = "math"
description = "Modulo operation"
signature = "number, number -> number"
examples = [
    { code = "mod_fn(`10`, `3`) -> 1", description = "Remainder of 10/3" },
    { code = "mod_fn(`15`, `5`) -> 0", description = "Evenly divisible" },
    { code = "mod_fn(`7`, `2`) -> 1", description = "Odd check" },
    { code = "mod_fn(`100`, `7`) -> 2", description = "Larger numbers" },
]
features = ["core"]

[[functions]]
name = "mode"
category = "math"
description = "Find the most common value in an array"
signature = "array -> any"
examples = [
    { code = "mode([1, 2, 2, 3]) -> 2", description = "Most frequent" },
    { code = "mode(['a', 'b', 'a', 'a']) -> 'a'", description = "String mode" },
    { code = "mode([1, 1, 2, 2, 3]) -> 1 or 2", description = "Tie returns first" },
    { code = "mode([5]) -> 5", description = "Single element" },
]
features = ["core"]

[[functions]]
name = "moving_avg"
category = "math"
description = "Simple moving average with window size"
signature = "array, number -> array"
examples = [
    { code = "moving_avg([1, 2, 3, 4, 5], `3`) -> [null, null, 2, 3, 4]", description = "Window of 3" },
    { code = "moving_avg([10, 20, 30, 40], `2`) -> [null, 15, 25, 35]", description = "Window of 2" },
    { code = "moving_avg(prices, `7`) -> weekly average", description = "7-day moving avg" },
    { code = "moving_avg([1, 2, 3], `1`) -> [1, 2, 3]", description = "Window of 1" },
]
features = ["core"]

[[functions]]
name = "multiply"
category = "math"
description = "Multiply two numbers"
signature = "number, number -> number"
examples = [
    { code = "multiply(`4`, `3`) -> 12", description = "Basic multiplication" },
    { code = "multiply(`2.5`, `4`) -> 10", description = "With decimals" },
    { code = "multiply(`-3`, `4`) -> -12", description = "With negative" },
    { code = "multiply(`0`, `100`) -> 0", description = "Multiply by zero" },
]
features = ["core"]

[[functions]]
name = "percentile"
category = "math"
description = "Calculate percentile of array"
signature = "array, number -> number"
examples = [
    { code = "percentile([1, 2, 3, 4, 5], `50`) -> 3", description = "50th percentile (median)" },
    { code = "percentile([1, 2, 3, 4, 5], `25`) -> 2", description = "25th percentile" },
    { code = "percentile([1, 2, 3, 4, 5], `75`) -> 4", description = "75th percentile" },
    { code = "percentile(scores, `90`) -> top 10% threshold", description = "90th percentile" },
]
features = ["core"]

[[functions]]
name = "pow"
category = "math"
description = "Raise to power"
signature = "number, number -> number"
examples = [
    { code = "pow(`2`, `3`) -> 8", description = "2 cubed" },
    { code = "pow(`10`, `2`) -> 100", description = "10 squared" },
    { code = "pow(`2`, `10`) -> 1024", description = "2^10" },
    { code = "pow(`4`, `0.5`) -> 2", description = "Square root via power" },
]
features = ["core"]

[[functions]]
name = "quantile"
category = "math"
description = "Nth quantile (generalized percentile, q in [0,1])"
signature = "array, number -> number"
examples = [
    { code = "quantile([1, 2, 3, 4, 5], `0.5`) -> 3", description = "Median (0.5)" },
    { code = "quantile([1, 2, 3, 4, 5], `0.25`) -> 2", description = "First quartile" },
    { code = "quantile([1, 2, 3, 4, 5], `0.75`) -> 4", description = "Third quartile" },
    { code = "quantile(values, `0.9`) -> 90th quantile", description = "90th quantile" },
]
features = ["core"]

[[functions]]
name = "round"
category = "math"
description = "Round to specified decimal places"
signature = "number, number -> number"
examples = [
    { code = "round(`3.14159`, `2`) -> 3.14", description = "Two decimals" },
    { code = "round(`3.5`, `0`) -> 4", description = "Round to integer" },
    { code = "round(`2.555`, `2`) -> 2.56", description = "Round up" },
    { code = "round(`123.456`, `1`) -> 123.5", description = "One decimal" },
]
features = ["core"]

[[functions]]
name = "sin"
category = "math"
description = "Sine function"
signature = "number -> number"
examples = [
    { code = "sin(`0`) -> 0", description = "Sin of 0" },
    { code = "sin(`1.5708`) -> 1", description = "Sin of pi/2" },
    { code = "sin(`3.14159`) -> ~0", description = "Sin of pi" },
    { code = "sin(`6.28318`) -> ~0", description = "Sin of 2*pi" },
]
features = ["core"]

[[functions]]
name = "sqrt"
category = "math"
description = "Square root"
signature = "number -> number"
examples = [
    { code = "sqrt(`16`) -> 4", description = "Perfect square" },
    { code = "sqrt(`2`) -> 1.414...", description = "Irrational result" },
    { code = "sqrt(`100`) -> 10", description = "Larger number" },
    { code = "sqrt(`0`) -> 0", description = "Zero" },
]
features = ["core"]

[[functions]]
name = "standardize"
category = "math"
description = "Standardize array to mean=0, std=1 (z-score normalization)"
signature = "array -> array"
examples = [
    { code = "standardize([10, 20, 30]) -> [-1.22, 0, 1.22]", description = "Basic z-scores" },
    { code = "standardize([1, 2, 3, 4, 5]) -> normalized", description = "Normalize values" },
    { code = "standardize(scores) -> z-scores", description = "Standardize scores" },
    { code = "standardize([5, 5, 5]) -> [0, 0, 0]", description = "Identical values" },
]
features = ["core"]

[[functions]]
name = "stddev"
category = "math"
description = "Calculate standard deviation of array"
signature = "array -> number"
examples = [
    { code = "stddev([1, 2, 3, 4, 5]) -> 1.414...", description = "Basic stddev" },
    { code = "stddev([10, 10, 10]) -> 0", description = "No variation" },
    { code = "stddev([1, 100]) -> ~49.5", description = "High variation" },
    { code = "stddev(values) -> spread measure", description = "Measure spread" },
]
features = ["core"]

[[functions]]
name = "subtract"
category = "math"
description = "Subtract second number from first"
signature = "number, number -> number"
examples = [
    { code = "subtract(`5`, `3`) -> 2", description = "Basic subtraction" },
    { code = "subtract(`10`, `15`) -> -5", description = "Negative result" },
    { code = "subtract(`3.5`, `1.5`) -> 2", description = "With decimals" },
    { code = "subtract(`0`, `5`) -> -5", description = "From zero" },
]
features = ["core"]

[[functions]]
name = "tan"
category = "math"
description = "Tangent function"
signature = "number -> number"
examples = [
    { code = "tan(`0`) -> 0", description = "Tan of 0" },
    { code = "tan(`0.7854`) -> ~1", description = "Tan of pi/4" },
    { code = "tan(`3.14159`) -> ~0", description = "Tan of pi" },
    { code = "tan(angle) -> ratio", description = "Calculate tangent" },
]
features = ["core"]

[[functions]]
name = "to_fixed"
category = "math"
description = "Format number with exact decimal places"
signature = "number, number -> string"
examples = [
    { code = '''to_fixed(`3.14159`, `2`) -> \"3.14\"''', description = "Two decimals" },
    { code = '''to_fixed(`5`, `2`) -> \"5.00\"''', description = "Pad with zeros" },
    { code = '''to_fixed(`99.9`, `0`) -> \"100\"''', description = "Round to integer" },
    { code = '''to_fixed(`1.5`, `3`) -> \"1.500\"''', description = "Extra precision" },
]
features = ["core"]

[[functions]]
name = "variance"
category = "math"
description = "Calculate variance of array"
signature = "array -> number"
examples = [
    { code = "variance([1, 2, 3, 4, 5]) -> 2", description = "Basic variance" },
    { code = "variance([10, 10, 10]) -> 0", description = "No variation" },
    { code = "variance([1, 100]) -> 2450.25", description = "High variation" },
    { code = "variance(values) -> spread^2", description = "Squared spread" },
]
features = ["core"]

# =============================================================================
# MULTIMATCH FUNCTIONS
# =============================================================================

[[functions]]
name = "extract_all"
category = "multimatch"
description = "Extract all pattern matches with positions (Aho-Corasick)"
signature = "string, array[string] -> array[object]"
examples = [
    { code = "extract_all('error warning', ['error', 'warning']) -> [{pattern: 'error', match: 'error', start: 0, end: 5}, ...]", description = "Multiple patterns" },
    { code = "extract_all('abab', ['a', 'b']) -> [{pattern: 'a', match: 'a', start: 0, end: 1}, ...]", description = "Overlapping matches" },
]
features = ["core"]

[[functions]]
name = "extract_between"
category = "multimatch"
description = "Extract text between two delimiters"
signature = "string, string, string -> string|null"
examples = [
    { code = '''extract_between('<title>Page</title>', '<title>', '</title>') -> \"Page\"''', description = "HTML tag content" },
    { code = '''extract_between('Hello [world]!', '[', ']') -> \"world\"''', description = "Bracketed content" },
    { code = "extract_between('no match', '[', ']') -> null", description = "No delimiters found" },
]
features = ["core"]

[[functions]]
name = "match_all"
category = "multimatch"
description = "Check if string contains all of the patterns (Aho-Corasick)"
signature = "string, array[string] -> boolean"
examples = [
    { code = "match_all('hello world', ['hello', 'world']) -> true", description = "All patterns found" },
    { code = "match_all('hello world', ['hello', 'foo']) -> false", description = "Missing pattern" },
    { code = "match_all('abc', []) -> true", description = "Empty patterns" },
]
features = ["core"]

[[functions]]
name = "match_any"
category = "multimatch"
description = "Check if string contains any of the patterns (Aho-Corasick)"
signature = "string, array[string] -> boolean"
examples = [
    { code = "match_any('hello world', ['world', 'foo']) -> true", description = "One pattern found" },
    { code = "match_any('hello world', ['foo', 'bar']) -> false", description = "No patterns found" },
    { code = "match_any('abc', []) -> false", description = "Empty patterns" },
]
features = ["core"]

[[functions]]
name = "match_count"
category = "multimatch"
description = "Count total pattern matches in string (Aho-Corasick)"
signature = "string, array[string] -> number"
examples = [
    { code = "match_count('abcabc', ['a', 'b']) -> 4", description = "Count all matches" },
    { code = "match_count('hello', ['l']) -> 2", description = "Repeated pattern" },
    { code = "match_count('abc', ['x']) -> 0", description = "No matches" },
]
features = ["core"]

[[functions]]
name = "match_positions"
category = "multimatch"
description = "Get start/end positions of all pattern matches (Aho-Corasick)"
signature = "string, array[string] -> array[object]"
examples = [
    { code = "match_positions('The quick fox', ['quick', 'fox']) -> [{pattern: 'quick', start: 4, end: 9}, ...]", description = "Find positions" },
    { code = "match_positions('abab', ['ab']) -> [{pattern: 'ab', start: 0, end: 2}, {pattern: 'ab', start: 2, end: 4}]", description = "Multiple occurrences" },
]
features = ["core"]

[[functions]]
name = "match_which"
category = "multimatch"
description = "Return array of patterns that match the string (Aho-Corasick)"
signature = "string, array[string] -> array[string]"
examples = [
    { code = '''match_which('hello world', ['hello', 'foo', 'world']) -> [\"hello\", \"world\"]''', description = "Find matching patterns" },
    { code = '''match_which('abc', ['a', 'b', 'x']) -> [\"a\", \"b\"]''', description = "Partial matches" },
    { code = "match_which('abc', ['x', 'y']) -> []", description = "No matches" },
]
features = ["core"]

[[functions]]
name = "replace_many"
category = "multimatch"
description = "Replace multiple patterns simultaneously (Aho-Corasick)"
signature = "string, object -> string"
examples = [
    { code = '''replace_many('hello world', {hello: 'hi', world: 'earth'}) -> \"hi earth\"''', description = "Multiple replacements" },
    { code = '''replace_many('aaa', {a: 'b'}) -> \"bbb\"''', description = "Repeated pattern" },
    { code = '''replace_many('abc', {x: 'y'}) -> \"abc\"''', description = "No matches" },
]
features = ["core"]

[[functions]]
name = "split_keep"
category = "multimatch"
description = "Split string keeping delimiters in result"
signature = "string, string -> array[string]"
examples = [
    { code = '''split_keep('a-b-c', '-') -> [\"a\", \"-\", \"b\", \"-\", \"c\"]''', description = "Keep dashes" },
    { code = '''split_keep('hello world', ' ') -> [\"hello\", \" \", \"world\"]''', description = "Keep spaces" },
    { code = '''split_keep('abc', '-') -> [\"abc\"]''', description = "No delimiter" },
]
features = ["core"]

[[functions]]
name = "tokenize"
category = "multimatch"
description = "Smart word tokenization with optional lowercase and min_length"
signature = "string, object? -> array[string]"
examples = [
    { code = '''tokenize('Hello, World!') -> [\"Hello\", \"World\"]''', description = "Basic tokenization" },
    { code = '''tokenize('Hello, World!', {lowercase: `true`}) -> [\"hello\", \"world\"]''', description = "Lowercase option" },
    { code = '''tokenize('a bb ccc', {min_length: `2`}) -> [\"bb\", \"ccc\"]''', description = "Minimum length" },
]
features = ["core"]

# =============================================================================
# NETWORK FUNCTIONS
# =============================================================================

[[functions]]
name = "cidr_broadcast"
category = "network"
description = "Get broadcast address from CIDR"
signature = "string -> string"
examples = [
    { code = '''cidr_broadcast('192.168.1.0/24') -> \"192.168.1.255\"''', description = "/24 network" },
    { code = '''cidr_broadcast('10.0.0.0/8') -> \"10.255.255.255\"''', description = "/8 network" },
    { code = '''cidr_broadcast('172.16.0.0/16') -> \"172.16.255.255\"''', description = "/16 network" },
]
features = ["core"]

[[functions]]
name = "cidr_contains"
category = "network"
description = "Check if IP is in CIDR range"
signature = "string, string -> boolean"
examples = [
    { code = "cidr_contains('192.168.0.0/16', '192.168.1.1') -> true", description = "IP in range" },
    { code = "cidr_contains('10.0.0.0/8', '192.168.1.1') -> false", description = "IP not in range" },
    { code = "cidr_contains('0.0.0.0/0', '8.8.8.8') -> true", description = "Catch-all range" },
]
features = ["core"]

[[functions]]
name = "cidr_network"
category = "network"
description = "Get network address from CIDR"
signature = "string -> string"
examples = [
    { code = '''cidr_network('192.168.1.0/24') -> \"192.168.1.0\"''', description = "/24 network" },
    { code = '''cidr_network('10.0.0.0/8') -> \"10.0.0.0\"''', description = "/8 network" },
    { code = '''cidr_network('192.168.1.100/24') -> \"192.168.1.0\"''', description = "Host in network" },
]
features = ["core"]

[[functions]]
name = "cidr_prefix"
category = "network"
description = "Get prefix length from CIDR"
signature = "string -> number"
examples = [
    { code = "cidr_prefix('192.168.1.0/24') -> 24", description = "/24 prefix" },
    { code = "cidr_prefix('10.0.0.0/8') -> 8", description = "/8 prefix" },
    { code = "cidr_prefix('0.0.0.0/0') -> 0", description = "Default route" },
]
features = ["core"]

[[functions]]
name = "int_to_ip"
category = "network"
description = "Convert integer to IP address"
signature = "number -> string"
examples = [
    { code = '''int_to_ip(`3232235777`) -> \"192.168.1.1\"''', description = "Private IP" },
    { code = '''int_to_ip(`0`) -> \"0.0.0.0\"''', description = "Zero" },
    { code = '''int_to_ip(`4294967295`) -> \"255.255.255.255\"''', description = "Max value" },
]
features = ["core"]

[[functions]]
name = "ip_to_int"
category = "network"
description = "Convert IP address to integer"
signature = "string -> number"
examples = [
    { code = "ip_to_int('192.168.1.1') -> 3232235777", description = "Private IP" },
    { code = "ip_to_int('0.0.0.0') -> 0", description = "Zero" },
    { code = "ip_to_int('255.255.255.255') -> 4294967295", description = "Max value" },
]
features = ["core"]

[[functions]]
name = "is_private_ip"
category = "network"
description = "Check if IP is in private range"
signature = "string -> boolean"
examples = [
    { code = "is_private_ip('192.168.1.1') -> true", description = "Class C private" },
    { code = "is_private_ip('10.0.0.1') -> true", description = "Class A private" },
    { code = "is_private_ip('8.8.8.8') -> false", description = "Public IP" },
]
features = ["core"]

# =============================================================================
# OBJECT FUNCTIONS
# =============================================================================

[[functions]]
name = "deep_diff"
category = "object"
description = "Structural diff between two objects"
signature = "object, object -> object"
examples = [
    { code = "deep_diff({a: 1}, {a: 2}) -> {added: {}, removed: {}, changed: {a: {from: 1, to: 2}}}", description = "Changed value" },
    { code = "deep_diff({a: 1}, {b: 2}) -> {added: {b: 2}, removed: {a: 1}, changed: {}}", description = "Added and removed" },
    { code = "deep_diff({a: 1}, {a: 1}) -> {added: {}, removed: {}, changed: {}}", description = "No differences" },
    { code = "deep_diff({}, {a: 1}) -> {added: {a: 1}, removed: {}, changed: {}}", description = "New key added" },
]
features = ["core"]

[[functions]]
name = "deep_equals"
category = "object"
description = "Deep equality check for any two values"
signature = "any, any -> boolean"
examples = [
    { code = "deep_equals({a: {b: 1}}, {a: {b: 1}}) -> true", description = "Equal nested objects" },
    { code = "deep_equals({a: 1}, {a: 2}) -> false", description = "Different values" },
    { code = "deep_equals([1, 2], [1, 2]) -> true", description = "Equal arrays" },
    { code = "deep_equals([1, 2], [2, 1]) -> false", description = "Order matters" },
]
features = ["core"]

[[functions]]
name = "deep_merge"
category = "object"
description = "Recursively merge objects"
signature = "object, object -> object"
examples = [
    { code = "deep_merge({a: {b: 1}}, {a: {c: 2}}) -> {a: {b: 1, c: 2}}", description = "Merge nested objects" },
    { code = "deep_merge({a: 1}, {b: 2}) -> {a: 1, b: 2}", description = "Merge flat objects" },
    { code = "deep_merge({a: 1}, {a: 2}) -> {a: 2}", description = "Later values override" },
    { code = "deep_merge({}, {a: 1}) -> {a: 1}", description = "Merge with empty object" },
]
features = ["core"]

[[functions]]
name = "defaults"
category = "object"
description = "Assign default values for missing keys (shallow)"
signature = "object, object -> object"
examples = [
    { code = "defaults({a: 1}, {a: 2, b: 3}) -> {a: 1, b: 3}", description = "Keep existing, add missing" },
    { code = "defaults({}, {a: 1, b: 2}) -> {a: 1, b: 2}", description = "All defaults applied" },
    { code = "defaults({a: 1, b: 2}, {}) -> {a: 1, b: 2}", description = "No defaults needed" },
    { code = "defaults({x: 1}, {y: 2}) -> {x: 1, y: 2}", description = "Different keys" },
]
features = ["core"]

[[functions]]
name = "defaults_deep"
category = "object"
description = "Recursively assign default values for missing keys"
signature = "object, object -> object"
examples = [
    { code = "defaults_deep({a: {b: 1}}, {a: {c: 2}}) -> {a: {b: 1, c: 2}}", description = "Merge nested defaults" },
    { code = "defaults_deep({a: {b: 1}}, {a: {b: 2}}) -> {a: {b: 1}}", description = "Keep existing nested" },
    { code = "defaults_deep({}, {a: {b: 1}}) -> {a: {b: 1}}", description = "Apply all nested defaults" },
    { code = "defaults_deep({x: 1}, {y: {z: 2}}) -> {x: 1, y: {z: 2}}", description = "Different structure" },
]
features = ["core"]

[[functions]]
name = "delete_path"
category = "object"
description = "Delete value at JSON pointer path (immutable)"
signature = "any, string -> any"
examples = [
    { code = "delete_path({a: 1, b: 2}, '/b') -> {a: 1}", description = "Delete top-level key" },
    { code = "delete_path({a: {b: 1, c: 2}}, '/a/b') -> {a: {c: 2}}", description = "Delete nested key" },
    { code = "delete_path([1, 2, 3], '/1') -> [1, 3]", description = "Delete array element" },
    { code = "delete_path({a: 1}, '/x') -> {a: 1}", description = "Path not found" },
]
features = ["core"]

[[functions]]
name = "flatten_keys"
category = "object"
description = "Flatten nested object with dot notation keys"
signature = "object -> object"
examples = [
    { code = '''flatten_keys({a: {b: 1}}) -> {\"a.b\": 1}''', description = "Simple nested" },
    { code = '''flatten_keys({a: {b: {c: 1}}}) -> {\"a.b.c\": 1}''', description = "Deep nested" },
    { code = '''flatten_keys({a: 1, b: 2}) -> {\"a\": 1, \"b\": 2}''', description = "Flat object" },
    { code = '''flatten_keys({x: {y: 1}, z: 2}) -> {\"x.y\": 1, \"z\": 2}''', description = "Mixed nesting" },
]
features = ["core"]

[[functions]]
name = "from_items"
category = "object"
description = "Convert array of [key, value] pairs to object"
signature = "array -> object"
examples = [
    { code = "from_items([['a', 1]]) -> {a: 1}", description = "Single pair" },
    { code = "from_items([['a', 1], ['b', 2]]) -> {a: 1, b: 2}", description = "Multiple pairs" },
    { code = "from_items([]) -> {}", description = "Empty array" },
    { code = "from_items([['x', 'hello']]) -> {x: 'hello'}", description = "String value" },
]
jep = "JEP-013"
features = ["core", "jep"]

[[functions]]
name = "get"
category = "object"
description = "Get value at dot-separated path with optional default"
signature = "any, string, any? -> any"
examples = [
    { code = "get({a: {b: 1}}, 'a.b') -> 1", description = "Nested path" },
    { code = "get({a: 1}, 'a') -> 1", description = "Top-level key" },
    { code = "get({a: 1}, 'x', 'default') -> 'default'", description = "Missing with default" },
    { code = "get({a: {b: {c: 3}}}, 'a.b.c') -> 3", description = "Deep path" },
]
features = ["core"]

[[functions]]
name = "has"
category = "object"
description = "Check if dot-separated path exists"
signature = "any, string -> boolean"
examples = [
    { code = "has({a: {b: 1}}, 'a.b') -> true", description = "Nested path exists" },
    { code = "has({a: 1}, 'a') -> true", description = "Top-level exists" },
    { code = "has({a: 1}, 'b') -> false", description = "Key missing" },
    { code = "has({a: {b: 1}}, 'a.c') -> false", description = "Nested missing" },
]
features = ["core"]

[[functions]]
name = "invert"
category = "object"
description = "Swap keys and values"
signature = "object -> object"
examples = [
    { code = "invert({a: 'x'}) -> {x: 'a'}", description = "Swap key and value" },
    { code = "invert({a: 'b', c: 'd'}) -> {b: 'a', d: 'c'}", description = "Multiple pairs" },
    { code = "invert({}) -> {}", description = "Empty object" },
    { code = "invert({name: 'id', value: 'data'}) -> {id: 'name', data: 'value'}", description = "Real-world example" },
]
features = ["core"]

[[functions]]
name = "items"
category = "object"
description = "Convert object to array of [key, value] pairs"
signature = "object -> array"
examples = [
    { code = '''items({a: 1}) -> [[\"a\", 1]]''', description = "Single key" },
    { code = '''items({a: 1, b: 2}) -> [[\"a\", 1], [\"b\", 2]]''', description = "Multiple keys" },
    { code = '''items({}) -> []''', description = "Empty object" },
    { code = '''items({x: 'hello'}) -> [[\"x\", \"hello\"]]''', description = "String value" },
]
jep = "JEP-013"
features = ["core", "jep"]

[[functions]]
name = "leaves"
category = "object"
description = "Get all leaf values (non-object, non-array)"
signature = "any -> array"
examples = [
    { code = "leaves({a: 1, b: [2, 3]}) -> [1, 2, 3]", description = "Mixed structure" },
    { code = "leaves({a: {b: 1}}) -> [1]", description = "Nested object" },
    { code = "leaves([1, 2, 3]) -> [1, 2, 3]", description = "Flat array" },
    { code = "leaves({a: 1, b: 2}) -> [1, 2]", description = "Flat object" },
]
features = ["core"]

[[functions]]
name = "leaves_with_paths"
category = "object"
description = "Get all leaf values with their JSON pointer paths"
signature = "any -> array"
examples = [
    { code = '''leaves_with_paths({a: 1}) -> [{path: \"/a\", value: 1}]''', description = "Single leaf" },
    { code = '''leaves_with_paths({a: {b: 1}}) -> [{path: \"/a/b\", value: 1}]''', description = "Nested path" },
    { code = '''leaves_with_paths([1, 2]) -> [{path: \"/0\", value: 1}, {path: \"/1\", value: 2}]''', description = "Array indices" },
    { code = '''leaves_with_paths({}) -> []''', description = "Empty object" },
]
features = ["core"]

[[functions]]
name = "omit"
category = "object"
description = "Remove specific keys from object"
signature = "object, array -> object"
examples = [
    { code = "omit({a: 1, b: 2}, ['a']) -> {b: 2}", description = "Remove one key" },
    { code = "omit({a: 1, b: 2, c: 3}, ['a', 'c']) -> {b: 2}", description = "Remove multiple keys" },
    { code = "omit({a: 1}, ['x']) -> {a: 1}", description = "Key not present" },
    { code = "omit({a: 1, b: 2}, []) -> {a: 1, b: 2}", description = "Empty removal list" },
]
features = ["core"]

[[functions]]
name = "paths"
category = "object"
description = "List all JSON pointer paths in value"
signature = "any -> array"
examples = [
    { code = '''paths({a: {b: 1}}) -> [\"/a\", \"/a/b\"]''', description = "Nested object" },
    { code = '''paths({a: 1, b: 2}) -> [\"/a\", \"/b\"]''', description = "Flat object" },
    { code = '''paths([1, 2]) -> [\"/0\", \"/1\"]''', description = "Array paths" },
    { code = '''paths({}) -> []''', description = "Empty object" },
]
features = ["core"]

[[functions]]
name = "pick"
category = "object"
description = "Select specific keys from object"
signature = "object, array -> object"
examples = [
    { code = "pick({a: 1, b: 2}, ['a']) -> {a: 1}", description = "Pick one key" },
    { code = "pick({a: 1, b: 2, c: 3}, ['a', 'c']) -> {a: 1, c: 3}", description = "Pick multiple keys" },
    { code = "pick({a: 1}, ['x']) -> {}", description = "Key not present" },
    { code = "pick({a: 1, b: 2}, []) -> {}", description = "Empty pick list" },
]
features = ["core"]

[[functions]]
name = "rename_keys"
category = "object"
description = "Rename object keys"
signature = "object, object -> object"
examples = [
    { code = "rename_keys({a: 1}, {a: 'b'}) -> {b: 1}", description = "Rename one key" },
    { code = "rename_keys({a: 1, b: 2}, {a: 'x', b: 'y'}) -> {x: 1, y: 2}", description = "Rename multiple" },
    { code = "rename_keys({a: 1}, {x: 'y'}) -> {a: 1}", description = "No matching key" },
    { code = "rename_keys({old: 'value'}, {old: 'new'}) -> {new: 'value'}", description = "Real-world rename" },
]
features = ["core"]

[[functions]]
name = "set_path"
category = "object"
description = "Set value at JSON pointer path (immutable)"
signature = "any, string, any -> any"
examples = [
    { code = "set_path({a: 1}, '/b', `2`) -> {a: 1, b: 2}", description = "Add new key" },
    { code = "set_path({a: 1}, '/a', `2`) -> {a: 2}", description = "Update existing" },
    { code = "set_path({a: {}}, '/a/b', `1`) -> {a: {b: 1}}", description = "Set nested path" },
    { code = "set_path([1, 2], '/1', `5`) -> [1, 5]", description = "Update array element" },
]
features = ["core"]

# =============================================================================
# PATH FUNCTIONS
# =============================================================================

[[functions]]
name = "path_basename"
category = "path"
description = "Get filename from path"
signature = "string -> string"
examples = [
    { code = '''path_basename('/foo/bar.txt') -> \"bar.txt\"''', description = "Unix path" },
    { code = '''path_basename('/foo/bar/') -> \"bar\"''', description = "Directory path" },
    { code = '''path_basename('file.txt') -> \"file.txt\"''', description = "Just filename" },
]
features = ["core"]

[[functions]]
name = "path_dirname"
category = "path"
description = "Get directory from path"
signature = "string -> string"
examples = [
    { code = '''path_dirname('/foo/bar.txt') -> \"/foo\"''', description = "Unix path" },
    { code = '''path_dirname('/foo/bar/baz') -> \"/foo/bar\"''', description = "Nested path" },
    { code = '''path_dirname('file.txt') -> \"\"''', description = "No directory" },
]
features = ["core"]

[[functions]]
name = "path_ext"
category = "path"
description = "Get file extension"
signature = "string -> string"
examples = [
    { code = '''path_ext('/foo/bar.txt') -> \"txt\"''', description = "Text file" },
    { code = '''path_ext('image.png') -> \"png\"''', description = "Image file" },
    { code = '''path_ext('noext') -> \"\"''', description = "No extension" },
]
features = ["core"]

[[functions]]
name = "path_join"
category = "path"
description = "Join path segments"
signature = "string... -> string"
examples = [
    { code = '''path_join('/foo', 'bar', 'baz') -> \"/foo/bar/baz\"''', description = "Multiple segments" },
    { code = '''path_join('/home', 'user', 'file.txt') -> \"/home/user/file.txt\"''', description = "Full path" },
    { code = '''path_join('a', 'b') -> \"a/b\"''', description = "Relative path" },
]
features = ["core"]

# =============================================================================
# PHONETIC FUNCTIONS
# =============================================================================

[[functions]]
name = "caverphone"
category = "phonetic"
description = "Caverphone code"
signature = "string -> string"
examples = [
    { code = '''caverphone('Smith') -> \"SMT1111111\"''', description = "Common name" },
    { code = '''caverphone('Thompson') -> \"TMPSN11111\"''', description = "Another name" },
]
features = ["core"]

[[functions]]
name = "caverphone2"
category = "phonetic"
description = "Caverphone 2 code"
signature = "string -> string"
examples = [
    { code = '''caverphone2('Smith') -> \"SMT1111111\"''', description = "Common name" },
    { code = '''caverphone2('Thompson') -> \"TMPSN11111\"''', description = "Another name" },
]
features = ["core"]

[[functions]]
name = "double_metaphone"
category = "phonetic"
description = "Double Metaphone codes"
signature = "string -> object"
examples = [
    { code = "double_metaphone('Smith') -> {primary: 'SM0', secondary: 'XMT'}", description = "Common name" },
    { code = "double_metaphone('Schmidt') -> {primary: 'XMT', secondary: 'SMT'}", description = "German variant" },
]
features = ["core"]

[[functions]]
name = "match_rating_codex"
category = "phonetic"
description = "Match Rating codex"
signature = "string -> string"
examples = [
    { code = '''match_rating_codex('Smith') -> \"SMTH\"''', description = "Common name" },
    { code = '''match_rating_codex('Johnson') -> \"JHNSN\"''', description = "Another name" },
]
features = ["core"]

[[functions]]
name = "metaphone"
category = "phonetic"
description = "Metaphone phonetic code"
signature = "string -> string"
examples = [
    { code = '''metaphone('Smith') -> \"SM0\"''', description = "Common name" },
    { code = '''metaphone('phone') -> \"FN\"''', description = "Ph sound" },
]
features = ["core"]

[[functions]]
name = "nysiis"
category = "phonetic"
description = "NYSIIS phonetic code"
signature = "string -> string"
examples = [
    { code = '''nysiis('Smith') -> \"SNAT\"''', description = "Common name" },
    { code = '''nysiis('Johnson') -> \"JANSAN\"''', description = "Another name" },
]
features = ["core"]

[[functions]]
name = "phonetic_match"
category = "phonetic"
description = "Check phonetic match with algorithm"
signature = "string, string, string -> boolean"
examples = [
    { code = "phonetic_match('Smith', 'Smyth', 'soundex') -> true", description = "Soundex match" },
    { code = "phonetic_match('Robert', 'Rupert', 'metaphone') -> true", description = "Metaphone match" },
    { code = "phonetic_match('John', 'Jane', 'soundex') -> false", description = "No match" },
]
features = ["core"]

[[functions]]
name = "soundex"
category = "phonetic"
description = "Soundex phonetic code"
signature = "string -> string"
examples = [
    { code = '''soundex('Robert') -> \"R163\"''', description = "Common name" },
    { code = '''soundex('Rupert') -> \"R163\"''', description = "Same code as Robert" },
    { code = '''soundex('Smith') -> \"S530\"''', description = "Another name" },
]
features = ["core"]

[[functions]]
name = "sounds_like"
category = "phonetic"
description = "Check if strings sound similar"
signature = "string, string -> boolean"
examples = [
    { code = "sounds_like('Robert', 'Rupert') -> true", description = "Similar sounding" },
    { code = "sounds_like('Smith', 'Smyth') -> true", description = "Spelling variants" },
    { code = "sounds_like('John', 'Mary') -> false", description = "Different names" },
]
features = ["core"]

# =============================================================================
# RAND FUNCTIONS
# =============================================================================

[[functions]]
name = "random"
category = "rand"
description = "Generate random number between 0 and 1"
signature = "-> number"
examples = [
    { code = "random() -> 0.123456...", description = "Random float" },
    { code = "floor(multiply(random(), `100`)) -> 42", description = "Random 0-99" },
]
features = ["core"]

[[functions]]
name = "sample"
category = "rand"
description = "Random sample from array"
signature = "array, number -> array"
examples = [
    { code = "sample([1, 2, 3, 4], `2`) -> [3, 1]", description = "Sample 2 items" },
    { code = "sample(['a', 'b', 'c'], `1`) -> ['b']", description = "Sample 1 item" },
    { code = "length(sample([1, 2, 3], `2`)) -> 2", description = "Always returns n items" },
]
features = ["core"]

[[functions]]
name = "shuffle"
category = "rand"
description = "Randomly shuffle array"
signature = "array -> array"
examples = [
    { code = "shuffle([1, 2, 3]) -> [2, 3, 1]", description = "Shuffle numbers" },
    { code = "length(shuffle([1, 2, 3])) -> 3", description = "Preserves length" },
]
features = ["core"]

# =============================================================================
# REGEX FUNCTIONS
# =============================================================================

[[functions]]
name = "regex_extract"
category = "regex"
description = "Extract regex matches"
signature = "string, string -> array"
examples = [
    { code = '''regex_extract('a1b2', '\\\\d+') -> [\"1\", \"2\"]''', description = "Extract numbers" },
    { code = '''regex_extract('hello world', '\\\\w+') -> [\"hello\", \"world\"]''', description = "Extract words" },
    { code = "regex_extract('abc', '\\\\d+') -> []", description = "No matches" },
]
features = ["core"]

[[functions]]
name = "regex_match"
category = "regex"
description = "Test if string matches regex"
signature = "string, string -> boolean"
examples = [
    { code = "regex_match('hello', '^h.*o$') -> true", description = "Full match" },
    { code = "regex_match('test123', '\\\\d+') -> true", description = "Contains digits" },
    { code = "regex_match('abc', '^\\\\d+$') -> false", description = "No match" },
]
features = ["core"]

[[functions]]
name = "regex_replace"
category = "regex"
description = "Replace regex matches"
signature = "string, string, string -> string"
examples = [
    { code = '''regex_replace('a1b2', '\\\\d+', 'X') -> \"aXbX\"''', description = "Replace digits" },
    { code = '''regex_replace('hello world', '\\\\s+', '-') -> \"hello-world\"''', description = "Replace spaces" },
    { code = '''regex_replace('abc', 'x', 'y') -> \"abc\"''', description = "No match unchanged" },
]
features = ["core"]

# =============================================================================
# SEMVER FUNCTIONS
# =============================================================================

[[functions]]
name = "semver_compare"
category = "semver"
description = "Compare versions (-1, 0, 1)"
signature = "string, string -> number"
examples = [
    { code = "semver_compare('1.0.0', '2.0.0') -> -1", description = "Less than" },
    { code = "semver_compare('2.0.0', '1.0.0') -> 1", description = "Greater than" },
    { code = "semver_compare('1.0.0', '1.0.0') -> 0", description = "Equal" },
]
features = ["core"]

[[functions]]
name = "semver_is_valid"
category = "semver"
description = "Check if string is valid semver"
signature = "string -> boolean"
examples = [
    { code = "semver_is_valid('1.2.3') -> true", description = "Valid semver" },
    { code = "semver_is_valid('1.2.3-alpha') -> true", description = "With prerelease" },
    { code = "semver_is_valid('invalid') -> false", description = "Invalid format" },
]
features = ["core"]

[[functions]]
name = "semver_major"
category = "semver"
description = "Get major version"
signature = "string -> number"
examples = [
    { code = "semver_major('1.2.3') -> 1", description = "Major version" },
    { code = "semver_major('10.0.0') -> 10", description = "Double digit" },
    { code = "semver_major('0.1.0') -> 0", description = "Zero major" },
]
features = ["core"]

[[functions]]
name = "semver_minor"
category = "semver"
description = "Get minor version"
signature = "string -> number"
examples = [
    { code = "semver_minor('1.2.3') -> 2", description = "Minor version" },
    { code = "semver_minor('1.10.0') -> 10", description = "Double digit" },
    { code = "semver_minor('1.0.0') -> 0", description = "Zero minor" },
]
features = ["core"]

[[functions]]
name = "semver_parse"
category = "semver"
description = "Parse semantic version"
signature = "string -> object"
examples = [
    { code = "semver_parse('1.2.3') -> {major: 1, minor: 2, patch: 3}", description = "Basic version" },
    { code = "semver_parse('1.2.3-alpha').pre -> 'alpha'", description = "With prerelease" },
]
features = ["core"]

[[functions]]
name = "semver_patch"
category = "semver"
description = "Get patch version"
signature = "string -> number"
examples = [
    { code = "semver_patch('1.2.3') -> 3", description = "Patch version" },
    { code = "semver_patch('1.2.10') -> 10", description = "Double digit" },
    { code = "semver_patch('1.2.0') -> 0", description = "Zero patch" },
]
features = ["core"]

[[functions]]
name = "semver_satisfies"
category = "semver"
description = "Check if version matches constraint"
signature = "string, string -> boolean"
examples = [
    { code = "semver_satisfies('1.2.3', '^1.0.0') -> true", description = "Caret range" },
    { code = "semver_satisfies('2.0.0', '^1.0.0') -> false", description = "Outside range" },
    { code = "semver_satisfies('1.5.0', '>=1.0.0') -> true", description = "Comparison" },
]
features = ["core"]

# =============================================================================
# STANDARD FUNCTIONS
# =============================================================================

[[functions]]
name = "abs"
category = "standard"
description = "Returns the absolute value of a number"
signature = "number -> number"
examples = [
    { code = "abs(`-5`) -> 5", description = "Negative number" },
    { code = "abs(`5`) -> 5", description = "Positive number" },
    { code = "abs(`0`) -> 0", description = "Zero" },
]
is_standard = true
features = ["spec"]

[[functions]]
name = "avg"
category = "standard"
description = "Returns the average of an array of numbers"
signature = "array[number] -> number"
examples = [
    { code = "avg([1, 2, 3]) -> 2", description = "Simple average" },
    { code = "avg([10, 20, 30, 40]) -> 25", description = "Four numbers" },
    { code = "avg([5]) -> 5", description = "Single element" },
]
is_standard = true
features = ["spec"]

[[functions]]
name = "ceil"
category = "standard"
description = "Returns the smallest integer greater than or equal to the number"
signature = "number -> number"
examples = [
    { code = "ceil(`1.5`) -> 2", description = "Round up decimal" },
    { code = "ceil(`-1.5`) -> -1", description = "Negative rounds toward zero" },
    { code = "ceil(`5`) -> 5", description = "Integer unchanged" },
]
is_standard = true
features = ["spec"]

[[functions]]
name = "contains"
category = "standard"
description = "Returns true if the subject contains the search value"
signature = "array|string, any -> boolean"
examples = [
    { code = "contains([1, 2, 3], `2`) -> true", description = "Array contains number" },
    { code = "contains('hello', 'ell') -> true", description = "String contains substring" },
    { code = "contains([1, 2, 3], `5`) -> false", description = "Not found" },
]
is_standard = true
features = ["spec"]

[[functions]]
name = "ends_with"
category = "standard"
description = "Returns true if the subject ends with the suffix"
signature = "string, string -> boolean"
examples = [
    { code = "ends_with('hello', 'lo') -> true", description = "Ends with suffix" },
    { code = "ends_with('hello', 'he') -> false", description = "Does not end with" },
    { code = "ends_with('test.txt', '.txt') -> true", description = "File extension" },
]
is_standard = true
features = ["spec"]

[[functions]]
name = "floor"
category = "standard"
description = "Returns the largest integer less than or equal to the number"
signature = "number -> number"
examples = [
    { code = "floor(`1.9`) -> 1", description = "Round down decimal" },
    { code = "floor(`-1.5`) -> -2", description = "Negative rounds away from zero" },
    { code = "floor(`5`) -> 5", description = "Integer unchanged" },
]
is_standard = true
features = ["spec"]

[[functions]]
name = "join"
category = "standard"
description = "Returns array elements joined into a string with a separator"
signature = "string, array[string] -> string"
examples = [
    { code = '''join(', ', ['a', 'b', 'c']) -> \"a, b, c\"''', description = "Join with comma" },
    { code = '''join('-', ['2024', '01', '15']) -> \"2024-01-15\"''', description = "Join date parts" },
    { code = '''join('', ['a', 'b', 'c']) -> \"abc\"''', description = "Join without separator" },
]
is_standard = true
features = ["spec"]

[[functions]]
name = "keys"
category = "standard"
description = "Returns an array of keys from an object"
signature = "object -> array[string]"
examples = [
    { code = '''keys({a: 1, b: 2}) -> [\"a\", \"b\"]''', description = "Get object keys" },
    { code = '''keys({name: \"John\", age: 30}) -> [\"age\", \"name\"]''', description = "Keys sorted alphabetically" },
    { code = "keys({}) -> []", description = "Empty object" },
]
is_standard = true
features = ["spec"]

[[functions]]
name = "length"
category = "standard"
description = "Returns the length of an array, object, or string"
signature = "array|object|string -> number"
examples = [
    { code = "length([1, 2, 3]) -> 3", description = "Array length" },
    { code = "length('hello') -> 5", description = "String length" },
    { code = "length({a: 1, b: 2}) -> 2", description = "Object key count" },
]
is_standard = true
features = ["spec"]

[[functions]]
name = "map"
category = "standard"
description = "Applies an expression to each element of an array"
signature = "expression, array -> array"
examples = [
    { code = "map(&a, [{a: 1}, {a: 2}]) -> [1, 2]", description = "Extract field from objects" },
    { code = "map(&length(@), ['a', 'bb', 'ccc']) -> [1, 2, 3]", description = "Apply function" },
    { code = "map(&@, [1, 2, 3]) -> [1, 2, 3]", description = "Identity mapping" },
]
is_standard = true
features = ["spec"]

[[functions]]
name = "max"
category = "standard"
description = "Returns the maximum value in an array"
signature = "array[number]|array[string] -> number|string"
examples = [
    { code = "max([1, 3, 2]) -> 3", description = "Max of numbers" },
    { code = "max(['a', 'c', 'b']) -> 'c'", description = "Max of strings" },
    { code = "max([-5, -1, -10]) -> -1", description = "Negative numbers" },
]
is_standard = true
features = ["spec"]

[[functions]]
name = "max_by"
category = "standard"
description = "Returns the element with maximum value by expression"
signature = "array, expression -> any"
examples = [
    { code = "max_by([{a: 1}, {a: 2}], &a) -> {a: 2}", description = "Max by field" },
    { code = "max_by([{name: 'a', age: 30}, {name: 'b', age: 25}], &age) -> {name: 'a', age: 30}", description = "Max by age" },
    { code = "max_by(['aa', 'b', 'ccc'], &length(@)) -> 'ccc'", description = "Max by length" },
]
is_standard = true
features = ["spec"]

[[functions]]
name = "merge"
category = "standard"
description = "Merges objects into a single object"
signature = "object... -> object"
examples = [
    { code = "merge({a: 1}, {b: 2}) -> {a: 1, b: 2}", description = "Merge two objects" },
    { code = "merge({a: 1}, {a: 2}) -> {a: 2}", description = "Later values override" },
    { code = "merge({a: 1}, {b: 2}, {c: 3}) -> {a: 1, b: 2, c: 3}", description = "Multiple objects" },
]
is_standard = true
features = ["spec"]

[[functions]]
name = "min"
category = "standard"
description = "Returns the minimum value in an array"
signature = "array[number]|array[string] -> number|string"
examples = [
    { code = "min([1, 3, 2]) -> 1", description = "Min of numbers" },
    { code = "min(['a', 'c', 'b']) -> 'a'", description = "Min of strings" },
    { code = "min([-5, -1, -10]) -> -10", description = "Negative numbers" },
]
is_standard = true
features = ["spec"]

[[functions]]
name = "min_by"
category = "standard"
description = "Returns the element with minimum value by expression"
signature = "array, expression -> any"
examples = [
    { code = "min_by([{a: 1}, {a: 2}], &a) -> {a: 1}", description = "Min by field" },
    { code = "min_by([{name: 'a', age: 30}, {name: 'b', age: 25}], &age) -> {name: 'b', age: 25}", description = "Min by age" },
    { code = "min_by(['aa', 'b', 'ccc'], &length(@)) -> 'b'", description = "Min by length" },
]
is_standard = true
features = ["spec"]

[[functions]]
name = "not_null"
category = "standard"
description = "Returns the first non-null argument"
signature = "any... -> any"
examples = [
    { code = '''not_null(`null`, 'a', 'b') -> \"a\"''', description = "Skip nulls" },
    { code = '''not_null('first', 'second') -> \"first\"''', description = "First non-null" },
    { code = "not_null(`null`, `null`, `1`) -> 1", description = "Multiple nulls" },
]
is_standard = true
features = ["spec"]

[[functions]]
name = "reverse"
category = "standard"
description = "Reverses an array or string"
signature = "array|string -> array|string"
examples = [
    { code = "reverse([1, 2, 3]) -> [3, 2, 1]", description = "Reverse array" },
    { code = "reverse('hello') -> 'olleh'", description = "Reverse string" },
    { code = "reverse([]) -> []", description = "Empty array" },
]
is_standard = true
features = ["spec"]

[[functions]]
name = "sort"
category = "standard"
description = "Sorts an array of numbers or strings"
signature = "array[number]|array[string] -> array"
examples = [
    { code = "sort([3, 1, 2]) -> [1, 2, 3]", description = "Sort numbers" },
    { code = "sort(['c', 'a', 'b']) -> ['a', 'b', 'c']", description = "Sort strings" },
    { code = "sort([]) -> []", description = "Empty array" },
]
is_standard = true
features = ["spec"]

[[functions]]
name = "sort_by"
category = "standard"
description = "Sorts an array by expression result"
signature = "array, expression -> array"
examples = [
    { code = "sort_by([{a: 2}, {a: 1}], &a) -> [{a: 1}, {a: 2}]", description = "Sort by field" },
    { code = "sort_by(['bb', 'a', 'ccc'], &length(@)) -> ['a', 'bb', 'ccc']", description = "Sort by length" },
    { code = "sort_by([{name: 'z'}, {name: 'a'}], &name) -> [{name: 'a'}, {name: 'z'}]", description = "Sort by name" },
]
is_standard = true
features = ["spec"]

[[functions]]
name = "starts_with"
category = "standard"
description = "Returns true if the subject starts with the prefix"
signature = "string, string -> boolean"
examples = [
    { code = "starts_with('hello', 'he') -> true", description = "Starts with prefix" },
    { code = "starts_with('hello', 'lo') -> false", description = "Does not start with" },
    { code = "starts_with('https://example.com', 'https') -> true", description = "URL protocol" },
]
is_standard = true
features = ["spec"]

[[functions]]
name = "sum"
category = "standard"
description = "Returns the sum of an array of numbers"
signature = "array[number] -> number"
examples = [
    { code = "sum([1, 2, 3]) -> 6", description = "Sum of numbers" },
    { code = "sum([10, -5, 3]) -> 8", description = "With negative" },
    { code = "sum([]) -> 0", description = "Empty array" },
]
is_standard = true
features = ["spec"]

[[functions]]
name = "to_array"
category = "standard"
description = "Converts a value to an array"
signature = "any -> array"
examples = [
    { code = '''to_array('hello') -> [\"hello\"]''', description = "String to array" },
    { code = "to_array([1, 2]) -> [1, 2]", description = "Array unchanged" },
    { code = "to_array(`5`) -> [5]", description = "Number to array" },
]
is_standard = true
features = ["spec"]

[[functions]]
name = "to_number"
category = "standard"
description = "Converts a value to a number"
signature = "any -> number"
examples = [
    { code = "to_number('42') -> 42", description = "String to number" },
    { code = "to_number('3.14') -> 3.14", description = "String to float" },
    { code = "to_number(`5`) -> 5", description = "Number unchanged" },
]
is_standard = true
features = ["spec"]

[[functions]]
name = "to_string"
category = "standard"
description = "Converts a value to a string"
signature = "any -> string"
examples = [
    { code = '''to_string(`42`) -> \"42\"''', description = "Number to string" },
    { code = '''to_string(`true`) -> \"true\"''', description = "Boolean to string" },
    { code = '''to_string('hello') -> \"hello\"''', description = "String unchanged" },
]
is_standard = true
features = ["spec"]

[[functions]]
name = "type"
category = "standard"
description = "Returns the type of a value as a string"
signature = "any -> string"
examples = [
    { code = '''type('hello') -> \"string\"''', description = "String type" },
    { code = '''type(`42`) -> \"number\"''', description = "Number type" },
    { code = '''type([1, 2]) -> \"array\"''', description = "Array type" },
    { code = '''type({a: 1}) -> \"object\"''', description = "Object type" },
]
is_standard = true
features = ["spec"]

[[functions]]
name = "values"
category = "standard"
description = "Returns an array of values from an object"
signature = "object -> array"
examples = [
    { code = "values({a: 1, b: 2}) -> [1, 2]", description = "Get object values" },
    { code = "values({x: 'hello', y: 'world'}) -> ['hello', 'world']", description = "String values" },
    { code = "values({}) -> []", description = "Empty object" },
]
is_standard = true
features = ["spec"]

# =============================================================================
# STRING FUNCTIONS
# =============================================================================

[[functions]]
name = "abbreviate"
category = "string"
description = "Truncate string with ellipsis suffix"
signature = "string, number, string? -> string"
examples = [
    { code = '''abbreviate('hello world', `8`) -> \"hello...\"''', description = "Default ellipsis" },
    { code = '''abbreviate('hello', `10`) -> \"hello\"''', description = "No truncation needed" },
    { code = '''abbreviate('hello world', `8`, '>>') -> \"hello >>\"''', description = "Custom suffix" },
]
features = ["core"]

[[functions]]
name = "camel_case"
category = "string"
description = "Convert to camelCase"
signature = "string -> string"
examples = [
    { code = '''camel_case('hello_world') -> \"helloWorld\"''', description = "From snake_case" },
    { code = '''camel_case('hello-world') -> \"helloWorld\"''', description = "From kebab-case" },
    { code = '''camel_case('Hello World') -> \"helloWorld\"''', description = "From title case" },
]
features = ["core"]

[[functions]]
name = "capitalize"
category = "string"
description = "Capitalize the first character"
signature = "string -> string"
examples = [
    { code = '''capitalize('hello') -> \"Hello\"''', description = "Basic capitalize" },
    { code = '''capitalize('HELLO') -> \"HELLO\"''', description = "Already uppercase" },
    { code = '''capitalize('') -> \"\"''', description = "Empty string" },
]
features = ["core"]

[[functions]]
name = "center"
category = "string"
description = "Center-pad string to given width"
signature = "string, number, string? -> string"
examples = [
    { code = '''center('hi', `6`) -> \"  hi  \"''', description = "Center with spaces" },
    { code = '''center('hi', `6`, '-') -> \"--hi--\"''', description = "Center with dashes" },
    { code = '''center('hello', `3`) -> \"hello\"''', description = "Already wider" },
]
features = ["core"]

[[functions]]
name = "concat"
category = "string"
description = "Concatenate strings"
signature = "string... -> string"
examples = [
    { code = '''concat('hello', ' ', 'world') -> \"hello world\"''', description = "Multiple strings" },
    { code = '''concat('a', 'b') -> \"ab\"''', description = "Two strings" },
    { code = '''concat('only') -> \"only\"''', description = "Single string" },
]
features = ["core"]

[[functions]]
name = "explode"
category = "string"
description = "Convert a string to an array of Unicode codepoints"
signature = "string -> array"
examples = [
    { code = "explode('abc') -> [97, 98, 99]", description = "ASCII characters" },
    { code = "explode('A☺') -> [65, 9786]", description = "Unicode characters" },
    { code = "explode('') -> []", description = "Empty string" },
]
features = ["core"]

[[functions]]
name = "find_first"
category = "string"
description = "Find first occurrence of substring"
signature = "string, string -> number | null"
examples = [
    { code = "find_first('hello', 'l') -> 2", description = "Find character" },
    { code = "find_first('hello world', 'world') -> 6", description = "Find substring" },
    { code = "find_first('hello', 'x') -> null", description = "Not found" },
]
jep = "JEP-014"
features = ["core", "jep"]

[[functions]]
name = "find_last"
category = "string"
description = "Find last occurrence of substring"
signature = "string, string -> number | null"
examples = [
    { code = "find_last('hello', 'l') -> 3", description = "Find last character" },
    { code = "find_last('foo bar foo', 'foo') -> 8", description = "Find last substring" },
    { code = "find_last('hello', 'x') -> null", description = "Not found" },
]
jep = "JEP-014"
features = ["core", "jep"]

[[functions]]
name = "indices"
category = "string"
description = "Find all indices of substring occurrences"
signature = "string, string -> array"
examples = [
    { code = "indices('hello', 'l') -> [2, 3]", description = "Multiple occurrences" },
    { code = "indices('ababa', 'aba') -> [0, 2]", description = "Overlapping matches" },
    { code = "indices('hello', 'x') -> []", description = "No matches" },
]
features = ["core"]

[[functions]]
name = "implode"
category = "string"
description = "Convert an array of Unicode codepoints to a string"
signature = "array -> string"
examples = [
    { code = '''implode([97, 98, 99]) -> \"abc\"''', description = "ASCII codepoints" },
    { code = '''implode([65, 9786]) -> \"A☺\"''', description = "Unicode codepoints" },
    { code = '''implode([]) -> \"\"''', description = "Empty array" },
]
features = ["core"]

[[functions]]
name = "inside"
category = "string"
description = "Check if search string is contained in string"
signature = "string, string -> boolean"
examples = [
    { code = "inside('world', 'hello world') -> true", description = "Found" },
    { code = "inside('foo', 'hello world') -> false", description = "Not found" },
    { code = "inside('', 'hello') -> true", description = "Empty string always matches" },
]
features = ["core"]

[[functions]]
name = "is_blank"
category = "string"
description = "Check if string is empty or whitespace-only"
signature = "string -> boolean"
examples = [
    { code = "is_blank('   ') -> true", description = "Whitespace only" },
    { code = "is_blank('') -> true", description = "Empty string" },
    { code = "is_blank('hello') -> false", description = "Has content" },
]
features = ["core"]

[[functions]]
name = "kebab_case"
category = "string"
description = "Convert to kebab-case"
signature = "string -> string"
examples = [
    { code = '''kebab_case('helloWorld') -> \"hello-world\"''', description = "From camelCase" },
    { code = '''kebab_case('hello_world') -> \"hello-world\"''', description = "From snake_case" },
    { code = '''kebab_case('Hello World') -> \"hello-world\"''', description = "From title case" },
]
features = ["core"]

[[functions]]
name = "lower"
category = "string"
description = "Convert string to lowercase"
signature = "string -> string"
examples = [
    { code = '''lower('HELLO') -> \"hello\"''', description = "All uppercase" },
    { code = '''lower('Hello World') -> \"hello world\"''', description = "Mixed case" },
    { code = '''lower('hello') -> \"hello\"''', description = "Already lowercase" },
]
jep = "JEP-014"
features = ["core", "jep"]

[[functions]]
name = "ltrimstr"
category = "string"
description = "Remove prefix from string if present"
signature = "string, string -> string"
examples = [
    { code = '''ltrimstr('foobar', 'foo') -> \"bar\"''', description = "Remove prefix" },
    { code = '''ltrimstr('foobar', 'bar') -> \"foobar\"''', description = "Prefix not found" },
    { code = '''ltrimstr('hello', '') -> \"hello\"''', description = "Empty prefix" },
]
features = ["core"]

[[functions]]
name = "mask"
category = "string"
description = "Mask string, keeping last N characters visible"
signature = "string, number?, string? -> string"
examples = [
    { code = '''mask('4111111111111111', `4`) -> \"************1111\"''', description = "Credit card" },
    { code = '''mask('secret', `0`) -> \"******\"''', description = "Mask all" },
    { code = '''mask('password', `4`, '#') -> \"####word\"''', description = "Custom mask char" },
]
features = ["core"]

[[functions]]
name = "normalize_whitespace"
category = "string"
description = "Collapse multiple whitespace to single space"
signature = "string -> string"
examples = [
    { code = '''normalize_whitespace('a  b  c') -> \"a b c\"''', description = "Multiple spaces" },
    { code = '''normalize_whitespace('a\\n\\nb') -> \"a b\"''', description = "Newlines to space" },
    { code = '''normalize_whitespace('hello') -> \"hello\"''', description = "Already normalized" },
]
features = ["core"]

[[functions]]
name = "pad_left"
category = "string"
description = "Pad string on the left to reach target length"
signature = "string, number, string -> string"
examples = [
    { code = '''pad_left('5', `3`, '0') -> \"005\"''', description = "Zero-pad number" },
    { code = '''pad_left('hi', `5`, ' ') -> \"   hi\"''', description = "Right-align text" },
    { code = '''pad_left('hello', `3`, '0') -> \"hello\"''', description = "Already long enough" },
]
jep = "JEP-014"
features = ["core", "jep"]

[[functions]]
name = "pad_right"
category = "string"
description = "Pad string on the right to reach target length"
signature = "string, number, string -> string"
examples = [
    { code = '''pad_right('5', `3`, '0') -> \"500\"''', description = "Pad with zeros" },
    { code = '''pad_right('hi', `5`, ' ') -> \"hi   \"''', description = "Left-align text" },
    { code = '''pad_right('hello', `3`, '0') -> \"hello\"''', description = "Already long enough" },
]
jep = "JEP-014"
features = ["core", "jep"]

[[functions]]
name = "redact"
category = "string"
description = "Redact regex pattern matches with replacement"
signature = "string, string, string? -> string"
examples = [
    { code = '''redact('email: test@example.com', '\\S+@\\S+', '[EMAIL]') -> \"email: [EMAIL]\"''', description = "Redact email" },
    { code = '''redact('call 555-1234', '\\d{3}-\\d{4}', '[PHONE]') -> \"call [PHONE]\"''', description = "Redact phone" },
    { code = '''redact('no match', 'xyz', '[X]') -> \"no match\"''', description = "No matches" },
]
features = ["core"]

[[functions]]
name = "repeat"
category = "string"
description = "Repeat a string n times"
signature = "string, number -> string"
examples = [
    { code = '''repeat('ab', `3`) -> \"ababab\"''', description = "Repeat 3 times" },
    { code = '''repeat('-', `5`) -> \"-----\"''', description = "Create separator" },
    { code = '''repeat('x', `0`) -> \"\"''', description = "Zero times" },
]
features = ["core"]

[[functions]]
name = "replace"
category = "string"
description = "Replace occurrences of a substring"
signature = "string, string, string -> string"
examples = [
    { code = '''replace('hello', 'l', 'L') -> \"heLLo\"''', description = "Replace all occurrences" },
    { code = '''replace('hello', 'x', 'y') -> \"hello\"''', description = "No match" },
    { code = '''replace('aaa', 'a', 'b') -> \"bbb\"''', description = "Replace all" },
]
jep = "JEP-014"
features = ["core", "jep"]

[[functions]]
name = "reverse_string"
category = "string"
description = "Reverse a string"
signature = "string -> string"
examples = [
    { code = '''reverse_string('hello') -> \"olleh\"''', description = "Reverse word" },
    { code = '''reverse_string('ab') -> \"ba\"''', description = "Two chars" },
    { code = '''reverse_string('') -> \"\"''', description = "Empty string" },
]
features = ["core"]

[[functions]]
name = "rtrimstr"
category = "string"
description = "Remove suffix from string if present"
signature = "string, string -> string"
examples = [
    { code = '''rtrimstr('foobar', 'bar') -> \"foo\"''', description = "Remove suffix" },
    { code = '''rtrimstr('hello.txt', '.txt') -> \"hello\"''', description = "Remove file extension" },
    { code = '''rtrimstr('hello', 'xyz') -> \"hello\"''', description = "Suffix not present" },
    { code = '''rtrimstr('barbar', 'bar') -> \"bar\"''', description = "Only removes once" },
]
features = ["core"]

[[functions]]
name = "slice"
category = "string"
description = "Extract substring by start and end index"
signature = "string, number, number -> string"
examples = [
    { code = '''slice('hello', `1`, `4`) -> \"ell\"''', description = "Middle slice" },
    { code = '''slice('hello', `0`, `2`) -> \"he\"''', description = "From start" },
    { code = '''slice('hello', `3`, `5`) -> \"lo\"''', description = "To end" },
    { code = '''slice('abcdef', `2`, `4`) -> \"cd\"''', description = "Two characters" },
]
features = ["core"]

[[functions]]
name = "snake_case"
category = "string"
description = "Convert to snake_case"
signature = "string -> string"
examples = [
    { code = '''snake_case('helloWorld') -> \"hello_world\"''', description = "From camelCase" },
    { code = '''snake_case('HelloWorld') -> \"hello_world\"''', description = "From PascalCase" },
    { code = '''snake_case('hello-world') -> \"hello_world\"''', description = "From kebab-case" },
    { code = '''snake_case('HELLO_WORLD') -> \"hello_world\"''', description = "From UPPER_CASE" },
]
features = ["core"]

[[functions]]
name = "split"
category = "string"
description = "Split string by delimiter"
signature = "string, string -> array"
examples = [
    { code = '''split('a,b,c', ',') -> [\"a\", \"b\", \"c\"]''', description = "Basic split" },
    { code = '''split('hello world', ' ') -> [\"hello\", \"world\"]''', description = "Split by space" },
    { code = '''split('no-delim', ',') -> [\"no-delim\"]''', description = "No delimiter found" },
    { code = '''split('', ',') -> [\"\"]''', description = "Empty string" },
]
jep = "JEP-014"
features = ["core", "jep"]

[[functions]]
name = "sprintf"
category = "string"
description = "Printf-style string formatting"
signature = "string, any... -> string"
examples = [
    { code = '''sprintf('Pi is %.2f', `3.14159`) -> \"Pi is 3.14\"''', description = "Float formatting" },
    { code = '''sprintf('Hello %s', 'world') -> \"Hello world\"''', description = "String interpolation" },
    { code = '''sprintf('%d items', `42`) -> \"42 items\"''', description = "Integer formatting" },
    { code = '''sprintf('%s: %d', 'count', `5`) -> \"count: 5\"''', description = "Multiple args" },
]
features = ["core"]

[[functions]]
name = "substr"
category = "string"
description = "Extract substring by start index and length"
signature = "string, number, number -> string"
examples = [
    { code = '''substr('hello', `1`, `3`) -> \"ell\"''', description = "From index 1, length 3" },
    { code = '''substr('hello', `0`, `2`) -> \"he\"''', description = "From start" },
    { code = '''substr('abcdef', `2`, `2`) -> \"cd\"''', description = "Middle portion" },
    { code = '''substr('hello', `4`, `1`) -> \"o\"''', description = "Single character" },
]
features = ["core"]

[[functions]]
name = "title"
category = "string"
description = "Convert to title case"
signature = "string -> string"
examples = [
    { code = '''title('hello world') -> \"Hello World\"''', description = "Basic title case" },
    { code = '''title('HELLO WORLD') -> \"Hello World\"''', description = "From uppercase" },
    { code = '''title('hello') -> \"Hello\"''', description = "Single word" },
    { code = '''title('a b c') -> \"A B C\"''', description = "Single letters" },
]
features = ["core"]

[[functions]]
name = "trim"
category = "string"
description = "Remove leading and trailing whitespace"
signature = "string -> string"
examples = [
    { code = '''trim('  hello  ') -> \"hello\"''', description = "Remove both sides" },
    { code = '''trim('hello') -> \"hello\"''', description = "No whitespace" },
    { code = '''trim('   ') -> \"\"''', description = "Only whitespace" },
    { code = '''trim('\t\nhello\t\n') -> \"hello\"''', description = "Tabs and newlines" },
]
jep = "JEP-014"
features = ["core", "jep"]

[[functions]]
name = "trim_left"
category = "string"
description = "Remove leading whitespace"
signature = "string -> string"
examples = [
    { code = '''trim_left('  hello') -> \"hello\"''', description = "Remove leading spaces" },
    { code = '''trim_left('hello  ') -> \"hello  \"''', description = "Trailing preserved" },
    { code = '''trim_left('\t\thello') -> \"hello\"''', description = "Remove tabs" },
    { code = '''trim_left('hello') -> \"hello\"''', description = "No change needed" },
]
jep = "JEP-014"
features = ["core", "jep"]

[[functions]]
name = "trim_right"
category = "string"
description = "Remove trailing whitespace"
signature = "string -> string"
examples = [
    { code = '''trim_right('hello  ') -> \"hello\"''', description = "Remove trailing spaces" },
    { code = '''trim_right('  hello') -> \"  hello\"''', description = "Leading preserved" },
    { code = '''trim_right('hello\t\t') -> \"hello\"''', description = "Remove tabs" },
    { code = '''trim_right('hello') -> \"hello\"''', description = "No change needed" },
]
jep = "JEP-014"
features = ["core", "jep"]

[[functions]]
name = "upper"
category = "string"
description = "Convert string to uppercase"
signature = "string -> string"
examples = [
    { code = '''upper('hello') -> \"HELLO\"''', description = "Basic uppercase" },
    { code = '''upper('Hello World') -> \"HELLO WORLD\"''', description = "Mixed case" },
    { code = '''upper('HELLO') -> \"HELLO\"''', description = "Already uppercase" },
    { code = '''upper('abc123') -> \"ABC123\"''', description = "With numbers" },
]
jep = "JEP-014"
features = ["core", "jep"]

[[functions]]
name = "wrap"
category = "string"
description = "Wrap text to specified width"
signature = "string, number -> string"
examples = [
    { code = '''wrap('hello world', `5`) -> \"hello\\nworld\"''', description = "Wrap at word boundary" },
    { code = '''wrap('a b c d e', `3`) -> \"a b\\nc d\\ne\"''', description = "Multiple wraps" },
    { code = '''wrap('short', `10`) -> \"short\"''', description = "No wrap needed" },
    { code = '''wrap('one two three', `7`) -> \"one two\\nthree\"''', description = "Longer text" },
]
features = ["core"]

# =============================================================================
# TEXT FUNCTIONS
# =============================================================================

[[functions]]
name = "char_count"
category = "text"
description = "Count characters in text"
signature = "string -> number"
examples = [
    { code = "char_count('hello') -> 5", description = "Simple word" },
    { code = "char_count('hello world') -> 11", description = "With space" },
    { code = "char_count('') -> 0", description = "Empty string" },
]
features = ["core"]

[[functions]]
name = "char_frequencies"
category = "text"
description = "Count character frequencies"
signature = "string -> object"
examples = [
    { code = "char_frequencies('aab') -> {a: 2, b: 1}", description = "Count repeated chars" },
    { code = "char_frequencies('hello') -> {e: 1, h: 1, l: 2, o: 1}", description = "Word frequencies" },
    { code = "char_frequencies('') -> {}", description = "Empty string" },
]
features = ["core"]

[[functions]]
name = "paragraph_count"
category = "text"
description = "Count paragraphs in text"
signature = "string -> number"
examples = [
    { code = '''paragraph_count('A\\n\\nB') -> 2''', description = "Two paragraphs" },
    { code = '''paragraph_count('Single paragraph') -> 1''', description = "Single paragraph" },
    { code = '''paragraph_count('A\\n\\nB\\n\\nC') -> 3''', description = "Three paragraphs" },
]
features = ["core"]

[[functions]]
name = "reading_time"
category = "text"
description = "Estimate reading time"
signature = "string -> string"
examples = [
    { code = '''reading_time('The quick brown fox') -> \"1 min read\"''', description = "Short text" },
    { code = '''reading_time('') -> \"1 min read\"''', description = "Empty text minimum" },
]
features = ["core"]

[[functions]]
name = "reading_time_seconds"
category = "text"
description = "Estimate reading time in seconds"
signature = "string -> number"
examples = [
    { code = "reading_time_seconds('The quick brown fox jumps over the lazy dog') -> 2", description = "Short sentence" },
    { code = "reading_time_seconds('') -> 0", description = "Empty text" },
]
features = ["core"]

[[functions]]
name = "sentence_count"
category = "text"
description = "Count sentences in text"
signature = "string -> number"
examples = [
    { code = "sentence_count('Hello. World!') -> 2", description = "Two sentences" },
    { code = "sentence_count('One sentence') -> 1", description = "Single sentence" },
    { code = "sentence_count('What? Yes! No.') -> 3", description = "Different terminators" },
]
features = ["core"]

[[functions]]
name = "word_count"
category = "text"
description = "Count words in text"
signature = "string -> number"
examples = [
    { code = "word_count('hello world') -> 2", description = "Two words" },
    { code = "word_count('one') -> 1", description = "Single word" },
    { code = "word_count('') -> 0", description = "Empty string" },
]
features = ["core"]

[[functions]]
name = "word_frequencies"
category = "text"
description = "Count word frequencies"
signature = "string -> object"
examples = [
    { code = "word_frequencies('a a b') -> {a: 2, b: 1}", description = "Count repeated words" },
    { code = "word_frequencies('the quick brown fox') -> {brown: 1, fox: 1, quick: 1, the: 1}", description = "Unique words" },
    { code = "word_frequencies('') -> {}", description = "Empty string" },
]
features = ["core"]

[[functions]]
name = "ngrams"
category = "text"
description = "Generate n-grams from text (word or character)"
signature = "string, number, string? -> array"
examples = [
    { code = "ngrams('hello', `3`, 'char') -> \\['hel', 'ell', 'llo'\\]", description = "Character trigrams" },
    { code = "ngrams('a b c d', `2`, 'word') -> \\[\\['a', 'b'\\], \\['b', 'c'\\], \\['c', 'd'\\]\\]", description = "Word bigrams" },
    { code = "ngrams('ab', `3`, 'char') -> \\[\\]", description = "Text shorter than n" },
]
features = ["core"]

[[functions]]
name = "bigrams"
category = "text"
description = "Generate word bigrams (2-grams)"
signature = "string -> array"
examples = [
    { code = "bigrams('a b c') -> \\[\\['a', 'b'\\], \\['b', 'c'\\]\\]", description = "Basic bigrams" },
    { code = "bigrams('the quick brown fox') -> \\[\\['the', 'quick'\\], \\['quick', 'brown'\\], \\['brown', 'fox'\\]\\]", description = "Sentence bigrams" },
    { code = "bigrams('single') -> \\[\\]", description = "Single word" },
]
features = ["core"]

[[functions]]
name = "trigrams"
category = "text"
description = "Generate word trigrams (3-grams)"
signature = "string -> array"
examples = [
    { code = "trigrams('a b c d') -> \\[\\['a', 'b', 'c'\\], \\['b', 'c', 'd'\\]\\]", description = "Basic trigrams" },
    { code = "trigrams('the quick brown fox jumps') -> \\[\\['the', 'quick', 'brown'\\], \\['quick', 'brown', 'fox'\\], \\['brown', 'fox', 'jumps'\\]\\]", description = "Sentence trigrams" },
    { code = "trigrams('a b') -> \\[\\]", description = "Too few words" },
]
features = ["core"]

# =============================================================================
# TYPE FUNCTIONS
# =============================================================================

[[functions]]
name = "is_array"
category = "type"
description = "Check if value is an array"
signature = "any -> boolean"
examples = [
    { code = "is_array([1, 2]) -> true", description = "Array returns true" },
    { code = "is_array('hello') -> false", description = "String returns false" },
    { code = "is_array({}) -> false", description = "Object returns false" },
    { code = "is_array([]) -> true", description = "Empty array is array" },
]
features = ["core"]

[[functions]]
name = "is_boolean"
category = "type"
description = "Check if value is a boolean"
signature = "any -> boolean"
examples = [
    { code = "is_boolean(`true`) -> true", description = "True is boolean" },
    { code = "is_boolean(`false`) -> true", description = "False is boolean" },
    { code = "is_boolean('true') -> false", description = "String is not boolean" },
    { code = "is_boolean(`1`) -> false", description = "Number is not boolean" },
]
features = ["core"]

[[functions]]
name = "is_empty"
category = "type"
description = "Check if value is empty"
signature = "any -> boolean"
examples = [
    { code = "is_empty([]) -> true", description = "Empty array" },
    { code = "is_empty('') -> true", description = "Empty string" },
    { code = "is_empty({}) -> true", description = "Empty object" },
    { code = "is_empty([1, 2]) -> false", description = "Non-empty array" },
]
features = ["core"]

[[functions]]
name = "is_null"
category = "type"
description = "Check if value is null"
signature = "any -> boolean"
examples = [
    { code = "is_null(`null`) -> true", description = "Null returns true" },
    { code = "is_null('') -> false", description = "Empty string is not null" },
    { code = "is_null(`0`) -> false", description = "Zero is not null" },
    { code = "is_null(missing_field) -> true", description = "Missing field is null" },
]
features = ["core"]

[[functions]]
name = "is_number"
category = "type"
description = "Check if value is a number"
signature = "any -> boolean"
examples = [
    { code = "is_number(`42`) -> true", description = "Integer is number" },
    { code = "is_number(`3.14`) -> true", description = "Float is number" },
    { code = "is_number('42') -> false", description = "String is not number" },
    { code = "is_number(`null`) -> false", description = "Null is not number" },
]
features = ["core"]

[[functions]]
name = "is_object"
category = "type"
description = "Check if value is an object"
signature = "any -> boolean"
examples = [
    { code = "is_object({a: 1}) -> true", description = "Object returns true" },
    { code = "is_object({}) -> true", description = "Empty object is object" },
    { code = "is_object([]) -> false", description = "Array is not object" },
    { code = "is_object('hello') -> false", description = "String is not object" },
]
features = ["core"]

[[functions]]
name = "is_string"
category = "type"
description = "Check if value is a string"
signature = "any -> boolean"
examples = [
    { code = "is_string('hello') -> true", description = "String returns true" },
    { code = "is_string('') -> true", description = "Empty string is string" },
    { code = "is_string(`42`) -> false", description = "Number is not string" },
    { code = "is_string([]) -> false", description = "Array is not string" },
]
features = ["core"]

[[functions]]
name = "to_boolean"
category = "type"
description = "Convert value to boolean"
signature = "any -> boolean"
examples = [
    { code = "to_boolean('true') -> true", description = "String 'true'" },
    { code = "to_boolean('false') -> false", description = "String 'false'" },
    { code = "to_boolean(`1`) -> true", description = "Non-zero is true" },
    { code = "to_boolean(`0`) -> false", description = "Zero is false" },
]
features = ["core"]

[[functions]]
name = "type_of"
category = "type"
description = "Get the type of a value"
signature = "any -> string"
examples = [
    { code = '''type_of(`42`) -> \"number\"''', description = "Number type" },
    { code = '''type_of('hello') -> \"string\"''', description = "String type" },
    { code = '''type_of([1, 2]) -> \"array\"''', description = "Array type" },
    { code = '''type_of({a: 1}) -> \"object\"''', description = "Object type" },
]
features = ["core"]

# =============================================================================
# URL FUNCTIONS
# =============================================================================

[[functions]]
name = "url_decode"
category = "url"
description = "URL decode a string"
signature = "string -> string"
examples = [
    { code = '''url_decode('hello%20world') -> \"hello world\"''', description = "Decode space" },
    { code = '''url_decode('a%2Bb') -> \"a+b\"''', description = "Decode plus sign" },
    { code = '''url_decode('100%25') -> \"100%\"''', description = "Decode percent" },
    { code = '''url_decode('hello') -> \"hello\"''', description = "No encoding" },
]
features = ["core"]

[[functions]]
name = "url_encode"
category = "url"
description = "URL encode a string"
signature = "string -> string"
examples = [
    { code = '''url_encode('hello world') -> \"hello%20world\"''', description = "Encode space" },
    { code = '''url_encode('a+b') -> \"a%2Bb\"''', description = "Encode plus" },
    { code = '''url_encode('100%') -> \"100%25\"''', description = "Encode percent" },
    { code = '''url_encode('hello') -> \"hello\"''', description = "No special chars" },
]
features = ["core"]

[[functions]]
name = "url_parse"
category = "url"
description = "Parse URL into components"
signature = "string -> object"
examples = [
    { code = "url_parse('https://example.com/path') -> {scheme: 'https', ...}", description = "Parse full URL" },
    { code = "url_parse('http://user:pass@host:8080') -> components", description = "With auth and port" },
    { code = "url_parse('https://api.example.com/v1?key=val') -> with query", description = "With query string" },
    { code = "url_parse('/path/to/file') -> relative path", description = "Relative URL" },
]
features = ["core"]

# =============================================================================
# UTILITY FUNCTIONS
# =============================================================================

[[functions]]
name = "coalesce"
category = "utility"
description = "Return first non-null value"
signature = "any... -> any"
examples = [
    { code = '''coalesce(`null`, `null`, 'value') -> \"value\"''', description = "Skip nulls" },
    { code = "coalesce(field1, field2, 'default') -> first non-null", description = "Field fallback" },
    { code = "coalesce('first', 'second') -> 'first'", description = "First wins" },
    { code = "coalesce(`null`, `null`) -> null", description = "All null" },
]
features = ["core"]

[[functions]]
name = "default"
category = "utility"
description = "Return default value if null"
signature = "any, any -> any"
examples = [
    { code = '''default(`null`, 'fallback') -> \"fallback\"''', description = "Null uses default" },
    { code = "default('value', 'fallback') -> 'value'", description = "Non-null keeps value" },
    { code = "default(missing_field, `0`) -> 0", description = "Missing field default" },
    { code = "default('', 'fallback') -> ''", description = "Empty string not null" },
]
features = ["core"]

[[functions]]
name = "if"
category = "utility"
description = "Conditional expression"
signature = "boolean, any, any -> any"
examples = [
    { code = '''if(`true`, 'yes', 'no') -> \"yes\"''', description = "True branch" },
    { code = '''if(`false`, 'yes', 'no') -> \"no\"''', description = "False branch" },
    { code = "if(age >= `18`, 'adult', 'minor') -> depends", description = "Conditional logic" },
    { code = "if(is_empty(arr), 'none', first(arr)) -> value or none", description = "Safe access" },
]
features = ["core"]

[[functions]]
name = "json_decode"
category = "utility"
description = "Parse JSON string"
signature = "string -> any"
examples = [
    { code = '''json_decode('{\"a\": 1}') -> {a: 1}''', description = "Parse object" },
    { code = '''json_decode('[1, 2, 3]') -> [1, 2, 3]''', description = "Parse array" },
    { code = '''json_decode('\"hello\"') -> \"hello\"''', description = "Parse string" },
    { code = "json_decode(json_field) -> parsed", description = "Parse field" },
]
features = ["core"]

[[functions]]
name = "json_encode"
category = "utility"
description = "Serialize value to JSON string"
signature = "any -> string"
examples = [
    { code = '''json_encode({a: 1}) -> \"{\\\"a\\\":1}\"''', description = "Encode object" },
    { code = '''json_encode([1, 2, 3]) -> \"[1,2,3]\"''', description = "Encode array" },
    { code = '''json_encode('hello') -> \"\\\"hello\\\"\"''', description = "Encode string" },
    { code = "json_encode(data) -> JSON string", description = "Encode any value" },
]
features = ["core"]

[[functions]]
name = "json_pointer"
category = "utility"
description = "Access value using JSON Pointer (RFC 6901)"
signature = "any, string -> any"
examples = [
    { code = "json_pointer({foo: {bar: 1}}, '/foo/bar') -> 1", description = "Nested access" },
    { code = "json_pointer(data, '/0/name') -> first item name", description = "Array access" },
    { code = "json_pointer({a: 1}, '/a') -> 1", description = "Top-level access" },
    { code = "json_pointer(data, '/missing') -> null", description = "Missing path" },
]
features = ["core"]

[[functions]]
name = "now"
category = "utility"
description = "Current Unix timestamp in seconds"
signature = "-> number"
examples = [
    { code = "now() -> 1699900000", description = "Current timestamp" },
    { code = "now() - 3600 -> one hour ago", description = "Subtract seconds" },
    { code = "now() + 86400 -> tomorrow", description = "Add one day" },
    { code = "from_epoch(now()) -> current ISO", description = "Convert to string" },
]
features = ["core"]

[[functions]]
name = "now_ms"
category = "utility"
description = "Current Unix timestamp in milliseconds"
signature = "-> number"
examples = [
    { code = "now_ms() -> 1699900000000", description = "Current time in ms" },
    { code = "now_ms() - start_ms -> elapsed ms", description = "Calculate duration" },
    { code = "now_ms() / `1000` -> seconds", description = "Convert to seconds" },
    { code = "from_epoch_ms(now_ms()) -> current ISO", description = "Convert to string" },
]
features = ["core"]

[[functions]]
name = "pretty"
category = "utility"
description = "Pretty-print value as formatted JSON string"
signature = "any, number? -> string"
examples = [
    { code = '''pretty({a: 1}) -> \"{\n  \\\"a\\\": 1\n}\"''', description = "Default 2-space indent" },
    { code = '''pretty({a: 1}, `4`) -> 4-space indent''', description = "Custom indent" },
    { code = "pretty(config) -> readable JSON", description = "Format for display" },
    { code = "sprintf('Config:\\n%s', pretty(@)) -> embedded", description = "Embed in output" },
]
features = ["core"]

# =============================================================================
# UUID FUNCTIONS
# =============================================================================

[[functions]]
name = "uuid"
category = "uuid"
description = "Generate a UUID v4"
signature = "-> string"
examples = [
    { code = '''uuid() -> \"550e8400-e29b-41d4-a716-446655440000\"''', description = "Generate UUID" },
    { code = "uuid() -> random unique ID", description = "Each call is unique" },
    { code = "{id: uuid(), name: 'item'} -> with UUID", description = "Add ID to object" },
]
features = ["core"]

# =============================================================================
# VALIDATION FUNCTIONS
# =============================================================================

[[functions]]
name = "is_base64"
category = "validation"
description = "Check if valid Base64 encoding"
signature = "string -> boolean"
examples = [
    { code = "is_base64('SGVsbG8=') -> true", description = "Valid base64" },
    { code = "is_base64('not valid!') -> false", description = "Invalid chars" },
    { code = "is_base64('') -> true", description = "Empty is valid" },
]
features = ["core"]

[[functions]]
name = "is_credit_card"
category = "validation"
description = "Validate credit card number (Luhn check + length)"
signature = "string -> boolean"
examples = [
    { code = "is_credit_card('4111111111111111') -> true", description = "Valid Visa test number" },
    { code = "is_credit_card('1234567890123456') -> false", description = "Invalid number" },
    { code = "is_credit_card('5500000000000004') -> true", description = "Valid Mastercard test" },
]
features = ["core"]

[[functions]]
name = "is_email"
category = "validation"
description = "Validate email address format"
signature = "string -> boolean"
examples = [
    { code = "is_email('user@example.com') -> true", description = "Valid email" },
    { code = "is_email('invalid-email') -> false", description = "Missing @" },
    { code = "is_email('user@sub.domain.com') -> true", description = "Subdomain" },
]
features = ["core"]

[[functions]]
name = "is_hex"
category = "validation"
description = "Check if valid hexadecimal string"
signature = "string -> boolean"
examples = [
    { code = "is_hex('deadbeef') -> true", description = "Valid hex" },
    { code = "is_hex('ABCDEF') -> true", description = "Uppercase hex" },
    { code = "is_hex('ghijkl') -> false", description = "Invalid chars" },
]
features = ["core"]

[[functions]]
name = "is_ipv4"
category = "validation"
description = "Validate IPv4 address format"
signature = "string -> boolean"
examples = [
    { code = "is_ipv4('192.168.1.1') -> true", description = "Valid IPv4" },
    { code = "is_ipv4('256.1.1.1') -> false", description = "Out of range" },
    { code = "is_ipv4('10.0.0.1') -> true", description = "Private IP" },
]
features = ["core"]

[[functions]]
name = "is_ipv6"
category = "validation"
description = "Validate IPv6 address format"
signature = "string -> boolean"
examples = [
    { code = "is_ipv6('::1') -> true", description = "Loopback" },
    { code = "is_ipv6('2001:db8::1') -> true", description = "Full IPv6" },
    { code = "is_ipv6('192.168.1.1') -> false", description = "IPv4 is not IPv6" },
]
features = ["core"]

[[functions]]
name = "is_iso_date"
category = "validation"
description = "Validate ISO 8601 date format"
signature = "string -> boolean"
examples = [
    { code = "is_iso_date('2023-12-13T15:30:00Z') -> true", description = "Full ISO format" },
    { code = "is_iso_date('2023-12-13') -> true", description = "Date only" },
    { code = "is_iso_date('12/13/2023') -> false", description = "US format invalid" },
]
features = ["core"]

[[functions]]
name = "is_json"
category = "validation"
description = "Check if string is valid JSON"
signature = "string -> boolean"
examples = [
    { code = '''is_json('{\"a\": 1}') -> true''', description = "Valid JSON object" },
    { code = "is_json('[1, 2, 3]') -> true", description = "Valid JSON array" },
    { code = "is_json('not json') -> false", description = "Invalid JSON" },
]
features = ["core"]

[[functions]]
name = "is_jwt"
category = "validation"
description = "Check if valid JWT structure (3 base64url parts)"
signature = "string -> boolean"
examples = [
    { code = "is_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIn0.dozjgNryP4J3jVmNHl0w5N_XgL0n3I9PlFUP0THsR8U') -> true", description = "Valid JWT" },
    { code = "is_jwt('eyJhbGciOiJIUzI1NiJ9.eyJuYW1lIjoiSm9obiJ9.signature') -> true", description = "Three parts with dots" },
    { code = "is_jwt('not.a.valid.jwt') -> false", description = "Four parts" },
    { code = "is_jwt('invalid') -> false", description = "No dots" },
]
features = ["core"]

[[functions]]
name = "is_phone"
category = "validation"
description = "Validate phone number format"
signature = "string -> boolean"
examples = [
    { code = "is_phone('+1-555-123-4567') -> true", description = "US format with country code" },
    { code = "is_phone('555-123-4567') -> true", description = "US format without country code" },
    { code = "is_phone('+44 20 7946 0958') -> true", description = "UK format" },
    { code = "is_phone('invalid') -> false", description = "Invalid phone" },
]
features = ["core"]

[[functions]]
name = "is_url"
category = "validation"
description = "Validate URL format"
signature = "string -> boolean"
examples = [
    { code = "is_url('https://example.com') -> true", description = "Simple HTTPS URL" },
    { code = "is_url('http://localhost:8080/path') -> true", description = "URL with port and path" },
    { code = "is_url('ftp://files.example.com') -> true", description = "FTP URL" },
    { code = "is_url('not a url') -> false", description = "Invalid URL" },
]
features = ["core"]

[[functions]]
name = "is_uuid"
category = "validation"
description = "Validate UUID format"
signature = "string -> boolean"
examples = [
    { code = "is_uuid('550e8400-e29b-41d4-a716-446655440000') -> true", description = "Valid UUID v4" },
    { code = "is_uuid('6ba7b810-9dad-11d1-80b4-00c04fd430c8') -> true", description = "Valid UUID v1" },
    { code = "is_uuid('00000000-0000-0000-0000-000000000000') -> true", description = "Nil UUID" },
    { code = "is_uuid('not-a-uuid') -> false", description = "Invalid format" },
]
features = ["core"]

[[functions]]
name = "luhn_check"
category = "validation"
description = "Generic Luhn algorithm check"
signature = "string -> boolean"
examples = [
    { code = "luhn_check('79927398713') -> true", description = "Valid Luhn number" },
    { code = "luhn_check('4532015112830366') -> true", description = "Valid credit card number" },
    { code = "luhn_check('1234567890') -> false", description = "Invalid Luhn" },
    { code = "luhn_check('0') -> true", description = "Single zero" },
]
features = ["core"]

# =============================================================================
# FORMAT FUNCTIONS
# =============================================================================

[[functions]]
name = "to_csv"
category = "format"
description = "Convert array to CSV row string (RFC 4180 compliant)"
signature = "array -> string"
examples = [
    { code = '''to_csv(['a', 'b', 'c']) -> "a,b,c"''', description = "Simple strings" },
    { code = '''to_csv(['hello', `42`, `true`, `null`]) -> "hello,42,true,"''', description = "Mixed types" },
    { code = '''to_csv(['hello, world', 'test']) -> "\"hello, world\",test"''', description = "Value with comma is quoted" },
    { code = '''to_csv(['say "hello"', 'test']) -> "\"say \"\"hello\"\"\",test"''', description = "Quotes are doubled" },
]
features = ["format"]

[[functions]]
name = "to_tsv"
category = "format"
description = "Convert array to TSV row string (tab-separated)"
signature = "array -> string"
examples = [
    { code = '''to_tsv(['a', 'b', 'c']) -> "a\tb\tc"''', description = "Simple strings" },
    { code = '''to_tsv(['hello', `42`, `true`]) -> "hello\t42\ttrue"''', description = "Mixed types" },
]
features = ["format"]

[[functions]]
name = "to_csv_rows"
category = "format"
description = "Convert array of arrays to multi-line CSV string"
signature = "array -> string"
examples = [
    { code = '''to_csv_rows([[`1`, `2`, `3`], [`4`, `5`, `6`]]) -> "1,2,3\n4,5,6"''', description = "Numeric rows" },
    { code = '''to_csv_rows([['a', 'b'], ['c', 'd']]) -> "a,b\nc,d"''', description = "String rows" },
    { code = '''to_csv_rows([]) -> ""''', description = "Empty array" },
]
features = ["format"]

[[functions]]
name = "to_csv_table"
category = "format"
description = "Convert array of objects to CSV with header row"
signature = "array, array? -> string"
examples = [
    { code = '''to_csv_table([{name: 'alice', age: `30`}]) -> "age,name\n30,alice"''', description = "Keys sorted alphabetically" },
    { code = '''to_csv_table([{name: 'alice', age: `30`}], ['name', 'age']) -> "name,age\nalice,30"''', description = "Explicit column order" },
    { code = '''to_csv_table([{a: `1`}, {a: `2`, b: `3`}], ['a', 'b']) -> "a,b\n1,\n2,3"''', description = "Missing fields become empty" },
    { code = '''to_csv_table([]) -> ""''', description = "Empty array" },
]
features = ["format"]

# =============================================================================
# ENVIRONMENT FUNCTIONS (opt-in, requires "env" feature)
# =============================================================================

[[functions]]
name = "env"
category = "utility"
description = "Get all environment variables as an object"
signature = "-> object"
examples = [
    { code = "env() -> {HOME: '/Users/...', PATH: '...', ...}", description = "All env vars" },
    { code = "env().HOME -> home directory", description = "Access specific var" },
    { code = "keys(env()) -> list of var names", description = "List all var names" },
]
features = ["env"]

[[functions]]
name = "get_env"
category = "utility"
description = "Get a single environment variable by name"
signature = "string -> string | null"
examples = [
    { code = '''get_env('HOME') -> \"/Users/josh\"''', description = "Get home directory" },
    { code = "get_env('PATH') -> system PATH", description = "Get PATH" },
    { code = "get_env('MISSING') -> null", description = "Returns null if not set" },
    { code = "default(get_env('PORT'), '8080') -> with fallback", description = "With default value" },
]
features = ["env"]