@fulmenhq/tsfulmen 0.1.13 → 0.2.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 (165) hide show
  1. package/CHANGELOG.md +73 -512
  2. package/README.md +111 -28
  3. package/config/crucible-ts/agentic/roles/README.md +76 -0
  4. package/config/crucible-ts/agentic/roles/cicd.yaml +82 -0
  5. package/config/crucible-ts/agentic/roles/dataeng.yaml +104 -0
  6. package/config/crucible-ts/agentic/roles/devlead.yaml +84 -0
  7. package/config/crucible-ts/agentic/roles/devrev.yaml +105 -0
  8. package/config/crucible-ts/agentic/roles/entarch.yaml +101 -0
  9. package/config/crucible-ts/agentic/roles/infoarch.yaml +95 -0
  10. package/config/crucible-ts/agentic/roles/prodmktg.yaml +92 -0
  11. package/config/crucible-ts/agentic/roles/qa.yaml +148 -0
  12. package/config/crucible-ts/agentic/roles/secrev.yaml +101 -0
  13. package/config/crucible-ts/agentic/roles/uxdev.yaml +168 -0
  14. package/config/crucible-ts/branding/ecosystem.yaml +26 -0
  15. package/config/crucible-ts/library/foundry/exit-codes.snapshot.json +26 -0
  16. package/config/crucible-ts/library/foundry/exit-codes.yaml +28 -3
  17. package/config/crucible-ts/library/foundry/patterns.yaml +2 -2
  18. package/config/crucible-ts/library/foundry/signal-resolution-fixtures.yaml +207 -0
  19. package/config/crucible-ts/library/foundry/signals.yaml +21 -0
  20. package/config/crucible-ts/library/foundry/simplified-modes.snapshot.json +9 -1
  21. package/config/crucible-ts/library/{foundry/similarity-fixtures.yaml → similarity/fixtures.yaml} +1 -1
  22. package/config/crucible-ts/library/v1.0.0/module-manifest.yaml +1 -2
  23. package/config/crucible-ts/taxonomy/fixture-catalog.yaml +145 -0
  24. package/config/crucible-ts/taxonomy/languages.yaml +2 -2
  25. package/config/crucible-ts/taxonomy/library/foundry-catalogs/v1.1.0/catalogs.yaml +77 -0
  26. package/config/crucible-ts/taxonomy/library/platform-modules/v1.1.0/modules.yaml +722 -0
  27. package/config/crucible-ts/taxonomy/metrics.yaml +1 -1
  28. package/config/crucible-ts/taxonomy/repository-categories.yaml +134 -1
  29. package/dist/appidentity/index.d.ts +117 -35
  30. package/dist/appidentity/index.js +752 -592
  31. package/dist/appidentity/index.js.map +1 -1
  32. package/dist/config/index.js +118 -6
  33. package/dist/config/index.js.map +1 -1
  34. package/dist/crucible/index.js +118 -6
  35. package/dist/crucible/index.js.map +1 -1
  36. package/dist/errors/index.js +118 -6
  37. package/dist/errors/index.js.map +1 -1
  38. package/dist/foundry/index.d.ts +13 -676
  39. package/dist/foundry/index.js +118 -6
  40. package/dist/foundry/index.js.map +1 -1
  41. package/dist/foundry/similarity/index.d.ts +2 -2
  42. package/dist/fulhash/index.d.ts +64 -12
  43. package/dist/fulhash/index.js +292 -53
  44. package/dist/fulhash/index.js.map +1 -1
  45. package/dist/index.d.ts +2 -2
  46. package/dist/index.js +753 -593
  47. package/dist/index.js.map +1 -1
  48. package/dist/{manager-D27vrdaS.d.ts → manager-CH3fX7zO.d.ts} +1 -1
  49. package/dist/pathfinder/index.js +368 -59
  50. package/dist/pathfinder/index.js.map +1 -1
  51. package/dist/reports/license-inventory.csv +302 -0
  52. package/dist/schema/index.js +118 -6
  53. package/dist/schema/index.js.map +1 -1
  54. package/dist/signals/index.d.ts +675 -0
  55. package/dist/signals/index.js +5790 -0
  56. package/dist/signals/index.js.map +1 -0
  57. package/dist/similarity/index.d.ts +2 -0
  58. package/dist/similarity/index.js +136 -0
  59. package/dist/similarity/index.js.map +1 -0
  60. package/dist/{suggest-Cv7SVQRu.d.ts → suggest-D8LbwtPV.d.ts} +1 -1
  61. package/dist/telemetry/http/index.js +704 -591
  62. package/dist/telemetry/http/index.js.map +1 -1
  63. package/dist/telemetry/index.js +118 -6
  64. package/dist/telemetry/index.js.map +1 -1
  65. package/dist/telemetry/prometheus/index.d.ts +1 -1
  66. package/dist/telemetry/prometheus/index.js +175 -11
  67. package/dist/telemetry/prometheus/index.js.map +1 -1
  68. package/package.json +15 -6
  69. package/schemas/crucible-ts/assessment/v1.0.0/severity-definitions.schema.json +1 -1
  70. package/schemas/crucible-ts/config/fulmen-ecosystem/v1.0.0/fulmen-config-paths.schema.json +1 -1
  71. package/schemas/crucible-ts/config/repository/app-identity/v1.0.0/app-identity.schema.json +3 -3
  72. package/schemas/crucible-ts/config/repository/v1.0.0/lifecycle-phase.json +1 -1
  73. package/schemas/crucible-ts/config/repository-category/codex/v1.0.0/codex-config.schema.json +1 -1
  74. package/schemas/crucible-ts/config/standards/v1.0.0/adr-adoption-status.json +1 -1
  75. package/schemas/crucible-ts/config/standards/v1.0.0/adr-frontmatter.schema.json +3 -3
  76. package/schemas/crucible-ts/config/standards/v1.0.0/adr-lifecycle-status.json +1 -1
  77. package/schemas/crucible-ts/config/sync-keys.schema.yaml +14 -0
  78. package/schemas/crucible-ts/content/ssot-provenance/v1.0.0/ssot-provenance.schema.json +1 -1
  79. package/schemas/crucible-ts/design/README.md +159 -0
  80. package/schemas/crucible-ts/design/core/v1.0.0/component-states.schema.json +204 -0
  81. package/schemas/crucible-ts/design/core/v1.0.0/semantic-colors.schema.json +179 -0
  82. package/schemas/crucible-ts/design/core/v1.0.0/spacing-scale.schema.json +165 -0
  83. package/schemas/crucible-ts/design/core/v1.0.0/typography-roles.schema.json +195 -0
  84. package/schemas/crucible-ts/design/tui/v1.0.0/color-palette.schema.json +303 -0
  85. package/schemas/crucible-ts/design/tui/v1.0.0/component.schema.json +374 -0
  86. package/schemas/crucible-ts/design/tui/v1.0.0/layout.schema.json +272 -0
  87. package/schemas/crucible-ts/design/tui/v1.0.0/theme.schema.json +205 -0
  88. package/schemas/crucible-ts/design/tui/v1.0.0/typography.schema.json +316 -0
  89. package/schemas/crucible-ts/devsecops/lorage-central/activity/v1.0.0/activity.schema.json +1 -1
  90. package/schemas/crucible-ts/devsecops/lorage-central/credentials/v1.0.0/credentials.schema.json +1 -1
  91. package/schemas/crucible-ts/devsecops/lorage-central/policy/v1.0.0/policy.schema.json +1 -1
  92. package/schemas/crucible-ts/devsecops/lorage-central/recipe/v1.0.0/recipe.schema.json +1 -1
  93. package/schemas/crucible-ts/devsecops/lorage-central/runbooks/v1.0.0/runbook.schema.json +1 -1
  94. package/schemas/crucible-ts/devsecops/lorage-central/tenant/v1.0.0/tenant.schema.json +1 -1
  95. package/schemas/crucible-ts/devsecops/secrets/v1.0.0/secrets.schema.json +1 -1
  96. package/schemas/crucible-ts/error-handling/v1.0.0/error-response.schema.json +1 -1
  97. package/schemas/crucible-ts/library/foundry/v1.0.0/country-codes.schema.json +1 -1
  98. package/schemas/crucible-ts/library/foundry/v1.0.0/exit-codes.schema.json +1 -1
  99. package/schemas/crucible-ts/library/foundry/v1.0.0/http-status-groups.schema.json +1 -1
  100. package/schemas/crucible-ts/library/foundry/v1.0.0/mime-types.schema.json +1 -1
  101. package/schemas/crucible-ts/library/foundry/v1.0.0/patterns.schema.json +1 -1
  102. package/schemas/crucible-ts/library/foundry/v1.0.0/signal-resolution-fixtures.schema.json +140 -0
  103. package/schemas/crucible-ts/library/foundry/v1.0.0/signals.schema.json +6 -1
  104. package/schemas/crucible-ts/library/fulencode/v1.0.0/fulencode-config.schema.json +1 -1
  105. package/schemas/crucible-ts/library/fulhash/v1.0.0/checksum-string.schema.json +2 -2
  106. package/schemas/crucible-ts/library/fulhash/v1.0.0/digest.schema.json +61 -1
  107. package/schemas/crucible-ts/library/fulhash/v1.0.0/fixtures.schema.json +1 -1
  108. package/schemas/crucible-ts/library/fulpack/v1.0.0/archive-entry.schema.json +1 -1
  109. package/schemas/crucible-ts/library/fulpack/v1.0.0/archive-info.schema.json +1 -1
  110. package/schemas/crucible-ts/library/fulpack/v1.0.0/archive-manifest.schema.json +2 -2
  111. package/schemas/crucible-ts/library/fulpack/v1.0.0/create-options.schema.json +1 -1
  112. package/schemas/crucible-ts/library/fulpack/v1.0.0/extract-options.schema.json +1 -1
  113. package/schemas/crucible-ts/library/fulpack/v1.0.0/extract-result.schema.json +1 -1
  114. package/schemas/crucible-ts/library/fulpack/v1.0.0/scan-options.schema.json +1 -1
  115. package/schemas/crucible-ts/library/fulpack/v1.0.0/validation-result.schema.json +1 -1
  116. package/schemas/crucible-ts/library/module-manifest/v1.0.0/module-manifest.schema.json +1 -1
  117. package/schemas/crucible-ts/library/{foundry → similarity}/v1.0.0/similarity.schema.json +2 -2
  118. package/schemas/crucible-ts/library/{foundry → similarity}/v2.0.0/similarity.schema.json +2 -2
  119. package/schemas/crucible-ts/observability/metrics/v1.0.0/metrics-event.schema.json +1 -1
  120. package/schemas/crucible-ts/pathfinder/v1.0.0/find-query.schema.json +1 -1
  121. package/schemas/crucible-ts/pathfinder/v1.0.0/finder-config.schema.json +1 -1
  122. package/schemas/crucible-ts/pathfinder/v1.0.0/path-result.schema.json +1 -1
  123. package/schemas/crucible-ts/protocol/http/v1.0.0/error-response.schema.json +1 -1
  124. package/schemas/crucible-ts/protocol/http/v1.0.0/health-response.schema.json +1 -1
  125. package/schemas/crucible-ts/protocol/http/v1.0.0/success-response.schema.json +1 -1
  126. package/schemas/crucible-ts/protocol/http/v1.0.0/version-response.schema.json +1 -1
  127. package/schemas/crucible-ts/server/management/v1.0.0/server-management.schema.json +1 -1
  128. package/schemas/crucible-ts/standards/publishing/v1.0.0/spec-catalog.schema.json +134 -0
  129. package/schemas/crucible-ts/taxonomy/devsecops/auth-methods/v1.0.0/auth-methods-key.schema.json +1 -1
  130. package/schemas/crucible-ts/taxonomy/devsecops/auth-methods/v1.0.0/auth-methods-metadata.schema.json +1 -1
  131. package/schemas/crucible-ts/taxonomy/devsecops/geo/v1.0.0/geo-key.schema.json +1 -1
  132. package/schemas/crucible-ts/taxonomy/devsecops/geo/v1.0.0/geo-metadata.schema.json +1 -1
  133. package/schemas/crucible-ts/taxonomy/devsecops/infra-phases/v1.0.0/infra-phases-key.schema.json +1 -1
  134. package/schemas/crucible-ts/taxonomy/devsecops/infra-phases/v1.0.0/infra-phases-metadata.schema.json +1 -1
  135. package/schemas/crucible-ts/taxonomy/devsecops/infra-providers/v1.0.0/infra-providers-key.schema.json +1 -1
  136. package/schemas/crucible-ts/taxonomy/devsecops/infra-providers/v1.0.0/infra-providers-metadata.schema.json +1 -1
  137. package/schemas/crucible-ts/taxonomy/devsecops/modules/v1.0.0/devsecops-module-entry.schema.json +1 -1
  138. package/schemas/crucible-ts/taxonomy/fixture/v1.0.0/fixture-catalog.schema.json +166 -0
  139. package/schemas/crucible-ts/taxonomy/language/v1.0.0/language-key.schema.json +1 -1
  140. package/schemas/crucible-ts/taxonomy/language/v1.0.0/language-metadata.schema.json +1 -1
  141. package/schemas/crucible-ts/taxonomy/library/foundry-catalogs/v1.1.0/catalog-entry.schema.json +98 -0
  142. package/schemas/crucible-ts/taxonomy/library/fulencode/detection-confidence/v1.0.0/levels.schema.json +1 -1
  143. package/schemas/crucible-ts/taxonomy/library/fulencode/encoding-families/v1.0.0/families.schema.json +1 -1
  144. package/schemas/crucible-ts/taxonomy/library/fulencode/normalization-profiles/v1.0.0/profiles.schema.json +1 -1
  145. package/schemas/crucible-ts/taxonomy/library/fulhash/algorithms/v1.0.0/algorithms.yaml +16 -0
  146. package/schemas/crucible-ts/taxonomy/library/modules/v1.0.0/module-entry.schema.json +1 -1
  147. package/schemas/crucible-ts/taxonomy/library/modules/v1.1.0/module-entry.schema.json +436 -0
  148. package/schemas/crucible-ts/taxonomy/repository-category/v1.0.0/category-key.schema.json +16 -8
  149. package/schemas/crucible-ts/taxonomy/repository-category/v1.0.0/category-metadata.schema.json +1 -1
  150. package/schemas/crucible-ts/upstream/3leaps/PROVENANCE.md +43 -0
  151. package/schemas/crucible-ts/upstream/3leaps/agentic/v0/role-prompt.schema.json +183 -0
  152. package/schemas/crucible-ts/upstream/3leaps/ailink/v0/prompt.schema.json +204 -0
  153. package/schemas/crucible-ts/upstream/3leaps/ailink/v0/search-response.schema.json +152 -0
  154. package/schemas/crucible-ts/upstream/README.md +50 -0
  155. package/schemas/crucible-ts/web/branding/v1.0.0/site-branding.schema.json +1 -1
  156. package/schemas/crucible-ts/web/styling/v1.0.0/site-styling.schema.json +1 -1
  157. package/schemas/crucible-ts/config/goneat/README.md +0 -60
  158. package/schemas/crucible-ts/config/goneat/v1.0.0/dates.yaml +0 -234
  159. package/schemas/crucible-ts/config/goneat/v1.0.0/goneat-config.yaml +0 -344
  160. package/schemas/crucible-ts/config/goneat/v1.0.0/lifecycle-phase.json +0 -20
  161. package/schemas/crucible-ts/config/goneat/v1.0.0/release-phase.json +0 -17
  162. package/schemas/crucible-ts/config/goneat/v1.0.0/security-policy.yaml +0 -178
  163. package/schemas/crucible-ts/config/goneat/v1.0.0/version-policy.schema.yaml +0 -205
  164. package/schemas/crucible-ts/tooling/goneat-tools/v1.0.0/README.md +0 -177
  165. package/schemas/crucible-ts/tooling/goneat-tools/v1.0.0/goneat-tools-config.schema.yaml +0 -146
@@ -108,7 +108,7 @@ required:
108
108
  - version
109
109
  - metrics
110
110
  additionalProperties: false
111
- version: "0.2.19"
111
+ version: "0.4.8"
112
112
  defaults:
113
113
  histogram_buckets:
114
114
  ms_metrics:
@@ -1,5 +1,5 @@
1
1
  # Fulmen repository category taxonomy (machine-readable source)
2
- version: "2025.10.2"
2
+ version: "2026.01.1"
3
3
  categories:
4
4
  - key: cli
5
5
  summary: "Command-line utilities without long-lived servers"
@@ -112,6 +112,28 @@ categories:
112
112
  references:
113
113
  - "docs/architecture/fulmen-forge-codex-standard.md"
114
114
  - "docs/architecture/fulmen-template-cdrl-standard.md"
115
+ - key: missive
116
+ summary: "Single-page promotional/CTA sites with minimal dependencies"
117
+ primaryEntryPoints:
118
+ - "index.html"
119
+ typicalConsumers:
120
+ - "Event attendees"
121
+ - "Donors/supporters"
122
+ - "Product launch visitors"
123
+ constraints:
124
+ - "MUST be single page (or very few pages)"
125
+ - "MUST NOT include blog, search, or content collections"
126
+ - "SHOULD use vanilla HTML/CSS with zero build"
127
+ - "MAY use light CSS framework (Pico.css, Water.css) via CDN"
128
+ - "MAY use minimal SSG only when partials/reuse justified"
129
+ notes: >
130
+ Missive repositories favor vanilla HTML/CSS with zero build. Escalate to Codex when multi-page, search, or content collections are needed.
131
+
132
+ templateNaming:
133
+ pattern: "forge-missive-{name}"
134
+ note: "Naming pattern TBD - could use message/communication metaphors"
135
+ references:
136
+ - "docs/standards/repository-category/missive/README.md"
115
137
  - key: sdk
116
138
  summary: "Client SDKs targeting external services or APIs"
117
139
  primaryEntryPoints:
@@ -121,3 +143,114 @@ categories:
121
143
  - "External developers"
122
144
  - "Partner integrations"
123
145
  notes: "Ship compatibility matrix and error taxonomy"
146
+ - key: spec-host
147
+ summary: "Machine-first static hosting for self-describing specification artifacts"
148
+ primaryEntryPoints:
149
+ - "index.json (optional catalog)"
150
+ - "v{version}/*.schema.json"
151
+ - "v{version}/*.openapi.json"
152
+ - "v{version}/*.asyncapi.json"
153
+ typicalConsumers:
154
+ - "JSON Schema validators"
155
+ - "IDE language servers"
156
+ - "API client generators"
157
+ - "CI/CD pipelines"
158
+ constraints:
159
+ - "MUST resolve embedded canonical IDs ($id, x-fulmen-id) over HTTPS"
160
+ - "MUST host self-describing specifications with industry-standard meta-validation"
161
+ - "MUST use versioned paths for immutability"
162
+ - "MUST NOT require runtime server (static files only)"
163
+ - "SHOULD provide index.json catalog for discovery"
164
+ - "MAY provide optional human-readable index page"
165
+ notes: >
166
+ Spec-host repositories host self-describing specifications where assets contain embedded canonical IDs ($id, x-fulmen-id) that must resolve over HTTPS. Assets are validated against industry-standard meta-schemas (JSON Schema, OpenAPI, AsyncAPI). For path-addressed assets without embedded IDs, see doc-host.
167
+
168
+ templateNaming:
169
+ pattern: "forge-spec-host-{name}"
170
+ note: "Naming pattern TBD - should reflect the corpus being hosted"
171
+ references:
172
+ - "docs/standards/publishing/spec-publishing.md"
173
+ - "docs/standards/repository-category/spec-host/README.md"
174
+ - key: doc-host
175
+ summary: "Machine-first static hosting for path-addressed documentation and configuration"
176
+ primaryEntryPoints:
177
+ - "index.json (optional catalog)"
178
+ - "{module}/**/*.md"
179
+ - "{module}/**/*.yaml"
180
+ - "{module}/**/*.json"
181
+ typicalConsumers:
182
+ - "Helper library shim modules"
183
+ - "Documentation tools"
184
+ - "Configuration loaders"
185
+ - "CI/CD pipelines"
186
+ constraints:
187
+ - "MUST serve files at canonical paths matching publish tree structure"
188
+ - "MUST use module namespace in URL structure per Canonical URI Resolution Standard"
189
+ - "MUST NOT require runtime server (static files only)"
190
+ - "SHOULD use versioned paths for versioned content"
191
+ - "MAY provide index for asset discovery"
192
+ notes: >
193
+ Doc-host repositories host path-addressed assets where canonical URLs are derived from file paths, not embedded identifiers. No meta-validation against industry-standard specifications is required. Suitable for Markdown docs, YAML configs, and reference data. For self-describing specifications with embedded IDs, see spec-host.
194
+
195
+ templateNaming:
196
+ pattern: "forge-doc-host-{name}"
197
+ note: "Naming pattern TBD - should reflect the content being hosted"
198
+ references:
199
+ - "docs/standards/publishing/canonical-uri-resolution.md"
200
+ - "docs/standards/repository-category/doc-host/README.md"
201
+ - key: fixture
202
+ summary: "Test infrastructure providing real-but-test-purpose servers, clients, or datastores"
203
+ primaryEntryPoints:
204
+ - "docker compose up"
205
+ - "Container image"
206
+ typicalConsumers:
207
+ - "Integration test suites"
208
+ - "CI/CD pipelines"
209
+ - "Local development environments"
210
+ constraints:
211
+ - "MUST NOT contain PII (use synthetic/anonymized data only)"
212
+ - "MUST NOT contain NPI/MNPI (regulatory/legal exposure)"
213
+ - "MUST NOT provide tooling for non-public interfaces in public repos"
214
+ - "MUST be container-first (docker compose up as primary entry)"
215
+ - "SHOULD use helper library (gofulmen, tsfulmen, pyfulmen) for observability"
216
+ - "MUST use scenario-driven configuration (YAML/JSON, not code changes)"
217
+ - "MUST be stateless by default (clean slate on restart)"
218
+ - "SHOULD expose structured logs for test assertions"
219
+ - "SHOULD self-document available endpoints/behaviors"
220
+ modes:
221
+ - key: server
222
+ summary: "Backend APIs (REST, gRPC, GraphQL)"
223
+ example: "fixture-server-proving-gauntlet-001"
224
+ - key: client
225
+ summary: "Clients for server/API testing"
226
+ example: "fixture-client-proving-probe-001"
227
+ - key: datastore
228
+ summary: "Databases, caches, or message queues"
229
+ example: "fixture-datastore-utility-bucket-001"
230
+ - key: identity
231
+ summary: "IdP/authentication services (OIDC, SAML)"
232
+ example: "fixture-identity-proving-warden-001"
233
+ status: "planned-v0.4.3"
234
+ behavioralCategories:
235
+ - key: proving
236
+ summary: "Real execution, test-purpose data, validates caller"
237
+ namingTheme: "Challenge/trial names (gauntlet, sentinel, bastion)"
238
+ - key: utility
239
+ summary: "Real execution, trivial but reliable service"
240
+ namingTheme: "Functional/descriptive (echo, static, relay)"
241
+ - key: chaos
242
+ summary: "Real execution, deliberately unreliable/hostile"
243
+ namingTheme: "Mischief names (gremlin, jinx, havoc)"
244
+ notes: >
245
+ Fixtures are real implementations with test-purpose configuration, NOT mocks (simulated responses). They execute real logic with synthetic data. Security constraints are inviolate to prevent data exposure in test artifacts. All fixture names must be registered in config/taxonomy/fixture-catalog.yaml.
246
+
247
+ naming:
248
+ pattern: "fixture-{mode}-{category}-{name}-{variant}"
249
+ categoryConstraint: "^(proving|utility|chaos)$"
250
+ nameConstraint: "^[a-z][a-z0-9]{1,20}$"
251
+ variantConstraint: "^[0-9]{3}$"
252
+ note: "Names registered in fixture-catalog.yaml. Variant 001 = reference implementation. Category in name for discoverability at scale."
253
+ registry: "config/taxonomy/fixture-catalog.yaml"
254
+ references:
255
+ - "docs/architecture/fulmen-fixture-standard.md"
256
+ - "docs/standards/repository-category/fixture/README.md"
@@ -28,40 +28,6 @@ declare const APP_IDENTITY_SCHEMA_ID = "config/repository/app-identity/v1.0.0/ap
28
28
  */
29
29
  declare const MAX_ANCESTOR_SEARCH_DEPTH = 20;
30
30
 
31
- /**
32
- * Application Identity Errors
33
- *
34
- * Module-specific error classes for identity operations
35
- */
36
-
37
- /**
38
- * Base error class for app identity operations
39
- */
40
- declare class AppIdentityError extends FulmenError {
41
- readonly identityPath?: string;
42
- constructor(message: string, identityPath?: string, cause?: Error);
43
- /**
44
- * Create error for identity not found
45
- */
46
- static notFound(searchedPaths: string[]): AppIdentityError;
47
- /**
48
- * Create error for schema validation failure
49
- */
50
- static validationFailed(path: string, diagnostics: SchemaValidationDiagnostic[]): AppIdentityError;
51
- /**
52
- * Create error for environment variable override pointing to missing file
53
- */
54
- static envOverrideMissing(envPath: string): AppIdentityError;
55
- /**
56
- * Create error for YAML parsing failure
57
- */
58
- static parseFailed(path: string, cause: Error): AppIdentityError;
59
- /**
60
- * Create error for file read failure
61
- */
62
- static readFailed(path: string, cause: Error): AppIdentityError;
63
- }
64
-
65
31
  /**
66
32
  * Application Identity Types
67
33
  *
@@ -169,6 +135,121 @@ interface LoadIdentityOptions {
169
135
  readonly skipValidation?: boolean;
170
136
  }
171
137
 
138
+ /**
139
+ * Embedded Identity Registration
140
+ *
141
+ * Provides a mechanism to register embedded identity at application startup
142
+ * for standalone binary/package support. This allows applications to work
143
+ * without requiring .fulmen/app.yaml to be discoverable on the filesystem.
144
+ *
145
+ * Discovery precedence (with embedded fallback):
146
+ * 1. Explicit path parameter
147
+ * 2. FULMEN_APP_IDENTITY_PATH environment variable
148
+ * 3. Ancestor search from CWD
149
+ * 4. Embedded identity fallback (this module)
150
+ */
151
+
152
+ /**
153
+ * Register embedded identity YAML that serves as fallback when
154
+ * runtime discovery cannot find an external app.yaml.
155
+ *
156
+ * Semantics:
157
+ * - First registration wins (subsequent calls throw error)
158
+ * - Validates against schema on registration
159
+ * - Stores as immutable process-level fallback
160
+ *
161
+ * @param data - YAML string or pre-parsed Identity object
162
+ * @throws {AppIdentityError} If already registered or validation fails
163
+ *
164
+ * @example
165
+ * ```typescript
166
+ * // From npm package entry point
167
+ * import { registerEmbeddedIdentity } from "@fulmenhq/tsfulmen/appidentity";
168
+ * import { readFileSync } from "node:fs";
169
+ * import { fileURLToPath } from "node:url";
170
+ * import { dirname, join } from "node:path";
171
+ *
172
+ * const __filename = fileURLToPath(import.meta.url);
173
+ * const __dirname = dirname(__filename);
174
+ * const embeddedPath = join(__dirname, "..", ".fulmen", "app.yaml");
175
+ *
176
+ * try {
177
+ * const yaml = readFileSync(embeddedPath, "utf-8");
178
+ * registerEmbeddedIdentity(yaml);
179
+ * } catch {
180
+ * // Embedded identity not available - discovery will use filesystem
181
+ * }
182
+ * ```
183
+ */
184
+ declare function registerEmbeddedIdentity(data: string | Identity): Promise<void>;
185
+ /**
186
+ * Check if embedded identity has been registered
187
+ *
188
+ * @returns true if registerEmbeddedIdentity() has been called successfully
189
+ */
190
+ declare function hasEmbeddedIdentity(): boolean;
191
+ /**
192
+ * Get the registered embedded identity
193
+ *
194
+ * @returns Frozen identity object or null if not registered
195
+ */
196
+ declare function getEmbeddedIdentity(): Identity | null;
197
+ /**
198
+ * Clear embedded identity registration
199
+ *
200
+ * WARNING: For testing only. In production, embedded identity should be
201
+ * set once at startup and never cleared.
202
+ */
203
+ declare function clearEmbeddedIdentity(): void;
204
+
205
+ /**
206
+ * Application Identity Errors
207
+ *
208
+ * Module-specific error classes for identity operations
209
+ */
210
+
211
+ /**
212
+ * Base error class for app identity operations
213
+ */
214
+ declare class AppIdentityError extends FulmenError {
215
+ readonly identityPath?: string;
216
+ constructor(message: string, identityPath?: string, cause?: Error);
217
+ /**
218
+ * Create error for identity not found
219
+ */
220
+ static notFound(searchedPaths: string[]): AppIdentityError;
221
+ /**
222
+ * Create error for schema validation failure
223
+ */
224
+ static validationFailed(path: string, diagnostics: SchemaValidationDiagnostic[]): AppIdentityError;
225
+ /**
226
+ * Create error for environment variable override pointing to missing file
227
+ */
228
+ static envOverrideMissing(envPath: string): AppIdentityError;
229
+ /**
230
+ * Create error for YAML parsing failure
231
+ */
232
+ static parseFailed(path: string, cause: Error): AppIdentityError;
233
+ /**
234
+ * Create error for file read failure
235
+ */
236
+ static readFailed(path: string, cause: Error): AppIdentityError;
237
+ /**
238
+ * Create error for embedded identity already registered
239
+ *
240
+ * Uses first-wins semantics - once registered, cannot be replaced
241
+ */
242
+ static alreadyRegistered(): AppIdentityError;
243
+ /**
244
+ * Create error for embedded identity YAML parsing failure
245
+ */
246
+ static embeddedParseFailed(cause: Error): AppIdentityError;
247
+ /**
248
+ * Create error for embedded identity schema validation failure
249
+ */
250
+ static embeddedValidationFailed(diagnostics: SchemaValidationDiagnostic[]): AppIdentityError;
251
+ }
252
+
172
253
  /**
173
254
  * Application Identity Helpers
174
255
  *
@@ -291,6 +372,7 @@ declare function clearIdentityCache(): void;
291
372
  * 2. Explicit path (options.path)
292
373
  * 3. Environment variable (FULMEN_APP_IDENTITY_PATH)
293
374
  * 4. Ancestor search from startDir or CWD
375
+ * 5. Embedded identity fallback (if registered via registerEmbeddedIdentity)
294
376
  *
295
377
  * Results are cached after first successful load unless skipCache is true.
296
378
  * Test injections are never cached.
@@ -301,4 +383,4 @@ declare function clearIdentityCache(): void;
301
383
  */
302
384
  declare function loadIdentity(options?: LoadIdentityOptions): Promise<Identity>;
303
385
 
304
- export { APP_IDENTITY_DIR, APP_IDENTITY_ENV_VAR, APP_IDENTITY_FILENAME, APP_IDENTITY_SCHEMA_ID, type AppIdentity, AppIdentityError, type ConfigIdentifiers, type Identity, type IdentityMetadata, type LoadIdentityOptions, MAX_ANCESTOR_SEARCH_DEPTH, type PythonMetadata, type RepositoryCategory, buildEnvVar, clearIdentityCache, getBinaryName, getCachedIdentity, getConfigIdentifiers, getConfigName, getEnvPrefix, getEnvVar, getTelemetryNamespace, getVendor, loadIdentity };
386
+ export { APP_IDENTITY_DIR, APP_IDENTITY_ENV_VAR, APP_IDENTITY_FILENAME, APP_IDENTITY_SCHEMA_ID, type AppIdentity, AppIdentityError, type ConfigIdentifiers, type Identity, type IdentityMetadata, type LoadIdentityOptions, MAX_ANCESTOR_SEARCH_DEPTH, type PythonMetadata, type RepositoryCategory, buildEnvVar, clearEmbeddedIdentity, clearIdentityCache, getBinaryName, getCachedIdentity, getConfigIdentifiers, getConfigName, getEmbeddedIdentity, getEnvPrefix, getEnvVar, getTelemetryNamespace, getVendor, hasEmbeddedIdentity, loadIdentity, registerEmbeddedIdentity };