@teamix-evo/registry 0.7.0 → 0.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -942,6 +942,38 @@ declare const TokensPackLinkedSchema: z.ZodObject<{
942
942
  templates?: string | undefined;
943
943
  'biz-ui'?: string | undefined;
944
944
  }>;
945
+ /**
946
+ * One entry in a variant's `renames` log — declares that a token was
947
+ * renamed at the given upstream variant version. Consumed by
948
+ * `teamix-evo update` (writes `.teamix-evo/.upgrade-hints/tokens-<ts>.json`)
949
+ * and the future `teamix-evo-upgrade` skill (suggests codemods, never
950
+ * auto-rewrites — frozen boundary, [ADR 0019](../../../../docs/adr/0019-project-upgrade-flow.md) §D4).
951
+ *
952
+ * Semantics: as of `sinceVersion`, every CSS custom property reference of
953
+ * `from` should be migrated to `to`. Older snapshots may still mention
954
+ * `from` legitimately.
955
+ */
956
+ declare const TokenRenameEntrySchema: z.ZodObject<{
957
+ /** Variant version at which the rename took effect (semver). */
958
+ sinceVersion: z.ZodString;
959
+ /** Old token name (with or without leading `--`; both forms accepted). */
960
+ from: z.ZodString;
961
+ /** New token name. */
962
+ to: z.ZodString;
963
+ /** Optional one-liner rationale surfaced in the upgrade-hints file. */
964
+ description: z.ZodOptional<z.ZodString>;
965
+ }, "strip", z.ZodTypeAny, {
966
+ sinceVersion: string;
967
+ from: string;
968
+ to: string;
969
+ description?: string | undefined;
970
+ }, {
971
+ sinceVersion: string;
972
+ from: string;
973
+ to: string;
974
+ description?: string | undefined;
975
+ }>;
976
+ type TokenRenameEntry = z.infer<typeof TokenRenameEntrySchema>;
945
977
  /**
946
978
  * One variant entry in the top-level catalog.
947
979
  */
@@ -971,6 +1003,30 @@ declare const TokensVariantEntrySchema: z.ZodObject<{
971
1003
  templates?: string | undefined;
972
1004
  'biz-ui'?: string | undefined;
973
1005
  }>>;
1006
+ /**
1007
+ * Token rename log accumulated across this variant's version history.
1008
+ * Empty / absent when the variant has never renamed a token.
1009
+ */
1010
+ renames: z.ZodOptional<z.ZodArray<z.ZodObject<{
1011
+ /** Variant version at which the rename took effect (semver). */
1012
+ sinceVersion: z.ZodString;
1013
+ /** Old token name (with or without leading `--`; both forms accepted). */
1014
+ from: z.ZodString;
1015
+ /** New token name. */
1016
+ to: z.ZodString;
1017
+ /** Optional one-liner rationale surfaced in the upgrade-hints file. */
1018
+ description: z.ZodOptional<z.ZodString>;
1019
+ }, "strip", z.ZodTypeAny, {
1020
+ sinceVersion: string;
1021
+ from: string;
1022
+ to: string;
1023
+ description?: string | undefined;
1024
+ }, {
1025
+ sinceVersion: string;
1026
+ from: string;
1027
+ to: string;
1028
+ description?: string | undefined;
1029
+ }>, "many">>;
974
1030
  }, "strip", z.ZodTypeAny, {
975
1031
  displayName: string;
976
1032
  version: string;
@@ -981,6 +1037,12 @@ declare const TokensVariantEntrySchema: z.ZodObject<{
981
1037
  templates?: string | undefined;
982
1038
  'biz-ui'?: string | undefined;
983
1039
  } | undefined;
1040
+ renames?: {
1041
+ sinceVersion: string;
1042
+ from: string;
1043
+ to: string;
1044
+ description?: string | undefined;
1045
+ }[] | undefined;
984
1046
  }, {
985
1047
  displayName: string;
986
1048
  version: string;
@@ -991,6 +1053,12 @@ declare const TokensVariantEntrySchema: z.ZodObject<{
991
1053
  templates?: string | undefined;
992
1054
  'biz-ui'?: string | undefined;
993
1055
  } | undefined;
1056
+ renames?: {
1057
+ sinceVersion: string;
1058
+ from: string;
1059
+ to: string;
1060
+ description?: string | undefined;
1061
+ }[] | undefined;
994
1062
  }>;
995
1063
  type TokensVariantEntry = z.infer<typeof TokensVariantEntrySchema>;
996
1064
  type TokensPackLinked = z.infer<typeof TokensPackLinkedSchema>;
@@ -1046,6 +1114,30 @@ declare const TokensPackageManifestSchema: z.ZodObject<{
1046
1114
  templates?: string | undefined;
1047
1115
  'biz-ui'?: string | undefined;
1048
1116
  }>>;
1117
+ /**
1118
+ * Token rename log accumulated across this variant's version history.
1119
+ * Empty / absent when the variant has never renamed a token.
1120
+ */
1121
+ renames: z.ZodOptional<z.ZodArray<z.ZodObject<{
1122
+ /** Variant version at which the rename took effect (semver). */
1123
+ sinceVersion: z.ZodString;
1124
+ /** Old token name (with or without leading `--`; both forms accepted). */
1125
+ from: z.ZodString;
1126
+ /** New token name. */
1127
+ to: z.ZodString;
1128
+ /** Optional one-liner rationale surfaced in the upgrade-hints file. */
1129
+ description: z.ZodOptional<z.ZodString>;
1130
+ }, "strip", z.ZodTypeAny, {
1131
+ sinceVersion: string;
1132
+ from: string;
1133
+ to: string;
1134
+ description?: string | undefined;
1135
+ }, {
1136
+ sinceVersion: string;
1137
+ from: string;
1138
+ to: string;
1139
+ description?: string | undefined;
1140
+ }>, "many">>;
1049
1141
  }, "strip", z.ZodTypeAny, {
1050
1142
  displayName: string;
1051
1143
  version: string;
@@ -1056,6 +1148,12 @@ declare const TokensPackageManifestSchema: z.ZodObject<{
1056
1148
  templates?: string | undefined;
1057
1149
  'biz-ui'?: string | undefined;
1058
1150
  } | undefined;
1151
+ renames?: {
1152
+ sinceVersion: string;
1153
+ from: string;
1154
+ to: string;
1155
+ description?: string | undefined;
1156
+ }[] | undefined;
1059
1157
  }, {
1060
1158
  displayName: string;
1061
1159
  version: string;
@@ -1066,6 +1164,12 @@ declare const TokensPackageManifestSchema: z.ZodObject<{
1066
1164
  templates?: string | undefined;
1067
1165
  'biz-ui'?: string | undefined;
1068
1166
  } | undefined;
1167
+ renames?: {
1168
+ sinceVersion: string;
1169
+ from: string;
1170
+ to: string;
1171
+ description?: string | undefined;
1172
+ }[] | undefined;
1069
1173
  }>, "many">;
1070
1174
  /**
1071
1175
  * Reserved for future shared assets that span variants (e.g. browser
@@ -1089,6 +1193,12 @@ declare const TokensPackageManifestSchema: z.ZodObject<{
1089
1193
  templates?: string | undefined;
1090
1194
  'biz-ui'?: string | undefined;
1091
1195
  } | undefined;
1196
+ renames?: {
1197
+ sinceVersion: string;
1198
+ from: string;
1199
+ to: string;
1200
+ description?: string | undefined;
1201
+ }[] | undefined;
1092
1202
  }[];
1093
1203
  $schema?: string | undefined;
1094
1204
  description?: string | undefined;
@@ -1110,6 +1220,12 @@ declare const TokensPackageManifestSchema: z.ZodObject<{
1110
1220
  templates?: string | undefined;
1111
1221
  'biz-ui'?: string | undefined;
1112
1222
  } | undefined;
1223
+ renames?: {
1224
+ sinceVersion: string;
1225
+ from: string;
1226
+ to: string;
1227
+ description?: string | undefined;
1228
+ }[] | undefined;
1113
1229
  }[];
1114
1230
  $schema?: string | undefined;
1115
1231
  description?: string | undefined;
@@ -1622,9 +1738,59 @@ declare const PackageEntrySchema: z.ZodObject<{
1622
1738
  rsc?: boolean | undefined;
1623
1739
  }>;
1624
1740
  /**
1625
- * Project configuration schemateamix-evo config.json at project root.
1741
+ * Token rename recordcaptures a single variant-switch's token mapping so
1742
+ * downstream codemod skills can rewrite consumer code (ADR 0019 §recovery).
1743
+ */
1744
+ declare const TokenRenameRecordSchema: z.ZodObject<{
1745
+ /** ISO-8601 UTC timestamp at which the variant switch was performed. */
1746
+ ts: z.ZodString;
1747
+ /** Variant the project was on before the switch. */
1748
+ fromVariant: z.ZodString;
1749
+ /** Variant the project switched to. */
1750
+ toVariant: z.ZodString;
1751
+ /**
1752
+ * Token rename mapping — old token name → new token name.
1753
+ * Empty object is legal (e.g. switch with zero rename).
1754
+ */
1755
+ renames: z.ZodRecord<z.ZodString, z.ZodString>;
1756
+ }, "strip", z.ZodTypeAny, {
1757
+ renames: Record<string, string>;
1758
+ ts: string;
1759
+ fromVariant: string;
1760
+ toVariant: string;
1761
+ }, {
1762
+ renames: Record<string, string>;
1763
+ ts: string;
1764
+ fromVariant: string;
1765
+ toVariant: string;
1766
+ }>;
1767
+ /**
1768
+ * Last successful update record per package — set by `teamix-evo update`
1769
+ * after a non-critical / critical step succeeds. Used by `restore` to point
1770
+ * users at the right snapshot, and by `doctor` to flag staleness.
1771
+ */
1772
+ declare const LastUpdateRecordSchema: z.ZodObject<{
1773
+ /** ISO-8601 UTC timestamp of the last successful update. */
1774
+ ts: z.ZodString;
1775
+ /** Version the package was on before this update. */
1776
+ fromVersion: z.ZodString;
1777
+ /** Version the package was on after this update. */
1778
+ toVersion: z.ZodString;
1779
+ }, "strip", z.ZodTypeAny, {
1780
+ ts: string;
1781
+ fromVersion: string;
1782
+ toVersion: string;
1783
+ }, {
1784
+ ts: string;
1785
+ fromVersion: string;
1786
+ toVersion: string;
1787
+ }>;
1788
+ /**
1789
+ * Project configuration schema v1 — the original shape shipped through v0.x.
1790
+ * Retained so existing `config.json` files keep validating; the top-level
1791
+ * `ProjectConfigSchema` transforms v1 into v2 transparently for callers.
1626
1792
  */
1627
- declare const ProjectConfigSchema: z.ZodObject<{
1793
+ declare const ProjectConfigV1Schema: z.ZodObject<{
1628
1794
  $schema: z.ZodOptional<z.ZodString>;
1629
1795
  schemaVersion: z.ZodLiteral<1>;
1630
1796
  /** IDE identifier */
@@ -1755,116 +1921,783 @@ declare const ProjectConfigSchema: z.ZodObject<{
1755
1921
  }>;
1756
1922
  $schema?: string | undefined;
1757
1923
  }>;
1758
-
1759
1924
  /**
1760
- * An installed resource entrytracks individual resource installation state.
1925
+ * Project configuration schema v2adds failure-recovery / variant-switch
1926
+ * tracking fields per [ADR 0019](../../../../docs/adr/0019-project-upgrade-flow.md):
1761
1927
  *
1762
- * For type="skill" resources, the same logical skill may produce multiple installed
1763
- * entries (one per ide × scope combination); the optional `ide`/`scope` fields
1764
- * disambiguate them.
1765
- */
1766
- declare const InstalledResourceSchema: z.ZodObject<{
1767
- /** Resource identifier matching the variant manifest */
1768
- id: z.ZodString;
1769
- /** Target path where the resource was installed (absolute or project-relative) */
1770
- target: z.ZodString;
1771
- /** Content hash for change detection (e.g. "sha256:...") */
1772
- hash: z.ZodString;
1773
- /** Update strategy that was applied */
1774
- strategy: z.ZodEnum<["frozen", "regenerable", "managed"]>;
1775
- /** IDE this resource was installed for (skill resources only) */
1776
- ide: z.ZodOptional<z.ZodEnum<["qoder", "claude"]>>;
1777
- /** Install scope (skill resources only) */
1778
- scope: z.ZodOptional<z.ZodEnum<["project", "global"]>>;
1779
- }, "strip", z.ZodTypeAny, {
1780
- id: string;
1781
- target: string;
1782
- hash: string;
1783
- strategy: "frozen" | "regenerable" | "managed";
1784
- scope?: "project" | "global" | undefined;
1785
- ide?: "qoder" | "claude" | undefined;
1786
- }, {
1787
- id: string;
1788
- target: string;
1789
- hash: string;
1790
- strategy: "frozen" | "regenerable" | "managed";
1791
- scope?: "project" | "global" | undefined;
1792
- ide?: "qoder" | "claude" | undefined;
1793
- }>;
1794
- /**
1795
- * An installed package entry — tracks a single package installation.
1928
+ * - `priorVariant` — variant in effect before the most recent switch.
1929
+ * - `lastUpdate` — per-package successful update record.
1930
+ * - `tokenRenameHistory` — accumulated rename log across switches.
1931
+ *
1932
+ * All new fields are optional so a freshly-migrated v1 config (no recovery
1933
+ * history yet) is a legal v2 document.
1796
1934
  */
1797
- declare const InstalledPackageSchema: z.ZodObject<{
1798
- /** Full package name (e.g. "@teamix-evo/tokens") */
1799
- package: z.ZodString;
1800
- /** Variant identifier (use "_flat" for non-variant packages such as skills) */
1801
- variant: z.ZodString;
1802
- /** Installed version */
1803
- version: z.ZodString;
1804
- /** ISO 8601 timestamp of installation */
1805
- installedAt: z.ZodString;
1806
- /** List of installed resources */
1807
- resources: z.ZodArray<z.ZodObject<{
1808
- /** Resource identifier matching the variant manifest */
1809
- id: z.ZodString;
1810
- /** Target path where the resource was installed (absolute or project-relative) */
1811
- target: z.ZodString;
1812
- /** Content hash for change detection (e.g. "sha256:...") */
1813
- hash: z.ZodString;
1814
- /** Update strategy that was applied */
1815
- strategy: z.ZodEnum<["frozen", "regenerable", "managed"]>;
1816
- /** IDE this resource was installed for (skill resources only) */
1817
- ide: z.ZodOptional<z.ZodEnum<["qoder", "claude"]>>;
1818
- /** Install scope (skill resources only) */
1935
+ declare const ProjectConfigV2Schema: z.ZodObject<{
1936
+ $schema: z.ZodOptional<z.ZodString>;
1937
+ schemaVersion: z.ZodLiteral<2>;
1938
+ /** IDE identifier */
1939
+ ide: z.ZodString;
1940
+ /** Installed packages keyed by package name */
1941
+ packages: z.ZodRecord<z.ZodString, z.ZodObject<{
1942
+ /** Variant identifier (e.g. "opentrek"; use "_flat" for skills/ui) */
1943
+ variant: z.ZodString;
1944
+ /** Semver version string */
1945
+ version: z.ZodString;
1946
+ /** Tailwind CSS version this project uses (only meaningful for design package). */
1947
+ tailwind: z.ZodOptional<z.ZodLiteral<"v4">>;
1948
+ /** IDEs this package was installed for (only meaningful for skills package). */
1949
+ ides: z.ZodOptional<z.ZodArray<z.ZodEnum<["qoder", "claude"]>, "many">>;
1950
+ /** Install scope (only meaningful for skills package). */
1819
1951
  scope: z.ZodOptional<z.ZodEnum<["project", "global"]>>;
1952
+ /** Path aliases for ui entry installation (only meaningful for ui package). */
1953
+ aliases: z.ZodOptional<z.ZodObject<{
1954
+ components: z.ZodString;
1955
+ hooks: z.ZodString;
1956
+ utils: z.ZodString;
1957
+ lib: z.ZodString;
1958
+ /** Biz-ui components (variant-bound). Defaults to `src/components/business/`. */
1959
+ business: z.ZodDefault<z.ZodString>;
1960
+ /** Page templates (variant-bound). Defaults to `src/templates/`. */
1961
+ templates: z.ZodDefault<z.ZodString>;
1962
+ }, "strip", z.ZodTypeAny, {
1963
+ components: string;
1964
+ hooks: string;
1965
+ utils: string;
1966
+ lib: string;
1967
+ business: string;
1968
+ templates: string;
1969
+ }, {
1970
+ components: string;
1971
+ hooks: string;
1972
+ utils: string;
1973
+ lib: string;
1974
+ business?: string | undefined;
1975
+ templates?: string | undefined;
1976
+ }>>;
1977
+ /**
1978
+ * Default icon library declared by the project (only meaningful for ui).
1979
+ * Declarative only — does NOT trigger code rewrites; ui entries hardcode imports.
1980
+ */
1981
+ iconLibrary: z.ZodOptional<z.ZodString>;
1982
+ /** Whether the project uses TSX (true) or JSX (false). ui-specific. */
1983
+ tsx: z.ZodOptional<z.ZodBoolean>;
1984
+ /** Whether to emit React Server Components markers (`"use client"`). ui-specific. */
1985
+ rsc: z.ZodOptional<z.ZodBoolean>;
1820
1986
  }, "strip", z.ZodTypeAny, {
1821
- id: string;
1822
- target: string;
1823
- hash: string;
1824
- strategy: "frozen" | "regenerable" | "managed";
1987
+ variant: string;
1988
+ version: string;
1989
+ ides?: ("qoder" | "claude")[] | undefined;
1825
1990
  scope?: "project" | "global" | undefined;
1826
- ide?: "qoder" | "claude" | undefined;
1991
+ tailwind?: "v4" | undefined;
1992
+ aliases?: {
1993
+ components: string;
1994
+ hooks: string;
1995
+ utils: string;
1996
+ lib: string;
1997
+ business: string;
1998
+ templates: string;
1999
+ } | undefined;
2000
+ iconLibrary?: string | undefined;
2001
+ tsx?: boolean | undefined;
2002
+ rsc?: boolean | undefined;
1827
2003
  }, {
1828
- id: string;
1829
- target: string;
1830
- hash: string;
1831
- strategy: "frozen" | "regenerable" | "managed";
2004
+ variant: string;
2005
+ version: string;
2006
+ ides?: ("qoder" | "claude")[] | undefined;
1832
2007
  scope?: "project" | "global" | undefined;
1833
- ide?: "qoder" | "claude" | undefined;
1834
- }>, "many">;
2008
+ tailwind?: "v4" | undefined;
2009
+ aliases?: {
2010
+ components: string;
2011
+ hooks: string;
2012
+ utils: string;
2013
+ lib: string;
2014
+ business?: string | undefined;
2015
+ templates?: string | undefined;
2016
+ } | undefined;
2017
+ iconLibrary?: string | undefined;
2018
+ tsx?: boolean | undefined;
2019
+ rsc?: boolean | undefined;
2020
+ }>>;
2021
+ /** Variant in effect before the most recent `variant switch`, if any. */
2022
+ priorVariant: z.ZodOptional<z.ZodString>;
2023
+ /** Last successful update record keyed by package name. */
2024
+ lastUpdate: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
2025
+ /** ISO-8601 UTC timestamp of the last successful update. */
2026
+ ts: z.ZodString;
2027
+ /** Version the package was on before this update. */
2028
+ fromVersion: z.ZodString;
2029
+ /** Version the package was on after this update. */
2030
+ toVersion: z.ZodString;
2031
+ }, "strip", z.ZodTypeAny, {
2032
+ ts: string;
2033
+ fromVersion: string;
2034
+ toVersion: string;
2035
+ }, {
2036
+ ts: string;
2037
+ fromVersion: string;
2038
+ toVersion: string;
2039
+ }>>>;
2040
+ /** Token rename log accumulated across variant switches (oldest → newest). */
2041
+ tokenRenameHistory: z.ZodOptional<z.ZodArray<z.ZodObject<{
2042
+ /** ISO-8601 UTC timestamp at which the variant switch was performed. */
2043
+ ts: z.ZodString;
2044
+ /** Variant the project was on before the switch. */
2045
+ fromVariant: z.ZodString;
2046
+ /** Variant the project switched to. */
2047
+ toVariant: z.ZodString;
2048
+ /**
2049
+ * Token rename mapping — old token name → new token name.
2050
+ * Empty object is legal (e.g. switch with zero rename).
2051
+ */
2052
+ renames: z.ZodRecord<z.ZodString, z.ZodString>;
2053
+ }, "strip", z.ZodTypeAny, {
2054
+ renames: Record<string, string>;
2055
+ ts: string;
2056
+ fromVariant: string;
2057
+ toVariant: string;
2058
+ }, {
2059
+ renames: Record<string, string>;
2060
+ ts: string;
2061
+ fromVariant: string;
2062
+ toVariant: string;
2063
+ }>, "many">>;
1835
2064
  }, "strip", z.ZodTypeAny, {
1836
- package: string;
1837
- variant: string;
1838
- version: string;
1839
- resources: {
1840
- id: string;
1841
- target: string;
1842
- hash: string;
1843
- strategy: "frozen" | "regenerable" | "managed";
2065
+ schemaVersion: 2;
2066
+ ide: string;
2067
+ packages: Record<string, {
2068
+ variant: string;
2069
+ version: string;
2070
+ ides?: ("qoder" | "claude")[] | undefined;
1844
2071
  scope?: "project" | "global" | undefined;
1845
- ide?: "qoder" | "claude" | undefined;
1846
- }[];
1847
- installedAt: string;
2072
+ tailwind?: "v4" | undefined;
2073
+ aliases?: {
2074
+ components: string;
2075
+ hooks: string;
2076
+ utils: string;
2077
+ lib: string;
2078
+ business: string;
2079
+ templates: string;
2080
+ } | undefined;
2081
+ iconLibrary?: string | undefined;
2082
+ tsx?: boolean | undefined;
2083
+ rsc?: boolean | undefined;
2084
+ }>;
2085
+ $schema?: string | undefined;
2086
+ priorVariant?: string | undefined;
2087
+ lastUpdate?: Record<string, {
2088
+ ts: string;
2089
+ fromVersion: string;
2090
+ toVersion: string;
2091
+ }> | undefined;
2092
+ tokenRenameHistory?: {
2093
+ renames: Record<string, string>;
2094
+ ts: string;
2095
+ fromVariant: string;
2096
+ toVariant: string;
2097
+ }[] | undefined;
1848
2098
  }, {
1849
- package: string;
1850
- variant: string;
1851
- version: string;
1852
- resources: {
1853
- id: string;
1854
- target: string;
1855
- hash: string;
1856
- strategy: "frozen" | "regenerable" | "managed";
2099
+ schemaVersion: 2;
2100
+ ide: string;
2101
+ packages: Record<string, {
2102
+ variant: string;
2103
+ version: string;
2104
+ ides?: ("qoder" | "claude")[] | undefined;
1857
2105
  scope?: "project" | "global" | undefined;
1858
- ide?: "qoder" | "claude" | undefined;
1859
- }[];
1860
- installedAt: string;
1861
- }>;
1862
- /**
1863
- * Installed manifest schema — tracks all installed packages in a project.
1864
- * Stored at `.teamix-evo/manifest.json`.
1865
- */
1866
- declare const InstalledManifestSchema: z.ZodObject<{
1867
- schemaVersion: z.ZodLiteral<1>;
2106
+ tailwind?: "v4" | undefined;
2107
+ aliases?: {
2108
+ components: string;
2109
+ hooks: string;
2110
+ utils: string;
2111
+ lib: string;
2112
+ business?: string | undefined;
2113
+ templates?: string | undefined;
2114
+ } | undefined;
2115
+ iconLibrary?: string | undefined;
2116
+ tsx?: boolean | undefined;
2117
+ rsc?: boolean | undefined;
2118
+ }>;
2119
+ $schema?: string | undefined;
2120
+ priorVariant?: string | undefined;
2121
+ lastUpdate?: Record<string, {
2122
+ ts: string;
2123
+ fromVersion: string;
2124
+ toVersion: string;
2125
+ }> | undefined;
2126
+ tokenRenameHistory?: {
2127
+ renames: Record<string, string>;
2128
+ ts: string;
2129
+ fromVariant: string;
2130
+ toVariant: string;
2131
+ }[] | undefined;
2132
+ }>;
2133
+ /**
2134
+ * Project configuration schema — teamix-evo config.json at project root.
2135
+ *
2136
+ * Accepts both v1 and v2 input documents and transforms v1 → v2 transparently,
2137
+ * so consumers always observe a v2-shaped object. Writers (`writeProjectConfig`)
2138
+ * therefore always emit `schemaVersion: 2`; legacy v1 files on disk are
2139
+ * silently upgraded the next time they're read and re-written.
2140
+ */
2141
+ declare const ProjectConfigSchema: z.ZodEffects<z.ZodDiscriminatedUnion<"schemaVersion", [z.ZodObject<{
2142
+ $schema: z.ZodOptional<z.ZodString>;
2143
+ schemaVersion: z.ZodLiteral<1>;
2144
+ /** IDE identifier */
2145
+ ide: z.ZodString;
2146
+ /** Installed packages keyed by package name */
2147
+ packages: z.ZodRecord<z.ZodString, z.ZodObject<{
2148
+ /** Variant identifier (e.g. "opentrek"; use "_flat" for skills/ui) */
2149
+ variant: z.ZodString;
2150
+ /** Semver version string */
2151
+ version: z.ZodString;
2152
+ /** Tailwind CSS version this project uses (only meaningful for design package). */
2153
+ tailwind: z.ZodOptional<z.ZodLiteral<"v4">>;
2154
+ /** IDEs this package was installed for (only meaningful for skills package). */
2155
+ ides: z.ZodOptional<z.ZodArray<z.ZodEnum<["qoder", "claude"]>, "many">>;
2156
+ /** Install scope (only meaningful for skills package). */
2157
+ scope: z.ZodOptional<z.ZodEnum<["project", "global"]>>;
2158
+ /** Path aliases for ui entry installation (only meaningful for ui package). */
2159
+ aliases: z.ZodOptional<z.ZodObject<{
2160
+ components: z.ZodString;
2161
+ hooks: z.ZodString;
2162
+ utils: z.ZodString;
2163
+ lib: z.ZodString;
2164
+ /** Biz-ui components (variant-bound). Defaults to `src/components/business/`. */
2165
+ business: z.ZodDefault<z.ZodString>;
2166
+ /** Page templates (variant-bound). Defaults to `src/templates/`. */
2167
+ templates: z.ZodDefault<z.ZodString>;
2168
+ }, "strip", z.ZodTypeAny, {
2169
+ components: string;
2170
+ hooks: string;
2171
+ utils: string;
2172
+ lib: string;
2173
+ business: string;
2174
+ templates: string;
2175
+ }, {
2176
+ components: string;
2177
+ hooks: string;
2178
+ utils: string;
2179
+ lib: string;
2180
+ business?: string | undefined;
2181
+ templates?: string | undefined;
2182
+ }>>;
2183
+ /**
2184
+ * Default icon library declared by the project (only meaningful for ui).
2185
+ * Declarative only — does NOT trigger code rewrites; ui entries hardcode imports.
2186
+ */
2187
+ iconLibrary: z.ZodOptional<z.ZodString>;
2188
+ /** Whether the project uses TSX (true) or JSX (false). ui-specific. */
2189
+ tsx: z.ZodOptional<z.ZodBoolean>;
2190
+ /** Whether to emit React Server Components markers (`"use client"`). ui-specific. */
2191
+ rsc: z.ZodOptional<z.ZodBoolean>;
2192
+ }, "strip", z.ZodTypeAny, {
2193
+ variant: string;
2194
+ version: string;
2195
+ ides?: ("qoder" | "claude")[] | undefined;
2196
+ scope?: "project" | "global" | undefined;
2197
+ tailwind?: "v4" | undefined;
2198
+ aliases?: {
2199
+ components: string;
2200
+ hooks: string;
2201
+ utils: string;
2202
+ lib: string;
2203
+ business: string;
2204
+ templates: string;
2205
+ } | undefined;
2206
+ iconLibrary?: string | undefined;
2207
+ tsx?: boolean | undefined;
2208
+ rsc?: boolean | undefined;
2209
+ }, {
2210
+ variant: string;
2211
+ version: string;
2212
+ ides?: ("qoder" | "claude")[] | undefined;
2213
+ scope?: "project" | "global" | undefined;
2214
+ tailwind?: "v4" | undefined;
2215
+ aliases?: {
2216
+ components: string;
2217
+ hooks: string;
2218
+ utils: string;
2219
+ lib: string;
2220
+ business?: string | undefined;
2221
+ templates?: string | undefined;
2222
+ } | undefined;
2223
+ iconLibrary?: string | undefined;
2224
+ tsx?: boolean | undefined;
2225
+ rsc?: boolean | undefined;
2226
+ }>>;
2227
+ }, "strip", z.ZodTypeAny, {
2228
+ schemaVersion: 1;
2229
+ ide: string;
2230
+ packages: Record<string, {
2231
+ variant: string;
2232
+ version: string;
2233
+ ides?: ("qoder" | "claude")[] | undefined;
2234
+ scope?: "project" | "global" | undefined;
2235
+ tailwind?: "v4" | undefined;
2236
+ aliases?: {
2237
+ components: string;
2238
+ hooks: string;
2239
+ utils: string;
2240
+ lib: string;
2241
+ business: string;
2242
+ templates: string;
2243
+ } | undefined;
2244
+ iconLibrary?: string | undefined;
2245
+ tsx?: boolean | undefined;
2246
+ rsc?: boolean | undefined;
2247
+ }>;
2248
+ $schema?: string | undefined;
2249
+ }, {
2250
+ schemaVersion: 1;
2251
+ ide: string;
2252
+ packages: Record<string, {
2253
+ variant: string;
2254
+ version: string;
2255
+ ides?: ("qoder" | "claude")[] | undefined;
2256
+ scope?: "project" | "global" | undefined;
2257
+ tailwind?: "v4" | undefined;
2258
+ aliases?: {
2259
+ components: string;
2260
+ hooks: string;
2261
+ utils: string;
2262
+ lib: string;
2263
+ business?: string | undefined;
2264
+ templates?: string | undefined;
2265
+ } | undefined;
2266
+ iconLibrary?: string | undefined;
2267
+ tsx?: boolean | undefined;
2268
+ rsc?: boolean | undefined;
2269
+ }>;
2270
+ $schema?: string | undefined;
2271
+ }>, z.ZodObject<{
2272
+ $schema: z.ZodOptional<z.ZodString>;
2273
+ schemaVersion: z.ZodLiteral<2>;
2274
+ /** IDE identifier */
2275
+ ide: z.ZodString;
2276
+ /** Installed packages keyed by package name */
2277
+ packages: z.ZodRecord<z.ZodString, z.ZodObject<{
2278
+ /** Variant identifier (e.g. "opentrek"; use "_flat" for skills/ui) */
2279
+ variant: z.ZodString;
2280
+ /** Semver version string */
2281
+ version: z.ZodString;
2282
+ /** Tailwind CSS version this project uses (only meaningful for design package). */
2283
+ tailwind: z.ZodOptional<z.ZodLiteral<"v4">>;
2284
+ /** IDEs this package was installed for (only meaningful for skills package). */
2285
+ ides: z.ZodOptional<z.ZodArray<z.ZodEnum<["qoder", "claude"]>, "many">>;
2286
+ /** Install scope (only meaningful for skills package). */
2287
+ scope: z.ZodOptional<z.ZodEnum<["project", "global"]>>;
2288
+ /** Path aliases for ui entry installation (only meaningful for ui package). */
2289
+ aliases: z.ZodOptional<z.ZodObject<{
2290
+ components: z.ZodString;
2291
+ hooks: z.ZodString;
2292
+ utils: z.ZodString;
2293
+ lib: z.ZodString;
2294
+ /** Biz-ui components (variant-bound). Defaults to `src/components/business/`. */
2295
+ business: z.ZodDefault<z.ZodString>;
2296
+ /** Page templates (variant-bound). Defaults to `src/templates/`. */
2297
+ templates: z.ZodDefault<z.ZodString>;
2298
+ }, "strip", z.ZodTypeAny, {
2299
+ components: string;
2300
+ hooks: string;
2301
+ utils: string;
2302
+ lib: string;
2303
+ business: string;
2304
+ templates: string;
2305
+ }, {
2306
+ components: string;
2307
+ hooks: string;
2308
+ utils: string;
2309
+ lib: string;
2310
+ business?: string | undefined;
2311
+ templates?: string | undefined;
2312
+ }>>;
2313
+ /**
2314
+ * Default icon library declared by the project (only meaningful for ui).
2315
+ * Declarative only — does NOT trigger code rewrites; ui entries hardcode imports.
2316
+ */
2317
+ iconLibrary: z.ZodOptional<z.ZodString>;
2318
+ /** Whether the project uses TSX (true) or JSX (false). ui-specific. */
2319
+ tsx: z.ZodOptional<z.ZodBoolean>;
2320
+ /** Whether to emit React Server Components markers (`"use client"`). ui-specific. */
2321
+ rsc: z.ZodOptional<z.ZodBoolean>;
2322
+ }, "strip", z.ZodTypeAny, {
2323
+ variant: string;
2324
+ version: string;
2325
+ ides?: ("qoder" | "claude")[] | undefined;
2326
+ scope?: "project" | "global" | undefined;
2327
+ tailwind?: "v4" | undefined;
2328
+ aliases?: {
2329
+ components: string;
2330
+ hooks: string;
2331
+ utils: string;
2332
+ lib: string;
2333
+ business: string;
2334
+ templates: string;
2335
+ } | undefined;
2336
+ iconLibrary?: string | undefined;
2337
+ tsx?: boolean | undefined;
2338
+ rsc?: boolean | undefined;
2339
+ }, {
2340
+ variant: string;
2341
+ version: string;
2342
+ ides?: ("qoder" | "claude")[] | undefined;
2343
+ scope?: "project" | "global" | undefined;
2344
+ tailwind?: "v4" | undefined;
2345
+ aliases?: {
2346
+ components: string;
2347
+ hooks: string;
2348
+ utils: string;
2349
+ lib: string;
2350
+ business?: string | undefined;
2351
+ templates?: string | undefined;
2352
+ } | undefined;
2353
+ iconLibrary?: string | undefined;
2354
+ tsx?: boolean | undefined;
2355
+ rsc?: boolean | undefined;
2356
+ }>>;
2357
+ /** Variant in effect before the most recent `variant switch`, if any. */
2358
+ priorVariant: z.ZodOptional<z.ZodString>;
2359
+ /** Last successful update record keyed by package name. */
2360
+ lastUpdate: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
2361
+ /** ISO-8601 UTC timestamp of the last successful update. */
2362
+ ts: z.ZodString;
2363
+ /** Version the package was on before this update. */
2364
+ fromVersion: z.ZodString;
2365
+ /** Version the package was on after this update. */
2366
+ toVersion: z.ZodString;
2367
+ }, "strip", z.ZodTypeAny, {
2368
+ ts: string;
2369
+ fromVersion: string;
2370
+ toVersion: string;
2371
+ }, {
2372
+ ts: string;
2373
+ fromVersion: string;
2374
+ toVersion: string;
2375
+ }>>>;
2376
+ /** Token rename log accumulated across variant switches (oldest → newest). */
2377
+ tokenRenameHistory: z.ZodOptional<z.ZodArray<z.ZodObject<{
2378
+ /** ISO-8601 UTC timestamp at which the variant switch was performed. */
2379
+ ts: z.ZodString;
2380
+ /** Variant the project was on before the switch. */
2381
+ fromVariant: z.ZodString;
2382
+ /** Variant the project switched to. */
2383
+ toVariant: z.ZodString;
2384
+ /**
2385
+ * Token rename mapping — old token name → new token name.
2386
+ * Empty object is legal (e.g. switch with zero rename).
2387
+ */
2388
+ renames: z.ZodRecord<z.ZodString, z.ZodString>;
2389
+ }, "strip", z.ZodTypeAny, {
2390
+ renames: Record<string, string>;
2391
+ ts: string;
2392
+ fromVariant: string;
2393
+ toVariant: string;
2394
+ }, {
2395
+ renames: Record<string, string>;
2396
+ ts: string;
2397
+ fromVariant: string;
2398
+ toVariant: string;
2399
+ }>, "many">>;
2400
+ }, "strip", z.ZodTypeAny, {
2401
+ schemaVersion: 2;
2402
+ ide: string;
2403
+ packages: Record<string, {
2404
+ variant: string;
2405
+ version: string;
2406
+ ides?: ("qoder" | "claude")[] | undefined;
2407
+ scope?: "project" | "global" | undefined;
2408
+ tailwind?: "v4" | undefined;
2409
+ aliases?: {
2410
+ components: string;
2411
+ hooks: string;
2412
+ utils: string;
2413
+ lib: string;
2414
+ business: string;
2415
+ templates: string;
2416
+ } | undefined;
2417
+ iconLibrary?: string | undefined;
2418
+ tsx?: boolean | undefined;
2419
+ rsc?: boolean | undefined;
2420
+ }>;
2421
+ $schema?: string | undefined;
2422
+ priorVariant?: string | undefined;
2423
+ lastUpdate?: Record<string, {
2424
+ ts: string;
2425
+ fromVersion: string;
2426
+ toVersion: string;
2427
+ }> | undefined;
2428
+ tokenRenameHistory?: {
2429
+ renames: Record<string, string>;
2430
+ ts: string;
2431
+ fromVariant: string;
2432
+ toVariant: string;
2433
+ }[] | undefined;
2434
+ }, {
2435
+ schemaVersion: 2;
2436
+ ide: string;
2437
+ packages: Record<string, {
2438
+ variant: string;
2439
+ version: string;
2440
+ ides?: ("qoder" | "claude")[] | undefined;
2441
+ scope?: "project" | "global" | undefined;
2442
+ tailwind?: "v4" | undefined;
2443
+ aliases?: {
2444
+ components: string;
2445
+ hooks: string;
2446
+ utils: string;
2447
+ lib: string;
2448
+ business?: string | undefined;
2449
+ templates?: string | undefined;
2450
+ } | undefined;
2451
+ iconLibrary?: string | undefined;
2452
+ tsx?: boolean | undefined;
2453
+ rsc?: boolean | undefined;
2454
+ }>;
2455
+ $schema?: string | undefined;
2456
+ priorVariant?: string | undefined;
2457
+ lastUpdate?: Record<string, {
2458
+ ts: string;
2459
+ fromVersion: string;
2460
+ toVersion: string;
2461
+ }> | undefined;
2462
+ tokenRenameHistory?: {
2463
+ renames: Record<string, string>;
2464
+ ts: string;
2465
+ fromVariant: string;
2466
+ toVariant: string;
2467
+ }[] | undefined;
2468
+ }>]>, {
2469
+ schemaVersion: 2;
2470
+ ide: string;
2471
+ packages: Record<string, {
2472
+ variant: string;
2473
+ version: string;
2474
+ ides?: ("qoder" | "claude")[] | undefined;
2475
+ scope?: "project" | "global" | undefined;
2476
+ tailwind?: "v4" | undefined;
2477
+ aliases?: {
2478
+ components: string;
2479
+ hooks: string;
2480
+ utils: string;
2481
+ lib: string;
2482
+ business: string;
2483
+ templates: string;
2484
+ } | undefined;
2485
+ iconLibrary?: string | undefined;
2486
+ tsx?: boolean | undefined;
2487
+ rsc?: boolean | undefined;
2488
+ }>;
2489
+ $schema?: string | undefined;
2490
+ priorVariant?: string | undefined;
2491
+ lastUpdate?: Record<string, {
2492
+ ts: string;
2493
+ fromVersion: string;
2494
+ toVersion: string;
2495
+ }> | undefined;
2496
+ tokenRenameHistory?: {
2497
+ renames: Record<string, string>;
2498
+ ts: string;
2499
+ fromVariant: string;
2500
+ toVariant: string;
2501
+ }[] | undefined;
2502
+ }, {
2503
+ schemaVersion: 1;
2504
+ ide: string;
2505
+ packages: Record<string, {
2506
+ variant: string;
2507
+ version: string;
2508
+ ides?: ("qoder" | "claude")[] | undefined;
2509
+ scope?: "project" | "global" | undefined;
2510
+ tailwind?: "v4" | undefined;
2511
+ aliases?: {
2512
+ components: string;
2513
+ hooks: string;
2514
+ utils: string;
2515
+ lib: string;
2516
+ business?: string | undefined;
2517
+ templates?: string | undefined;
2518
+ } | undefined;
2519
+ iconLibrary?: string | undefined;
2520
+ tsx?: boolean | undefined;
2521
+ rsc?: boolean | undefined;
2522
+ }>;
2523
+ $schema?: string | undefined;
2524
+ } | {
2525
+ schemaVersion: 2;
2526
+ ide: string;
2527
+ packages: Record<string, {
2528
+ variant: string;
2529
+ version: string;
2530
+ ides?: ("qoder" | "claude")[] | undefined;
2531
+ scope?: "project" | "global" | undefined;
2532
+ tailwind?: "v4" | undefined;
2533
+ aliases?: {
2534
+ components: string;
2535
+ hooks: string;
2536
+ utils: string;
2537
+ lib: string;
2538
+ business?: string | undefined;
2539
+ templates?: string | undefined;
2540
+ } | undefined;
2541
+ iconLibrary?: string | undefined;
2542
+ tsx?: boolean | undefined;
2543
+ rsc?: boolean | undefined;
2544
+ }>;
2545
+ $schema?: string | undefined;
2546
+ priorVariant?: string | undefined;
2547
+ lastUpdate?: Record<string, {
2548
+ ts: string;
2549
+ fromVersion: string;
2550
+ toVersion: string;
2551
+ }> | undefined;
2552
+ tokenRenameHistory?: {
2553
+ renames: Record<string, string>;
2554
+ ts: string;
2555
+ fromVariant: string;
2556
+ toVariant: string;
2557
+ }[] | undefined;
2558
+ }>;
2559
+
2560
+ /**
2561
+ * An installed resource entry — tracks individual resource installation state.
2562
+ *
2563
+ * For type="skill" resources, the same logical skill may produce multiple installed
2564
+ * entries (one per ide × scope combination); the optional `ide`/`scope` fields
2565
+ * disambiguate them.
2566
+ */
2567
+ declare const InstalledResourceSchema: z.ZodObject<{
2568
+ /** Resource identifier matching the variant manifest */
2569
+ id: z.ZodString;
2570
+ /** Target path where the resource was installed (absolute or project-relative) */
2571
+ target: z.ZodString;
2572
+ /** Content hash for change detection (e.g. "sha256:...") */
2573
+ hash: z.ZodString;
2574
+ /** Update strategy that was applied */
2575
+ strategy: z.ZodEnum<["frozen", "regenerable", "managed"]>;
2576
+ /** IDE this resource was installed for (skill resources only) */
2577
+ ide: z.ZodOptional<z.ZodEnum<["qoder", "claude"]>>;
2578
+ /** Install scope (skill resources only) */
2579
+ scope: z.ZodOptional<z.ZodEnum<["project", "global"]>>;
2580
+ /**
2581
+ * Origin of the file content. Optional for backwards compatibility — older
2582
+ * manifests without this field still validate.
2583
+ *
2584
+ * - `teamix-evo` : installed from `@teamix-evo/ui` (or biz-ui)
2585
+ * - `shadcn-native` : matches an upstream registry entry verbatim
2586
+ * - `custom` : user-modified or hand-authored, no upstream match
2587
+ * - `custom-legacy` : user version preserved during a Coexist promotion
2588
+ * (see ADR / promote-to-biz)
2589
+ * - `detected` : adopted via `ui add --adopt`, registry id matched but
2590
+ * content has not been verified against upstream hash
2591
+ */
2592
+ sourceLineage: z.ZodOptional<z.ZodEnum<["teamix-evo", "shadcn-native", "custom", "custom-legacy", "detected"]>>;
2593
+ }, "strip", z.ZodTypeAny, {
2594
+ id: string;
2595
+ target: string;
2596
+ hash: string;
2597
+ strategy: "frozen" | "regenerable" | "managed";
2598
+ scope?: "project" | "global" | undefined;
2599
+ ide?: "qoder" | "claude" | undefined;
2600
+ sourceLineage?: "custom" | "teamix-evo" | "shadcn-native" | "custom-legacy" | "detected" | undefined;
2601
+ }, {
2602
+ id: string;
2603
+ target: string;
2604
+ hash: string;
2605
+ strategy: "frozen" | "regenerable" | "managed";
2606
+ scope?: "project" | "global" | undefined;
2607
+ ide?: "qoder" | "claude" | undefined;
2608
+ sourceLineage?: "custom" | "teamix-evo" | "shadcn-native" | "custom-legacy" | "detected" | undefined;
2609
+ }>;
2610
+ /**
2611
+ * An installed package entry — tracks a single package installation.
2612
+ */
2613
+ declare const InstalledPackageSchema: z.ZodObject<{
2614
+ /** Full package name (e.g. "@teamix-evo/tokens") */
2615
+ package: z.ZodString;
2616
+ /** Variant identifier (use "_flat" for non-variant packages such as skills) */
2617
+ variant: z.ZodString;
2618
+ /** Installed version */
2619
+ version: z.ZodString;
2620
+ /** ISO 8601 timestamp of installation */
2621
+ installedAt: z.ZodString;
2622
+ /** List of installed resources */
2623
+ resources: z.ZodArray<z.ZodObject<{
2624
+ /** Resource identifier matching the variant manifest */
2625
+ id: z.ZodString;
2626
+ /** Target path where the resource was installed (absolute or project-relative) */
2627
+ target: z.ZodString;
2628
+ /** Content hash for change detection (e.g. "sha256:...") */
2629
+ hash: z.ZodString;
2630
+ /** Update strategy that was applied */
2631
+ strategy: z.ZodEnum<["frozen", "regenerable", "managed"]>;
2632
+ /** IDE this resource was installed for (skill resources only) */
2633
+ ide: z.ZodOptional<z.ZodEnum<["qoder", "claude"]>>;
2634
+ /** Install scope (skill resources only) */
2635
+ scope: z.ZodOptional<z.ZodEnum<["project", "global"]>>;
2636
+ /**
2637
+ * Origin of the file content. Optional for backwards compatibility — older
2638
+ * manifests without this field still validate.
2639
+ *
2640
+ * - `teamix-evo` : installed from `@teamix-evo/ui` (or biz-ui)
2641
+ * - `shadcn-native` : matches an upstream registry entry verbatim
2642
+ * - `custom` : user-modified or hand-authored, no upstream match
2643
+ * - `custom-legacy` : user version preserved during a Coexist promotion
2644
+ * (see ADR / promote-to-biz)
2645
+ * - `detected` : adopted via `ui add --adopt`, registry id matched but
2646
+ * content has not been verified against upstream hash
2647
+ */
2648
+ sourceLineage: z.ZodOptional<z.ZodEnum<["teamix-evo", "shadcn-native", "custom", "custom-legacy", "detected"]>>;
2649
+ }, "strip", z.ZodTypeAny, {
2650
+ id: string;
2651
+ target: string;
2652
+ hash: string;
2653
+ strategy: "frozen" | "regenerable" | "managed";
2654
+ scope?: "project" | "global" | undefined;
2655
+ ide?: "qoder" | "claude" | undefined;
2656
+ sourceLineage?: "custom" | "teamix-evo" | "shadcn-native" | "custom-legacy" | "detected" | undefined;
2657
+ }, {
2658
+ id: string;
2659
+ target: string;
2660
+ hash: string;
2661
+ strategy: "frozen" | "regenerable" | "managed";
2662
+ scope?: "project" | "global" | undefined;
2663
+ ide?: "qoder" | "claude" | undefined;
2664
+ sourceLineage?: "custom" | "teamix-evo" | "shadcn-native" | "custom-legacy" | "detected" | undefined;
2665
+ }>, "many">;
2666
+ }, "strip", z.ZodTypeAny, {
2667
+ package: string;
2668
+ variant: string;
2669
+ version: string;
2670
+ resources: {
2671
+ id: string;
2672
+ target: string;
2673
+ hash: string;
2674
+ strategy: "frozen" | "regenerable" | "managed";
2675
+ scope?: "project" | "global" | undefined;
2676
+ ide?: "qoder" | "claude" | undefined;
2677
+ sourceLineage?: "custom" | "teamix-evo" | "shadcn-native" | "custom-legacy" | "detected" | undefined;
2678
+ }[];
2679
+ installedAt: string;
2680
+ }, {
2681
+ package: string;
2682
+ variant: string;
2683
+ version: string;
2684
+ resources: {
2685
+ id: string;
2686
+ target: string;
2687
+ hash: string;
2688
+ strategy: "frozen" | "regenerable" | "managed";
2689
+ scope?: "project" | "global" | undefined;
2690
+ ide?: "qoder" | "claude" | undefined;
2691
+ sourceLineage?: "custom" | "teamix-evo" | "shadcn-native" | "custom-legacy" | "detected" | undefined;
2692
+ }[];
2693
+ installedAt: string;
2694
+ }>;
2695
+ /**
2696
+ * Installed manifest schema — tracks all installed packages in a project.
2697
+ * Stored at `.teamix-evo/manifest.json`.
2698
+ */
2699
+ declare const InstalledManifestSchema: z.ZodObject<{
2700
+ schemaVersion: z.ZodLiteral<1>;
1868
2701
  /** List of installed packages */
1869
2702
  installed: z.ZodArray<z.ZodObject<{
1870
2703
  /** Full package name (e.g. "@teamix-evo/tokens") */
@@ -1889,6 +2722,19 @@ declare const InstalledManifestSchema: z.ZodObject<{
1889
2722
  ide: z.ZodOptional<z.ZodEnum<["qoder", "claude"]>>;
1890
2723
  /** Install scope (skill resources only) */
1891
2724
  scope: z.ZodOptional<z.ZodEnum<["project", "global"]>>;
2725
+ /**
2726
+ * Origin of the file content. Optional for backwards compatibility — older
2727
+ * manifests without this field still validate.
2728
+ *
2729
+ * - `teamix-evo` : installed from `@teamix-evo/ui` (or biz-ui)
2730
+ * - `shadcn-native` : matches an upstream registry entry verbatim
2731
+ * - `custom` : user-modified or hand-authored, no upstream match
2732
+ * - `custom-legacy` : user version preserved during a Coexist promotion
2733
+ * (see ADR / promote-to-biz)
2734
+ * - `detected` : adopted via `ui add --adopt`, registry id matched but
2735
+ * content has not been verified against upstream hash
2736
+ */
2737
+ sourceLineage: z.ZodOptional<z.ZodEnum<["teamix-evo", "shadcn-native", "custom", "custom-legacy", "detected"]>>;
1892
2738
  }, "strip", z.ZodTypeAny, {
1893
2739
  id: string;
1894
2740
  target: string;
@@ -1896,6 +2742,7 @@ declare const InstalledManifestSchema: z.ZodObject<{
1896
2742
  strategy: "frozen" | "regenerable" | "managed";
1897
2743
  scope?: "project" | "global" | undefined;
1898
2744
  ide?: "qoder" | "claude" | undefined;
2745
+ sourceLineage?: "custom" | "teamix-evo" | "shadcn-native" | "custom-legacy" | "detected" | undefined;
1899
2746
  }, {
1900
2747
  id: string;
1901
2748
  target: string;
@@ -1903,6 +2750,7 @@ declare const InstalledManifestSchema: z.ZodObject<{
1903
2750
  strategy: "frozen" | "regenerable" | "managed";
1904
2751
  scope?: "project" | "global" | undefined;
1905
2752
  ide?: "qoder" | "claude" | undefined;
2753
+ sourceLineage?: "custom" | "teamix-evo" | "shadcn-native" | "custom-legacy" | "detected" | undefined;
1906
2754
  }>, "many">;
1907
2755
  }, "strip", z.ZodTypeAny, {
1908
2756
  package: string;
@@ -1915,6 +2763,7 @@ declare const InstalledManifestSchema: z.ZodObject<{
1915
2763
  strategy: "frozen" | "regenerable" | "managed";
1916
2764
  scope?: "project" | "global" | undefined;
1917
2765
  ide?: "qoder" | "claude" | undefined;
2766
+ sourceLineage?: "custom" | "teamix-evo" | "shadcn-native" | "custom-legacy" | "detected" | undefined;
1918
2767
  }[];
1919
2768
  installedAt: string;
1920
2769
  }, {
@@ -1928,6 +2777,7 @@ declare const InstalledManifestSchema: z.ZodObject<{
1928
2777
  strategy: "frozen" | "regenerable" | "managed";
1929
2778
  scope?: "project" | "global" | undefined;
1930
2779
  ide?: "qoder" | "claude" | undefined;
2780
+ sourceLineage?: "custom" | "teamix-evo" | "shadcn-native" | "custom-legacy" | "detected" | undefined;
1931
2781
  }[];
1932
2782
  installedAt: string;
1933
2783
  }>, "many">;
@@ -1944,6 +2794,7 @@ declare const InstalledManifestSchema: z.ZodObject<{
1944
2794
  strategy: "frozen" | "regenerable" | "managed";
1945
2795
  scope?: "project" | "global" | undefined;
1946
2796
  ide?: "qoder" | "claude" | undefined;
2797
+ sourceLineage?: "custom" | "teamix-evo" | "shadcn-native" | "custom-legacy" | "detected" | undefined;
1947
2798
  }[];
1948
2799
  installedAt: string;
1949
2800
  }[];
@@ -1960,6 +2811,7 @@ declare const InstalledManifestSchema: z.ZodObject<{
1960
2811
  strategy: "frozen" | "regenerable" | "managed";
1961
2812
  scope?: "project" | "global" | undefined;
1962
2813
  ide?: "qoder" | "claude" | undefined;
2814
+ sourceLineage?: "custom" | "teamix-evo" | "shadcn-native" | "custom-legacy" | "detected" | undefined;
1963
2815
  }[];
1964
2816
  installedAt: string;
1965
2817
  }[];
@@ -2066,6 +2918,1217 @@ declare const SkillsLockSchema: z.ZodObject<{
2066
2918
  type SkillsLockEntry = z.infer<typeof SkillsLockEntrySchema>;
2067
2919
  type SkillsLock = z.infer<typeof SkillsLockSchema>;
2068
2920
 
2921
+ /**
2922
+ * Component-source upgrade staging manifest — emitted by CLI as the input for
2923
+ * the `teamix-evo-upgrade` skill (component source section). Persisted at
2924
+ * `.teamix-evo/.upgrade-staging/<category>-<fs-iso-ts>/meta.json`.
2925
+ *
2926
+ * See [ADR 0040](../../../../docs/adr/0040-component-source-layer-upgrade-flow.md).
2927
+ */
2928
+ /** Risk classification CLI assigns per component (AI may downgrade after review). */
2929
+ declare const UpgradeRiskLevelSchema: z.ZodEnum<["unchanged", "upgradable-low", "upgradable-medium", "risky", "breaking", "foreign"]>;
2930
+ /** Lineage classification of the consumer project's component layer. */
2931
+ declare const ComponentLineageSchema: z.ZodEnum<["teamix-evo", "shadcn-native", "mixed", "custom-only"]>;
2932
+ /** Discriminator for which package category a staging manifest covers. */
2933
+ declare const UpgradeStagingCategorySchema: z.ZodEnum<["ui", "biz-ui"]>;
2934
+ /** What command produced the staging dir. */
2935
+ declare const UpgradeStagingTriggerSchema: z.ZodEnum<["update", "ui-upgrade", "biz-ui-upgrade"]>;
2936
+ /** Per-component "current state on disk" portion of a staging entry. */
2937
+ declare const UpgradeStagingCurrentSchema: z.ZodObject<{
2938
+ /** Project-relative path of the component file (e.g. `src/components/ui/button.tsx`). */
2939
+ target: z.ZodString;
2940
+ /** Hash recorded in `.teamix-evo/manifest.json` at install time, or null when foreign. */
2941
+ hash: z.ZodNullable<z.ZodString>;
2942
+ /** Lineage of *this specific component* (independent of project-wide lineage). */
2943
+ sourceLineage: z.ZodEnum<["teamix-evo", "shadcn-native", "custom", "absent"]>;
2944
+ }, "strip", z.ZodTypeAny, {
2945
+ target: string;
2946
+ hash: string | null;
2947
+ sourceLineage: "custom" | "teamix-evo" | "shadcn-native" | "absent";
2948
+ }, {
2949
+ target: string;
2950
+ hash: string | null;
2951
+ sourceLineage: "custom" | "teamix-evo" | "shadcn-native" | "absent";
2952
+ }>;
2953
+ /** Per-component "incoming source from registry" portion of a staging entry. */
2954
+ declare const UpgradeStagingIncomingSchema: z.ZodObject<{
2955
+ /** Package-level version the incoming source comes from. */
2956
+ sourceVersion: z.ZodString;
2957
+ /** Hash of incoming source after applying the consumer's import-rewrite aliases. */
2958
+ hash: z.ZodString;
2959
+ /** Path of the incoming source file relative to the staging dir (e.g. `button/incoming.tsx`). */
2960
+ relPath: z.ZodString;
2961
+ }, "strip", z.ZodTypeAny, {
2962
+ hash: string;
2963
+ sourceVersion: string;
2964
+ relPath: string;
2965
+ }, {
2966
+ hash: string;
2967
+ sourceVersion: string;
2968
+ relPath: string;
2969
+ }>;
2970
+ /** Risk + diff metadata produced by CLI heuristics. */
2971
+ declare const UpgradeStagingDiffSchema: z.ZodObject<{
2972
+ riskLevel: z.ZodEnum<["unchanged", "upgradable-low", "upgradable-medium", "risky", "breaking", "foreign"]>;
2973
+ /** Human-readable, machine-parsable hints (e.g. `"new prop: loading"`, `"removed cva variant: ghost"`). */
2974
+ hints: z.ZodArray<z.ZodString, "many">;
2975
+ /** Number of files that differ for this entry (almost always 1 today; reserved for multi-file entries). */
2976
+ filesChangedCount: z.ZodNumber;
2977
+ /**
2978
+ * Path of the unified diff relative to the staging dir, when CLI emitted one.
2979
+ * Reserved for a future emitter — in schema v1 the CLI does **not** pre-render
2980
+ * `diff.unified.patch`; the consumer of the staging (the `teamix-evo-upgrade`
2981
+ * skill) computes the diff on the fly from `current.tsx` vs `incoming.tsx`.
2982
+ */
2983
+ diffRelPath: z.ZodOptional<z.ZodString>;
2984
+ }, "strip", z.ZodTypeAny, {
2985
+ riskLevel: "unchanged" | "upgradable-low" | "upgradable-medium" | "risky" | "breaking" | "foreign";
2986
+ hints: string[];
2987
+ filesChangedCount: number;
2988
+ diffRelPath?: string | undefined;
2989
+ }, {
2990
+ riskLevel: "unchanged" | "upgradable-low" | "upgradable-medium" | "risky" | "breaking" | "foreign";
2991
+ hints: string[];
2992
+ filesChangedCount: number;
2993
+ diffRelPath?: string | undefined;
2994
+ }>;
2995
+ /**
2996
+ * File-type triage label — mirrors the buckets used by `ui add --adopt`
2997
+ * (Init landing plan §1.1) so downstream consumers (skill / promote-to-biz)
2998
+ * can reuse a single classification.
2999
+ */
3000
+ declare const PromoteFileTypeSchema: z.ZodEnum<["component", "hook", "util", "type", "provider"]>;
3001
+ /**
3002
+ * Promotion mode catalogue — the 8 modes documented in the Init landing plan
3003
+ * §1.2. Multiple may apply to a single entry; the CLI surfaces a recommended
3004
+ * subset and the AI / user picks the final composition.
3005
+ */
3006
+ declare const PromoteModeSchema: z.ZodEnum<["Coexist", "Preset", "Wrapper", "Compose", "Variant", "Fork", "TokenOnly", "ManualReview"]>;
3007
+ /**
3008
+ * Lightweight feature vector summarizing the diff between user code and
3009
+ * upstream source. Each axis is best-effort regex-level; the consumer
3010
+ * (`teamix-evo-upgrade` / `promote-to-biz` skill) refines via AST as needed.
3011
+ */
3012
+ declare const PromoteFeatureVectorSchema: z.ZodObject<{
3013
+ apiDelta: z.ZodObject<{
3014
+ added: z.ZodArray<z.ZodString, "many">;
3015
+ removed: z.ZodArray<z.ZodString, "many">;
3016
+ signatureChanged: z.ZodBoolean;
3017
+ }, "strip", z.ZodTypeAny, {
3018
+ added: string[];
3019
+ removed: string[];
3020
+ signatureChanged: boolean;
3021
+ }, {
3022
+ added: string[];
3023
+ removed: string[];
3024
+ signatureChanged: boolean;
3025
+ }>;
3026
+ styleDelta: z.ZodObject<{
3027
+ classNameDiff: z.ZodBoolean;
3028
+ tokenUsageDiff: z.ZodBoolean;
3029
+ }, "strip", z.ZodTypeAny, {
3030
+ classNameDiff: boolean;
3031
+ tokenUsageDiff: boolean;
3032
+ }, {
3033
+ classNameDiff: boolean;
3034
+ tokenUsageDiff: boolean;
3035
+ }>;
3036
+ logicDelta: z.ZodObject<{
3037
+ hasState: z.ZodBoolean;
3038
+ hasEffect: z.ZodBoolean;
3039
+ hasExtraImports: z.ZodBoolean;
3040
+ }, "strip", z.ZodTypeAny, {
3041
+ hasState: boolean;
3042
+ hasEffect: boolean;
3043
+ hasExtraImports: boolean;
3044
+ }, {
3045
+ hasState: boolean;
3046
+ hasEffect: boolean;
3047
+ hasExtraImports: boolean;
3048
+ }>;
3049
+ cvaDelta: z.ZodObject<{
3050
+ addedVariants: z.ZodArray<z.ZodString, "many">;
3051
+ modifiedVariants: z.ZodArray<z.ZodString, "many">;
3052
+ }, "strip", z.ZodTypeAny, {
3053
+ addedVariants: string[];
3054
+ modifiedVariants: string[];
3055
+ }, {
3056
+ addedVariants: string[];
3057
+ modifiedVariants: string[];
3058
+ }>;
3059
+ structureDelta: z.ZodObject<{
3060
+ isComposition: z.ZodBoolean;
3061
+ atomicChildren: z.ZodArray<z.ZodString, "many">;
3062
+ }, "strip", z.ZodTypeAny, {
3063
+ isComposition: boolean;
3064
+ atomicChildren: string[];
3065
+ }, {
3066
+ isComposition: boolean;
3067
+ atomicChildren: string[];
3068
+ }>;
3069
+ }, "strip", z.ZodTypeAny, {
3070
+ apiDelta: {
3071
+ added: string[];
3072
+ removed: string[];
3073
+ signatureChanged: boolean;
3074
+ };
3075
+ styleDelta: {
3076
+ classNameDiff: boolean;
3077
+ tokenUsageDiff: boolean;
3078
+ };
3079
+ logicDelta: {
3080
+ hasState: boolean;
3081
+ hasEffect: boolean;
3082
+ hasExtraImports: boolean;
3083
+ };
3084
+ cvaDelta: {
3085
+ addedVariants: string[];
3086
+ modifiedVariants: string[];
3087
+ };
3088
+ structureDelta: {
3089
+ isComposition: boolean;
3090
+ atomicChildren: string[];
3091
+ };
3092
+ }, {
3093
+ apiDelta: {
3094
+ added: string[];
3095
+ removed: string[];
3096
+ signatureChanged: boolean;
3097
+ };
3098
+ styleDelta: {
3099
+ classNameDiff: boolean;
3100
+ tokenUsageDiff: boolean;
3101
+ };
3102
+ logicDelta: {
3103
+ hasState: boolean;
3104
+ hasEffect: boolean;
3105
+ hasExtraImports: boolean;
3106
+ };
3107
+ cvaDelta: {
3108
+ addedVariants: string[];
3109
+ modifiedVariants: string[];
3110
+ };
3111
+ structureDelta: {
3112
+ isComposition: boolean;
3113
+ atomicChildren: string[];
3114
+ };
3115
+ }>;
3116
+ /**
3117
+ * Optional promotion-planning payload attached to a staging entry. Surfaces
3118
+ * the data the `promote-to-biz` skill needs without forcing every consumer
3119
+ * to compute it themselves. Older manifests (schema v1, pre-feature-vector)
3120
+ * leave the field undefined.
3121
+ */
3122
+ declare const UpgradeStagingPromotionSchema: z.ZodObject<{
3123
+ fileType: z.ZodEnum<["component", "hook", "util", "type", "provider"]>;
3124
+ featureVector: z.ZodObject<{
3125
+ apiDelta: z.ZodObject<{
3126
+ added: z.ZodArray<z.ZodString, "many">;
3127
+ removed: z.ZodArray<z.ZodString, "many">;
3128
+ signatureChanged: z.ZodBoolean;
3129
+ }, "strip", z.ZodTypeAny, {
3130
+ added: string[];
3131
+ removed: string[];
3132
+ signatureChanged: boolean;
3133
+ }, {
3134
+ added: string[];
3135
+ removed: string[];
3136
+ signatureChanged: boolean;
3137
+ }>;
3138
+ styleDelta: z.ZodObject<{
3139
+ classNameDiff: z.ZodBoolean;
3140
+ tokenUsageDiff: z.ZodBoolean;
3141
+ }, "strip", z.ZodTypeAny, {
3142
+ classNameDiff: boolean;
3143
+ tokenUsageDiff: boolean;
3144
+ }, {
3145
+ classNameDiff: boolean;
3146
+ tokenUsageDiff: boolean;
3147
+ }>;
3148
+ logicDelta: z.ZodObject<{
3149
+ hasState: z.ZodBoolean;
3150
+ hasEffect: z.ZodBoolean;
3151
+ hasExtraImports: z.ZodBoolean;
3152
+ }, "strip", z.ZodTypeAny, {
3153
+ hasState: boolean;
3154
+ hasEffect: boolean;
3155
+ hasExtraImports: boolean;
3156
+ }, {
3157
+ hasState: boolean;
3158
+ hasEffect: boolean;
3159
+ hasExtraImports: boolean;
3160
+ }>;
3161
+ cvaDelta: z.ZodObject<{
3162
+ addedVariants: z.ZodArray<z.ZodString, "many">;
3163
+ modifiedVariants: z.ZodArray<z.ZodString, "many">;
3164
+ }, "strip", z.ZodTypeAny, {
3165
+ addedVariants: string[];
3166
+ modifiedVariants: string[];
3167
+ }, {
3168
+ addedVariants: string[];
3169
+ modifiedVariants: string[];
3170
+ }>;
3171
+ structureDelta: z.ZodObject<{
3172
+ isComposition: z.ZodBoolean;
3173
+ atomicChildren: z.ZodArray<z.ZodString, "many">;
3174
+ }, "strip", z.ZodTypeAny, {
3175
+ isComposition: boolean;
3176
+ atomicChildren: string[];
3177
+ }, {
3178
+ isComposition: boolean;
3179
+ atomicChildren: string[];
3180
+ }>;
3181
+ }, "strip", z.ZodTypeAny, {
3182
+ apiDelta: {
3183
+ added: string[];
3184
+ removed: string[];
3185
+ signatureChanged: boolean;
3186
+ };
3187
+ styleDelta: {
3188
+ classNameDiff: boolean;
3189
+ tokenUsageDiff: boolean;
3190
+ };
3191
+ logicDelta: {
3192
+ hasState: boolean;
3193
+ hasEffect: boolean;
3194
+ hasExtraImports: boolean;
3195
+ };
3196
+ cvaDelta: {
3197
+ addedVariants: string[];
3198
+ modifiedVariants: string[];
3199
+ };
3200
+ structureDelta: {
3201
+ isComposition: boolean;
3202
+ atomicChildren: string[];
3203
+ };
3204
+ }, {
3205
+ apiDelta: {
3206
+ added: string[];
3207
+ removed: string[];
3208
+ signatureChanged: boolean;
3209
+ };
3210
+ styleDelta: {
3211
+ classNameDiff: boolean;
3212
+ tokenUsageDiff: boolean;
3213
+ };
3214
+ logicDelta: {
3215
+ hasState: boolean;
3216
+ hasEffect: boolean;
3217
+ hasExtraImports: boolean;
3218
+ };
3219
+ cvaDelta: {
3220
+ addedVariants: string[];
3221
+ modifiedVariants: string[];
3222
+ };
3223
+ structureDelta: {
3224
+ isComposition: boolean;
3225
+ atomicChildren: string[];
3226
+ };
3227
+ }>;
3228
+ recommendedModes: z.ZodArray<z.ZodEnum<["Coexist", "Preset", "Wrapper", "Compose", "Variant", "Fork", "TokenOnly", "ManualReview"]>, "many">;
3229
+ confidence: z.ZodNumber;
3230
+ reasons: z.ZodArray<z.ZodString, "many">;
3231
+ }, "strip", z.ZodTypeAny, {
3232
+ fileType: "type" | "component" | "hook" | "util" | "provider";
3233
+ featureVector: {
3234
+ apiDelta: {
3235
+ added: string[];
3236
+ removed: string[];
3237
+ signatureChanged: boolean;
3238
+ };
3239
+ styleDelta: {
3240
+ classNameDiff: boolean;
3241
+ tokenUsageDiff: boolean;
3242
+ };
3243
+ logicDelta: {
3244
+ hasState: boolean;
3245
+ hasEffect: boolean;
3246
+ hasExtraImports: boolean;
3247
+ };
3248
+ cvaDelta: {
3249
+ addedVariants: string[];
3250
+ modifiedVariants: string[];
3251
+ };
3252
+ structureDelta: {
3253
+ isComposition: boolean;
3254
+ atomicChildren: string[];
3255
+ };
3256
+ };
3257
+ recommendedModes: ("Coexist" | "Preset" | "Wrapper" | "Compose" | "Variant" | "Fork" | "TokenOnly" | "ManualReview")[];
3258
+ confidence: number;
3259
+ reasons: string[];
3260
+ }, {
3261
+ fileType: "type" | "component" | "hook" | "util" | "provider";
3262
+ featureVector: {
3263
+ apiDelta: {
3264
+ added: string[];
3265
+ removed: string[];
3266
+ signatureChanged: boolean;
3267
+ };
3268
+ styleDelta: {
3269
+ classNameDiff: boolean;
3270
+ tokenUsageDiff: boolean;
3271
+ };
3272
+ logicDelta: {
3273
+ hasState: boolean;
3274
+ hasEffect: boolean;
3275
+ hasExtraImports: boolean;
3276
+ };
3277
+ cvaDelta: {
3278
+ addedVariants: string[];
3279
+ modifiedVariants: string[];
3280
+ };
3281
+ structureDelta: {
3282
+ isComposition: boolean;
3283
+ atomicChildren: string[];
3284
+ };
3285
+ };
3286
+ recommendedModes: ("Coexist" | "Preset" | "Wrapper" | "Compose" | "Variant" | "Fork" | "TokenOnly" | "ManualReview")[];
3287
+ confidence: number;
3288
+ reasons: string[];
3289
+ }>;
3290
+ /** A single component-level entry inside the staging manifest. */
3291
+ declare const UpgradeStagingEntrySchema: z.ZodObject<{
3292
+ /** Component identifier matching the upstream registry (e.g. `"button"`). */
3293
+ id: z.ZodString;
3294
+ /** Which package category this entry belongs to. */
3295
+ category: z.ZodEnum<["ui", "biz-ui"]>;
3296
+ current: z.ZodObject<{
3297
+ /** Project-relative path of the component file (e.g. `src/components/ui/button.tsx`). */
3298
+ target: z.ZodString;
3299
+ /** Hash recorded in `.teamix-evo/manifest.json` at install time, or null when foreign. */
3300
+ hash: z.ZodNullable<z.ZodString>;
3301
+ /** Lineage of *this specific component* (independent of project-wide lineage). */
3302
+ sourceLineage: z.ZodEnum<["teamix-evo", "shadcn-native", "custom", "absent"]>;
3303
+ }, "strip", z.ZodTypeAny, {
3304
+ target: string;
3305
+ hash: string | null;
3306
+ sourceLineage: "custom" | "teamix-evo" | "shadcn-native" | "absent";
3307
+ }, {
3308
+ target: string;
3309
+ hash: string | null;
3310
+ sourceLineage: "custom" | "teamix-evo" | "shadcn-native" | "absent";
3311
+ }>;
3312
+ /** Absent when the entry is `breaking` (no incoming) or `foreign` (no upstream). */
3313
+ incoming: z.ZodOptional<z.ZodObject<{
3314
+ /** Package-level version the incoming source comes from. */
3315
+ sourceVersion: z.ZodString;
3316
+ /** Hash of incoming source after applying the consumer's import-rewrite aliases. */
3317
+ hash: z.ZodString;
3318
+ /** Path of the incoming source file relative to the staging dir (e.g. `button/incoming.tsx`). */
3319
+ relPath: z.ZodString;
3320
+ }, "strip", z.ZodTypeAny, {
3321
+ hash: string;
3322
+ sourceVersion: string;
3323
+ relPath: string;
3324
+ }, {
3325
+ hash: string;
3326
+ sourceVersion: string;
3327
+ relPath: string;
3328
+ }>>;
3329
+ diff: z.ZodObject<{
3330
+ riskLevel: z.ZodEnum<["unchanged", "upgradable-low", "upgradable-medium", "risky", "breaking", "foreign"]>;
3331
+ /** Human-readable, machine-parsable hints (e.g. `"new prop: loading"`, `"removed cva variant: ghost"`). */
3332
+ hints: z.ZodArray<z.ZodString, "many">;
3333
+ /** Number of files that differ for this entry (almost always 1 today; reserved for multi-file entries). */
3334
+ filesChangedCount: z.ZodNumber;
3335
+ /**
3336
+ * Path of the unified diff relative to the staging dir, when CLI emitted one.
3337
+ * Reserved for a future emitter — in schema v1 the CLI does **not** pre-render
3338
+ * `diff.unified.patch`; the consumer of the staging (the `teamix-evo-upgrade`
3339
+ * skill) computes the diff on the fly from `current.tsx` vs `incoming.tsx`.
3340
+ */
3341
+ diffRelPath: z.ZodOptional<z.ZodString>;
3342
+ }, "strip", z.ZodTypeAny, {
3343
+ riskLevel: "unchanged" | "upgradable-low" | "upgradable-medium" | "risky" | "breaking" | "foreign";
3344
+ hints: string[];
3345
+ filesChangedCount: number;
3346
+ diffRelPath?: string | undefined;
3347
+ }, {
3348
+ riskLevel: "unchanged" | "upgradable-low" | "upgradable-medium" | "risky" | "breaking" | "foreign";
3349
+ hints: string[];
3350
+ filesChangedCount: number;
3351
+ diffRelPath?: string | undefined;
3352
+ }>;
3353
+ /**
3354
+ * Optional promotion-planning payload (Init landing plan Phase 2.C.2). Only
3355
+ * emitted when the CLI was able to compare current/incoming sources —
3356
+ * `breaking` / `foreign` entries leave it undefined.
3357
+ */
3358
+ promotion: z.ZodOptional<z.ZodObject<{
3359
+ fileType: z.ZodEnum<["component", "hook", "util", "type", "provider"]>;
3360
+ featureVector: z.ZodObject<{
3361
+ apiDelta: z.ZodObject<{
3362
+ added: z.ZodArray<z.ZodString, "many">;
3363
+ removed: z.ZodArray<z.ZodString, "many">;
3364
+ signatureChanged: z.ZodBoolean;
3365
+ }, "strip", z.ZodTypeAny, {
3366
+ added: string[];
3367
+ removed: string[];
3368
+ signatureChanged: boolean;
3369
+ }, {
3370
+ added: string[];
3371
+ removed: string[];
3372
+ signatureChanged: boolean;
3373
+ }>;
3374
+ styleDelta: z.ZodObject<{
3375
+ classNameDiff: z.ZodBoolean;
3376
+ tokenUsageDiff: z.ZodBoolean;
3377
+ }, "strip", z.ZodTypeAny, {
3378
+ classNameDiff: boolean;
3379
+ tokenUsageDiff: boolean;
3380
+ }, {
3381
+ classNameDiff: boolean;
3382
+ tokenUsageDiff: boolean;
3383
+ }>;
3384
+ logicDelta: z.ZodObject<{
3385
+ hasState: z.ZodBoolean;
3386
+ hasEffect: z.ZodBoolean;
3387
+ hasExtraImports: z.ZodBoolean;
3388
+ }, "strip", z.ZodTypeAny, {
3389
+ hasState: boolean;
3390
+ hasEffect: boolean;
3391
+ hasExtraImports: boolean;
3392
+ }, {
3393
+ hasState: boolean;
3394
+ hasEffect: boolean;
3395
+ hasExtraImports: boolean;
3396
+ }>;
3397
+ cvaDelta: z.ZodObject<{
3398
+ addedVariants: z.ZodArray<z.ZodString, "many">;
3399
+ modifiedVariants: z.ZodArray<z.ZodString, "many">;
3400
+ }, "strip", z.ZodTypeAny, {
3401
+ addedVariants: string[];
3402
+ modifiedVariants: string[];
3403
+ }, {
3404
+ addedVariants: string[];
3405
+ modifiedVariants: string[];
3406
+ }>;
3407
+ structureDelta: z.ZodObject<{
3408
+ isComposition: z.ZodBoolean;
3409
+ atomicChildren: z.ZodArray<z.ZodString, "many">;
3410
+ }, "strip", z.ZodTypeAny, {
3411
+ isComposition: boolean;
3412
+ atomicChildren: string[];
3413
+ }, {
3414
+ isComposition: boolean;
3415
+ atomicChildren: string[];
3416
+ }>;
3417
+ }, "strip", z.ZodTypeAny, {
3418
+ apiDelta: {
3419
+ added: string[];
3420
+ removed: string[];
3421
+ signatureChanged: boolean;
3422
+ };
3423
+ styleDelta: {
3424
+ classNameDiff: boolean;
3425
+ tokenUsageDiff: boolean;
3426
+ };
3427
+ logicDelta: {
3428
+ hasState: boolean;
3429
+ hasEffect: boolean;
3430
+ hasExtraImports: boolean;
3431
+ };
3432
+ cvaDelta: {
3433
+ addedVariants: string[];
3434
+ modifiedVariants: string[];
3435
+ };
3436
+ structureDelta: {
3437
+ isComposition: boolean;
3438
+ atomicChildren: string[];
3439
+ };
3440
+ }, {
3441
+ apiDelta: {
3442
+ added: string[];
3443
+ removed: string[];
3444
+ signatureChanged: boolean;
3445
+ };
3446
+ styleDelta: {
3447
+ classNameDiff: boolean;
3448
+ tokenUsageDiff: boolean;
3449
+ };
3450
+ logicDelta: {
3451
+ hasState: boolean;
3452
+ hasEffect: boolean;
3453
+ hasExtraImports: boolean;
3454
+ };
3455
+ cvaDelta: {
3456
+ addedVariants: string[];
3457
+ modifiedVariants: string[];
3458
+ };
3459
+ structureDelta: {
3460
+ isComposition: boolean;
3461
+ atomicChildren: string[];
3462
+ };
3463
+ }>;
3464
+ recommendedModes: z.ZodArray<z.ZodEnum<["Coexist", "Preset", "Wrapper", "Compose", "Variant", "Fork", "TokenOnly", "ManualReview"]>, "many">;
3465
+ confidence: z.ZodNumber;
3466
+ reasons: z.ZodArray<z.ZodString, "many">;
3467
+ }, "strip", z.ZodTypeAny, {
3468
+ fileType: "type" | "component" | "hook" | "util" | "provider";
3469
+ featureVector: {
3470
+ apiDelta: {
3471
+ added: string[];
3472
+ removed: string[];
3473
+ signatureChanged: boolean;
3474
+ };
3475
+ styleDelta: {
3476
+ classNameDiff: boolean;
3477
+ tokenUsageDiff: boolean;
3478
+ };
3479
+ logicDelta: {
3480
+ hasState: boolean;
3481
+ hasEffect: boolean;
3482
+ hasExtraImports: boolean;
3483
+ };
3484
+ cvaDelta: {
3485
+ addedVariants: string[];
3486
+ modifiedVariants: string[];
3487
+ };
3488
+ structureDelta: {
3489
+ isComposition: boolean;
3490
+ atomicChildren: string[];
3491
+ };
3492
+ };
3493
+ recommendedModes: ("Coexist" | "Preset" | "Wrapper" | "Compose" | "Variant" | "Fork" | "TokenOnly" | "ManualReview")[];
3494
+ confidence: number;
3495
+ reasons: string[];
3496
+ }, {
3497
+ fileType: "type" | "component" | "hook" | "util" | "provider";
3498
+ featureVector: {
3499
+ apiDelta: {
3500
+ added: string[];
3501
+ removed: string[];
3502
+ signatureChanged: boolean;
3503
+ };
3504
+ styleDelta: {
3505
+ classNameDiff: boolean;
3506
+ tokenUsageDiff: boolean;
3507
+ };
3508
+ logicDelta: {
3509
+ hasState: boolean;
3510
+ hasEffect: boolean;
3511
+ hasExtraImports: boolean;
3512
+ };
3513
+ cvaDelta: {
3514
+ addedVariants: string[];
3515
+ modifiedVariants: string[];
3516
+ };
3517
+ structureDelta: {
3518
+ isComposition: boolean;
3519
+ atomicChildren: string[];
3520
+ };
3521
+ };
3522
+ recommendedModes: ("Coexist" | "Preset" | "Wrapper" | "Compose" | "Variant" | "Fork" | "TokenOnly" | "ManualReview")[];
3523
+ confidence: number;
3524
+ reasons: string[];
3525
+ }>>;
3526
+ }, "strip", z.ZodTypeAny, {
3527
+ id: string;
3528
+ category: "ui" | "biz-ui";
3529
+ current: {
3530
+ target: string;
3531
+ hash: string | null;
3532
+ sourceLineage: "custom" | "teamix-evo" | "shadcn-native" | "absent";
3533
+ };
3534
+ diff: {
3535
+ riskLevel: "unchanged" | "upgradable-low" | "upgradable-medium" | "risky" | "breaking" | "foreign";
3536
+ hints: string[];
3537
+ filesChangedCount: number;
3538
+ diffRelPath?: string | undefined;
3539
+ };
3540
+ incoming?: {
3541
+ hash: string;
3542
+ sourceVersion: string;
3543
+ relPath: string;
3544
+ } | undefined;
3545
+ promotion?: {
3546
+ fileType: "type" | "component" | "hook" | "util" | "provider";
3547
+ featureVector: {
3548
+ apiDelta: {
3549
+ added: string[];
3550
+ removed: string[];
3551
+ signatureChanged: boolean;
3552
+ };
3553
+ styleDelta: {
3554
+ classNameDiff: boolean;
3555
+ tokenUsageDiff: boolean;
3556
+ };
3557
+ logicDelta: {
3558
+ hasState: boolean;
3559
+ hasEffect: boolean;
3560
+ hasExtraImports: boolean;
3561
+ };
3562
+ cvaDelta: {
3563
+ addedVariants: string[];
3564
+ modifiedVariants: string[];
3565
+ };
3566
+ structureDelta: {
3567
+ isComposition: boolean;
3568
+ atomicChildren: string[];
3569
+ };
3570
+ };
3571
+ recommendedModes: ("Coexist" | "Preset" | "Wrapper" | "Compose" | "Variant" | "Fork" | "TokenOnly" | "ManualReview")[];
3572
+ confidence: number;
3573
+ reasons: string[];
3574
+ } | undefined;
3575
+ }, {
3576
+ id: string;
3577
+ category: "ui" | "biz-ui";
3578
+ current: {
3579
+ target: string;
3580
+ hash: string | null;
3581
+ sourceLineage: "custom" | "teamix-evo" | "shadcn-native" | "absent";
3582
+ };
3583
+ diff: {
3584
+ riskLevel: "unchanged" | "upgradable-low" | "upgradable-medium" | "risky" | "breaking" | "foreign";
3585
+ hints: string[];
3586
+ filesChangedCount: number;
3587
+ diffRelPath?: string | undefined;
3588
+ };
3589
+ incoming?: {
3590
+ hash: string;
3591
+ sourceVersion: string;
3592
+ relPath: string;
3593
+ } | undefined;
3594
+ promotion?: {
3595
+ fileType: "type" | "component" | "hook" | "util" | "provider";
3596
+ featureVector: {
3597
+ apiDelta: {
3598
+ added: string[];
3599
+ removed: string[];
3600
+ signatureChanged: boolean;
3601
+ };
3602
+ styleDelta: {
3603
+ classNameDiff: boolean;
3604
+ tokenUsageDiff: boolean;
3605
+ };
3606
+ logicDelta: {
3607
+ hasState: boolean;
3608
+ hasEffect: boolean;
3609
+ hasExtraImports: boolean;
3610
+ };
3611
+ cvaDelta: {
3612
+ addedVariants: string[];
3613
+ modifiedVariants: string[];
3614
+ };
3615
+ structureDelta: {
3616
+ isComposition: boolean;
3617
+ atomicChildren: string[];
3618
+ };
3619
+ };
3620
+ recommendedModes: ("Coexist" | "Preset" | "Wrapper" | "Compose" | "Variant" | "Fork" | "TokenOnly" | "ManualReview")[];
3621
+ confidence: number;
3622
+ reasons: string[];
3623
+ } | undefined;
3624
+ }>;
3625
+ /**
3626
+ * Top-level staging manifest, written as `meta.json` in the staging dir.
3627
+ * Versioned independently from the project config (`schemaVersion: 1` here is
3628
+ * scoped to this manifest only).
3629
+ */
3630
+ declare const UpgradeStagingManifestSchema: z.ZodObject<{
3631
+ schemaVersion: z.ZodLiteral<1>;
3632
+ /** ISO-8601 timestamp the staging dir was created (matches dir suffix). */
3633
+ ts: z.ZodString;
3634
+ /** Which package category this staging covers. */
3635
+ package: z.ZodEnum<["ui", "biz-ui"]>;
3636
+ /** Which command produced this staging. */
3637
+ trigger: z.ZodEnum<["update", "ui-upgrade", "biz-ui-upgrade"]>;
3638
+ /** Variant applicable to the staging (always `_flat` for ui; concrete variant for biz-ui). */
3639
+ variant: z.ZodString;
3640
+ /** Installed package version (from `.teamix-evo/manifest.json`); empty string when foreign-only. */
3641
+ fromVersion: z.ZodString;
3642
+ /** Upstream package version. */
3643
+ toVersion: z.ZodString;
3644
+ /** Project-wide lineage classification. */
3645
+ lineage: z.ZodEnum<["teamix-evo", "shadcn-native", "mixed", "custom-only"]>;
3646
+ /** Aggregate counts grouped by riskLevel for quick AI summarization. */
3647
+ summary: z.ZodObject<{
3648
+ total: z.ZodNumber;
3649
+ byRisk: z.ZodRecord<z.ZodEnum<["unchanged", "upgradable-low", "upgradable-medium", "risky", "breaking", "foreign"]>, z.ZodNumber>;
3650
+ }, "strip", z.ZodTypeAny, {
3651
+ total: number;
3652
+ byRisk: Partial<Record<"unchanged" | "upgradable-low" | "upgradable-medium" | "risky" | "breaking" | "foreign", number>>;
3653
+ }, {
3654
+ total: number;
3655
+ byRisk: Partial<Record<"unchanged" | "upgradable-low" | "upgradable-medium" | "risky" | "breaking" | "foreign", number>>;
3656
+ }>;
3657
+ entries: z.ZodArray<z.ZodObject<{
3658
+ /** Component identifier matching the upstream registry (e.g. `"button"`). */
3659
+ id: z.ZodString;
3660
+ /** Which package category this entry belongs to. */
3661
+ category: z.ZodEnum<["ui", "biz-ui"]>;
3662
+ current: z.ZodObject<{
3663
+ /** Project-relative path of the component file (e.g. `src/components/ui/button.tsx`). */
3664
+ target: z.ZodString;
3665
+ /** Hash recorded in `.teamix-evo/manifest.json` at install time, or null when foreign. */
3666
+ hash: z.ZodNullable<z.ZodString>;
3667
+ /** Lineage of *this specific component* (independent of project-wide lineage). */
3668
+ sourceLineage: z.ZodEnum<["teamix-evo", "shadcn-native", "custom", "absent"]>;
3669
+ }, "strip", z.ZodTypeAny, {
3670
+ target: string;
3671
+ hash: string | null;
3672
+ sourceLineage: "custom" | "teamix-evo" | "shadcn-native" | "absent";
3673
+ }, {
3674
+ target: string;
3675
+ hash: string | null;
3676
+ sourceLineage: "custom" | "teamix-evo" | "shadcn-native" | "absent";
3677
+ }>;
3678
+ /** Absent when the entry is `breaking` (no incoming) or `foreign` (no upstream). */
3679
+ incoming: z.ZodOptional<z.ZodObject<{
3680
+ /** Package-level version the incoming source comes from. */
3681
+ sourceVersion: z.ZodString;
3682
+ /** Hash of incoming source after applying the consumer's import-rewrite aliases. */
3683
+ hash: z.ZodString;
3684
+ /** Path of the incoming source file relative to the staging dir (e.g. `button/incoming.tsx`). */
3685
+ relPath: z.ZodString;
3686
+ }, "strip", z.ZodTypeAny, {
3687
+ hash: string;
3688
+ sourceVersion: string;
3689
+ relPath: string;
3690
+ }, {
3691
+ hash: string;
3692
+ sourceVersion: string;
3693
+ relPath: string;
3694
+ }>>;
3695
+ diff: z.ZodObject<{
3696
+ riskLevel: z.ZodEnum<["unchanged", "upgradable-low", "upgradable-medium", "risky", "breaking", "foreign"]>;
3697
+ /** Human-readable, machine-parsable hints (e.g. `"new prop: loading"`, `"removed cva variant: ghost"`). */
3698
+ hints: z.ZodArray<z.ZodString, "many">;
3699
+ /** Number of files that differ for this entry (almost always 1 today; reserved for multi-file entries). */
3700
+ filesChangedCount: z.ZodNumber;
3701
+ /**
3702
+ * Path of the unified diff relative to the staging dir, when CLI emitted one.
3703
+ * Reserved for a future emitter — in schema v1 the CLI does **not** pre-render
3704
+ * `diff.unified.patch`; the consumer of the staging (the `teamix-evo-upgrade`
3705
+ * skill) computes the diff on the fly from `current.tsx` vs `incoming.tsx`.
3706
+ */
3707
+ diffRelPath: z.ZodOptional<z.ZodString>;
3708
+ }, "strip", z.ZodTypeAny, {
3709
+ riskLevel: "unchanged" | "upgradable-low" | "upgradable-medium" | "risky" | "breaking" | "foreign";
3710
+ hints: string[];
3711
+ filesChangedCount: number;
3712
+ diffRelPath?: string | undefined;
3713
+ }, {
3714
+ riskLevel: "unchanged" | "upgradable-low" | "upgradable-medium" | "risky" | "breaking" | "foreign";
3715
+ hints: string[];
3716
+ filesChangedCount: number;
3717
+ diffRelPath?: string | undefined;
3718
+ }>;
3719
+ /**
3720
+ * Optional promotion-planning payload (Init landing plan Phase 2.C.2). Only
3721
+ * emitted when the CLI was able to compare current/incoming sources —
3722
+ * `breaking` / `foreign` entries leave it undefined.
3723
+ */
3724
+ promotion: z.ZodOptional<z.ZodObject<{
3725
+ fileType: z.ZodEnum<["component", "hook", "util", "type", "provider"]>;
3726
+ featureVector: z.ZodObject<{
3727
+ apiDelta: z.ZodObject<{
3728
+ added: z.ZodArray<z.ZodString, "many">;
3729
+ removed: z.ZodArray<z.ZodString, "many">;
3730
+ signatureChanged: z.ZodBoolean;
3731
+ }, "strip", z.ZodTypeAny, {
3732
+ added: string[];
3733
+ removed: string[];
3734
+ signatureChanged: boolean;
3735
+ }, {
3736
+ added: string[];
3737
+ removed: string[];
3738
+ signatureChanged: boolean;
3739
+ }>;
3740
+ styleDelta: z.ZodObject<{
3741
+ classNameDiff: z.ZodBoolean;
3742
+ tokenUsageDiff: z.ZodBoolean;
3743
+ }, "strip", z.ZodTypeAny, {
3744
+ classNameDiff: boolean;
3745
+ tokenUsageDiff: boolean;
3746
+ }, {
3747
+ classNameDiff: boolean;
3748
+ tokenUsageDiff: boolean;
3749
+ }>;
3750
+ logicDelta: z.ZodObject<{
3751
+ hasState: z.ZodBoolean;
3752
+ hasEffect: z.ZodBoolean;
3753
+ hasExtraImports: z.ZodBoolean;
3754
+ }, "strip", z.ZodTypeAny, {
3755
+ hasState: boolean;
3756
+ hasEffect: boolean;
3757
+ hasExtraImports: boolean;
3758
+ }, {
3759
+ hasState: boolean;
3760
+ hasEffect: boolean;
3761
+ hasExtraImports: boolean;
3762
+ }>;
3763
+ cvaDelta: z.ZodObject<{
3764
+ addedVariants: z.ZodArray<z.ZodString, "many">;
3765
+ modifiedVariants: z.ZodArray<z.ZodString, "many">;
3766
+ }, "strip", z.ZodTypeAny, {
3767
+ addedVariants: string[];
3768
+ modifiedVariants: string[];
3769
+ }, {
3770
+ addedVariants: string[];
3771
+ modifiedVariants: string[];
3772
+ }>;
3773
+ structureDelta: z.ZodObject<{
3774
+ isComposition: z.ZodBoolean;
3775
+ atomicChildren: z.ZodArray<z.ZodString, "many">;
3776
+ }, "strip", z.ZodTypeAny, {
3777
+ isComposition: boolean;
3778
+ atomicChildren: string[];
3779
+ }, {
3780
+ isComposition: boolean;
3781
+ atomicChildren: string[];
3782
+ }>;
3783
+ }, "strip", z.ZodTypeAny, {
3784
+ apiDelta: {
3785
+ added: string[];
3786
+ removed: string[];
3787
+ signatureChanged: boolean;
3788
+ };
3789
+ styleDelta: {
3790
+ classNameDiff: boolean;
3791
+ tokenUsageDiff: boolean;
3792
+ };
3793
+ logicDelta: {
3794
+ hasState: boolean;
3795
+ hasEffect: boolean;
3796
+ hasExtraImports: boolean;
3797
+ };
3798
+ cvaDelta: {
3799
+ addedVariants: string[];
3800
+ modifiedVariants: string[];
3801
+ };
3802
+ structureDelta: {
3803
+ isComposition: boolean;
3804
+ atomicChildren: string[];
3805
+ };
3806
+ }, {
3807
+ apiDelta: {
3808
+ added: string[];
3809
+ removed: string[];
3810
+ signatureChanged: boolean;
3811
+ };
3812
+ styleDelta: {
3813
+ classNameDiff: boolean;
3814
+ tokenUsageDiff: boolean;
3815
+ };
3816
+ logicDelta: {
3817
+ hasState: boolean;
3818
+ hasEffect: boolean;
3819
+ hasExtraImports: boolean;
3820
+ };
3821
+ cvaDelta: {
3822
+ addedVariants: string[];
3823
+ modifiedVariants: string[];
3824
+ };
3825
+ structureDelta: {
3826
+ isComposition: boolean;
3827
+ atomicChildren: string[];
3828
+ };
3829
+ }>;
3830
+ recommendedModes: z.ZodArray<z.ZodEnum<["Coexist", "Preset", "Wrapper", "Compose", "Variant", "Fork", "TokenOnly", "ManualReview"]>, "many">;
3831
+ confidence: z.ZodNumber;
3832
+ reasons: z.ZodArray<z.ZodString, "many">;
3833
+ }, "strip", z.ZodTypeAny, {
3834
+ fileType: "type" | "component" | "hook" | "util" | "provider";
3835
+ featureVector: {
3836
+ apiDelta: {
3837
+ added: string[];
3838
+ removed: string[];
3839
+ signatureChanged: boolean;
3840
+ };
3841
+ styleDelta: {
3842
+ classNameDiff: boolean;
3843
+ tokenUsageDiff: boolean;
3844
+ };
3845
+ logicDelta: {
3846
+ hasState: boolean;
3847
+ hasEffect: boolean;
3848
+ hasExtraImports: boolean;
3849
+ };
3850
+ cvaDelta: {
3851
+ addedVariants: string[];
3852
+ modifiedVariants: string[];
3853
+ };
3854
+ structureDelta: {
3855
+ isComposition: boolean;
3856
+ atomicChildren: string[];
3857
+ };
3858
+ };
3859
+ recommendedModes: ("Coexist" | "Preset" | "Wrapper" | "Compose" | "Variant" | "Fork" | "TokenOnly" | "ManualReview")[];
3860
+ confidence: number;
3861
+ reasons: string[];
3862
+ }, {
3863
+ fileType: "type" | "component" | "hook" | "util" | "provider";
3864
+ featureVector: {
3865
+ apiDelta: {
3866
+ added: string[];
3867
+ removed: string[];
3868
+ signatureChanged: boolean;
3869
+ };
3870
+ styleDelta: {
3871
+ classNameDiff: boolean;
3872
+ tokenUsageDiff: boolean;
3873
+ };
3874
+ logicDelta: {
3875
+ hasState: boolean;
3876
+ hasEffect: boolean;
3877
+ hasExtraImports: boolean;
3878
+ };
3879
+ cvaDelta: {
3880
+ addedVariants: string[];
3881
+ modifiedVariants: string[];
3882
+ };
3883
+ structureDelta: {
3884
+ isComposition: boolean;
3885
+ atomicChildren: string[];
3886
+ };
3887
+ };
3888
+ recommendedModes: ("Coexist" | "Preset" | "Wrapper" | "Compose" | "Variant" | "Fork" | "TokenOnly" | "ManualReview")[];
3889
+ confidence: number;
3890
+ reasons: string[];
3891
+ }>>;
3892
+ }, "strip", z.ZodTypeAny, {
3893
+ id: string;
3894
+ category: "ui" | "biz-ui";
3895
+ current: {
3896
+ target: string;
3897
+ hash: string | null;
3898
+ sourceLineage: "custom" | "teamix-evo" | "shadcn-native" | "absent";
3899
+ };
3900
+ diff: {
3901
+ riskLevel: "unchanged" | "upgradable-low" | "upgradable-medium" | "risky" | "breaking" | "foreign";
3902
+ hints: string[];
3903
+ filesChangedCount: number;
3904
+ diffRelPath?: string | undefined;
3905
+ };
3906
+ incoming?: {
3907
+ hash: string;
3908
+ sourceVersion: string;
3909
+ relPath: string;
3910
+ } | undefined;
3911
+ promotion?: {
3912
+ fileType: "type" | "component" | "hook" | "util" | "provider";
3913
+ featureVector: {
3914
+ apiDelta: {
3915
+ added: string[];
3916
+ removed: string[];
3917
+ signatureChanged: boolean;
3918
+ };
3919
+ styleDelta: {
3920
+ classNameDiff: boolean;
3921
+ tokenUsageDiff: boolean;
3922
+ };
3923
+ logicDelta: {
3924
+ hasState: boolean;
3925
+ hasEffect: boolean;
3926
+ hasExtraImports: boolean;
3927
+ };
3928
+ cvaDelta: {
3929
+ addedVariants: string[];
3930
+ modifiedVariants: string[];
3931
+ };
3932
+ structureDelta: {
3933
+ isComposition: boolean;
3934
+ atomicChildren: string[];
3935
+ };
3936
+ };
3937
+ recommendedModes: ("Coexist" | "Preset" | "Wrapper" | "Compose" | "Variant" | "Fork" | "TokenOnly" | "ManualReview")[];
3938
+ confidence: number;
3939
+ reasons: string[];
3940
+ } | undefined;
3941
+ }, {
3942
+ id: string;
3943
+ category: "ui" | "biz-ui";
3944
+ current: {
3945
+ target: string;
3946
+ hash: string | null;
3947
+ sourceLineage: "custom" | "teamix-evo" | "shadcn-native" | "absent";
3948
+ };
3949
+ diff: {
3950
+ riskLevel: "unchanged" | "upgradable-low" | "upgradable-medium" | "risky" | "breaking" | "foreign";
3951
+ hints: string[];
3952
+ filesChangedCount: number;
3953
+ diffRelPath?: string | undefined;
3954
+ };
3955
+ incoming?: {
3956
+ hash: string;
3957
+ sourceVersion: string;
3958
+ relPath: string;
3959
+ } | undefined;
3960
+ promotion?: {
3961
+ fileType: "type" | "component" | "hook" | "util" | "provider";
3962
+ featureVector: {
3963
+ apiDelta: {
3964
+ added: string[];
3965
+ removed: string[];
3966
+ signatureChanged: boolean;
3967
+ };
3968
+ styleDelta: {
3969
+ classNameDiff: boolean;
3970
+ tokenUsageDiff: boolean;
3971
+ };
3972
+ logicDelta: {
3973
+ hasState: boolean;
3974
+ hasEffect: boolean;
3975
+ hasExtraImports: boolean;
3976
+ };
3977
+ cvaDelta: {
3978
+ addedVariants: string[];
3979
+ modifiedVariants: string[];
3980
+ };
3981
+ structureDelta: {
3982
+ isComposition: boolean;
3983
+ atomicChildren: string[];
3984
+ };
3985
+ };
3986
+ recommendedModes: ("Coexist" | "Preset" | "Wrapper" | "Compose" | "Variant" | "Fork" | "TokenOnly" | "ManualReview")[];
3987
+ confidence: number;
3988
+ reasons: string[];
3989
+ } | undefined;
3990
+ }>, "many">;
3991
+ }, "strip", z.ZodTypeAny, {
3992
+ entries: {
3993
+ id: string;
3994
+ category: "ui" | "biz-ui";
3995
+ current: {
3996
+ target: string;
3997
+ hash: string | null;
3998
+ sourceLineage: "custom" | "teamix-evo" | "shadcn-native" | "absent";
3999
+ };
4000
+ diff: {
4001
+ riskLevel: "unchanged" | "upgradable-low" | "upgradable-medium" | "risky" | "breaking" | "foreign";
4002
+ hints: string[];
4003
+ filesChangedCount: number;
4004
+ diffRelPath?: string | undefined;
4005
+ };
4006
+ incoming?: {
4007
+ hash: string;
4008
+ sourceVersion: string;
4009
+ relPath: string;
4010
+ } | undefined;
4011
+ promotion?: {
4012
+ fileType: "type" | "component" | "hook" | "util" | "provider";
4013
+ featureVector: {
4014
+ apiDelta: {
4015
+ added: string[];
4016
+ removed: string[];
4017
+ signatureChanged: boolean;
4018
+ };
4019
+ styleDelta: {
4020
+ classNameDiff: boolean;
4021
+ tokenUsageDiff: boolean;
4022
+ };
4023
+ logicDelta: {
4024
+ hasState: boolean;
4025
+ hasEffect: boolean;
4026
+ hasExtraImports: boolean;
4027
+ };
4028
+ cvaDelta: {
4029
+ addedVariants: string[];
4030
+ modifiedVariants: string[];
4031
+ };
4032
+ structureDelta: {
4033
+ isComposition: boolean;
4034
+ atomicChildren: string[];
4035
+ };
4036
+ };
4037
+ recommendedModes: ("Coexist" | "Preset" | "Wrapper" | "Compose" | "Variant" | "Fork" | "TokenOnly" | "ManualReview")[];
4038
+ confidence: number;
4039
+ reasons: string[];
4040
+ } | undefined;
4041
+ }[];
4042
+ schemaVersion: 1;
4043
+ package: "ui" | "biz-ui";
4044
+ variant: string;
4045
+ ts: string;
4046
+ fromVersion: string;
4047
+ toVersion: string;
4048
+ trigger: "update" | "ui-upgrade" | "biz-ui-upgrade";
4049
+ lineage: "teamix-evo" | "shadcn-native" | "mixed" | "custom-only";
4050
+ summary: {
4051
+ total: number;
4052
+ byRisk: Partial<Record<"unchanged" | "upgradable-low" | "upgradable-medium" | "risky" | "breaking" | "foreign", number>>;
4053
+ };
4054
+ }, {
4055
+ entries: {
4056
+ id: string;
4057
+ category: "ui" | "biz-ui";
4058
+ current: {
4059
+ target: string;
4060
+ hash: string | null;
4061
+ sourceLineage: "custom" | "teamix-evo" | "shadcn-native" | "absent";
4062
+ };
4063
+ diff: {
4064
+ riskLevel: "unchanged" | "upgradable-low" | "upgradable-medium" | "risky" | "breaking" | "foreign";
4065
+ hints: string[];
4066
+ filesChangedCount: number;
4067
+ diffRelPath?: string | undefined;
4068
+ };
4069
+ incoming?: {
4070
+ hash: string;
4071
+ sourceVersion: string;
4072
+ relPath: string;
4073
+ } | undefined;
4074
+ promotion?: {
4075
+ fileType: "type" | "component" | "hook" | "util" | "provider";
4076
+ featureVector: {
4077
+ apiDelta: {
4078
+ added: string[];
4079
+ removed: string[];
4080
+ signatureChanged: boolean;
4081
+ };
4082
+ styleDelta: {
4083
+ classNameDiff: boolean;
4084
+ tokenUsageDiff: boolean;
4085
+ };
4086
+ logicDelta: {
4087
+ hasState: boolean;
4088
+ hasEffect: boolean;
4089
+ hasExtraImports: boolean;
4090
+ };
4091
+ cvaDelta: {
4092
+ addedVariants: string[];
4093
+ modifiedVariants: string[];
4094
+ };
4095
+ structureDelta: {
4096
+ isComposition: boolean;
4097
+ atomicChildren: string[];
4098
+ };
4099
+ };
4100
+ recommendedModes: ("Coexist" | "Preset" | "Wrapper" | "Compose" | "Variant" | "Fork" | "TokenOnly" | "ManualReview")[];
4101
+ confidence: number;
4102
+ reasons: string[];
4103
+ } | undefined;
4104
+ }[];
4105
+ schemaVersion: 1;
4106
+ package: "ui" | "biz-ui";
4107
+ variant: string;
4108
+ ts: string;
4109
+ fromVersion: string;
4110
+ toVersion: string;
4111
+ trigger: "update" | "ui-upgrade" | "biz-ui-upgrade";
4112
+ lineage: "teamix-evo" | "shadcn-native" | "mixed" | "custom-only";
4113
+ summary: {
4114
+ total: number;
4115
+ byRisk: Partial<Record<"unchanged" | "upgradable-low" | "upgradable-medium" | "risky" | "breaking" | "foreign", number>>;
4116
+ };
4117
+ }>;
4118
+ type UpgradeRiskLevel = z.infer<typeof UpgradeRiskLevelSchema>;
4119
+ type ComponentLineage = z.infer<typeof ComponentLineageSchema>;
4120
+ type UpgradeStagingCategory = z.infer<typeof UpgradeStagingCategorySchema>;
4121
+ type UpgradeStagingTrigger = z.infer<typeof UpgradeStagingTriggerSchema>;
4122
+ type UpgradeStagingCurrent = z.infer<typeof UpgradeStagingCurrentSchema>;
4123
+ type UpgradeStagingIncoming = z.infer<typeof UpgradeStagingIncomingSchema>;
4124
+ type UpgradeStagingDiff = z.infer<typeof UpgradeStagingDiffSchema>;
4125
+ type UpgradeStagingEntry = z.infer<typeof UpgradeStagingEntrySchema>;
4126
+ type UpgradeStagingManifest = z.infer<typeof UpgradeStagingManifestSchema>;
4127
+ type PromoteFileType = z.infer<typeof PromoteFileTypeSchema>;
4128
+ type PromoteMode = z.infer<typeof PromoteModeSchema>;
4129
+ type PromoteFeatureVector = z.infer<typeof PromoteFeatureVectorSchema>;
4130
+ type UpgradeStagingPromotion = z.infer<typeof UpgradeStagingPromotionSchema>;
4131
+
2069
4132
  /** Resource update strategy */
2070
4133
  type UpdateStrategy = z.infer<typeof UpdateStrategySchema>;
2071
4134
  /** Resource type discriminator */
@@ -2098,8 +4161,26 @@ type UiAliases = z.infer<typeof UiAliasesSchema>;
2098
4161
  type PackageEntry = z.infer<typeof PackageEntrySchema>;
2099
4162
  /** Tailwind CSS major version (always `"v4"` since v0.7). */
2100
4163
  type TailwindVersion = z.infer<typeof TailwindVersionSchema>;
2101
- /** Project configuration (config.json) */
4164
+ /**
4165
+ * Project configuration v1 — legacy shape kept for migration only. New code
4166
+ * should use `ProjectConfig` (≡ v2) which `validateConfig` always returns.
4167
+ */
4168
+ type ProjectConfigV1 = z.infer<typeof ProjectConfigV1Schema>;
4169
+ /**
4170
+ * Project configuration v2 — current shape with failure-recovery fields
4171
+ * (`priorVariant` / `lastUpdate` / `tokenRenameHistory`). Equivalent to
4172
+ * `ProjectConfig`.
4173
+ */
4174
+ type ProjectConfigV2 = z.infer<typeof ProjectConfigV2Schema>;
4175
+ /**
4176
+ * Project configuration (config.json) — always v2 after parsing; legacy v1
4177
+ * documents are auto-migrated by `ProjectConfigSchema.transform`.
4178
+ */
2102
4179
  type ProjectConfig = z.infer<typeof ProjectConfigSchema>;
4180
+ /** Token rename record stored in `tokenRenameHistory`. */
4181
+ type TokenRenameRecord = z.infer<typeof TokenRenameRecordSchema>;
4182
+ /** Last successful update record stored in `lastUpdate[pkgName]`. */
4183
+ type LastUpdateRecord = z.infer<typeof LastUpdateRecordSchema>;
2103
4184
  /** An installed resource tracking entry */
2104
4185
  type InstalledResource = z.infer<typeof InstalledResourceSchema>;
2105
4186
  /** An installed package tracking entry */
@@ -2117,6 +4198,24 @@ interface ManagedRegion {
2117
4198
  /** Content between start and end markers */
2118
4199
  content: string;
2119
4200
  }
4201
+ /**
4202
+ * Ordered slice of a document, classifying each chunk as either user-owned
4203
+ * (`unmanaged`) or framework-owned (`managed`). Used by the update pipeline
4204
+ * (ADR 0019 §2) to apply tri-state semantics — `regenerable` rewrites the
4205
+ * whole file, `managed` rewrites only `managed` segments and preserves
4206
+ * `unmanaged` ones verbatim, `frozen` skips entirely.
4207
+ *
4208
+ * Concatenating every segment's textual form (start marker + content + end
4209
+ * marker for managed; content for unmanaged) reconstructs the original
4210
+ * document byte-for-byte.
4211
+ */
4212
+ type DocumentSegment = {
4213
+ kind: 'unmanaged';
4214
+ content: string;
4215
+ } | {
4216
+ kind: 'managed';
4217
+ region: ManagedRegion;
4218
+ };
2120
4219
  /** Generic result type for validation operations */
2121
4220
  type Result<T> = {
2122
4221
  success: true;
@@ -2250,6 +4349,58 @@ declare function replaceManagedRegion(content: string, id: string, newContent: s
2250
4349
  * @returns true if the region exists
2251
4350
  */
2252
4351
  declare function hasManagedRegion(content: string, id: string): boolean;
4352
+ /**
4353
+ * Split a document into an ordered sequence of {@link DocumentSegment}s,
4354
+ * classifying each chunk as either `unmanaged` (user-owned) or `managed`
4355
+ * (framework-owned, identified by `<!-- teamix-evo:managed:start id="..." -->`
4356
+ * markers).
4357
+ *
4358
+ * The output preserves the document byte-for-byte: concatenating each
4359
+ * segment's serialized form—marker + content + marker for `managed`,
4360
+ * `content` for `unmanaged`—reconstructs the original input exactly.
4361
+ *
4362
+ * `unmanaged` segments may be empty strings when two managed regions touch
4363
+ * each other or sit at the document edges — callers SHOULD preserve them so
4364
+ * a later round-trip (split → mutate managed only → join) does not silently
4365
+ * drop boundary structure.
4366
+ *
4367
+ * Marker integrity is enforced via {@link parseManagedRegions} — unmatched
4368
+ * or duplicate markers throw. The update pipeline (ADR 0019 §2) relies on
4369
+ * this contract so a corrupted file fails fast rather than producing
4370
+ * unexpected merges.
4371
+ *
4372
+ * @example
4373
+ * const segs = splitManagedRegions(
4374
+ * `prelude\n<!-- teamix-evo:managed:start id="core" -->\nA\n<!-- teamix-evo:managed:end id="core" -->\ntail`,
4375
+ * );
4376
+ * // [
4377
+ * // { kind: 'unmanaged', content: 'prelude\n' },
4378
+ * // { kind: 'managed', region: { id: 'core', …, content: '\nA\n' } },
4379
+ * // { kind: 'unmanaged', content: '\ntail' },
4380
+ * // ]
4381
+ *
4382
+ * @param content - The full document content.
4383
+ * @returns Ordered segments covering the entire input.
4384
+ * @throws Error when start/end markers are unmatched or a start id appears more than once.
4385
+ */
4386
+ declare function splitManagedRegions(content: string): DocumentSegment[];
4387
+ /**
4388
+ * Extract the leading YAML frontmatter block (including the surrounding
4389
+ * `---` fences and the trailing newline, if any) from a document.
4390
+ *
4391
+ * Returns `null` when the document does not start with a frontmatter block.
4392
+ */
4393
+ declare function extractFrontmatter(content: string): string | null;
4394
+ /**
4395
+ * Replace the leading YAML frontmatter block of `content` with
4396
+ * `newFrontmatter`. If `content` has no frontmatter, `newFrontmatter` is
4397
+ * prepended (separated by a single newline if it does not already end
4398
+ * with one).
4399
+ *
4400
+ * `newFrontmatter` must include the surrounding `---` fences — pass the
4401
+ * value returned by {@link extractFrontmatter}.
4402
+ */
4403
+ declare function replaceFrontmatter(content: string, newFrontmatter: string): string;
2253
4404
 
2254
4405
  /**
2255
4406
  * Determine whether a resource should be updated based on its strategy
@@ -2279,4 +4430,4 @@ interface UpdateActionOptions {
2279
4430
  */
2280
4431
  declare function getUpdateAction(strategy: UpdateStrategy, options: UpdateActionOptions): UpdateAction;
2281
4432
 
2282
- export { type InstalledManifest, InstalledManifestSchema, type InstalledPackage, InstalledPackageSchema, type InstalledResource, InstalledResourceSchema, type ManagedRegion, type PackageEntry, PackageEntrySchema, type ProjectConfig, ProjectConfigSchema, type Resource, ResourceSchema, type ResourceType, ResourceTypeSchema, type Result, type SkillEntry, SkillEntrySchema, type SkillIde, SkillIdeSchema, type SkillScope, SkillScopeSchema, type SkillsLock, type SkillsLockEntry, SkillsLockEntrySchema, SkillsLockSchema, type SkillsPackageManifest, SkillsPackageManifestSchema, type TailwindVersion, TailwindVersionSchema, type TokensPackLinked, TokensPackLinkedSchema, type TokensPackLock, TokensPackLockSchema, type TokensPackageManifest, TokensPackageManifestSchema, type TokensVariantEntry, TokensVariantEntrySchema, type UiAlias, UiAliasSchema, type UiAliases, UiAliasesSchema, type UiEntry, type UiEntryFile, UiEntryFileSchema, UiEntrySchema, type UiEntryType, UiEntryTypeSchema, type UiPackageManifest, UiPackageManifestSchema, type UpdateAction, type UpdateActionOptions, type UpdateStrategy, UpdateStrategySchema, type VariantManifest, VariantManifestSchema, type VariantUiPackageCatalog, VariantUiPackageCatalogSchema, type VariantUiPackageManifest, VariantUiPackageManifestSchema, type VariantUiPackageName, VariantUiPackageNameSchema, getUpdateAction, getVariantEntry, hasManagedRegion, loadSkillsPackageManifest, loadTokensPackageManifest, loadUiPackageManifest, loadVariantManifest, loadVariantUiPackageCatalog, loadVariantUiPackageManifest, parseManagedRegions, replaceManagedRegion, resolveUiEntryOrder, shouldUpdate, validateConfig, validateInstalled, validateManifest, validateSkillsLock, validateSkillsPackage, validateUiDependencyGraph, validateUiPackage };
4433
+ export { type ComponentLineage, ComponentLineageSchema, type DocumentSegment, type InstalledManifest, InstalledManifestSchema, type InstalledPackage, InstalledPackageSchema, type InstalledResource, InstalledResourceSchema, type LastUpdateRecord, LastUpdateRecordSchema, type ManagedRegion, type PackageEntry, PackageEntrySchema, type ProjectConfig, ProjectConfigSchema, type ProjectConfigV1, ProjectConfigV1Schema, type ProjectConfigV2, ProjectConfigV2Schema, type PromoteFeatureVector, PromoteFeatureVectorSchema, type PromoteFileType, PromoteFileTypeSchema, type PromoteMode, PromoteModeSchema, type Resource, ResourceSchema, type ResourceType, ResourceTypeSchema, type Result, type SkillEntry, SkillEntrySchema, type SkillIde, SkillIdeSchema, type SkillScope, SkillScopeSchema, type SkillsLock, type SkillsLockEntry, SkillsLockEntrySchema, SkillsLockSchema, type SkillsPackageManifest, SkillsPackageManifestSchema, type TailwindVersion, TailwindVersionSchema, type TokenRenameEntry, TokenRenameEntrySchema, type TokenRenameRecord, TokenRenameRecordSchema, type TokensPackLinked, TokensPackLinkedSchema, type TokensPackLock, TokensPackLockSchema, type TokensPackageManifest, TokensPackageManifestSchema, type TokensVariantEntry, TokensVariantEntrySchema, type UiAlias, UiAliasSchema, type UiAliases, UiAliasesSchema, type UiEntry, type UiEntryFile, UiEntryFileSchema, UiEntrySchema, type UiEntryType, UiEntryTypeSchema, type UiPackageManifest, UiPackageManifestSchema, type UpdateAction, type UpdateActionOptions, type UpdateStrategy, UpdateStrategySchema, type UpgradeRiskLevel, UpgradeRiskLevelSchema, type UpgradeStagingCategory, UpgradeStagingCategorySchema, type UpgradeStagingCurrent, UpgradeStagingCurrentSchema, type UpgradeStagingDiff, UpgradeStagingDiffSchema, type UpgradeStagingEntry, UpgradeStagingEntrySchema, type UpgradeStagingIncoming, UpgradeStagingIncomingSchema, type UpgradeStagingManifest, UpgradeStagingManifestSchema, type UpgradeStagingPromotion, UpgradeStagingPromotionSchema, type UpgradeStagingTrigger, UpgradeStagingTriggerSchema, type VariantManifest, VariantManifestSchema, type VariantUiPackageCatalog, VariantUiPackageCatalogSchema, type VariantUiPackageManifest, VariantUiPackageManifestSchema, type VariantUiPackageName, VariantUiPackageNameSchema, extractFrontmatter, getUpdateAction, getVariantEntry, hasManagedRegion, loadSkillsPackageManifest, loadTokensPackageManifest, loadUiPackageManifest, loadVariantManifest, loadVariantUiPackageCatalog, loadVariantUiPackageManifest, parseManagedRegions, replaceFrontmatter, replaceManagedRegion, resolveUiEntryOrder, shouldUpdate, splitManagedRegions, validateConfig, validateInstalled, validateManifest, validateSkillsLock, validateSkillsPackage, validateUiDependencyGraph, validateUiPackage };