@fulmenhq/tsfulmen 0.1.13 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (165) hide show
  1. package/CHANGELOG.md +73 -512
  2. package/README.md +111 -28
  3. package/config/crucible-ts/agentic/roles/README.md +76 -0
  4. package/config/crucible-ts/agentic/roles/cicd.yaml +82 -0
  5. package/config/crucible-ts/agentic/roles/dataeng.yaml +104 -0
  6. package/config/crucible-ts/agentic/roles/devlead.yaml +84 -0
  7. package/config/crucible-ts/agentic/roles/devrev.yaml +105 -0
  8. package/config/crucible-ts/agentic/roles/entarch.yaml +101 -0
  9. package/config/crucible-ts/agentic/roles/infoarch.yaml +95 -0
  10. package/config/crucible-ts/agentic/roles/prodmktg.yaml +92 -0
  11. package/config/crucible-ts/agentic/roles/qa.yaml +148 -0
  12. package/config/crucible-ts/agentic/roles/secrev.yaml +101 -0
  13. package/config/crucible-ts/agentic/roles/uxdev.yaml +168 -0
  14. package/config/crucible-ts/branding/ecosystem.yaml +26 -0
  15. package/config/crucible-ts/library/foundry/exit-codes.snapshot.json +26 -0
  16. package/config/crucible-ts/library/foundry/exit-codes.yaml +28 -3
  17. package/config/crucible-ts/library/foundry/patterns.yaml +2 -2
  18. package/config/crucible-ts/library/foundry/signal-resolution-fixtures.yaml +207 -0
  19. package/config/crucible-ts/library/foundry/signals.yaml +21 -0
  20. package/config/crucible-ts/library/foundry/simplified-modes.snapshot.json +9 -1
  21. package/config/crucible-ts/library/{foundry/similarity-fixtures.yaml → similarity/fixtures.yaml} +1 -1
  22. package/config/crucible-ts/library/v1.0.0/module-manifest.yaml +1 -2
  23. package/config/crucible-ts/taxonomy/fixture-catalog.yaml +145 -0
  24. package/config/crucible-ts/taxonomy/languages.yaml +2 -2
  25. package/config/crucible-ts/taxonomy/library/foundry-catalogs/v1.1.0/catalogs.yaml +77 -0
  26. package/config/crucible-ts/taxonomy/library/platform-modules/v1.1.0/modules.yaml +722 -0
  27. package/config/crucible-ts/taxonomy/metrics.yaml +1 -1
  28. package/config/crucible-ts/taxonomy/repository-categories.yaml +134 -1
  29. package/dist/appidentity/index.d.ts +117 -35
  30. package/dist/appidentity/index.js +752 -592
  31. package/dist/appidentity/index.js.map +1 -1
  32. package/dist/config/index.js +118 -6
  33. package/dist/config/index.js.map +1 -1
  34. package/dist/crucible/index.js +118 -6
  35. package/dist/crucible/index.js.map +1 -1
  36. package/dist/errors/index.js +118 -6
  37. package/dist/errors/index.js.map +1 -1
  38. package/dist/foundry/index.d.ts +13 -676
  39. package/dist/foundry/index.js +118 -6
  40. package/dist/foundry/index.js.map +1 -1
  41. package/dist/foundry/similarity/index.d.ts +2 -2
  42. package/dist/fulhash/index.d.ts +64 -12
  43. package/dist/fulhash/index.js +292 -53
  44. package/dist/fulhash/index.js.map +1 -1
  45. package/dist/index.d.ts +2 -2
  46. package/dist/index.js +753 -593
  47. package/dist/index.js.map +1 -1
  48. package/dist/{manager-D27vrdaS.d.ts → manager-CH3fX7zO.d.ts} +1 -1
  49. package/dist/pathfinder/index.js +368 -59
  50. package/dist/pathfinder/index.js.map +1 -1
  51. package/dist/reports/license-inventory.csv +302 -0
  52. package/dist/schema/index.js +118 -6
  53. package/dist/schema/index.js.map +1 -1
  54. package/dist/signals/index.d.ts +675 -0
  55. package/dist/signals/index.js +5790 -0
  56. package/dist/signals/index.js.map +1 -0
  57. package/dist/similarity/index.d.ts +2 -0
  58. package/dist/similarity/index.js +136 -0
  59. package/dist/similarity/index.js.map +1 -0
  60. package/dist/{suggest-Cv7SVQRu.d.ts → suggest-D8LbwtPV.d.ts} +1 -1
  61. package/dist/telemetry/http/index.js +704 -591
  62. package/dist/telemetry/http/index.js.map +1 -1
  63. package/dist/telemetry/index.js +118 -6
  64. package/dist/telemetry/index.js.map +1 -1
  65. package/dist/telemetry/prometheus/index.d.ts +1 -1
  66. package/dist/telemetry/prometheus/index.js +175 -11
  67. package/dist/telemetry/prometheus/index.js.map +1 -1
  68. package/package.json +15 -6
  69. package/schemas/crucible-ts/assessment/v1.0.0/severity-definitions.schema.json +1 -1
  70. package/schemas/crucible-ts/config/fulmen-ecosystem/v1.0.0/fulmen-config-paths.schema.json +1 -1
  71. package/schemas/crucible-ts/config/repository/app-identity/v1.0.0/app-identity.schema.json +3 -3
  72. package/schemas/crucible-ts/config/repository/v1.0.0/lifecycle-phase.json +1 -1
  73. package/schemas/crucible-ts/config/repository-category/codex/v1.0.0/codex-config.schema.json +1 -1
  74. package/schemas/crucible-ts/config/standards/v1.0.0/adr-adoption-status.json +1 -1
  75. package/schemas/crucible-ts/config/standards/v1.0.0/adr-frontmatter.schema.json +3 -3
  76. package/schemas/crucible-ts/config/standards/v1.0.0/adr-lifecycle-status.json +1 -1
  77. package/schemas/crucible-ts/config/sync-keys.schema.yaml +14 -0
  78. package/schemas/crucible-ts/content/ssot-provenance/v1.0.0/ssot-provenance.schema.json +1 -1
  79. package/schemas/crucible-ts/design/README.md +159 -0
  80. package/schemas/crucible-ts/design/core/v1.0.0/component-states.schema.json +204 -0
  81. package/schemas/crucible-ts/design/core/v1.0.0/semantic-colors.schema.json +179 -0
  82. package/schemas/crucible-ts/design/core/v1.0.0/spacing-scale.schema.json +165 -0
  83. package/schemas/crucible-ts/design/core/v1.0.0/typography-roles.schema.json +195 -0
  84. package/schemas/crucible-ts/design/tui/v1.0.0/color-palette.schema.json +303 -0
  85. package/schemas/crucible-ts/design/tui/v1.0.0/component.schema.json +374 -0
  86. package/schemas/crucible-ts/design/tui/v1.0.0/layout.schema.json +272 -0
  87. package/schemas/crucible-ts/design/tui/v1.0.0/theme.schema.json +205 -0
  88. package/schemas/crucible-ts/design/tui/v1.0.0/typography.schema.json +316 -0
  89. package/schemas/crucible-ts/devsecops/lorage-central/activity/v1.0.0/activity.schema.json +1 -1
  90. package/schemas/crucible-ts/devsecops/lorage-central/credentials/v1.0.0/credentials.schema.json +1 -1
  91. package/schemas/crucible-ts/devsecops/lorage-central/policy/v1.0.0/policy.schema.json +1 -1
  92. package/schemas/crucible-ts/devsecops/lorage-central/recipe/v1.0.0/recipe.schema.json +1 -1
  93. package/schemas/crucible-ts/devsecops/lorage-central/runbooks/v1.0.0/runbook.schema.json +1 -1
  94. package/schemas/crucible-ts/devsecops/lorage-central/tenant/v1.0.0/tenant.schema.json +1 -1
  95. package/schemas/crucible-ts/devsecops/secrets/v1.0.0/secrets.schema.json +1 -1
  96. package/schemas/crucible-ts/error-handling/v1.0.0/error-response.schema.json +1 -1
  97. package/schemas/crucible-ts/library/foundry/v1.0.0/country-codes.schema.json +1 -1
  98. package/schemas/crucible-ts/library/foundry/v1.0.0/exit-codes.schema.json +1 -1
  99. package/schemas/crucible-ts/library/foundry/v1.0.0/http-status-groups.schema.json +1 -1
  100. package/schemas/crucible-ts/library/foundry/v1.0.0/mime-types.schema.json +1 -1
  101. package/schemas/crucible-ts/library/foundry/v1.0.0/patterns.schema.json +1 -1
  102. package/schemas/crucible-ts/library/foundry/v1.0.0/signal-resolution-fixtures.schema.json +140 -0
  103. package/schemas/crucible-ts/library/foundry/v1.0.0/signals.schema.json +6 -1
  104. package/schemas/crucible-ts/library/fulencode/v1.0.0/fulencode-config.schema.json +1 -1
  105. package/schemas/crucible-ts/library/fulhash/v1.0.0/checksum-string.schema.json +2 -2
  106. package/schemas/crucible-ts/library/fulhash/v1.0.0/digest.schema.json +61 -1
  107. package/schemas/crucible-ts/library/fulhash/v1.0.0/fixtures.schema.json +1 -1
  108. package/schemas/crucible-ts/library/fulpack/v1.0.0/archive-entry.schema.json +1 -1
  109. package/schemas/crucible-ts/library/fulpack/v1.0.0/archive-info.schema.json +1 -1
  110. package/schemas/crucible-ts/library/fulpack/v1.0.0/archive-manifest.schema.json +2 -2
  111. package/schemas/crucible-ts/library/fulpack/v1.0.0/create-options.schema.json +1 -1
  112. package/schemas/crucible-ts/library/fulpack/v1.0.0/extract-options.schema.json +1 -1
  113. package/schemas/crucible-ts/library/fulpack/v1.0.0/extract-result.schema.json +1 -1
  114. package/schemas/crucible-ts/library/fulpack/v1.0.0/scan-options.schema.json +1 -1
  115. package/schemas/crucible-ts/library/fulpack/v1.0.0/validation-result.schema.json +1 -1
  116. package/schemas/crucible-ts/library/module-manifest/v1.0.0/module-manifest.schema.json +1 -1
  117. package/schemas/crucible-ts/library/{foundry → similarity}/v1.0.0/similarity.schema.json +2 -2
  118. package/schemas/crucible-ts/library/{foundry → similarity}/v2.0.0/similarity.schema.json +2 -2
  119. package/schemas/crucible-ts/observability/metrics/v1.0.0/metrics-event.schema.json +1 -1
  120. package/schemas/crucible-ts/pathfinder/v1.0.0/find-query.schema.json +1 -1
  121. package/schemas/crucible-ts/pathfinder/v1.0.0/finder-config.schema.json +1 -1
  122. package/schemas/crucible-ts/pathfinder/v1.0.0/path-result.schema.json +1 -1
  123. package/schemas/crucible-ts/protocol/http/v1.0.0/error-response.schema.json +1 -1
  124. package/schemas/crucible-ts/protocol/http/v1.0.0/health-response.schema.json +1 -1
  125. package/schemas/crucible-ts/protocol/http/v1.0.0/success-response.schema.json +1 -1
  126. package/schemas/crucible-ts/protocol/http/v1.0.0/version-response.schema.json +1 -1
  127. package/schemas/crucible-ts/server/management/v1.0.0/server-management.schema.json +1 -1
  128. package/schemas/crucible-ts/standards/publishing/v1.0.0/spec-catalog.schema.json +134 -0
  129. package/schemas/crucible-ts/taxonomy/devsecops/auth-methods/v1.0.0/auth-methods-key.schema.json +1 -1
  130. package/schemas/crucible-ts/taxonomy/devsecops/auth-methods/v1.0.0/auth-methods-metadata.schema.json +1 -1
  131. package/schemas/crucible-ts/taxonomy/devsecops/geo/v1.0.0/geo-key.schema.json +1 -1
  132. package/schemas/crucible-ts/taxonomy/devsecops/geo/v1.0.0/geo-metadata.schema.json +1 -1
  133. package/schemas/crucible-ts/taxonomy/devsecops/infra-phases/v1.0.0/infra-phases-key.schema.json +1 -1
  134. package/schemas/crucible-ts/taxonomy/devsecops/infra-phases/v1.0.0/infra-phases-metadata.schema.json +1 -1
  135. package/schemas/crucible-ts/taxonomy/devsecops/infra-providers/v1.0.0/infra-providers-key.schema.json +1 -1
  136. package/schemas/crucible-ts/taxonomy/devsecops/infra-providers/v1.0.0/infra-providers-metadata.schema.json +1 -1
  137. package/schemas/crucible-ts/taxonomy/devsecops/modules/v1.0.0/devsecops-module-entry.schema.json +1 -1
  138. package/schemas/crucible-ts/taxonomy/fixture/v1.0.0/fixture-catalog.schema.json +166 -0
  139. package/schemas/crucible-ts/taxonomy/language/v1.0.0/language-key.schema.json +1 -1
  140. package/schemas/crucible-ts/taxonomy/language/v1.0.0/language-metadata.schema.json +1 -1
  141. package/schemas/crucible-ts/taxonomy/library/foundry-catalogs/v1.1.0/catalog-entry.schema.json +98 -0
  142. package/schemas/crucible-ts/taxonomy/library/fulencode/detection-confidence/v1.0.0/levels.schema.json +1 -1
  143. package/schemas/crucible-ts/taxonomy/library/fulencode/encoding-families/v1.0.0/families.schema.json +1 -1
  144. package/schemas/crucible-ts/taxonomy/library/fulencode/normalization-profiles/v1.0.0/profiles.schema.json +1 -1
  145. package/schemas/crucible-ts/taxonomy/library/fulhash/algorithms/v1.0.0/algorithms.yaml +16 -0
  146. package/schemas/crucible-ts/taxonomy/library/modules/v1.0.0/module-entry.schema.json +1 -1
  147. package/schemas/crucible-ts/taxonomy/library/modules/v1.1.0/module-entry.schema.json +436 -0
  148. package/schemas/crucible-ts/taxonomy/repository-category/v1.0.0/category-key.schema.json +16 -8
  149. package/schemas/crucible-ts/taxonomy/repository-category/v1.0.0/category-metadata.schema.json +1 -1
  150. package/schemas/crucible-ts/upstream/3leaps/PROVENANCE.md +43 -0
  151. package/schemas/crucible-ts/upstream/3leaps/agentic/v0/role-prompt.schema.json +183 -0
  152. package/schemas/crucible-ts/upstream/3leaps/ailink/v0/prompt.schema.json +204 -0
  153. package/schemas/crucible-ts/upstream/3leaps/ailink/v0/search-response.schema.json +152 -0
  154. package/schemas/crucible-ts/upstream/README.md +50 -0
  155. package/schemas/crucible-ts/web/branding/v1.0.0/site-branding.schema.json +1 -1
  156. package/schemas/crucible-ts/web/styling/v1.0.0/site-styling.schema.json +1 -1
  157. package/schemas/crucible-ts/config/goneat/README.md +0 -60
  158. package/schemas/crucible-ts/config/goneat/v1.0.0/dates.yaml +0 -234
  159. package/schemas/crucible-ts/config/goneat/v1.0.0/goneat-config.yaml +0 -344
  160. package/schemas/crucible-ts/config/goneat/v1.0.0/lifecycle-phase.json +0 -20
  161. package/schemas/crucible-ts/config/goneat/v1.0.0/release-phase.json +0 -17
  162. package/schemas/crucible-ts/config/goneat/v1.0.0/security-policy.yaml +0 -178
  163. package/schemas/crucible-ts/config/goneat/v1.0.0/version-policy.schema.yaml +0 -205
  164. package/schemas/crucible-ts/tooling/goneat-tools/v1.0.0/README.md +0 -177
  165. package/schemas/crucible-ts/tooling/goneat-tools/v1.0.0/goneat-tools-config.schema.yaml +0 -146
@@ -0,0 +1,675 @@
1
+ import { a as BehaviorInfo, m as SignalInfo, k as SignalCatalog, S as SignalManager, l as SignalHandler, H as HandlerOptions, F as FallbackLogger, T as TelemetryEmitter } from '../manager-CH3fX7zO.js';
2
+ export { B as Behavior, b as BehaviorPhase, E as ExitCodes, L as LogLevel, O as OsMappings, P as PlatformOverrides, e as PlatformSupport, f as PlatformSupportLevel, i as Signal, j as SignalBehavior, n as SignalManagerOptions, o as TimeoutBehavior, W as WindowsFallback, p as WindowsFallbackBehavior, q as WindowsFallbackOptions, s as WindowsFallbackResult, c as createSignalManager, g as getFallbackMetadata, d as getHttpFallbackGuidance, h as handleWindowsFallback, r as requiresFallback } from '../manager-CH3fX7zO.js';
3
+
4
+ /**
5
+ * Signal Capability Detection
6
+ *
7
+ * Platform-aware signal support detection driven by catalog metadata.
8
+ * Ensures cross-language parity by querying windows_event/fallback fields
9
+ * rather than hardcoding signal names.
10
+ */
11
+ /**
12
+ * Platform types
13
+ */
14
+ type Platform = "linux" | "darwin" | "win32" | "freebsd" | "unknown";
15
+ /**
16
+ * Platform capabilities summary
17
+ */
18
+ interface PlatformCapabilities {
19
+ platform: Platform;
20
+ isPOSIX: boolean;
21
+ isWindows: boolean;
22
+ supportsNativeSignals: boolean;
23
+ supportsSignalExitCodes: boolean;
24
+ supportedSignals: string[];
25
+ unsupportedSignals: string[];
26
+ mappedSignals: string[];
27
+ }
28
+ /**
29
+ * Detect current platform
30
+ */
31
+ declare function getPlatform(): Platform;
32
+ /**
33
+ * Check if current platform is POSIX-compliant
34
+ */
35
+ declare function isPOSIX(): boolean;
36
+ /**
37
+ * Check if current platform is Windows
38
+ */
39
+ declare function isWindows(): boolean;
40
+ /**
41
+ * Check if a signal is supported on the current platform
42
+ *
43
+ * Uses catalog metadata (windows_event field) to determine support.
44
+ * Returns true if:
45
+ * - Platform is POSIX (all signals natively supported)
46
+ * - Platform is Windows AND signal has non-null windows_event
47
+ *
48
+ * @param signalName - Signal name (e.g., "SIGTERM") or id (e.g., "term")
49
+ */
50
+ declare function supportsSignal(signalName: string): Promise<boolean>;
51
+ /**
52
+ * Check if platform supports signal-based exit codes (128+N pattern)
53
+ *
54
+ * Windows doesn't propagate signal numbers via exit codes in the same way
55
+ * as POSIX systems. This function helps applications decide whether to
56
+ * rely on signal exit codes for process monitoring.
57
+ */
58
+ declare function supportsSignalExitCodes(): boolean;
59
+ /**
60
+ * Get comprehensive platform capabilities
61
+ *
62
+ * Queries catalog to build a complete picture of signal support.
63
+ * Useful for capability reporting, documentation generation, and testing.
64
+ */
65
+ declare function getPlatformCapabilities(): Promise<PlatformCapabilities>;
66
+ /**
67
+ * Get the signal number for the current platform
68
+ *
69
+ * Handles platform-specific overrides (e.g., SIGUSR1/SIGUSR2 on macOS/FreeBSD).
70
+ * Returns the appropriate signal number based on platform_overrides.
71
+ *
72
+ * @param signalName - Signal name (e.g., "SIGTERM") or id (e.g., "term")
73
+ * @returns Signal number for current platform, or null if signal not found
74
+ */
75
+ declare function getSignalNumber(signalName: string): Promise<number | null>;
76
+ /**
77
+ * Get the Windows console event name for a signal
78
+ *
79
+ * Returns the Windows console event that corresponds to a Unix signal,
80
+ * or null if the signal is not supported on Windows.
81
+ *
82
+ * @param signalName - Signal name (e.g., "SIGTERM") or id (e.g., "term")
83
+ */
84
+ declare function getWindowsEvent(signalName: string): Promise<string | null>;
85
+
86
+ /**
87
+ * Signal Catalog Loader
88
+ *
89
+ * Loads and validates the signal handling catalog from Crucible SSOT assets
90
+ * following the same pattern as other Foundry catalogs.
91
+ */
92
+
93
+ /**
94
+ * Get the signals catalog version
95
+ */
96
+ declare function getSignalsVersion(): Promise<string>;
97
+ /**
98
+ * Get all signals
99
+ */
100
+ declare function listSignals(): Promise<SignalInfo[]>;
101
+ /**
102
+ * Get a specific signal by ID or name
103
+ */
104
+ declare function getSignal(identifier: string): Promise<SignalInfo | null>;
105
+ /**
106
+ * Get all behaviors
107
+ */
108
+ declare function listBehaviors(): Promise<BehaviorInfo[]>;
109
+ /**
110
+ * Get a specific behavior by ID
111
+ */
112
+ declare function getBehavior(id: string): Promise<BehaviorInfo | null>;
113
+ /**
114
+ * Get the complete catalog (for advanced use cases)
115
+ */
116
+ declare function getSignalCatalog(): Promise<SignalCatalog>;
117
+
118
+ /**
119
+ * Signal Handler Convenience Wrappers
120
+ *
121
+ * Common signal handling patterns for shutdown, reload, and custom behaviors.
122
+ */
123
+
124
+ /**
125
+ * Register a graceful shutdown handler
126
+ *
127
+ * Convenience wrapper for SIGTERM and SIGINT handlers.
128
+ * Automatically registers both signals to the same handler.
129
+ *
130
+ * @param manager - Signal manager instance
131
+ * @param handler - Shutdown handler function
132
+ * @param options - Handler options
133
+ *
134
+ * @example
135
+ * ```typescript
136
+ * await onShutdown(manager, async () => {
137
+ * await closeDatabase();
138
+ * await flushLogs();
139
+ * });
140
+ * ```
141
+ */
142
+ declare function onShutdown(manager: SignalManager, handler: SignalHandler, options?: HandlerOptions): Promise<void>;
143
+ /**
144
+ * Register a config reload handler
145
+ *
146
+ * Convenience wrapper for SIGHUP handler.
147
+ * Only registers on POSIX platforms (SIGHUP not supported on Windows).
148
+ *
149
+ * @param manager - Signal manager instance
150
+ * @param handler - Reload handler function
151
+ * @param options - Handler options
152
+ *
153
+ * @example
154
+ * ```typescript
155
+ * await onReload(manager, async () => {
156
+ * const newConfig = await loadConfig();
157
+ * await validateConfig(newConfig);
158
+ * process.exit(129); // Exit for restart
159
+ * });
160
+ * ```
161
+ */
162
+ declare function onReload(manager: SignalManager, handler: SignalHandler, options?: HandlerOptions): Promise<void>;
163
+ /**
164
+ * Register a custom handler for SIGUSR1
165
+ *
166
+ * Common use cases: toggle debug logging, reopen log files, dump statistics.
167
+ *
168
+ * @param manager - Signal manager instance
169
+ * @param handler - Custom handler function
170
+ * @param options - Handler options
171
+ *
172
+ * @example
173
+ * ```typescript
174
+ * await onUSR1(manager, async () => {
175
+ * logger.info('SIGUSR1 received - reopening log files');
176
+ * await reopenLogFiles();
177
+ * });
178
+ * ```
179
+ */
180
+ declare function onUSR1(manager: SignalManager, handler: SignalHandler, options?: HandlerOptions): Promise<void>;
181
+ /**
182
+ * Register a custom handler for SIGUSR2
183
+ *
184
+ * Common use cases: trigger profiling, rotate credentials, toggle verbose mode.
185
+ *
186
+ * @param manager - Signal manager instance
187
+ * @param handler - Custom handler function
188
+ * @param options - Handler options
189
+ *
190
+ * @example
191
+ * ```typescript
192
+ * await onUSR2(manager, async () => {
193
+ * logger.info('SIGUSR2 received - toggling debug mode');
194
+ * toggleDebugMode();
195
+ * });
196
+ * ```
197
+ */
198
+ declare function onUSR2(manager: SignalManager, handler: SignalHandler, options?: HandlerOptions): Promise<void>;
199
+ /**
200
+ * Register an emergency quit handler
201
+ *
202
+ * Convenience wrapper for SIGQUIT (immediate exit, no cleanup).
203
+ *
204
+ * @param manager - Signal manager instance
205
+ * @param handler - Emergency quit handler
206
+ * @param options - Handler options
207
+ *
208
+ * @example
209
+ * ```typescript
210
+ * await onEmergencyQuit(manager, async () => {
211
+ * logger.error('SIGQUIT received - emergency exit');
212
+ * process.exit(131);
213
+ * });
214
+ * ```
215
+ */
216
+ declare function onEmergencyQuit(manager: SignalManager, handler: SignalHandler, options?: HandlerOptions): Promise<void>;
217
+ /**
218
+ * Register handlers for all common shutdown signals
219
+ *
220
+ * Registers the same handler for SIGTERM, SIGINT, and SIGQUIT.
221
+ * Useful for applications that want consistent shutdown behavior.
222
+ *
223
+ * @param manager - Signal manager instance
224
+ * @param handler - Shutdown handler function
225
+ * @param options - Handler options
226
+ */
227
+ declare function onAnyShutdown(manager: SignalManager, handler: SignalHandler, options?: HandlerOptions): Promise<void>;
228
+
229
+ /**
230
+ * Double-Tap Signal Handling
231
+ *
232
+ * Implements Ctrl+C double-tap pattern for graceful shutdown with force-quit option.
233
+ * Per Crucible standard: 2-second window, immediate exit on second signal.
234
+ */
235
+
236
+ /**
237
+ * Double-tap configuration
238
+ */
239
+ interface DoubleTapConfig {
240
+ /**
241
+ * Debounce window in milliseconds (default: 2000ms per Crucible standard)
242
+ */
243
+ windowMs?: number;
244
+ /**
245
+ * Exit code for forced double-tap exit (default: 130 for SIGINT)
246
+ */
247
+ exitCode?: number;
248
+ /**
249
+ * Message to display on first signal (default: from catalog)
250
+ */
251
+ hintMessage?: string;
252
+ /**
253
+ * Logger for double-tap events
254
+ */
255
+ logger?: FallbackLogger;
256
+ /**
257
+ * Enable test mode (prevents process.exit calls)
258
+ */
259
+ testMode?: boolean;
260
+ }
261
+ /**
262
+ * Double-tap state tracker
263
+ */
264
+ interface DoubleTapState {
265
+ firstTapTime: number | null;
266
+ windowMs: number;
267
+ exitCode: number;
268
+ hintMessage: string;
269
+ logger?: FallbackLogger;
270
+ testMode: boolean;
271
+ }
272
+ /**
273
+ * Create double-tap state tracker for a signal
274
+ *
275
+ * @param signalName - Signal name (typically "SIGINT")
276
+ * @param config - Double-tap configuration
277
+ */
278
+ declare function createDoubleTapTracker(signalName: string, config?: DoubleTapConfig): Promise<DoubleTapState>;
279
+ /**
280
+ * Handle double-tap signal logic
281
+ *
282
+ * Returns true if this is the second tap (force-quit), false if first tap.
283
+ * Updates state to track timing between taps.
284
+ *
285
+ * @param state - Double-tap state tracker
286
+ * @returns true if force-quit should proceed, false if graceful shutdown
287
+ */
288
+ declare function handleDoubleTap(state: DoubleTapState): boolean;
289
+ /**
290
+ * Reset double-tap state
291
+ *
292
+ * Called when graceful shutdown completes before second tap.
293
+ */
294
+ declare function resetDoubleTap(state: DoubleTapState): void;
295
+ /**
296
+ * Check if currently within double-tap window
297
+ *
298
+ * Useful for testing and debugging.
299
+ */
300
+ declare function isWithinWindow(state: DoubleTapState): boolean;
301
+ /**
302
+ * Get time remaining in double-tap window (milliseconds)
303
+ *
304
+ * Returns null if not in a window, otherwise milliseconds remaining.
305
+ */
306
+ declare function getWindowTimeRemaining(state: DoubleTapState): number | null;
307
+
308
+ /**
309
+ * Signal Support Guards
310
+ *
311
+ * Validation functions that throw actionable errors when signals are unsupported.
312
+ * Used to fail-fast with clear operational guidance.
313
+ */
314
+ /**
315
+ * Guard options
316
+ */
317
+ interface GuardOptions {
318
+ /**
319
+ * Include platform-specific operational guidance in error message
320
+ */
321
+ includeGuidance?: boolean;
322
+ }
323
+ /**
324
+ * Ensure a signal is supported on the current platform
325
+ *
326
+ * Throws an error with actionable guidance if the signal is not supported.
327
+ * Use this as a guard at the start of signal registration functions.
328
+ *
329
+ * @param signalName - Signal name (e.g., "SIGTERM") or id (e.g., "term")
330
+ * @param options - Guard configuration
331
+ * @throws {FoundryCatalogError} If signal is not found or not supported
332
+ *
333
+ * @example
334
+ * ```typescript
335
+ * await ensureSupported("SIGHUP");
336
+ * // On Windows: throws with HTTP fallback guidance
337
+ * // On POSIX: passes through
338
+ * ```
339
+ */
340
+ declare function ensureSupported(signalName: string, options?: GuardOptions): Promise<void>;
341
+ /**
342
+ * Ensure platform supports signal-based exit codes
343
+ *
344
+ * Throws an error if the platform doesn't support the POSIX 128+N exit code pattern.
345
+ * Use this when exit code semantics are critical to application logic.
346
+ *
347
+ * @throws {FoundryCatalogError} If platform doesn't support signal exit codes
348
+ *
349
+ * @example
350
+ * ```typescript
351
+ * ensureSignalExitCodesSupported();
352
+ * // On Windows: throws with guidance
353
+ * // On POSIX: passes through
354
+ * ```
355
+ */
356
+ declare function ensureSignalExitCodesSupported(): void;
357
+ /**
358
+ * Ensure platform is POSIX
359
+ *
360
+ * Throws an error if the platform is not POSIX-compliant.
361
+ * Use this for functionality that strictly requires POSIX signal semantics.
362
+ *
363
+ * @throws {FoundryCatalogError} If platform is not POSIX
364
+ */
365
+ declare function ensurePOSIX(): void;
366
+ /**
367
+ * Ensure platform is Windows
368
+ *
369
+ * Throws an error if the platform is not Windows.
370
+ * Use this for Windows-specific fallback testing or functionality.
371
+ *
372
+ * @throws {FoundryCatalogError} If platform is not Windows
373
+ */
374
+ declare function ensureWindows(): void;
375
+
376
+ /**
377
+ * HTTP Signal Endpoint Helper
378
+ *
379
+ * Framework-agnostic scaffold for POST /admin/signal endpoint.
380
+ * Applications provide auth/rate-limiting; helper handles validation and execution.
381
+ */
382
+
383
+ /**
384
+ * Signal request payload
385
+ */
386
+ interface SignalRequest {
387
+ signal: string;
388
+ reason?: string;
389
+ correlation_id?: string;
390
+ }
391
+ /**
392
+ * Signal response (success)
393
+ */
394
+ interface SignalResponse {
395
+ status: "accepted";
396
+ signal: string;
397
+ correlation_id: string;
398
+ message: string;
399
+ }
400
+ /**
401
+ * Signal error response
402
+ */
403
+ interface SignalErrorResponse {
404
+ status: "error";
405
+ error: string;
406
+ message: string;
407
+ valid_signals?: string[];
408
+ }
409
+ /**
410
+ * Authentication result
411
+ */
412
+ interface AuthResult {
413
+ authenticated: boolean;
414
+ identity?: string;
415
+ reason?: string;
416
+ }
417
+ /**
418
+ * Rate limit result
419
+ */
420
+ interface RateLimitResult {
421
+ allowed: boolean;
422
+ remaining?: number;
423
+ reset_at?: number;
424
+ }
425
+ /**
426
+ * Authentication hook function
427
+ *
428
+ * Applications must provide this to validate requests.
429
+ * Returns authentication result with optional identity.
430
+ */
431
+ type AuthHook = (req: unknown) => Promise<AuthResult> | AuthResult;
432
+ /**
433
+ * Rate limiting hook function
434
+ *
435
+ * Applications may provide this to enforce rate limits.
436
+ * Returns whether request is allowed and quota info.
437
+ */
438
+ type RateLimitHook = (identity: string, signal: string) => Promise<RateLimitResult> | RateLimitResult;
439
+ /**
440
+ * Signal endpoint options
441
+ */
442
+ interface SignalEndpointOptions {
443
+ /**
444
+ * Signal manager instance
445
+ */
446
+ manager: SignalManager;
447
+ /**
448
+ * Authentication hook (required)
449
+ */
450
+ auth: AuthHook;
451
+ /**
452
+ * Rate limiting hook (optional)
453
+ */
454
+ rateLimit?: RateLimitHook;
455
+ /**
456
+ * Logger for endpoint events
457
+ */
458
+ logger?: FallbackLogger;
459
+ /**
460
+ * Telemetry emitter
461
+ */
462
+ telemetry?: TelemetryEmitter;
463
+ /**
464
+ * Allowed signals (default: all catalog signals)
465
+ */
466
+ allowedSignals?: string[];
467
+ }
468
+ /**
469
+ * Create a framework-agnostic signal endpoint handler
470
+ *
471
+ * Returns an async function that processes signal requests.
472
+ * Applications wire this to their HTTP framework (Express, Fastify, etc.)
473
+ *
474
+ * @param options - Endpoint configuration
475
+ *
476
+ * @example Express
477
+ * ```typescript
478
+ * const handler = createSignalEndpoint({
479
+ * manager,
480
+ * auth: async (req) => {
481
+ * const token = req.headers.authorization?.split(' ')[1];
482
+ * return { authenticated: token === process.env.ADMIN_TOKEN };
483
+ * },
484
+ * });
485
+ *
486
+ * app.post('/admin/signal', async (req, res) => {
487
+ * const result = await handler(req.body, req);
488
+ * res.status(result.status === 'accepted' ? 202 : result.statusCode || 400)
489
+ * .json(result);
490
+ * });
491
+ * ```
492
+ *
493
+ * @example Fastify
494
+ * ```typescript
495
+ * const handler = createSignalEndpoint({ manager, auth });
496
+ *
497
+ * fastify.post('/admin/signal', async (request, reply) => {
498
+ * const result = await handler(request.body, request);
499
+ * reply.status(result.status === 'accepted' ? 202 : 400).send(result);
500
+ * });
501
+ * ```
502
+ */
503
+ declare function createSignalEndpoint(options: SignalEndpointOptions): (payload: SignalRequest, req: unknown) => Promise<(SignalResponse | SignalErrorResponse) & {
504
+ statusCode?: number;
505
+ }>;
506
+ /**
507
+ * Create a simple bearer token auth hook
508
+ *
509
+ * Validates requests against a static token.
510
+ * For production, use mTLS or more robust auth.
511
+ *
512
+ * @param expectedToken - Expected bearer token
513
+ *
514
+ * @example
515
+ * ```typescript
516
+ * const auth = createBearerTokenAuth(process.env.ADMIN_TOKEN);
517
+ * const handler = createSignalEndpoint({ manager, auth });
518
+ * ```
519
+ */
520
+ declare function createBearerTokenAuth(expectedToken: string): AuthHook;
521
+ /**
522
+ * Create a simple in-memory rate limiter
523
+ *
524
+ * Tracks requests per identity with sliding window.
525
+ * For production, use Redis or distributed rate limiting.
526
+ *
527
+ * @param requestsPerMinute - Max requests per minute per identity
528
+ *
529
+ * @example
530
+ * ```typescript
531
+ * const rateLimit = createSimpleRateLimiter(10); // 10 req/min
532
+ * const handler = createSignalEndpoint({ manager, auth, rateLimit });
533
+ * ```
534
+ */
535
+ declare function createSimpleRateLimiter(requestsPerMinute: number): RateLimitHook;
536
+
537
+ /**
538
+ * Configuration Reload Helpers
539
+ *
540
+ * Implements restart-based config reload pattern with mandatory schema validation.
541
+ * Per Crucible standard: validate before restart, reject invalid configs without disruption.
542
+ */
543
+
544
+ /**
545
+ * Configuration validator function type
546
+ *
547
+ * Applications provide this function to validate new config against schema.
548
+ * Should return validation result with errors if invalid.
549
+ */
550
+ type ConfigValidator<T = unknown> = (config: T) => Promise<ConfigValidationResult> | ConfigValidationResult;
551
+ /**
552
+ * Configuration validation result
553
+ */
554
+ interface ConfigValidationResult {
555
+ valid: boolean;
556
+ errors?: Array<{
557
+ path: string;
558
+ message: string;
559
+ }>;
560
+ }
561
+ /**
562
+ * Configuration loader function type
563
+ *
564
+ * Applications provide this function to load new config from disk/environment.
565
+ */
566
+ type ConfigLoader<T = unknown> = () => Promise<T> | T;
567
+ /**
568
+ * Config reload options
569
+ */
570
+ interface ConfigReloadOptions<T = unknown> {
571
+ /**
572
+ * Config loader function
573
+ */
574
+ loader: ConfigLoader<T>;
575
+ /**
576
+ * Schema validator function
577
+ */
578
+ validator: ConfigValidator<T>;
579
+ /**
580
+ * Callback invoked after successful validation, before exit
581
+ * Use for cleanup, logging, etc.
582
+ */
583
+ onValidated?: (config: T) => void | Promise<void>;
584
+ /**
585
+ * Exit code for successful reload (default: 129 for SIGHUP)
586
+ */
587
+ exitCode?: number;
588
+ /**
589
+ * Logger for reload events
590
+ */
591
+ logger?: FallbackLogger;
592
+ /**
593
+ * Telemetry emitter
594
+ */
595
+ telemetry?: TelemetryEmitter;
596
+ /**
597
+ * Test mode (prevents process.exit)
598
+ */
599
+ testMode?: boolean;
600
+ }
601
+ /**
602
+ * Config reload result (for testing)
603
+ */
604
+ interface ConfigReloadResult {
605
+ reloaded: boolean;
606
+ validationErrors?: Array<{
607
+ path: string;
608
+ message: string;
609
+ }>;
610
+ error?: Error;
611
+ }
612
+ /**
613
+ * Create a config reload handler with schema validation
614
+ *
615
+ * Returns a signal handler function that implements restart-based reload:
616
+ * 1. Load new config
617
+ * 2. Validate against schema (mandatory)
618
+ * 3. If invalid: log errors, continue with current config
619
+ * 4. If valid: invoke callback, exit for restart
620
+ *
621
+ * @param options - Reload configuration
622
+ *
623
+ * @example
624
+ * ```typescript
625
+ * const reloadHandler = createConfigReloadHandler({
626
+ * loader: () => loadConfig('./config.yaml'),
627
+ * validator: (config) => validateConfigSchema(config),
628
+ * onValidated: async (config) => {
629
+ * logger.info('Config validated, restarting...');
630
+ * },
631
+ * logger: myLogger,
632
+ * });
633
+ *
634
+ * await manager.register('SIGHUP', reloadHandler);
635
+ * ```
636
+ */
637
+ declare function createConfigReloadHandler<T = unknown>(options: ConfigReloadOptions<T>): () => Promise<void>;
638
+ /**
639
+ * Three-strikes failure tracker
640
+ *
641
+ * Tracks consecutive config reload failures and triggers alerts.
642
+ * Useful for detecting persistent config source issues.
643
+ */
644
+ declare class ConfigReloadTracker {
645
+ private failures;
646
+ private lastFailureTime;
647
+ private readonly maxFailures;
648
+ private readonly logger?;
649
+ private readonly telemetry?;
650
+ constructor(options: {
651
+ maxFailures?: number;
652
+ logger?: FallbackLogger;
653
+ telemetry?: TelemetryEmitter;
654
+ });
655
+ /**
656
+ * Record a reload failure
657
+ *
658
+ * @returns true if threshold exceeded, false otherwise
659
+ */
660
+ recordFailure(): boolean;
661
+ /**
662
+ * Record a successful reload (resets counter)
663
+ */
664
+ recordSuccess(): void;
665
+ /**
666
+ * Get current failure count
667
+ */
668
+ getFailureCount(): number;
669
+ /**
670
+ * Get last failure timestamp
671
+ */
672
+ getLastFailureTime(): number | null;
673
+ }
674
+
675
+ export { type AuthHook, type AuthResult, BehaviorInfo, type ConfigLoader, type ConfigReloadOptions, type ConfigReloadResult, ConfigReloadTracker, type ConfigValidationResult, type ConfigValidator, type DoubleTapConfig, type DoubleTapState, FallbackLogger, type GuardOptions, HandlerOptions, type Platform, type PlatformCapabilities, type RateLimitHook, type RateLimitResult, SignalCatalog, type SignalEndpointOptions, type SignalErrorResponse, SignalHandler, SignalInfo, SignalManager, type SignalRequest, type SignalResponse, TelemetryEmitter, createBearerTokenAuth, createConfigReloadHandler, createDoubleTapTracker, createSignalEndpoint, createSimpleRateLimiter, ensurePOSIX, ensureSignalExitCodesSupported, ensureSupported, ensureWindows, getBehavior, getPlatform, getPlatformCapabilities, getSignal, getSignalCatalog, getSignalNumber, getSignalsVersion, getWindowTimeRemaining, getWindowsEvent, handleDoubleTap, isPOSIX, isWindows, isWithinWindow, listBehaviors, listSignals, onAnyShutdown, onEmergencyQuit, onReload, onShutdown, onUSR1, onUSR2, resetDoubleTap, supportsSignal, supportsSignalExitCodes };