@wildo-ai/zod-decorators 1.1.2 → 1.1.4

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 (40) hide show
  1. package/dist/esm/.native.tsbuildinfo +1 -0
  2. package/dist/esm/companion-exports.d.ts.map +1 -1
  3. package/dist/esm/currencies.shared.schemas.d.ts +16 -0
  4. package/dist/esm/currencies.shared.schemas.d.ts.map +1 -1
  5. package/dist/esm/currencies.shared.schemas.js +99 -0
  6. package/dist/esm/currencies.shared.schemas.js.map +1 -1
  7. package/dist/esm/files/extension-nature-map.d.ts.map +1 -1
  8. package/dist/esm/files/mime-registry.d.ts.map +1 -1
  9. package/dist/esm/files/unified-registry.d.ts.map +1 -1
  10. package/dist/esm/index.d.ts.map +1 -1
  11. package/dist/esm/testing/decorated-test-schemas.d.ts.map +1 -1
  12. package/dist/esm/testing.d.ts.map +1 -1
  13. package/dist/esm/zod-bigdecimal.d.ts.map +1 -1
  14. package/dist/esm/zod-code.d.ts.map +1 -1
  15. package/dist/esm/zod-color.d.ts.map +1 -1
  16. package/dist/esm/zod-decorators.types.d.ts +156 -29
  17. package/dist/esm/zod-decorators.types.d.ts.map +1 -1
  18. package/dist/esm/zod-decorators.types.js +82 -8
  19. package/dist/esm/zod-decorators.types.js.map +1 -1
  20. package/dist/esm/zod-duration.d.ts.map +1 -1
  21. package/dist/esm/zod-file.d.ts +30 -0
  22. package/dist/esm/zod-file.d.ts.map +1 -1
  23. package/dist/esm/zod-file.js +49 -9
  24. package/dist/esm/zod-file.js.map +1 -1
  25. package/dist/esm/zod-money.d.ts +51 -0
  26. package/dist/esm/zod-money.d.ts.map +1 -1
  27. package/dist/esm/zod-money.js +81 -1
  28. package/dist/esm/zod-money.js.map +1 -1
  29. package/dist/esm/zod-phone.d.ts.map +1 -1
  30. package/dist/esm/zod-range.d.ts.map +1 -1
  31. package/dist/esm/zod-utils.shared.d.ts +29 -0
  32. package/dist/esm/zod-utils.shared.d.ts.map +1 -1
  33. package/dist/esm/zod-utils.shared.js +104 -1
  34. package/dist/esm/zod-utils.shared.js.map +1 -1
  35. package/dist/esm/zod-versioned.d.ts.map +1 -1
  36. package/dist/esm/zod.module-override.d.ts.map +1 -1
  37. package/dist/esm/zod.module-override.js +54 -4
  38. package/dist/esm/zod.module-override.js.map +1 -1
  39. package/dist/tsconfig.build.tsbuildinfo +1 -1
  40. package/package.json +1 -1
@@ -729,7 +729,14 @@ export const FileMimeTypeGroups = {
729
729
  ],
730
730
  };
731
731
  /**
732
- * File nature classification for constraint validation and UI display.
732
+ * @wildo_source:part:start zod.decorators.file-vocabularies facet:layer:shared facet:audience:app-developer
733
+ *
734
+ * The vocabularies a `z_file()` field selects from. Pick a member of each; the option bag names the
735
+ * type, and these are the values.
736
+ *
737
+ * File nature classification, chosen with `z_file({ nature })`. It selects which per-nature
738
+ * constraint bag applies and how the form control and display surface behave. `ALL` accepts any
739
+ * kind and is the right answer for a generic attachment field.
733
740
  */
734
741
  export var FileNature;
735
742
  (function (FileNature) {
@@ -741,6 +748,7 @@ export var FileNature;
741
748
  FileNature["ARCHIVE"] = "archive";
742
749
  FileNature["ALL"] = "all";
743
750
  })(FileNature || (FileNature = {}));
751
+ /** @wildo_source:part:end zod.decorators.file-vocabularies */
744
752
  /**
745
753
  * Rendering-level file nature categories.
746
754
  *
@@ -835,7 +843,25 @@ export var FileActivationPolicy;
835
843
  FileActivationPolicy["CUSTOM"] = "custom";
836
844
  })(FileActivationPolicy || (FileActivationPolicy = {}));
837
845
  /**
838
- * Storage providers accepted for file uploads.
846
+ * @wildo_source:part:start zod.decorators.file-vocabularies
847
+ *
848
+ * Where a field's bytes may be stored, chosen with `z_file({ storageAccepted: [...] })`. ORDER
849
+ * EXPRESSES PREFERENCE: list several and the first CONFIGURED one is used. Omit the option entirely
850
+ * and the field resolves to managed storage.
851
+ *
852
+ * ⚠️ **`WILDO_MANAGED`, `LOCAL_DIRECTORY` and `GOOGLE_DRIVE` have a provider behind them.** `ONEDRIVE`
853
+ * and `DROPBOX` are declared vocabulary with no implementation — a field naming only those has no
854
+ * configured provider, and startup configuration validation refuses the application rather than
855
+ * letting it serve a field that could never accept an upload.
856
+ *
857
+ * `GOOGLE_DRIVE` is a VENDOR storage: the bytes live in a person's Drive and are reached through the
858
+ * delegated grant of whoever linked (via the Drive picker) or uploaded them, never through an
859
+ * application credential. It is "configured" when the `google-drive` provider admits a user-owned
860
+ * connection. A field that accepts it is offered the Drive picker; a local pick on such a field is
861
+ * uploaded INTO that person's Drive when Drive is the first configured storage in the list.
862
+ *
863
+ * ⚠️ **The target is decided once, when the file is created, and the object never moves.** Changing
864
+ * a field's declared target changes where NEW files go; it does not relocate what is already stored.
839
865
  */
840
866
  export var FileStorageAccepted;
841
867
  (function (FileStorageAccepted) {
@@ -884,6 +910,39 @@ export const AudioFormat = {
884
910
  OGG: 'ogg',
885
911
  AAC: 'aac',
886
912
  };
913
+ /** @wildo_source:part:end zod.decorators.file-nature-constraints */
914
+ /*
915
+ * MAINTAINER NOTE — deliberately OUTSIDE the `zod.decorators.rag-source` anchor below, because the
916
+ * anchor ships into every generated application and an application author needs the vocabulary, not
917
+ * its history. The one sentence they DO need ("there is no semantic member, and why") is inside.
918
+ *
919
+ * ## `SEMANTIC` was a fifth member here, and was REMOVED on 2026-09-09 (#434)
920
+ *
921
+ * It read `SEMANTIC — split at embedding-detected topic boundaries` and was never implemented: every
922
+ * field authoring it silently degraded to `FIXED_SIZE`. The obvious fix was to build it. The measured
923
+ * answer is that it is not worth building, so the member went instead — recorded because "add the
924
+ * missing one back" is what the next reader will otherwise propose.
925
+ *
926
+ * Chroma's chunking evaluation benchmarks exactly this algorithm. Its `KamradtSemanticChunker` scored
927
+ * 83.6% recall / 1.5% precision against `RecursiveCharacterTextSplitter`'s 89.5% / 3.6% — worse on
928
+ * BOTH axes than the `RECURSIVE` member beside it — and the report calls it "slightly below average
929
+ * across all metrics". A 2026 cost-versus-effectiveness study reached the same conclusion
930
+ * independently: expensive chunking methods "do not yield meaningful effectiveness improvements while
931
+ * introducing substantially higher computational overhead", with only fixed-size and recursive
932
+ * "robust across datasets".
933
+ * spec-cite: Chroma, "Evaluating Chunking Strategies for Retrieval"
934
+ * (https://www.trychroma.com/research/evaluating-chunking); arXiv:2606.00881. Both read 2026-09-09.
935
+ *
936
+ * The architectural cost was the other half, and it is Wildo-specific. Boundaries computed from
937
+ * embeddings make the CHUNKER a client of the embeddings provider on the resource WRITE path, and
938
+ * force the embedding model into `chunkingConfigHash` — after which a model migration RE-CHUNKS
939
+ * rather than re-embedding in place, discarding exactly the property the dimension-flexible vector
940
+ * column and the deferred `rag:embedding-drain` batch exist to provide.
941
+ *
942
+ * If retrieval quality is ever the MEASURED bottleneck, the evidence points at CONTEXTUAL RETRIEVAL
943
+ * (prepend document-level context to each chunk before embedding), not at topic boundaries. That
944
+ * changes what is embedded rather than when boundaries are computed, so it costs none of the above.
945
+ */
887
946
  /**
888
947
  * @wildo_source:part:start zod.decorators.rag-source facet:layer:shared facet:family:decorator facet:family:param-surface facet:kind:api facet:audience:app-developer
889
948
  *
@@ -902,7 +961,6 @@ export const AudioFormat = {
902
961
  *
903
962
  * - `FIXED_SIZE` — split every `chunkSize` characters/tokens regardless of structure.
904
963
  * - `RECURSIVE` — split on a separator hierarchy (paragraph → sentence → word) down to `chunkSize`.
905
- * - `SEMANTIC` — split at embedding-detected topic boundaries.
906
964
  * - `MARKDOWN` — split on markdown structure (headings, lists, code fences).
907
965
  * - `CODE` — split on source-code structure (functions, classes, blocks). Unified in (2026-08-26)
908
966
  * from a second copy of this vocabulary that `saas-models` then carried: the member sets differed
@@ -910,11 +968,16 @@ export const AudioFormat = {
910
968
  * invalidated configurations authored against the wider one — so the union won. That second copy,
911
969
  * and the agent-level RAG configuration schemas around it, were retired on 2026-08-27 as a
912
970
  * pre-capability design the shipped capability superseded; this object is now the only home.
971
+ *
972
+ * There is deliberately NO semantic/embedding-based member. It is the option people reach for
973
+ * first, and published evaluations put it BELOW `RECURSIVE` on both recall and precision while
974
+ * costing an embedding pass per document — so `RECURSIVE` is the right default for prose, and the
975
+ * two structure-aware members are for text whose structure carries meaning.
976
+ *
913
977
  */
914
978
  export const RAGChunkingStrategy = {
915
979
  FIXED_SIZE: 'fixed_size',
916
980
  RECURSIVE: 'recursive',
917
- SEMANTIC: 'semantic',
918
981
  MARKDOWN: 'markdown',
919
982
  CODE: 'code',
920
983
  };
@@ -933,6 +996,15 @@ export var FileGenerationSource;
933
996
  FileGenerationSource["PDF_TEMPLATE"] = "pdfTemplate";
934
997
  })(FileGenerationSource || (FileGenerationSource = {}));
935
998
  /**
999
+ * @wildo_source:part:start zod.decorators.file-vocabularies
1000
+ *
1001
+ * What happens to the file when its parent record is deleted, chosen with
1002
+ * `z_file({ onParentDelete })`. Defaults to `CASCADE`.
1003
+ *
1004
+ * ⚠️ `SOFT_DELETE` behaves IDENTICALLY to `CASCADE` at runtime today. It exists as an explicit
1005
+ * semantic marker for consumers that want to model a softer intent — choosing it does not currently
1006
+ * change what happens to the file.
1007
+ *
936
1008
  * File behavior when parent resource is deleted.
937
1009
  * - CASCADE: Mark the file deleted as part of parent removal; physical storage cleanup is deferred to the cleanup batch
938
1010
  * - SOFT_DELETE: Same current runtime behavior as CASCADE, but keeps an explicit semantic marker for consumers that want to model softer intent
@@ -1339,10 +1411,12 @@ export var ZodDecorator;
1339
1411
  * could ask to have erased.
1340
1412
  *
1341
1413
  * ⚠️ This is a WRITE-side claim — "when this field CHANGES, the change itself is evidence" — and
1342
- * is independent of the READ-side disclosure trail. The only disclosure trigger the framework has
1343
- * is `isBackendOnly({ isReturnedAtCreation: true })`, which fires one `FIELD_ACCESS` event when a
1344
- * server-minted secret is first exposed. A field can carry either, both, or neither. There is no
1345
- * general "audit every read of this field" marker — do not go looking for one.
1414
+ * is independent of the READ-side disclosure trail. The framework has exactly two disclosure
1415
+ * triggers: `isBackendOnly({ isReturnedAtCreation: true })`, which fires one `FIELD_ACCESS` event
1416
+ * when a server-minted secret is first exposed on a create, and `.isEphemeral()`, which fires on
1417
+ * any operation so a rotate or regenerate is recorded as well. A field can carry any combination
1418
+ * of the three markers. There is still no general "audit every read of this field" marker; do not
1419
+ * go looking for one.
1346
1420
  *
1347
1421
  * assurance-control: WILDO.SECRETS.DISCLOSURE_AUDIT
1348
1422
  */