@fulmenhq/tsfulmen 0.3.3 → 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.
- package/CHANGELOG.md +51 -1
- package/README.md +30 -1
- package/config/crucible-ts/taxonomy/metrics.yaml +1 -1
- package/dist/appidentity/index.js +9 -2209
- package/dist/appidentity/index.js.map +1 -1
- package/dist/assets/index.d.ts +179 -0
- package/dist/assets/index.js +4 -0
- package/dist/assets/index.js.map +1 -0
- package/dist/bin/prometheus-cli.js +15 -9139
- package/dist/bin/prometheus-cli.js.map +1 -1
- package/dist/bin/schema-cli.js +4 -6098
- package/dist/bin/schema-cli.js.map +1 -1
- package/dist/bin/signals-cli.js +15 -1910
- package/dist/bin/signals-cli.js.map +1 -1
- package/dist/chunk-3HISR2XI.js +36 -0
- package/dist/chunk-3HISR2XI.js.map +1 -0
- package/dist/chunk-5HZEJGZ5.js +725 -0
- package/dist/chunk-5HZEJGZ5.js.map +1 -0
- package/dist/chunk-7SVYOPJ3.js +9412 -0
- package/dist/chunk-7SVYOPJ3.js.map +1 -0
- package/dist/chunk-BCO3FUUO.js +682 -0
- package/dist/chunk-BCO3FUUO.js.map +1 -0
- package/dist/chunk-BJDL6JEX.js +208 -0
- package/dist/chunk-BJDL6JEX.js.map +1 -0
- package/dist/chunk-BTUS6PZZ.js +302 -0
- package/dist/chunk-BTUS6PZZ.js.map +1 -0
- package/dist/chunk-CW4CSNVF.js +410 -0
- package/dist/chunk-CW4CSNVF.js.map +1 -0
- package/dist/chunk-HIBZ2AY7.js +194 -0
- package/dist/chunk-HIBZ2AY7.js.map +1 -0
- package/dist/chunk-HS4F3BRR.js +985 -0
- package/dist/chunk-HS4F3BRR.js.map +1 -0
- package/dist/chunk-HY6JQOFN.js +32 -0
- package/dist/chunk-HY6JQOFN.js.map +1 -0
- package/dist/chunk-K2FYT43R.js +837 -0
- package/dist/chunk-K2FYT43R.js.map +1 -0
- package/dist/chunk-K7BMFGQP.js +43 -0
- package/dist/chunk-K7BMFGQP.js.map +1 -0
- package/dist/chunk-LWAH2UG7.js +103 -0
- package/dist/chunk-LWAH2UG7.js.map +1 -0
- package/dist/chunk-OHE2AOH4.js +273 -0
- package/dist/chunk-OHE2AOH4.js.map +1 -0
- package/dist/chunk-P3DNOZOG.js +1488 -0
- package/dist/chunk-P3DNOZOG.js.map +1 -0
- package/dist/chunk-PQ6TKPUN.js +27 -0
- package/dist/chunk-PQ6TKPUN.js.map +1 -0
- package/dist/chunk-QCCN6POA.js +211 -0
- package/dist/chunk-QCCN6POA.js.map +1 -0
- package/dist/chunk-RSLFR4TO.js +631 -0
- package/dist/chunk-RSLFR4TO.js.map +1 -0
- package/dist/chunk-UP2VWCW5.js +33 -0
- package/dist/chunk-UP2VWCW5.js.map +1 -0
- package/dist/chunk-W6TQFTTY.js +130 -0
- package/dist/chunk-W6TQFTTY.js.map +1 -0
- package/dist/chunk-WSMVLWLB.js +269 -0
- package/dist/chunk-WSMVLWLB.js.map +1 -0
- package/dist/config/index.js +6 -1220
- package/dist/config/index.js.map +1 -1
- package/dist/crucible/fulpack/index.js +2 -25
- package/dist/crucible/fulpack/index.js.map +1 -1
- package/dist/crucible/index.js +13 -1129
- package/dist/crucible/index.js.map +1 -1
- package/dist/docscribe/index.js +2 -680
- package/dist/docscribe/index.js.map +1 -1
- package/dist/errors/index.js +5 -1831
- package/dist/errors/index.js.map +1 -1
- package/dist/errors-D7KXV3QW.js +4 -0
- package/dist/errors-D7KXV3QW.js.map +1 -0
- package/dist/errors-RBJX6ETJ.js +8 -0
- package/dist/errors-RBJX6ETJ.js.map +1 -0
- package/dist/export-BWRETGYS.js +6 -0
- package/dist/export-BWRETGYS.js.map +1 -0
- package/dist/foundry/index.js +340 -3949
- package/dist/foundry/index.js.map +1 -1
- package/dist/foundry/similarity/index.js +3 -134
- package/dist/foundry/similarity/index.js.map +1 -1
- package/dist/fulencode/index.js +3 -319
- package/dist/fulencode/index.js.map +1 -1
- package/dist/fulhash/index.js +3 -611
- package/dist/fulhash/index.js.map +1 -1
- package/dist/fulpack/index.js +3 -1515
- package/dist/fulpack/index.js.map +1 -1
- package/dist/hash-YOJYVOWH.js +4 -0
- package/dist/hash-YOJYVOWH.js.map +1 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +14 -4395
- package/dist/index.js.map +1 -1
- package/dist/loader-H5K7HSO5.js +9 -0
- package/dist/loader-H5K7HSO5.js.map +1 -0
- package/dist/logging/index.js +2 -723
- package/dist/logging/index.js.map +1 -1
- package/dist/pathfinder/index.js +18 -2341
- package/dist/pathfinder/index.js.map +1 -1
- package/dist/prom-client-PNEBGD3G.js +4801 -0
- package/dist/prom-client-PNEBGD3G.js.map +1 -0
- package/dist/reports/license-inventory.csv +1 -1
- package/dist/schema/index.d.ts +19 -6
- package/dist/schema/index.js +4 -6148
- package/dist/schema/index.js.map +1 -1
- package/dist/signals/index.js +8 -2767
- package/dist/signals/index.js.map +1 -1
- package/dist/similarity/index.js +3 -134
- package/dist/similarity/index.js.map +1 -1
- package/dist/telemetry/http/index.js +9 -930
- package/dist/telemetry/http/index.js.map +1 -1
- package/dist/telemetry/index.js +4 -1561
- package/dist/telemetry/index.js.map +1 -1
- package/dist/telemetry/prometheus/index.js +7 -8422
- package/dist/telemetry/prometheus/index.js.map +1 -1
- package/dist/validator-U4CKD2Y3.js +6 -0
- package/dist/validator-U4CKD2Y3.js.map +1 -0
- package/package.json +5 -1
- package/schemas/crucible-ts/library/module-manifest/v1.0.0/module-manifest.schema.json +1 -1
- package/schemas/crucible-ts/observability/logging/v1.0.0/definitions.schema.json +1 -1
- package/schemas/crucible-ts/observability/logging/v1.0.0/log-event.schema.json +13 -13
- package/schemas/crucible-ts/observability/logging/v1.0.0/logger-config.schema.json +2 -2
- package/schemas/crucible-ts/observability/logging/v1.0.0/logging-policy.schema.json +1 -1
- package/schemas/crucible-ts/observability/logging/v1.0.0/middleware-config.schema.json +2 -2
- package/schemas/crucible-ts/observability/logging/v1.0.0/severity-filter.schema.json +3 -3
- package/schemas/crucible-ts/upstream/3leaps/crucible/PROVENANCE.md +3 -3
- package/schemas/crucible-ts/upstream/3leaps/crucible/docs/catalog/classifiers/README.md +1 -1
- package/schemas/crucible-ts/upstream/3leaps/crucible/docs/standards/classifiers-framework.md +1 -1
- package/schemas/crucible-ts/upstream/3leaps/crucible/docs/standards/data-sensitivity-classification.md +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/crucible/foundry/exitCodes.ts","../src/foundry/exit-codes/capabilities.ts","../src/foundry/exit-codes/simplified.ts"],"names":["SimplifiedMode"],"mappings":";AAgBO,IAAM,SAAA,GAAY;AAAA;AAAA;AAAA,EAGvB,YAAA,EAAc,CAAA;AAAA,EACd,YAAA,EAAc,CAAA;AAAA;AAAA;AAAA,EAId,gBAAA,EAAkB,EAAA;AAAA,EAClB,yBAAA,EAA2B,EAAA;AAAA,EAC3B,6BAAA,EAA+B,EAAA;AAAA,EAC/B,wBAAA,EAA0B,EAAA;AAAA,EAC1B,uBAAA,EAAyB,EAAA;AAAA,EACzB,uBAAA,EAAyB,EAAA;AAAA;AAAA;AAAA,EAIzB,mBAAA,EAAqB,EAAA;AAAA,EACrB,uBAAA,EAAyB,EAAA;AAAA,EACzB,0BAAA,EAA4B,EAAA;AAAA,EAC5B,0BAAA,EAA4B,EAAA;AAAA,EAC5B,wBAAA,EAA0B,EAAA;AAAA;AAAA;AAAA,EAI1B,wBAAA,EAA0B,EAAA;AAAA,EAC1B,yBAAA,EAA2B,EAAA;AAAA,EAC3B,iCAAA,EAAmC,EAAA;AAAA,EACnC,uBAAA,EAAyB,EAAA;AAAA,EACzB,sBAAA,EAAwB,EAAA;AAAA;AAAA;AAAA,EAIxB,qBAAA,EAAuB,EAAA;AAAA,EACvB,8BAAA,EAAgC,EAAA;AAAA,EAChC,UAAA,EAAY,EAAA;AAAA;AAAA;AAAA,EAIZ,sBAAA,EAAwB,EAAA;AAAA,EACxB,mBAAA,EAA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AAA,OAAO,cAAA;AACT","file":"chunk-RSLFR4TO.js","sourcesContent":["/**\n * Exit Codes - Generated from Crucible catalog\n *\n * This file is AUTO-GENERATED from the Foundry exit codes catalog.\n * DO NOT EDIT MANUALLY - changes will be overwritten.\n *\n * Catalog Version: v1.0.0\n * Last Reviewed: 2025-10-31\n * Source: config/library/foundry/exit-codes.yaml\n */\n\n/**\n * Standardized process exit codes for Fulmen ecosystem\n *\n * @see https://github.com/fulmenhq/crucible/blob/main/docs/standards/library/foundry/README.md#exit-codes\n */\nexport const exitCodes = {\n // Standard Exit Codes (0-1)\n // POSIX standard success and generic failure codes\n EXIT_SUCCESS: 0,\n EXIT_FAILURE: 1,\n\n // Networking & Port Management (10-19)\n // Network-related failures (ports, connectivity, etc.)\n EXIT_PORT_IN_USE: 10,\n EXIT_PORT_RANGE_EXHAUSTED: 11,\n EXIT_INSTANCE_ALREADY_RUNNING: 12,\n EXIT_NETWORK_UNREACHABLE: 13,\n EXIT_CONNECTION_REFUSED: 14,\n EXIT_CONNECTION_TIMEOUT: 15,\n\n // Configuration & Validation (20-29)\n // Configuration errors, validation failures, version mismatches\n EXIT_CONFIG_INVALID: 20,\n EXIT_MISSING_DEPENDENCY: 21,\n EXIT_SSOT_VERSION_MISMATCH: 22,\n EXIT_CONFIG_FILE_NOT_FOUND: 23,\n EXIT_ENVIRONMENT_INVALID: 24,\n\n // Runtime Errors (30-39)\n // Errors during normal operation (health checks, database, etc.)\n EXIT_HEALTH_CHECK_FAILED: 30,\n EXIT_DATABASE_UNAVAILABLE: 31,\n EXIT_EXTERNAL_SERVICE_UNAVAILABLE: 32,\n EXIT_RESOURCE_EXHAUSTED: 33,\n EXIT_OPERATION_TIMEOUT: 34,\n\n // Command-Line Usage Errors (40-49)\n // Invalid arguments, missing required flags, usage errors\n EXIT_INVALID_ARGUMENT: 40,\n EXIT_MISSING_REQUIRED_ARGUMENT: 41,\n EXIT_USAGE: 64,\n\n // Permissions & File Access (50-59)\n // Permission denied, file not found, access errors\n EXIT_PERMISSION_DENIED: 50,\n EXIT_FILE_NOT_FOUND: 51,\n EXIT_DIRECTORY_NOT_FOUND: 52,\n EXIT_FILE_READ_ERROR: 53,\n EXIT_FILE_WRITE_ERROR: 54,\n\n // Data & Processing Errors (60-69)\n // Data validation, parsing, transformation failures\n EXIT_DATA_INVALID: 60,\n EXIT_PARSE_ERROR: 61,\n EXIT_TRANSFORMATION_FAILED: 62,\n EXIT_DATA_CORRUPT: 63,\n\n // Security & Authentication (70-79)\n // Authentication failures, authorization errors, security violations\n EXIT_AUTHENTICATION_FAILED: 70,\n EXIT_AUTHORIZATION_FAILED: 71,\n EXIT_SECURITY_VIOLATION: 72,\n EXIT_CERTIFICATE_INVALID: 73,\n\n // Observability & Monitoring (80-89)\n // Observability infrastructure failures. Use when observability is CRITICAL to operation (e.g., monitoring agents, telemetry exporters). For workhorses where observability is auxiliary: - Log warning and continue (don't exit) - Emit degraded health status - Only exit if explicitly configured (fail_on_observability_error: true)\n EXIT_METRICS_UNAVAILABLE: 80,\n EXIT_TRACING_FAILED: 81,\n EXIT_LOGGING_FAILED: 82,\n EXIT_ALERT_SYSTEM_FAILED: 83,\n EXIT_STRUCTURED_LOGGING_FAILED: 84,\n\n // Testing & Validation (91-99)\n // Test execution outcomes and validation failures. NOTE: Test harnesses MUST use EXIT_SUCCESS (0) for successful test runs per ecosystem conventions (pytest, Go testing, Jest all use 0 for success). Codes in this category are for FAILURES and exceptional conditions only.\n EXIT_TEST_FAILURE: 91,\n EXIT_TEST_ERROR: 92,\n EXIT_TEST_INTERRUPTED: 93,\n EXIT_TEST_USAGE_ERROR: 94,\n EXIT_TEST_NO_TESTS_COLLECTED: 95,\n EXIT_COVERAGE_THRESHOLD_NOT_MET: 96,\n\n // Shell & Process Control (124-127)\n // Exit codes from shell conventions and process control utilities (timeout, exec)\n EXIT_TIMEOUT: 124,\n EXIT_TIMEOUT_INTERNAL: 125,\n EXIT_CANNOT_EXECUTE: 126,\n EXIT_NOT_FOUND: 127,\n\n // Signal-Induced Exits (128-165)\n // 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.\n EXIT_SIGNAL_HUP: 129,\n EXIT_SIGNAL_INT: 130,\n EXIT_SIGNAL_QUIT: 131,\n EXIT_SIGNAL_KILL: 137,\n EXIT_SIGNAL_PIPE: 141,\n EXIT_SIGNAL_ALRM: 142,\n EXIT_SIGNAL_TERM: 143,\n EXIT_SIGNAL_USR1: 138,\n EXIT_SIGNAL_USR2: 140,\n} as const;\n\n/**\n * Exit code value type - union of all valid exit code numbers\n */\nexport type ExitCode = (typeof exitCodes)[keyof typeof exitCodes];\n\n/**\n * Exit code name type - union of all valid exit code constant names\n */\nexport type ExitCodeName = keyof typeof exitCodes;\n\n/**\n * Exit code metadata information\n */\nexport interface ExitCodeInfo {\n code: number;\n name: string;\n description: string;\n context: string;\n category: string;\n retryHint?: \"retry\" | \"no_retry\" | \"investigate\";\n bsdEquivalent?: string;\n pythonNote?: string;\n}\n\n/**\n * Metadata for all exit codes\n */\nexport const exitCodeMetadata: Record<number, ExitCodeInfo> = {\n 0: {\n code: 0,\n name: \"EXIT_SUCCESS\",\n description: \"Successful execution\",\n context: \"Command completed without errors\",\n category: \"standard\",\n },\n 1: {\n code: 1,\n name: \"EXIT_FAILURE\",\n description: \"Generic failure (unspecified error)\",\n context: \"Use when no more specific exit code applies\",\n category: \"standard\",\n },\n 10: {\n code: 10,\n name: \"EXIT_PORT_IN_USE\",\n description: \"Specified port is already in use\",\n context: \"Server startup when port unavailable and fail_if_unavailable strategy\",\n category: \"networking\",\n },\n 11: {\n code: 11,\n name: \"EXIT_PORT_RANGE_EXHAUSTED\",\n description: \"No available ports in configured range\",\n context: \"Server startup when all ports in environment range occupied\",\n category: \"networking\",\n },\n 12: {\n code: 12,\n name: \"EXIT_INSTANCE_ALREADY_RUNNING\",\n description: \"Another instance already running on target port\",\n context: \"Server startup when PID registry shows active process on port\",\n category: \"networking\",\n },\n 13: {\n code: 13,\n name: \"EXIT_NETWORK_UNREACHABLE\",\n description: \"Network destination unreachable\",\n context: \"Client connections, health checks, external service validation\",\n category: \"networking\",\n },\n 14: {\n code: 14,\n name: \"EXIT_CONNECTION_REFUSED\",\n description: \"Connection refused by remote host\",\n context: \"Database connections, API endpoints, upstream services\",\n category: \"networking\",\n },\n 15: {\n code: 15,\n name: \"EXIT_CONNECTION_TIMEOUT\",\n description: \"Connection attempt timed out\",\n context: \"Slow networks, unresponsive services, firewall blocks\",\n category: \"networking\",\n },\n 20: {\n code: 20,\n name: \"EXIT_CONFIG_INVALID\",\n description: \"Configuration file failed validation\",\n context: \"Startup validation, schema mismatches, invalid YAML/JSON\",\n category: \"configuration\",\n retryHint: \"no_retry\",\n },\n 21: {\n code: 21,\n name: \"EXIT_MISSING_DEPENDENCY\",\n description: \"Required dependency not found\",\n context: \"Missing binaries, libraries, or runtime requirements\",\n category: \"configuration\",\n retryHint: \"investigate\",\n },\n 22: {\n code: 22,\n name: \"EXIT_SSOT_VERSION_MISMATCH\",\n description: \"SSOT (Crucible) version incompatible\",\n context: \"Helper library detects unsupported Crucible version\",\n category: \"configuration\",\n retryHint: \"no_retry\",\n },\n 23: {\n code: 23,\n name: \"EXIT_CONFIG_FILE_NOT_FOUND\",\n description: \"Required configuration file not found\",\n context: \"Explicitly specified config path doesn't exist\",\n category: \"configuration\",\n },\n 24: {\n code: 24,\n name: \"EXIT_ENVIRONMENT_INVALID\",\n description: \"Invalid or unsupported environment specification\",\n context: \"Unknown environment name, missing environment config\",\n category: \"configuration\",\n },\n 30: {\n code: 30,\n name: \"EXIT_HEALTH_CHECK_FAILED\",\n description: \"Health check endpoint returned non-healthy status\",\n context: \"Startup health validation, readiness probes\",\n category: \"runtime\",\n retryHint: \"retry\",\n },\n 31: {\n code: 31,\n name: \"EXIT_DATABASE_UNAVAILABLE\",\n description: \"Database connection failed or unavailable\",\n context: \"Startup connection checks, critical query failures\",\n category: \"runtime\",\n retryHint: \"retry\",\n },\n 32: {\n code: 32,\n name: \"EXIT_EXTERNAL_SERVICE_UNAVAILABLE\",\n description: \"Required external service unavailable\",\n context: \"API dependencies, message queues, cache servers\",\n category: \"runtime\",\n },\n 33: {\n code: 33,\n name: \"EXIT_RESOURCE_EXHAUSTED\",\n description: \"System resources exhausted (memory, disk, file descriptors)\",\n context: \"Out-of-memory, disk full, too many open files\",\n category: \"runtime\",\n retryHint: \"investigate\",\n },\n 34: {\n code: 34,\n name: \"EXIT_OPERATION_TIMEOUT\",\n description: \"Operation exceeded timeout threshold\",\n context: \"Long-running tasks, async operations, batch processing\",\n category: \"runtime\",\n retryHint: \"retry\",\n },\n 40: {\n code: 40,\n name: \"EXIT_INVALID_ARGUMENT\",\n description: \"Invalid command-line argument or flag value\",\n context: \"Type errors, out-of-range values, malformed input\",\n category: \"usage\",\n },\n 41: {\n code: 41,\n name: \"EXIT_MISSING_REQUIRED_ARGUMENT\",\n description: \"Required command-line argument not provided\",\n context: \"Missing --config, --port, or other required flags\",\n category: \"usage\",\n },\n 64: {\n code: 64,\n name: \"EXIT_USAGE\",\n description: \"Command-line usage error\",\n context: \"BSD sysexits.h EX_USAGE - wrong number of arguments, bad syntax\",\n category: \"usage\",\n bsdEquivalent: \"EX_USAGE\",\n },\n 50: {\n code: 50,\n name: \"EXIT_PERMISSION_DENIED\",\n description: \"Insufficient permissions for operation\",\n context: \"File access, port binding (<1024), privileged operations\",\n category: \"permissions\",\n },\n 51: {\n code: 51,\n name: \"EXIT_FILE_NOT_FOUND\",\n description: \"Required file not found\",\n context: \"Assets, templates, data files (not config - use 23)\",\n category: \"permissions\",\n },\n 52: {\n code: 52,\n name: \"EXIT_DIRECTORY_NOT_FOUND\",\n description: \"Required directory not found\",\n context: \"State directories, log paths, data directories\",\n category: \"permissions\",\n },\n 53: {\n code: 53,\n name: \"EXIT_FILE_READ_ERROR\",\n description: \"Error reading file\",\n context: \"Corrupt files, I/O errors, encoding issues\",\n category: \"permissions\",\n },\n 54: {\n code: 54,\n name: \"EXIT_FILE_WRITE_ERROR\",\n description: \"Error writing file\",\n context: \"Disk full, read-only filesystem, permission errors\",\n category: \"permissions\",\n },\n 60: {\n code: 60,\n name: \"EXIT_DATA_INVALID\",\n description: \"Input data failed validation\",\n context: \"Schema validation, business rule violations\",\n category: \"data\",\n },\n 61: {\n code: 61,\n name: \"EXIT_PARSE_ERROR\",\n description: \"Error parsing input data\",\n context: \"Malformed JSON/YAML/XML, syntax errors\",\n category: \"data\",\n },\n 62: {\n code: 62,\n name: \"EXIT_TRANSFORMATION_FAILED\",\n description: \"Data transformation or conversion failed\",\n context: \"Type conversions, format transformations, encoding changes\",\n category: \"data\",\n },\n 63: {\n code: 63,\n name: \"EXIT_DATA_CORRUPT\",\n description: \"Data corruption detected\",\n context: \"Checksum failures, integrity violations\",\n category: \"data\",\n },\n 70: {\n code: 70,\n name: \"EXIT_AUTHENTICATION_FAILED\",\n description: \"Authentication failed\",\n context: \"Invalid credentials, expired tokens, auth service unavailable\",\n category: \"security\",\n },\n 71: {\n code: 71,\n name: \"EXIT_AUTHORIZATION_FAILED\",\n description: \"Authorization failed (authenticated but insufficient permissions)\",\n context: \"RBAC failures, scope violations, resource access denied\",\n category: \"security\",\n },\n 72: {\n code: 72,\n name: \"EXIT_SECURITY_VIOLATION\",\n description: \"Security policy violation detected\",\n context: \"Suspicious activity, rate limit exceeded, IP blocklist\",\n category: \"security\",\n },\n 73: {\n code: 73,\n name: \"EXIT_CERTIFICATE_INVALID\",\n description: \"TLS/SSL certificate validation failed\",\n context: \"Expired certs, untrusted CAs, hostname mismatches\",\n category: \"security\",\n bsdEquivalent: \"EX_PROTOCOL\",\n },\n 80: {\n code: 80,\n name: \"EXIT_METRICS_UNAVAILABLE\",\n description: \"Metrics endpoint or collection system unavailable\",\n context:\n \"Use for observability-focused tools (Prometheus exporters, StatsD agents).\\nWorkhorses SHOULD log warning and continue unless configured to fail-fast.\\n\",\n category: \"observability\",\n },\n 81: {\n code: 81,\n name: \"EXIT_TRACING_FAILED\",\n description: \"Distributed tracing system unavailable\",\n context: \"OTLP exporter failed, Jaeger collector unreachable\",\n category: \"observability\",\n },\n 82: {\n code: 82,\n name: \"EXIT_LOGGING_FAILED\",\n description: \"Logging system unavailable or misconfigured\",\n context: \"Log aggregator unreachable, log file unwritable\",\n category: \"observability\",\n },\n 83: {\n code: 83,\n name: \"EXIT_ALERT_SYSTEM_FAILED\",\n description: \"Alerting system unavailable\",\n context: \"PagerDuty API failed, Slack webhook unreachable\",\n category: \"observability\",\n },\n 84: {\n code: 84,\n name: \"EXIT_STRUCTURED_LOGGING_FAILED\",\n description: \"Structured logging system unavailable\",\n context: \"JSON log aggregator unreachable, log schema validation failed\",\n category: \"observability\",\n },\n 91: {\n code: 91,\n name: \"EXIT_TEST_FAILURE\",\n description: \"One or more tests failed\",\n context:\n \"Test assertions failed, expected behavior not met.\\nMaps to pytest exit code 1, Go test failure, Jest failure.\\n\",\n category: \"testing\",\n },\n 92: {\n code: 92,\n name: \"EXIT_TEST_ERROR\",\n description: \"Test execution error (not test failure)\",\n context:\n \"Test setup failed, fixture unavailable, test harness error.\\nMaps to pytest exit code 3 (internal error).\\n\",\n category: \"testing\",\n },\n 93: {\n code: 93,\n name: \"EXIT_TEST_INTERRUPTED\",\n description: \"Test run interrupted by user or system\",\n context:\n \"Ctrl+C during tests, system signal, user cancellation.\\nMaps to pytest exit code 2.\\n\",\n category: \"testing\",\n },\n 94: {\n code: 94,\n name: \"EXIT_TEST_USAGE_ERROR\",\n description: \"Test command usage error\",\n context: \"Invalid test arguments, bad configuration.\\nMaps to pytest exit code 4.\\n\",\n category: \"testing\",\n },\n 95: {\n code: 95,\n name: \"EXIT_TEST_NO_TESTS_COLLECTED\",\n description: \"No tests found or all tests skipped\",\n context: \"Empty test suite, all tests deselected or skipped.\\nMaps to pytest exit code 5.\\n\",\n category: \"testing\",\n },\n 96: {\n code: 96,\n name: \"EXIT_COVERAGE_THRESHOLD_NOT_MET\",\n description: \"Test coverage below required threshold\",\n context: \"Code coverage validation, quality gate failure\",\n category: \"testing\",\n },\n 124: {\n code: 124,\n name: \"EXIT_TIMEOUT\",\n description: \"Command timed out before completion\",\n context: \"GNU timeout or similar utility terminated command after deadline\",\n category: \"shell\",\n },\n 125: {\n code: 125,\n name: \"EXIT_TIMEOUT_INTERNAL\",\n description: \"Timeout utility itself failed\",\n context: \"Error in timeout tool before or during command execution (not command failure)\",\n category: \"shell\",\n },\n 126: {\n code: 126,\n name: \"EXIT_CANNOT_EXECUTE\",\n description: \"Command found but could not be executed\",\n context: \"Permission denied, not executable, exec format error\",\n category: \"shell\",\n bsdEquivalent: \"EX_NOPERM (partial)\",\n },\n 127: {\n code: 127,\n name: \"EXIT_NOT_FOUND\",\n description: \"Command not found\",\n context: \"Executable not found in PATH or specified path does not exist\",\n category: \"shell\",\n bsdEquivalent: \"EX_UNAVAILABLE (partial)\",\n },\n 129: {\n code: 129,\n name: \"EXIT_SIGNAL_HUP\",\n description: \"Hangup signal (SIGHUP) - config reload via restart\",\n context:\n \"Config reload via restart-based pattern (mandatory schema validation).\\nProcess exits with 129, supervisor restarts with new config.\\nSee signals.yaml for reload behavior definition.\",\n category: \"signals\",\n bsdEquivalent: \"128 + 1\",\n },\n 130: {\n code: 130,\n name: \"EXIT_SIGNAL_INT\",\n description: \"Interrupt signal (SIGINT) - user interrupt with Ctrl+C double-tap\",\n context:\n \"Ctrl+C pressed. First tap initiates graceful shutdown, second within 2s forces immediate exit.\\nSame exit code (130) for both graceful and force modes.\\nSee signals.yaml for double-tap behavior definition.\",\n category: \"signals\",\n bsdEquivalent: \"128 + 2\",\n },\n 131: {\n code: 131,\n name: \"EXIT_SIGNAL_QUIT\",\n description: \"Quit signal (SIGQUIT) - immediate exit\",\n context:\n \"Ctrl+\\\\ on Unix, Ctrl+Break on Windows. Immediate termination without cleanup.\\nUse for emergency shutdown or debugging (core dumps).\",\n category: \"signals\",\n bsdEquivalent: \"128 + 3\",\n },\n 137: {\n code: 137,\n name: \"EXIT_SIGNAL_KILL\",\n description: \"Kill signal (SIGKILL)\",\n context: \"Forceful termination, non-graceful shutdown (not catchable)\",\n category: \"signals\",\n bsdEquivalent: \"128 + 9\",\n pythonNote: \"Cannot be caught in Python (OS-level)\",\n },\n 141: {\n code: 141,\n name: \"EXIT_SIGNAL_PIPE\",\n description: \"Broken pipe (SIGPIPE) - observe only\",\n context:\n \"Writing to closed pipe/socket. Fulmen default is observe_only (log + graceful exit).\\nApplications may override to ignore for network services.\\nSee signals.yaml for SIGPIPE handling guidance.\",\n category: \"signals\",\n bsdEquivalent: \"128 + 13\",\n pythonNote: \"Raised as BrokenPipeError exception\",\n },\n 142: {\n code: 142,\n name: \"EXIT_SIGNAL_ALRM\",\n description: \"Alarm signal (SIGALRM) - watchdog timeout\",\n context:\n \"Watchdog timer expired. Treat as timeout-induced exit.\\nWatchdog pattern out of scope for v1.0.0 module implementations.\",\n category: \"signals\",\n bsdEquivalent: \"128 + 14\",\n pythonNote: \"Supported by signal module, rarely used in practice\",\n },\n 143: {\n code: 143,\n name: \"EXIT_SIGNAL_TERM\",\n description: \"Termination signal (SIGTERM) - graceful shutdown\",\n context:\n \"Graceful shutdown requested by container orchestrator or process supervisor.\\nStandard 30-second timeout for cleanup. Applications run cleanup handlers before exit.\\nSee signals.yaml for graceful shutdown behavior definition.\",\n category: \"signals\",\n bsdEquivalent: \"128 + 15\",\n pythonNote: \"Default signal for graceful shutdown\",\n },\n 138: {\n code: 138,\n name: \"EXIT_SIGNAL_USR1\",\n description: \"User-defined signal 1 (SIGUSR1) - custom handler\",\n context:\n \"Application-specific signal (e.g., reopen logs, dump stats, trigger profiling).\\nApplications register custom handlers. Exit code 138 on Linux (128+10).\\nPlatform differences: macOS/FreeBSD use signal 30 (exit 158), not 10.\",\n category: \"signals\",\n },\n 140: {\n code: 140,\n name: \"EXIT_SIGNAL_USR2\",\n description: \"User-defined signal 2 (SIGUSR2) - custom handler\",\n context:\n \"Application-specific signal (e.g., toggle debug mode, rotate credentials).\\nApplications register custom handlers. Exit code 140 on Linux (128+12).\\nPlatform differences: macOS/FreeBSD use signal 31 (exit 159), not 12.\",\n category: \"signals\",\n },\n};\n\n/**\n * Get metadata for a specific exit code\n *\n * @param code - Exit code number\n * @returns Exit code metadata or undefined if not found\n */\nexport function getExitCodeInfo(code: number): ExitCodeInfo | undefined {\n return exitCodeMetadata[code];\n}\n\n/**\n * Catalog version for telemetry and compatibility checks\n */\nexport const EXIT_CODES_VERSION = \"v1.0.0\";\n","/**\n * Exit Code Capabilities Detection\n *\n * Detects platform capabilities for exit code support, particularly\n * for signal-based exit codes which are POSIX-specific.\n *\n * @module foundry/exit-codes/capabilities\n */\n\n/**\n * Check if the current platform supports signal-based exit codes\n *\n * Signal exit codes (128+N pattern) are POSIX-specific and not\n * meaningful on Windows. Applications should use this to decide\n * whether to use simplified mode.\n *\n * @returns true if platform supports signal exit codes (POSIX), false otherwise (Windows)\n *\n * @example\n * ```ts\n * import { supportsSignalExitCodes, SimplifiedMode } from '@fulmenhq/tsfulmen/foundry/exit-codes';\n *\n * const exitCodeMode = supportsSignalExitCodes()\n * ? 'full' // Use all 54 exit codes\n * : SimplifiedMode.SEVERITY; // Use simplified mode on Windows\n *\n * console.log(`Exit code mode: ${exitCodeMode}`);\n * ```\n *\n * @example\n * ```ts\n * // Guard signal exit code usage\n * import { exitCodes, supportsSignalExitCodes } from '@fulmenhq/tsfulmen/foundry/exit-codes';\n *\n * function handleTermination() {\n * if (supportsSignalExitCodes()) {\n * // POSIX: Use specific signal exit code\n * process.exit(exitCodes.EXIT_SIGNAL_TERM);\n * } else {\n * // Windows: Use generic failure\n * process.exit(exitCodes.EXIT_FAILURE);\n * }\n * }\n * ```\n */\nexport function supportsSignalExitCodes(): boolean {\n // Windows does not support POSIX signals in the same way\n // WSL reports as 'linux' so it will correctly return true\n return process.platform !== \"win32\";\n}\n\n/**\n * Get the current platform identifier\n *\n * Useful for logging and diagnostics.\n *\n * @returns Platform string (linux, darwin, win32, etc.)\n */\nexport function getPlatform(): NodeJS.Platform {\n return process.platform;\n}\n\n/**\n * Check if running on Windows (including WSL detection)\n *\n * Note: WSL reports as 'linux' not 'win32', so this only returns\n * true for native Windows processes.\n *\n * @returns true if running on native Windows\n */\nexport function isWindows(): boolean {\n return process.platform === \"win32\";\n}\n\n/**\n * Check if running on a POSIX-compliant platform\n *\n * @returns true if running on Linux, macOS, or other POSIX systems\n */\nexport function isPOSIX(): boolean {\n return !isWindows();\n}\n\n/**\n * Platform capabilities summary\n */\nexport interface PlatformCapabilities {\n platform: NodeJS.Platform;\n supportsSignalExitCodes: boolean;\n isPOSIX: boolean;\n isWindows: boolean;\n}\n\n/**\n * Get a summary of platform capabilities\n *\n * @returns Platform capabilities object\n *\n * @example\n * ```ts\n * import { getPlatformCapabilities } from '@fulmenhq/tsfulmen/foundry/exit-codes';\n *\n * const caps = getPlatformCapabilities();\n * console.log(`Platform: ${caps.platform}`);\n * console.log(`Supports signal exit codes: ${caps.supportsSignalExitCodes}`);\n * ```\n */\nexport function getPlatformCapabilities(): PlatformCapabilities {\n return {\n platform: getPlatform(),\n supportsSignalExitCodes: supportsSignalExitCodes(),\n isPOSIX: isPOSIX(),\n isWindows: isWindows(),\n };\n}\n","/**\n * Simplified Exit Code Mapping\n *\n * Provides simplified exit code modes for applications that don't need\n * the full granularity of 54 exit codes. Useful for:\n * - Windows environments where signal codes may not be relevant\n * - Simple scripts that only need basic success/failure indication\n * - Wrapper scripts that aggregate multiple failure types\n *\n * @module foundry/exit-codes/simplified\n */\n\nimport type { ExitCode } from \"../../crucible/foundry/exitCodes.js\";\nimport { exitCodeMetadata } from \"../../crucible/foundry/exitCodes.js\";\n\n/**\n * Simplified exit code modes\n */\nexport enum SimplifiedMode {\n /**\n * BASIC mode: Only success (0) and failure (1)\n * - 0 = EXIT_SUCCESS\n * - 1 = All failures\n */\n BASIC = \"basic\",\n\n /**\n * SEVERITY mode: Success, recoverable, config, fatal\n * - 0 = EXIT_SUCCESS\n * - 1 = Recoverable errors (retry possible)\n * - 2 = Configuration/usage errors (fix config, don't retry)\n * - 3 = Fatal errors (investigate required)\n */\n SEVERITY = \"severity\",\n}\n\n/**\n * Map a full exit code to a simplified code based on mode\n *\n * @param code - Full exit code from exitCodes\n * @param mode - Simplified mode to use\n * @returns Simplified exit code (0-3 depending on mode)\n *\n * @example\n * ```ts\n * import { exitCodes, mapExitCodeToSimplified, SimplifiedMode } from '@fulmenhq/tsfulmen/foundry/exit-codes';\n *\n * // Basic mode - only 0 or 1\n * const basicCode = mapExitCodeToSimplified(exitCodes.EXIT_CONFIG_INVALID, SimplifiedMode.BASIC);\n * console.log(basicCode); // 1 (any failure)\n *\n * // Severity mode - categorizes failures\n * const sevCode = mapExitCodeToSimplified(exitCodes.EXIT_CONFIG_INVALID, SimplifiedMode.SEVERITY);\n * console.log(sevCode); // 2 (config error - don't retry)\n *\n * const retryCode = mapExitCodeToSimplified(exitCodes.EXIT_DATABASE_UNAVAILABLE, SimplifiedMode.SEVERITY);\n * console.log(retryCode); // 1 (recoverable - retry possible)\n * ```\n */\nexport function mapExitCodeToSimplified(\n code: ExitCode,\n mode: SimplifiedMode = SimplifiedMode.BASIC,\n): number {\n // Success is always 0\n if (code === 0) {\n return 0;\n }\n\n // BASIC mode: everything else is 1\n if (mode === SimplifiedMode.BASIC) {\n return 1;\n }\n\n // SEVERITY mode: categorize based on metadata\n const info = exitCodeMetadata[code];\n if (!info) {\n // Unknown code - treat as fatal\n return 3;\n }\n\n // Check retry hint first\n if (info.retryHint === \"retry\") {\n // Recoverable - likely transient failure\n return 1;\n }\n\n if (info.retryHint === \"no_retry\") {\n // Configuration/permanent error - don't retry\n return 2;\n }\n\n if (info.retryHint === \"investigate\") {\n // Serious issue requiring investigation\n return 3;\n }\n\n // Category-based fallback\n switch (info.category) {\n case \"configuration\":\n case \"usage\":\n // Config and usage errors - fix config, don't retry\n return 2;\n\n case \"networking\":\n case \"runtime\":\n // Network and runtime issues - often recoverable\n return 1;\n\n case \"permissions\":\n case \"data\":\n // Permission and data errors - likely permanent\n return 2;\n\n case \"security\":\n // Security issues - investigate\n return 3;\n\n case \"observability\":\n // Observability failures - recoverable if non-critical\n return 1;\n\n case \"testing\":\n // Test failures - depends on context, default to failure\n return 1;\n\n case \"signals\":\n // Signal termination - not applicable on Windows\n // Treat as fatal since process was forcibly terminated\n return 3;\n\n default:\n // Unknown category - treat as generic failure\n return 1;\n }\n}\n\n/**\n * Get all simplified exit codes for a given mode\n *\n * @param mode - Simplified mode\n * @returns Array of simplified codes for this mode\n *\n * @example\n * ```ts\n * import { getSimplifiedCodes, SimplifiedMode } from '@fulmenhq/tsfulmen/foundry/exit-codes';\n *\n * console.log(getSimplifiedCodes(SimplifiedMode.BASIC));\n * // [0, 1]\n *\n * console.log(getSimplifiedCodes(SimplifiedMode.SEVERITY));\n * // [0, 1, 2, 3]\n * ```\n */\nexport function getSimplifiedCodes(mode: SimplifiedMode): number[] {\n switch (mode) {\n case SimplifiedMode.BASIC:\n return [0, 1];\n case SimplifiedMode.SEVERITY:\n return [0, 1, 2, 3];\n default:\n return [0, 1];\n }\n}\n\n/**\n * Get description for a simplified exit code\n *\n * @param code - Simplified exit code\n * @param mode - Simplified mode\n * @returns Human-readable description\n */\nexport function getSimplifiedCodeDescription(code: number, mode: SimplifiedMode): string {\n if (mode === SimplifiedMode.BASIC) {\n switch (code) {\n case 0:\n return \"Success\";\n case 1:\n return \"Failure\";\n default:\n return \"Unknown\";\n }\n }\n\n if (mode === SimplifiedMode.SEVERITY) {\n switch (code) {\n case 0:\n return \"Success\";\n case 1:\n return \"Recoverable error (retry possible)\";\n case 2:\n return \"Configuration error (fix config, don't retry)\";\n case 3:\n return \"Fatal error (investigate required)\";\n default:\n return \"Unknown\";\n }\n }\n\n return \"Unknown mode\";\n}\n"]}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
|
6
|
+
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
|
|
7
|
+
}) : x)(function(x) {
|
|
8
|
+
if (typeof require !== "undefined") return require.apply(this, arguments);
|
|
9
|
+
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
10
|
+
});
|
|
11
|
+
var __esm = (fn, res) => function __init() {
|
|
12
|
+
return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
|
|
13
|
+
};
|
|
14
|
+
var __commonJS = (cb, mod) => function __require2() {
|
|
15
|
+
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
16
|
+
};
|
|
17
|
+
var __export = (target, all) => {
|
|
18
|
+
for (var name in all)
|
|
19
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
20
|
+
};
|
|
21
|
+
var __copyProps = (to, from, except, desc) => {
|
|
22
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
23
|
+
for (let key of __getOwnPropNames(from))
|
|
24
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
25
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
26
|
+
}
|
|
27
|
+
return to;
|
|
28
|
+
};
|
|
29
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
30
|
+
|
|
31
|
+
export { __commonJS, __esm, __export, __require, __toCommonJS };
|
|
32
|
+
//# sourceMappingURL=chunk-UP2VWCW5.js.map
|
|
33
|
+
//# sourceMappingURL=chunk-UP2VWCW5.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"chunk-UP2VWCW5.js"}
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import { FulmenError } from './chunk-CW4CSNVF.js';
|
|
2
|
+
|
|
3
|
+
// src/appidentity/errors.ts
|
|
4
|
+
var AppIdentityError = class _AppIdentityError extends FulmenError {
|
|
5
|
+
identityPath;
|
|
6
|
+
constructor(message, identityPath, cause) {
|
|
7
|
+
let errorData;
|
|
8
|
+
if (cause) {
|
|
9
|
+
errorData = FulmenError.fromError(cause, {
|
|
10
|
+
code: "APP_IDENTITY_ERROR",
|
|
11
|
+
severity: "high",
|
|
12
|
+
context: { identityPath }
|
|
13
|
+
}).data;
|
|
14
|
+
} else {
|
|
15
|
+
errorData = {
|
|
16
|
+
code: "APP_IDENTITY_ERROR",
|
|
17
|
+
message,
|
|
18
|
+
severity: "high",
|
|
19
|
+
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
20
|
+
context: { identityPath }
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
super(errorData);
|
|
24
|
+
this.name = "AppIdentityError";
|
|
25
|
+
this.identityPath = identityPath;
|
|
26
|
+
if (Error.captureStackTrace) {
|
|
27
|
+
Error.captureStackTrace(this, _AppIdentityError);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Create error for identity not found
|
|
32
|
+
*/
|
|
33
|
+
static notFound(searchedPaths) {
|
|
34
|
+
const message = `App identity not found
|
|
35
|
+
Searched paths:
|
|
36
|
+
${searchedPaths.map((p) => ` - ${p}`).join("\n")}`;
|
|
37
|
+
return new _AppIdentityError(message);
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Create error for schema validation failure
|
|
41
|
+
*/
|
|
42
|
+
static validationFailed(path, diagnostics) {
|
|
43
|
+
const errorCount = diagnostics.filter((d) => d.severity === "ERROR").length;
|
|
44
|
+
const warningCount = diagnostics.filter((d) => d.severity === "WARN").length;
|
|
45
|
+
let message = `Invalid app identity: ${path}
|
|
46
|
+
`;
|
|
47
|
+
message += `Validation errors: ${errorCount} error(s), ${warningCount} warning(s)
|
|
48
|
+
`;
|
|
49
|
+
const displayDiagnostics = diagnostics.slice(0, 3);
|
|
50
|
+
for (const diag of displayDiagnostics) {
|
|
51
|
+
message += ` - ${diag.message}`;
|
|
52
|
+
if (diag.pointer) {
|
|
53
|
+
message += ` at ${diag.pointer}`;
|
|
54
|
+
}
|
|
55
|
+
message += "\n";
|
|
56
|
+
}
|
|
57
|
+
if (diagnostics.length > 3) {
|
|
58
|
+
message += ` ... and ${diagnostics.length - 3} more
|
|
59
|
+
`;
|
|
60
|
+
}
|
|
61
|
+
return new _AppIdentityError(message, path);
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Create error for environment variable override pointing to missing file
|
|
65
|
+
*/
|
|
66
|
+
static envOverrideMissing(envPath) {
|
|
67
|
+
const message = `FULMEN_APP_IDENTITY_PATH points to missing file: ${envPath}
|
|
68
|
+
`;
|
|
69
|
+
return new _AppIdentityError(message, envPath);
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Create error for YAML parsing failure
|
|
73
|
+
*/
|
|
74
|
+
static parseFailed(path, cause) {
|
|
75
|
+
const message = `Failed to parse identity file: ${path}
|
|
76
|
+
${cause.message}`;
|
|
77
|
+
return new _AppIdentityError(message, path, cause);
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Create error for file read failure
|
|
81
|
+
*/
|
|
82
|
+
static readFailed(path, cause) {
|
|
83
|
+
const message = `Failed to read identity file: ${path}
|
|
84
|
+
${cause.message}`;
|
|
85
|
+
return new _AppIdentityError(message, path, cause);
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Create error for embedded identity already registered
|
|
89
|
+
*
|
|
90
|
+
* Uses first-wins semantics - once registered, cannot be replaced
|
|
91
|
+
*/
|
|
92
|
+
static alreadyRegistered() {
|
|
93
|
+
const message = "Embedded identity already registered. Registration uses first-wins semantics and cannot be replaced.";
|
|
94
|
+
return new _AppIdentityError(message);
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Create error for embedded identity YAML parsing failure
|
|
98
|
+
*/
|
|
99
|
+
static embeddedParseFailed(cause) {
|
|
100
|
+
const message = `Failed to parse embedded identity YAML: ${cause.message}`;
|
|
101
|
+
return new _AppIdentityError(message, void 0, cause);
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Create error for embedded identity schema validation failure
|
|
105
|
+
*/
|
|
106
|
+
static embeddedValidationFailed(diagnostics) {
|
|
107
|
+
const errorCount = diagnostics.filter((d) => d.severity === "ERROR").length;
|
|
108
|
+
const warningCount = diagnostics.filter((d) => d.severity === "WARN").length;
|
|
109
|
+
let message = "Invalid embedded identity\n";
|
|
110
|
+
message += `Validation errors: ${errorCount} error(s), ${warningCount} warning(s)
|
|
111
|
+
`;
|
|
112
|
+
const displayDiagnostics = diagnostics.slice(0, 3);
|
|
113
|
+
for (const diag of displayDiagnostics) {
|
|
114
|
+
message += ` - ${diag.message}`;
|
|
115
|
+
if (diag.pointer) {
|
|
116
|
+
message += ` at ${diag.pointer}`;
|
|
117
|
+
}
|
|
118
|
+
message += "\n";
|
|
119
|
+
}
|
|
120
|
+
if (diagnostics.length > 3) {
|
|
121
|
+
message += ` ... and ${diagnostics.length - 3} more
|
|
122
|
+
`;
|
|
123
|
+
}
|
|
124
|
+
return new _AppIdentityError(message);
|
|
125
|
+
}
|
|
126
|
+
};
|
|
127
|
+
|
|
128
|
+
export { AppIdentityError };
|
|
129
|
+
//# sourceMappingURL=chunk-W6TQFTTY.js.map
|
|
130
|
+
//# sourceMappingURL=chunk-W6TQFTTY.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/appidentity/errors.ts"],"names":[],"mappings":";;;AAYO,IAAM,gBAAA,GAAN,MAAM,iBAAA,SAAyB,WAAA,CAA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kBAAA,EAAoB;AACrC,MAAA,OAAA,IAAW,CAAA,IAAA,EAAO,KAAK,OAAO,CAAA,CAAA;AAC9B,MAAA,IAAI,KAAK,OAAA,EAAS;AAChB,QAAA,OAAA,IAAW,CAAA,IAAA,EAAO,KAAK,OAAO,CAAA,CAAA;AAAA,MAChC;AACA,MAAA,OAAA,IAAW,IAAA;AAAA,IACb;AAEA,IAAA,IAAI,WAAA,CAAY,SAAS,CAAA,EAAG;AAC1B,MAAA,OAAA,IAAW,CAAA,UAAA,EAAa,WAAA,CAAY,MAAA,GAAS,CAAC,CAAA;AAAA,CAAA;AAAA,IAChD;AAEA,IAAA,OAAO,IAAI,kBAAiB,OAAO,CAAA;AAAA,EACrC;AACF","file":"chunk-W6TQFTTY.js","sourcesContent":["/**\n * Application Identity Errors\n *\n * Module-specific error classes for identity operations\n */\n\nimport { FulmenError, type FulmenErrorData } from \"../errors/index.js\";\nimport type { SchemaValidationDiagnostic } from \"../schema/types.js\";\n\n/**\n * Base error class for app identity operations\n */\nexport class AppIdentityError extends FulmenError {\n public readonly identityPath?: string;\n\n constructor(message: string, identityPath?: string, cause?: Error) {\n // Build FulmenErrorData\n let errorData: FulmenErrorData;\n\n if (cause) {\n errorData = FulmenError.fromError(cause, {\n code: \"APP_IDENTITY_ERROR\",\n severity: \"high\",\n context: { identityPath },\n }).data;\n } else {\n errorData = {\n code: \"APP_IDENTITY_ERROR\",\n message,\n severity: \"high\",\n timestamp: new Date().toISOString(),\n context: { identityPath },\n };\n }\n\n super(errorData);\n this.name = \"AppIdentityError\";\n this.identityPath = identityPath;\n\n // Maintains proper stack trace for where our error was thrown (only available on V8)\n if (Error.captureStackTrace) {\n Error.captureStackTrace(this, AppIdentityError);\n }\n }\n\n /**\n * Create error for identity not found\n */\n static notFound(searchedPaths: string[]): AppIdentityError {\n const message = `App identity not found\\nSearched paths:\\n${searchedPaths.map((p) => ` - ${p}`).join(\"\\n\")}`;\n return new AppIdentityError(message);\n }\n\n /**\n * Create error for schema validation failure\n */\n static validationFailed(\n path: string,\n diagnostics: SchemaValidationDiagnostic[],\n ): AppIdentityError {\n const errorCount = diagnostics.filter((d) => d.severity === \"ERROR\").length;\n const warningCount = diagnostics.filter((d) => d.severity === \"WARN\").length;\n\n let message = `Invalid app identity: ${path}\\n`;\n message += `Validation errors: ${errorCount} error(s), ${warningCount} warning(s)\\n`;\n\n // Include first few diagnostics\n const displayDiagnostics = diagnostics.slice(0, 3);\n for (const diag of displayDiagnostics) {\n message += ` - ${diag.message}`;\n if (diag.pointer) {\n message += ` at ${diag.pointer}`;\n }\n message += \"\\n\";\n }\n\n if (diagnostics.length > 3) {\n message += ` ... and ${diagnostics.length - 3} more\\n`;\n }\n\n return new AppIdentityError(message, path);\n }\n\n /**\n * Create error for environment variable override pointing to missing file\n */\n static envOverrideMissing(envPath: string): AppIdentityError {\n const message = `FULMEN_APP_IDENTITY_PATH points to missing file: ${envPath}\\n`;\n return new AppIdentityError(message, envPath);\n }\n\n /**\n * Create error for YAML parsing failure\n */\n static parseFailed(path: string, cause: Error): AppIdentityError {\n const message = `Failed to parse identity file: ${path}\\n${cause.message}`;\n return new AppIdentityError(message, path, cause);\n }\n\n /**\n * Create error for file read failure\n */\n static readFailed(path: string, cause: Error): AppIdentityError {\n const message = `Failed to read identity file: ${path}\\n${cause.message}`;\n return new AppIdentityError(message, path, cause);\n }\n\n /**\n * Create error for embedded identity already registered\n *\n * Uses first-wins semantics - once registered, cannot be replaced\n */\n static alreadyRegistered(): AppIdentityError {\n const message =\n \"Embedded identity already registered. \" +\n \"Registration uses first-wins semantics and cannot be replaced.\";\n return new AppIdentityError(message);\n }\n\n /**\n * Create error for embedded identity YAML parsing failure\n */\n static embeddedParseFailed(cause: Error): AppIdentityError {\n const message = `Failed to parse embedded identity YAML: ${cause.message}`;\n return new AppIdentityError(message, undefined, cause);\n }\n\n /**\n * Create error for embedded identity schema validation failure\n */\n static embeddedValidationFailed(diagnostics: SchemaValidationDiagnostic[]): AppIdentityError {\n const errorCount = diagnostics.filter((d) => d.severity === \"ERROR\").length;\n const warningCount = diagnostics.filter((d) => d.severity === \"WARN\").length;\n\n let message = \"Invalid embedded identity\\n\";\n message += `Validation errors: ${errorCount} error(s), ${warningCount} warning(s)\\n`;\n\n const displayDiagnostics = diagnostics.slice(0, 3);\n for (const diag of displayDiagnostics) {\n message += ` - ${diag.message}`;\n if (diag.pointer) {\n message += ` at ${diag.pointer}`;\n }\n message += \"\\n\";\n }\n\n if (diagnostics.length > 3) {\n message += ` ... and ${diagnostics.length - 3} more\\n`;\n }\n\n return new AppIdentityError(message);\n }\n}\n"]}
|
|
@@ -0,0 +1,269 @@
|
|
|
1
|
+
import { UnsupportedAlgorithmError, Algorithm, Digest, createHasher2, createHasher, FulHashError, DigestStateError } from './chunk-OHE2AOH4.js';
|
|
2
|
+
import { createHash } from 'crypto';
|
|
3
|
+
import { createXXHash128 } from 'hash-wasm';
|
|
4
|
+
|
|
5
|
+
var isWasmReady = false;
|
|
6
|
+
var initPromise = null;
|
|
7
|
+
async function initializeWasm() {
|
|
8
|
+
if (isWasmReady) {
|
|
9
|
+
return;
|
|
10
|
+
}
|
|
11
|
+
if (initPromise) {
|
|
12
|
+
return initPromise;
|
|
13
|
+
}
|
|
14
|
+
initPromise = createXXHash128().then(() => {
|
|
15
|
+
isWasmReady = true;
|
|
16
|
+
}).catch((error) => {
|
|
17
|
+
initPromise = null;
|
|
18
|
+
throw new FulHashError(`Failed to initialize hash-wasm XXH3-128 module: ${error.message}`);
|
|
19
|
+
});
|
|
20
|
+
return initPromise;
|
|
21
|
+
}
|
|
22
|
+
async function createHasher3() {
|
|
23
|
+
if (!isWasmReady) {
|
|
24
|
+
throw new FulHashError("WASM not initialized. Call initializeWasm() first.");
|
|
25
|
+
}
|
|
26
|
+
return createXXHash128();
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
// src/fulhash/stream.ts
|
|
30
|
+
function intToBytes(crc) {
|
|
31
|
+
const bytes = new Uint8Array(4);
|
|
32
|
+
const unsigned = crc >>> 0;
|
|
33
|
+
bytes[0] = unsigned >>> 24 & 255;
|
|
34
|
+
bytes[1] = unsigned >>> 16 & 255;
|
|
35
|
+
bytes[2] = unsigned >>> 8 & 255;
|
|
36
|
+
bytes[3] = unsigned & 255;
|
|
37
|
+
return bytes;
|
|
38
|
+
}
|
|
39
|
+
var BaseStreamHasher = class {
|
|
40
|
+
state = "initial" /* INITIAL */;
|
|
41
|
+
algorithm;
|
|
42
|
+
constructor(algorithm) {
|
|
43
|
+
this.algorithm = algorithm;
|
|
44
|
+
}
|
|
45
|
+
ensureNotFinalized() {
|
|
46
|
+
if (this.state === "finalized" /* FINALIZED */) {
|
|
47
|
+
throw new DigestStateError("Cannot update after digest(). Call reset() to reuse hasher.");
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
ensureUpdating() {
|
|
51
|
+
if (this.state !== "updating" /* UPDATING */ && this.state !== "initial" /* INITIAL */) {
|
|
52
|
+
throw new DigestStateError("Invalid state for digest(). Hasher may have been finalized.");
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
markUpdating() {
|
|
56
|
+
this.state = "updating" /* UPDATING */;
|
|
57
|
+
}
|
|
58
|
+
markFinalized() {
|
|
59
|
+
this.state = "finalized" /* FINALIZED */;
|
|
60
|
+
}
|
|
61
|
+
markInitial() {
|
|
62
|
+
this.state = "initial" /* INITIAL */;
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
var SHA256StreamHasher = class extends BaseStreamHasher {
|
|
66
|
+
hasher;
|
|
67
|
+
constructor() {
|
|
68
|
+
super("sha256" /* SHA256 */);
|
|
69
|
+
this.hasher = createHash("sha256");
|
|
70
|
+
}
|
|
71
|
+
update(data) {
|
|
72
|
+
this.ensureNotFinalized();
|
|
73
|
+
this.markUpdating();
|
|
74
|
+
if (typeof data === "string") {
|
|
75
|
+
this.hasher.update(data, "utf8");
|
|
76
|
+
} else {
|
|
77
|
+
this.hasher.update(data);
|
|
78
|
+
}
|
|
79
|
+
return this;
|
|
80
|
+
}
|
|
81
|
+
digest() {
|
|
82
|
+
this.ensureUpdating();
|
|
83
|
+
this.markFinalized();
|
|
84
|
+
const bytes = new Uint8Array(this.hasher.digest());
|
|
85
|
+
return new Digest(this.algorithm, bytes);
|
|
86
|
+
}
|
|
87
|
+
reset() {
|
|
88
|
+
this.hasher = createHash("sha256");
|
|
89
|
+
this.markInitial();
|
|
90
|
+
return this;
|
|
91
|
+
}
|
|
92
|
+
};
|
|
93
|
+
var XXH3StreamHasher = class extends BaseStreamHasher {
|
|
94
|
+
hasher;
|
|
95
|
+
constructor(hasher) {
|
|
96
|
+
super("xxh3-128" /* XXH3_128 */);
|
|
97
|
+
this.hasher = hasher;
|
|
98
|
+
this.hasher.init();
|
|
99
|
+
}
|
|
100
|
+
update(data) {
|
|
101
|
+
this.ensureNotFinalized();
|
|
102
|
+
this.markUpdating();
|
|
103
|
+
if (typeof data === "string") {
|
|
104
|
+
const encoder = new TextEncoder();
|
|
105
|
+
this.hasher.update(encoder.encode(data));
|
|
106
|
+
} else {
|
|
107
|
+
this.hasher.update(data);
|
|
108
|
+
}
|
|
109
|
+
return this;
|
|
110
|
+
}
|
|
111
|
+
digest() {
|
|
112
|
+
this.ensureUpdating();
|
|
113
|
+
this.markFinalized();
|
|
114
|
+
const bytes = this.hasher.digest("binary");
|
|
115
|
+
return new Digest(this.algorithm, bytes);
|
|
116
|
+
}
|
|
117
|
+
reset() {
|
|
118
|
+
this.hasher.init();
|
|
119
|
+
this.markInitial();
|
|
120
|
+
return this;
|
|
121
|
+
}
|
|
122
|
+
};
|
|
123
|
+
var CRC32StreamHasher = class extends BaseStreamHasher {
|
|
124
|
+
hasher = null;
|
|
125
|
+
constructor() {
|
|
126
|
+
super("crc32" /* CRC32 */);
|
|
127
|
+
}
|
|
128
|
+
async init() {
|
|
129
|
+
this.hasher = await createHasher();
|
|
130
|
+
this.hasher.init();
|
|
131
|
+
}
|
|
132
|
+
update(data) {
|
|
133
|
+
this.ensureNotFinalized();
|
|
134
|
+
this.markUpdating();
|
|
135
|
+
if (!this.hasher) {
|
|
136
|
+
throw new Error("Hasher not initialized");
|
|
137
|
+
}
|
|
138
|
+
if (typeof data === "string") {
|
|
139
|
+
const encoder = new TextEncoder();
|
|
140
|
+
this.hasher.update(encoder.encode(data));
|
|
141
|
+
} else {
|
|
142
|
+
this.hasher.update(data);
|
|
143
|
+
}
|
|
144
|
+
return this;
|
|
145
|
+
}
|
|
146
|
+
digest() {
|
|
147
|
+
this.ensureUpdating();
|
|
148
|
+
this.markFinalized();
|
|
149
|
+
if (!this.hasher) throw new Error("Hasher not initialized");
|
|
150
|
+
const hex = this.hasher.digest();
|
|
151
|
+
const bytes = intToBytes(parseInt(hex, 16));
|
|
152
|
+
return new Digest(this.algorithm, bytes);
|
|
153
|
+
}
|
|
154
|
+
reset() {
|
|
155
|
+
if (!this.hasher) throw new Error("Hasher not initialized");
|
|
156
|
+
this.hasher.init();
|
|
157
|
+
this.markInitial();
|
|
158
|
+
return this;
|
|
159
|
+
}
|
|
160
|
+
};
|
|
161
|
+
var CRC32CStreamHasher = class extends BaseStreamHasher {
|
|
162
|
+
hasher = null;
|
|
163
|
+
constructor() {
|
|
164
|
+
super("crc32c" /* CRC32C */);
|
|
165
|
+
}
|
|
166
|
+
async init() {
|
|
167
|
+
this.hasher = await createHasher2();
|
|
168
|
+
this.hasher.init();
|
|
169
|
+
}
|
|
170
|
+
update(data) {
|
|
171
|
+
this.ensureNotFinalized();
|
|
172
|
+
this.markUpdating();
|
|
173
|
+
if (!this.hasher) throw new Error("Hasher not initialized");
|
|
174
|
+
if (typeof data === "string") {
|
|
175
|
+
const encoder = new TextEncoder();
|
|
176
|
+
this.hasher.update(encoder.encode(data));
|
|
177
|
+
} else {
|
|
178
|
+
this.hasher.update(data);
|
|
179
|
+
}
|
|
180
|
+
return this;
|
|
181
|
+
}
|
|
182
|
+
digest() {
|
|
183
|
+
this.ensureUpdating();
|
|
184
|
+
this.markFinalized();
|
|
185
|
+
if (!this.hasher) throw new Error("Hasher not initialized");
|
|
186
|
+
const hex = this.hasher.digest();
|
|
187
|
+
const bytes = intToBytes(parseInt(hex, 16));
|
|
188
|
+
return new Digest(this.algorithm, bytes);
|
|
189
|
+
}
|
|
190
|
+
reset() {
|
|
191
|
+
if (!this.hasher) throw new Error("Hasher not initialized");
|
|
192
|
+
this.hasher.init();
|
|
193
|
+
this.markInitial();
|
|
194
|
+
return this;
|
|
195
|
+
}
|
|
196
|
+
};
|
|
197
|
+
async function createStreamHasher(options = {}) {
|
|
198
|
+
const algorithm = options.algorithm ?? "xxh3-128" /* XXH3_128 */;
|
|
199
|
+
switch (algorithm) {
|
|
200
|
+
case "sha256" /* SHA256 */:
|
|
201
|
+
return new SHA256StreamHasher();
|
|
202
|
+
case "xxh3-128" /* XXH3_128 */: {
|
|
203
|
+
await initializeWasm();
|
|
204
|
+
const wasmHasher = await createHasher3();
|
|
205
|
+
return new XXH3StreamHasher(wasmHasher);
|
|
206
|
+
}
|
|
207
|
+
case "crc32" /* CRC32 */: {
|
|
208
|
+
const hasher = new CRC32StreamHasher();
|
|
209
|
+
await hasher.init();
|
|
210
|
+
return hasher;
|
|
211
|
+
}
|
|
212
|
+
case "crc32c" /* CRC32C */: {
|
|
213
|
+
const hasher = new CRC32CStreamHasher();
|
|
214
|
+
await hasher.init();
|
|
215
|
+
return hasher;
|
|
216
|
+
}
|
|
217
|
+
default:
|
|
218
|
+
throw new UnsupportedAlgorithmError(algorithm, Object.values(Algorithm));
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
// src/fulhash/convenience.ts
|
|
223
|
+
async function multiHash(input, algorithms, encoding = "utf8") {
|
|
224
|
+
const uniqueAlgorithms = [...new Set(algorithms)];
|
|
225
|
+
const hashers = await Promise.all(
|
|
226
|
+
uniqueAlgorithms.map((algo) => createStreamHasher({ algorithm: algo }))
|
|
227
|
+
);
|
|
228
|
+
if (typeof input === "string") {
|
|
229
|
+
if (encoding !== "utf8") {
|
|
230
|
+
const buf = Buffer.from(input, encoding);
|
|
231
|
+
for (const hasher of hashers) {
|
|
232
|
+
hasher.update(buf);
|
|
233
|
+
}
|
|
234
|
+
} else {
|
|
235
|
+
for (const hasher of hashers) {
|
|
236
|
+
hasher.update(input);
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
} else if (input instanceof Uint8Array) {
|
|
240
|
+
for (const hasher of hashers) {
|
|
241
|
+
hasher.update(input);
|
|
242
|
+
}
|
|
243
|
+
} else {
|
|
244
|
+
for await (const chunk of input) {
|
|
245
|
+
for (const hasher of hashers) {
|
|
246
|
+
hasher.update(chunk);
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
const result = {};
|
|
251
|
+
for (let i = 0; i < uniqueAlgorithms.length; i++) {
|
|
252
|
+
result[uniqueAlgorithms[i]] = hashers[i].digest();
|
|
253
|
+
}
|
|
254
|
+
return result;
|
|
255
|
+
}
|
|
256
|
+
async function verify(input, checksum, encoding = "utf8") {
|
|
257
|
+
const expected = Digest.parse(checksum);
|
|
258
|
+
const result = await multiHash(input, [expected.algorithm], encoding);
|
|
259
|
+
const actual = result[expected.algorithm];
|
|
260
|
+
if (!actual) return false;
|
|
261
|
+
return actual.algorithm === expected.algorithm && actual.hex === expected.hex;
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
// src/fulhash/index.ts
|
|
265
|
+
var VERSION = "1.0.0";
|
|
266
|
+
|
|
267
|
+
export { VERSION, createStreamHasher, multiHash, verify };
|
|
268
|
+
//# sourceMappingURL=chunk-WSMVLWLB.js.map
|
|
269
|
+
//# sourceMappingURL=chunk-WSMVLWLB.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/fulhash/wasm-loader.ts","../src/fulhash/stream.ts","../src/fulhash/convenience.ts","../src/fulhash/index.ts"],"names":["createHasher"],"mappings":";;;;AAIA,IAAI,WAAA,GAAc,KAAA;AAClB,IAAI,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KAAA,IAAS,CAAA,GAAI,CAAA,EAAG,CAAA,GAAI,gBAAA,CAAiB,QAAQ,CAAA,EAAA,EAAK;AAChD,IAAA,MAAA,CAAO,iBAAiB,CAAC,CAAC,IAAI,OAAA,CAAQ,CAAC,EAAE,MAAA,EAAO;AAAA,EAClD;AAEA,EAAA,OAAO,MAAA;AACT;AAMA,eAAsB,MAAA,CACpB,KAAA,EACA,QAAA,EACA,QAAA,GAA2B,MAAA,EACT;AAClB,EAAA,MAAM,QAAA,GAAW,MAAA,CAAO,KAAA,CAAM,QAAQ,CAAA;AACtC,EAAA,MAAM,MAAA,GAAS,MAAM,SAAA,CAAU,KAAA,EAAO,CAAC,QAAA,CAAS,SAAS,GAAG,QAAQ,CAAA;AACpE,EAAA,MAAM,MAAA,GAAS,MAAA,CAAO,QAAA,CAAS,SAAS,CAAA;AAExC,EAAA,IAAI,CAAC,QAAQ,OAAO,KAAA;AACpB,EAAA,OAAO,OAAO,SAAA,KAAc,QAAA,CAAS,SAAA,IAAa,MAAA,CAAO,QAAQ,QAAA,CAAS,GAAA;AAC5E;;;ACrEO,IAAM,OAAA,GAAU","file":"chunk-WSMVLWLB.js","sourcesContent":["import type { IHasher } from \"hash-wasm\";\nimport { createXXHash128 } from \"hash-wasm\";\nimport { FulHashError } from \"./errors.js\";\n\nlet isWasmReady = false;\nlet initPromise: Promise<void> | null = null;\n\nexport async function initializeWasm(): Promise<void> {\n if (isWasmReady) {\n return;\n }\n\n if (initPromise) {\n return initPromise;\n }\n\n initPromise = createXXHash128()\n .then(() => {\n isWasmReady = true;\n })\n .catch((error) => {\n initPromise = null;\n throw new FulHashError(`Failed to initialize hash-wasm XXH3-128 module: ${error.message}`);\n });\n\n return initPromise;\n}\n\nexport function isInitialized(): boolean {\n return isWasmReady;\n}\n\nexport async function createHasher(): Promise<IHasher> {\n if (!isWasmReady) {\n throw new FulHashError(\"WASM not initialized. Call initializeWasm() first.\");\n }\n return createXXHash128();\n}\n","import { createHash } from \"node:crypto\";\nimport type { IHasher } from \"hash-wasm\";\nimport { Algorithm } from \"../crucible/fulhash/types.js\";\nimport * as crc32 from \"./algorithms/crc32.js\";\nimport * as crc32c from \"./algorithms/crc32c.js\";\nimport type { StreamHasher, StreamHasherOptions } from \"./definitions.js\";\nimport { Digest } from \"./digest.js\";\nimport { DigestStateError, UnsupportedAlgorithmError } from \"./errors.js\";\nimport { createHasher as createXXH3Hasher, initializeWasm } from \"./wasm-loader.js\";\n\nenum State {\n INITIAL = \"initial\",\n UPDATING = \"updating\",\n FINALIZED = \"finalized\",\n}\n\nfunction intToBytes(crc: number): Uint8Array {\n const bytes = new Uint8Array(4);\n const unsigned = crc >>> 0;\n bytes[0] = (unsigned >>> 24) & 0xff;\n bytes[1] = (unsigned >>> 16) & 0xff;\n bytes[2] = (unsigned >>> 8) & 0xff;\n bytes[3] = unsigned & 0xff;\n return bytes;\n}\n\ntype IDataType =\n | string\n | Uint8Array\n | Uint16Array\n | Uint32Array\n | Int8Array\n | Int16Array\n | Int32Array\n | Float32Array\n | Float64Array\n | DataView\n | ArrayBuffer\n | SharedArrayBuffer;\n\n// Helper to define local interface for CRC hashers returned by our modules\ninterface CRC32Hasher extends IHasher {\n // We only use the update method with Uint8Array in our wrapper,\n // but we declare it compatible with IHasher to avoid TS complaints if possible,\n // or cast it. hash-wasm's IHasher expects IDataType (string | Buffer | TypedArray).\n update(data: IDataType): IHasher;\n}\n\nabstract class BaseStreamHasher implements StreamHasher {\n protected state: State = State.INITIAL;\n protected readonly algorithm: Algorithm;\n\n constructor(algorithm: Algorithm) {\n this.algorithm = algorithm;\n }\n\n abstract update(data: string | Uint8Array): StreamHasher;\n abstract digest(): Digest;\n abstract reset(): StreamHasher;\n\n protected ensureNotFinalized(): void {\n if (this.state === State.FINALIZED) {\n throw new DigestStateError(\"Cannot update after digest(). Call reset() to reuse hasher.\");\n }\n }\n\n protected ensureUpdating(): void {\n if (this.state !== State.UPDATING && this.state !== State.INITIAL) {\n throw new DigestStateError(\"Invalid state for digest(). Hasher may have been finalized.\");\n }\n }\n\n protected markUpdating(): void {\n this.state = State.UPDATING;\n }\n\n protected markFinalized(): void {\n this.state = State.FINALIZED;\n }\n\n protected markInitial(): void {\n this.state = State.INITIAL;\n }\n}\n\nclass SHA256StreamHasher extends BaseStreamHasher {\n private hasher: ReturnType<typeof createHash>;\n\n constructor() {\n super(Algorithm.SHA256);\n this.hasher = createHash(\"sha256\");\n }\n\n update(data: string | Uint8Array): StreamHasher {\n this.ensureNotFinalized();\n this.markUpdating();\n\n if (typeof data === \"string\") {\n this.hasher.update(data, \"utf8\");\n } else {\n this.hasher.update(data);\n }\n\n return this;\n }\n\n digest(): Digest {\n this.ensureUpdating();\n this.markFinalized();\n\n const bytes = new Uint8Array(this.hasher.digest());\n return new Digest(this.algorithm, bytes);\n }\n\n reset(): StreamHasher {\n this.hasher = createHash(\"sha256\");\n this.markInitial();\n return this;\n }\n}\n\nclass XXH3StreamHasher extends BaseStreamHasher {\n private hasher: IHasher;\n\n constructor(hasher: IHasher) {\n super(Algorithm.XXH3_128);\n this.hasher = hasher;\n this.hasher.init();\n }\n\n update(data: string | Uint8Array): StreamHasher {\n this.ensureNotFinalized();\n this.markUpdating();\n\n if (typeof data === \"string\") {\n const encoder = new TextEncoder();\n this.hasher.update(encoder.encode(data));\n } else {\n this.hasher.update(data);\n }\n\n return this;\n }\n\n digest(): Digest {\n this.ensureUpdating();\n this.markFinalized();\n\n const bytes = this.hasher.digest(\"binary\");\n return new Digest(this.algorithm, bytes);\n }\n\n reset(): StreamHasher {\n this.hasher.init();\n this.markInitial();\n return this;\n }\n}\n\nclass CRC32StreamHasher extends BaseStreamHasher {\n private hasher: CRC32Hasher | null = null;\n\n constructor() {\n super(Algorithm.CRC32);\n }\n\n async init(): Promise<void> {\n this.hasher = await crc32.createHasher();\n this.hasher.init();\n }\n\n update(data: string | Uint8Array): StreamHasher {\n this.ensureNotFinalized();\n this.markUpdating();\n\n if (!this.hasher) {\n // This shouldn't happen if createStreamHasher calls init, but technically\n // synchronous update() can't await. We might need to buffer or assume initialized.\n // However, the Factory createStreamHasher is async, so we can await init there.\n throw new Error(\"Hasher not initialized\");\n }\n\n if (typeof data === \"string\") {\n const encoder = new TextEncoder();\n this.hasher.update(encoder.encode(data));\n } else {\n this.hasher.update(data);\n }\n return this;\n }\n\n digest(): Digest {\n this.ensureUpdating();\n this.markFinalized();\n if (!this.hasher) throw new Error(\"Hasher not initialized\");\n\n const hex = this.hasher.digest();\n const bytes = intToBytes(parseInt(hex, 16));\n return new Digest(this.algorithm, bytes);\n }\n\n reset(): StreamHasher {\n if (!this.hasher) throw new Error(\"Hasher not initialized\");\n this.hasher.init();\n this.markInitial();\n return this;\n }\n}\n\nclass CRC32CStreamHasher extends BaseStreamHasher {\n private hasher: CRC32Hasher | null = null;\n\n constructor() {\n super(Algorithm.CRC32C);\n }\n\n async init(): Promise<void> {\n this.hasher = await crc32c.createHasher();\n this.hasher.init();\n }\n\n update(data: string | Uint8Array): StreamHasher {\n this.ensureNotFinalized();\n this.markUpdating();\n\n if (!this.hasher) throw new Error(\"Hasher not initialized\");\n\n if (typeof data === \"string\") {\n const encoder = new TextEncoder();\n this.hasher.update(encoder.encode(data));\n } else {\n this.hasher.update(data);\n }\n return this;\n }\n\n digest(): Digest {\n this.ensureUpdating();\n this.markFinalized();\n if (!this.hasher) throw new Error(\"Hasher not initialized\");\n\n const hex = this.hasher.digest();\n const bytes = intToBytes(parseInt(hex, 16));\n return new Digest(this.algorithm, bytes);\n }\n\n reset(): StreamHasher {\n if (!this.hasher) throw new Error(\"Hasher not initialized\");\n this.hasher.init();\n this.markInitial();\n return this;\n }\n}\n\nexport async function createStreamHasher(options: StreamHasherOptions = {}): Promise<StreamHasher> {\n const algorithm = options.algorithm ?? Algorithm.XXH3_128;\n\n switch (algorithm) {\n case Algorithm.SHA256:\n return new SHA256StreamHasher();\n case Algorithm.XXH3_128: {\n await initializeWasm();\n const wasmHasher = await createXXH3Hasher();\n return new XXH3StreamHasher(wasmHasher);\n }\n case Algorithm.CRC32: {\n const hasher = new CRC32StreamHasher();\n await hasher.init();\n return hasher;\n }\n case Algorithm.CRC32C: {\n const hasher = new CRC32CStreamHasher();\n await hasher.init();\n return hasher;\n }\n default:\n throw new UnsupportedAlgorithmError(algorithm, Object.values(Algorithm));\n }\n}\n","import type { Algorithm } from \"../crucible/fulhash/types.js\";\nimport type { MultiHashResult, StreamHasher } from \"./definitions.js\";\nimport { Digest } from \"./digest.js\";\nimport { createStreamHasher } from \"./stream.js\";\n\nexport type HashInput = string | Uint8Array | AsyncIterable<string | Uint8Array>;\n\n/**\n * Compute multiple hashes in a single pass over the data.\n * Useful for generating checksums for multiple algorithms (e.g. SHA256 + XXH3)\n * without reading the stream multiple times.\n */\nexport async function multiHash(\n input: HashInput,\n algorithms: Algorithm[],\n encoding: BufferEncoding = \"utf8\",\n): Promise<MultiHashResult> {\n const uniqueAlgorithms = [...new Set(algorithms)];\n const hashers: StreamHasher[] = await Promise.all(\n uniqueAlgorithms.map((algo) => createStreamHasher({ algorithm: algo })),\n );\n\n if (typeof input === \"string\") {\n if (encoding !== \"utf8\") {\n // Manual buffer conversion for non-utf8 encodings, as some stream hashers\n // (like XXH3) might default to UTF-8 for string inputs.\n const buf = Buffer.from(input, encoding);\n for (const hasher of hashers) {\n hasher.update(buf);\n }\n } else {\n for (const hasher of hashers) {\n hasher.update(input);\n }\n }\n } else if (input instanceof Uint8Array) {\n for (const hasher of hashers) {\n hasher.update(input);\n }\n } else {\n // AsyncIterable (Stream)\n for await (const chunk of input) {\n // If chunk is string and encoding is non-utf8, we might have an issue here\n // as the stream chunk doesn't carry encoding info.\n // Standard Node streams yield Buffers or strings (usually utf8).\n // If the user passes an async iterable of strings, we assume they are safe to pass to update().\n // If strict encoding control is needed for streams, the stream should yield Buffers.\n for (const hasher of hashers) {\n hasher.update(chunk);\n }\n }\n }\n\n const result: MultiHashResult = {};\n for (let i = 0; i < uniqueAlgorithms.length; i++) {\n result[uniqueAlgorithms[i]] = hashers[i].digest();\n }\n\n return result;\n}\n\n/**\n * Verify data against a formatted checksum (e.g. \"sha256:abc...\").\n * Automatically selects the algorithm from the checksum prefix.\n */\nexport async function verify(\n input: HashInput,\n checksum: string,\n encoding: BufferEncoding = \"utf8\",\n): Promise<boolean> {\n const expected = Digest.parse(checksum);\n const result = await multiHash(input, [expected.algorithm], encoding);\n const actual = result[expected.algorithm];\n\n if (!actual) return false;\n return actual.algorithm === expected.algorithm && actual.hex === expected.hex;\n}\n","/**\n * FulHash - Consistent hashing API for Fulmen ecosystem\n *\n * Provides block and streaming hashing with XXH3-128, SHA-256, CRC32, and CRC32C algorithms.\n * Cross-language compatible with gofulmen and pyfulmen.\n */\n\nexport const VERSION = \"1.0.0\";\n\nexport * from \"../crucible/fulhash/types.js\";\nexport { type HashInput, multiHash, verify } from \"./convenience.js\";\nexport type {\n HashOptions,\n StreamHasher,\n StreamHasherOptions,\n} from \"./definitions.js\";\nexport { Digest } from \"./digest.js\";\nexport {\n DigestStateError,\n FulHashError,\n InvalidChecksumError,\n InvalidChecksumFormatError,\n UnsupportedAlgorithmError,\n} from \"./errors.js\";\nexport { hash, hashBytes, hashString } from \"./hash.js\";\nexport { createStreamHasher } from \"./stream.js\";\n"]}
|