tracelattice 1.2.5

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 (294) hide show
  1. package/LICENSE +24 -0
  2. package/README.md +112 -0
  3. package/dist/ServerConfig.d.ts +229 -0
  4. package/dist/ServerConfig.d.ts.map +1 -0
  5. package/dist/ServerConfig.js +121 -0
  6. package/dist/ServerConfig.js.map +1 -0
  7. package/dist/__tests__/base-registry.test.d.ts +2 -0
  8. package/dist/__tests__/base-registry.test.d.ts.map +1 -0
  9. package/dist/__tests__/base-transport-cov.test.d.ts +2 -0
  10. package/dist/__tests__/base-transport-cov.test.d.ts.map +1 -0
  11. package/dist/__tests__/base-transport.test.d.ts +2 -0
  12. package/dist/__tests__/base-transport.test.d.ts.map +1 -0
  13. package/dist/__tests__/config-loader.test.d.ts +2 -0
  14. package/dist/__tests__/config-loader.test.d.ts.map +1 -0
  15. package/dist/__tests__/connection-pool-cov.test.d.ts +2 -0
  16. package/dist/__tests__/connection-pool-cov.test.d.ts.map +1 -0
  17. package/dist/__tests__/connection-pool.test.d.ts +2 -0
  18. package/dist/__tests__/connection-pool.test.d.ts.map +1 -0
  19. package/dist/__tests__/container.test.d.ts +2 -0
  20. package/dist/__tests__/container.test.d.ts.map +1 -0
  21. package/dist/__tests__/crud.test.d.ts +2 -0
  22. package/dist/__tests__/crud.test.d.ts.map +1 -0
  23. package/dist/__tests__/discovery-cache.test.d.ts +2 -0
  24. package/dist/__tests__/discovery-cache.test.d.ts.map +1 -0
  25. package/dist/__tests__/errors.test.d.ts +2 -0
  26. package/dist/__tests__/errors.test.d.ts.map +1 -0
  27. package/dist/__tests__/factories.test.d.ts +2 -0
  28. package/dist/__tests__/factories.test.d.ts.map +1 -0
  29. package/dist/__tests__/health-checker-cov.test.d.ts +2 -0
  30. package/dist/__tests__/health-checker-cov.test.d.ts.map +1 -0
  31. package/dist/__tests__/health-checker.test.d.ts +2 -0
  32. package/dist/__tests__/health-checker.test.d.ts.map +1 -0
  33. package/dist/__tests__/helpers/factories.d.ts +36 -0
  34. package/dist/__tests__/helpers/factories.d.ts.map +1 -0
  35. package/dist/__tests__/helpers/index.d.ts +3 -0
  36. package/dist/__tests__/helpers/index.d.ts.map +1 -0
  37. package/dist/__tests__/helpers/timers.d.ts +4 -0
  38. package/dist/__tests__/helpers/timers.d.ts.map +1 -0
  39. package/dist/__tests__/history-manager.test.d.ts +2 -0
  40. package/dist/__tests__/history-manager.test.d.ts.map +1 -0
  41. package/dist/__tests__/http-helpers-cov.test.d.ts +2 -0
  42. package/dist/__tests__/http-helpers-cov.test.d.ts.map +1 -0
  43. package/dist/__tests__/http-transport-cov.test.d.ts +2 -0
  44. package/dist/__tests__/http-transport-cov.test.d.ts.map +1 -0
  45. package/dist/__tests__/http-transport.test.d.ts +2 -0
  46. package/dist/__tests__/http-transport.test.d.ts.map +1 -0
  47. package/dist/__tests__/input-normalizer.test.d.ts +8 -0
  48. package/dist/__tests__/input-normalizer.test.d.ts.map +1 -0
  49. package/dist/__tests__/integration.test.d.ts +2 -0
  50. package/dist/__tests__/integration.test.d.ts.map +1 -0
  51. package/dist/__tests__/lib-server.test.d.ts +2 -0
  52. package/dist/__tests__/lib-server.test.d.ts.map +1 -0
  53. package/dist/__tests__/memory-persistence.test.d.ts +2 -0
  54. package/dist/__tests__/memory-persistence.test.d.ts.map +1 -0
  55. package/dist/__tests__/metrics-integration.test.d.ts +2 -0
  56. package/dist/__tests__/metrics-integration.test.d.ts.map +1 -0
  57. package/dist/__tests__/persistence.test.d.ts +2 -0
  58. package/dist/__tests__/persistence.test.d.ts.map +1 -0
  59. package/dist/__tests__/reasoning-integration.test.d.ts +11 -0
  60. package/dist/__tests__/reasoning-integration.test.d.ts.map +1 -0
  61. package/dist/__tests__/reasoning-types.test.d.ts +2 -0
  62. package/dist/__tests__/reasoning-types.test.d.ts.map +1 -0
  63. package/dist/__tests__/request-context.test.d.ts +2 -0
  64. package/dist/__tests__/request-context.test.d.ts.map +1 -0
  65. package/dist/__tests__/sanitize.test.d.ts +2 -0
  66. package/dist/__tests__/sanitize.test.d.ts.map +1 -0
  67. package/dist/__tests__/schema.test.d.ts +2 -0
  68. package/dist/__tests__/schema.test.d.ts.map +1 -0
  69. package/dist/__tests__/sequentialthinking-tools.test.d.ts +2 -0
  70. package/dist/__tests__/sequentialthinking-tools.test.d.ts.map +1 -0
  71. package/dist/__tests__/server-config.test.d.ts +2 -0
  72. package/dist/__tests__/server-config.test.d.ts.map +1 -0
  73. package/dist/__tests__/skill-discovery.test.d.ts +2 -0
  74. package/dist/__tests__/skill-discovery.test.d.ts.map +1 -0
  75. package/dist/__tests__/skill-registry.test.d.ts +2 -0
  76. package/dist/__tests__/skill-registry.test.d.ts.map +1 -0
  77. package/dist/__tests__/skill-watcher.test.d.ts +2 -0
  78. package/dist/__tests__/skill-watcher.test.d.ts.map +1 -0
  79. package/dist/__tests__/sqlite-persistence.test.d.ts +2 -0
  80. package/dist/__tests__/sqlite-persistence.test.d.ts.map +1 -0
  81. package/dist/__tests__/sse-transport-cov.test.d.ts +2 -0
  82. package/dist/__tests__/sse-transport-cov.test.d.ts.map +1 -0
  83. package/dist/__tests__/sse-transport.test.d.ts +2 -0
  84. package/dist/__tests__/sse-transport.test.d.ts.map +1 -0
  85. package/dist/__tests__/streamable-http-cov.test.d.ts +2 -0
  86. package/dist/__tests__/streamable-http-cov.test.d.ts.map +1 -0
  87. package/dist/__tests__/streamable-http-transport.test.d.ts +2 -0
  88. package/dist/__tests__/streamable-http-transport.test.d.ts.map +1 -0
  89. package/dist/__tests__/structured-logger.test.d.ts +2 -0
  90. package/dist/__tests__/structured-logger.test.d.ts.map +1 -0
  91. package/dist/__tests__/thought-evaluator.test.d.ts +2 -0
  92. package/dist/__tests__/thought-evaluator.test.d.ts.map +1 -0
  93. package/dist/__tests__/thought-formatter.test.d.ts +2 -0
  94. package/dist/__tests__/thought-formatter.test.d.ts.map +1 -0
  95. package/dist/__tests__/thought-processor.test.d.ts +8 -0
  96. package/dist/__tests__/thought-processor.test.d.ts.map +1 -0
  97. package/dist/__tests__/tool-registry-cov.test.d.ts +2 -0
  98. package/dist/__tests__/tool-registry-cov.test.d.ts.map +1 -0
  99. package/dist/__tests__/tool-registry.test.d.ts +2 -0
  100. package/dist/__tests__/tool-registry.test.d.ts.map +1 -0
  101. package/dist/__tests__/tool-watcher.test.d.ts +2 -0
  102. package/dist/__tests__/tool-watcher.test.d.ts.map +1 -0
  103. package/dist/__tests__/worker-manager-cov.test.d.ts +2 -0
  104. package/dist/__tests__/worker-manager-cov.test.d.ts.map +1 -0
  105. package/dist/__tests__/worker-manager.test.d.ts +2 -0
  106. package/dist/__tests__/worker-manager.test.d.ts.map +1 -0
  107. package/dist/cache/DiscoveryCache.d.ts +269 -0
  108. package/dist/cache/DiscoveryCache.d.ts.map +1 -0
  109. package/dist/cache/DiscoveryCache.js +100 -0
  110. package/dist/cache/DiscoveryCache.js.map +1 -0
  111. package/dist/cli.d.ts +3 -0
  112. package/dist/cli.d.ts.map +1 -0
  113. package/dist/cli.js +114 -0
  114. package/dist/cli.js.map +1 -0
  115. package/dist/cluster/WorkerManager.d.ts +166 -0
  116. package/dist/cluster/WorkerManager.d.ts.map +1 -0
  117. package/dist/cluster/WorkerManager.js +202 -0
  118. package/dist/cluster/WorkerManager.js.map +1 -0
  119. package/dist/cluster/worker.d.ts +11 -0
  120. package/dist/cluster/worker.d.ts.map +1 -0
  121. package/dist/cluster/worker.js +36 -0
  122. package/dist/cluster/worker.js.map +1 -0
  123. package/dist/config/ConfigLoader.d.ts +224 -0
  124. package/dist/config/ConfigLoader.d.ts.map +1 -0
  125. package/dist/config/ConfigLoader.js +85 -0
  126. package/dist/config/ConfigLoader.js.map +1 -0
  127. package/dist/context/RequestContext.d.ts +61 -0
  128. package/dist/context/RequestContext.d.ts.map +1 -0
  129. package/dist/context/RequestContext.js +17 -0
  130. package/dist/context/RequestContext.js.map +1 -0
  131. package/dist/contracts/index.d.ts +10 -0
  132. package/dist/contracts/index.d.ts.map +1 -0
  133. package/dist/contracts/index.js +1 -0
  134. package/dist/contracts/interfaces.d.ts +107 -0
  135. package/dist/contracts/interfaces.d.ts.map +1 -0
  136. package/dist/contracts/interfaces.js +1 -0
  137. package/dist/core/HistoryManager.d.ts +514 -0
  138. package/dist/core/HistoryManager.d.ts.map +1 -0
  139. package/dist/core/HistoryManager.js +331 -0
  140. package/dist/core/HistoryManager.js.map +1 -0
  141. package/dist/core/IHistoryManager.d.ts +100 -0
  142. package/dist/core/IHistoryManager.d.ts.map +1 -0
  143. package/dist/core/IHistoryManager.js +1 -0
  144. package/dist/core/InputNormalizer.d.ts +139 -0
  145. package/dist/core/InputNormalizer.d.ts.map +1 -0
  146. package/dist/core/InputNormalizer.js +101 -0
  147. package/dist/core/InputNormalizer.js.map +1 -0
  148. package/dist/core/ThoughtEvaluator.d.ts +127 -0
  149. package/dist/core/ThoughtEvaluator.d.ts.map +1 -0
  150. package/dist/core/ThoughtEvaluator.js +346 -0
  151. package/dist/core/ThoughtEvaluator.js.map +1 -0
  152. package/dist/core/ThoughtFormatter.d.ts +133 -0
  153. package/dist/core/ThoughtFormatter.d.ts.map +1 -0
  154. package/dist/core/ThoughtFormatter.js +70 -0
  155. package/dist/core/ThoughtFormatter.js.map +1 -0
  156. package/dist/core/ThoughtProcessor.d.ts +218 -0
  157. package/dist/core/ThoughtProcessor.d.ts.map +1 -0
  158. package/dist/core/ThoughtProcessor.js +205 -0
  159. package/dist/core/ThoughtProcessor.js.map +1 -0
  160. package/dist/core/reasoning.d.ts +169 -0
  161. package/dist/core/reasoning.d.ts.map +1 -0
  162. package/dist/core/reasoning.js +1 -0
  163. package/dist/core/step.d.ts +45 -0
  164. package/dist/core/step.d.ts.map +1 -0
  165. package/dist/core/step.js +1 -0
  166. package/dist/core/thought.d.ts +190 -0
  167. package/dist/core/thought.d.ts.map +1 -0
  168. package/dist/core/thought.js +1 -0
  169. package/dist/di/Container.d.ts +226 -0
  170. package/dist/di/Container.d.ts.map +1 -0
  171. package/dist/di/Container.js +96 -0
  172. package/dist/di/Container.js.map +1 -0
  173. package/dist/di/ServiceRegistry.d.ts +32 -0
  174. package/dist/di/ServiceRegistry.d.ts.map +1 -0
  175. package/dist/di/ServiceRegistry.js +1 -0
  176. package/dist/errors.d.ts +482 -0
  177. package/dist/errors.d.ts.map +1 -0
  178. package/dist/errors.js +108 -0
  179. package/dist/errors.js.map +1 -0
  180. package/dist/health/HealthChecker.d.ts +73 -0
  181. package/dist/health/HealthChecker.d.ts.map +1 -0
  182. package/dist/health/HealthChecker.js +69 -0
  183. package/dist/health/HealthChecker.js.map +1 -0
  184. package/dist/index.d.ts +2 -0
  185. package/dist/index.d.ts.map +1 -0
  186. package/dist/index.js +1 -0
  187. package/dist/lib.d.ts +205 -0
  188. package/dist/lib.d.ts.map +1 -0
  189. package/dist/lib.js +219 -0
  190. package/dist/lib.js.map +1 -0
  191. package/dist/logger/NullLogger.d.ts +154 -0
  192. package/dist/logger/NullLogger.d.ts.map +1 -0
  193. package/dist/logger/NullLogger.js +24 -0
  194. package/dist/logger/NullLogger.js.map +1 -0
  195. package/dist/logger/StructuredLogger.d.ts +327 -0
  196. package/dist/logger/StructuredLogger.d.ts.map +1 -0
  197. package/dist/logger/StructuredLogger.js +72 -0
  198. package/dist/logger/StructuredLogger.js.map +1 -0
  199. package/dist/metrics/__tests__/metrics.test.d.ts +2 -0
  200. package/dist/metrics/__tests__/metrics.test.d.ts.map +1 -0
  201. package/dist/metrics/metrics.impl.d.ts +252 -0
  202. package/dist/metrics/metrics.impl.d.ts.map +1 -0
  203. package/dist/metrics/metrics.impl.js +197 -0
  204. package/dist/metrics/metrics.impl.js.map +1 -0
  205. package/dist/persistence/FilePersistence.d.ts +66 -0
  206. package/dist/persistence/FilePersistence.d.ts.map +1 -0
  207. package/dist/persistence/FilePersistence.js +132 -0
  208. package/dist/persistence/FilePersistence.js.map +1 -0
  209. package/dist/persistence/MemoryPersistence.d.ts +68 -0
  210. package/dist/persistence/MemoryPersistence.d.ts.map +1 -0
  211. package/dist/persistence/MemoryPersistence.js +51 -0
  212. package/dist/persistence/MemoryPersistence.js.map +1 -0
  213. package/dist/persistence/PersistenceBackend.d.ts +69 -0
  214. package/dist/persistence/PersistenceBackend.d.ts.map +1 -0
  215. package/dist/persistence/PersistenceBackend.js +1 -0
  216. package/dist/persistence/PersistenceFactory.d.ts +21 -0
  217. package/dist/persistence/PersistenceFactory.d.ts.map +1 -0
  218. package/dist/persistence/PersistenceFactory.js +25 -0
  219. package/dist/persistence/PersistenceFactory.js.map +1 -0
  220. package/dist/persistence/SqlitePersistence.d.ts +60 -0
  221. package/dist/persistence/SqlitePersistence.d.ts.map +1 -0
  222. package/dist/persistence/SqlitePersistence.js +136 -0
  223. package/dist/persistence/SqlitePersistence.js.map +1 -0
  224. package/dist/pool/ConnectionPool.d.ts +215 -0
  225. package/dist/pool/ConnectionPool.d.ts.map +1 -0
  226. package/dist/pool/ConnectionPool.js +187 -0
  227. package/dist/pool/ConnectionPool.js.map +1 -0
  228. package/dist/registry/BaseRegistry.d.ts +203 -0
  229. package/dist/registry/BaseRegistry.d.ts.map +1 -0
  230. package/dist/registry/BaseRegistry.js +165 -0
  231. package/dist/registry/BaseRegistry.js.map +1 -0
  232. package/dist/registry/SkillRegistry.d.ts +69 -0
  233. package/dist/registry/SkillRegistry.d.ts.map +1 -0
  234. package/dist/registry/SkillRegistry.js +88 -0
  235. package/dist/registry/SkillRegistry.js.map +1 -0
  236. package/dist/registry/ToolRegistry.d.ts +69 -0
  237. package/dist/registry/ToolRegistry.d.ts.map +1 -0
  238. package/dist/registry/ToolRegistry.js +93 -0
  239. package/dist/registry/ToolRegistry.js.map +1 -0
  240. package/dist/sanitize.d.ts +63 -0
  241. package/dist/sanitize.d.ts.map +1 -0
  242. package/dist/sanitize.js +14 -0
  243. package/dist/sanitize.js.map +1 -0
  244. package/dist/schema.d.ts +531 -0
  245. package/dist/schema.d.ts.map +1 -0
  246. package/dist/schema.js +204 -0
  247. package/dist/schema.js.map +1 -0
  248. package/dist/telemetry/Telemetry.d.ts +36 -0
  249. package/dist/telemetry/Telemetry.d.ts.map +1 -0
  250. package/dist/telemetry/Telemetry.js +68 -0
  251. package/dist/telemetry/Telemetry.js.map +1 -0
  252. package/dist/telemetry/__tests__/Telemetry.test.d.ts +2 -0
  253. package/dist/telemetry/__tests__/Telemetry.test.d.ts.map +1 -0
  254. package/dist/transport/BaseTransport.d.ts +184 -0
  255. package/dist/transport/BaseTransport.d.ts.map +1 -0
  256. package/dist/transport/BaseTransport.js +200 -0
  257. package/dist/transport/BaseTransport.js.map +1 -0
  258. package/dist/transport/HttpHelpers.d.ts +60 -0
  259. package/dist/transport/HttpHelpers.d.ts.map +1 -0
  260. package/dist/transport/HttpHelpers.js +50 -0
  261. package/dist/transport/HttpHelpers.js.map +1 -0
  262. package/dist/transport/HttpTransport.d.ts +134 -0
  263. package/dist/transport/HttpTransport.d.ts.map +1 -0
  264. package/dist/transport/HttpTransport.js +175 -0
  265. package/dist/transport/HttpTransport.js.map +1 -0
  266. package/dist/transport/SseTransport.d.ts +133 -0
  267. package/dist/transport/SseTransport.d.ts.map +1 -0
  268. package/dist/transport/SseTransport.js +318 -0
  269. package/dist/transport/SseTransport.js.map +1 -0
  270. package/dist/transport/StreamableHttpTransport.d.ts +224 -0
  271. package/dist/transport/StreamableHttpTransport.d.ts.map +1 -0
  272. package/dist/transport/StreamableHttpTransport.js +407 -0
  273. package/dist/transport/StreamableHttpTransport.js.map +1 -0
  274. package/dist/types/disposable.d.ts +22 -0
  275. package/dist/types/disposable.d.ts.map +1 -0
  276. package/dist/types/disposable.js +1 -0
  277. package/dist/types/server-config.d.ts +32 -0
  278. package/dist/types/server-config.d.ts.map +1 -0
  279. package/dist/types/server-config.js +1 -0
  280. package/dist/types/skill.d.ts +69 -0
  281. package/dist/types/skill.d.ts.map +1 -0
  282. package/dist/types/skill.js +1 -0
  283. package/dist/types/tool.d.ts +68 -0
  284. package/dist/types/tool.d.ts.map +1 -0
  285. package/dist/types/tool.js +1 -0
  286. package/dist/watchers/SkillWatcher.d.ts +132 -0
  287. package/dist/watchers/SkillWatcher.d.ts.map +1 -0
  288. package/dist/watchers/SkillWatcher.js +73 -0
  289. package/dist/watchers/SkillWatcher.js.map +1 -0
  290. package/dist/watchers/ToolWatcher.d.ts +109 -0
  291. package/dist/watchers/ToolWatcher.d.ts.map +1 -0
  292. package/dist/watchers/ToolWatcher.js +71 -0
  293. package/dist/watchers/ToolWatcher.js.map +1 -0
  294. package/package.json +95 -0
package/LICENSE ADDED
@@ -0,0 +1,24 @@
1
+ This is free and unencumbered software released into the public domain.
2
+
3
+ Anyone is free to copy, modify, publish, use, compile, sell, or
4
+ distribute this software, either in source code form or as a compiled
5
+ binary, for any purpose, commercial or non-commercial, and by any
6
+ means.
7
+
8
+ In jurisdictions that recognize copyright laws, the author or authors
9
+ of this software dedicate any and all copyright interest in the
10
+ software to the public domain. We make this dedication for the benefit
11
+ of the public at large and to the detriment of our heirs and
12
+ successors. We intend this dedication to be an overt act of
13
+ relinquishment in perpetuity of all present and future rights to this
14
+ software under copyright law.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
19
+ IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
20
+ OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
21
+ ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22
+ OTHER DEALINGS IN THE SOFTWARE.
23
+
24
+ For more information, please refer to <https://unlicense.org>
package/README.md ADDED
@@ -0,0 +1,112 @@
1
+ # MCP Sequential Thinking Server
2
+
3
+ An MCP (Model Context Protocol) server that provides sequential thinking capabilities with intelligent tool and skill recommendations for AI assistants.
4
+
5
+ ## Features
6
+
7
+ - **Sequential Thinking Framework**: Break down complex problems into structured thought steps
8
+ - **Tool Recommendations**: AI-driven tool selection with confidence scores and rationales
9
+ - **Skill Integration**: Support for Claude Code skills with automatic discovery
10
+ - **Branching & Revision**: Non-linear thinking paths with thought revision support
11
+ - **History Management**: Configurable thought history with automatic trimming
12
+ - **Type-Safe**: Full TypeScript support with Valibot validation
13
+
14
+ ## Install
15
+
16
+ Requires [Node.js](https://nodejs.org/) v18+.
17
+
18
+ From the project root:
19
+
20
+ ```
21
+ > **Tip:** Use `./install.sh --link` for development mode (symlinks instead of copying, rebuild with `npm run build` after changes).
22
+
23
+ ## Configure MCP Client
24
+
25
+ The server uses **stdio transport** by default — no extra configuration needed. Add it to your MCP client:
26
+
27
+ ### Claude Code
28
+
29
+ **User-scoped** (`~/.claude.json`) or **project-scoped** (`.mcp.json` in project root):
30
+
31
+ ```json
32
+ {
33
+ "mcpServers": {
34
+ "tracelattice": {
35
+ "command": "tracelattice"
36
+ }
37
+ }
38
+ }
39
+ ```
40
+
41
+ Or via CLI:
42
+
43
+ ```bash
44
+ claude mcp add tracelattice -- tracelattice
45
+ ```
46
+
47
+ ### Codex CLI
48
+
49
+ **User-scoped** (`~/.codex/config.toml`) or **project-scoped** (`.codex/config.toml`):
50
+
51
+ ```toml
52
+ [mcp_servers.tracelattice]
53
+ command = "tracelattice"
54
+ ```
55
+
56
+ Or via CLI:
57
+
58
+ ```bash
59
+ codex mcp add tracelattice -- tracelattice
60
+ ```
61
+
62
+ ### OpenCode
63
+
64
+ **Global** (`~/.config/opencode/opencode.json`) or **project-scoped** (`.opencode.json`):
65
+
66
+ ```json
67
+ {
68
+ "mcpServers": {
69
+ "tracelattice": {
70
+ "type": "local",
71
+ "command": [
72
+ "npx",
73
+ "-y",
74
+ "tracelattice"
75
+ ],
76
+ "enabled": true,
77
+ "environment": {
78
+ "MAX_HISTORY_SIZE": "10000"
79
+ }
80
+ },
81
+ }
82
+ }
83
+ ```
84
+
85
+ ## Configuration
86
+
87
+ | Variable | Default | Description |
88
+ |----------|---------|-------------|
89
+ | `MAX_HISTORY_SIZE` | `1000` | Maximum thoughts to keep in history |
90
+
91
+ ## Transports
92
+
93
+ The server supports three transports via the `TRANSPORT_TYPE` environment variable:
94
+
95
+ | Transport | Use Case | Command |
96
+ |-----------|----------|---------|
97
+ | `stdio` (default) | Local MCP clients | `tracelattice` |
98
+ | `sse` (legacy) | Multi-user, backwards compat | `TRANSPORT_TYPE=sse tracelattice` |
99
+ | `streamable-http` | Production deployments | `TRANSPORT_TYPE=streamable-http tracelattice` |
100
+ ## Development
101
+
102
+ ```bash
103
+ npm install
104
+ npm run dev # MCP inspector
105
+ npm test
106
+ npm run type-check
107
+ npm run lint
108
+ ```
109
+
110
+ ## License
111
+
112
+ MIT
@@ -0,0 +1,229 @@
1
+ /**
2
+ * Server configuration management with validation.
3
+ *
4
+ * This module provides the `ServerConfig` class which handles all server configuration
5
+ * with built-in validation and sensible defaults. Configuration values are validated
6
+ * on construction and warnings are emitted for out-of-range values.
7
+ *
8
+ * @module ServerConfig
9
+ */
10
+ import type { PersistenceConfig } from './persistence/PersistenceBackend.js';
11
+ /**
12
+ * Configuration options for creating a `ServerConfig` instance.
13
+ *
14
+ * All properties are optional with sensible defaults applied during validation.
15
+ *
16
+ * @example
17
+ * ```typescript
18
+ * const options: ServerConfigOptions = {
19
+ * maxHistorySize: 500,
20
+ * maxBranches: 25,
21
+ * skillDirs: ['./custom-skills'],
22
+ * persistence: { enabled: true, backend: 'sqlite' }
23
+ * };
24
+ * ```
25
+ */
26
+ export interface ServerConfigOptions {
27
+ /**
28
+ * Maximum number of thoughts to keep in history.
29
+ * @default 1000
30
+ */
31
+ maxHistorySize?: number;
32
+ /**
33
+ * Maximum number of branches to maintain.
34
+ * @default 50
35
+ */
36
+ maxBranches?: number;
37
+ /**
38
+ * Maximum size of each branch.
39
+ * @default 100
40
+ */
41
+ maxBranchSize?: number;
42
+ /**
43
+ * Directory paths to search for skills.
44
+ * @default ['.claude/skills', '~/.claude/skills']
45
+ */
46
+ skillDirs?: string[];
47
+ /**
48
+ * Discovery cache configuration.
49
+ */
50
+ discoveryCache?: {
51
+ /**
52
+ * Time-to-live for cache entries in milliseconds.
53
+ * @default 300000 (5 minutes)
54
+ */
55
+ ttl?: number;
56
+ /**
57
+ * Maximum number of entries in the cache.
58
+ * @default 100
59
+ */
60
+ maxSize?: number;
61
+ };
62
+ /**
63
+ * Persistence configuration for storing history and state.
64
+ */
65
+ persistence?: PersistenceConfig;
66
+ /**
67
+ * Maximum number of thoughts to buffer before flushing to persistence.
68
+ * @default 100
69
+ */
70
+ persistenceBufferSize?: number;
71
+ /**
72
+ * Interval in milliseconds between periodic persistence flushes.
73
+ * @default 1000
74
+ */
75
+ persistenceFlushInterval?: number;
76
+ /**
77
+ * Maximum number of retries for failed persistence flushes.
78
+ * @default 3
79
+ */
80
+ persistenceMaxRetries?: number;
81
+ }
82
+ /**
83
+ * Server configuration with validation and defaults.
84
+ *
85
+ * This class manages all server configuration including history limits,
86
+ * branch limits, skill directories, discovery cache settings, and persistence.
87
+ * All values are validated on construction with appropriate defaults applied.
88
+ *
89
+ * @remarks
90
+ * - Values outside recommended ranges trigger warnings but are still applied
91
+ * - Environment variables override file-based configuration
92
+ * - The `toJSON()` method provides a plain object representation
93
+ *
94
+ * @example
95
+ * ```typescript
96
+ * // Using defaults
97
+ * const config1 = new ServerConfig();
98
+ * console.log(config1.maxHistorySize); // 1000
99
+ *
100
+ * // With custom options
101
+ * const config2 = new ServerConfig({
102
+ * maxHistorySize: 500,
103
+ * persistence: { enabled: true, backend: 'file', options: { dataDir: './data' } }
104
+ * });
105
+ *
106
+ * // Export as plain object
107
+ * const json = config2.toJSON();
108
+ * ```
109
+ */
110
+ export declare class ServerConfig {
111
+ /** Maximum number of thoughts to keep in history. */
112
+ maxHistorySize: number;
113
+ /** Maximum number of branches to maintain. */
114
+ maxBranches: number;
115
+ /** Maximum size of each branch. */
116
+ maxBranchSize: number;
117
+ /** Directory paths to search for skills. */
118
+ skillDirs: string[];
119
+ /** Discovery cache configuration. */
120
+ discoveryCache: {
121
+ ttl: number;
122
+ maxSize: number;
123
+ };
124
+ /** Persistence configuration. */
125
+ persistence: PersistenceConfig;
126
+ /** Maximum number of thoughts to buffer before flushing to persistence. */
127
+ persistenceBufferSize: number;
128
+ /** Interval in milliseconds between periodic persistence flushes. */
129
+ persistenceFlushInterval: number;
130
+ /** Maximum number of retries for failed persistence flushes. */
131
+ persistenceMaxRetries: number;
132
+ /**
133
+ * Creates a new ServerConfig instance with validation.
134
+ *
135
+ * All values are validated and defaults are applied for undefined options.
136
+ * Warnings are emitted to console for values outside recommended ranges.
137
+ *
138
+ * @param options - Optional configuration overrides
139
+ *
140
+ * @example
141
+ * ```typescript
142
+ * const config = new ServerConfig({
143
+ * maxHistorySize: 500,
144
+ * skillDirs: ['./my-skills']
145
+ * });
146
+ * ```
147
+ */
148
+ constructor(options?: ServerConfigOptions);
149
+ /**
150
+ * Validates the max history size value.
151
+ * @param value - The value to validate
152
+ * @returns The validated value or default (1000)
153
+ * @private
154
+ */
155
+ private validateMaxHistorySize;
156
+ /**
157
+ * Validates the max branches value.
158
+ * @param value - The value to validate
159
+ * @returns The validated value or default (50)
160
+ * @private
161
+ */
162
+ private validateMaxBranches;
163
+ /**
164
+ * Validates the max branch size value.
165
+ * @param value - The value to validate
166
+ * @returns The validated value or default (100)
167
+ * @private
168
+ */
169
+ private validateMaxBranchSize;
170
+ /**
171
+ * Validates the skill directories value.
172
+ * @param value - The value to validate
173
+ * @returns The validated value or default ['.claude/skills', '~/.claude/skills']
174
+ * @private
175
+ */
176
+ private validateSkillDirs;
177
+ /**
178
+ * Validates the discovery cache configuration.
179
+ * @param value - The value to validate
180
+ * @returns The validated value with defaults applied
181
+ * @private
182
+ */
183
+ private validateDiscoveryCache;
184
+ /**
185
+ * Validates the persistence configuration.
186
+ * @param value - The value to validate
187
+ * @returns The validated value with defaults applied
188
+ * @private
189
+ */
190
+ private validatePersistence;
191
+ /**
192
+ * Validates the persistence buffer size value.
193
+ * @param value - The value to validate
194
+ * @returns The validated value or default (100)
195
+ * @private
196
+ */
197
+ private validatePersistenceBufferSize;
198
+ /**
199
+ * Validates the persistence flush interval value.
200
+ * @param value - The value to validate
201
+ * @returns The validated value or default (1000)
202
+ * @private
203
+ */
204
+ private validatePersistenceFlushInterval;
205
+ /**
206
+ * Validates the persistence max retries value.
207
+ * @param value - The value to validate
208
+ * @returns The validated value or default (3)
209
+ * @private
210
+ */
211
+ private validatePersistenceMaxRetries;
212
+ /**
213
+ * Converts the configuration to a plain object.
214
+ *
215
+ * Useful for serialization, logging, or when a plain object representation
216
+ * is preferred over the ServerConfig instance.
217
+ *
218
+ * @returns A plain object representation of the configuration
219
+ *
220
+ * @example
221
+ * ```typescript
222
+ * const config = new ServerConfig({ maxHistorySize: 500 });
223
+ * const json = config.toJSON();
224
+ * console.log(JSON.stringify(json, null, 2));
225
+ * ```
226
+ */
227
+ toJSON(): ServerConfigOptions;
228
+ }
229
+ //# sourceMappingURL=ServerConfig.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ServerConfig.d.ts","sourceRoot":"","sources":["../src/ServerConfig.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAKH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,qCAAqC,CAAC;AAE7E;;;;;;;;;;;;;;GAcG;AACH,MAAM,WAAW,mBAAmB;IACnC;;;OAGG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IAExB;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IAEvB;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;IAErB;;OAEG;IACH,cAAc,CAAC,EAAE;QAChB;;;WAGG;QACH,GAAG,CAAC,EAAE,MAAM,CAAC;QACb;;;WAGG;QACH,OA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AAO,CAAC,6BAA6B;IAerC;;;;;;;;;;;;;;OAcG;IACI,MAAM,IAAI,mBAAmB;CAapC"}
@@ -0,0 +1,121 @@
1
+ import { homedir } from "node:os";
2
+ import { join } from "node:path";
3
+ import { ConfigurationError } from "./errors.js";
4
+ class ServerConfig {
5
+ maxHistorySize;
6
+ maxBranches;
7
+ maxBranchSize;
8
+ skillDirs;
9
+ discoveryCache;
10
+ persistence;
11
+ persistenceBufferSize;
12
+ persistenceFlushInterval;
13
+ persistenceMaxRetries;
14
+ constructor(options = {}){
15
+ this.maxHistorySize = this.validateMaxHistorySize(options.maxHistorySize);
16
+ this.maxBranches = this.validateMaxBranches(options.maxBranches);
17
+ this.maxBranchSize = this.validateMaxBranchSize(options.maxBranchSize);
18
+ this.skillDirs = this.validateSkillDirs(options.skillDirs);
19
+ this.discoveryCache = this.validateDiscoveryCache(options.discoveryCache);
20
+ this.persistence = this.validatePersistence(options.persistence);
21
+ this.persistenceBufferSize = this.validatePersistenceBufferSize(options.persistenceBufferSize);
22
+ this.persistenceFlushInterval = this.validatePersistenceFlushInterval(options.persistenceFlushInterval);
23
+ this.persistenceMaxRetries = this.validatePersistenceMaxRetries(options.persistenceMaxRetries);
24
+ }
25
+ validateMaxHistorySize(value) {
26
+ const defaultValue = 1000;
27
+ if (null == value) return defaultValue;
28
+ if ('number' != typeof value || !Number.isFinite(value)) throw new ConfigurationError(`maxHistorySize must be a finite number, got ${value}`);
29
+ if (value < 1) throw new ConfigurationError(`maxHistorySize must be at least 1, got ${value}`);
30
+ if (value > 10000) throw new ConfigurationError(`maxHistorySize must not exceed 10000, got ${value}`);
31
+ return value;
32
+ }
33
+ validateMaxBranches(value) {
34
+ const defaultValue = 50;
35
+ if (null == value) return defaultValue;
36
+ if ('number' != typeof value || !Number.isFinite(value)) throw new ConfigurationError(`maxBranches must be a finite number, got ${value}`);
37
+ if (value < 0) throw new ConfigurationError(`maxBranches must be non-negative, got ${value}`);
38
+ if (value > 1000) throw new ConfigurationError(`maxBranches must not exceed 1000, got ${value}`);
39
+ return value;
40
+ }
41
+ validateMaxBranchSize(value) {
42
+ const defaultValue = 100;
43
+ if (null == value) return defaultValue;
44
+ if ('number' != typeof value || !Number.isFinite(value)) throw new ConfigurationError(`maxBranchSize must be a finite number, got ${value}`);
45
+ if (value < 1) throw new ConfigurationError(`maxBranchSize must be at least 1, got ${value}`);
46
+ if (value > 1000) throw new ConfigurationError(`maxBranchSize must not exceed 1000, got ${value}`);
47
+ return value;
48
+ }
49
+ validateSkillDirs(value) {
50
+ const defaultValue = [
51
+ '.claude/skills',
52
+ join(homedir(), '.claude/skills')
53
+ ];
54
+ if (!value) return defaultValue;
55
+ return value;
56
+ }
57
+ validateDiscoveryCache(value) {
58
+ return {
59
+ ttl: value?.ttl ?? 300000,
60
+ maxSize: value?.maxSize ?? 100
61
+ };
62
+ }
63
+ validatePersistence(value) {
64
+ if (!value) return {
65
+ enabled: false,
66
+ backend: 'memory'
67
+ };
68
+ const validBackends = [
69
+ 'file',
70
+ 'sqlite',
71
+ 'memory'
72
+ ];
73
+ const backend = value.backend ?? 'memory';
74
+ if (!validBackends.includes(backend)) throw new ConfigurationError(`persistence.backend must be one of ${validBackends.join(', ')}, got ${backend}`);
75
+ return {
76
+ enabled: value.enabled ?? false,
77
+ backend,
78
+ options: value.options ?? {}
79
+ };
80
+ }
81
+ validatePersistenceBufferSize(value) {
82
+ const defaultValue = 100;
83
+ if (null == value) return defaultValue;
84
+ if ('number' != typeof value || !Number.isFinite(value)) throw new ConfigurationError(`persistenceBufferSize must be a finite number, got ${value}`);
85
+ if (value < 1) throw new ConfigurationError(`persistenceBufferSize must be at least 1, got ${value}`);
86
+ if (value > 10000) throw new ConfigurationError(`persistenceBufferSize must not exceed 10000, got ${value}`);
87
+ return value;
88
+ }
89
+ validatePersistenceFlushInterval(value) {
90
+ const defaultValue = 1000;
91
+ if (null == value) return defaultValue;
92
+ if ('number' != typeof value || !Number.isFinite(value)) throw new ConfigurationError(`persistenceFlushInterval must be a finite number, got ${value}`);
93
+ if (value < 100) throw new ConfigurationError(`persistenceFlushInterval must be at least 100, got ${value}`);
94
+ if (value > 60000) throw new ConfigurationError(`persistenceFlushInterval must not exceed 60000, got ${value}`);
95
+ return value;
96
+ }
97
+ validatePersistenceMaxRetries(value) {
98
+ const defaultValue = 3;
99
+ if (null == value) return defaultValue;
100
+ if ('number' != typeof value || !Number.isFinite(value)) throw new ConfigurationError(`persistenceMaxRetries must be a finite number, got ${value}`);
101
+ if (value < 0) throw new ConfigurationError(`persistenceMaxRetries must be non-negative, got ${value}`);
102
+ if (value > 10) throw new ConfigurationError(`persistenceMaxRetries must not exceed 10, got ${value}`);
103
+ return value;
104
+ }
105
+ toJSON() {
106
+ return {
107
+ maxHistorySize: this.maxHistorySize,
108
+ maxBranches: this.maxBranches,
109
+ maxBranchSize: this.maxBranchSize,
110
+ skillDirs: this.skillDirs,
111
+ discoveryCache: this.discoveryCache,
112
+ persistence: this.persistence,
113
+ persistenceBufferSize: this.persistenceBufferSize,
114
+ persistenceFlushInterval: this.persistenceFlushInterval,
115
+ persistenceMaxRetries: this.persistenceMaxRetries
116
+ };
117
+ }
118
+ }
119
+ export { ServerConfig };
120
+
121
+ //# sourceMappingURL=ServerConfig.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ServerConfig.js","sources":["../src/ServerConfig.ts"],"sourcesContent":["/**\n * Server configuration management with validation.\n *\n * This module provides the `ServerConfig` class which handles all server configuration\n * with built-in validation and sensible defaults. Configuration values are validated\n * on construction and warnings are emitted for out-of-range values.\n *\n * @module ServerConfig\n */\n\nimport { homedir } from 'node:os';\nimport { join } from 'node:path';\nimport { ConfigurationError } from './errors.js';\nimport type { PersistenceConfig } from './persistence/PersistenceBackend.js';\n\n/**\n * Configuration options for creating a `ServerConfig` instance.\n *\n * All properties are optional with sensible defaults applied during validation.\n *\n * @example\n * ```typescript\n * const options: ServerConfigOptions = {\n * maxHistorySize: 500,\n * maxBranches: 25,\n * skillDirs: ['./custom-skills'],\n * persistence: { enabled: true, backend: 'sqlite' }\n * };\n * ```\n */\nexport interface ServerConfigOptions {\n\t/**\n\t * Maximum number of thoughts to keep in history.\n\t * @default 1000\n\t */\n\tmaxHistorySize?: number;\n\n\t/**\n\t * Maximum number of branches to maintain.\n\t * @default 50\n\t */\n\tmaxBranches?: number;\n\n\t/**\n\t * Maximum size of each branch.\n\t * @default 100\n\t */\n\tmaxBranchSize?: number;\n\n\t/**\n\t * Directory paths to search for skills.\n\t * @default ['.claude/skills', '~/.claude/skills']\n\t */\n\tskillDirs?: string[];\n\n\t/**\n\t * Discovery cache configuration.\n\t */\n\tdiscoveryCache?: {\n\t\t/**\n\t\t * Time-to-live for cache entries in milliseconds.\n\t\t * @default 300000 (5 minutes)\n\t\t */\n\t\tttl?: number;\n\t\t/**\n\t\t * Maximum number of entries in the cache.\n\t\t * @default 100\n\t\t */\n\t\tmaxSize?: number;\n\t};\n\n\t/**\n\t * Persistence configuration for storing history and state.\n\t */\n\tpersistence?: PersistenceConfig;\n\n\t/**\n\t * Maximum number of thoughts to buffer before flushing to persistence.\n\t * @default 100\n\t */\n\tpersistenceBufferSize?: number;\n\n\t/**\n\t * Interval in milliseconds between periodic persistence flushes.\n\t * @default 1000\n\t */\n\tpersistenceFlushInterval?: number;\n\n\t/**\n\t * Maximum number of retries for failed persistence flushes.\n\t * @default 3\n\t */\n\tpersistenceMaxRetries?: number;\n}\n\n/**\n * Server configuration with validation and defaults.\n *\n * This class manages all server configuration including history limits,\n * branch limits, skill directories, discovery cache settings, and persistence.\n * All values are validated on construction with appropriate defaults applied.\n *\n * @remarks\n * - Values outside recommended ranges trigger warnings but are still applied\n * - Environment variables override file-based configuration\n * - The `toJSON()` method provides a plain object representation\n *\n * @example\n * ```typescript\n * // Using defaults\n * const config1 = new ServerConfig();\n * console.log(config1.maxHistorySize); // 1000\n *\n * // With custom options\n * const config2 = new ServerConfig({\n * maxHistorySize: 500,\n * persistence: { enabled: true, backend: 'file', options: { dataDir: './data' } }\n * });\n *\n * // Export as plain object\n * const json = config2.toJSON();\n * ```\n */\nexport class ServerConfig {\n\t/** Maximum number of thoughts to keep in history. */\n\tpublic maxHistorySize: number;\n\n\t/** Maximum number of branches to maintain. */\n\tpublic maxBranches: number;\n\n\t/** Maximum size of each branch. */\n\tpublic maxBranchSize: number;\n\n\t/** Directory paths to search for skills. */\n\tpublic skillDirs: string[];\n\n\t/** Discovery cache configuration. */\n\tpublic discoveryCache: { ttl: number; maxSize: number };\n\n\t/** Persistence configuration. */\n\tpublic persistence: PersistenceConfig;\n\n\t/** Maximum number of thoughts to buffer before flushing to persistence. */\n\tpublic persistenceBufferSize: number;\n\n\t/** Interval in milliseconds between periodic persistence flushes. */\n\tpublic persistenceFlushInterval: number;\n\n\t/** Maximum number of retries for failed persistence flushes. */\n\tpublic persistenceMaxRetries: number;\n\n\t/**\n\t * Creates a new ServerConfig instance with validation.\n\t *\n\t * All values are validated and defaults are applied for undefined options.\n\t * Warnings are emitted to console for values outside recommended ranges.\n\t *\n\t * @param options - Optional configuration overrides\n\t *\n\t * @example\n\t * ```typescript\n\t * const config = new ServerConfig({\n\t * maxHistorySize: 500,\n\t * skillDirs: ['./my-skills']\n\t * });\n\t * ```\n\t */\n\tconstructor(options: ServerConfigOptions = {}) {\n\t\tthis.maxHistorySize = this.validateMaxHistorySize(options.maxHistorySize);\n\t\tthis.maxBranches = this.validateMaxBranches(options.maxBranches);\n\t\tthis.maxBranchSize = this.validateMaxBranchSize(options.maxBranchSize);\n\t\tthis.skillDirs = this.validateSkillDirs(options.skillDirs);\n\t\tthis.discoveryCache = this.validateDiscoveryCache(options.discoveryCache);\n\t\tthis.persistence = this.validatePersistence(options.persistence);\n\t\tthis.persistenceBufferSize = this.validatePersistenceBufferSize(options.persistenceBufferSize);\n\t\tthis.persistenceFlushInterval = this.validatePersistenceFlushInterval(\n\t\t\toptions.persistenceFlushInterval\n\t\t);\n\t\tthis.persistenceMaxRetries = this.validatePersistenceMaxRetries(options.persistenceMaxRetries);\n\t}\n\n\t/**\n\t * Validates the max history size value.\n\t * @param value - The value to validate\n\t * @returns The validated value or default (1000)\n\t * @private\n\t */\n\tprivate validateMaxHistorySize(value?: number): number {\n\t\tconst defaultValue = 1000;\n\t\tif (value === undefined || value === null) return defaultValue;\n\t\tif (typeof value !== 'number' || !Number.isFinite(value)) {\n\t\t\tthrow new ConfigurationError(`maxHistorySize must be a finite number, got ${value}`);\n\t\t}\n\t\tif (value < 1) {\n\t\t\tthrow new ConfigurationError(`maxHistorySize must be at least 1, got ${value}`);\n\t\t}\n\t\tif (value > 10000) {\n\t\t\tthrow new ConfigurationError(`maxHistorySize must not exceed 10000, got ${value}`);\n\t\t}\n\t\treturn value;\n\t}\n\n\t/**\n\t * Validates the max branches value.\n\t * @param value - The value to validate\n\t * @returns The validated value or default (50)\n\t * @private\n\t */\n\tprivate validateMaxBranches(value?: number): number {\n\t\tconst defaultValue = 50;\n\t\tif (value === undefined || value === null) return defaultValue;\n\t\tif (typeof value !== 'number' || !Number.isFinite(value)) {\n\t\t\tthrow new ConfigurationError(`maxBranches must be a finite number, got ${value}`);\n\t\t}\n\t\tif (value < 0) {\n\t\t\tthrow new ConfigurationError(`maxBranches must be non-negative, got ${value}`);\n\t\t}\n\t\tif (value > 1000) {\n\t\t\tthrow new ConfigurationError(`maxBranches must not exceed 1000, got ${value}`);\n\t\t}\n\t\treturn value;\n\t}\n\n\t/**\n\t * Validates the max branch size value.\n\t * @param value - The value to validate\n\t * @returns The validated value or default (100)\n\t * @private\n\t */\n\tprivate validateMaxBranchSize(value?: number): number {\n\t\tconst defaultValue = 100;\n\t\tif (value === undefined || value === null) return defaultValue;\n\t\tif (typeof value !== 'number' || !Number.isFinite(value)) {\n\t\t\tthrow new ConfigurationError(`maxBranchSize must be a finite number, got ${value}`);\n\t\t}\n\t\tif (value < 1) {\n\t\t\tthrow new ConfigurationError(`maxBranchSize must be at least 1, got ${value}`);\n\t\t}\n\t\tif (value > 1000) {\n\t\t\tthrow new ConfigurationError(`maxBranchSize must not exceed 1000, got ${value}`);\n\t\t}\n\t\treturn value;\n\t}\n\n\t/**\n\t * Validates the skill directories value.\n\t * @param value - The value to validate\n\t * @returns The validated value or default ['.claude/skills', '~/.claude/skills']\n\t * @private\n\t */\n\tprivate validateSkillDirs(value?: string[]): string[] {\n\t\tconst defaultValue = ['.claude/skills', join(homedir(), '.claude/skills')];\n\t\tif (!value) return defaultValue;\n\t\treturn value;\n\t}\n\n\t/**\n\t * Validates the discovery cache configuration.\n\t * @param value - The value to validate\n\t * @returns The validated value with defaults applied\n\t * @private\n\t */\n\tprivate validateDiscoveryCache(value?: { ttl?: number; maxSize?: number }): {\n\t\tttl: number;\n\t\tmaxSize: number;\n\t} {\n\t\treturn {\n\t\t\tttl: value?.ttl ?? 300000,\n\t\t\tmaxSize: value?.maxSize ?? 100,\n\t\t};\n\t}\n\n\t/**\n\t * Validates the persistence configuration.\n\t * @param value - The value to validate\n\t * @returns The validated value with defaults applied\n\t * @private\n\t */\n\tprivate validatePersistence(value?: PersistenceConfig): PersistenceConfig {\n\t\tif (!value) {\n\t\t\t// Default to in-memory (no actual persistence, just consistency)\n\t\t\treturn {\n\t\t\t\tenabled: false,\n\t\t\t\tbackend: 'memory',\n\t\t\t};\n\t\t}\n\n\t\t// Validate backend type\n\t\tconst validBackends = ['file', 'sqlite', 'memory'];\n\t\tconst backend = value.backend ?? 'memory';\n\t\tif (!validBackends.includes(backend)) {\n\t\t\tthrow new ConfigurationError(\n\t\t\t\t`persistence.backend must be one of ${validBackends.join(', ')}, got ${backend}`\n\t\t\t);\n\t\t}\n\n\t\treturn {\n\t\t\tenabled: value.enabled ?? false,\n\t\t\tbackend,\n\t\t\toptions: value.options ?? {},\n\t\t};\n\t}\n\n\t/**\n\t * Validates the persistence buffer size value.\n\t * @param value - The value to validate\n\t * @returns The validated value or default (100)\n\t * @private\n\t */\n\tprivate validatePersistenceBufferSize(value?: number): number {\n\t\tconst defaultValue = 100;\n\t\tif (value === undefined || value === null) return defaultValue;\n\t\tif (typeof value !== 'number' || !Number.isFinite(value)) {\n\t\t\tthrow new ConfigurationError(`persistenceBufferSize must be a finite number, got ${value}`);\n\t\t}\n\t\tif (value < 1) {\n\t\t\tthrow new ConfigurationError(`persistenceBufferSize must be at least 1, got ${value}`);\n\t\t}\n\t\tif (value > 10000) {\n\t\t\tthrow new ConfigurationError(`persistenceBufferSize must not exceed 10000, got ${value}`);\n\t\t}\n\t\treturn value;\n\t}\n\n\t/**\n\t * Validates the persistence flush interval value.\n\t * @param value - The value to validate\n\t * @returns The validated value or default (1000)\n\t * @private\n\t */\n\tprivate validatePersistenceFlushInterval(value?: number): number {\n\t\tconst defaultValue = 1000;\n\t\tif (value === undefined || value === null) return defaultValue;\n\t\tif (typeof value !== 'number' || !Number.isFinite(value)) {\n\t\t\tthrow new ConfigurationError(\n\t\t\t\t`persistenceFlushInterval must be a finite number, got ${value}`\n\t\t\t);\n\t\t}\n\t\tif (value < 100) {\n\t\t\tthrow new ConfigurationError(`persistenceFlushInterval must be at least 100, got ${value}`);\n\t\t}\n\t\tif (value > 60000) {\n\t\t\tthrow new ConfigurationError(`persistenceFlushInterval must not exceed 60000, got ${value}`);\n\t\t}\n\t\treturn value;\n\t}\n\n\t/**\n\t * Validates the persistence max retries value.\n\t * @param value - The value to validate\n\t * @returns The validated value or default (3)\n\t * @private\n\t */\n\tprivate validatePersistenceMaxRetries(value?: number): number {\n\t\tconst defaultValue = 3;\n\t\tif (value === undefined || value === null) return defaultValue;\n\t\tif (typeof value !== 'number' || !Number.isFinite(value)) {\n\t\t\tthrow new ConfigurationError(`persistenceMaxRetries must be a finite number, got ${value}`);\n\t\t}\n\t\tif (value < 0) {\n\t\t\tthrow new ConfigurationError(`persistenceMaxRetries must be non-negative, got ${value}`);\n\t\t}\n\t\tif (value > 10) {\n\t\t\tthrow new ConfigurationError(`persistenceMaxRetries must not exceed 10, got ${value}`);\n\t\t}\n\t\treturn value;\n\t}\n\n\t/**\n\t * Converts the configuration to a plain object.\n\t *\n\t * Useful for serialization, logging, or when a plain object representation\n\t * is preferred over the ServerConfig instance.\n\t *\n\t * @returns A plain object representation of the configuration\n\t *\n\t * @example\n\t * ```typescript\n\t * const config = new ServerConfig({ maxHistorySize: 500 });\n\t * const json = config.toJSON();\n\t * console.log(JSON.stringify(json, null, 2));\n\t * ```\n\t */\n\tpublic toJSON(): ServerConfigOptions {\n\t\treturn {\n\t\t\tmaxHistorySize: this.maxHistorySize,\n\t\t\tmaxBranches: this.maxBranches,\n\t\t\tmaxBranchSize: this.maxBranchSize,\n\t\t\tskillDirs: this.skillDirs,\n\t\t\tdiscoveryCache: this.discoveryCache,\n\t\t\tpersistence: this.persistence,\n\t\t\tpersistenceBufferSize: this.persistenceBufferSize,\n\t\t\tpersistenceFlushInterval: this.persistenceFlushInterval,\n\t\t\tpersistenceMaxRetries: this.persistenceMaxRetries,\n\t\t};\n\t}\n}\n"],"names":["ServerConfig","options","value","defaultValue","Number","ConfigurationError","join","homedir","validBackends","backend"],"mappings":";;;AA2HO,MAAMA;IAEL,eAAuB;IAGvB,YAAoB;IAGpB,cAAsB;IAGtB,UAAoB;IAGpB,eAAiD;IAGjD,YAA+B;IAG/B,sBAA8B;IAG9B,yBAAiC;IAGjC,sBAA8B;IAkBrC,YAAYC,UAA+B,CAAC,CAAC,CAAE;QAC9C,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,sBAAsB,CAACA,QAAQ,cAAc;QACxE,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,mBAAmB,CAACA,QAAQ,WAAW;QAC/D,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,qBAAqB,CAACA,QAAQ,aAAa;QACrE,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,iBAAiB,CAACA,QAAQ,SAAS;QACzD,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,sBAAsB,CAACA,QAAQ,cAAc;QACxE,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,mBAAmB,CAACA,Q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QAClD,IAAI,AAAiB,YAAjB,OAAOD,SAAsB,CAACE,OAAO,QAAQ,CAACF,QACjD,MAAM,IAAIG,mBACT,CAAC,sDAAsD,EAAEH,OAAO;QAGlE,IAAIA,QAAQ,KACX,MAAM,IAAIG,mBAAmB,CAAC,mDAAmD,EAAEH,OAAO;QAE3F,IAAIA,QAAQ,OACX,MAAM,IAAIG,mBAAmB,CAAC,oDAAoD,EAAEH,OAAO;QAE5F,OAAOA;IACR;IAQQ,8BAA8BA,KAAc,EAAU;QAC7D,MAAMC,eAAe;QACrB,IAAID,QAAAA,OAAuC,OAAOC;QAClD,IAAI,AAAiB,YAAjB,OAAOD,SAAsB,CAACE,OAAO,QAAQ,CAACF,QACjD,MAAM,IAAIG,mBAAmB,CAAC,mDAAmD,EAAEH,OAAO;QAE3F,IAAIA,QAAQ,GACX,MAAM,IAAIG,mBAAmB,CAAC,gDAAgD,EAAEH,OAAO;QAExF,IAAIA,QAAQ,IACX,MAAM,IAAIG,mBAAmB,CAAC,8CAA8C,EAAEH,OAAO;QAEtF,OAAOA;IACR;IAiBO,SAA8B;QACpC,OAAO;YACN,gBAAgB,IAAI,CAAC,cAAc;YACnC,aAAa,IAAI,CAAC,WAAW;YAC7B,eAAe,IAAI,CAAC,aAAa;YACjC,WAAW,IAAI,CAAC,SAAS;YACzB,gBAAgB,IAAI,CAAC,cAAc;YACnC,aAAa,IAAI,CAAC,WAAW;YAC7B,uBAAuB,IAAI,CAAC,qBAAqB;YACjD,0BAA0B,IAAI,CAAC,wBAAwB;YACvD,uBAAuB,IAAI,CAAC,qBAAqB;QAClD;IACD;AACD"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=base-registry.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"base-registry.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/base-registry.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=base-transport-cov.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"base-transport-cov.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/base-transport-cov.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=base-transport.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"base-transport.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/base-transport.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=config-loader.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config-loader.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/config-loader.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=connection-pool-cov.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"connection-pool-cov.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/connection-pool-cov.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=connection-pool.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"connection-pool.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/connection-pool.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=container.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"container.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/container.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=crud.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"crud.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/crud.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=discovery-cache.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"discovery-cache.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/discovery-cache.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=errors.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/errors.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=factories.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"factories.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/factories.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=health-checker-cov.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"health-checker-cov.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/health-checker-cov.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=health-checker.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"health-checker.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/health-checker.test.ts"],"names":[],"mappings":""}