@fulmenhq/tsfulmen 0.3.2 → 0.4.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.
Files changed (128) hide show
  1. package/CHANGELOG.md +65 -1
  2. package/README.md +30 -1
  3. package/config/crucible-ts/taxonomy/metrics.yaml +1 -1
  4. package/dist/appidentity/index.d.ts +15 -5
  5. package/dist/appidentity/index.js +9 -2204
  6. package/dist/appidentity/index.js.map +1 -1
  7. package/dist/assets/index.d.ts +179 -0
  8. package/dist/assets/index.js +4 -0
  9. package/dist/assets/index.js.map +1 -0
  10. package/dist/bin/prometheus-cli.js +15 -9134
  11. package/dist/bin/prometheus-cli.js.map +1 -1
  12. package/dist/bin/schema-cli.js +4 -6098
  13. package/dist/bin/schema-cli.js.map +1 -1
  14. package/dist/bin/signals-cli.js +15 -1910
  15. package/dist/bin/signals-cli.js.map +1 -1
  16. package/dist/chunk-3HISR2XI.js +36 -0
  17. package/dist/chunk-3HISR2XI.js.map +1 -0
  18. package/dist/chunk-5HZEJGZ5.js +725 -0
  19. package/dist/chunk-5HZEJGZ5.js.map +1 -0
  20. package/dist/chunk-7SVYOPJ3.js +9412 -0
  21. package/dist/chunk-7SVYOPJ3.js.map +1 -0
  22. package/dist/chunk-BCO3FUUO.js +682 -0
  23. package/dist/chunk-BCO3FUUO.js.map +1 -0
  24. package/dist/chunk-BJDL6JEX.js +208 -0
  25. package/dist/chunk-BJDL6JEX.js.map +1 -0
  26. package/dist/chunk-BTUS6PZZ.js +302 -0
  27. package/dist/chunk-BTUS6PZZ.js.map +1 -0
  28. package/dist/chunk-CW4CSNVF.js +410 -0
  29. package/dist/chunk-CW4CSNVF.js.map +1 -0
  30. package/dist/chunk-HIBZ2AY7.js +194 -0
  31. package/dist/chunk-HIBZ2AY7.js.map +1 -0
  32. package/dist/chunk-HS4F3BRR.js +985 -0
  33. package/dist/chunk-HS4F3BRR.js.map +1 -0
  34. package/dist/chunk-HY6JQOFN.js +32 -0
  35. package/dist/chunk-HY6JQOFN.js.map +1 -0
  36. package/dist/chunk-K2FYT43R.js +837 -0
  37. package/dist/chunk-K2FYT43R.js.map +1 -0
  38. package/dist/chunk-K7BMFGQP.js +43 -0
  39. package/dist/chunk-K7BMFGQP.js.map +1 -0
  40. package/dist/chunk-LWAH2UG7.js +103 -0
  41. package/dist/chunk-LWAH2UG7.js.map +1 -0
  42. package/dist/chunk-OHE2AOH4.js +273 -0
  43. package/dist/chunk-OHE2AOH4.js.map +1 -0
  44. package/dist/chunk-P3DNOZOG.js +1488 -0
  45. package/dist/chunk-P3DNOZOG.js.map +1 -0
  46. package/dist/chunk-PQ6TKPUN.js +27 -0
  47. package/dist/chunk-PQ6TKPUN.js.map +1 -0
  48. package/dist/chunk-QCCN6POA.js +211 -0
  49. package/dist/chunk-QCCN6POA.js.map +1 -0
  50. package/dist/chunk-RSLFR4TO.js +631 -0
  51. package/dist/chunk-RSLFR4TO.js.map +1 -0
  52. package/dist/chunk-UP2VWCW5.js +33 -0
  53. package/dist/chunk-UP2VWCW5.js.map +1 -0
  54. package/dist/chunk-W6TQFTTY.js +130 -0
  55. package/dist/chunk-W6TQFTTY.js.map +1 -0
  56. package/dist/chunk-WSMVLWLB.js +269 -0
  57. package/dist/chunk-WSMVLWLB.js.map +1 -0
  58. package/dist/config/index.d.ts +69 -11
  59. package/dist/config/index.js +24 -1227
  60. package/dist/config/index.js.map +1 -1
  61. package/dist/crucible/fulpack/index.js +2 -25
  62. package/dist/crucible/fulpack/index.js.map +1 -1
  63. package/dist/crucible/index.js +13 -1129
  64. package/dist/crucible/index.js.map +1 -1
  65. package/dist/docscribe/index.js +2 -680
  66. package/dist/docscribe/index.js.map +1 -1
  67. package/dist/errors/index.js +5 -1831
  68. package/dist/errors/index.js.map +1 -1
  69. package/dist/errors-D7KXV3QW.js +4 -0
  70. package/dist/errors-D7KXV3QW.js.map +1 -0
  71. package/dist/errors-RBJX6ETJ.js +8 -0
  72. package/dist/errors-RBJX6ETJ.js.map +1 -0
  73. package/dist/export-BWRETGYS.js +6 -0
  74. package/dist/export-BWRETGYS.js.map +1 -0
  75. package/dist/foundry/index.d.ts +1 -1
  76. package/dist/foundry/index.js +340 -3949
  77. package/dist/foundry/index.js.map +1 -1
  78. package/dist/foundry/similarity/index.js +3 -134
  79. package/dist/foundry/similarity/index.js.map +1 -1
  80. package/dist/fulencode/index.js +3 -319
  81. package/dist/fulencode/index.js.map +1 -1
  82. package/dist/fulhash/index.js +3 -611
  83. package/dist/fulhash/index.js.map +1 -1
  84. package/dist/fulpack/index.js +3 -1515
  85. package/dist/fulpack/index.js.map +1 -1
  86. package/dist/hash-YOJYVOWH.js +4 -0
  87. package/dist/hash-YOJYVOWH.js.map +1 -0
  88. package/dist/index.d.ts +2 -2
  89. package/dist/index.js +14 -4390
  90. package/dist/index.js.map +1 -1
  91. package/dist/loader-H5K7HSO5.js +9 -0
  92. package/dist/loader-H5K7HSO5.js.map +1 -0
  93. package/dist/logging/index.js +2 -723
  94. package/dist/logging/index.js.map +1 -1
  95. package/dist/pathfinder/index.js +18 -2341
  96. package/dist/pathfinder/index.js.map +1 -1
  97. package/dist/prom-client-PNEBGD3G.js +4801 -0
  98. package/dist/prom-client-PNEBGD3G.js.map +1 -0
  99. package/dist/reports/license-inventory.csv +1 -1
  100. package/dist/schema/index.d.ts +19 -6
  101. package/dist/schema/index.js +4 -6148
  102. package/dist/schema/index.js.map +1 -1
  103. package/dist/signals/index.d.ts +1 -1
  104. package/dist/signals/index.js +8 -2767
  105. package/dist/signals/index.js.map +1 -1
  106. package/dist/similarity/index.js +3 -134
  107. package/dist/similarity/index.js.map +1 -1
  108. package/dist/telemetry/http/index.js +9 -930
  109. package/dist/telemetry/http/index.js.map +1 -1
  110. package/dist/telemetry/index.js +4 -1561
  111. package/dist/telemetry/index.js.map +1 -1
  112. package/dist/telemetry/prometheus/index.js +7 -8417
  113. package/dist/telemetry/prometheus/index.js.map +1 -1
  114. package/dist/{types-Dv5TERCM.d.ts → types-CHDvDRCf.d.ts} +17 -1
  115. package/dist/validator-U4CKD2Y3.js +6 -0
  116. package/dist/validator-U4CKD2Y3.js.map +1 -0
  117. package/package.json +5 -1
  118. package/schemas/crucible-ts/library/module-manifest/v1.0.0/module-manifest.schema.json +1 -1
  119. package/schemas/crucible-ts/observability/logging/v1.0.0/definitions.schema.json +1 -1
  120. package/schemas/crucible-ts/observability/logging/v1.0.0/log-event.schema.json +13 -13
  121. package/schemas/crucible-ts/observability/logging/v1.0.0/logger-config.schema.json +2 -2
  122. package/schemas/crucible-ts/observability/logging/v1.0.0/logging-policy.schema.json +1 -1
  123. package/schemas/crucible-ts/observability/logging/v1.0.0/middleware-config.schema.json +2 -2
  124. package/schemas/crucible-ts/observability/logging/v1.0.0/severity-filter.schema.json +3 -3
  125. package/schemas/crucible-ts/upstream/3leaps/crucible/PROVENANCE.md +3 -3
  126. package/schemas/crucible-ts/upstream/3leaps/crucible/docs/catalog/classifiers/README.md +1 -1
  127. package/schemas/crucible-ts/upstream/3leaps/crucible/docs/standards/classifiers-framework.md +1 -1
  128. package/schemas/crucible-ts/upstream/3leaps/crucible/docs/standards/data-sensitivity-classification.md +1 -1
@@ -0,0 +1,179 @@
1
+ /**
2
+ * Asset resolution - Types
3
+ *
4
+ * Central contract for resolving tsfulmen's bundled SSOT assets (schemas,
5
+ * metaschemas, foundry catalogs, taxonomy) either from the filesystem (npm /
6
+ * `node dist` / source) or from embedded generated modules (a `bun --compile`
7
+ * single-file binary, where no asset tree exists on disk).
8
+ *
9
+ * Logical paths are **package-root-relative POSIX paths**, e.g.
10
+ * `schemas/crucible-ts/library/foundry/v1.0.0/signals.schema.json` or
11
+ * `config/crucible-ts/library/foundry/signals.yaml`. Using a single namespace
12
+ * across both the `schemas/` and `config/` trees lets cross-tree `$ref`
13
+ * resolution (e.g. a schema referencing `config/.../taxonomy/metrics.yaml`)
14
+ * work through one resolver.
15
+ */
16
+ /**
17
+ * How assets are resolved.
18
+ * - `fs`: read from the on-disk asset trees (current behavior).
19
+ * - `embedded`: read from generated, build-embedded manifests (compile-safe).
20
+ * - `auto`: prefer `fs` when the asset tree is present/readable, else `embedded`.
21
+ */
22
+ type AssetMode = "fs" | "embedded" | "auto";
23
+ /**
24
+ * Provenance/metadata for diagnostics and parity reporting across SDKs.
25
+ */
26
+ interface AssetProvenance {
27
+ /** The concrete resolution mode in effect (never `auto`). */
28
+ readonly mode: Exclude<AssetMode, "auto">;
29
+ /** On-disk base directory, when resolving from the filesystem. */
30
+ readonly baseDir?: string;
31
+ /** Number of embedded assets available, when resolving from embedded modules. */
32
+ readonly embeddedCount?: number;
33
+ }
34
+ /**
35
+ * Resolves SSOT assets by logical path, independent of backing store.
36
+ */
37
+ interface AssetResolver {
38
+ /** Concrete resolution mode (`fs` or `embedded`). */
39
+ readonly mode: Exclude<AssetMode, "auto">;
40
+ /**
41
+ * Read an asset's text content by logical path.
42
+ * @throws {AssetResolutionError} when the asset cannot be found/read.
43
+ */
44
+ read(logicalPath: string): Promise<string>;
45
+ /**
46
+ * Enumerate logical paths matching the given glob patterns (e.g.
47
+ * `["schemas/crucible-ts/** /*.schema.json"]`). Powers schema-registry
48
+ * discovery without a filesystem walk.
49
+ */
50
+ list(patterns: string[]): Promise<string[]>;
51
+ /** Whether an asset exists at the given logical path. */
52
+ has(logicalPath: string): Promise<boolean>;
53
+ /** Provenance for diagnostics / size & parity reporting. */
54
+ provenance(): AssetProvenance;
55
+ }
56
+ /**
57
+ * A generated, build-embedded set of assets for one domain (e.g. metaschemas,
58
+ * foundry catalogs). T3 codegen emits these; {@link registerEmbeddedAssets}
59
+ * composes them into the embedded resolver.
60
+ */
61
+ interface EmbeddedAssetManifest {
62
+ /** Domain label for diagnostics (e.g. `"foundry"`, `"metaschema"`). */
63
+ readonly domain: string;
64
+ /** Logical path -> raw text content. */
65
+ readonly files: Readonly<Record<string, string>>;
66
+ }
67
+
68
+ /**
69
+ * Asset resolution - Embedded backend
70
+ *
71
+ * Reads SSOT assets from generated, build-embedded manifests instead of the
72
+ * filesystem, so loads work inside a `bun --compile` single-file binary (no
73
+ * asset tree on disk). T3 codegen emits per-domain {@link EmbeddedAssetManifest}
74
+ * modules and registers them via {@link registerEmbeddedAssets}; this resolver
75
+ * composes whatever has been registered.
76
+ *
77
+ * Until T3 lands, no manifests are registered, so the embedded resolver is
78
+ * empty — `read()` throws a clear "not found" and `list()` returns `[]`.
79
+ */
80
+
81
+ /**
82
+ * Register a generated embedded-asset manifest. Idempotent per domain
83
+ * (re-registering a domain replaces it). Called by generated modules.
84
+ */
85
+ declare function registerEmbeddedAssets(manifest: EmbeddedAssetManifest): void;
86
+ /** Whether a specific domain has been registered. */
87
+ declare function hasEmbeddedDomain(domain: string): boolean;
88
+ /** Clear all registered manifests. For testing only. */
89
+ declare function clearEmbeddedAssets(): void;
90
+ /** Whether any embedded manifests have been registered. */
91
+ declare function hasEmbeddedAssets(): boolean;
92
+ declare class EmbeddedAssetResolver implements AssetResolver {
93
+ readonly mode: "embedded";
94
+ private readonly index;
95
+ constructor();
96
+ read(logicalPath: string): Promise<string>;
97
+ list(patterns: string[]): Promise<string[]>;
98
+ has(logicalPath: string): Promise<boolean>;
99
+ provenance(): AssetProvenance;
100
+ }
101
+
102
+ /**
103
+ * Asset resolution - Error handling
104
+ *
105
+ * Custom error classes for SSOT asset resolution (filesystem or embedded).
106
+ */
107
+ declare class AssetResolutionError extends Error {
108
+ readonly assetPath?: string | undefined;
109
+ readonly cause?: Error | undefined;
110
+ constructor(message: string, assetPath?: string | undefined, cause?: Error | undefined);
111
+ static notFound(assetPath: string, mode: string): AssetResolutionError;
112
+ static readFailed(assetPath: string, code: string): AssetResolutionError;
113
+ static baseDirUnavailable(detail: string): AssetResolutionError;
114
+ }
115
+
116
+ /**
117
+ * Asset resolution - Filesystem backend
118
+ *
119
+ * Reads SSOT assets from the on-disk `schemas/crucible-ts` / `config/crucible-ts`
120
+ * trees shipped in the npm package. This is the current (pre-v0.4.0) behavior,
121
+ * now centralized behind the {@link AssetResolver} contract.
122
+ */
123
+
124
+ declare class FsAssetResolver implements AssetResolver {
125
+ private readonly baseDir;
126
+ private readonly enforceNamespace;
127
+ readonly mode: "fs";
128
+ /**
129
+ * @param baseDir Directory logical paths resolve against.
130
+ * @param enforceNamespace Restrict to the SSOT namespaces (schemas/config/docs).
131
+ * Default `true` for the package's own asset tree; pass `false` when `baseDir`
132
+ * is a consumer-supplied tree they scope themselves (traversal guards still apply).
133
+ */
134
+ constructor(baseDir: string, enforceNamespace?: boolean);
135
+ private resolve;
136
+ read(logicalPath: string): Promise<string>;
137
+ list(patterns: string[]): Promise<string[]>;
138
+ has(logicalPath: string): Promise<boolean>;
139
+ provenance(): AssetProvenance;
140
+ /** The on-disk base directory this resolver reads from. */
141
+ getBaseDir(): string;
142
+ }
143
+
144
+ /**
145
+ * Asset resolution - Resolver factory & mode selection
146
+ *
147
+ * Chooses between the filesystem and embedded backends. Default is `auto`:
148
+ * prefer the filesystem when the on-disk asset tree is present/readable, else
149
+ * fall back to embedded generated modules (the `bun --compile` case). The mode
150
+ * can be forced with the `TSFULMEN_ASSET_MODE` env var or an explicit option.
151
+ */
152
+
153
+ /**
154
+ * Find the package-root directory that contains the SSOT asset trees by walking
155
+ * upward from this module. Works for both source (`src/assets/`) and bundled
156
+ * (`dist/`) layouts without hard-coded depths — and returns `null` inside a
157
+ * `bun --compile` binary where no such directory exists on disk.
158
+ */
159
+ declare function findAssetBaseDir(): string | null;
160
+ interface ResolveAssetsOptions {
161
+ /** Force a mode. Precedence: explicit option > `TSFULMEN_ASSET_MODE` > `auto`. */
162
+ mode?: AssetMode;
163
+ /** Override the FS base dir (e.g. a consumer's own asset tree). Implies `fs`. */
164
+ baseDir?: string;
165
+ }
166
+ /**
167
+ * Build an {@link AssetResolver} for the requested (or auto-detected) mode.
168
+ * Stateless — callers that want a cached instance use {@link getAssetResolver}.
169
+ */
170
+ declare function resolveAssets(options?: ResolveAssetsOptions): AssetResolver;
171
+ /**
172
+ * Cached resolver keyed on the effective options. Most call sites should use
173
+ * this; pass fresh options (or different env) to rebuild.
174
+ */
175
+ declare function getAssetResolver(options?: ResolveAssetsOptions): AssetResolver;
176
+ /** Reset the cached resolver. For testing / after registering embedded assets. */
177
+ declare function resetAssetResolver(): void;
178
+
179
+ export { type AssetMode, type AssetProvenance, AssetResolutionError, type AssetResolver, type EmbeddedAssetManifest, EmbeddedAssetResolver, FsAssetResolver, type ResolveAssetsOptions, clearEmbeddedAssets, findAssetBaseDir, getAssetResolver, hasEmbeddedAssets, hasEmbeddedDomain, registerEmbeddedAssets, resetAssetResolver, resolveAssets };
@@ -0,0 +1,4 @@
1
+ export { AssetResolutionError, EmbeddedAssetResolver, FsAssetResolver, clearEmbeddedAssets, findAssetBaseDir, getAssetResolver, hasEmbeddedAssets, hasEmbeddedDomain, registerEmbeddedAssets, resetAssetResolver, resolveAssets } from '../chunk-BTUS6PZZ.js';
2
+ import '../chunk-UP2VWCW5.js';
3
+ //# sourceMappingURL=index.js.map
4
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"index.js"}