sublime_pkg_tools 0.0.1

Package and version management toolkit for Node.js projects with changeset support
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
# sublime_pkg_tools API Specification

## Table of Contents

- [Overview]#overview
- [Version Information]#version-information
- [Config Module]#config-module
  - [PackageToolsConfig]#packagetoolsconfig
  - [ChangesetConfig]#changesetconfig
  - [VersionConfig]#versionconfig
  - [DependencyConfig]#dependencyconfig
  - [UpgradeConfig]#upgradeconfig
  - [ChangelogConfig]#changelogconfig
  - [AuditConfig]#auditconfig
  - [GitConfig]#gitconfig
  - [Configuration Loader]#configuration-loader
- [Types Module]#types-module
  - [Version Types]#version-types
  - [Package Types]#package-types
  - [Changeset Types]#changeset-types
  - [Dependency Types]#dependency-types
  - [Common Traits]#common-traits
  - [Type Aliases]#type-aliases
- [Version Module]#version-module
  - [VersionResolver]#versionresolver
  - [DependencyGraph]#dependencygraph
  - [DependencyPropagator]#dependencypropagator
  - [SnapshotGenerator]#snapshotgenerator
  - [Resolution Types]#resolution-types
  - [Application Types]#application-types
- [Changeset Module]#changeset-module
  - [ChangesetManager]#changesetmanager
  - [ChangesetStorage]#changesetstorage
  - [FileBasedChangesetStorage]#filebasedchangesetstorage
  - [ChangesetHistory]#changesethistory
  - [PackageDetector]#packagedetector
- [Changes Module]#changes-module
  - [ChangesAnalyzer]#changesanalyzer
  - [PackageMapper]#packagemapper
  - [Report Types]#report-types
- [Changelog Module]#changelog-module
  - [ChangelogGenerator]#changeloggenerator
  - [ChangelogCollector]#changelogcollector
  - [ChangelogParser]#changelogparser
  - [Formatters]#formatters
  - [Conventional Commits]#conventional-commits
  - [Merge Messages]#merge-messages
- [Upgrade Module]#upgrade-module
  - [UpgradeManager]#upgrademanager
  - [RegistryClient]#registryclient
  - [Detection Functions]#detection-functions
  - [Application Functions]#application-functions
  - [BackupManager]#backupmanager
- [Audit Module]#audit-module
  - [AuditManager]#auditmanager
  - [Audit Functions]#audit-functions
  - [Health Score]#health-score
  - [Issue Types]#issue-types
  - [Report Types]#report-types-1
  - [Formatters]#formatters-1
- [Error Module]#error-module
  - [Error Types]#error-types
  - [Result Types]#result-types

## Overview

`sublime_pkg_tools` is a comprehensive package and version management toolkit for Node.js projects with changeset support. It provides a library-first approach to managing packages, versions, changesets, and dependencies in both single-package and monorepo configurations.

**Key Features:**
- Version resolution with independent and unified strategies
- Dependency propagation across workspace packages
- Changeset-based workflow management
- Changes analysis and package mapping
- Conventional commits and changelog generation
- External dependency upgrade detection and application
- Comprehensive audit and health scoring
- Full async/await support

**Core Philosophy:**
- Changeset as source of truth
- Library not CLI
- Simple, serializable data model
- No opinionated workflow enforcement

## Version Information

### `VERSION`

```rust
pub const VERSION: &str = env!("CARGO_PKG_VERSION");
```

The version of the `sublime_pkg_tools` crate as defined in `Cargo.toml`.

### `version()`

```rust
pub fn version() -> &'static str
```

Returns the version of the `sublime_pkg_tools` crate.

**Returns:**
- A string slice containing the version number in semver format.

**Example:**
```rust
use sublime_pkg_tools::version;

let ver = version();
println!("sublime_pkg_tools version: {}", ver);
```

## Config Module

The `config` module provides comprehensive configuration management for all package tools functionality.

### PackageToolsConfig

Main configuration structure for package tools.

```rust
pub struct PackageToolsConfig {
    pub changeset: ChangesetConfig,
    pub version: VersionConfig,
    pub dependency: DependencyConfig,
    pub upgrade: UpgradeConfig,
    pub changelog: ChangelogConfig,
    pub audit: AuditConfig,
    pub git: GitConfig,
}
```

**Fields:**
- `changeset`: Changeset management configuration
- `version`: Version resolution configuration
- `dependency`: Dependency propagation configuration
- `upgrade`: Upgrade detection and application configuration
- `changelog`: Changelog generation configuration
- `audit`: Audit and health check configuration
- `git`: Git integration configuration

**Implements:**
- `Default`: Provides sensible defaults
- `Clone`: Can be cloned
- `Debug`: Debug formatting
- `Serialize`, `Deserialize`: Serialization support

### ChangesetConfig

Configuration for changeset management.

```rust
pub struct ChangesetConfig {
    pub path: String,
    pub history_path: String,
    pub available_environments: Vec<String>,
    pub default_environments: Vec<String>,
}
```

**Fields:**
- `path`: Path to store active changesets (default: `.changesets`)
- `history_path`: Path to store archived changesets (default: `.changesets/history`)
- `available_environments`: List of valid environment names
- `default_environments`: Default environments for new changesets

### VersionConfig

Configuration for version resolution.

```rust
pub struct VersionConfig {
    pub strategy: VersioningStrategy,
    pub default_bump: VersionBump,
    pub snapshot_format: String,
}
```

**Fields:**
- `strategy`: Versioning strategy (Independent or Unified)
- `default_bump`: Default version bump type (Patch, Minor, or Major)
- `snapshot_format`: Format template for snapshot versions

### DependencyConfig

Configuration for dependency propagation.

```rust
pub struct DependencyConfig {
    pub propagation_bump: VersionBump,
    pub propagate_dependencies: bool,
    pub propagate_dev_dependencies: bool,
    pub propagate_peer_dependencies: bool,
    pub max_depth: usize,
    pub fail_on_circular: bool,
    pub skip_workspace_protocol: bool,
    pub skip_file_protocol: bool,
    pub skip_link_protocol: bool,
    pub skip_portal_protocol: bool,
}
```

**Fields:**
- `propagation_bump`: Version bump type for dependency updates
- `propagate_dependencies`: Whether to propagate regular dependencies
- `propagate_dev_dependencies`: Whether to propagate dev dependencies
- `propagate_peer_dependencies`: Whether to propagate peer dependencies
- `max_depth`: Maximum propagation depth
- `fail_on_circular`: Whether to fail on circular dependencies
- `skip_workspace_protocol`: Skip workspace: protocol dependencies
- `skip_file_protocol`: Skip file: protocol dependencies
- `skip_link_protocol`: Skip link: protocol dependencies
- `skip_portal_protocol`: Skip portal: protocol dependencies

### UpgradeConfig

Configuration for upgrade detection and application.

```rust
pub struct UpgradeConfig {
    pub auto_changeset: bool,
    pub changeset_bump: VersionBump,
    pub registry: RegistryConfig,
    pub backup: BackupConfig,
}
```

**Fields:**
- `auto_changeset`: Automatically create changesets for upgrades
- `changeset_bump`: Version bump type for upgrade changesets
- `registry`: Registry configuration
- `backup`: Backup and rollback configuration

#### RegistryConfig

```rust
pub struct RegistryConfig {
    pub default_registry: String,
    pub scoped_registries: HashMap<String, String>,
    pub timeout_secs: u64,
    pub retry_attempts: usize,
    pub read_npmrc: bool,
}
```

**Fields:**
- `default_registry`: Default npm registry URL
- `scoped_registries`: Scoped package registries
- `timeout_secs`: Request timeout in seconds
- `retry_attempts`: Number of retry attempts
- `read_npmrc`: Whether to read .npmrc configuration

#### BackupConfig

```rust
pub struct BackupConfig {
    pub enabled: bool,
    pub path: String,
    pub keep_count: usize,
}
```

**Fields:**
- `enabled`: Whether backups are enabled
- `path`: Path to store backups
- `keep_count`: Number of backups to keep

### ChangelogConfig

Configuration for changelog generation.

```rust
pub struct ChangelogConfig {
    pub enabled: bool,
    pub format: ChangelogFormat,
    pub include_commit_links: bool,
    pub repository_url: Option<String>,
    pub conventional: ConventionalConfig,
    pub template: TemplateConfig,
    pub exclude: ExcludeConfig,
    pub monorepo_mode: MonorepoMode,
}
```

**Fields:**
- `enabled`: Whether changelog generation is enabled
- `format`: Changelog format (KeepAChangelog, ConventionalCommits, or Custom)
- `include_commit_links`: Include links to commits
- `repository_url`: Repository URL for links
- `conventional`: Conventional commits configuration
- `template`: Template configuration
- `exclude`: Exclusion patterns
- `monorepo_mode`: Monorepo changelog mode

#### ChangelogFormat

```rust
pub enum ChangelogFormat {
    KeepAChangelog,
    ConventionalCommits,
    Custom,
}
```

#### MonorepoMode

```rust
pub enum MonorepoMode {
    PerPackage,
    Root,
    Both,
}
```

### AuditConfig

Configuration for audit and health checks.

```rust
pub struct AuditConfig {
    pub enabled: bool,
    pub min_severity: IssueSeverity,
    pub sections: AuditSectionsConfig,
    pub health_score_weights: HealthScoreWeightsConfig,
}
```

**Fields:**
- `enabled`: Whether audits are enabled
- `min_severity`: Minimum severity to report
- `sections`: Configuration for audit sections
- `health_score_weights`: Weights for health score calculation

### GitConfig

Configuration for Git integration.

```rust
pub struct GitConfig {
    pub branch_base: String,
    pub detect_affected_packages: bool,
}
```

**Fields:**
- `branch_base`: Base branch for comparisons
- `detect_affected_packages`: Auto-detect affected packages from Git

### Configuration Loader

#### `load_config()`

```rust
pub async fn load_config(workspace_root: &Path) -> Result<PackageToolsConfig>
```

Loads package tools configuration from the workspace.

**Parameters:**
- `workspace_root`: Path to the workspace root directory

**Returns:**
- `Result<PackageToolsConfig>`: Loaded configuration or error

**Example:**
```rust
use sublime_pkg_tools::config::load_config;
use std::path::Path;

let config = load_config(Path::new(".")).await?;
println!("Changeset path: {}", config.changeset.path);
```

#### `load_config_from_file()`

```rust
pub async fn load_config_from_file(path: &Path) -> Result<PackageToolsConfig>
```

Loads configuration from a specific file.

**Parameters:**
- `path`: Path to the configuration file

**Returns:**
- `Result<PackageToolsConfig>`: Loaded configuration or error

#### `ConfigLoader`

```rust
pub struct ConfigLoader;

impl ConfigLoader {
    pub async fn load(workspace_root: &Path) -> Result<PackageToolsConfig>;
    pub async fn load_from_file(path: &Path) -> Result<PackageToolsConfig>;
    pub async fn load_with_defaults() -> PackageToolsConfig;
}
```

## Types Module

The `types` module provides fundamental data structures used throughout the package tools system.

### Version Types

#### `Version`

Represents a semantic version (major.minor.patch).

```rust
pub struct Version {
    pub major: u64,
    pub minor: u64,
    pub patch: u64,
}
```

**Methods:**

```rust
impl Version {
    pub fn new(major: u64, minor: u64, patch: u64) -> Self;
    pub fn parse(s: &str) -> Result<Self>;
    pub fn bump(&self, bump: VersionBump) -> Result<Self>;
    pub fn to_string(&self) -> String;
    pub fn is_greater_than(&self, other: &Version) -> bool;
    pub fn is_compatible_with(&self, other: &Version) -> bool;
}
```

**Implements:**
- `Clone`, `Debug`, `PartialEq`, `Eq`, `PartialOrd`, `Ord`
- `Display`: Formats as "major.minor.patch"
- `FromStr`: Parses from string
- `Serialize`, `Deserialize`

#### `VersionBump`

Version bump type.

```rust
pub enum VersionBump {
    Major,
    Minor,
    Patch,
    None,
}
```

**Methods:**

```rust
impl VersionBump {
    pub fn from_str(s: &str) -> Result<Self>;
    pub fn as_str(&self) -> &str;
}
```

#### `VersioningStrategy`

Versioning strategy for monorepos.

```rust
pub enum VersioningStrategy {
    Independent,
    Unified,
}
```

**Variants:**
- `Independent`: Each package has its own version
- `Unified`: All packages share the same version

### Package Types

#### `PackageInfo`

Information about a package.

```rust
pub struct PackageInfo {
    pub name: String,
    pub version: Version,
    pub path: PathBuf,
    pub package_json_path: PathBuf,
    pub dependencies: HashMap<String, String>,
    pub dev_dependencies: HashMap<String, String>,
    pub peer_dependencies: HashMap<String, String>,
    pub optional_dependencies: HashMap<String, String>,
    pub is_workspace_package: bool,
}
```

**Methods:**

```rust
impl PackageInfo {
    pub async fn from_path(path: &Path, fs: &FileSystemManager) -> Result<Self>;
    pub async fn load_package_json(&self, fs: &FileSystemManager) -> Result<serde_json::Value>;
    pub fn all_dependencies(&self) -> HashMap<String, String>;
    pub fn has_dependency(&self, name: &str) -> bool;
    pub fn get_dependency_version(&self, name: &str) -> Option<&String>;
}
```

**Implements:**
- `Clone`, `Debug`
- `Named`: Provides `name()` method
- `Versionable`: Provides `version()` method
- `HasDependencies`: Provides dependency methods

#### `DependencyType`

Type of dependency.

```rust
pub enum DependencyType {
    Regular,
    Dev,
    Peer,
    Optional,
}
```

### Changeset Types

#### `Changeset`

The central data structure representing package changes.

```rust
pub struct Changeset {
    pub id: String,
    pub branch: String,
    pub bump: VersionBump,
    pub packages: Vec<String>,
    pub environments: Vec<String>,
    pub commits: Vec<String>,
    pub created_at: DateTime<Utc>,
    pub updated_at: DateTime<Utc>,
}
```

**Methods:**

```rust
impl Changeset {
    pub fn new(branch: &str, bump: VersionBump, environments: Vec<String>) -> Self;
    pub fn add_package(&mut self, package: &str);
    pub fn add_commit(&mut self, commit: &str);
    pub fn remove_package(&mut self, package: &str);
    pub fn has_package(&self, package: &str) -> bool;
    pub fn update_bump(&mut self, bump: VersionBump);
    pub fn add_environment(&mut self, env: &str);
    pub fn remove_environment(&mut self, env: &str);
    pub fn validate(&self) -> Result<()>;
}
```

**Implements:**
- `Clone`, `Debug`
- `Serialize`, `Deserialize`
- `Identifiable`: Provides `id()` method

#### `ArchivedChangeset`

A changeset that has been released.

```rust
pub struct ArchivedChangeset {
    pub changeset: Changeset,
    pub release_info: ReleaseInfo,
}
```

**Methods:**

```rust
impl ArchivedChangeset {
    pub fn new(changeset: Changeset, release_info: ReleaseInfo) -> Self;
    pub fn changeset(&self) -> &Changeset;
    pub fn release_info(&self) -> &ReleaseInfo;
}
```

#### `ReleaseInfo`

Information about a release.

```rust
pub struct ReleaseInfo {
    pub released_at: DateTime<Utc>,
    pub released_by: String,
    pub release_commit: String,
    pub released_versions: HashMap<String, String>,
}
```

**Methods:**

```rust
impl ReleaseInfo {
    pub fn new(
        released_at: DateTime<Utc>,
        released_by: String,
        release_commit: String,
        released_versions: HashMap<String, String>,
    ) -> Self;
}
```

#### `UpdateSummary`

Summary of a changeset update operation.

```rust
pub struct UpdateSummary {
    pub commits_added: usize,
    pub new_packages: Vec<String>,
    pub existing_packages: Vec<String>,
}
```

### Dependency Types

#### `VersionProtocol`

Version specification protocol.

```rust
pub enum VersionProtocol {
    Workspace,
    File(String),
    Link(String),
    Portal(String),
    Semver(String),
}
```

**Functions:**

```rust
pub fn parse_protocol(version_spec: &str) -> VersionProtocol;
pub fn is_workspace_protocol(version_spec: &str) -> bool;
pub fn is_local_protocol(version_spec: &str) -> bool;
pub fn should_skip_protocol(version_spec: &str, config: &DependencyConfig) -> bool;
pub fn extract_protocol_path(version_spec: &str) -> Option<String>;
```

#### `LocalLinkType`

Type of local link.

```rust
pub enum LocalLinkType {
    File,
    Link,
    Portal,
}
```

#### `DependencyUpdate`

Represents a dependency version update.

```rust
pub struct DependencyUpdate {
    pub dependency_name: String,
    pub dependency_type: DependencyType,
    pub old_version_spec: String,
    pub new_version_spec: String,
    pub reason: UpdateReason,
}
```

#### `UpdateReason`

Reason for a dependency update.

```rust
pub enum UpdateReason {
    DirectChange,
    Propagation,
}
```

#### `CircularDependency`

Represents a circular dependency.

```rust
pub struct CircularDependency {
    pub cycle: Vec<String>,
}
```

### Common Traits

#### `Named`

```rust
pub trait Named {
    fn name(&self) -> &str;
}
```

#### `Versionable`

```rust
pub trait Versionable {
    fn version(&self) -> &Version;
}
```

#### `HasDependencies`

```rust
pub trait HasDependencies {
    fn dependencies(&self) -> &HashMap<String, String>;
    fn dev_dependencies(&self) -> &HashMap<String, String>;
    fn peer_dependencies(&self) -> &HashMap<String, String>;
    fn optional_dependencies(&self) -> &HashMap<String, String>;
}
```

#### `Identifiable`

```rust
pub trait Identifiable {
    fn id(&self) -> &str;
}
```

### Type Aliases

```rust
pub type PackageName = String;
pub type VersionSpec = String;
pub type CommitHash = String;
pub type BranchName = String;
```

### Prelude

```rust
pub mod prelude {
    pub use super::{
        Changeset, ArchivedChangeset, ReleaseInfo,
        Version, VersionBump, VersioningStrategy,
        PackageInfo, DependencyType,
        Named, Versionable, HasDependencies, Identifiable,
    };
}
```

## Version Module

The `version` module provides version resolution and dependency propagation.

### VersionResolver

Main version resolution orchestrator.

```rust
pub struct VersionResolver {
    // Private fields
}
```

**Methods:**

```rust
impl VersionResolver {
    pub async fn new(
        workspace_root: PathBuf,
        config: PackageToolsConfig,
    ) -> Result<Self>;
    
    pub async fn resolve_versions(
        &self,
        changeset: &Changeset,
    ) -> Result<VersionResolution>;
    
    pub async fn apply_versions(
        &self,
        changeset: &Changeset,
        dry_run: bool,
    ) -> Result<ApplyResult>;
    
    pub async fn preview_versions(
        &self,
        changeset: &Changeset,
    ) -> Result<VersionResolution>;
}
```

**Example:**
```rust
use sublime_pkg_tools::version::VersionResolver;
use sublime_pkg_tools::types::{Changeset, VersionBump};
use sublime_pkg_tools::config::PackageToolsConfig;
use std::path::PathBuf;

let workspace_root = PathBuf::from(".");
let config = PackageToolsConfig::default();

let resolver = VersionResolver::new(workspace_root, config).await?;

let mut changeset = Changeset::new("main", VersionBump::Minor, vec!["production".to_string()]);
changeset.add_package("my-package");

let resolution = resolver.resolve_versions(&changeset).await?;
for update in &resolution.updates {
    println!("{}: {} -> {}", update.name, update.current_version, update.next_version);
}
```

### DependencyGraph

Dependency graph for analyzing package relationships.

```rust
pub struct DependencyGraph {
    // Private fields
}
```

**Methods:**

```rust
impl DependencyGraph {
    pub fn from_packages(packages: &[PackageInfo]) -> Result<Self>;
    pub fn dependents(&self, package_name: &str) -> Vec<&str>;
    pub fn dependencies(&self, package_name: &str) -> Vec<&str>;
    pub fn detect_cycles(&self) -> Vec<CircularDependency>;
    pub fn topological_sort(&self) -> Result<Vec<String>>;
}
```

### DependencyPropagator

Handles dependency propagation logic.

```rust
pub struct DependencyPropagator {
    // Private fields
}
```

**Methods:**

```rust
impl DependencyPropagator {
    pub fn new(config: DependencyConfig) -> Self;
    
    pub fn propagate(
        &self,
        graph: &DependencyGraph,
        initial_updates: &[PackageUpdate],
    ) -> Result<Vec<PackageUpdate>>;
}
```

### SnapshotGenerator

Generates snapshot versions for testing.

```rust
pub struct SnapshotGenerator {
    // Private fields
}
```

**Methods:**

```rust
impl SnapshotGenerator {
    pub fn new(format: &str) -> Result<Self>;
    pub fn generate(&self, context: &SnapshotContext) -> Result<String>;
}
```

#### `SnapshotContext`

```rust
pub struct SnapshotContext {
    pub version: Version,
    pub branch: String,
    pub commit: &'static str,
    pub timestamp: i64,
}
```

#### `SnapshotVariable`

```rust
pub enum SnapshotVariable {
    Version,
    Branch,
    Commit,
    ShortCommit,
    Timestamp,
}
```

### Resolution Types

#### `VersionResolution`

Result of version resolution.

```rust
pub struct VersionResolution {
    pub updates: Vec<PackageUpdate>,
    pub circular_dependencies: Vec<CircularDependency>,
}
```

#### `PackageUpdate`

Version update for a package.

```rust
pub struct PackageUpdate {
    pub name: String,
    pub path: PathBuf,
    pub current_version: Version,
    pub next_version: Version,
    pub bump: VersionBump,
    pub dependency_updates: Vec<DependencyUpdate>,
}
```

### Application Types

#### `ApplyResult`

Result of applying version updates.

```rust
pub struct ApplyResult {
    pub resolution: VersionResolution,
    pub summary: ApplySummary,
}
```

#### `ApplySummary`

```rust
pub struct ApplySummary {
    pub packages_updated: usize,
    pub dependencies_updated: usize,
    pub files_modified: Vec<PathBuf>,
}
```

## Changeset Module

The `changeset` module provides changeset management functionality.

### ChangesetManager

Main changeset management orchestrator.

```rust
pub struct ChangesetManager {
    // Private fields
}
```

**Methods:**

```rust
impl ChangesetManager {
    pub async fn new(
        workspace_root: PathBuf,
        fs: FileSystemManager,
        config: PackageToolsConfig,
    ) -> Result<Self>;
    
    pub async fn create(
        &self,
        branch: &str,
        bump: VersionBump,
        environments: Vec<String>,
    ) -> Result<Changeset>;
    
    pub async fn load(&self, branch: &str) -> Result<Changeset>;
    
    pub async fn update(&self, changeset: &Changeset) -> Result<()>;
    
    pub async fn delete(&self, branch: &str) -> Result<()>;
    
    pub async fn list_pending(&self) -> Result<Vec<String>>;
    
    pub async fn exists(&self, branch: &str) -> Result<bool>;
    
    pub async fn archive(
        &self,
        branch: &str,
        release_info: ReleaseInfo,
    ) -> Result<()>;
    
    pub async fn add_commits_from_git(
        &self,
        branch: &str,
    ) -> Result<UpdateSummary>;
}
```

**Example:**
```rust
use sublime_pkg_tools::changeset::ChangesetManager;
use sublime_pkg_tools::types::{VersionBump, ReleaseInfo};
use sublime_pkg_tools::config::PackageToolsConfig;
use sublime_standard_tools::filesystem::FileSystemManager;
use std::path::PathBuf;
use std::collections::HashMap;
use chrono::Utc;

let workspace_root = PathBuf::from(".");
let fs = FileSystemManager::new();
let config = PackageToolsConfig::default();

let manager = ChangesetManager::new(workspace_root, fs, config).await?;

// Create changeset
let changeset = manager.create(
    "feature-branch",
    VersionBump::Minor,
    vec!["production".to_string()]
).await?;

// Load and update
let mut changeset = manager.load("feature-branch").await?;
changeset.add_package("my-package");
manager.update(&changeset).await?;

// Archive
let mut versions = HashMap::new();
versions.insert("my-package".to_string(), "1.2.0".to_string());

let release_info = ReleaseInfo::new(
    Utc::now(),
    "ci-bot".to_string(),
    "abc123".to_string(),
    versions,
);

manager.archive("feature-branch", release_info).await?;
```

### ChangesetStorage

Trait for changeset storage implementations.

```rust
#[async_trait]
pub trait ChangesetStorage: Send + Sync {
    async fn save(&self, changeset: &Changeset) -> Result<()>;
    async fn load(&self, branch: &str) -> Result<Changeset>;
    async fn exists(&self, branch: &str) -> Result<bool>;
    async fn delete(&self, branch: &str) -> Result<()>;
    async fn list_pending(&self) -> Result<Vec<String>>;
    async fn archive(&self, changeset: &Changeset, release_info: ReleaseInfo) -> Result<()>;
    async fn load_archived(&self, id: &str) -> Result<ArchivedChangeset>;
    async fn list_archived(&self) -> Result<Vec<String>>;
}
```

### FileBasedChangesetStorage

File-based implementation of changeset storage.

```rust
pub struct FileBasedChangesetStorage {
    // Private fields
}
```

**Methods:**

```rust
impl FileBasedChangesetStorage {
    pub fn new(
        workspace_root: PathBuf,
        changeset_path: PathBuf,
        history_path: PathBuf,
        fs: FileSystemManager,
    ) -> Self;
}
```

**Implements:**
- `ChangesetStorage`

### ChangesetHistory

Query interface for changeset history.

```rust
pub struct ChangesetHistory {
    // Private fields
}
```

**Methods:**

```rust
impl ChangesetHistory {
    pub fn new(storage: Box<dyn ChangesetStorage>) -> Self;
    
    pub async fn query_by_date(
        &self,
        start: DateTime<Utc>,
        end: DateTime<Utc>,
    ) -> Result<Vec<ArchivedChangeset>>;
    
    pub async fn query_by_package(
        &self,
        package: &str,
    ) -> Result<Vec<ArchivedChangeset>>;
    
    pub async fn query_by_environment(
        &self,
        environment: &str,
    ) -> Result<Vec<ArchivedChangeset>>;
    
    pub async fn query_by_bump(
        &self,
        bump: VersionBump,
    ) -> Result<Vec<ArchivedChangeset>>;
    
    pub async fn get_latest(&self, count: usize) -> Result<Vec<ArchivedChangeset>>;
}
```

### PackageDetector

Detects affected packages from Git changes.

```rust
pub struct PackageDetector {
    // Private fields
}
```

**Methods:**

```rust
impl PackageDetector {
    pub async fn new(
        workspace_root: PathBuf,
        fs: FileSystemManager,
    ) -> Result<Self>;
    
    pub async fn detect_from_commits(
        &self,
        repo: &Repo,
        commits: &[String],
    ) -> Result<Vec<String>>;
    
    pub async fn detect_from_branch(
        &self,
        repo: &Repo,
        branch: &str,
        base: &str,
    ) -> Result<Vec<String>>;
}
```

## Changes Module

The `changes` module provides changes analysis and package mapping.

### ChangesAnalyzer

Main changes analysis orchestrator.

```rust
pub struct ChangesAnalyzer {
    // Private fields
}
```

**Methods:**

```rust
impl ChangesAnalyzer {
    pub async fn new(
        workspace_root: PathBuf,
        repo: Repo,
        fs: FileSystemManager,
        config: PackageToolsConfig,
    ) -> Result<Self>;
    
    pub async fn analyze_working_directory(&self) -> Result<ChangesReport>;
    
    pub async fn analyze_commit_range(
        &self,
        from_ref: &str,
        to_ref: &str,
    ) -> Result<ChangesReport>;
    
    pub async fn analyze_with_versions(
        &self,
        from_ref: &str,
        to_ref: &str,
        changeset: &Changeset,
    ) -> Result<ChangesReport>;
}
```

**Example:**
```rust
use sublime_pkg_tools::changes::ChangesAnalyzer;
use sublime_pkg_tools::config::PackageToolsConfig;
use sublime_git_tools::Repo;
use sublime_standard_tools::filesystem::FileSystemManager;
use std::path::PathBuf;

let workspace_root = PathBuf::from(".");
let fs = FileSystemManager::new();
let config = PackageToolsConfig::default();
let git_repo = Repo::open(".")?;

let analyzer = ChangesAnalyzer::new(workspace_root, git_repo, fs, config).await?;

let changes = analyzer.analyze_working_directory().await?;
for package_change in changes.packages {
    println!("Package: {}", package_change.package_name());
    println!("  Files changed: {}", package_change.files.len());
}
```

### PackageMapper

Maps file paths to packages.

```rust
pub struct PackageMapper {
    // Private fields
}
```

**Methods:**

```rust
impl PackageMapper {
    pub async fn new(
        workspace_root: PathBuf,
        fs: FileSystemManager,
    ) -> Result<Self>;
    
    pub fn map_file_to_package(&self, file_path: &Path) -> Option<&PackageInfo>;
    
    pub fn map_files_to_packages(
        &self,
        file_paths: &[PathBuf],
    ) -> HashMap<String, Vec<PathBuf>>;
    
    pub fn get_package(&self, name: &str) -> Option<&PackageInfo>;
    
    pub fn all_packages(&self) -> &[PackageInfo];
}
```

### Report Types

#### `ChangesReport`

```rust
pub struct ChangesReport {
    pub packages: Vec<PackageChanges>,
    pub summary: ChangesSummary,
    pub mode: AnalysisMode,
}
```

#### `PackageChanges`

```rust
pub struct PackageChanges {
    pub name: String,
    pub path: PathBuf,
    pub files: Vec<FileChange>,
    pub commits: Vec<CommitInfo>,
    pub has_changes: bool,
    pub current_version: Option<Version>,
    pub next_version: Option<Version>,
    pub stats: PackageChangeStats,
}
```

**Methods:**

```rust
impl PackageChanges {
    pub fn package_name(&self) -> &str;
    pub fn file_count(&self) -> usize;
    pub fn commit_count(&self) -> usize;
}
```

#### `FileChange`

```rust
pub struct FileChange {
    pub path: PathBuf,
    pub change_type: FileChangeType,
    pub lines_added: usize,
    pub lines_deleted: usize,
}
```

#### `FileChangeType`

```rust
pub enum FileChangeType {
    Added,
    Modified,
    Deleted,
    Renamed { from: PathBuf },
    Copied { from: PathBuf },
}
```

#### `CommitInfo`

```rust
pub struct CommitInfo {
    pub hash: String,
    pub message: String,
    pub author: String,
    pub date: DateTime<Utc>,
}
```

#### `ChangesSummary`

```rust
pub struct ChangesSummary {
    pub total_packages: usize,
    pub packages_with_changes: usize,
    pub total_files_changed: usize,
    pub total_commits: usize,
}
```

#### `PackageChangeStats`

```rust
pub struct PackageChangeStats {
    pub files_added: usize,
    pub files_modified: usize,
    pub files_deleted: usize,
    pub lines_added: usize,
    pub lines_deleted: usize,
}
```

#### `AnalysisMode`

```rust
pub enum AnalysisMode {
    WorkingDirectory,
    CommitRange,
    WithVersions,
}
```

## Changelog Module

The `changelog` module provides changelog generation with multiple format support.

### ChangelogGenerator

Main changelog generation orchestrator.

```rust
pub struct ChangelogGenerator {
    // Private fields
}
```

**Methods:**

```rust
impl ChangelogGenerator {
    pub async fn new(
        workspace_root: PathBuf,
        repo: Repo,
        fs: FileSystemManager,
        config: PackageToolsConfig,
    ) -> Result<Self>;
    
    pub async fn generate_for_version(
        &self,
        package: &str,
        version: &str,
    ) -> Result<GeneratedChangelog>;
    
    pub async fn generate_for_changeset(
        &self,
        changeset: &Changeset,
    ) -> Result<Vec<GeneratedChangelog>>;
    
    pub async fn update_changelog(
        &self,
        package: &str,
        version: &str,
        dry_run: bool,
    ) -> Result<()>;
}
```

**Example:**
```rust
use sublime_pkg_tools::changelog::ChangelogGenerator;
use sublime_pkg_tools::config::PackageToolsConfig;
use sublime_git_tools::Repo;
use sublime_standard_tools::filesystem::FileSystemManager;
use std::path::PathBuf;

let workspace_root = PathBuf::from(".");
let fs = FileSystemManager::new();
let config = PackageToolsConfig::default();
let git_repo = Repo::open(".")?;

let generator = ChangelogGenerator::new(workspace_root, git_repo, fs, config).await?;

let changelog = generator.generate_for_version("my-package", "2.0.0").await?;
println!("{}", changelog.to_markdown());
```

### ChangelogCollector

Collects changelog data from Git commits.

```rust
pub struct ChangelogCollector {
    // Private fields
}
```

**Methods:**

```rust
impl ChangelogCollector {
    pub async fn new(
        workspace_root: PathBuf,
        repo: Repo,
        config: ChangelogConfig,
    ) -> Result<Self>;
    
    pub async fn collect_for_version(
        &self,
        package: &str,
        from_version: Option<&str>,
        to_version: &str,
    ) -> Result<Changelog>;
}
```

### ChangelogParser

Parses existing CHANGELOG.md files.

```rust
pub struct ChangelogParser {
    // Private fields
}
```

**Methods:**

```rust
impl ChangelogParser {
    pub fn new() -> Self;
    pub fn parse(&self, content: &str) -> Result<ParsedChangelog>;
    pub fn parse_file(&self, path: &Path) -> Result<ParsedChangelog>;
}
```

#### `ParsedChangelog`

```rust
pub struct ParsedChangelog {
    pub versions: Vec<ParsedVersion>,
}
```

#### `ParsedVersion`

```rust
pub struct ParsedVersion {
    pub version: String,
    pub date: Option<String>,
    pub sections: HashMap<String, Vec<String>>,
}
```

### Formatters

#### `KeepAChangelogFormatter`

```rust
pub struct KeepAChangelogFormatter;

impl KeepAChangelogFormatter {
    pub fn new() -> Self;
    pub fn format(&self, changelog: &Changelog) -> String;
}
```

#### `ConventionalCommitsFormatter`

```rust
pub struct ConventionalCommitsFormatter;

impl ConventionalCommitsFormatter {
    pub fn new() -> Self;
    pub fn format(&self, changelog: &Changelog) -> String;
}
```

#### `CustomTemplateFormatter`

```rust
pub struct CustomTemplateFormatter {
    // Private fields
}

impl CustomTemplateFormatter {
    pub fn new(template: String) -> Self;
    pub fn format(&self, changelog: &Changelog) -> String;
}
```

### Conventional Commits

#### `ConventionalCommit`

```rust
pub struct ConventionalCommit {
    pub commit_type: String,
    pub scope: Option<String>,
    pub description: String,
    pub body: Option<String>,
    pub footers: Vec<CommitFooter>,
    pub breaking: bool,
}
```

**Methods:**

```rust
impl ConventionalCommit {
    pub fn parse(message: &str) -> Result<Self>;
    pub fn is_breaking(&self) -> bool;
    pub fn section_type(&self) -> SectionType;
}
```

#### `CommitFooter`

```rust
pub struct CommitFooter {
    pub token: String,
    pub value: String,
}
```

#### `SectionType`

```rust
pub enum SectionType {
    Features,
    Fixes,
    Breaking,
    Other(String),
}
```

### Merge Messages

#### `generate_merge_commit_message()`

```rust
pub fn generate_merge_commit_message(
    context: &MergeMessageContext,
) -> Result<String>
```

Generates a merge commit message from changeset information.

#### `MergeMessageContext`

```rust
pub struct MergeMessageContext {
    pub changeset: Changeset,
    pub version_updates: Vec<PackageUpdate>,
    pub changelog_entries: HashMap<String, String>,
}
```

### Types

#### `Changelog`

```rust
pub struct Changelog {
    pub version: String,
    pub date: Option<String>,
    pub sections: Vec<ChangelogSection>,
    pub metadata: ChangelogMetadata,
}
```

#### `ChangelogSection`

```rust
pub struct ChangelogSection {
    pub title: String,
    pub entries: Vec<ChangelogEntry>,
}
```

#### `ChangelogEntry`

```rust
pub struct ChangelogEntry {
    pub message: String,
    pub commit_hash: Option<String>,
    pub author: Option<String>,
}
```

#### `ChangelogMetadata`

```rust
pub struct ChangelogMetadata {
    pub package_name: String,
    pub repository_url: Option<String>,
    pub compare_url: Option<String>,
}
```

#### `GeneratedChangelog`

```rust
pub struct GeneratedChangelog {
    pub package: String,
    pub changelog: Changelog,
    pub markdown: String,
}
```

**Methods:**

```rust
impl GeneratedChangelog {
    pub fn to_markdown(&self) -> &str;
}
```

#### `VersionTag`

```rust
pub struct VersionTag {
    pub tag: String,
    pub version: Version,
    pub commit_hash: String,
}
```

## Upgrade Module

The `upgrade` module provides dependency upgrade detection and application.

### UpgradeManager

Main upgrade management orchestrator.

```rust
pub struct UpgradeManager {
    // Private fields
}
```

**Methods:**

```rust
impl UpgradeManager {
    pub async fn new(
        workspace_root: PathBuf,
        fs: FileSystemManager,
        config: PackageToolsConfig,
    ) -> Result<Self>;
    
    pub async fn detect_upgrades(
        &self,
        options: DetectionOptions,
    ) -> Result<Vec<PackageUpgrades>>;
    
    pub async fn apply_upgrades(
        &self,
        selection: UpgradeSelection,
        dry_run: bool,
    ) -> Result<UpgradeResult>;
    
    pub async fn apply_with_changeset(
        &self,
        selection: UpgradeSelection,
        dry_run: bool,
        changeset_manager: Option<&ChangesetManager>,
    ) -> Result<UpgradeResult>;
    
    pub async fn rollback_last(&self) -> Result<()>;
}
```

**Example:**
```rust
use sublime_pkg_tools::upgrade::{UpgradeManager, DetectionOptions, UpgradeSelection};
use sublime_pkg_tools::config::PackageToolsConfig;
use sublime_standard_tools::filesystem::FileSystemManager;
use std::path::PathBuf;

let workspace_root = PathBuf::from(".");
let fs = FileSystemManager::new();
let config = PackageToolsConfig::default();

let manager = UpgradeManager::new(workspace_root, fs, config).await?;

// Detect upgrades
let options = DetectionOptions::all();
let available = manager.detect_upgrades(options).await?;
println!("Found {} packages with upgrades", available.len());

// Apply patch upgrades
let selection = UpgradeSelection::patch_only();
let result = manager.apply_upgrades(selection, false).await?;
println!("Applied {} upgrades", result.applied.len());
```

### RegistryClient

Client for fetching package metadata from npm registries.

```rust
pub struct RegistryClient {
    // Private fields
}
```

**Methods:**

```rust
impl RegistryClient {
    pub fn new(config: RegistryConfig) -> Self;
    
    pub async fn get_package_metadata(
        &self,
        package_name: &str,
    ) -> Result<PackageMetadata>;
    
    pub async fn get_latest_version(
        &self,
        package_name: &str,
    ) -> Result<String>;
}
```

#### `PackageMetadata`

```rust
pub struct PackageMetadata {
    pub name: String,
    pub versions: HashMap<String, VersionInfo>,
    pub dist_tags: HashMap<String, String>,
    pub repository: Option<RepositoryInfo>,
    pub deprecated: Option<String>,
}
```

#### `VersionInfo`

```rust
pub struct VersionInfo {
    pub version: String,
    pub published_at: DateTime<Utc>,
    pub deprecated: Option<String>,
}
```

#### `RepositoryInfo`

```rust
pub struct RepositoryInfo {
    pub url: String,
    pub repository_type: String,
}
```

#### `UpgradeType`

```rust
pub enum UpgradeType {
    Major,
    Minor,
    Patch,
}
```

#### `NpmrcConfig`

```rust
pub mod npmrc {
    pub struct NpmrcConfig {
        pub registries: HashMap<String, String>,
        pub auth_tokens: HashMap<String, String>,
    }
    
    impl NpmrcConfig {
        pub fn parse_file(path: &Path) -> Result<Self>;
        pub fn parse(content: &str) -> Result<Self>;
    }
}
```

### Detection Functions

#### `detect_upgrades()`

```rust
pub async fn detect_upgrades(
    workspace_root: &Path,
    options: DetectionOptions,
    fs: &FileSystemManager,
) -> Result<Vec<PackageUpgrades>>
```

Detects available upgrades for packages in the workspace.

**Parameters:**
- `workspace_root`: Path to the workspace root
- `options`: Detection options
- `fs`: Filesystem manager

**Returns:**
- `Result<Vec<PackageUpgrades>>`: List of packages with available upgrades

#### `DetectionOptions`

```rust
pub struct DetectionOptions {
    pub include_major: bool,
    pub include_minor: bool,
    pub include_patch: bool,
    pub include_dev_dependencies: bool,
    pub include_peer_dependencies: bool,
    pub packages: Option<Vec<String>>,
}
```

**Methods:**

```rust
impl DetectionOptions {
    pub fn all() -> Self;
    pub fn patch_only() -> Self;
    pub fn minor_and_patch() -> Self;
    pub fn specific_packages(packages: Vec<String>) -> Self;
}
```

#### `PackageUpgrades`

```rust
pub struct PackageUpgrades {
    pub package_name: String,
    pub package_path: PathBuf,
    pub dependencies: Vec<DependencyUpgrade>,
}
```

#### `DependencyUpgrade`

```rust
pub struct DependencyUpgrade {
    pub name: String,
    pub current_version: String,
    pub latest_version: String,
    pub upgrade_type: UpgradeType,
    pub dependency_type: DependencyType,
}
```

#### `UpgradePreview`

```rust
pub struct UpgradePreview {
    pub total_upgrades: usize,
    pub major_upgrades: usize,
    pub minor_upgrades: usize,
    pub patch_upgrades: usize,
}
```

#### `UpgradeSummary`

```rust
pub struct UpgradeSummary {
    pub packages_analyzed: usize,
    pub upgrades_found: usize,
    pub preview: UpgradePreview,
}
```

### Application Functions

#### `apply_upgrades()`

```rust
pub async fn apply_upgrades(
    packages: Vec<PackageUpgrades>,
    selection: UpgradeSelection,
    dry_run: bool,
    fs: &FileSystemManager,
) -> Result<UpgradeResult>
```

Applies selected upgrades to packages.

**Parameters:**
- `packages`: Packages with available upgrades
- `selection`: Upgrade selection criteria
- `dry_run`: Whether to perform a dry run
- `fs`: Filesystem manager

**Returns:**
- `Result<UpgradeResult>`: Result of the upgrade operation

#### `apply_with_changeset()`

```rust
pub async fn apply_with_changeset(
    packages: Vec<PackageUpgrades>,
    selection: UpgradeSelection,
    dry_run: bool,
    workspace_root: &Path,
    config: &UpgradeConfig,
    changeset_manager: Option<&ChangesetManager>,
    fs: &FileSystemManager,
) -> Result<UpgradeResult>
```

Applies upgrades with automatic changeset creation.

#### `UpgradeSelection`

```rust
pub struct UpgradeSelection {
    pub major: bool,
    pub minor: bool,
    pub patch: bool,
    pub packages: Option<Vec<String>>,
    pub dependencies: Option<Vec<String>>,
}
```

**Methods:**

```rust
impl UpgradeSelection {
    pub fn all() -> Self;
    pub fn patch_only() -> Self;
    pub fn minor_and_patch() -> Self;
    pub fn packages(packages: Vec<String>) -> Self;
    pub fn dependencies(dependencies: Vec<String>) -> Self;
}
```

#### `UpgradeResult`

```rust
pub struct UpgradeResult {
    pub applied: Vec<AppliedUpgrade>,
    pub skipped: Vec<DependencyUpgrade>,
    pub failed: Vec<(DependencyUpgrade, String)>,
    pub summary: ApplySummary,
    pub changeset_id: Option<String>,
}
```

#### `AppliedUpgrade`

```rust
pub struct AppliedUpgrade {
    pub package_name: String,
    pub dependency_name: String,
    pub old_version: String,
    pub new_version: String,
    pub upgrade_type: UpgradeType,
}
```

#### `ApplySummary`

```rust
pub struct ApplySummary {
    pub total_applied: usize,
    pub total_skipped: usize,
    pub total_failed: usize,
    pub packages_modified: Vec<String>,
}
```

### BackupManager

Manages backups and rollback for upgrades.

```rust
pub struct BackupManager {
    // Private fields
}
```

**Methods:**

```rust
impl BackupManager {
    pub fn new(workspace_root: PathBuf, config: BackupConfig, fs: FileSystemManager) -> Self;
    
    pub async fn create_backup(&self) -> Result<String>;
    
    pub async fn restore_backup(&self, backup_id: &str) -> Result<()>;
    
    pub async fn list_backups(&self) -> Result<Vec<BackupMetadata>>;
    
    pub async fn cleanup_old_backups(&self) -> Result<usize>;
}
```

#### `BackupMetadata`

```rust
pub struct BackupMetadata {
    pub id: String,
    pub created_at: DateTime<Utc>,
    pub packages: Vec<String>,
    pub size_bytes: u64,
}
```

## Audit Module

The `audit` module provides comprehensive auditing and health scoring.

### AuditManager

Main audit orchestrator.

```rust
pub struct AuditManager {
    // Private fields
}
```

**Methods:**

```rust
impl AuditManager {
    pub async fn new(
        workspace_root: PathBuf,
        config: PackageToolsConfig,
    ) -> Result<Self>;
    
    pub async fn run_audit(&self) -> Result<AuditReport>;
    
    pub async fn run_section(
        &self,
        section: &str,
    ) -> Result<Box<dyn std::any::Any>>;
}
```

**Example:**
```rust
use sublime_pkg_tools::audit::AuditManager;
use sublime_pkg_tools::config::PackageToolsConfig;
use std::path::PathBuf;

let workspace_root = PathBuf::from(".");
let config = PackageToolsConfig::default();

let audit_manager = AuditManager::new(workspace_root, config).await?;
let audit_result = audit_manager.run_audit().await?;

println!("Health score: {:.2}", audit_result.summary.health_score);
println!("Total issues: {}", audit_result.summary.total_issues);
```

### Audit Functions

#### `audit_upgrades()`

```rust
pub async fn audit_upgrades(
    workspace_root: &Path,
    fs: &FileSystemManager,
    config: &AuditConfig,
) -> Result<UpgradeAuditSection>
```

Audits available package upgrades.

#### `audit_dependencies()`

```rust
pub async fn audit_dependencies(
    workspace_root: &Path,
    fs: &FileSystemManager,
    config: &AuditConfig,
) -> Result<DependencyAuditSection>
```

Audits dependency health and issues.

#### `audit_version_consistency()`

```rust
pub async fn audit_version_consistency(
    workspace_root: &Path,
    fs: &FileSystemManager,
    config: &AuditConfig,
) -> Result<VersionConsistencyAuditSection>
```

Audits version consistency across packages.

#### `audit_breaking_changes()`

```rust
pub async fn audit_breaking_changes(
    workspace_root: &Path,
    fs: &FileSystemManager,
    config: &AuditConfig,
) -> Result<BreakingChangesAuditSection>
```

Audits for potential breaking changes.

#### `categorize_dependencies()`

```rust
pub async fn categorize_dependencies(
    workspace_root: &Path,
    fs: &FileSystemManager,
) -> Result<DependencyCategorization>
```

Categorizes dependencies by type.

#### `generate_categorization_issues()`

```rust
pub fn generate_categorization_issues(
    categorization: &DependencyCategorization,
) -> Vec<AuditIssue>
```

Generates issues from dependency categorization.

### Health Score

#### `calculate_health_score()`

```rust
pub fn calculate_health_score(report: &AuditReport) -> f64
```

Calculates overall health score from audit report.

#### `calculate_health_score_detailed()`

```rust
pub fn calculate_health_score_detailed(
    report: &AuditReport,
    weights: &HealthScoreWeights,
) -> HealthScoreBreakdown
```

Calculates detailed health score breakdown.

#### `HealthScoreWeights`

```rust
pub struct HealthScoreWeights {
    pub upgrades_weight: f64,
    pub dependencies_weight: f64,
    pub version_consistency_weight: f64,
    pub breaking_changes_weight: f64,
}
```

**Methods:**

```rust
impl HealthScoreWeights {
    pub fn default() -> Self;
    pub fn balanced() -> Self;
}
```

#### `HealthScoreBreakdown`

```rust
pub struct HealthScoreBreakdown {
    pub overall_score: f64,
    pub upgrades_score: f64,
    pub dependencies_score: f64,
    pub version_consistency_score: f64,
    pub breaking_changes_score: f64,
}
```

#### `calculate_diminishing_factor()`

```rust
pub fn calculate_diminishing_factor(count: usize, severity_multiplier: f64) -> f64
```

Calculates diminishing factor for issue counts.

### Issue Types

#### `AuditIssue`

```rust
pub struct AuditIssue {
    pub category: IssueCategory,
    pub severity: IssueSeverity,
    pub title: String,
    pub description: String,
    pub affected_packages: Vec<String>,
}
```

#### `IssueCategory`

```rust
pub enum IssueCategory {
    Upgrade,
    Dependency,
    VersionConsistency,
    BreakingChange,
    Other(String),
}
```

#### `IssueSeverity`

```rust
pub enum IssueSeverity {
    Critical,
    High,
    Medium,
    Low,
    Info,
}
```

### Report Types

#### `AuditReport`

```rust
pub struct AuditReport {
    pub summary: AuditSummary,
    pub sections: AuditSections,
}
```

**Methods:**

```rust
impl AuditReport {
    pub fn total_issues(&self) -> usize;
    pub fn critical_issues(&self) -> Vec<&AuditIssue>;
    pub fn high_issues(&self) -> Vec<&AuditIssue>;
}
```

#### `AuditSummary`

```rust
pub struct AuditSummary {
    pub total_packages: usize,
    pub total_issues: usize,
    pub critical_issues: usize,
    pub high_issues: usize,
    pub medium_issues: usize,
    pub low_issues: usize,
    pub info_issues: usize,
    pub health_score: f64,
}
```

#### `AuditSections`

```rust
pub struct AuditSections {
    pub upgrades: Option<UpgradeAuditSection>,
    pub dependencies: Option<DependencyAuditSection>,
    pub version_consistency: Option<VersionConsistencyAuditSection>,
    pub breaking_changes: Option<BreakingChangesAuditSection>,
}
```

#### `UpgradeAuditSection`

```rust
pub struct UpgradeAuditSection {
    pub total_upgrades: usize,
    pub major_upgrades: usize,
    pub minor_upgrades: usize,
    pub patch_upgrades: usize,
    pub issues: Vec<AuditIssue>,
}
```

#### `DependencyAuditSection`

```rust
pub struct DependencyAuditSection {
    pub total_dependencies: usize,
    pub circular_dependencies: Vec<Vec<String>>,
    pub missing_dependencies: Vec<String>,
    pub deprecated_packages: Vec<DeprecatedPackage>,
    pub categorization: DependencyCategorization,
    pub issues: Vec<AuditIssue>,
}
```

#### `VersionConsistencyAuditSection`

```rust
pub struct VersionConsistencyAuditSection {
    pub inconsistencies: Vec<VersionInconsistency>,
    pub conflicts: Vec<VersionConflict>,
    pub issues: Vec<AuditIssue>,
}
```

#### `BreakingChangesAuditSection`

```rust
pub struct BreakingChangesAuditSection {
    pub total_breaking_changes: usize,
    pub packages_with_breaking_changes: Vec<PackageBreakingChanges>,
    pub issues: Vec<AuditIssue>,
}
```

#### `DeprecatedPackage`

```rust
pub struct DeprecatedPackage {
    pub name: String,
    pub version: String,
    pub message: Option<String>,
    pub used_by: Vec<String>,
}
```

#### `VersionInconsistency`

```rust
pub struct VersionInconsistency {
    pub dependency_name: String,
    pub versions: Vec<VersionUsage>,
}
```

#### `VersionUsage`

```rust
pub struct VersionUsage {
    pub package_name: String,
    pub version_spec: String,
}
```

#### `VersionConflict`

```rust
pub struct VersionConflict {
    pub dependency_name: String,
    pub package1: String,
    pub version1: String,
    pub package2: String,
    pub version2: String,
}
```

#### `PackageBreakingChanges`

```rust
pub struct PackageBreakingChanges {
    pub package_name: String,
    pub changes: Vec<BreakingChange>,
}
```

#### `BreakingChange`

```rust
pub struct BreakingChange {
    pub description: String,
    pub source: BreakingChangeSource,
    pub from_version: String,
    pub to_version: String,
}
```

#### `BreakingChangeSource`

```rust
pub enum BreakingChangeSource {
    Commit(String),
    Changelog,
    SemverMajor,
}
```

#### `DependencyCategorization`

```rust
pub struct DependencyCategorization {
    pub internal: Vec<InternalPackage>,
    pub external: Vec<ExternalPackage>,
    pub workspace: Vec<WorkspaceLink>,
    pub local: Vec<LocalLink>,
    pub stats: CategorizationStats,
}
```

#### `InternalPackage`

```rust
pub struct InternalPackage {
    pub name: String,
    pub path: PathBuf,
    pub version: String,
}
```

#### `ExternalPackage`

```rust
pub struct ExternalPackage {
    pub name: String,
    pub version: String,
    pub used_by: Vec<String>,
}
```

#### `WorkspaceLink`

```rust
pub struct WorkspaceLink {
    pub name: String,
    pub path: PathBuf,
    pub version_spec: String,
}
```

#### `LocalLink`

```rust
pub struct LocalLink {
    pub name: String,
    pub path: String,
    pub link_type: LocalLinkType,
    pub used_by: Vec<String>,
}
```

#### `CategorizationStats`

```rust
pub struct CategorizationStats {
    pub total_internal: usize,
    pub total_external: usize,
    pub total_workspace: usize,
    pub total_local: usize,
}
```

### Formatters

#### `format_markdown()`

```rust
pub fn format_markdown(report: &AuditReport, options: FormatOptions) -> String
```

Formats audit report as Markdown.

#### `format_json()`

```rust
pub fn format_json(report: &AuditReport) -> Result<String>
```

Formats audit report as JSON.

#### `format_json_compact()`

```rust
pub fn format_json_compact(report: &AuditReport) -> Result<String>
```

Formats audit report as compact JSON.

#### `FormatOptions`

```rust
pub struct FormatOptions {
    pub verbosity: Verbosity,
    pub include_summary: bool,
    pub include_recommendations: bool,
}
```

#### `Verbosity`

```rust
pub enum Verbosity {
    Minimal,
    Normal,
    Detailed,
}
```

#### `AuditReportExt`

Extension trait for formatting audit reports.

```rust
pub trait AuditReportExt {
    fn to_markdown(&self, options: FormatOptions) -> String;
    fn to_json(&self) -> Result<String>;
    fn to_json_compact(&self) -> Result<String>;
}

impl AuditReportExt for AuditReport {
    // Implementation provided
}
```

## Error Module

The `error` module provides comprehensive error handling for all package tools operations.

### Error Types

#### `Error`

Main error type for package tools.

```rust
pub enum Error {
    Config(ConfigError),
    Version(VersionError),
    Changeset(ChangesetError),
    Changes(ChangesError),
    Changelog(ChangelogError),
    Upgrade(UpgradeError),
    Audit(AuditError),
    FileSystem(FileSystemError),
    Git(RepoError),
    IO(std::io::Error),
    Json(serde_json::Error),
}
```

**Methods:**

```rust
impl Error {
    pub fn is_transient(&self) -> bool;
    pub fn filesystem_error(err: FileSystemError) -> Self;
    pub fn git_error(err: RepoError) -> Self;
}
```

**Implements:**
- `Display`: Human-readable error messages
- `std::error::Error`: Standard error trait
- `From<sublime_standard_tools::error::FileSystemError>`
- `From<sublime_git_tools::RepoError>`

#### `ConfigError`

Configuration-related errors.

```rust
pub enum ConfigError {
    NotFound { path: PathBuf },
    ParseError { path: PathBuf, source: Box<dyn std::error::Error> },
    InvalidConfig { message: String },
    ValidationFailed { errors: Vec<String> },
    UnsupportedFormat { format: String },
    Io { source: std::io::Error },
    EnvVarError { var_name: String, reason: String },
    MergeConflict { field: String, reason: String },
}
```

#### `VersionError`

Version resolution errors.

```rust
pub enum VersionError {
    InvalidVersion { version: String },
    ParseError { input: String },
    CircularDependency { cycle: Vec<String> },
    DependencyNotFound { package: String, dependency: String },
    PropagationFailed { reason: String },
    SnapshotGenerationFailed { reason: String },
    ApplicationFailed { package: String, reason: String },
}
```

#### `ChangesetError`

Changeset management errors.

```rust
pub enum ChangesetError {
    NotFound { branch: String },
    AlreadyExists { branch: String },
    InvalidChangeset { reason: String },
    StorageError { operation: String, reason: String },
    GitIntegrationFailed { reason: String },
    ArchiveFailed { changeset_id: String, reason: String },
}
```

#### `ChangesError`

Changes analysis errors.

```rust
pub enum ChangesError {
    AnalysisFailed { reason: String },
    MappingFailed { file: PathBuf, reason: String },
    GitError { source: RepoError },
    PackageNotFound { path: PathBuf },
}
```

#### `ChangelogError`

Changelog generation errors.

```rust
pub enum ChangelogError {
    GenerationFailed { package: String, reason: String },
    ParseError { path: PathBuf, reason: String },
    FormatError { format: String, reason: String },
    ConventionalCommitParseError { commit: String, reason: String },
    GitError { source: RepoError },
}
```

#### `UpgradeError`

Upgrade detection and application errors.

```rust
pub enum UpgradeError {
    DetectionFailed { reason: String },
    RegistryError { package: String, reason: String },
    ApplicationFailed { package: String, dependency: String, reason: String },
    BackupFailed { reason: String },
    RollbackFailed { backup_id: String, reason: String },
    NpmrcParseError { path: PathBuf, reason: String },
}
```

#### `AuditError`

Audit and health check errors.

```rust
pub enum AuditError {
    AuditFailed { section: String, reason: String },
    HealthScoreCalculationFailed { reason: String },
    ReportGenerationFailed { reason: String },
}
```

### Result Types

Type aliases for results with specific error types.

```rust
pub type Result<T> = std::result::Result<T, Error>;
pub type ConfigResult<T> = std::result::Result<T, ConfigError>;
pub type VersionResult<T> = std::result::Result<T, VersionError>;
pub type ChangesetResult<T> = std::result::Result<T, ChangesetError>;
pub type ChangesResult<T> = std::result::Result<T, ChangesError>;
pub type ChangelogResult<T> = std::result::Result<T, ChangelogError>;
pub type UpgradeResult<T> = std::result::Result<T, UpgradeError>;
pub type AuditResult<T> = std::result::Result<T, AuditError>;
```

### Context Extension Trait

The `context` submodule provides context extension for errors:

```rust
pub mod context {
    pub trait ErrorContext<T, E> {
        fn with_context<C>(self, context: C) -> Result<T>
        where
            C: std::fmt::Display + Send + Sync + 'static;
        
        fn with_context_f<C, F>(self, f: F) -> Result<T>
        where
            C: std::fmt::Display + Send + Sync + 'static,
            F: FnOnce() -> C;
    }
    
    impl<T, E> ErrorContext<T, E> for std::result::Result<T, E>
    where
        E: std::error::Error + Send + Sync + 'static,
    {
        // Implementation provided
    }
}
```

### Recovery Extension

The `recovery` submodule provides error recovery utilities:

```rust
pub mod recovery {
    pub trait ErrorRecovery<T> {
        fn or_recover<F>(self, f: F) -> Result<T>
        where
            F: FnOnce(Error) -> Result<T>;
    }
    
    impl<T> ErrorRecovery<T> for Result<T> {
        // Implementation provided
    }
}
```

## Examples

### Complete Workflow Example

```rust
use sublime_pkg_tools::{
    config::load_config,
    changeset::ChangesetManager,
    version::VersionResolver,
    changelog::ChangelogGenerator,
    types::{Changeset, VersionBump},
};
use sublime_standard_tools::filesystem::FileSystemManager;
use sublime_git_tools::Repo;
use std::path::PathBuf;

async fn complete_workflow() -> Result<(), Box<dyn std::error::Error>> {
    let workspace_root = PathBuf::from(".");
    
    // Load configuration
    let config = load_config(&workspace_root).await?;
    
    // Initialize managers
    let fs = FileSystemManager::new();
    let git_repo = Repo::open(".")?;
    
    let changeset_manager = ChangesetManager::new(
        workspace_root.clone(),
        fs.clone(),
        config.clone(),
    ).await?;
    
    let version_resolver = VersionResolver::new(
        workspace_root.clone(),
        config.clone(),
    ).await?;
    
    let changelog_generator = ChangelogGenerator::new(
        workspace_root.clone(),
        git_repo,
        fs.clone(),
        config.clone(),
    ).await?;
    
    // Create changeset
    let changeset = changeset_manager.create(
        "feature/new-api",
        VersionBump::Minor,
        vec!["production".to_string()],
    ).await?;
    
    // Add commits from Git
    let summary = changeset_manager.add_commits_from_git("feature/new-api").await?;
    println!("Added {} commits affecting {} packages",
        summary.commits_added,
        summary.new_packages.len()
    );
    
    // Resolve versions
    let resolution = version_resolver.resolve_versions(&changeset).await?;
    for update in &resolution.updates {
        println!("{}: {} -> {}",
            update.name,
            update.current_version,
            update.next_version
        );
    }
    
    // Apply versions
    let result = version_resolver.apply_versions(&changeset, false).await?;
    println!("Updated {} packages", result.summary.packages_updated);
    
    // Generate changelogs
    let changelogs = changelog_generator.generate_for_changeset(&changeset).await?;
    for cl in changelogs {
        println!("Generated changelog for {}", cl.package);
    }
    
    Ok(())
}
```

### Upgrade Workflow Example

```rust
use sublime_pkg_tools::{
    upgrade::{UpgradeManager, DetectionOptions, UpgradeSelection},
    config::load_config,
};
use sublime_standard_tools::filesystem::FileSystemManager;
use std::path::PathBuf;

async fn upgrade_workflow() -> Result<(), Box<dyn std::error::Error>> {
    let workspace_root = PathBuf::from(".");
    let config = load_config(&workspace_root).await?;
    let fs = FileSystemManager::new();
    
    let manager = UpgradeManager::new(
        workspace_root,
        fs,
        config,
    ).await?;
    
    // Detect all available upgrades
    let options = DetectionOptions::all();
    let available = manager.detect_upgrades(options).await?;
    
    println!("Found upgrades for {} packages", available.len());
    for pkg in &available {
        println!("  {}: {} dependencies can be upgraded",
            pkg.package_name,
            pkg.dependencies.len()
        );
    }
    
    // Apply only patch upgrades
    let selection = UpgradeSelection::patch_only();
    let result = manager.apply_upgrades(selection, false).await?;
    
    println!("Applied {} upgrades", result.applied.len());
    if !result.failed.is_empty() {
        println!("Failed to apply {} upgrades", result.failed.len());
    }
    
    Ok(())
}
```

### Audit Workflow Example

```rust
use sublime_pkg_tools::{
    audit::{AuditManager, format_markdown, FormatOptions, Verbosity},
    config::load_config,
};
use std::path::PathBuf;

async fn audit_workflow() -> Result<(), Box<dyn std::error::Error>> {
    let workspace_root = PathBuf::from(".");
    let config = load_config(&workspace_root).await?;
    
    let manager = AuditManager::new(workspace_root, config).await?;
    
    // Run full audit
    let report = manager.run_audit().await?;
    
    println!("Health Score: {:.2}/100", report.summary.health_score);
    println!("Total Issues: {}", report.summary.total_issues);
    println!("  Critical: {}", report.summary.critical_issues);
    println!("  High: {}", report.summary.high_issues);
    println!("  Medium: {}", report.summary.medium_issues);
    
    // Format as markdown
    let options = FormatOptions {
        verbosity: Verbosity::Detailed,
        include_summary: true,
        include_recommendations: true,
    };
    let markdown = format_markdown(&report, options);
    println!("\n{}", markdown);
    
    Ok(())
}
```

## Version History

### Version 0.1.0 (Initial Release)

Initial release with core functionality:
- Configuration management
- Type system and data structures
- Version resolution and dependency propagation
- Changeset management and storage
- Changes analysis and package mapping
- Changelog generation with multiple formats
- Dependency upgrade detection and application
- Comprehensive audit and health scoring
- Full error handling and recovery