@usefragments/core 1.5.0 → 1.5.2

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.
Files changed (65) hide show
  1. package/dist/{chunk-HXGE3O2F.js → chunk-BAHCOAVG.js} +133 -7
  2. package/dist/chunk-BAHCOAVG.js.map +1 -0
  3. package/dist/{chunk-57QDBEHQ.js → chunk-ZHS52OT4.js} +3 -9
  4. package/dist/chunk-ZHS52OT4.js.map +1 -0
  5. package/dist/codes/index.d.ts +2 -2
  6. package/dist/codes/index.js +2 -2
  7. package/dist/compiled-types/index.d.ts +1 -1
  8. package/dist/generate/index.d.ts +1 -1
  9. package/dist/{governance-BLsyk56o.d.ts → governance-pKrfh517.d.ts} +264 -4
  10. package/dist/{index-h_yWj15D.d.ts → index-DbkPE46t.d.ts} +40 -0
  11. package/dist/index.d.ts +472 -28
  12. package/dist/index.js +561 -39
  13. package/dist/index.js.map +1 -1
  14. package/dist/react-types.d.ts +1 -1
  15. package/dist/schemas/index.d.ts +1 -1
  16. package/dist/schemas/index.js +1 -1
  17. package/dist/test-utils.d.ts +1 -1
  18. package/package.json +1 -1
  19. package/src/agent-format.test.ts +1 -0
  20. package/src/canonical-bridge.ts +46 -0
  21. package/src/canonical-direction.ts +118 -0
  22. package/src/codes/__tests__/codes.test.ts +1 -1
  23. package/src/codes/codes.ts +29 -0
  24. package/src/config.ts +20 -0
  25. package/src/contract/preimage.test.ts +40 -0
  26. package/src/contract/preimage.ts +20 -0
  27. package/src/effective-governance-inputs.test.ts +52 -0
  28. package/src/effective-governance-inputs.ts +106 -0
  29. package/src/facts/builders.ts +25 -1
  30. package/src/facts/compile.ts +20 -2
  31. package/src/facts/fact-index.ts +12 -1
  32. package/src/facts/facts.test.ts +14 -18
  33. package/src/facts/types.ts +25 -6
  34. package/src/governance-integrity.test.ts +127 -0
  35. package/src/governance-integrity.ts +326 -4
  36. package/src/governance.test.ts +87 -1
  37. package/src/governance.ts +121 -0
  38. package/src/index.ts +34 -5
  39. package/src/rules/__tests__/fix-emission-invariant.test.ts +35 -4
  40. package/src/rules/components-prefer-library.test.ts +103 -0
  41. package/src/rules/components-prefer-library.ts +30 -4
  42. package/src/rules/fix-availability.ts +1 -0
  43. package/src/rules/index.ts +7 -0
  44. package/src/rules/jsx-preferred-import-path.ts +45 -9
  45. package/src/rules/rules.test.ts +202 -6
  46. package/src/rules/spacing-resolution.ts +2 -2
  47. package/src/rules/styles-no-raw-color.test.ts +6 -1
  48. package/src/rules/styles-no-raw-color.ts +3 -2
  49. package/src/rules/styles-no-raw-dimensions.ts +5 -7
  50. package/src/rules/styles-no-raw-spacing.test.ts +48 -0
  51. package/src/rules/styles-no-raw-spacing.ts +10 -7
  52. package/src/rules/styles-no-raw-typography.ts +7 -4
  53. package/src/rules/taxonomy.test.ts +3 -0
  54. package/src/rules/tiers.ts +2 -0
  55. package/src/rules/token-candidates.ts +36 -0
  56. package/src/rules/tokens-require-dual-fallback.ts +2 -1
  57. package/src/rules/tokens-upstream-drift.test.ts +111 -0
  58. package/src/rules/tokens-upstream-drift.ts +57 -0
  59. package/src/rules/utils.ts +22 -14
  60. package/src/schema.ts +13 -0
  61. package/src/schemas/index.ts +5 -8
  62. package/src/token-types.ts +71 -1
  63. package/src/types.ts +27 -3
  64. package/dist/chunk-57QDBEHQ.js.map +0 -1
  65. package/dist/chunk-HXGE3O2F.js.map +0 -1
@@ -2416,6 +2416,7 @@ declare const agentFormatSchema: z.ZodUnion<[z.ZodObject<{
2416
2416
  }>;
2417
2417
  engineVersion: z.ZodString;
2418
2418
  scopeHash: z.ZodString;
2419
+ inputsHash: z.ZodOptional<z.ZodString>;
2419
2420
  inputFilesHash: z.ZodString;
2420
2421
  }, "strip", z.ZodTypeAny, {
2421
2422
  scope: {
@@ -2428,6 +2429,7 @@ declare const agentFormatSchema: z.ZodUnion<[z.ZodObject<{
2428
2429
  scopeHash: string;
2429
2430
  inputFilesHash: string;
2430
2431
  baselineId?: string | undefined;
2432
+ inputsHash?: string | undefined;
2431
2433
  }, {
2432
2434
  scope: {
2433
2435
  method: "status" | "three-dot" | "tree-diff" | "fallback-full" | "explicit" | "full";
@@ -2439,6 +2441,7 @@ declare const agentFormatSchema: z.ZodUnion<[z.ZodObject<{
2439
2441
  scopeHash: string;
2440
2442
  inputFilesHash: string;
2441
2443
  baselineId?: string | undefined;
2444
+ inputsHash?: string | undefined;
2442
2445
  }>>;
2443
2446
  verdict: z.ZodOptional<z.ZodObject<{
2444
2447
  exitCode: z.ZodUnion<[z.ZodLiteral<0>, z.ZodLiteral<1>]>;
@@ -2619,6 +2622,7 @@ declare const agentFormatSchema: z.ZodUnion<[z.ZodObject<{
2619
2622
  scopeHash: string;
2620
2623
  inputFilesHash: string;
2621
2624
  baselineId?: string | undefined;
2625
+ inputsHash?: string | undefined;
2622
2626
  } | undefined;
2623
2627
  }, {
2624
2628
  passed: boolean;
@@ -2761,6 +2765,7 @@ declare const agentFormatSchema: z.ZodUnion<[z.ZodObject<{
2761
2765
  scopeHash: string;
2762
2766
  inputFilesHash: string;
2763
2767
  baselineId?: string | undefined;
2768
+ inputsHash?: string | undefined;
2764
2769
  } | undefined;
2765
2770
  }>, z.ZodObject<{
2766
2771
  schemaVersion: z.ZodLiteral<"typestyle.agent.v2">;
@@ -3208,6 +3213,7 @@ declare const agentFormatSchema: z.ZodUnion<[z.ZodObject<{
3208
3213
  }>;
3209
3214
  engineVersion: z.ZodString;
3210
3215
  scopeHash: z.ZodString;
3216
+ inputsHash: z.ZodOptional<z.ZodString>;
3211
3217
  inputFilesHash: z.ZodString;
3212
3218
  }, "strip", z.ZodTypeAny, {
3213
3219
  scope: {
@@ -3220,6 +3226,7 @@ declare const agentFormatSchema: z.ZodUnion<[z.ZodObject<{
3220
3226
  scopeHash: string;
3221
3227
  inputFilesHash: string;
3222
3228
  baselineId?: string | undefined;
3229
+ inputsHash?: string | undefined;
3223
3230
  }, {
3224
3231
  scope: {
3225
3232
  method: "status" | "three-dot" | "tree-diff" | "fallback-full" | "explicit" | "full";
@@ -3231,6 +3238,7 @@ declare const agentFormatSchema: z.ZodUnion<[z.ZodObject<{
3231
3238
  scopeHash: string;
3232
3239
  inputFilesHash: string;
3233
3240
  baselineId?: string | undefined;
3241
+ inputsHash?: string | undefined;
3234
3242
  }>>;
3235
3243
  verdict: z.ZodOptional<z.ZodObject<{
3236
3244
  exitCode: z.ZodUnion<[z.ZodLiteral<0>, z.ZodLiteral<1>]>;
@@ -3411,6 +3419,7 @@ declare const agentFormatSchema: z.ZodUnion<[z.ZodObject<{
3411
3419
  scopeHash: string;
3412
3420
  inputFilesHash: string;
3413
3421
  baselineId?: string | undefined;
3422
+ inputsHash?: string | undefined;
3414
3423
  } | undefined;
3415
3424
  }, {
3416
3425
  status: "indeterminate";
@@ -3553,6 +3562,7 @@ declare const agentFormatSchema: z.ZodUnion<[z.ZodObject<{
3553
3562
  scopeHash: string;
3554
3563
  inputFilesHash: string;
3555
3564
  baselineId?: string | undefined;
3565
+ inputsHash?: string | undefined;
3556
3566
  } | undefined;
3557
3567
  }>, z.ZodObject<{
3558
3568
  schemaVersion: z.ZodLiteral<"typestyle.agent.v2">;
@@ -4025,6 +4035,7 @@ declare const agentFormatSchema: z.ZodUnion<[z.ZodObject<{
4025
4035
  }>;
4026
4036
  engineVersion: z.ZodString;
4027
4037
  scopeHash: z.ZodString;
4038
+ inputsHash: z.ZodOptional<z.ZodString>;
4028
4039
  inputFilesHash: z.ZodString;
4029
4040
  }, "strip", z.ZodTypeAny, {
4030
4041
  scope: {
@@ -4037,6 +4048,7 @@ declare const agentFormatSchema: z.ZodUnion<[z.ZodObject<{
4037
4048
  scopeHash: string;
4038
4049
  inputFilesHash: string;
4039
4050
  baselineId?: string | undefined;
4051
+ inputsHash?: string | undefined;
4040
4052
  }, {
4041
4053
  scope: {
4042
4054
  method: "status" | "three-dot" | "tree-diff" | "fallback-full" | "explicit" | "full";
@@ -4048,6 +4060,7 @@ declare const agentFormatSchema: z.ZodUnion<[z.ZodObject<{
4048
4060
  scopeHash: string;
4049
4061
  inputFilesHash: string;
4050
4062
  baselineId?: string | undefined;
4063
+ inputsHash?: string | undefined;
4051
4064
  }>;
4052
4065
  verdict: z.ZodObject<{
4053
4066
  reasons: z.ZodArray<z.ZodString, "many">;
@@ -4136,6 +4149,7 @@ declare const agentFormatSchema: z.ZodUnion<[z.ZodObject<{
4136
4149
  scopeHash: string;
4137
4150
  inputFilesHash: string;
4138
4151
  baselineId?: string | undefined;
4152
+ inputsHash?: string | undefined;
4139
4153
  };
4140
4154
  findings?: {
4141
4155
  message: string;
@@ -4278,6 +4292,7 @@ declare const agentFormatSchema: z.ZodUnion<[z.ZodObject<{
4278
4292
  scopeHash: string;
4279
4293
  inputFilesHash: string;
4280
4294
  baselineId?: string | undefined;
4295
+ inputsHash?: string | undefined;
4281
4296
  };
4282
4297
  findings?: {
4283
4298
  message: string;
@@ -4378,6 +4393,7 @@ declare const agentErrorEnvelopeSchema: z.ZodObject<{
4378
4393
  }>;
4379
4394
  engineVersion: z.ZodString;
4380
4395
  scopeHash: z.ZodString;
4396
+ inputsHash: z.ZodOptional<z.ZodString>;
4381
4397
  inputFilesHash: z.ZodString;
4382
4398
  }, "strip", z.ZodTypeAny, {
4383
4399
  scope: {
@@ -4390,6 +4406,7 @@ declare const agentErrorEnvelopeSchema: z.ZodObject<{
4390
4406
  scopeHash: string;
4391
4407
  inputFilesHash: string;
4392
4408
  baselineId?: string | undefined;
4409
+ inputsHash?: string | undefined;
4393
4410
  }, {
4394
4411
  scope: {
4395
4412
  method: "status" | "three-dot" | "tree-diff" | "fallback-full" | "explicit" | "full";
@@ -4401,6 +4418,7 @@ declare const agentErrorEnvelopeSchema: z.ZodObject<{
4401
4418
  scopeHash: string;
4402
4419
  inputFilesHash: string;
4403
4420
  baselineId?: string | undefined;
4421
+ inputsHash?: string | undefined;
4404
4422
  }>>;
4405
4423
  verdict: z.ZodOptional<z.ZodObject<{
4406
4424
  exitCode: z.ZodUnion<[z.ZodLiteral<0>, z.ZodLiteral<1>]>;
@@ -4440,6 +4458,7 @@ declare const agentErrorEnvelopeSchema: z.ZodObject<{
4440
4458
  scopeHash: string;
4441
4459
  inputFilesHash: string;
4442
4460
  baselineId?: string | undefined;
4461
+ inputsHash?: string | undefined;
4443
4462
  } | undefined;
4444
4463
  cloudReport?: "reported" | "failed" | "skipped" | undefined;
4445
4464
  notices?: string[] | undefined;
@@ -4466,6 +4485,7 @@ declare const agentErrorEnvelopeSchema: z.ZodObject<{
4466
4485
  scopeHash: string;
4467
4486
  inputFilesHash: string;
4468
4487
  baselineId?: string | undefined;
4488
+ inputsHash?: string | undefined;
4469
4489
  } | undefined;
4470
4490
  cloudReport?: "reported" | "failed" | "skipped" | undefined;
4471
4491
  notices?: string[] | undefined;
@@ -4917,6 +4937,7 @@ declare const agentOutputSchema: z.ZodUnion<[z.ZodUnion<[z.ZodObject<{
4917
4937
  }>;
4918
4938
  engineVersion: z.ZodString;
4919
4939
  scopeHash: z.ZodString;
4940
+ inputsHash: z.ZodOptional<z.ZodString>;
4920
4941
  inputFilesHash: z.ZodString;
4921
4942
  }, "strip", z.ZodTypeAny, {
4922
4943
  scope: {
@@ -4929,6 +4950,7 @@ declare const agentOutputSchema: z.ZodUnion<[z.ZodUnion<[z.ZodObject<{
4929
4950
  scopeHash: string;
4930
4951
  inputFilesHash: string;
4931
4952
  baselineId?: string | undefined;
4953
+ inputsHash?: string | undefined;
4932
4954
  }, {
4933
4955
  scope: {
4934
4956
  method: "status" | "three-dot" | "tree-diff" | "fallback-full" | "explicit" | "full";
@@ -4940,6 +4962,7 @@ declare const agentOutputSchema: z.ZodUnion<[z.ZodUnion<[z.ZodObject<{
4940
4962
  scopeHash: string;
4941
4963
  inputFilesHash: string;
4942
4964
  baselineId?: string | undefined;
4965
+ inputsHash?: string | undefined;
4943
4966
  }>>;
4944
4967
  verdict: z.ZodOptional<z.ZodObject<{
4945
4968
  exitCode: z.ZodUnion<[z.ZodLiteral<0>, z.ZodLiteral<1>]>;
@@ -5120,6 +5143,7 @@ declare const agentOutputSchema: z.ZodUnion<[z.ZodUnion<[z.ZodObject<{
5120
5143
  scopeHash: string;
5121
5144
  inputFilesHash: string;
5122
5145
  baselineId?: string | undefined;
5146
+ inputsHash?: string | undefined;
5123
5147
  } | undefined;
5124
5148
  }, {
5125
5149
  passed: boolean;
@@ -5262,6 +5286,7 @@ declare const agentOutputSchema: z.ZodUnion<[z.ZodUnion<[z.ZodObject<{
5262
5286
  scopeHash: string;
5263
5287
  inputFilesHash: string;
5264
5288
  baselineId?: string | undefined;
5289
+ inputsHash?: string | undefined;
5265
5290
  } | undefined;
5266
5291
  }>, z.ZodObject<{
5267
5292
  schemaVersion: z.ZodLiteral<"typestyle.agent.v2">;
@@ -5709,6 +5734,7 @@ declare const agentOutputSchema: z.ZodUnion<[z.ZodUnion<[z.ZodObject<{
5709
5734
  }>;
5710
5735
  engineVersion: z.ZodString;
5711
5736
  scopeHash: z.ZodString;
5737
+ inputsHash: z.ZodOptional<z.ZodString>;
5712
5738
  inputFilesHash: z.ZodString;
5713
5739
  }, "strip", z.ZodTypeAny, {
5714
5740
  scope: {
@@ -5721,6 +5747,7 @@ declare const agentOutputSchema: z.ZodUnion<[z.ZodUnion<[z.ZodObject<{
5721
5747
  scopeHash: string;
5722
5748
  inputFilesHash: string;
5723
5749
  baselineId?: string | undefined;
5750
+ inputsHash?: string | undefined;
5724
5751
  }, {
5725
5752
  scope: {
5726
5753
  method: "status" | "three-dot" | "tree-diff" | "fallback-full" | "explicit" | "full";
@@ -5732,6 +5759,7 @@ declare const agentOutputSchema: z.ZodUnion<[z.ZodUnion<[z.ZodObject<{
5732
5759
  scopeHash: string;
5733
5760
  inputFilesHash: string;
5734
5761
  baselineId?: string | undefined;
5762
+ inputsHash?: string | undefined;
5735
5763
  }>>;
5736
5764
  verdict: z.ZodOptional<z.ZodObject<{
5737
5765
  exitCode: z.ZodUnion<[z.ZodLiteral<0>, z.ZodLiteral<1>]>;
@@ -5912,6 +5940,7 @@ declare const agentOutputSchema: z.ZodUnion<[z.ZodUnion<[z.ZodObject<{
5912
5940
  scopeHash: string;
5913
5941
  inputFilesHash: string;
5914
5942
  baselineId?: string | undefined;
5943
+ inputsHash?: string | undefined;
5915
5944
  } | undefined;
5916
5945
  }, {
5917
5946
  status: "indeterminate";
@@ -6054,6 +6083,7 @@ declare const agentOutputSchema: z.ZodUnion<[z.ZodUnion<[z.ZodObject<{
6054
6083
  scopeHash: string;
6055
6084
  inputFilesHash: string;
6056
6085
  baselineId?: string | undefined;
6086
+ inputsHash?: string | undefined;
6057
6087
  } | undefined;
6058
6088
  }>, z.ZodObject<{
6059
6089
  schemaVersion: z.ZodLiteral<"typestyle.agent.v2">;
@@ -6526,6 +6556,7 @@ declare const agentOutputSchema: z.ZodUnion<[z.ZodUnion<[z.ZodObject<{
6526
6556
  }>;
6527
6557
  engineVersion: z.ZodString;
6528
6558
  scopeHash: z.ZodString;
6559
+ inputsHash: z.ZodOptional<z.ZodString>;
6529
6560
  inputFilesHash: z.ZodString;
6530
6561
  }, "strip", z.ZodTypeAny, {
6531
6562
  scope: {
@@ -6538,6 +6569,7 @@ declare const agentOutputSchema: z.ZodUnion<[z.ZodUnion<[z.ZodObject<{
6538
6569
  scopeHash: string;
6539
6570
  inputFilesHash: string;
6540
6571
  baselineId?: string | undefined;
6572
+ inputsHash?: string | undefined;
6541
6573
  }, {
6542
6574
  scope: {
6543
6575
  method: "status" | "three-dot" | "tree-diff" | "fallback-full" | "explicit" | "full";
@@ -6549,6 +6581,7 @@ declare const agentOutputSchema: z.ZodUnion<[z.ZodUnion<[z.ZodObject<{
6549
6581
  scopeHash: string;
6550
6582
  inputFilesHash: string;
6551
6583
  baselineId?: string | undefined;
6584
+ inputsHash?: string | undefined;
6552
6585
  }>;
6553
6586
  verdict: z.ZodObject<{
6554
6587
  reasons: z.ZodArray<z.ZodString, "many">;
@@ -6637,6 +6670,7 @@ declare const agentOutputSchema: z.ZodUnion<[z.ZodUnion<[z.ZodObject<{
6637
6670
  scopeHash: string;
6638
6671
  inputFilesHash: string;
6639
6672
  baselineId?: string | undefined;
6673
+ inputsHash?: string | undefined;
6640
6674
  };
6641
6675
  findings?: {
6642
6676
  message: string;
@@ -6779,6 +6813,7 @@ declare const agentOutputSchema: z.ZodUnion<[z.ZodUnion<[z.ZodObject<{
6779
6813
  scopeHash: string;
6780
6814
  inputFilesHash: string;
6781
6815
  baselineId?: string | undefined;
6816
+ inputsHash?: string | undefined;
6782
6817
  };
6783
6818
  findings?: {
6784
6819
  message: string;
@@ -6877,6 +6912,7 @@ declare const agentOutputSchema: z.ZodUnion<[z.ZodUnion<[z.ZodObject<{
6877
6912
  }>;
6878
6913
  engineVersion: z.ZodString;
6879
6914
  scopeHash: z.ZodString;
6915
+ inputsHash: z.ZodOptional<z.ZodString>;
6880
6916
  inputFilesHash: z.ZodString;
6881
6917
  }, "strip", z.ZodTypeAny, {
6882
6918
  scope: {
@@ -6889,6 +6925,7 @@ declare const agentOutputSchema: z.ZodUnion<[z.ZodUnion<[z.ZodObject<{
6889
6925
  scopeHash: string;
6890
6926
  inputFilesHash: string;
6891
6927
  baselineId?: string | undefined;
6928
+ inputsHash?: string | undefined;
6892
6929
  }, {
6893
6930
  scope: {
6894
6931
  method: "status" | "three-dot" | "tree-diff" | "fallback-full" | "explicit" | "full";
@@ -6900,6 +6937,7 @@ declare const agentOutputSchema: z.ZodUnion<[z.ZodUnion<[z.ZodObject<{
6900
6937
  scopeHash: string;
6901
6938
  inputFilesHash: string;
6902
6939
  baselineId?: string | undefined;
6940
+ inputsHash?: string | undefined;
6903
6941
  }>>;
6904
6942
  verdict: z.ZodOptional<z.ZodObject<{
6905
6943
  exitCode: z.ZodUnion<[z.ZodLiteral<0>, z.ZodLiteral<1>]>;
@@ -6939,6 +6977,7 @@ declare const agentOutputSchema: z.ZodUnion<[z.ZodUnion<[z.ZodObject<{
6939
6977
  scopeHash: string;
6940
6978
  inputFilesHash: string;
6941
6979
  baselineId?: string | undefined;
6980
+ inputsHash?: string | undefined;
6942
6981
  } | undefined;
6943
6982
  cloudReport?: "reported" | "failed" | "skipped" | undefined;
6944
6983
  notices?: string[] | undefined;
@@ -6965,6 +7004,7 @@ declare const agentOutputSchema: z.ZodUnion<[z.ZodUnion<[z.ZodObject<{
6965
7004
  scopeHash: string;
6966
7005
  inputFilesHash: string;
6967
7006
  baselineId?: string | undefined;
7007
+ inputsHash?: string | undefined;
6968
7008
  } | undefined;
6969
7009
  cloudReport?: "reported" | "failed" | "skipped" | undefined;
6970
7010
  notices?: string[] | undefined;