@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.
- package/CHANGELOG.md +73 -512
- package/README.md +111 -28
- package/config/crucible-ts/agentic/roles/README.md +76 -0
- package/config/crucible-ts/agentic/roles/cicd.yaml +82 -0
- package/config/crucible-ts/agentic/roles/dataeng.yaml +104 -0
- package/config/crucible-ts/agentic/roles/devlead.yaml +84 -0
- package/config/crucible-ts/agentic/roles/devrev.yaml +105 -0
- package/config/crucible-ts/agentic/roles/entarch.yaml +101 -0
- package/config/crucible-ts/agentic/roles/infoarch.yaml +95 -0
- package/config/crucible-ts/agentic/roles/prodmktg.yaml +92 -0
- package/config/crucible-ts/agentic/roles/qa.yaml +148 -0
- package/config/crucible-ts/agentic/roles/secrev.yaml +101 -0
- package/config/crucible-ts/agentic/roles/uxdev.yaml +168 -0
- package/config/crucible-ts/branding/ecosystem.yaml +26 -0
- package/config/crucible-ts/library/foundry/exit-codes.snapshot.json +26 -0
- package/config/crucible-ts/library/foundry/exit-codes.yaml +28 -3
- package/config/crucible-ts/library/foundry/patterns.yaml +2 -2
- package/config/crucible-ts/library/foundry/signal-resolution-fixtures.yaml +207 -0
- package/config/crucible-ts/library/foundry/signals.yaml +21 -0
- package/config/crucible-ts/library/foundry/simplified-modes.snapshot.json +9 -1
- package/config/crucible-ts/library/{foundry/similarity-fixtures.yaml → similarity/fixtures.yaml} +1 -1
- package/config/crucible-ts/library/v1.0.0/module-manifest.yaml +1 -2
- package/config/crucible-ts/taxonomy/fixture-catalog.yaml +145 -0
- package/config/crucible-ts/taxonomy/languages.yaml +2 -2
- package/config/crucible-ts/taxonomy/library/foundry-catalogs/v1.1.0/catalogs.yaml +77 -0
- package/config/crucible-ts/taxonomy/library/platform-modules/v1.1.0/modules.yaml +722 -0
- package/config/crucible-ts/taxonomy/metrics.yaml +1 -1
- package/config/crucible-ts/taxonomy/repository-categories.yaml +134 -1
- package/dist/appidentity/index.d.ts +117 -35
- package/dist/appidentity/index.js +752 -592
- package/dist/appidentity/index.js.map +1 -1
- package/dist/config/index.js +118 -6
- package/dist/config/index.js.map +1 -1
- package/dist/crucible/index.js +118 -6
- package/dist/crucible/index.js.map +1 -1
- package/dist/errors/index.js +118 -6
- package/dist/errors/index.js.map +1 -1
- package/dist/foundry/index.d.ts +13 -676
- package/dist/foundry/index.js +118 -6
- package/dist/foundry/index.js.map +1 -1
- package/dist/foundry/similarity/index.d.ts +2 -2
- package/dist/fulhash/index.d.ts +64 -12
- package/dist/fulhash/index.js +292 -53
- package/dist/fulhash/index.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +753 -593
- package/dist/index.js.map +1 -1
- package/dist/{manager-D27vrdaS.d.ts → manager-CH3fX7zO.d.ts} +1 -1
- package/dist/pathfinder/index.js +368 -59
- package/dist/pathfinder/index.js.map +1 -1
- package/dist/reports/license-inventory.csv +302 -0
- package/dist/schema/index.js +118 -6
- package/dist/schema/index.js.map +1 -1
- package/dist/signals/index.d.ts +675 -0
- package/dist/signals/index.js +5790 -0
- package/dist/signals/index.js.map +1 -0
- package/dist/similarity/index.d.ts +2 -0
- package/dist/similarity/index.js +136 -0
- package/dist/similarity/index.js.map +1 -0
- package/dist/{suggest-Cv7SVQRu.d.ts → suggest-D8LbwtPV.d.ts} +1 -1
- package/dist/telemetry/http/index.js +704 -591
- package/dist/telemetry/http/index.js.map +1 -1
- package/dist/telemetry/index.js +118 -6
- package/dist/telemetry/index.js.map +1 -1
- package/dist/telemetry/prometheus/index.d.ts +1 -1
- package/dist/telemetry/prometheus/index.js +175 -11
- package/dist/telemetry/prometheus/index.js.map +1 -1
- package/package.json +15 -6
- package/schemas/crucible-ts/assessment/v1.0.0/severity-definitions.schema.json +1 -1
- package/schemas/crucible-ts/config/fulmen-ecosystem/v1.0.0/fulmen-config-paths.schema.json +1 -1
- package/schemas/crucible-ts/config/repository/app-identity/v1.0.0/app-identity.schema.json +3 -3
- package/schemas/crucible-ts/config/repository/v1.0.0/lifecycle-phase.json +1 -1
- package/schemas/crucible-ts/config/repository-category/codex/v1.0.0/codex-config.schema.json +1 -1
- package/schemas/crucible-ts/config/standards/v1.0.0/adr-adoption-status.json +1 -1
- package/schemas/crucible-ts/config/standards/v1.0.0/adr-frontmatter.schema.json +3 -3
- package/schemas/crucible-ts/config/standards/v1.0.0/adr-lifecycle-status.json +1 -1
- package/schemas/crucible-ts/config/sync-keys.schema.yaml +14 -0
- package/schemas/crucible-ts/content/ssot-provenance/v1.0.0/ssot-provenance.schema.json +1 -1
- package/schemas/crucible-ts/design/README.md +159 -0
- package/schemas/crucible-ts/design/core/v1.0.0/component-states.schema.json +204 -0
- package/schemas/crucible-ts/design/core/v1.0.0/semantic-colors.schema.json +179 -0
- package/schemas/crucible-ts/design/core/v1.0.0/spacing-scale.schema.json +165 -0
- package/schemas/crucible-ts/design/core/v1.0.0/typography-roles.schema.json +195 -0
- package/schemas/crucible-ts/design/tui/v1.0.0/color-palette.schema.json +303 -0
- package/schemas/crucible-ts/design/tui/v1.0.0/component.schema.json +374 -0
- package/schemas/crucible-ts/design/tui/v1.0.0/layout.schema.json +272 -0
- package/schemas/crucible-ts/design/tui/v1.0.0/theme.schema.json +205 -0
- package/schemas/crucible-ts/design/tui/v1.0.0/typography.schema.json +316 -0
- package/schemas/crucible-ts/devsecops/lorage-central/activity/v1.0.0/activity.schema.json +1 -1
- package/schemas/crucible-ts/devsecops/lorage-central/credentials/v1.0.0/credentials.schema.json +1 -1
- package/schemas/crucible-ts/devsecops/lorage-central/policy/v1.0.0/policy.schema.json +1 -1
- package/schemas/crucible-ts/devsecops/lorage-central/recipe/v1.0.0/recipe.schema.json +1 -1
- package/schemas/crucible-ts/devsecops/lorage-central/runbooks/v1.0.0/runbook.schema.json +1 -1
- package/schemas/crucible-ts/devsecops/lorage-central/tenant/v1.0.0/tenant.schema.json +1 -1
- package/schemas/crucible-ts/devsecops/secrets/v1.0.0/secrets.schema.json +1 -1
- package/schemas/crucible-ts/error-handling/v1.0.0/error-response.schema.json +1 -1
- package/schemas/crucible-ts/library/foundry/v1.0.0/country-codes.schema.json +1 -1
- package/schemas/crucible-ts/library/foundry/v1.0.0/exit-codes.schema.json +1 -1
- package/schemas/crucible-ts/library/foundry/v1.0.0/http-status-groups.schema.json +1 -1
- package/schemas/crucible-ts/library/foundry/v1.0.0/mime-types.schema.json +1 -1
- package/schemas/crucible-ts/library/foundry/v1.0.0/patterns.schema.json +1 -1
- package/schemas/crucible-ts/library/foundry/v1.0.0/signal-resolution-fixtures.schema.json +140 -0
- package/schemas/crucible-ts/library/foundry/v1.0.0/signals.schema.json +6 -1
- package/schemas/crucible-ts/library/fulencode/v1.0.0/fulencode-config.schema.json +1 -1
- package/schemas/crucible-ts/library/fulhash/v1.0.0/checksum-string.schema.json +2 -2
- package/schemas/crucible-ts/library/fulhash/v1.0.0/digest.schema.json +61 -1
- package/schemas/crucible-ts/library/fulhash/v1.0.0/fixtures.schema.json +1 -1
- package/schemas/crucible-ts/library/fulpack/v1.0.0/archive-entry.schema.json +1 -1
- package/schemas/crucible-ts/library/fulpack/v1.0.0/archive-info.schema.json +1 -1
- package/schemas/crucible-ts/library/fulpack/v1.0.0/archive-manifest.schema.json +2 -2
- package/schemas/crucible-ts/library/fulpack/v1.0.0/create-options.schema.json +1 -1
- package/schemas/crucible-ts/library/fulpack/v1.0.0/extract-options.schema.json +1 -1
- package/schemas/crucible-ts/library/fulpack/v1.0.0/extract-result.schema.json +1 -1
- package/schemas/crucible-ts/library/fulpack/v1.0.0/scan-options.schema.json +1 -1
- package/schemas/crucible-ts/library/fulpack/v1.0.0/validation-result.schema.json +1 -1
- package/schemas/crucible-ts/library/module-manifest/v1.0.0/module-manifest.schema.json +1 -1
- package/schemas/crucible-ts/library/{foundry → similarity}/v1.0.0/similarity.schema.json +2 -2
- package/schemas/crucible-ts/library/{foundry → similarity}/v2.0.0/similarity.schema.json +2 -2
- package/schemas/crucible-ts/observability/metrics/v1.0.0/metrics-event.schema.json +1 -1
- package/schemas/crucible-ts/pathfinder/v1.0.0/find-query.schema.json +1 -1
- package/schemas/crucible-ts/pathfinder/v1.0.0/finder-config.schema.json +1 -1
- package/schemas/crucible-ts/pathfinder/v1.0.0/path-result.schema.json +1 -1
- package/schemas/crucible-ts/protocol/http/v1.0.0/error-response.schema.json +1 -1
- package/schemas/crucible-ts/protocol/http/v1.0.0/health-response.schema.json +1 -1
- package/schemas/crucible-ts/protocol/http/v1.0.0/success-response.schema.json +1 -1
- package/schemas/crucible-ts/protocol/http/v1.0.0/version-response.schema.json +1 -1
- package/schemas/crucible-ts/server/management/v1.0.0/server-management.schema.json +1 -1
- package/schemas/crucible-ts/standards/publishing/v1.0.0/spec-catalog.schema.json +134 -0
- package/schemas/crucible-ts/taxonomy/devsecops/auth-methods/v1.0.0/auth-methods-key.schema.json +1 -1
- package/schemas/crucible-ts/taxonomy/devsecops/auth-methods/v1.0.0/auth-methods-metadata.schema.json +1 -1
- package/schemas/crucible-ts/taxonomy/devsecops/geo/v1.0.0/geo-key.schema.json +1 -1
- package/schemas/crucible-ts/taxonomy/devsecops/geo/v1.0.0/geo-metadata.schema.json +1 -1
- package/schemas/crucible-ts/taxonomy/devsecops/infra-phases/v1.0.0/infra-phases-key.schema.json +1 -1
- package/schemas/crucible-ts/taxonomy/devsecops/infra-phases/v1.0.0/infra-phases-metadata.schema.json +1 -1
- package/schemas/crucible-ts/taxonomy/devsecops/infra-providers/v1.0.0/infra-providers-key.schema.json +1 -1
- package/schemas/crucible-ts/taxonomy/devsecops/infra-providers/v1.0.0/infra-providers-metadata.schema.json +1 -1
- package/schemas/crucible-ts/taxonomy/devsecops/modules/v1.0.0/devsecops-module-entry.schema.json +1 -1
- package/schemas/crucible-ts/taxonomy/fixture/v1.0.0/fixture-catalog.schema.json +166 -0
- package/schemas/crucible-ts/taxonomy/language/v1.0.0/language-key.schema.json +1 -1
- package/schemas/crucible-ts/taxonomy/language/v1.0.0/language-metadata.schema.json +1 -1
- package/schemas/crucible-ts/taxonomy/library/foundry-catalogs/v1.1.0/catalog-entry.schema.json +98 -0
- package/schemas/crucible-ts/taxonomy/library/fulencode/detection-confidence/v1.0.0/levels.schema.json +1 -1
- package/schemas/crucible-ts/taxonomy/library/fulencode/encoding-families/v1.0.0/families.schema.json +1 -1
- package/schemas/crucible-ts/taxonomy/library/fulencode/normalization-profiles/v1.0.0/profiles.schema.json +1 -1
- package/schemas/crucible-ts/taxonomy/library/fulhash/algorithms/v1.0.0/algorithms.yaml +16 -0
- package/schemas/crucible-ts/taxonomy/library/modules/v1.0.0/module-entry.schema.json +1 -1
- package/schemas/crucible-ts/taxonomy/library/modules/v1.1.0/module-entry.schema.json +436 -0
- package/schemas/crucible-ts/taxonomy/repository-category/v1.0.0/category-key.schema.json +16 -8
- package/schemas/crucible-ts/taxonomy/repository-category/v1.0.0/category-metadata.schema.json +1 -1
- package/schemas/crucible-ts/upstream/3leaps/PROVENANCE.md +43 -0
- package/schemas/crucible-ts/upstream/3leaps/agentic/v0/role-prompt.schema.json +183 -0
- package/schemas/crucible-ts/upstream/3leaps/ailink/v0/prompt.schema.json +204 -0
- package/schemas/crucible-ts/upstream/3leaps/ailink/v0/search-response.schema.json +152 -0
- package/schemas/crucible-ts/upstream/README.md +50 -0
- package/schemas/crucible-ts/web/branding/v1.0.0/site-branding.schema.json +1 -1
- package/schemas/crucible-ts/web/styling/v1.0.0/site-styling.schema.json +1 -1
- package/schemas/crucible-ts/config/goneat/README.md +0 -60
- package/schemas/crucible-ts/config/goneat/v1.0.0/dates.yaml +0 -234
- package/schemas/crucible-ts/config/goneat/v1.0.0/goneat-config.yaml +0 -344
- package/schemas/crucible-ts/config/goneat/v1.0.0/lifecycle-phase.json +0 -20
- package/schemas/crucible-ts/config/goneat/v1.0.0/release-phase.json +0 -17
- package/schemas/crucible-ts/config/goneat/v1.0.0/security-policy.yaml +0 -178
- package/schemas/crucible-ts/config/goneat/v1.0.0/version-policy.schema.yaml +0 -205
- package/schemas/crucible-ts/tooling/goneat-tools/v1.0.0/README.md +0 -177
- package/schemas/crucible-ts/tooling/goneat-tools/v1.0.0/goneat-tools-config.schema.yaml +0 -146
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { F as FulmenError } from '../../fulmen-error-B_kX8jSC.js';
|
|
2
2
|
import { metrics } from '../index.js';
|
|
3
3
|
import { b as MetricsRegistry } from '../../registry-_yEKhTTl.js';
|
|
4
|
-
import { S as SignalManager } from '../../manager-
|
|
4
|
+
import { S as SignalManager } from '../../manager-CH3fX7zO.js';
|
|
5
5
|
import { IncomingMessage, ServerResponse, Server } from 'node:http';
|
|
6
6
|
import '../../types-BJswWpQC.js';
|
|
7
7
|
|
|
@@ -1610,7 +1610,10 @@ async function loadReferencedSchema(uri) {
|
|
|
1610
1610
|
const repoRoot = join(__dirname4, "..", "..");
|
|
1611
1611
|
let resolvedPath;
|
|
1612
1612
|
if (uri.startsWith("https://schemas.fulmenhq.dev/")) {
|
|
1613
|
-
|
|
1613
|
+
let relativePath = uri.replace("https://schemas.fulmenhq.dev/", "");
|
|
1614
|
+
if (relativePath.startsWith("crucible/")) {
|
|
1615
|
+
relativePath = relativePath.slice("crucible/".length);
|
|
1616
|
+
}
|
|
1614
1617
|
if (relativePath.startsWith("config/taxonomy/")) {
|
|
1615
1618
|
resolvedPath = join(
|
|
1616
1619
|
repoRoot,
|
|
@@ -1827,7 +1830,9 @@ async function compileSchemaById(schemaId, registryOptions) {
|
|
|
1827
1830
|
const aliases = [];
|
|
1828
1831
|
const normalizedRelativePath = metadata.relativePath.replace(/\\/g, "/");
|
|
1829
1832
|
if (normalizedRelativePath) {
|
|
1830
|
-
aliases.push(
|
|
1833
|
+
aliases.push(
|
|
1834
|
+
new URL(`crucible/${normalizedRelativePath}`, "https://schemas.fulmenhq.dev/").toString()
|
|
1835
|
+
);
|
|
1831
1836
|
}
|
|
1832
1837
|
return compileSchema(content, { aliases });
|
|
1833
1838
|
} catch (error) {
|
|
@@ -2345,6 +2350,12 @@ var init_exitCodes = __esm({
|
|
|
2345
2350
|
EXIT_TEST_USAGE_ERROR: 94,
|
|
2346
2351
|
EXIT_TEST_NO_TESTS_COLLECTED: 95,
|
|
2347
2352
|
EXIT_COVERAGE_THRESHOLD_NOT_MET: 96,
|
|
2353
|
+
// Shell & Process Control (124-127)
|
|
2354
|
+
// Exit codes from shell conventions and process control utilities (timeout, exec)
|
|
2355
|
+
EXIT_TIMEOUT: 124,
|
|
2356
|
+
EXIT_TIMEOUT_INTERNAL: 125,
|
|
2357
|
+
EXIT_CANNOT_EXECUTE: 126,
|
|
2358
|
+
EXIT_NOT_FOUND: 127,
|
|
2348
2359
|
// Signal-Induced Exits (128-165)
|
|
2349
2360
|
// Process terminated by Unix signals (128+N pattern per POSIX). Signal codes follow Linux numbering; macOS/FreeBSD differ for SIGUSR1/SIGUSR2. For full signal semantics, see config/library/foundry/signals.yaml. For signal handling patterns, see docs/standards/library/modules/signal-handling.md.
|
|
2350
2361
|
EXIT_SIGNAL_HUP: 129,
|
|
@@ -2682,6 +2693,36 @@ var init_exitCodes = __esm({
|
|
|
2682
2693
|
context: "Code coverage validation, quality gate failure",
|
|
2683
2694
|
category: "testing"
|
|
2684
2695
|
},
|
|
2696
|
+
124: {
|
|
2697
|
+
code: 124,
|
|
2698
|
+
name: "EXIT_TIMEOUT",
|
|
2699
|
+
description: "Command timed out before completion",
|
|
2700
|
+
context: "GNU timeout or similar utility terminated command after deadline",
|
|
2701
|
+
category: "shell"
|
|
2702
|
+
},
|
|
2703
|
+
125: {
|
|
2704
|
+
code: 125,
|
|
2705
|
+
name: "EXIT_TIMEOUT_INTERNAL",
|
|
2706
|
+
description: "Timeout utility itself failed",
|
|
2707
|
+
context: "Error in timeout tool before or during command execution (not command failure)",
|
|
2708
|
+
category: "shell"
|
|
2709
|
+
},
|
|
2710
|
+
126: {
|
|
2711
|
+
code: 126,
|
|
2712
|
+
name: "EXIT_CANNOT_EXECUTE",
|
|
2713
|
+
description: "Command found but could not be executed",
|
|
2714
|
+
context: "Permission denied, not executable, exec format error",
|
|
2715
|
+
category: "shell",
|
|
2716
|
+
bsdEquivalent: "EX_NOPERM (partial)"
|
|
2717
|
+
},
|
|
2718
|
+
127: {
|
|
2719
|
+
code: 127,
|
|
2720
|
+
name: "EXIT_NOT_FOUND",
|
|
2721
|
+
description: "Command not found",
|
|
2722
|
+
context: "Executable not found in PATH or specified path does not exist",
|
|
2723
|
+
category: "shell",
|
|
2724
|
+
bsdEquivalent: "EX_UNAVAILABLE (partial)"
|
|
2725
|
+
},
|
|
2685
2726
|
129: {
|
|
2686
2727
|
code: 129,
|
|
2687
2728
|
name: "EXIT_SIGNAL_HUP",
|
|
@@ -4995,6 +5036,45 @@ ${cause.message}`;
|
|
|
4995
5036
|
${cause.message}`;
|
|
4996
5037
|
return new _AppIdentityError(message, path, cause);
|
|
4997
5038
|
}
|
|
5039
|
+
/**
|
|
5040
|
+
* Create error for embedded identity already registered
|
|
5041
|
+
*
|
|
5042
|
+
* Uses first-wins semantics - once registered, cannot be replaced
|
|
5043
|
+
*/
|
|
5044
|
+
static alreadyRegistered() {
|
|
5045
|
+
const message = "Embedded identity already registered. Registration uses first-wins semantics and cannot be replaced.";
|
|
5046
|
+
return new _AppIdentityError(message);
|
|
5047
|
+
}
|
|
5048
|
+
/**
|
|
5049
|
+
* Create error for embedded identity YAML parsing failure
|
|
5050
|
+
*/
|
|
5051
|
+
static embeddedParseFailed(cause) {
|
|
5052
|
+
const message = `Failed to parse embedded identity YAML: ${cause.message}`;
|
|
5053
|
+
return new _AppIdentityError(message, void 0, cause);
|
|
5054
|
+
}
|
|
5055
|
+
/**
|
|
5056
|
+
* Create error for embedded identity schema validation failure
|
|
5057
|
+
*/
|
|
5058
|
+
static embeddedValidationFailed(diagnostics) {
|
|
5059
|
+
const errorCount = diagnostics.filter((d) => d.severity === "ERROR").length;
|
|
5060
|
+
const warningCount = diagnostics.filter((d) => d.severity === "WARN").length;
|
|
5061
|
+
let message = "Invalid embedded identity\n";
|
|
5062
|
+
message += `Validation errors: ${errorCount} error(s), ${warningCount} warning(s)
|
|
5063
|
+
`;
|
|
5064
|
+
const displayDiagnostics = diagnostics.slice(0, 3);
|
|
5065
|
+
for (const diag3 of displayDiagnostics) {
|
|
5066
|
+
message += ` - ${diag3.message}`;
|
|
5067
|
+
if (diag3.pointer) {
|
|
5068
|
+
message += ` at ${diag3.pointer}`;
|
|
5069
|
+
}
|
|
5070
|
+
message += "\n";
|
|
5071
|
+
}
|
|
5072
|
+
if (diagnostics.length > 3) {
|
|
5073
|
+
message += ` ... and ${diagnostics.length - 3} more
|
|
5074
|
+
`;
|
|
5075
|
+
}
|
|
5076
|
+
return new _AppIdentityError(message);
|
|
5077
|
+
}
|
|
4998
5078
|
};
|
|
4999
5079
|
}
|
|
5000
5080
|
});
|
|
@@ -5052,6 +5132,65 @@ var init_discovery = __esm({
|
|
|
5052
5132
|
init_errors4();
|
|
5053
5133
|
}
|
|
5054
5134
|
});
|
|
5135
|
+
function deepFreeze5(obj) {
|
|
5136
|
+
Object.freeze(obj);
|
|
5137
|
+
Object.getOwnPropertyNames(obj).forEach((prop) => {
|
|
5138
|
+
const value = obj[prop];
|
|
5139
|
+
if (value !== null && (typeof value === "object" || typeof value === "function") && !Object.isFrozen(value)) {
|
|
5140
|
+
deepFreeze5(value);
|
|
5141
|
+
}
|
|
5142
|
+
});
|
|
5143
|
+
return obj;
|
|
5144
|
+
}
|
|
5145
|
+
async function registerEmbeddedIdentity(data) {
|
|
5146
|
+
if (isRegistered) {
|
|
5147
|
+
throw AppIdentityError.alreadyRegistered();
|
|
5148
|
+
}
|
|
5149
|
+
let identity;
|
|
5150
|
+
if (typeof data === "string") {
|
|
5151
|
+
let parsed;
|
|
5152
|
+
try {
|
|
5153
|
+
parsed = parse(data);
|
|
5154
|
+
} catch (error) {
|
|
5155
|
+
throw AppIdentityError.embeddedParseFailed(
|
|
5156
|
+
error instanceof Error ? error : new Error(String(error))
|
|
5157
|
+
);
|
|
5158
|
+
}
|
|
5159
|
+
const result = await validateDataBySchemaId(parsed, APP_IDENTITY_SCHEMA_ID);
|
|
5160
|
+
if (!result.valid) {
|
|
5161
|
+
throw AppIdentityError.embeddedValidationFailed(result.diagnostics);
|
|
5162
|
+
}
|
|
5163
|
+
identity = parsed;
|
|
5164
|
+
} else {
|
|
5165
|
+
const result = await validateDataBySchemaId(data, APP_IDENTITY_SCHEMA_ID);
|
|
5166
|
+
if (!result.valid) {
|
|
5167
|
+
throw AppIdentityError.embeddedValidationFailed(result.diagnostics);
|
|
5168
|
+
}
|
|
5169
|
+
identity = data;
|
|
5170
|
+
}
|
|
5171
|
+
embeddedIdentity = deepFreeze5(structuredClone(identity));
|
|
5172
|
+
isRegistered = true;
|
|
5173
|
+
}
|
|
5174
|
+
function hasEmbeddedIdentity() {
|
|
5175
|
+
return isRegistered;
|
|
5176
|
+
}
|
|
5177
|
+
function getEmbeddedIdentity() {
|
|
5178
|
+
return embeddedIdentity;
|
|
5179
|
+
}
|
|
5180
|
+
function clearEmbeddedIdentity() {
|
|
5181
|
+
embeddedIdentity = null;
|
|
5182
|
+
isRegistered = false;
|
|
5183
|
+
}
|
|
5184
|
+
var embeddedIdentity, isRegistered;
|
|
5185
|
+
var init_embedded = __esm({
|
|
5186
|
+
"src/appidentity/embedded.ts"() {
|
|
5187
|
+
init_schema();
|
|
5188
|
+
init_constants();
|
|
5189
|
+
init_errors4();
|
|
5190
|
+
embeddedIdentity = null;
|
|
5191
|
+
isRegistered = false;
|
|
5192
|
+
}
|
|
5193
|
+
});
|
|
5055
5194
|
|
|
5056
5195
|
// src/appidentity/loader.ts
|
|
5057
5196
|
var loader_exports = {};
|
|
@@ -5060,19 +5199,19 @@ __export(loader_exports, {
|
|
|
5060
5199
|
getCachedIdentity: () => getCachedIdentity,
|
|
5061
5200
|
loadIdentity: () => loadIdentity
|
|
5062
5201
|
});
|
|
5063
|
-
function
|
|
5202
|
+
function deepFreeze6(obj) {
|
|
5064
5203
|
Object.freeze(obj);
|
|
5065
5204
|
Object.getOwnPropertyNames(obj).forEach((prop) => {
|
|
5066
5205
|
const value = obj[prop];
|
|
5067
5206
|
if (value !== null && (typeof value === "object" || typeof value === "function") && !Object.isFrozen(value)) {
|
|
5068
|
-
|
|
5207
|
+
deepFreeze6(value);
|
|
5069
5208
|
}
|
|
5070
5209
|
});
|
|
5071
5210
|
return obj;
|
|
5072
5211
|
}
|
|
5073
5212
|
async function loadIdentity(options) {
|
|
5074
5213
|
if (options?.identity) {
|
|
5075
|
-
return
|
|
5214
|
+
return deepFreeze6(structuredClone(options.identity));
|
|
5076
5215
|
}
|
|
5077
5216
|
if (!options?.skipCache) {
|
|
5078
5217
|
const cached = getCachedIdentity();
|
|
@@ -5080,11 +5219,30 @@ async function loadIdentity(options) {
|
|
|
5080
5219
|
return cached;
|
|
5081
5220
|
}
|
|
5082
5221
|
}
|
|
5083
|
-
|
|
5084
|
-
|
|
5085
|
-
|
|
5086
|
-
|
|
5222
|
+
let discovery;
|
|
5223
|
+
try {
|
|
5224
|
+
discovery = await discoverIdentityPath({
|
|
5225
|
+
path: options?.path,
|
|
5226
|
+
startDir: options?.startDir
|
|
5227
|
+
});
|
|
5228
|
+
} catch (error) {
|
|
5229
|
+
const hasExplicitPath = Boolean(options?.path);
|
|
5230
|
+
const hasEnvOverride = Boolean(process.env[APP_IDENTITY_ENV_VAR]);
|
|
5231
|
+
if (!hasExplicitPath && !hasEnvOverride && error instanceof AppIdentityError) {
|
|
5232
|
+
const embedded = getEmbeddedIdentity();
|
|
5233
|
+
if (embedded) {
|
|
5234
|
+
setCachedIdentity(embedded);
|
|
5235
|
+
return embedded;
|
|
5236
|
+
}
|
|
5237
|
+
}
|
|
5238
|
+
throw error;
|
|
5239
|
+
}
|
|
5087
5240
|
if (!discovery) {
|
|
5241
|
+
const embedded = getEmbeddedIdentity();
|
|
5242
|
+
if (embedded) {
|
|
5243
|
+
setCachedIdentity(embedded);
|
|
5244
|
+
return embedded;
|
|
5245
|
+
}
|
|
5088
5246
|
throw AppIdentityError.notFound([]);
|
|
5089
5247
|
}
|
|
5090
5248
|
let content;
|
|
@@ -5111,7 +5269,7 @@ async function loadIdentity(options) {
|
|
|
5111
5269
|
throw AppIdentityError.validationFailed(discovery.path, result.diagnostics);
|
|
5112
5270
|
}
|
|
5113
5271
|
}
|
|
5114
|
-
const identity =
|
|
5272
|
+
const identity = deepFreeze6(structuredClone(parsed));
|
|
5115
5273
|
setCachedIdentity(identity);
|
|
5116
5274
|
return identity;
|
|
5117
5275
|
}
|
|
@@ -5121,6 +5279,7 @@ var init_loader2 = __esm({
|
|
|
5121
5279
|
init_cache();
|
|
5122
5280
|
init_constants();
|
|
5123
5281
|
init_discovery();
|
|
5282
|
+
init_embedded();
|
|
5124
5283
|
init_errors4();
|
|
5125
5284
|
}
|
|
5126
5285
|
});
|
|
@@ -10555,20 +10714,25 @@ __export(appidentity_exports, {
|
|
|
10555
10714
|
AppIdentityError: () => AppIdentityError,
|
|
10556
10715
|
MAX_ANCESTOR_SEARCH_DEPTH: () => MAX_ANCESTOR_SEARCH_DEPTH,
|
|
10557
10716
|
buildEnvVar: () => buildEnvVar,
|
|
10717
|
+
clearEmbeddedIdentity: () => clearEmbeddedIdentity,
|
|
10558
10718
|
clearIdentityCache: () => clearIdentityCache,
|
|
10559
10719
|
getBinaryName: () => getBinaryName,
|
|
10560
10720
|
getCachedIdentity: () => getCachedIdentity,
|
|
10561
10721
|
getConfigIdentifiers: () => getConfigIdentifiers,
|
|
10562
10722
|
getConfigName: () => getConfigName,
|
|
10723
|
+
getEmbeddedIdentity: () => getEmbeddedIdentity,
|
|
10563
10724
|
getEnvPrefix: () => getEnvPrefix,
|
|
10564
10725
|
getEnvVar: () => getEnvVar,
|
|
10565
10726
|
getTelemetryNamespace: () => getTelemetryNamespace,
|
|
10566
10727
|
getVendor: () => getVendor,
|
|
10567
|
-
|
|
10728
|
+
hasEmbeddedIdentity: () => hasEmbeddedIdentity,
|
|
10729
|
+
loadIdentity: () => loadIdentity,
|
|
10730
|
+
registerEmbeddedIdentity: () => registerEmbeddedIdentity
|
|
10568
10731
|
});
|
|
10569
10732
|
var init_appidentity = __esm({
|
|
10570
10733
|
"src/appidentity/index.ts"() {
|
|
10571
10734
|
init_constants();
|
|
10735
|
+
init_embedded();
|
|
10572
10736
|
init_errors4();
|
|
10573
10737
|
init_helpers();
|
|
10574
10738
|
init_loader2();
|