specmem-hardwicksoftware 3.5.99

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 (1473) hide show
  1. package/CHANGELOG.md +299 -0
  2. package/LICENSE.md +6406 -0
  3. package/README.md +539 -0
  4. package/bin/AegisTheme.cjs +1022 -0
  5. package/bin/AnsiRenderer.cjs +1055 -0
  6. package/bin/BoxRenderer.cjs +605 -0
  7. package/bin/ClaudeLiveScreen.cjs +1299 -0
  8. package/bin/DashboardModules.cjs +733 -0
  9. package/bin/LiveScreenCapture.cjs +1012 -0
  10. package/bin/MemoryBrowserScreen.cjs +1595 -0
  11. package/bin/TabManager.cjs +1414 -0
  12. package/bin/checkAgentStatus-fix.patch +30 -0
  13. package/bin/mcp-socket-client.cjs +462 -0
  14. package/bin/screen-utils.cjs +106 -0
  15. package/bin/specmem-autoclaude.cjs +663 -0
  16. package/bin/specmem-cleanup.cjs +421 -0
  17. package/bin/specmem-cli.cjs +794 -0
  18. package/bin/specmem-console-teamcomms-class.cjs +428 -0
  19. package/bin/specmem-console.cjs +8104 -0
  20. package/bin/specmem-statusbar.cjs +530 -0
  21. package/bootstrap.cjs +5065 -0
  22. package/claude-hooks/agent-chooser-hook.js +179 -0
  23. package/claude-hooks/agent-chooser-inject.js +121 -0
  24. package/claude-hooks/agent-loading-hook.js +990 -0
  25. package/claude-hooks/agent-output-fader.cjs +542 -0
  26. package/claude-hooks/agent-output-interceptor.js +193 -0
  27. package/claude-hooks/agent-type-matcher.js +419 -0
  28. package/claude-hooks/auto-bypass.py +74 -0
  29. package/claude-hooks/background-completion-silencer.js +134 -0
  30. package/claude-hooks/bash-auto-background.js +182 -0
  31. package/claude-hooks/build-cedict-dictionary.mjs +167 -0
  32. package/claude-hooks/bullshit-radar.cjs +323 -0
  33. package/claude-hooks/cedict-codes.json +270 -0
  34. package/claude-hooks/cedict-extracted.json +22632 -0
  35. package/claude-hooks/claude-watchdog.sh +401 -0
  36. package/claude-hooks/context-dedup.cjs +144 -0
  37. package/claude-hooks/context-yeeter.cjs +244 -0
  38. package/claude-hooks/debug-suffix.cjs +15 -0
  39. package/claude-hooks/debug2.cjs +7 -0
  40. package/claude-hooks/drilldown-enforcer.js +242 -0
  41. package/claude-hooks/english-morphology-standalone.cjs +149 -0
  42. package/claude-hooks/english-morphology.cjs +152 -0
  43. package/claude-hooks/extract-translations.mjs +193 -0
  44. package/claude-hooks/file-claim-enforcer.cjs +293 -0
  45. package/claude-hooks/file-claim-enforcer.js +293 -0
  46. package/claude-hooks/find-collisions.cjs +39 -0
  47. package/claude-hooks/fix-abbreviations.cjs +60 -0
  48. package/claude-hooks/fix-collisions.cjs +60 -0
  49. package/claude-hooks/fix-decompressor.cjs +79 -0
  50. package/claude-hooks/fix-suffixes.cjs +66 -0
  51. package/claude-hooks/grammar-engine.cjs +159 -0
  52. package/claude-hooks/input-aware-improver.js +231 -0
  53. package/claude-hooks/is-agent.cjs +64 -0
  54. package/claude-hooks/mega-test.cjs +213 -0
  55. package/claude-hooks/merge-dictionaries.mjs +207 -0
  56. package/claude-hooks/merged-codes.cjs +22675 -0
  57. package/claude-hooks/merged-codes.json +22676 -0
  58. package/claude-hooks/output-cleaner.cjs +388 -0
  59. package/claude-hooks/post-write-memory-hook.cjs +430 -0
  60. package/claude-hooks/quick-test.cjs +24 -0
  61. package/claude-hooks/quick-test2.cjs +24 -0
  62. package/claude-hooks/remove-bad-codes.cjs +23 -0
  63. package/claude-hooks/search-reminder-hook.js +90 -0
  64. package/claude-hooks/semantic-test.cjs +93 -0
  65. package/claude-hooks/settings.json +445 -0
  66. package/claude-hooks/smart-context-hook.cjs +547 -0
  67. package/claude-hooks/smart-context-hook.js +539 -0
  68. package/claude-hooks/smart-search-interceptor.js +364 -0
  69. package/claude-hooks/socket-connect-helper.cjs +235 -0
  70. package/claude-hooks/specmem/sockets/session-start.lock +1 -0
  71. package/claude-hooks/specmem-context-hook.cjs +357 -0
  72. package/claude-hooks/specmem-context-hook.js +357 -0
  73. package/claude-hooks/specmem-drilldown-hook.cjs +480 -0
  74. package/claude-hooks/specmem-drilldown-hook.js +480 -0
  75. package/claude-hooks/specmem-drilldown-setter.js +210 -0
  76. package/claude-hooks/specmem-paths.cjs +213 -0
  77. package/claude-hooks/specmem-precompact.js +183 -0
  78. package/claude-hooks/specmem-session-init.sh +33 -0
  79. package/claude-hooks/specmem-session-start.cjs +498 -0
  80. package/claude-hooks/specmem-stop-hook.cjs +73 -0
  81. package/claude-hooks/specmem-stop-hook.js +5 -0
  82. package/claude-hooks/specmem-team-comms.cjs +434 -0
  83. package/claude-hooks/specmem-team-member-inject.js +271 -0
  84. package/claude-hooks/specmem-unified-hook.py +670 -0
  85. package/claude-hooks/subagent-loading-hook.js +194 -0
  86. package/claude-hooks/sysprompt-squisher.cjs +167 -0
  87. package/claude-hooks/task-progress-hook.js +204 -0
  88. package/claude-hooks/team-comms-enforcer.cjs +585 -0
  89. package/claude-hooks/test-accuracy.cjs +27 -0
  90. package/claude-hooks/test-big.cjs +28 -0
  91. package/claude-hooks/test-inflectors.cjs +39 -0
  92. package/claude-hooks/test-pluralize.cjs +37 -0
  93. package/claude-hooks/test-quick.cjs +8 -0
  94. package/claude-hooks/test-wink.cjs +20 -0
  95. package/claude-hooks/token-compressor.cjs +940 -0
  96. package/claude-hooks/use-code-pointers.cjs +279 -0
  97. package/commands/COMMAND_TOOL_MAP.md +299 -0
  98. package/commands/specmem-agents.md +412 -0
  99. package/commands/specmem-autoclaude.md +295 -0
  100. package/commands/specmem-changes.md +247 -0
  101. package/commands/specmem-code.md +103 -0
  102. package/commands/specmem-configteammembercomms.md +322 -0
  103. package/commands/specmem-drilldown.md +208 -0
  104. package/commands/specmem-find.md +195 -0
  105. package/commands/specmem-getdashboard.md +243 -0
  106. package/commands/specmem-hooks.md +219 -0
  107. package/commands/specmem-pointers.md +149 -0
  108. package/commands/specmem-progress.md +287 -0
  109. package/commands/specmem-remember.md +123 -0
  110. package/commands/specmem-service.md +349 -0
  111. package/commands/specmem-stats.md +189 -0
  112. package/commands/specmem-team-member.md +409 -0
  113. package/commands/specmem-webdev.md +583 -0
  114. package/commands/specmem.md +363 -0
  115. package/dist/autoStart/index.d.ts +214 -0
  116. package/dist/autoStart/index.d.ts.map +1 -0
  117. package/dist/autoStart/index.js +883 -0
  118. package/dist/autoStart/index.js.map +1 -0
  119. package/dist/claude-sessions/contextRestorationParser.d.ts +74 -0
  120. package/dist/claude-sessions/contextRestorationParser.d.ts.map +1 -0
  121. package/dist/claude-sessions/contextRestorationParser.js +570 -0
  122. package/dist/claude-sessions/contextRestorationParser.js.map +1 -0
  123. package/dist/claude-sessions/index.d.ts +13 -0
  124. package/dist/claude-sessions/index.d.ts.map +1 -0
  125. package/dist/claude-sessions/index.js +11 -0
  126. package/dist/claude-sessions/index.js.map +1 -0
  127. package/dist/claude-sessions/sessionIntegration.d.ts +48 -0
  128. package/dist/claude-sessions/sessionIntegration.d.ts.map +1 -0
  129. package/dist/claude-sessions/sessionIntegration.js +146 -0
  130. package/dist/claude-sessions/sessionIntegration.js.map +1 -0
  131. package/dist/claude-sessions/sessionParser.d.ts +293 -0
  132. package/dist/claude-sessions/sessionParser.d.ts.map +1 -0
  133. package/dist/claude-sessions/sessionParser.js +1028 -0
  134. package/dist/claude-sessions/sessionParser.js.map +1 -0
  135. package/dist/claude-sessions/sessionWatcher.d.ts +139 -0
  136. package/dist/claude-sessions/sessionWatcher.d.ts.map +1 -0
  137. package/dist/claude-sessions/sessionWatcher.js +722 -0
  138. package/dist/claude-sessions/sessionWatcher.js.map +1 -0
  139. package/dist/cli/deploy-to-claude.d.ts +56 -0
  140. package/dist/cli/deploy-to-claude.d.ts.map +1 -0
  141. package/dist/cli/deploy-to-claude.js +576 -0
  142. package/dist/cli/deploy-to-claude.js.map +1 -0
  143. package/dist/code-explanations/explainCode.d.ts +86 -0
  144. package/dist/code-explanations/explainCode.d.ts.map +1 -0
  145. package/dist/code-explanations/explainCode.js +286 -0
  146. package/dist/code-explanations/explainCode.js.map +1 -0
  147. package/dist/code-explanations/feedback.d.ts +87 -0
  148. package/dist/code-explanations/feedback.d.ts.map +1 -0
  149. package/dist/code-explanations/feedback.js +212 -0
  150. package/dist/code-explanations/feedback.js.map +1 -0
  151. package/dist/code-explanations/getRelatedCode.d.ts +80 -0
  152. package/dist/code-explanations/getRelatedCode.d.ts.map +1 -0
  153. package/dist/code-explanations/getRelatedCode.js +262 -0
  154. package/dist/code-explanations/getRelatedCode.js.map +1 -0
  155. package/dist/code-explanations/index.d.ts +284 -0
  156. package/dist/code-explanations/index.d.ts.map +1 -0
  157. package/dist/code-explanations/index.js +249 -0
  158. package/dist/code-explanations/index.js.map +1 -0
  159. package/dist/code-explanations/linkCodeToPrompt.d.ts +79 -0
  160. package/dist/code-explanations/linkCodeToPrompt.d.ts.map +1 -0
  161. package/dist/code-explanations/linkCodeToPrompt.js +213 -0
  162. package/dist/code-explanations/linkCodeToPrompt.js.map +1 -0
  163. package/dist/code-explanations/recallExplanation.d.ts +88 -0
  164. package/dist/code-explanations/recallExplanation.d.ts.map +1 -0
  165. package/dist/code-explanations/recallExplanation.js +218 -0
  166. package/dist/code-explanations/recallExplanation.js.map +1 -0
  167. package/dist/code-explanations/schema.d.ts +32 -0
  168. package/dist/code-explanations/schema.d.ts.map +1 -0
  169. package/dist/code-explanations/schema.js +221 -0
  170. package/dist/code-explanations/schema.js.map +1 -0
  171. package/dist/code-explanations/semanticSearch.d.ts +75 -0
  172. package/dist/code-explanations/semanticSearch.d.ts.map +1 -0
  173. package/dist/code-explanations/semanticSearch.js +203 -0
  174. package/dist/code-explanations/semanticSearch.js.map +1 -0
  175. package/dist/code-explanations/types.d.ts +328 -0
  176. package/dist/code-explanations/types.d.ts.map +1 -0
  177. package/dist/code-explanations/types.js +122 -0
  178. package/dist/code-explanations/types.js.map +1 -0
  179. package/dist/codebase/codeAnalyzer.d.ts +272 -0
  180. package/dist/codebase/codeAnalyzer.d.ts.map +1 -0
  181. package/dist/codebase/codeAnalyzer.js +1353 -0
  182. package/dist/codebase/codeAnalyzer.js.map +1 -0
  183. package/dist/codebase/codebaseIndexer.d.ts +360 -0
  184. package/dist/codebase/codebaseIndexer.d.ts.map +1 -0
  185. package/dist/codebase/codebaseIndexer.js +1735 -0
  186. package/dist/codebase/codebaseIndexer.js.map +1 -0
  187. package/dist/codebase/codebaseTools.d.ts +853 -0
  188. package/dist/codebase/codebaseTools.d.ts.map +1 -0
  189. package/dist/codebase/codebaseTools.js +1279 -0
  190. package/dist/codebase/codebaseTools.js.map +1 -0
  191. package/dist/codebase/exclusions.d.ts +111 -0
  192. package/dist/codebase/exclusions.d.ts.map +1 -0
  193. package/dist/codebase/exclusions.js +771 -0
  194. package/dist/codebase/exclusions.js.map +1 -0
  195. package/dist/codebase/fileWatcher.d.ts +135 -0
  196. package/dist/codebase/fileWatcher.d.ts.map +1 -0
  197. package/dist/codebase/fileWatcher.js +309 -0
  198. package/dist/codebase/fileWatcher.js.map +1 -0
  199. package/dist/codebase/index.d.ts +33 -0
  200. package/dist/codebase/index.d.ts.map +1 -0
  201. package/dist/codebase/index.js +77 -0
  202. package/dist/codebase/index.js.map +1 -0
  203. package/dist/codebase/ingestion.d.ts +177 -0
  204. package/dist/codebase/ingestion.d.ts.map +1 -0
  205. package/dist/codebase/ingestion.js +690 -0
  206. package/dist/codebase/ingestion.js.map +1 -0
  207. package/dist/codebase/languageDetection.d.ts +75 -0
  208. package/dist/codebase/languageDetection.d.ts.map +1 -0
  209. package/dist/codebase/languageDetection.js +768 -0
  210. package/dist/codebase/languageDetection.js.map +1 -0
  211. package/dist/commands/codebaseCommands.d.ts +101 -0
  212. package/dist/commands/codebaseCommands.d.ts.map +1 -0
  213. package/dist/commands/codebaseCommands.js +911 -0
  214. package/dist/commands/codebaseCommands.js.map +1 -0
  215. package/dist/commands/commandHandler.d.ts +126 -0
  216. package/dist/commands/commandHandler.d.ts.map +1 -0
  217. package/dist/commands/commandHandler.js +296 -0
  218. package/dist/commands/commandHandler.js.map +1 -0
  219. package/dist/commands/commandLoader.d.ts +103 -0
  220. package/dist/commands/commandLoader.d.ts.map +1 -0
  221. package/dist/commands/commandLoader.js +223 -0
  222. package/dist/commands/commandLoader.js.map +1 -0
  223. package/dist/commands/contextCommands.d.ts +83 -0
  224. package/dist/commands/contextCommands.d.ts.map +1 -0
  225. package/dist/commands/contextCommands.js +512 -0
  226. package/dist/commands/contextCommands.js.map +1 -0
  227. package/dist/commands/index.d.ts +24 -0
  228. package/dist/commands/index.d.ts.map +1 -0
  229. package/dist/commands/index.js +28 -0
  230. package/dist/commands/index.js.map +1 -0
  231. package/dist/commands/mcpResources.d.ts +50 -0
  232. package/dist/commands/mcpResources.d.ts.map +1 -0
  233. package/dist/commands/mcpResources.js +372 -0
  234. package/dist/commands/mcpResources.js.map +1 -0
  235. package/dist/commands/memoryCommands.d.ts +74 -0
  236. package/dist/commands/memoryCommands.d.ts.map +1 -0
  237. package/dist/commands/memoryCommands.js +609 -0
  238. package/dist/commands/memoryCommands.js.map +1 -0
  239. package/dist/commands/promptCommands.d.ts +91 -0
  240. package/dist/commands/promptCommands.d.ts.map +1 -0
  241. package/dist/commands/promptCommands.js +801 -0
  242. package/dist/commands/promptCommands.js.map +1 -0
  243. package/dist/commands/teamMemberCommands.d.ts +21 -0
  244. package/dist/commands/teamMemberCommands.d.ts.map +1 -0
  245. package/dist/commands/teamMemberCommands.js +137 -0
  246. package/dist/commands/teamMemberCommands.js.map +1 -0
  247. package/dist/comms/fileCommsTransport.d.ts +91 -0
  248. package/dist/comms/fileCommsTransport.d.ts.map +1 -0
  249. package/dist/comms/fileCommsTransport.js +244 -0
  250. package/dist/comms/fileCommsTransport.js.map +1 -0
  251. package/dist/comms/index.d.ts +7 -0
  252. package/dist/comms/index.d.ts.map +1 -0
  253. package/dist/comms/index.js +7 -0
  254. package/dist/comms/index.js.map +1 -0
  255. package/dist/config/apiKeyDetection.d.ts +41 -0
  256. package/dist/config/apiKeyDetection.d.ts.map +1 -0
  257. package/dist/config/apiKeyDetection.js +211 -0
  258. package/dist/config/apiKeyDetection.js.map +1 -0
  259. package/dist/config/autoConfig.d.ts +188 -0
  260. package/dist/config/autoConfig.d.ts.map +1 -0
  261. package/dist/config/autoConfig.js +850 -0
  262. package/dist/config/autoConfig.js.map +1 -0
  263. package/dist/config/configSync.d.ts +119 -0
  264. package/dist/config/configSync.d.ts.map +1 -0
  265. package/dist/config/configSync.js +878 -0
  266. package/dist/config/configSync.js.map +1 -0
  267. package/dist/config/embeddingTimeouts.d.ts +145 -0
  268. package/dist/config/embeddingTimeouts.d.ts.map +1 -0
  269. package/dist/config/embeddingTimeouts.js +255 -0
  270. package/dist/config/embeddingTimeouts.js.map +1 -0
  271. package/dist/config/index.d.ts +5 -0
  272. package/dist/config/index.d.ts.map +1 -0
  273. package/dist/config/index.js +7 -0
  274. package/dist/config/index.js.map +1 -0
  275. package/dist/config/languageConfig.d.ts +68 -0
  276. package/dist/config/languageConfig.d.ts.map +1 -0
  277. package/dist/config/languageConfig.js +473 -0
  278. package/dist/config/languageConfig.js.map +1 -0
  279. package/dist/config/password.d.ts +145 -0
  280. package/dist/config/password.d.ts.map +1 -0
  281. package/dist/config/password.js +428 -0
  282. package/dist/config/password.js.map +1 -0
  283. package/dist/config.d.ts +338 -0
  284. package/dist/config.d.ts.map +1 -0
  285. package/dist/config.js +1177 -0
  286. package/dist/config.js.map +1 -0
  287. package/dist/consolidation.d.ts +44 -0
  288. package/dist/consolidation.d.ts.map +1 -0
  289. package/dist/consolidation.js +447 -0
  290. package/dist/consolidation.js.map +1 -0
  291. package/dist/constants.d.ts +371 -0
  292. package/dist/constants.d.ts.map +1 -0
  293. package/dist/constants.js +552 -0
  294. package/dist/constants.js.map +1 -0
  295. package/dist/coordination/TeamMemberRegistry.d.ts +192 -0
  296. package/dist/coordination/TeamMemberRegistry.d.ts.map +1 -0
  297. package/dist/coordination/TeamMemberRegistry.js +415 -0
  298. package/dist/coordination/TeamMemberRegistry.js.map +1 -0
  299. package/dist/coordination/events.d.ts +369 -0
  300. package/dist/coordination/events.d.ts.map +1 -0
  301. package/dist/coordination/events.js +232 -0
  302. package/dist/coordination/events.js.map +1 -0
  303. package/dist/coordination/handlers.d.ts +116 -0
  304. package/dist/coordination/handlers.d.ts.map +1 -0
  305. package/dist/coordination/handlers.js +400 -0
  306. package/dist/coordination/handlers.js.map +1 -0
  307. package/dist/coordination/index.d.ts +14 -0
  308. package/dist/coordination/index.d.ts.map +1 -0
  309. package/dist/coordination/index.js +31 -0
  310. package/dist/coordination/index.js.map +1 -0
  311. package/dist/coordination/integration.d.ts +260 -0
  312. package/dist/coordination/integration.d.ts.map +1 -0
  313. package/dist/coordination/integration.js +472 -0
  314. package/dist/coordination/integration.js.map +1 -0
  315. package/dist/coordination/server.d.ts +266 -0
  316. package/dist/coordination/server.d.ts.map +1 -0
  317. package/dist/coordination/server.js +995 -0
  318. package/dist/coordination/server.js.map +1 -0
  319. package/dist/coordination/serviceProvider.d.ts +70 -0
  320. package/dist/coordination/serviceProvider.d.ts.map +1 -0
  321. package/dist/coordination/serviceProvider.js +273 -0
  322. package/dist/coordination/serviceProvider.js.map +1 -0
  323. package/dist/dashboard/api/claudeControl.d.ts +44 -0
  324. package/dist/dashboard/api/claudeControl.d.ts.map +1 -0
  325. package/dist/dashboard/api/claudeControl.js +650 -0
  326. package/dist/dashboard/api/claudeControl.js.map +1 -0
  327. package/dist/dashboard/api/claudeHistory.d.ts +4 -0
  328. package/dist/dashboard/api/claudeHistory.d.ts.map +1 -0
  329. package/dist/dashboard/api/claudeHistory.js +319 -0
  330. package/dist/dashboard/api/claudeHistory.js.map +1 -0
  331. package/dist/dashboard/api/dataExport.d.ts +23 -0
  332. package/dist/dashboard/api/dataExport.d.ts.map +1 -0
  333. package/dist/dashboard/api/dataExport.js +509 -0
  334. package/dist/dashboard/api/dataExport.js.map +1 -0
  335. package/dist/dashboard/api/fileManager.d.ts +39 -0
  336. package/dist/dashboard/api/fileManager.d.ts.map +1 -0
  337. package/dist/dashboard/api/fileManager.js +814 -0
  338. package/dist/dashboard/api/fileManager.js.map +1 -0
  339. package/dist/dashboard/api/hooks.d.ts +16 -0
  340. package/dist/dashboard/api/hooks.d.ts.map +1 -0
  341. package/dist/dashboard/api/hooks.js +342 -0
  342. package/dist/dashboard/api/hooks.js.map +1 -0
  343. package/dist/dashboard/api/hotReload.d.ts +14 -0
  344. package/dist/dashboard/api/hotReload.d.ts.map +1 -0
  345. package/dist/dashboard/api/hotReload.js +219 -0
  346. package/dist/dashboard/api/hotReload.js.map +1 -0
  347. package/dist/dashboard/api/liveSessionStream.d.ts +19 -0
  348. package/dist/dashboard/api/liveSessionStream.d.ts.map +1 -0
  349. package/dist/dashboard/api/liveSessionStream.js +430 -0
  350. package/dist/dashboard/api/liveSessionStream.js.map +1 -0
  351. package/dist/dashboard/api/memoryRecall.d.ts +20 -0
  352. package/dist/dashboard/api/memoryRecall.d.ts.map +1 -0
  353. package/dist/dashboard/api/memoryRecall.js +524 -0
  354. package/dist/dashboard/api/memoryRecall.js.map +1 -0
  355. package/dist/dashboard/api/promptSend.d.ts +33 -0
  356. package/dist/dashboard/api/promptSend.d.ts.map +1 -0
  357. package/dist/dashboard/api/promptSend.js +544 -0
  358. package/dist/dashboard/api/promptSend.js.map +1 -0
  359. package/dist/dashboard/api/settings.d.ts +10 -0
  360. package/dist/dashboard/api/settings.d.ts.map +1 -0
  361. package/dist/dashboard/api/settings.js +656 -0
  362. package/dist/dashboard/api/settings.js.map +1 -0
  363. package/dist/dashboard/api/setup.d.ts +21 -0
  364. package/dist/dashboard/api/setup.d.ts.map +1 -0
  365. package/dist/dashboard/api/setup.js +663 -0
  366. package/dist/dashboard/api/setup.js.map +1 -0
  367. package/dist/dashboard/api/specmemTools.d.ts +14 -0
  368. package/dist/dashboard/api/specmemTools.d.ts.map +1 -0
  369. package/dist/dashboard/api/specmemTools.js +1059 -0
  370. package/dist/dashboard/api/specmemTools.js.map +1 -0
  371. package/dist/dashboard/api/taskTeamMembers.d.ts +8 -0
  372. package/dist/dashboard/api/taskTeamMembers.d.ts.map +1 -0
  373. package/dist/dashboard/api/taskTeamMembers.js +136 -0
  374. package/dist/dashboard/api/taskTeamMembers.js.map +1 -0
  375. package/dist/dashboard/api/teamMemberDeploy.d.ts +15 -0
  376. package/dist/dashboard/api/teamMemberDeploy.d.ts.map +1 -0
  377. package/dist/dashboard/api/teamMemberDeploy.js +421 -0
  378. package/dist/dashboard/api/teamMemberDeploy.js.map +1 -0
  379. package/dist/dashboard/api/teamMemberHistory.d.ts +38 -0
  380. package/dist/dashboard/api/teamMemberHistory.d.ts.map +1 -0
  381. package/dist/dashboard/api/teamMemberHistory.js +583 -0
  382. package/dist/dashboard/api/teamMemberHistory.js.map +1 -0
  383. package/dist/dashboard/api/terminal.d.ts +12 -0
  384. package/dist/dashboard/api/terminal.d.ts.map +1 -0
  385. package/dist/dashboard/api/terminal.js +344 -0
  386. package/dist/dashboard/api/terminal.js.map +1 -0
  387. package/dist/dashboard/api/terminalInject.d.ts +17 -0
  388. package/dist/dashboard/api/terminalInject.d.ts.map +1 -0
  389. package/dist/dashboard/api/terminalInject.js +322 -0
  390. package/dist/dashboard/api/terminalInject.js.map +1 -0
  391. package/dist/dashboard/api/terminalStream.d.ts +12 -0
  392. package/dist/dashboard/api/terminalStream.d.ts.map +1 -0
  393. package/dist/dashboard/api/terminalStream.js +482 -0
  394. package/dist/dashboard/api/terminalStream.js.map +1 -0
  395. package/dist/dashboard/index.d.ts +7 -0
  396. package/dist/dashboard/index.d.ts.map +1 -0
  397. package/dist/dashboard/index.js +7 -0
  398. package/dist/dashboard/index.js.map +1 -0
  399. package/dist/dashboard/ptyStreamer.d.ts +173 -0
  400. package/dist/dashboard/ptyStreamer.d.ts.map +1 -0
  401. package/dist/dashboard/ptyStreamer.js +661 -0
  402. package/dist/dashboard/ptyStreamer.js.map +1 -0
  403. package/dist/dashboard/public/DASHBOARD-README.md +378 -0
  404. package/dist/dashboard/public/INTEGRATION-GUIDE.md +395 -0
  405. package/dist/dashboard/public/codebase-config.html +1247 -0
  406. package/dist/dashboard/public/dashboard-v2.html +1942 -0
  407. package/dist/dashboard/public/data-export.html +819 -0
  408. package/dist/dashboard/public/example-page.html +164 -0
  409. package/dist/dashboard/public/file-explorer.html +1023 -0
  410. package/dist/dashboard/public/hooks.html +1103 -0
  411. package/dist/dashboard/public/index-improvements.css +499 -0
  412. package/dist/dashboard/public/index.html +5534 -0
  413. package/dist/dashboard/public/memory-controls.html +1959 -0
  414. package/dist/dashboard/public/memory-recall.html +1495 -0
  415. package/dist/dashboard/public/previews/skeleton-memory-graph.html +361 -0
  416. package/dist/dashboard/public/previews/skeleton-memory-list.html +366 -0
  417. package/dist/dashboard/public/previews/skeleton-search-results.html +609 -0
  418. package/dist/dashboard/public/previews/skeleton-stats-dashboard.html +556 -0
  419. package/dist/dashboard/public/prompt-console.html +2763 -0
  420. package/dist/dashboard/public/react-dist/assets/index-CkjobT5B.js +871 -0
  421. package/dist/dashboard/public/react-dist/assets/index-iRclxMst.css +1 -0
  422. package/dist/dashboard/public/react-dist/index.html +16 -0
  423. package/dist/dashboard/public/shared-header.js +325 -0
  424. package/dist/dashboard/public/shared-language-selector.js +626 -0
  425. package/dist/dashboard/public/shared-logger.js +66 -0
  426. package/dist/dashboard/public/shared-nav.js +325 -0
  427. package/dist/dashboard/public/shared-theme-blue.css +331 -0
  428. package/dist/dashboard/public/shared-theme.css +813 -0
  429. package/dist/dashboard/public/shared-toast.js +415 -0
  430. package/dist/dashboard/public/team-member-history.html +1291 -0
  431. package/dist/dashboard/public/team-member-spy.html +1199 -0
  432. package/dist/dashboard/public/team-members.html +3756 -0
  433. package/dist/dashboard/public/terminal-output.html +1013 -0
  434. package/dist/dashboard/public/terminal.html +372 -0
  435. package/dist/dashboard/sessionStore.d.ts +86 -0
  436. package/dist/dashboard/sessionStore.d.ts.map +1 -0
  437. package/dist/dashboard/sessionStore.js +262 -0
  438. package/dist/dashboard/sessionStore.js.map +1 -0
  439. package/dist/dashboard/standalone.d.ts +27 -0
  440. package/dist/dashboard/standalone.d.ts.map +1 -0
  441. package/dist/dashboard/standalone.js +380 -0
  442. package/dist/dashboard/standalone.js.map +1 -0
  443. package/dist/dashboard/webServer.d.ts +390 -0
  444. package/dist/dashboard/webServer.d.ts.map +1 -0
  445. package/dist/dashboard/webServer.js +4297 -0
  446. package/dist/dashboard/webServer.js.map +1 -0
  447. package/dist/dashboard/websocket/teamMemberStream.d.ts +87 -0
  448. package/dist/dashboard/websocket/teamMemberStream.d.ts.map +1 -0
  449. package/dist/dashboard/websocket/teamMemberStream.js +366 -0
  450. package/dist/dashboard/websocket/teamMemberStream.js.map +1 -0
  451. package/dist/dashboard/websocket/terminalStream.d.ts +130 -0
  452. package/dist/dashboard/websocket/terminalStream.d.ts.map +1 -0
  453. package/dist/dashboard/websocket/terminalStream.js +456 -0
  454. package/dist/dashboard/websocket/terminalStream.js.map +1 -0
  455. package/dist/database/embeddedPostgres.d.ts +187 -0
  456. package/dist/database/embeddedPostgres.d.ts.map +1 -0
  457. package/dist/database/embeddedPostgres.js +763 -0
  458. package/dist/database/embeddedPostgres.js.map +1 -0
  459. package/dist/database/index.d.ts +12 -0
  460. package/dist/database/index.d.ts.map +1 -0
  461. package/dist/database/index.js +20 -0
  462. package/dist/database/index.js.map +1 -0
  463. package/dist/database/initEmbeddedPostgres.d.ts +124 -0
  464. package/dist/database/initEmbeddedPostgres.d.ts.map +1 -0
  465. package/dist/database/initEmbeddedPostgres.js +855 -0
  466. package/dist/database/initEmbeddedPostgres.js.map +1 -0
  467. package/dist/database.d.ts +256 -0
  468. package/dist/database.d.ts.map +1 -0
  469. package/dist/database.js +1209 -0
  470. package/dist/database.js.map +1 -0
  471. package/dist/db/apiDataManager.d.ts +334 -0
  472. package/dist/db/apiDataManager.d.ts.map +1 -0
  473. package/dist/db/apiDataManager.js +631 -0
  474. package/dist/db/apiDataManager.js.map +1 -0
  475. package/dist/db/batchOperations.d.ts +154 -0
  476. package/dist/db/batchOperations.d.ts.map +1 -0
  477. package/dist/db/batchOperations.js +564 -0
  478. package/dist/db/batchOperations.js.map +1 -0
  479. package/dist/db/bigBrainMigrations.d.ts +48 -0
  480. package/dist/db/bigBrainMigrations.d.ts.map +1 -0
  481. package/dist/db/bigBrainMigrations.js +4266 -0
  482. package/dist/db/bigBrainMigrations.js.map +1 -0
  483. package/dist/db/connectionPoolGoBrrr.d.ts +94 -0
  484. package/dist/db/connectionPoolGoBrrr.d.ts.map +1 -0
  485. package/dist/db/connectionPoolGoBrrr.js +548 -0
  486. package/dist/db/connectionPoolGoBrrr.js.map +1 -0
  487. package/dist/db/dashboardQueries.d.ts +182 -0
  488. package/dist/db/dashboardQueries.d.ts.map +1 -0
  489. package/dist/db/dashboardQueries.js +821 -0
  490. package/dist/db/dashboardQueries.js.map +1 -0
  491. package/dist/db/deploymentBootstrap.d.ts +43 -0
  492. package/dist/db/deploymentBootstrap.d.ts.map +1 -0
  493. package/dist/db/deploymentBootstrap.js +329 -0
  494. package/dist/db/deploymentBootstrap.js.map +1 -0
  495. package/dist/db/dimensionService.d.ts +140 -0
  496. package/dist/db/dimensionService.d.ts.map +1 -0
  497. package/dist/db/dimensionService.js +261 -0
  498. package/dist/db/dimensionService.js.map +1 -0
  499. package/dist/db/embeddingOverflow.d.ts +69 -0
  500. package/dist/db/embeddingOverflow.d.ts.map +1 -0
  501. package/dist/db/embeddingOverflow.js +332 -0
  502. package/dist/db/embeddingOverflow.js.map +1 -0
  503. package/dist/db/embeddingOverflow.sql +221 -0
  504. package/dist/db/findThatShit.d.ts +145 -0
  505. package/dist/db/findThatShit.d.ts.map +1 -0
  506. package/dist/db/findThatShit.js +782 -0
  507. package/dist/db/findThatShit.js.map +1 -0
  508. package/dist/db/hotPathManager.d.ts +187 -0
  509. package/dist/db/hotPathManager.d.ts.map +1 -0
  510. package/dist/db/hotPathManager.js +504 -0
  511. package/dist/db/hotPathManager.js.map +1 -0
  512. package/dist/db/index.d.ts +85 -0
  513. package/dist/db/index.d.ts.map +1 -0
  514. package/dist/db/index.js +219 -0
  515. package/dist/db/index.js.map +1 -0
  516. package/dist/db/memoryDrilldown.sql +99 -0
  517. package/dist/db/migrate.d.ts +3 -0
  518. package/dist/db/migrate.d.ts.map +1 -0
  519. package/dist/db/migrate.js +97 -0
  520. package/dist/db/migrate.js.map +1 -0
  521. package/dist/db/migrateJsonToPostgres.d.ts +43 -0
  522. package/dist/db/migrateJsonToPostgres.d.ts.map +1 -0
  523. package/dist/db/migrateJsonToPostgres.js +465 -0
  524. package/dist/db/migrateJsonToPostgres.js.map +1 -0
  525. package/dist/db/nukeFromOrbit.d.ts +63 -0
  526. package/dist/db/nukeFromOrbit.d.ts.map +1 -0
  527. package/dist/db/nukeFromOrbit.js +499 -0
  528. package/dist/db/nukeFromOrbit.js.map +1 -0
  529. package/dist/db/processedTraining.sql +60 -0
  530. package/dist/db/projectNamespacing.d.ts +258 -0
  531. package/dist/db/projectNamespacing.d.ts.map +1 -0
  532. package/dist/db/projectNamespacing.js +920 -0
  533. package/dist/db/projectNamespacing.js.map +1 -0
  534. package/dist/db/projectNamespacing.sql +374 -0
  535. package/dist/db/projectSchemaInit.sql +271 -0
  536. package/dist/db/spatialMemory.d.ts +296 -0
  537. package/dist/db/spatialMemory.d.ts.map +1 -0
  538. package/dist/db/spatialMemory.js +818 -0
  539. package/dist/db/spatialMemory.js.map +1 -0
  540. package/dist/db/streamingQuery.d.ts +143 -0
  541. package/dist/db/streamingQuery.d.ts.map +1 -0
  542. package/dist/db/streamingQuery.js +350 -0
  543. package/dist/db/streamingQuery.js.map +1 -0
  544. package/dist/db/teamComms.sql +224 -0
  545. package/dist/db/yeetStuffInDb.d.ts +72 -0
  546. package/dist/db/yeetStuffInDb.d.ts.map +1 -0
  547. package/dist/db/yeetStuffInDb.js +473 -0
  548. package/dist/db/yeetStuffInDb.js.map +1 -0
  549. package/dist/embedding-providers/index.d.ts +10 -0
  550. package/dist/embedding-providers/index.d.ts.map +1 -0
  551. package/dist/embedding-providers/index.js +12 -0
  552. package/dist/embedding-providers/index.js.map +1 -0
  553. package/dist/embeddings/projectionLayer.d.ts +114 -0
  554. package/dist/embeddings/projectionLayer.d.ts.map +1 -0
  555. package/dist/embeddings/projectionLayer.js +345 -0
  556. package/dist/embeddings/projectionLayer.js.map +1 -0
  557. package/dist/events/Publisher.d.ts +193 -0
  558. package/dist/events/Publisher.d.ts.map +1 -0
  559. package/dist/events/Publisher.js +439 -0
  560. package/dist/events/Publisher.js.map +1 -0
  561. package/dist/events/config.d.ts +139 -0
  562. package/dist/events/config.d.ts.map +1 -0
  563. package/dist/events/config.js +266 -0
  564. package/dist/events/config.js.map +1 -0
  565. package/dist/events/index.d.ts +19 -0
  566. package/dist/events/index.d.ts.map +1 -0
  567. package/dist/events/index.js +31 -0
  568. package/dist/events/index.js.map +1 -0
  569. package/dist/events/integration.d.ts +206 -0
  570. package/dist/events/integration.d.ts.map +1 -0
  571. package/dist/events/integration.js +348 -0
  572. package/dist/events/integration.js.map +1 -0
  573. package/dist/events/metrics.d.ts +147 -0
  574. package/dist/events/metrics.d.ts.map +1 -0
  575. package/dist/events/metrics.js +343 -0
  576. package/dist/events/metrics.js.map +1 -0
  577. package/dist/hooks/cli.d.ts +28 -0
  578. package/dist/hooks/cli.d.ts.map +1 -0
  579. package/dist/hooks/cli.js +118 -0
  580. package/dist/hooks/cli.js.map +1 -0
  581. package/dist/hooks/contextInjectionHook.d.ts +60 -0
  582. package/dist/hooks/contextInjectionHook.d.ts.map +1 -0
  583. package/dist/hooks/contextInjectionHook.js +294 -0
  584. package/dist/hooks/contextInjectionHook.js.map +1 -0
  585. package/dist/hooks/drilldownHook.d.ts +125 -0
  586. package/dist/hooks/drilldownHook.d.ts.map +1 -0
  587. package/dist/hooks/drilldownHook.js +181 -0
  588. package/dist/hooks/drilldownHook.js.map +1 -0
  589. package/dist/hooks/hookManager.d.ts +180 -0
  590. package/dist/hooks/hookManager.d.ts.map +1 -0
  591. package/dist/hooks/hookManager.js +782 -0
  592. package/dist/hooks/hookManager.js.map +1 -0
  593. package/dist/hooks/index.d.ts +62 -0
  594. package/dist/hooks/index.d.ts.map +1 -0
  595. package/dist/hooks/index.js +66 -0
  596. package/dist/hooks/index.js.map +1 -0
  597. package/dist/hooks/lowContextHook.d.ts +71 -0
  598. package/dist/hooks/lowContextHook.d.ts.map +1 -0
  599. package/dist/hooks/lowContextHook.js +258 -0
  600. package/dist/hooks/lowContextHook.js.map +1 -0
  601. package/dist/hooks/simpleContextHook.d.ts +65 -0
  602. package/dist/hooks/simpleContextHook.d.ts.map +1 -0
  603. package/dist/hooks/simpleContextHook.js +194 -0
  604. package/dist/hooks/simpleContextHook.js.map +1 -0
  605. package/dist/hooks/teamFramingCli.d.ts +56 -0
  606. package/dist/hooks/teamFramingCli.d.ts.map +1 -0
  607. package/dist/hooks/teamFramingCli.js +264 -0
  608. package/dist/hooks/teamFramingCli.js.map +1 -0
  609. package/dist/hooks/teamMemberPrepromptHook.d.ts +150 -0
  610. package/dist/hooks/teamMemberPrepromptHook.d.ts.map +1 -0
  611. package/dist/hooks/teamMemberPrepromptHook.js +308 -0
  612. package/dist/hooks/teamMemberPrepromptHook.js.map +1 -0
  613. package/dist/index.d.ts +42 -0
  614. package/dist/index.d.ts.map +1 -0
  615. package/dist/index.js +4433 -0
  616. package/dist/index.js.map +1 -0
  617. package/dist/init/claudeConfigInjector.d.ts +116 -0
  618. package/dist/init/claudeConfigInjector.d.ts.map +1 -0
  619. package/dist/init/claudeConfigInjector.js +1154 -0
  620. package/dist/init/claudeConfigInjector.js.map +1 -0
  621. package/dist/installer/autoInstall.d.ts +72 -0
  622. package/dist/installer/autoInstall.d.ts.map +1 -0
  623. package/dist/installer/autoInstall.js +617 -0
  624. package/dist/installer/autoInstall.js.map +1 -0
  625. package/dist/installer/dbSetup.d.ts +84 -0
  626. package/dist/installer/dbSetup.d.ts.map +1 -0
  627. package/dist/installer/dbSetup.js +350 -0
  628. package/dist/installer/dbSetup.js.map +1 -0
  629. package/dist/installer/firstRun.d.ts +49 -0
  630. package/dist/installer/firstRun.d.ts.map +1 -0
  631. package/dist/installer/firstRun.js +207 -0
  632. package/dist/installer/firstRun.js.map +1 -0
  633. package/dist/installer/index.d.ts +10 -0
  634. package/dist/installer/index.d.ts.map +1 -0
  635. package/dist/installer/index.js +10 -0
  636. package/dist/installer/index.js.map +1 -0
  637. package/dist/installer/silentAutoInstall.d.ts +99 -0
  638. package/dist/installer/silentAutoInstall.d.ts.map +1 -0
  639. package/dist/installer/silentAutoInstall.js +491 -0
  640. package/dist/installer/silentAutoInstall.js.map +1 -0
  641. package/dist/installer/systemDeps.d.ts +54 -0
  642. package/dist/installer/systemDeps.d.ts.map +1 -0
  643. package/dist/installer/systemDeps.js +322 -0
  644. package/dist/installer/systemDeps.js.map +1 -0
  645. package/dist/mcp/cliNotifications.d.ts +133 -0
  646. package/dist/mcp/cliNotifications.d.ts.map +1 -0
  647. package/dist/mcp/cliNotifications.js +289 -0
  648. package/dist/mcp/cliNotifications.js.map +1 -0
  649. package/dist/mcp/embeddingServerManager.d.ts +307 -0
  650. package/dist/mcp/embeddingServerManager.d.ts.map +1 -0
  651. package/dist/mcp/embeddingServerManager.js +2081 -0
  652. package/dist/mcp/embeddingServerManager.js.map +1 -0
  653. package/dist/mcp/healthMonitor.d.ts +196 -0
  654. package/dist/mcp/healthMonitor.d.ts.map +1 -0
  655. package/dist/mcp/healthMonitor.js +685 -0
  656. package/dist/mcp/healthMonitor.js.map +1 -0
  657. package/dist/mcp/hotReloadManager.d.ts +101 -0
  658. package/dist/mcp/hotReloadManager.d.ts.map +1 -0
  659. package/dist/mcp/hotReloadManager.js +251 -0
  660. package/dist/mcp/hotReloadManager.js.map +1 -0
  661. package/dist/mcp/index.d.ts +16 -0
  662. package/dist/mcp/index.d.ts.map +1 -0
  663. package/dist/mcp/index.js +22 -0
  664. package/dist/mcp/index.js.map +1 -0
  665. package/dist/mcp/mcpProtocolHandler.d.ts +64 -0
  666. package/dist/mcp/mcpProtocolHandler.d.ts.map +1 -0
  667. package/dist/mcp/mcpProtocolHandler.js +253 -0
  668. package/dist/mcp/mcpProtocolHandler.js.map +1 -0
  669. package/dist/mcp/miniCOTServerManager.d.ts +336 -0
  670. package/dist/mcp/miniCOTServerManager.d.ts.map +1 -0
  671. package/dist/mcp/miniCOTServerManager.js +1384 -0
  672. package/dist/mcp/miniCOTServerManager.js.map +1 -0
  673. package/dist/mcp/promptExecutor.d.ts +188 -0
  674. package/dist/mcp/promptExecutor.d.ts.map +1 -0
  675. package/dist/mcp/promptExecutor.js +469 -0
  676. package/dist/mcp/promptExecutor.js.map +1 -0
  677. package/dist/mcp/reloadBroadcast.d.ts +127 -0
  678. package/dist/mcp/reloadBroadcast.d.ts.map +1 -0
  679. package/dist/mcp/reloadBroadcast.js +275 -0
  680. package/dist/mcp/reloadBroadcast.js.map +1 -0
  681. package/dist/mcp/resilientTransport.d.ts +249 -0
  682. package/dist/mcp/resilientTransport.d.ts.map +1 -0
  683. package/dist/mcp/resilientTransport.js +931 -0
  684. package/dist/mcp/resilientTransport.js.map +1 -0
  685. package/dist/mcp/samplingHandler.d.ts +129 -0
  686. package/dist/mcp/samplingHandler.d.ts.map +1 -0
  687. package/dist/mcp/samplingHandler.js +276 -0
  688. package/dist/mcp/samplingHandler.js.map +1 -0
  689. package/dist/mcp/specMemServer.d.ts +305 -0
  690. package/dist/mcp/specMemServer.d.ts.map +1 -0
  691. package/dist/mcp/specMemServer.js +2048 -0
  692. package/dist/mcp/specMemServer.js.map +1 -0
  693. package/dist/mcp/toolRegistry.d.ts +122 -0
  694. package/dist/mcp/toolRegistry.d.ts.map +1 -0
  695. package/dist/mcp/toolRegistry.js +609 -0
  696. package/dist/mcp/toolRegistry.js.map +1 -0
  697. package/dist/mcp/tools/embeddingControl.d.ts +114 -0
  698. package/dist/mcp/tools/embeddingControl.d.ts.map +1 -0
  699. package/dist/mcp/tools/embeddingControl.js +222 -0
  700. package/dist/mcp/tools/embeddingControl.js.map +1 -0
  701. package/dist/mcp/tools/index.d.ts +10 -0
  702. package/dist/mcp/tools/index.d.ts.map +1 -0
  703. package/dist/mcp/tools/index.js +17 -0
  704. package/dist/mcp/tools/index.js.map +1 -0
  705. package/dist/mcp/tools/teamComms.d.ts +444 -0
  706. package/dist/mcp/tools/teamComms.d.ts.map +1 -0
  707. package/dist/mcp/tools/teamComms.js +1953 -0
  708. package/dist/mcp/tools/teamComms.js.map +1 -0
  709. package/dist/mcp/triggerSystem.d.ts +129 -0
  710. package/dist/mcp/triggerSystem.d.ts.map +1 -0
  711. package/dist/mcp/triggerSystem.js +363 -0
  712. package/dist/mcp/triggerSystem.js.map +1 -0
  713. package/dist/mcp/watcherIntegration.d.ts +77 -0
  714. package/dist/mcp/watcherIntegration.d.ts.map +1 -0
  715. package/dist/mcp/watcherIntegration.js +428 -0
  716. package/dist/mcp/watcherIntegration.js.map +1 -0
  717. package/dist/mcp/watcherToolWrappers.d.ts +89 -0
  718. package/dist/mcp/watcherToolWrappers.d.ts.map +1 -0
  719. package/dist/mcp/watcherToolWrappers.js +91 -0
  720. package/dist/mcp/watcherToolWrappers.js.map +1 -0
  721. package/dist/memorization/claudeCodeMigration.d.ts +34 -0
  722. package/dist/memorization/claudeCodeMigration.d.ts.map +1 -0
  723. package/dist/memorization/claudeCodeMigration.js +210 -0
  724. package/dist/memorization/claudeCodeMigration.js.map +1 -0
  725. package/dist/memorization/claudeCodeTracker.d.ts +147 -0
  726. package/dist/memorization/claudeCodeTracker.d.ts.map +1 -0
  727. package/dist/memorization/claudeCodeTracker.js +424 -0
  728. package/dist/memorization/claudeCodeTracker.js.map +1 -0
  729. package/dist/memorization/codeMemorizer.d.ts +158 -0
  730. package/dist/memorization/codeMemorizer.d.ts.map +1 -0
  731. package/dist/memorization/codeMemorizer.js +357 -0
  732. package/dist/memorization/codeMemorizer.js.map +1 -0
  733. package/dist/memorization/codeRecall.d.ts +156 -0
  734. package/dist/memorization/codeRecall.d.ts.map +1 -0
  735. package/dist/memorization/codeRecall.js +499 -0
  736. package/dist/memorization/codeRecall.js.map +1 -0
  737. package/dist/memorization/index.d.ts +55 -0
  738. package/dist/memorization/index.d.ts.map +1 -0
  739. package/dist/memorization/index.js +64 -0
  740. package/dist/memorization/index.js.map +1 -0
  741. package/dist/memorization/memorizationTools.d.ts +413 -0
  742. package/dist/memorization/memorizationTools.d.ts.map +1 -0
  743. package/dist/memorization/memorizationTools.js +513 -0
  744. package/dist/memorization/memorizationTools.js.map +1 -0
  745. package/dist/memorization/watcherIntegration.d.ts +100 -0
  746. package/dist/memorization/watcherIntegration.d.ts.map +1 -0
  747. package/dist/memorization/watcherIntegration.js +196 -0
  748. package/dist/memorization/watcherIntegration.js.map +1 -0
  749. package/dist/memory/humanLikeMemory.d.ts +206 -0
  750. package/dist/memory/humanLikeMemory.d.ts.map +1 -0
  751. package/dist/memory/humanLikeMemory.js +603 -0
  752. package/dist/memory/humanLikeMemory.js.map +1 -0
  753. package/dist/memory/index.d.ts +22 -0
  754. package/dist/memory/index.d.ts.map +1 -0
  755. package/dist/memory/index.js +24 -0
  756. package/dist/memory/index.js.map +1 -0
  757. package/dist/memory/memoryEvolutionMigration.d.ts +36 -0
  758. package/dist/memory/memoryEvolutionMigration.d.ts.map +1 -0
  759. package/dist/memory/memoryEvolutionMigration.js +371 -0
  760. package/dist/memory/memoryEvolutionMigration.js.map +1 -0
  761. package/dist/memory/quadrantSearch.d.ts +221 -0
  762. package/dist/memory/quadrantSearch.d.ts.map +1 -0
  763. package/dist/memory/quadrantSearch.js +897 -0
  764. package/dist/memory/quadrantSearch.js.map +1 -0
  765. package/dist/middleware/apiVersioning.d.ts +83 -0
  766. package/dist/middleware/apiVersioning.d.ts.map +1 -0
  767. package/dist/middleware/apiVersioning.js +152 -0
  768. package/dist/middleware/apiVersioning.js.map +1 -0
  769. package/dist/middleware/compression.d.ts +48 -0
  770. package/dist/middleware/compression.d.ts.map +1 -0
  771. package/dist/middleware/compression.js +240 -0
  772. package/dist/middleware/compression.js.map +1 -0
  773. package/dist/middleware/csrf.d.ts +118 -0
  774. package/dist/middleware/csrf.d.ts.map +1 -0
  775. package/dist/middleware/csrf.js +300 -0
  776. package/dist/middleware/csrf.js.map +1 -0
  777. package/dist/middleware/index.d.ts +13 -0
  778. package/dist/middleware/index.d.ts.map +1 -0
  779. package/dist/middleware/index.js +17 -0
  780. package/dist/middleware/index.js.map +1 -0
  781. package/dist/middleware/wsRateLimiter.d.ts +129 -0
  782. package/dist/middleware/wsRateLimiter.d.ts.map +1 -0
  783. package/dist/middleware/wsRateLimiter.js +279 -0
  784. package/dist/middleware/wsRateLimiter.js.map +1 -0
  785. package/dist/migrations/run.d.ts +2 -0
  786. package/dist/migrations/run.d.ts.map +1 -0
  787. package/dist/migrations/run.js +25 -0
  788. package/dist/migrations/run.js.map +1 -0
  789. package/dist/migrations/syncDimensions.d.ts +24 -0
  790. package/dist/migrations/syncDimensions.d.ts.map +1 -0
  791. package/dist/migrations/syncDimensions.js +140 -0
  792. package/dist/migrations/syncDimensions.js.map +1 -0
  793. package/dist/migrations/teamComms.d.ts +16 -0
  794. package/dist/migrations/teamComms.d.ts.map +1 -0
  795. package/dist/migrations/teamComms.js +210 -0
  796. package/dist/migrations/teamComms.js.map +1 -0
  797. package/dist/openapi/index.d.ts +10 -0
  798. package/dist/openapi/index.d.ts.map +1 -0
  799. package/dist/openapi/index.js +10 -0
  800. package/dist/openapi/index.js.map +1 -0
  801. package/dist/openapi/spec.d.ts +902 -0
  802. package/dist/openapi/spec.d.ts.map +1 -0
  803. package/dist/openapi/spec.js +733 -0
  804. package/dist/openapi/spec.js.map +1 -0
  805. package/dist/packages/dependencyHistory.d.ts +113 -0
  806. package/dist/packages/dependencyHistory.d.ts.map +1 -0
  807. package/dist/packages/dependencyHistory.js +360 -0
  808. package/dist/packages/dependencyHistory.js.map +1 -0
  809. package/dist/packages/index.d.ts +30 -0
  810. package/dist/packages/index.d.ts.map +1 -0
  811. package/dist/packages/index.js +65 -0
  812. package/dist/packages/index.js.map +1 -0
  813. package/dist/packages/packageTools.d.ts +255 -0
  814. package/dist/packages/packageTools.d.ts.map +1 -0
  815. package/dist/packages/packageTools.js +242 -0
  816. package/dist/packages/packageTools.js.map +1 -0
  817. package/dist/packages/packageTracker.d.ts +98 -0
  818. package/dist/packages/packageTracker.d.ts.map +1 -0
  819. package/dist/packages/packageTracker.js +268 -0
  820. package/dist/packages/packageTracker.js.map +1 -0
  821. package/dist/packages/packageWatcher.d.ts +62 -0
  822. package/dist/packages/packageWatcher.d.ts.map +1 -0
  823. package/dist/packages/packageWatcher.js +146 -0
  824. package/dist/packages/packageWatcher.js.map +1 -0
  825. package/dist/providers/MiniCOTProvider.d.ts +48 -0
  826. package/dist/providers/MiniCOTProvider.d.ts.map +1 -0
  827. package/dist/providers/MiniCOTProvider.js +98 -0
  828. package/dist/providers/MiniCOTProvider.js.map +1 -0
  829. package/dist/reminders/index.d.ts +5 -0
  830. package/dist/reminders/index.d.ts.map +1 -0
  831. package/dist/reminders/index.js +5 -0
  832. package/dist/reminders/index.js.map +1 -0
  833. package/dist/reminders/skillReminder.d.ts +131 -0
  834. package/dist/reminders/skillReminder.d.ts.map +1 -0
  835. package/dist/reminders/skillReminder.js +386 -0
  836. package/dist/reminders/skillReminder.js.map +1 -0
  837. package/dist/search.d.ts +35 -0
  838. package/dist/search.d.ts.map +1 -0
  839. package/dist/search.js +574 -0
  840. package/dist/search.js.map +1 -0
  841. package/dist/security/localhostOnly.d.ts +36 -0
  842. package/dist/security/localhostOnly.d.ts.map +1 -0
  843. package/dist/security/localhostOnly.js +101 -0
  844. package/dist/security/localhostOnly.js.map +1 -0
  845. package/dist/services/CameraZoomSearch.d.ts +206 -0
  846. package/dist/services/CameraZoomSearch.d.ts.map +1 -0
  847. package/dist/services/CameraZoomSearch.js +669 -0
  848. package/dist/services/CameraZoomSearch.js.map +1 -0
  849. package/dist/services/DataFlowPipeline.d.ts +111 -0
  850. package/dist/services/DataFlowPipeline.d.ts.map +1 -0
  851. package/dist/services/DataFlowPipeline.js +379 -0
  852. package/dist/services/DataFlowPipeline.js.map +1 -0
  853. package/dist/services/DimensionAdapter.d.ts +194 -0
  854. package/dist/services/DimensionAdapter.d.ts.map +1 -0
  855. package/dist/services/DimensionAdapter.js +566 -0
  856. package/dist/services/DimensionAdapter.js.map +1 -0
  857. package/dist/services/DimensionService.d.ts +252 -0
  858. package/dist/services/DimensionService.d.ts.map +1 -0
  859. package/dist/services/DimensionService.js +564 -0
  860. package/dist/services/DimensionService.js.map +1 -0
  861. package/dist/services/EmbeddingQueue.d.ts +71 -0
  862. package/dist/services/EmbeddingQueue.d.ts.map +1 -0
  863. package/dist/services/EmbeddingQueue.js +258 -0
  864. package/dist/services/EmbeddingQueue.js.map +1 -0
  865. package/dist/services/MemoryDrilldown.d.ts +226 -0
  866. package/dist/services/MemoryDrilldown.d.ts.map +1 -0
  867. package/dist/services/MemoryDrilldown.js +479 -0
  868. package/dist/services/MemoryDrilldown.js.map +1 -0
  869. package/dist/services/MiniCOTScorer.d.ts +140 -0
  870. package/dist/services/MiniCOTScorer.d.ts.map +1 -0
  871. package/dist/services/MiniCOTScorer.js +292 -0
  872. package/dist/services/MiniCOTScorer.js.map +1 -0
  873. package/dist/services/ProjectContext.d.ts +342 -0
  874. package/dist/services/ProjectContext.d.ts.map +1 -0
  875. package/dist/services/ProjectContext.js +667 -0
  876. package/dist/services/ProjectContext.js.map +1 -0
  877. package/dist/services/ResponseCompactor.d.ts +135 -0
  878. package/dist/services/ResponseCompactor.d.ts.map +1 -0
  879. package/dist/services/ResponseCompactor.js +501 -0
  880. package/dist/services/ResponseCompactor.js.map +1 -0
  881. package/dist/services/TeamCommsDbService.d.ts +202 -0
  882. package/dist/services/TeamCommsDbService.d.ts.map +1 -0
  883. package/dist/services/TeamCommsDbService.js +526 -0
  884. package/dist/services/TeamCommsDbService.js.map +1 -0
  885. package/dist/services/UnifiedPasswordService.d.ts +166 -0
  886. package/dist/services/UnifiedPasswordService.d.ts.map +1 -0
  887. package/dist/services/UnifiedPasswordService.js +587 -0
  888. package/dist/services/UnifiedPasswordService.js.map +1 -0
  889. package/dist/services/adaptiveSearchConfig.d.ts +64 -0
  890. package/dist/services/adaptiveSearchConfig.d.ts.map +1 -0
  891. package/dist/services/adaptiveSearchConfig.js +187 -0
  892. package/dist/services/adaptiveSearchConfig.js.map +1 -0
  893. package/dist/skills/index.d.ts +8 -0
  894. package/dist/skills/index.d.ts.map +1 -0
  895. package/dist/skills/index.js +8 -0
  896. package/dist/skills/index.js.map +1 -0
  897. package/dist/skills/skillScanner.d.ts +203 -0
  898. package/dist/skills/skillScanner.d.ts.map +1 -0
  899. package/dist/skills/skillScanner.js +559 -0
  900. package/dist/skills/skillScanner.js.map +1 -0
  901. package/dist/skills/skillsResource.d.ts +69 -0
  902. package/dist/skills/skillsResource.d.ts.map +1 -0
  903. package/dist/skills/skillsResource.js +257 -0
  904. package/dist/skills/skillsResource.js.map +1 -0
  905. package/dist/startup/index.d.ts +9 -0
  906. package/dist/startup/index.d.ts.map +1 -0
  907. package/dist/startup/index.js +12 -0
  908. package/dist/startup/index.js.map +1 -0
  909. package/dist/startup/startupIndexing.d.ts +80 -0
  910. package/dist/startup/startupIndexing.d.ts.map +1 -0
  911. package/dist/startup/startupIndexing.js +463 -0
  912. package/dist/startup/startupIndexing.js.map +1 -0
  913. package/dist/startup/validation.d.ts +89 -0
  914. package/dist/startup/validation.d.ts.map +1 -0
  915. package/dist/startup/validation.js +590 -0
  916. package/dist/startup/validation.js.map +1 -0
  917. package/dist/storage/index.d.ts +4 -0
  918. package/dist/storage/index.d.ts.map +1 -0
  919. package/dist/storage/index.js +4 -0
  920. package/dist/storage/index.js.map +1 -0
  921. package/dist/storage/overflowManager.d.ts +80 -0
  922. package/dist/storage/overflowManager.d.ts.map +1 -0
  923. package/dist/storage/overflowManager.js +317 -0
  924. package/dist/storage/overflowManager.js.map +1 -0
  925. package/dist/storage/overflowStorage.d.ts +69 -0
  926. package/dist/storage/overflowStorage.d.ts.map +1 -0
  927. package/dist/storage/overflowStorage.js +379 -0
  928. package/dist/storage/overflowStorage.js.map +1 -0
  929. package/dist/storage/toonFormat.d.ts +50 -0
  930. package/dist/storage/toonFormat.d.ts.map +1 -0
  931. package/dist/storage/toonFormat.js +224 -0
  932. package/dist/storage/toonFormat.js.map +1 -0
  933. package/dist/team-members/communication.d.ts +237 -0
  934. package/dist/team-members/communication.d.ts.map +1 -0
  935. package/dist/team-members/communication.js +650 -0
  936. package/dist/team-members/communication.js.map +1 -0
  937. package/dist/team-members/index.d.ts +14 -0
  938. package/dist/team-members/index.d.ts.map +1 -0
  939. package/dist/team-members/index.js +22 -0
  940. package/dist/team-members/index.js.map +1 -0
  941. package/dist/team-members/taskOrchestrator.d.ts +224 -0
  942. package/dist/team-members/taskOrchestrator.d.ts.map +1 -0
  943. package/dist/team-members/taskOrchestrator.js +574 -0
  944. package/dist/team-members/taskOrchestrator.js.map +1 -0
  945. package/dist/team-members/taskTeamMemberLogger.d.ts +157 -0
  946. package/dist/team-members/taskTeamMemberLogger.d.ts.map +1 -0
  947. package/dist/team-members/taskTeamMemberLogger.js +478 -0
  948. package/dist/team-members/taskTeamMemberLogger.js.map +1 -0
  949. package/dist/team-members/teamCommsService.d.ts +221 -0
  950. package/dist/team-members/teamCommsService.d.ts.map +1 -0
  951. package/dist/team-members/teamCommsService.js +628 -0
  952. package/dist/team-members/teamCommsService.js.map +1 -0
  953. package/dist/team-members/teamMemberChannels.d.ts +217 -0
  954. package/dist/team-members/teamMemberChannels.d.ts.map +1 -0
  955. package/dist/team-members/teamMemberChannels.js +687 -0
  956. package/dist/team-members/teamMemberChannels.js.map +1 -0
  957. package/dist/team-members/teamMemberDashboard.d.ts +222 -0
  958. package/dist/team-members/teamMemberDashboard.d.ts.map +1 -0
  959. package/dist/team-members/teamMemberDashboard.js +610 -0
  960. package/dist/team-members/teamMemberDashboard.js.map +1 -0
  961. package/dist/team-members/teamMemberDeployment.d.ts +60 -0
  962. package/dist/team-members/teamMemberDeployment.d.ts.map +1 -0
  963. package/dist/team-members/teamMemberDeployment.js +429 -0
  964. package/dist/team-members/teamMemberDeployment.js.map +1 -0
  965. package/dist/team-members/teamMemberDiscovery.d.ts +178 -0
  966. package/dist/team-members/teamMemberDiscovery.d.ts.map +1 -0
  967. package/dist/team-members/teamMemberDiscovery.js +446 -0
  968. package/dist/team-members/teamMemberDiscovery.js.map +1 -0
  969. package/dist/team-members/teamMemberHistory.d.ts +80 -0
  970. package/dist/team-members/teamMemberHistory.d.ts.map +1 -0
  971. package/dist/team-members/teamMemberHistory.js +426 -0
  972. package/dist/team-members/teamMemberHistory.js.map +1 -0
  973. package/dist/team-members/teamMemberLimits.d.ts +66 -0
  974. package/dist/team-members/teamMemberLimits.d.ts.map +1 -0
  975. package/dist/team-members/teamMemberLimits.js +259 -0
  976. package/dist/team-members/teamMemberLimits.js.map +1 -0
  977. package/dist/team-members/teamMemberRegistry.d.ts +199 -0
  978. package/dist/team-members/teamMemberRegistry.d.ts.map +1 -0
  979. package/dist/team-members/teamMemberRegistry.js +572 -0
  980. package/dist/team-members/teamMemberRegistry.js.map +1 -0
  981. package/dist/team-members/teamMemberTracker.d.ts +148 -0
  982. package/dist/team-members/teamMemberTracker.d.ts.map +1 -0
  983. package/dist/team-members/teamMemberTracker.js +828 -0
  984. package/dist/team-members/teamMemberTracker.js.map +1 -0
  985. package/dist/team-members/workers/aiWorker.d.ts +53 -0
  986. package/dist/team-members/workers/aiWorker.d.ts.map +1 -0
  987. package/dist/team-members/workers/aiWorker.js +322 -0
  988. package/dist/team-members/workers/aiWorker.js.map +1 -0
  989. package/dist/team-members/workers/baseWorker.d.ts +101 -0
  990. package/dist/team-members/workers/baseWorker.d.ts.map +1 -0
  991. package/dist/team-members/workers/baseWorker.js +179 -0
  992. package/dist/team-members/workers/baseWorker.js.map +1 -0
  993. package/dist/team-members/workers/codeReviewWorker.d.ts +3 -0
  994. package/dist/team-members/workers/codeReviewWorker.d.ts.map +1 -0
  995. package/dist/team-members/workers/codeReviewWorker.js +144 -0
  996. package/dist/team-members/workers/codeReviewWorker.js.map +1 -0
  997. package/dist/team-members/workers/index.d.ts +7 -0
  998. package/dist/team-members/workers/index.d.ts.map +1 -0
  999. package/dist/team-members/workers/index.js +7 -0
  1000. package/dist/team-members/workers/index.js.map +1 -0
  1001. package/dist/team-members/workers/repairWorker.d.ts +9 -0
  1002. package/dist/team-members/workers/repairWorker.d.ts.map +1 -0
  1003. package/dist/team-members/workers/repairWorker.js +102 -0
  1004. package/dist/team-members/workers/repairWorker.js.map +1 -0
  1005. package/dist/team-members/workers/sendToTeamMemberB.d.ts +9 -0
  1006. package/dist/team-members/workers/sendToTeamMemberB.d.ts.map +1 -0
  1007. package/dist/team-members/workers/sendToTeamMemberB.js +105 -0
  1008. package/dist/team-members/workers/sendToTeamMemberB.js.map +1 -0
  1009. package/dist/team-members/workers/specmemClient.d.ts +179 -0
  1010. package/dist/team-members/workers/specmemClient.d.ts.map +1 -0
  1011. package/dist/team-members/workers/specmemClient.js +421 -0
  1012. package/dist/team-members/workers/specmemClient.js.map +1 -0
  1013. package/dist/team-members/workers/testCommunication.d.ts +8 -0
  1014. package/dist/team-members/workers/testCommunication.d.ts.map +1 -0
  1015. package/dist/team-members/workers/testCommunication.js +136 -0
  1016. package/dist/team-members/workers/testCommunication.js.map +1 -0
  1017. package/dist/team-members/workers/testCommunicationSuite.d.ts +26 -0
  1018. package/dist/team-members/workers/testCommunicationSuite.d.ts.map +1 -0
  1019. package/dist/team-members/workers/testCommunicationSuite.js +415 -0
  1020. package/dist/team-members/workers/testCommunicationSuite.js.map +1 -0
  1021. package/dist/team-members/workers/testWorker.d.ts +9 -0
  1022. package/dist/team-members/workers/testWorker.d.ts.map +1 -0
  1023. package/dist/team-members/workers/testWorker.js +107 -0
  1024. package/dist/team-members/workers/testWorker.js.map +1 -0
  1025. package/dist/tools/agentDefinitions.d.ts +30 -0
  1026. package/dist/tools/agentDefinitions.d.ts.map +1 -0
  1027. package/dist/tools/agentDefinitions.js +166 -0
  1028. package/dist/tools/agentDefinitions.js.map +1 -0
  1029. package/dist/tools/goofy/checkSyncStatus.d.ts +68 -0
  1030. package/dist/tools/goofy/checkSyncStatus.d.ts.map +1 -0
  1031. package/dist/tools/goofy/checkSyncStatus.js +112 -0
  1032. package/dist/tools/goofy/checkSyncStatus.js.map +1 -0
  1033. package/dist/tools/goofy/codeMemoryLink.d.ts +82 -0
  1034. package/dist/tools/goofy/codeMemoryLink.d.ts.map +1 -0
  1035. package/dist/tools/goofy/codeMemoryLink.js +212 -0
  1036. package/dist/tools/goofy/codeMemoryLink.js.map +1 -0
  1037. package/dist/tools/goofy/compareInstanceMemory.d.ts +97 -0
  1038. package/dist/tools/goofy/compareInstanceMemory.d.ts.map +1 -0
  1039. package/dist/tools/goofy/compareInstanceMemory.js +218 -0
  1040. package/dist/tools/goofy/compareInstanceMemory.js.map +1 -0
  1041. package/dist/tools/goofy/createReasoningChain.d.ts +135 -0
  1042. package/dist/tools/goofy/createReasoningChain.d.ts.map +1 -0
  1043. package/dist/tools/goofy/createReasoningChain.js +257 -0
  1044. package/dist/tools/goofy/createReasoningChain.js.map +1 -0
  1045. package/dist/tools/goofy/deployTeamMember.d.ts +63 -0
  1046. package/dist/tools/goofy/deployTeamMember.d.ts.map +1 -0
  1047. package/dist/tools/goofy/deployTeamMember.js +103 -0
  1048. package/dist/tools/goofy/deployTeamMember.js.map +1 -0
  1049. package/dist/tools/goofy/drillDown.d.ts +143 -0
  1050. package/dist/tools/goofy/drillDown.d.ts.map +1 -0
  1051. package/dist/tools/goofy/drillDown.js +288 -0
  1052. package/dist/tools/goofy/drillDown.js.map +1 -0
  1053. package/dist/tools/goofy/extractClaudeSessions.d.ts +90 -0
  1054. package/dist/tools/goofy/extractClaudeSessions.d.ts.map +1 -0
  1055. package/dist/tools/goofy/extractClaudeSessions.js +277 -0
  1056. package/dist/tools/goofy/extractClaudeSessions.js.map +1 -0
  1057. package/dist/tools/goofy/extractContextRestorations.d.ts +70 -0
  1058. package/dist/tools/goofy/extractContextRestorations.d.ts.map +1 -0
  1059. package/dist/tools/goofy/extractContextRestorations.js +100 -0
  1060. package/dist/tools/goofy/extractContextRestorations.js.map +1 -0
  1061. package/dist/tools/goofy/findCodePointers.d.ts +364 -0
  1062. package/dist/tools/goofy/findCodePointers.d.ts.map +1 -0
  1063. package/dist/tools/goofy/findCodePointers.js +1764 -0
  1064. package/dist/tools/goofy/findCodePointers.js.map +1 -0
  1065. package/dist/tools/goofy/findMemoryGallery.d.ts +40 -0
  1066. package/dist/tools/goofy/findMemoryGallery.d.ts.map +1 -0
  1067. package/dist/tools/goofy/findMemoryGallery.js +66 -0
  1068. package/dist/tools/goofy/findMemoryGallery.js.map +1 -0
  1069. package/dist/tools/goofy/findWhatISaid.d.ts +300 -0
  1070. package/dist/tools/goofy/findWhatISaid.d.ts.map +1 -0
  1071. package/dist/tools/goofy/findWhatISaid.js +2547 -0
  1072. package/dist/tools/goofy/findWhatISaid.js.map +1 -0
  1073. package/dist/tools/goofy/forceResync.d.ts +57 -0
  1074. package/dist/tools/goofy/forceResync.d.ts.map +1 -0
  1075. package/dist/tools/goofy/forceResync.js +100 -0
  1076. package/dist/tools/goofy/forceResync.js.map +1 -0
  1077. package/dist/tools/goofy/getActiveTeamMembers.d.ts +48 -0
  1078. package/dist/tools/goofy/getActiveTeamMembers.d.ts.map +1 -0
  1079. package/dist/tools/goofy/getActiveTeamMembers.js +136 -0
  1080. package/dist/tools/goofy/getActiveTeamMembers.js.map +1 -0
  1081. package/dist/tools/goofy/getMemoryFull.d.ts +34 -0
  1082. package/dist/tools/goofy/getMemoryFull.d.ts.map +1 -0
  1083. package/dist/tools/goofy/getMemoryFull.js +58 -0
  1084. package/dist/tools/goofy/getMemoryFull.js.map +1 -0
  1085. package/dist/tools/goofy/getSessionWatcherStatus.d.ts +43 -0
  1086. package/dist/tools/goofy/getSessionWatcherStatus.d.ts.map +1 -0
  1087. package/dist/tools/goofy/getSessionWatcherStatus.js +92 -0
  1088. package/dist/tools/goofy/getSessionWatcherStatus.js.map +1 -0
  1089. package/dist/tools/goofy/getTeamMemberOutput.d.ts +35 -0
  1090. package/dist/tools/goofy/getTeamMemberOutput.d.ts.map +1 -0
  1091. package/dist/tools/goofy/getTeamMemberOutput.js +62 -0
  1092. package/dist/tools/goofy/getTeamMemberOutput.js.map +1 -0
  1093. package/dist/tools/goofy/getTeamMemberScreen.d.ts +28 -0
  1094. package/dist/tools/goofy/getTeamMemberScreen.d.ts.map +1 -0
  1095. package/dist/tools/goofy/getTeamMemberScreen.js +59 -0
  1096. package/dist/tools/goofy/getTeamMemberScreen.js.map +1 -0
  1097. package/dist/tools/goofy/getTeamMemberStatus.d.ts +33 -0
  1098. package/dist/tools/goofy/getTeamMemberStatus.d.ts.map +1 -0
  1099. package/dist/tools/goofy/getTeamMemberStatus.js +56 -0
  1100. package/dist/tools/goofy/getTeamMemberStatus.js.map +1 -0
  1101. package/dist/tools/goofy/index.d.ts +39 -0
  1102. package/dist/tools/goofy/index.d.ts.map +1 -0
  1103. package/dist/tools/goofy/index.js +51 -0
  1104. package/dist/tools/goofy/index.js.map +1 -0
  1105. package/dist/tools/goofy/interveneTeamMember.d.ts +33 -0
  1106. package/dist/tools/goofy/interveneTeamMember.d.ts.map +1 -0
  1107. package/dist/tools/goofy/interveneTeamMember.js +69 -0
  1108. package/dist/tools/goofy/interveneTeamMember.js.map +1 -0
  1109. package/dist/tools/goofy/killDeployedTeamMember.d.ts +29 -0
  1110. package/dist/tools/goofy/killDeployedTeamMember.d.ts.map +1 -0
  1111. package/dist/tools/goofy/killDeployedTeamMember.js +56 -0
  1112. package/dist/tools/goofy/killDeployedTeamMember.js.map +1 -0
  1113. package/dist/tools/goofy/linkTheVibes.d.ts +125 -0
  1114. package/dist/tools/goofy/linkTheVibes.d.ts.map +1 -0
  1115. package/dist/tools/goofy/linkTheVibes.js +354 -0
  1116. package/dist/tools/goofy/linkTheVibes.js.map +1 -0
  1117. package/dist/tools/goofy/listDeployedTeamMembers.d.ts +26 -0
  1118. package/dist/tools/goofy/listDeployedTeamMembers.d.ts.map +1 -0
  1119. package/dist/tools/goofy/listDeployedTeamMembers.js +52 -0
  1120. package/dist/tools/goofy/listDeployedTeamMembers.js.map +1 -0
  1121. package/dist/tools/goofy/listenForMessages.d.ts +56 -0
  1122. package/dist/tools/goofy/listenForMessages.d.ts.map +1 -0
  1123. package/dist/tools/goofy/listenForMessages.js +122 -0
  1124. package/dist/tools/goofy/listenForMessages.js.map +1 -0
  1125. package/dist/tools/goofy/memoryHealthCheck.d.ts +159 -0
  1126. package/dist/tools/goofy/memoryHealthCheck.d.ts.map +1 -0
  1127. package/dist/tools/goofy/memoryHealthCheck.js +443 -0
  1128. package/dist/tools/goofy/memoryHealthCheck.js.map +1 -0
  1129. package/dist/tools/goofy/rememberThisShit.d.ts +103 -0
  1130. package/dist/tools/goofy/rememberThisShit.d.ts.map +1 -0
  1131. package/dist/tools/goofy/rememberThisShit.js +291 -0
  1132. package/dist/tools/goofy/rememberThisShit.js.map +1 -0
  1133. package/dist/tools/goofy/sayToTeamMember.d.ts +55 -0
  1134. package/dist/tools/goofy/sayToTeamMember.d.ts.map +1 -0
  1135. package/dist/tools/goofy/sayToTeamMember.js +116 -0
  1136. package/dist/tools/goofy/sayToTeamMember.js.map +1 -0
  1137. package/dist/tools/goofy/selfMessage.d.ts +54 -0
  1138. package/dist/tools/goofy/selfMessage.d.ts.map +1 -0
  1139. package/dist/tools/goofy/selfMessage.js +111 -0
  1140. package/dist/tools/goofy/selfMessage.js.map +1 -0
  1141. package/dist/tools/goofy/sendHeartbeat.d.ts +53 -0
  1142. package/dist/tools/goofy/sendHeartbeat.d.ts.map +1 -0
  1143. package/dist/tools/goofy/sendHeartbeat.js +119 -0
  1144. package/dist/tools/goofy/sendHeartbeat.js.map +1 -0
  1145. package/dist/tools/goofy/showMeTheStats.d.ts +216 -0
  1146. package/dist/tools/goofy/showMeTheStats.d.ts.map +1 -0
  1147. package/dist/tools/goofy/showMeTheStats.js +535 -0
  1148. package/dist/tools/goofy/showMeTheStats.js.map +1 -0
  1149. package/dist/tools/goofy/smartRecall.d.ts +136 -0
  1150. package/dist/tools/goofy/smartRecall.d.ts.map +1 -0
  1151. package/dist/tools/goofy/smartRecall.js +286 -0
  1152. package/dist/tools/goofy/smartRecall.js.map +1 -0
  1153. package/dist/tools/goofy/smartSearch.d.ts +64 -0
  1154. package/dist/tools/goofy/smartSearch.d.ts.map +1 -0
  1155. package/dist/tools/goofy/smartSearch.js +89 -0
  1156. package/dist/tools/goofy/smartSearch.js.map +1 -0
  1157. package/dist/tools/goofy/smushMemoriesTogether.d.ts +128 -0
  1158. package/dist/tools/goofy/smushMemoriesTogether.d.ts.map +1 -0
  1159. package/dist/tools/goofy/smushMemoriesTogether.js +536 -0
  1160. package/dist/tools/goofy/smushMemoriesTogether.js.map +1 -0
  1161. package/dist/tools/goofy/spatialSearch.d.ts +198 -0
  1162. package/dist/tools/goofy/spatialSearch.d.ts.map +1 -0
  1163. package/dist/tools/goofy/spatialSearch.js +551 -0
  1164. package/dist/tools/goofy/spatialSearch.js.map +1 -0
  1165. package/dist/tools/goofy/spawnResearchTeamMember.d.ts +104 -0
  1166. package/dist/tools/goofy/spawnResearchTeamMember.d.ts.map +1 -0
  1167. package/dist/tools/goofy/spawnResearchTeamMember.js +290 -0
  1168. package/dist/tools/goofy/spawnResearchTeamMember.js.map +1 -0
  1169. package/dist/tools/goofy/spawnResearchTeamMemberTool.d.ts +121 -0
  1170. package/dist/tools/goofy/spawnResearchTeamMemberTool.d.ts.map +1 -0
  1171. package/dist/tools/goofy/spawnResearchTeamMemberTool.js +215 -0
  1172. package/dist/tools/goofy/spawnResearchTeamMemberTool.js.map +1 -0
  1173. package/dist/tools/goofy/startWatchingTheFiles.d.ts +81 -0
  1174. package/dist/tools/goofy/startWatchingTheFiles.d.ts.map +1 -0
  1175. package/dist/tools/goofy/startWatchingTheFiles.js +161 -0
  1176. package/dist/tools/goofy/startWatchingTheFiles.js.map +1 -0
  1177. package/dist/tools/goofy/stopWatchingTheFiles.d.ts +50 -0
  1178. package/dist/tools/goofy/stopWatchingTheFiles.d.ts.map +1 -0
  1179. package/dist/tools/goofy/stopWatchingTheFiles.js +81 -0
  1180. package/dist/tools/goofy/stopWatchingTheFiles.js.map +1 -0
  1181. package/dist/tools/goofy/whatDidIMean.d.ts +113 -0
  1182. package/dist/tools/goofy/whatDidIMean.d.ts.map +1 -0
  1183. package/dist/tools/goofy/whatDidIMean.js +401 -0
  1184. package/dist/tools/goofy/whatDidIMean.js.map +1 -0
  1185. package/dist/tools/goofy/yeahNahDeleteThat.d.ts +109 -0
  1186. package/dist/tools/goofy/yeahNahDeleteThat.d.ts.map +1 -0
  1187. package/dist/tools/goofy/yeahNahDeleteThat.js +319 -0
  1188. package/dist/tools/goofy/yeahNahDeleteThat.js.map +1 -0
  1189. package/dist/tools/index.d.ts +9 -0
  1190. package/dist/tools/index.d.ts.map +1 -0
  1191. package/dist/tools/index.js +9 -0
  1192. package/dist/tools/index.js.map +1 -0
  1193. package/dist/tools/teamMemberDeployer.d.ts +117 -0
  1194. package/dist/tools/teamMemberDeployer.d.ts.map +1 -0
  1195. package/dist/tools/teamMemberDeployer.js +613 -0
  1196. package/dist/tools/teamMemberDeployer.js.map +1 -0
  1197. package/dist/trace/index.d.ts +14 -0
  1198. package/dist/trace/index.d.ts.map +1 -0
  1199. package/dist/trace/index.js +16 -0
  1200. package/dist/trace/index.js.map +1 -0
  1201. package/dist/trace/tools/analyzeImpact.d.ts +90 -0
  1202. package/dist/trace/tools/analyzeImpact.d.ts.map +1 -0
  1203. package/dist/trace/tools/analyzeImpact.js +240 -0
  1204. package/dist/trace/tools/analyzeImpact.js.map +1 -0
  1205. package/dist/trace/tools/exploreDependencies.d.ts +81 -0
  1206. package/dist/trace/tools/exploreDependencies.d.ts.map +1 -0
  1207. package/dist/trace/tools/exploreDependencies.js +161 -0
  1208. package/dist/trace/tools/exploreDependencies.js.map +1 -0
  1209. package/dist/trace/tools/findSimilarBugs.d.ts +112 -0
  1210. package/dist/trace/tools/findSimilarBugs.d.ts.map +1 -0
  1211. package/dist/trace/tools/findSimilarBugs.js +216 -0
  1212. package/dist/trace/tools/findSimilarBugs.js.map +1 -0
  1213. package/dist/trace/tools/index.d.ts +22 -0
  1214. package/dist/trace/tools/index.d.ts.map +1 -0
  1215. package/dist/trace/tools/index.js +39 -0
  1216. package/dist/trace/tools/index.js.map +1 -0
  1217. package/dist/trace/tools/smartExplore.d.ts +126 -0
  1218. package/dist/trace/tools/smartExplore.d.ts.map +1 -0
  1219. package/dist/trace/tools/smartExplore.js +303 -0
  1220. package/dist/trace/tools/smartExplore.js.map +1 -0
  1221. package/dist/trace/tools/traceError.d.ts +101 -0
  1222. package/dist/trace/tools/traceError.d.ts.map +1 -0
  1223. package/dist/trace/tools/traceError.js +175 -0
  1224. package/dist/trace/tools/traceError.js.map +1 -0
  1225. package/dist/trace/traceExploreSystem.d.ts +271 -0
  1226. package/dist/trace/traceExploreSystem.d.ts.map +1 -0
  1227. package/dist/trace/traceExploreSystem.js +789 -0
  1228. package/dist/trace/traceExploreSystem.js.map +1 -0
  1229. package/dist/types/index.d.ts +421 -0
  1230. package/dist/types/index.d.ts.map +1 -0
  1231. package/dist/types/index.js +118 -0
  1232. package/dist/types/index.js.map +1 -0
  1233. package/dist/utils/circuitBreaker.d.ts +195 -0
  1234. package/dist/utils/circuitBreaker.d.ts.map +1 -0
  1235. package/dist/utils/circuitBreaker.js +374 -0
  1236. package/dist/utils/circuitBreaker.js.map +1 -0
  1237. package/dist/utils/cleanupHandler.d.ts +108 -0
  1238. package/dist/utils/cleanupHandler.d.ts.map +1 -0
  1239. package/dist/utils/cleanupHandler.js +203 -0
  1240. package/dist/utils/cleanupHandler.js.map +1 -0
  1241. package/dist/utils/compactXmlResponse.d.ts +60 -0
  1242. package/dist/utils/compactXmlResponse.d.ts.map +1 -0
  1243. package/dist/utils/compactXmlResponse.js +209 -0
  1244. package/dist/utils/compactXmlResponse.js.map +1 -0
  1245. package/dist/utils/cotBroadcast.d.ts +56 -0
  1246. package/dist/utils/cotBroadcast.d.ts.map +1 -0
  1247. package/dist/utils/cotBroadcast.js +157 -0
  1248. package/dist/utils/cotBroadcast.js.map +1 -0
  1249. package/dist/utils/debugLogger.d.ts +95 -0
  1250. package/dist/utils/debugLogger.d.ts.map +1 -0
  1251. package/dist/utils/debugLogger.js +610 -0
  1252. package/dist/utils/debugLogger.js.map +1 -0
  1253. package/dist/utils/fileProcessingQueue.d.ts +259 -0
  1254. package/dist/utils/fileProcessingQueue.d.ts.map +1 -0
  1255. package/dist/utils/fileProcessingQueue.js +714 -0
  1256. package/dist/utils/fileProcessingQueue.js.map +1 -0
  1257. package/dist/utils/humanReadableOutput.d.ts +124 -0
  1258. package/dist/utils/humanReadableOutput.d.ts.map +1 -0
  1259. package/dist/utils/humanReadableOutput.js +340 -0
  1260. package/dist/utils/humanReadableOutput.js.map +1 -0
  1261. package/dist/utils/index.d.ts +32 -0
  1262. package/dist/utils/index.d.ts.map +1 -0
  1263. package/dist/utils/index.js +71 -0
  1264. package/dist/utils/index.js.map +1 -0
  1265. package/dist/utils/instanceManager.d.ts +530 -0
  1266. package/dist/utils/instanceManager.d.ts.map +1 -0
  1267. package/dist/utils/instanceManager.js +1784 -0
  1268. package/dist/utils/instanceManager.js.map +1 -0
  1269. package/dist/utils/logger.d.ts +6 -0
  1270. package/dist/utils/logger.d.ts.map +1 -0
  1271. package/dist/utils/logger.js +49 -0
  1272. package/dist/utils/logger.js.map +1 -0
  1273. package/dist/utils/mapCleanup.d.ts +58 -0
  1274. package/dist/utils/mapCleanup.d.ts.map +1 -0
  1275. package/dist/utils/mapCleanup.js +150 -0
  1276. package/dist/utils/mapCleanup.js.map +1 -0
  1277. package/dist/utils/memoryManager.d.ts +349 -0
  1278. package/dist/utils/memoryManager.d.ts.map +1 -0
  1279. package/dist/utils/memoryManager.js +799 -0
  1280. package/dist/utils/memoryManager.js.map +1 -0
  1281. package/dist/utils/metrics.d.ts +160 -0
  1282. package/dist/utils/metrics.d.ts.map +1 -0
  1283. package/dist/utils/metrics.js +558 -0
  1284. package/dist/utils/metrics.js.map +1 -0
  1285. package/dist/utils/pathValidator.d.ts +96 -0
  1286. package/dist/utils/pathValidator.d.ts.map +1 -0
  1287. package/dist/utils/pathValidator.js +320 -0
  1288. package/dist/utils/pathValidator.js.map +1 -0
  1289. package/dist/utils/portAllocator.d.ts +296 -0
  1290. package/dist/utils/portAllocator.d.ts.map +1 -0
  1291. package/dist/utils/portAllocator.js +768 -0
  1292. package/dist/utils/portAllocator.js.map +1 -0
  1293. package/dist/utils/portUtils.d.ts +97 -0
  1294. package/dist/utils/portUtils.d.ts.map +1 -0
  1295. package/dist/utils/portUtils.js +285 -0
  1296. package/dist/utils/portUtils.js.map +1 -0
  1297. package/dist/utils/postgresAutoSetup.d.ts +55 -0
  1298. package/dist/utils/postgresAutoSetup.d.ts.map +1 -0
  1299. package/dist/utils/postgresAutoSetup.js +406 -0
  1300. package/dist/utils/postgresAutoSetup.js.map +1 -0
  1301. package/dist/utils/processHealthCheck.d.ts +61 -0
  1302. package/dist/utils/processHealthCheck.d.ts.map +1 -0
  1303. package/dist/utils/processHealthCheck.js +313 -0
  1304. package/dist/utils/processHealthCheck.js.map +1 -0
  1305. package/dist/utils/progressReporter.d.ts +151 -0
  1306. package/dist/utils/progressReporter.d.ts.map +1 -0
  1307. package/dist/utils/progressReporter.js +345 -0
  1308. package/dist/utils/progressReporter.js.map +1 -0
  1309. package/dist/utils/projectEnv.d.ts +73 -0
  1310. package/dist/utils/projectEnv.d.ts.map +1 -0
  1311. package/dist/utils/projectEnv.js +137 -0
  1312. package/dist/utils/projectEnv.js.map +1 -0
  1313. package/dist/utils/qoms.d.ts +122 -0
  1314. package/dist/utils/qoms.d.ts.map +1 -0
  1315. package/dist/utils/qoms.js +650 -0
  1316. package/dist/utils/qoms.js.map +1 -0
  1317. package/dist/utils/retryHelper.d.ts +122 -0
  1318. package/dist/utils/retryHelper.d.ts.map +1 -0
  1319. package/dist/utils/retryHelper.js +272 -0
  1320. package/dist/utils/retryHelper.js.map +1 -0
  1321. package/dist/utils/safeProcessTermination.d.ts +206 -0
  1322. package/dist/utils/safeProcessTermination.d.ts.map +1 -0
  1323. package/dist/utils/safeProcessTermination.js +552 -0
  1324. package/dist/utils/safeProcessTermination.js.map +1 -0
  1325. package/dist/utils/sessionInjector.d.ts +68 -0
  1326. package/dist/utils/sessionInjector.d.ts.map +1 -0
  1327. package/dist/utils/sessionInjector.js +189 -0
  1328. package/dist/utils/sessionInjector.js.map +1 -0
  1329. package/dist/utils/statsCache.d.ts +134 -0
  1330. package/dist/utils/statsCache.d.ts.map +1 -0
  1331. package/dist/utils/statsCache.js +285 -0
  1332. package/dist/utils/statsCache.js.map +1 -0
  1333. package/dist/utils/timeoutMiddleware.d.ts +81 -0
  1334. package/dist/utils/timeoutMiddleware.d.ts.map +1 -0
  1335. package/dist/utils/timeoutMiddleware.js +155 -0
  1336. package/dist/utils/timeoutMiddleware.js.map +1 -0
  1337. package/dist/utils/timerRegistry.d.ts +91 -0
  1338. package/dist/utils/timerRegistry.d.ts.map +1 -0
  1339. package/dist/utils/timerRegistry.js +187 -0
  1340. package/dist/utils/timerRegistry.js.map +1 -0
  1341. package/dist/utils/tokenCompressor.d.ts +332 -0
  1342. package/dist/utils/tokenCompressor.d.ts.map +1 -0
  1343. package/dist/utils/tokenCompressor.js +1306 -0
  1344. package/dist/utils/tokenCompressor.js.map +1 -0
  1345. package/dist/utils/tracing.d.ts +236 -0
  1346. package/dist/utils/tracing.d.ts.map +1 -0
  1347. package/dist/utils/tracing.js +378 -0
  1348. package/dist/utils/tracing.js.map +1 -0
  1349. package/dist/watcher/changeHandler.d.ts +123 -0
  1350. package/dist/watcher/changeHandler.d.ts.map +1 -0
  1351. package/dist/watcher/changeHandler.js +623 -0
  1352. package/dist/watcher/changeHandler.js.map +1 -0
  1353. package/dist/watcher/changeQueue.d.ts +133 -0
  1354. package/dist/watcher/changeQueue.d.ts.map +1 -0
  1355. package/dist/watcher/changeQueue.js +355 -0
  1356. package/dist/watcher/changeQueue.js.map +1 -0
  1357. package/dist/watcher/fileWatcher.d.ts +121 -0
  1358. package/dist/watcher/fileWatcher.d.ts.map +1 -0
  1359. package/dist/watcher/fileWatcher.js +531 -0
  1360. package/dist/watcher/fileWatcher.js.map +1 -0
  1361. package/dist/watcher/index.d.ts +94 -0
  1362. package/dist/watcher/index.d.ts.map +1 -0
  1363. package/dist/watcher/index.js +235 -0
  1364. package/dist/watcher/index.js.map +1 -0
  1365. package/dist/watcher/syncChecker.d.ts +93 -0
  1366. package/dist/watcher/syncChecker.d.ts.map +1 -0
  1367. package/dist/watcher/syncChecker.js +401 -0
  1368. package/dist/watcher/syncChecker.js.map +1 -0
  1369. package/dist/watcher/tsCompiler.d.ts +88 -0
  1370. package/dist/watcher/tsCompiler.d.ts.map +1 -0
  1371. package/dist/watcher/tsCompiler.js +212 -0
  1372. package/dist/watcher/tsCompiler.js.map +1 -0
  1373. package/embedding-sandbox/Dockerfile +77 -0
  1374. package/embedding-sandbox/Dockerfile.frankenstein +91 -0
  1375. package/embedding-sandbox/README.md +193 -0
  1376. package/embedding-sandbox/__pycache__/frankenstein-embeddings.cpython-312.pyc +0 -0
  1377. package/embedding-sandbox/__pycache__/frankenstein-embeddings.cpython-313.pyc +0 -0
  1378. package/embedding-sandbox/__pycache__/qqms_v2.cpython-312.pyc +0 -0
  1379. package/embedding-sandbox/__pycache__/qqms_v2.cpython-313.pyc +0 -0
  1380. package/embedding-sandbox/add_js_docs.py +684 -0
  1381. package/embedding-sandbox/build_docs_db.py +239 -0
  1382. package/embedding-sandbox/client.cjs +376 -0
  1383. package/embedding-sandbox/client.ts +913 -0
  1384. package/embedding-sandbox/deploy-frankenstein.sh +240 -0
  1385. package/embedding-sandbox/docker-compose.yml +60 -0
  1386. package/embedding-sandbox/docker-manager.py +325 -0
  1387. package/embedding-sandbox/docs/python_docs.db +0 -0
  1388. package/embedding-sandbox/download-model.mjs +79 -0
  1389. package/embedding-sandbox/download-model.py +28 -0
  1390. package/embedding-sandbox/embedding-supervisor.sh +164 -0
  1391. package/embedding-sandbox/frankenstein-embeddings.py +3940 -0
  1392. package/embedding-sandbox/manage-services.sh +354 -0
  1393. package/embedding-sandbox/overflow_queue.py +345 -0
  1394. package/embedding-sandbox/package.json +17 -0
  1395. package/embedding-sandbox/project_isolation.py +292 -0
  1396. package/embedding-sandbox/qqms_v2.py +967 -0
  1397. package/embedding-sandbox/ram-manager.sh +311 -0
  1398. package/embedding-sandbox/requirements-frankenstein.txt +7 -0
  1399. package/embedding-sandbox/run_js_docs.py +59 -0
  1400. package/embedding-sandbox/seed_docs.py +885 -0
  1401. package/embedding-sandbox/server-batch.mjs +228 -0
  1402. package/embedding-sandbox/server.mjs +389 -0
  1403. package/embedding-sandbox/specmem/sockets/claude-input-state.json +1 -0
  1404. package/embedding-sandbox/specmem/sockets/embedding-death-reason.txt +3 -0
  1405. package/embedding-sandbox/specmem/sockets/seen-sessions.json +1 -0
  1406. package/embedding-sandbox/specmem/sockets/session-start.lock +1 -0
  1407. package/embedding-sandbox/specmem/sockets/session-stops.log +7 -0
  1408. package/embedding-sandbox/start-frankenstein-throttled.sh +98 -0
  1409. package/embedding-sandbox/start-on-demand.sh +116 -0
  1410. package/embedding-sandbox/start-sandbox.sh +237 -0
  1411. package/embedding-sandbox/start-supervised.sh +11 -0
  1412. package/embedding-sandbox/stop-sandbox.sh +51 -0
  1413. package/embedding-sandbox/test-socket.mjs +61 -0
  1414. package/embedding-sandbox/warm-start.sh +353 -0
  1415. package/embedding-sandbox/warm_start_feeder.py +660 -0
  1416. package/legal/README.md +31 -0
  1417. package/legal/anthropic-privacy-center-screenshot-2026-01-30.png +0 -0
  1418. package/legal/anthropic-tos-screenshot-2026-01-30.png +0 -0
  1419. package/lib/codebase-bridge.cjs +308 -0
  1420. package/package.json +136 -0
  1421. package/plugins/specmem-agents/agents/bug-hunter.md +79 -0
  1422. package/plugins/specmem-agents/agents/memory-explorer.md +57 -0
  1423. package/plugins/specmem-agents/agents/team-coordinator.md +82 -0
  1424. package/scripts/auto-updater.cjs +399 -0
  1425. package/scripts/backfill-code-definition-embeddings.ts +440 -0
  1426. package/scripts/backfill-code-embeddings.ts +206 -0
  1427. package/scripts/capture-tos-screenshots.cjs +94 -0
  1428. package/scripts/check-global-install.cjs +67 -0
  1429. package/scripts/cleanup-embedding-servers.sh +25 -0
  1430. package/scripts/dashboard-standalone.sh +369 -0
  1431. package/scripts/deploy-hooks.cjs +1451 -0
  1432. package/scripts/deploy.sh +106 -0
  1433. package/scripts/docker-project-down.sh +83 -0
  1434. package/scripts/docker-project-list.sh +40 -0
  1435. package/scripts/docker-project-up.sh +79 -0
  1436. package/scripts/fast-backfill-embeddings.ts +173 -0
  1437. package/scripts/fast-batch-embedder.cjs +334 -0
  1438. package/scripts/first-run-model-setup.cjs +849 -0
  1439. package/scripts/global-postinstall.cjs +1957 -0
  1440. package/scripts/index-codebase.js +72 -0
  1441. package/scripts/migrate-fix-embeddings.py +110 -0
  1442. package/scripts/migrate-to-project-schemas.ts +525 -0
  1443. package/scripts/optimize-embedding-model.py +324 -0
  1444. package/scripts/optimize-instructions.cjs +530 -0
  1445. package/scripts/pack-docker-images.sh +68 -0
  1446. package/scripts/pack-for-testing.sh +130 -0
  1447. package/scripts/postinstall.cjs +54 -0
  1448. package/scripts/project-env.sh +51 -0
  1449. package/scripts/reset-db.sh +30 -0
  1450. package/scripts/run-indexer.ts +69 -0
  1451. package/scripts/run-migrations.js +47 -0
  1452. package/scripts/setup-db.sh +34 -0
  1453. package/scripts/setup-minimal-schema.sql +143 -0
  1454. package/scripts/skills/code-review.md +44 -0
  1455. package/scripts/skills/debugging.md +56 -0
  1456. package/scripts/skills/specmem-deployteam.md +239 -0
  1457. package/scripts/skills/teammemberskills/EFFICIENT_GREP.md +171 -0
  1458. package/scripts/skills/teammemberskills/task-planning.md +67 -0
  1459. package/scripts/specmem/sockets/session-start.lock +1 -0
  1460. package/scripts/specmem/sockets/session-stops.log +1 -0
  1461. package/scripts/specmem-health.sh +382 -0
  1462. package/scripts/specmem-init.cjs +6935 -0
  1463. package/scripts/strip-debug-logs.cjs +43 -0
  1464. package/scripts/test-mcp-standalone.sh +365 -0
  1465. package/scripts/test-optimized-models.py +166 -0
  1466. package/scripts/verify-embedding-fix.sh +148 -0
  1467. package/skills/code-review.md +44 -0
  1468. package/skills/debugging.md +56 -0
  1469. package/skills/specmem-deployteam.md +239 -0
  1470. package/skills/teammemberskills/EFFICIENT_GREP.md +171 -0
  1471. package/skills/teammemberskills/task-planning.md +67 -0
  1472. package/specmem-health.cjs +522 -0
  1473. package/specmem.env +216 -0
@@ -0,0 +1,885 @@
1
+ #!/usr/bin/env python3
2
+ """
3
+ SEED DOCS - Pre-load Python, JavaScript & TypeScript documentation for PCA training
4
+
5
+ This ensures the AI model always has enough samples for dimensionality
6
+ reduction (PCA) to work properly. Run once on fresh install.
7
+
8
+ Docs are stored in specmem_overflow.training_data and persist across restarts.
9
+
10
+ Included documentation:
11
+ - Python built-in functions and data structures
12
+ - JavaScript built-in methods (Array, Object, String, Math, Promise, etc.)
13
+ - TypeScript type system, error patterns, and best practices
14
+ - Programming concepts and patterns
15
+ """
16
+
17
+ import os
18
+ import sys
19
+ import json
20
+ import hashlib
21
+ import time
22
+ from typing import List, Dict
23
+
24
+ import psycopg2
25
+ from psycopg2.extras import Json
26
+
27
+ # Database config
28
+ OVERFLOW_DB = {
29
+ 'host': os.environ.get('SPECMEM_DB_HOST', 'localhost'),
30
+ 'port': os.environ.get('SPECMEM_DB_PORT', '5432'),
31
+ 'dbname': os.environ.get('OVERFLOW_DB_NAME', 'specmem_overflow'),
32
+ 'user': os.environ.get('SPECMEM_DB_USER', 'specmem_westayunprofessional'),
33
+ 'password': os.environ.get('SPECMEM_DB_PASSWORD', 'specmem_westayunprofessional')
34
+ }
35
+
36
+ # Minimum samples needed for PCA
37
+ MIN_SAMPLES = 500
38
+
39
+ # Python built-in functions and their descriptions
40
+ PYTHON_DOCS = [
41
+ ("abs(x)", "Return the absolute value of a number. The argument may be an integer, a floating point number, or an object implementing __abs__()."),
42
+ ("aiter(async_iterable)", "Return an asynchronous iterator for an asynchronous iterable."),
43
+ ("all(iterable)", "Return True if all elements of the iterable are true (or if the iterable is empty)."),
44
+ ("any(iterable)", "Return True if any element of the iterable is true. If the iterable is empty, return False."),
45
+ ("ascii(object)", "Return a string containing a printable representation of an object, escaping non-ASCII characters."),
46
+ ("bin(x)", "Convert an integer number to a binary string prefixed with '0b'."),
47
+ ("bool(x)", "Return a Boolean value, True or False. x is converted using the standard truth testing procedure."),
48
+ ("breakpoint(*args, **kws)", "This function drops you into the debugger at the call site."),
49
+ ("bytearray([source[, encoding[, errors]]])", "Return a new array of bytes. The bytearray class is a mutable sequence of integers in the range 0 <= x < 256."),
50
+ ("bytes([source[, encoding[, errors]]])", "Return a new bytes object which is an immutable sequence of integers in the range 0 <= x < 256."),
51
+ ("callable(object)", "Return True if the object argument appears callable, False if not."),
52
+ ("chr(i)", "Return the string representing a character whose Unicode code point is the integer i."),
53
+ ("classmethod(function)", "Transform a method into a class method. A class method receives the class as implicit first argument."),
54
+ ("compile(source, filename, mode)", "Compile the source into a code or AST object. Code objects can be executed by exec() or eval()."),
55
+ ("complex([real[, imag]])", "Return a complex number with the value real + imag*1j or convert a string or number to a complex number."),
56
+ ("delattr(object, name)", "Delete the named attribute from object, if the object allows it."),
57
+ ("dict(**kwarg)", "Create a new dictionary. The dict object is the dictionary class."),
58
+ ("dir([object])", "Without arguments, return the list of names in the current local scope. With an argument, return a list of valid attributes for that object."),
59
+ ("divmod(a, b)", "Take two non-complex numbers as arguments and return a pair of numbers consisting of their quotient and remainder."),
60
+ ("enumerate(iterable, start=0)", "Return an enumerate object. iterable must be a sequence, an iterator, or some other object which supports iteration."),
61
+ ("eval(expression[, globals[, locals]])", "The expression argument is parsed and evaluated as a Python expression."),
62
+ ("exec(object[, globals[, locals]])", "This function supports dynamic execution of Python code."),
63
+ ("filter(function, iterable)", "Construct an iterator from those elements of iterable for which function returns true."),
64
+ ("float([x])", "Return a floating point number constructed from a number or string x."),
65
+ ("format(value[, format_spec])", "Convert a value to a formatted representation, as controlled by format_spec."),
66
+ ("frozenset([iterable])", "Return a new frozenset object, optionally with elements taken from iterable."),
67
+ ("getattr(object, name[, default])", "Return the value of the named attribute of object. name must be a string."),
68
+ ("globals()", "Return the dictionary implementing the current module namespace."),
69
+ ("hasattr(object, name)", "Return True if the string is the name of one of the object's attributes, False if not."),
70
+ ("hash(object)", "Return the hash value of the object (if it has one). Hash values are integers."),
71
+ ("help([object])", "Invoke the built-in help system. This function is intended for interactive use."),
72
+ ("hex(x)", "Convert an integer number to a lowercase hexadecimal string prefixed with '0x'."),
73
+ ("id(object)", "Return the identity of an object. This is an integer which is guaranteed to be unique and constant for this object during its lifetime."),
74
+ ("input([prompt])", "If the prompt argument is present, it is written to standard output without a trailing newline."),
75
+ ("int([x])", "Return an integer object constructed from a number or string x, or return 0 if no arguments are given."),
76
+ ("isinstance(object, classinfo)", "Return True if the object argument is an instance of the classinfo argument."),
77
+ ("issubclass(class, classinfo)", "Return True if class is a subclass of classinfo."),
78
+ ("iter(object[, sentinel])", "Return an iterator object. The first argument is interpreted very differently depending on the presence of the second argument."),
79
+ ("len(s)", "Return the length (the number of items) of an object. The argument may be a sequence or collection."),
80
+ ("list([iterable])", "Rather than being a function, list is actually a mutable sequence type."),
81
+ ("locals()", "Return a dictionary representing the current local symbol table."),
82
+ ("map(function, iterable, ...)", "Return an iterator that applies function to every item of iterable, yielding the results."),
83
+ ("max(iterable, *[, key, default])", "Return the largest item in an iterable or the largest of two or more arguments."),
84
+ ("memoryview(object)", "Return a memory view object created from the given argument."),
85
+ ("min(iterable, *[, key, default])", "Return the smallest item in an iterable or the smallest of two or more arguments."),
86
+ ("next(iterator[, default])", "Retrieve the next item from the iterator by calling its __next__() method."),
87
+ ("object()", "Return a new featureless object. object is a base for all classes."),
88
+ ("oct(x)", "Convert an integer number to an octal string prefixed with '0o'."),
89
+ ("open(file, mode='r')", "Open file and return a corresponding file object. If the file cannot be opened, an OSError is raised."),
90
+ ("ord(c)", "Given a string representing one Unicode character, return an integer representing the Unicode code point of that character."),
91
+ ("pow(base, exp[, mod])", "Return base to the power exp; if mod is present, return base to the power exp, modulo mod."),
92
+ ("print(*objects, sep=' ', end='\\n')", "Print objects to the text stream file, separated by sep and followed by end."),
93
+ ("property(fget=None, fset=None, fdel=None, doc=None)", "Return a property attribute."),
94
+ ("range(stop)", "Rather than being a function, range is actually an immutable sequence type."),
95
+ ("repr(object)", "Return a string containing a printable representation of an object."),
96
+ ("reversed(seq)", "Return a reverse iterator. seq must be an object which has a __reversed__() method."),
97
+ ("round(number[, ndigits])", "Return number rounded to ndigits precision after the decimal point."),
98
+ ("set([iterable])", "Return a new set object, optionally with elements taken from iterable."),
99
+ ("setattr(object, name, value)", "This is the counterpart of getattr(). The arguments are an object, a string, and an arbitrary value."),
100
+ ("slice(stop)", "Return a slice object representing the set of indices specified by range(start, stop, step)."),
101
+ ("sorted(iterable, *, key=None, reverse=False)", "Return a new sorted list from the items in iterable."),
102
+ ("staticmethod(function)", "Transform a method into a static method. A static method does not receive an implicit first argument."),
103
+ ("str(object='')", "Return a str version of object."),
104
+ ("sum(iterable, /, start=0)", "Sums start and the items of an iterable from left to right and returns the total."),
105
+ ("super([type[, object-or-type]])", "Return a proxy object that delegates method calls to a parent or sibling class of type."),
106
+ ("tuple([iterable])", "Rather than being a function, tuple is actually an immutable sequence type."),
107
+ ("type(object)", "With one argument, return the type of an object. The return value is a type object."),
108
+ ("vars([object])", "Return the __dict__ attribute for a module, class, instance, or any other object with a __dict__ attribute."),
109
+ ("zip(*iterables, strict=False)", "Iterate over several iterables in parallel, producing tuples with an item from each one."),
110
+ ("__import__(name)", "This function is invoked by the import statement. It is not recommended to use this function."),
111
+ # Python data structures
112
+ ("list.append(x)", "Add an item to the end of the list. Equivalent to a[len(a):] = [x]."),
113
+ ("list.extend(iterable)", "Extend the list by appending all the items from the iterable."),
114
+ ("list.insert(i, x)", "Insert an item at a given position. The first argument is the index."),
115
+ ("list.remove(x)", "Remove the first item from the list whose value is equal to x. Raises ValueError if not found."),
116
+ ("list.pop([i])", "Remove the item at the given position in the list, and return it."),
117
+ ("list.clear()", "Remove all items from the list. Equivalent to del a[:]."),
118
+ ("list.index(x[, start[, end]])", "Return zero-based index in the list of the first item whose value is equal to x."),
119
+ ("list.count(x)", "Return the number of times x appears in the list."),
120
+ ("list.sort(*, key=None, reverse=False)", "Sort the items of the list in place."),
121
+ ("list.reverse()", "Reverse the elements of the list in place."),
122
+ ("list.copy()", "Return a shallow copy of the list. Equivalent to a[:]."),
123
+ ("dict.clear()", "Remove all items from the dictionary."),
124
+ ("dict.copy()", "Return a shallow copy of the dictionary."),
125
+ ("dict.get(key[, default])", "Return the value for key if key is in the dictionary, else default."),
126
+ ("dict.items()", "Return a new view of the dictionary's items ((key, value) pairs)."),
127
+ ("dict.keys()", "Return a new view of the dictionary's keys."),
128
+ ("dict.pop(key[, default])", "If key is in the dictionary, remove it and return its value, else return default."),
129
+ ("dict.popitem()", "Remove and return a (key, value) pair from the dictionary. Pairs are returned in LIFO order."),
130
+ ("dict.setdefault(key[, default])", "If key is in the dictionary, return its value. If not, insert key with a value of default."),
131
+ ("dict.update([other])", "Update the dictionary with the key/value pairs from other, overwriting existing keys."),
132
+ ("dict.values()", "Return a new view of the dictionary's values."),
133
+ ("set.add(elem)", "Add element elem to the set."),
134
+ ("set.remove(elem)", "Remove element elem from the set. Raises KeyError if elem is not contained."),
135
+ ("set.discard(elem)", "Remove element elem from the set if it is present."),
136
+ ("set.pop()", "Remove and return an arbitrary element from the set. Raises KeyError if the set is empty."),
137
+ ("set.clear()", "Remove all elements from the set."),
138
+ ("str.capitalize()", "Return a copy of the string with its first character capitalized and the rest lowercased."),
139
+ ("str.casefold()", "Return a casefolded copy of the string. Casefolded strings may be used for caseless matching."),
140
+ ("str.center(width[, fillchar])", "Return centered in a string of length width. Padding is done using the specified fill character."),
141
+ ("str.count(sub[, start[, end]])", "Return the number of non-overlapping occurrences of substring sub."),
142
+ ("str.encode(encoding='utf-8', errors='strict')", "Return an encoded version of the string as a bytes object."),
143
+ ("str.endswith(suffix[, start[, end]])", "Return True if the string ends with the specified suffix, otherwise return False."),
144
+ ("str.expandtabs(tabsize=8)", "Return a copy of the string where all tab characters are replaced by spaces."),
145
+ ("str.find(sub[, start[, end]])", "Return the lowest index in the string where substring sub is found."),
146
+ ("str.format(*args, **kwargs)", "Perform a string formatting operation. The string on which this method is called can contain literal text or replacement fields."),
147
+ ("str.index(sub[, start[, end]])", "Like find(), but raise ValueError when the substring is not found."),
148
+ ("str.isalnum()", "Return True if all characters in the string are alphanumeric and there is at least one character."),
149
+ ("str.isalpha()", "Return True if all characters in the string are alphabetic and there is at least one character."),
150
+ ("str.isascii()", "Return True if the string is empty or all characters in the string are ASCII."),
151
+ ("str.isdecimal()", "Return True if all characters in the string are decimal characters and there is at least one character."),
152
+ ("str.isdigit()", "Return True if all characters in the string are digits and there is at least one character."),
153
+ ("str.islower()", "Return True if all cased characters in the string are lowercase and there is at least one cased character."),
154
+ ("str.isnumeric()", "Return True if all characters in the string are numeric characters and there is at least one character."),
155
+ ("str.isspace()", "Return True if there are only whitespace characters in the string and there is at least one character."),
156
+ ("str.istitle()", "Return True if the string is a titlecased string and there is at least one character."),
157
+ ("str.isupper()", "Return True if all cased characters in the string are uppercase and there is at least one cased character."),
158
+ ("str.join(iterable)", "Return a string which is the concatenation of the strings in iterable."),
159
+ ("str.ljust(width[, fillchar])", "Return the string left justified in a string of length width."),
160
+ ("str.lower()", "Return a copy of the string with all the cased characters converted to lowercase."),
161
+ ("str.lstrip([chars])", "Return a copy of the string with leading characters removed."),
162
+ ("str.partition(sep)", "Split the string at the first occurrence of sep, return a 3-tuple."),
163
+ ("str.replace(old, new[, count])", "Return a copy of the string with all occurrences of substring old replaced by new."),
164
+ ("str.rfind(sub[, start[, end]])", "Return the highest index in the string where substring sub is found."),
165
+ ("str.rindex(sub[, start[, end]])", "Like rfind() but raises ValueError when the substring is not found."),
166
+ ("str.rjust(width[, fillchar])", "Return the string right justified in a string of length width."),
167
+ ("str.rpartition(sep)", "Split the string at the last occurrence of sep, return a 3-tuple."),
168
+ ("str.rsplit(sep=None, maxsplit=-1)", "Return a list of the words in the string, using sep as the delimiter string."),
169
+ ("str.rstrip([chars])", "Return a copy of the string with trailing characters removed."),
170
+ ("str.split(sep=None, maxsplit=-1)", "Return a list of the words in the string, using sep as the delimiter string."),
171
+ ("str.splitlines([keepends])", "Return a list of the lines in the string, breaking at line boundaries."),
172
+ ("str.startswith(prefix[, start[, end]])", "Return True if string starts with the prefix, otherwise return False."),
173
+ ("str.strip([chars])", "Return a copy of the string with leading and trailing characters removed."),
174
+ ("str.swapcase()", "Return a copy of the string with uppercase characters converted to lowercase and vice versa."),
175
+ ("str.title()", "Return a titlecased version of the string where words start with an uppercase character."),
176
+ ("str.upper()", "Return a copy of the string with all the cased characters converted to uppercase."),
177
+ ("str.zfill(width)", "Return a copy of the string left filled with ASCII '0' digits to make a string of length width."),
178
+
179
+ # === Python Error Patterns and Exception Handling ===
180
+ # TypeError Patterns
181
+ ("TypeError: 'NoneType' object is not subscriptable", "Error when trying to index None. Fix: Check if variable is None before accessing. Example: if data is not None: data[0]. Use .get() for dicts or default values."),
182
+ ("TypeError: 'NoneType' object is not iterable", "Error when iterating over None. Fix: Check for None before loop. Example: for item in (data or []). Or use: if data: for item in data."),
183
+ ("TypeError: 'NoneType' object is not callable", "Error when calling None as function. Common cause: method returns None and result is called. Fix: Check return values."),
184
+ ("TypeError: unsupported operand type(s)", "Error when using operators with incompatible types. Example: '5' + 3. Fix: Convert types explicitly: int('5') + 3 or str(5) + '3'."),
185
+ ("TypeError: can only concatenate str (not 'int') to str", "Error when concatenating string with non-string. Fix: Use str() conversion or f-strings: f'{text}{number}'."),
186
+ ("TypeError: object of type 'X' has no len()", "Error when calling len() on object without __len__. Fix: Check type supports len() or implement __len__ method."),
187
+ ("TypeError: unhashable type: 'list'", "Error when using mutable type as dict key or set element. Fix: Use tuple instead of list: {tuple(mylist): value}."),
188
+ ("TypeError: argument of type 'NoneType' is not iterable", "Error with 'in' operator on None. Fix: Check for None: if data and item in data."),
189
+ ("TypeError: 'X' object does not support item assignment", "Error assigning to immutable type (tuple, string). Fix: Convert to list, modify, convert back."),
190
+ ("TypeError: missing required positional argument", "Error when function call missing argument. Fix: Provide all required arguments or use default values."),
191
+ ("TypeError: takes X positional arguments but Y were given", "Error with wrong number of arguments. Fix: Check function signature and adjust call."),
192
+
193
+ # ValueError Patterns
194
+ ("ValueError: invalid literal for int()", "Error converting non-numeric string to int. Fix: Validate input or use try/except: try: int(s) except ValueError: handle_error()."),
195
+ ("ValueError: list.remove(x): x not in list", "Error removing non-existent element. Fix: Check with 'in' first or use try/except."),
196
+ ("ValueError: too many values to unpack", "Error when unpacking has mismatched count. Fix: Ensure left side matches iterable length or use *rest."),
197
+ ("ValueError: not enough values to unpack", "Error when unpacking from shorter iterable. Fix: Check length or use default: a, b = (data + [None, None])[:2]."),
198
+ ("ValueError: substring not found", "Error from str.index() when substring missing. Fix: Use str.find() which returns -1, or check with 'in' first."),
199
+ ("ValueError: could not convert string to float", "Error converting non-numeric to float. Fix: Validate input, handle commas/currency, use try/except."),
200
+
201
+ # KeyError Patterns
202
+ ("KeyError: 'X'", "Error accessing missing dict key. Fix: Use dict.get(key, default) or check with 'in': if key in mydict."),
203
+ ("KeyError vs dict.get() pattern", "Best practice: Use data.get('key') instead of data['key'] for optional keys. Returns None if missing, or specify default: data.get('key', 'default')."),
204
+ ("KeyError in nested dicts", "Error accessing nested missing key. Fix: Use chained .get(): data.get('a', {}).get('b', default)."),
205
+ ("KeyError with defaultdict", "Solution: Use collections.defaultdict(list) or defaultdict(int) to auto-create missing keys with default values."),
206
+
207
+ # AttributeError Patterns
208
+ ("AttributeError: 'NoneType' object has no attribute", "Error calling method on None. Fix: Check for None before method call: if obj is not None: obj.method()."),
209
+ ("AttributeError: 'X' object has no attribute 'Y'", "Error accessing non-existent attribute. Fix: Use hasattr(obj, 'attr') or getattr(obj, 'attr', default)."),
210
+ ("AttributeError: 'str' object has no attribute 'append'", "Error using list method on string. Strings are immutable. Fix: Use concatenation or list()."),
211
+ ("AttributeError: module has no attribute", "Error from incorrect import or missing function. Fix: Check module documentation and import statement."),
212
+
213
+ # IndexError Patterns
214
+ ("IndexError: list index out of range", "Error accessing index beyond list length. Fix: Check len() before access or use try/except. Safe: lst[-1] if lst else None."),
215
+ ("IndexError: string index out of range", "Error accessing character beyond string length. Fix: Check length or use slicing which won't raise: s[0:1]."),
216
+ ("IndexError with negative indices", "Negative indices count from end. -1 is last element. IndexError if abs(index) > len(list)."),
217
+
218
+ # NameError Patterns
219
+ ("NameError: name 'X' is not defined", "Error using undefined variable. Fix: Define before use, check spelling, ensure proper scope, add imports."),
220
+ ("NameError from scope issues", "Variables in functions have local scope. Fix: Use global/nonlocal keywords or pass as parameters."),
221
+ ("NameError: name 'X' is not defined (circular import)", "Error from circular imports. Fix: Move import inside function, restructure modules, or use TYPE_CHECKING."),
222
+
223
+ # IndentationError Patterns
224
+ ("IndentationError: expected an indented block", "Error when code block has no body. Fix: Add pass statement or proper indentation after if/for/def/class."),
225
+ ("IndentationError: unexpected indent", "Error from extra indentation. Fix: Align with surrounding code, use consistent spaces/tabs."),
226
+ ("IndentationError: unindent does not match", "Error from inconsistent indentation levels. Fix: Use 4 spaces consistently, never mix tabs and spaces."),
227
+ ("TabError: inconsistent use of tabs and spaces", "Error mixing tabs and spaces. Fix: Configure editor to use spaces only, run python -tt to detect."),
228
+
229
+ # ModuleNotFoundError and ImportError
230
+ ("ModuleNotFoundError: No module named 'X'", "Error when module not installed or in path. Fix: pip install X, check spelling, verify PYTHONPATH."),
231
+ ("ImportError: cannot import name 'X'", "Error when name doesn't exist in module. Fix: Check available names with dir(module), verify version compatibility."),
232
+ ("ImportError: attempted relative import with no known parent package", "Error with relative imports in script. Fix: Run as module: python -m package.module."),
233
+ ("ImportError: circular import", "Error from modules importing each other. Fix: Restructure code, use lazy imports, or import inside functions."),
234
+
235
+ # UnicodeDecodeError and Encoding
236
+ ("UnicodeDecodeError: 'utf-8' codec can't decode byte", "Error reading file with wrong encoding. Fix: Specify encoding: open(file, encoding='latin-1') or use errors='ignore'."),
237
+ ("UnicodeEncodeError: 'ascii' codec can't encode", "Error encoding non-ASCII character. Fix: Use .encode('utf-8') or specify encoding in open()."),
238
+ ("UnicodeDecodeError handling strategies", "Options: errors='ignore' (skip), 'replace' (use ?), 'backslashreplace', or detect encoding with chardet library."),
239
+
240
+ # FileNotFoundError and OSError
241
+ ("FileNotFoundError: No such file or directory", "Error opening non-existent file. Fix: Check path with os.path.exists(), use pathlib, or try/except."),
242
+ ("PermissionError: Permission denied", "Error accessing protected file. Fix: Check file permissions, run with appropriate privileges, or handle exception."),
243
+ ("IsADirectoryError: Is a directory", "Error opening directory as file. Fix: Check with os.path.isfile() before opening."),
244
+
245
+ # RuntimeError and RecursionError
246
+ ("RuntimeError: dictionary changed size during iteration", "Error modifying dict while iterating. Fix: Iterate over list(dict.keys()) or dict.copy()."),
247
+ ("RecursionError: maximum recursion depth exceeded", "Error from infinite or deep recursion. Fix: Add base case, use iteration, or increase sys.setrecursionlimit()."),
248
+ ("RuntimeError: generator already executing", "Error from recursive generator call. Fix: Don't call next() on generator from within itself."),
249
+
250
+ # ZeroDivisionError
251
+ ("ZeroDivisionError: division by zero", "Error dividing by zero. Fix: Check divisor before division or use try/except."),
252
+ ("ZeroDivisionError: integer division or modulo by zero", "Same error for // and %. Fix: if divisor != 0: result = a // divisor."),
253
+
254
+ # StopIteration
255
+ ("StopIteration handling", "Raised when iterator exhausted. Fix: Use for loop instead of next(), or catch exception with default: next(iter, default)."),
256
+
257
+ # AssertionError
258
+ ("AssertionError patterns", "Raised by assert statement when condition false. Use for debugging, not production validation. Can be disabled with -O flag."),
259
+
260
+ # === Python Common Bugs and Antipatterns ===
261
+ ("Mutable default argument bug", "Bug: def f(lst=[]). List is shared between calls! Fix: def f(lst=None): lst = lst or [] or lst = lst if lst is not None else []."),
262
+ ("Late binding closure bug", "Bug: lambdas in loop capture variable by reference. Fix: Use default argument: lambda x=x: x, or functools.partial."),
263
+ ("Modifying list while iterating", "Bug: for item in lst: lst.remove(item). Skips elements! Fix: Iterate over copy: for item in lst[:] or list(lst)."),
264
+ ("String concatenation in loop", "Performance bug: result += string in loop is O(n^2). Fix: Use ''.join(list_of_strings) which is O(n)."),
265
+ ("Using 'is' instead of '==' for values", "Bug: x is 1 may fail for large numbers. 'is' checks identity, '==' checks equality. Only use 'is' for None/True/False."),
266
+ ("Catching bare except", "Antipattern: except: catches all including KeyboardInterrupt. Fix: Use except Exception: for all errors or specific exceptions."),
267
+ ("Ignoring exceptions silently", "Antipattern: except: pass. Hides bugs. Fix: At minimum log the error or re-raise in finally."),
268
+ ("Using eval() on user input", "Security bug: eval() executes arbitrary code. Fix: Use ast.literal_eval() for safe literal parsing or proper parsing."),
269
+ ("SQL injection vulnerability", "Security bug: f'SELECT * FROM users WHERE id={user_input}'. Fix: Use parameterized queries: cursor.execute('SELECT * FROM users WHERE id=?', (user_id,))."),
270
+ ("Shallow copy surprise", "Bug: list.copy() is shallow. Nested objects are shared. Fix: Use copy.deepcopy() for nested structures."),
271
+ ("Boolean comparison with is", "Antipattern: if x is True. Fix: Use if x: or if x == True for boolean comparison."),
272
+ ("Using type() for type checking", "Antipattern: type(x) == list. Misses subclasses. Fix: Use isinstance(x, list) which handles inheritance."),
273
+ ("Global variable modification", "Bug: global var is modified unexpectedly. Fix: Avoid globals, use class attributes, or pass explicitly."),
274
+ ("Unpacking with wrong number of values", "Bug: a, b = func() when func returns 3 values. Fix: Use starred expression: a, b, *rest = func()."),
275
+
276
+ # === Python asyncio Patterns and Pitfalls ===
277
+ ("asyncio.run() usage", "Entry point for async code: asyncio.run(main()). Creates event loop, runs coroutine, closes loop. Use once at top level."),
278
+ ("async/await basics", "async def marks coroutine. await pauses execution until awaitable completes. Can only await inside async function."),
279
+ ("asyncio.gather() pattern", "Run multiple coroutines concurrently: results = await asyncio.gather(coro1(), coro2()). Returns list of results in order."),
280
+ ("asyncio.create_task() pattern", "Schedule coroutine to run: task = asyncio.create_task(coro()). Returns Task object. Remember to await it later."),
281
+ ("asyncio.wait_for() timeout", "Add timeout to coroutine: await asyncio.wait_for(coro(), timeout=5.0). Raises TimeoutError if exceeded."),
282
+ ("asyncio pitfall: forgetting await", "Bug: result = async_func() returns coroutine, not result. Fix: result = await async_func()."),
283
+ ("asyncio pitfall: blocking in async", "Bug: Using time.sleep() blocks event loop. Fix: Use await asyncio.sleep() for non-blocking delay."),
284
+ ("asyncio pitfall: fire and forget", "Bug: asyncio.create_task(coro()) without reference. Task may be garbage collected. Fix: Keep reference or use gather."),
285
+ ("asyncio.Queue pattern", "Thread-safe async queue: queue = asyncio.Queue(); await queue.put(item); item = await queue.get()."),
286
+ ("asyncio.Semaphore pattern", "Limit concurrent operations: sem = asyncio.Semaphore(10); async with sem: await limited_operation()."),
287
+ ("async context manager", "Implement __aenter__ and __aexit__ for async with. Use @asynccontextmanager decorator for simpler syntax."),
288
+ ("async iterator", "Implement __aiter__ returning self and async __anext__. Use async for to iterate: async for item in async_iter."),
289
+
290
+ # === Python Context Manager Patterns ===
291
+ ("Context manager basics", "with statement ensures cleanup. Calls __enter__ on entry, __exit__ on exit (even with exceptions)."),
292
+ ("contextlib.contextmanager", "Decorator to create context manager from generator: @contextmanager def cm(): setup(); yield resource; cleanup()."),
293
+ ("Multiple context managers", "Combine with comma or contextlib.ExitStack: with open(f1) as a, open(f2) as b: or with ExitStack() as stack."),
294
+ ("Custom context manager class", "Implement __enter__(self) returning resource and __exit__(self, exc_type, exc_val, exc_tb). Return True to suppress exceptions."),
295
+ ("contextlib.suppress", "Ignore specific exceptions: with suppress(FileNotFoundError): os.remove(file). Cleaner than try/except pass."),
296
+ ("contextlib.redirect_stdout", "Redirect stdout: with redirect_stdout(f): print('goes to file'). Useful for capturing output."),
297
+ ("Context manager for timing", "Pattern: @contextmanager def timer(): start = time.time(); yield; print(time.time() - start)."),
298
+ ("Nested context managers", "with A() as a: with B() as b: code. Or use ExitStack for dynamic number of context managers."),
299
+
300
+ # === Python Decorator Patterns ===
301
+ ("Basic decorator pattern", "def decorator(func): @wraps(func) def wrapper(*args, **kwargs): return func(*args, **kwargs); return wrapper."),
302
+ ("Decorator with arguments", "def decorator(arg): def actual_decorator(func): @wraps(func) def wrapper(*a, **kw): return func(*a, **kw); return wrapper; return actual_decorator."),
303
+ ("functools.wraps importance", "Always use @wraps(func) in decorators. Preserves __name__, __doc__, and other attributes of original function."),
304
+ ("Class-based decorator", "class Decorator: def __init__(self, func): self.func = func; def __call__(self, *args): return self.func(*args)."),
305
+ ("Decorator for methods", "First argument is self/cls. Use descriptor protocol or functools.wraps for proper method decoration."),
306
+ ("Stacking decorators", "@d1 @d2 def f(): pass is equivalent to f = d1(d2(f)). Order matters, d2 applied first."),
307
+ ("functools.lru_cache", "Memoization decorator: @lru_cache(maxsize=128) def expensive_func(arg): return result. Caches results."),
308
+ ("functools.cached_property", "Lazy computed property cached after first access: @cached_property def prop(self): return expensive_computation."),
309
+ ("dataclass decorator", "@dataclass generates __init__, __repr__, __eq__. Options: frozen=True for immutable, order=True for comparison."),
310
+ ("property decorator", "@property for getter, @prop.setter for setter, @prop.deleter for deleter. Makes attribute access controlled."),
311
+ ("classmethod vs staticmethod", "@classmethod receives class as first arg (cls). @staticmethod receives no implicit arg. Use classmethod for factory methods."),
312
+
313
+ # === Python Import System Gotchas ===
314
+ ("Relative vs absolute imports", "Absolute: from package.module import X. Relative: from .module import X. Relative only works in packages."),
315
+ ("Circular import solutions", "1) Import inside function. 2) Import at end of module. 3) Use TYPE_CHECKING. 4) Restructure code."),
316
+ ("TYPE_CHECKING import pattern", "from typing import TYPE_CHECKING; if TYPE_CHECKING: from module import Type. Only imported for type checkers."),
317
+ ("__init__.py purpose", "Makes directory a package. Can be empty or contain package initialization. Controls what from package import * exports."),
318
+ ("__all__ list", "__all__ = ['public_name'] controls from module import *. Only listed names are imported."),
319
+ ("Importing from __main__", "Code in if __name__ == '__main__' only runs when script executed directly, not when imported."),
320
+ ("sys.path manipulation", "sys.path.insert(0, '/path') adds to import search path. Use sparingly, prefer proper package structure."),
321
+ ("importlib for dynamic imports", "importlib.import_module('package.module') for runtime imports. Useful for plugins."),
322
+ ("Reloading modules", "importlib.reload(module) reloads already imported module. Doesn't reload dependencies."),
323
+ ("Package vs module", "Module is single .py file. Package is directory with __init__.py containing modules/subpackages."),
324
+
325
+ # === Python Type Hint Patterns ===
326
+ ("Basic type hints", "def func(name: str, age: int) -> str: return f'{name} is {age}'. Use for documentation and type checkers."),
327
+ ("Optional type", "from typing import Optional. Optional[str] means str | None. For parameters that can be None."),
328
+ ("Union types", "from typing import Union. Union[int, str] or int | str (Python 3.10+). Value can be any listed type."),
329
+ ("List, Dict, Set types", "from typing import List, Dict, Set. List[int], Dict[str, int], Set[str]. Or use list[int] in 3.9+."),
330
+ ("Callable type", "from typing import Callable. Callable[[int, str], bool] for function type with specific signature."),
331
+ ("TypeVar for generics", "from typing import TypeVar; T = TypeVar('T'); def first(lst: list[T]) -> T: return lst[0]."),
332
+ ("Generic classes", "from typing import Generic, TypeVar; T = TypeVar('T'); class Box(Generic[T]): def __init__(self, item: T): self.item = item."),
333
+ ("Protocol for structural typing", "from typing import Protocol. Define interface: class Sized(Protocol): def __len__(self) -> int: ...."),
334
+ ("Literal types", "from typing import Literal. Literal['red', 'blue'] restricts to specific values."),
335
+ ("TypedDict for dict shapes", "from typing import TypedDict. class User(TypedDict): name: str; age: int. Types dict with known keys."),
336
+ ("Final for constants", "from typing import Final. MAX_SIZE: Final = 100. Indicates value should not be reassigned."),
337
+ ("cast() for type assertions", "from typing import cast. result = cast(str, unknown_value). Tells type checker to trust the type."),
338
+ ("@overload for multiple signatures", "from typing import overload. Define multiple @overload signatures, then implement without decorator."),
339
+ ("Self type", "from typing import Self. def clone(self) -> Self. Returns same type as class, useful for subclasses."),
340
+ ("ParamSpec for decorator typing", "from typing import ParamSpec; P = ParamSpec('P'). Preserves parameter types in decorators."),
341
+
342
+ # === Python Common Module Patterns ===
343
+ # os module
344
+ ("os.path.join", "Join path components safely: os.path.join('dir', 'subdir', 'file.txt'). Handles separators correctly."),
345
+ ("os.path.exists/isfile/isdir", "Check path: os.path.exists(path), os.path.isfile(path), os.path.isdir(path). Returns boolean."),
346
+ ("os.makedirs", "Create directory tree: os.makedirs('a/b/c', exist_ok=True). exist_ok prevents error if exists."),
347
+ ("os.environ", "Access environment: os.environ['VAR'] or os.environ.get('VAR', 'default'). Modifiable dict-like object."),
348
+ ("os.listdir vs os.scandir", "os.listdir returns names. os.scandir returns DirEntry objects with metadata, more efficient."),
349
+
350
+ # sys module
351
+ ("sys.argv", "Command line arguments list. sys.argv[0] is script name. Use argparse for complex parsing."),
352
+ ("sys.path", "Module search path list. First item is script directory or empty string for current."),
353
+ ("sys.exit", "Exit program: sys.exit(0) for success, sys.exit(1) for error. Raises SystemExit exception."),
354
+ ("sys.stdin/stdout/stderr", "Standard streams. Can redirect: sys.stdout = open('log.txt', 'w'). Use contextlib.redirect_stdout."),
355
+
356
+ # json module
357
+ ("json.loads/dumps", "Parse: json.loads(json_string). Serialize: json.dumps(obj). Returns string, not bytes."),
358
+ ("json.load/dump", "File operations: json.load(file_obj), json.dump(obj, file_obj). Works with file objects."),
359
+ ("json custom encoder", "class CustomEncoder(JSONEncoder): def default(self, obj): return obj.__dict__. Pass cls=CustomEncoder."),
360
+ ("json.dumps formatting", "Pretty print: json.dumps(obj, indent=2, sort_keys=True). Human-readable output."),
361
+
362
+ # re (regex) module
363
+ ("re.search vs re.match", "re.match only matches at start of string. re.search finds first match anywhere. Use re.fullmatch for entire string."),
364
+ ("re.findall", "Returns list of all matches: re.findall(r'\\d+', text). Returns groups if pattern has groups."),
365
+ ("re.sub", "Replace matches: re.sub(r'pattern', 'replacement', text). Can use function for replacement."),
366
+ ("re.compile", "Compile pattern for reuse: pattern = re.compile(r'\\d+'); pattern.search(text). Faster for multiple uses."),
367
+ ("re groups", "Access groups: match.group(0) full match, match.group(1) first group. Named: (?P<name>pattern)."),
368
+
369
+ # datetime module
370
+ ("datetime.now/utcnow", "Current time: datetime.now() local, datetime.utcnow() UTC. Prefer datetime.now(timezone.utc)."),
371
+ ("datetime.strftime/strptime", "Format: dt.strftime('%Y-%m-%d'). Parse: datetime.strptime('2024-01-15', '%Y-%m-%d')."),
372
+ ("timedelta arithmetic", "Date math: datetime.now() + timedelta(days=7). Supports days, hours, minutes, seconds."),
373
+ ("timezone handling", "Use pytz or zoneinfo for timezones: from zoneinfo import ZoneInfo; dt.replace(tzinfo=ZoneInfo('UTC'))."),
374
+
375
+ # collections module
376
+ ("collections.defaultdict", "Dict with default factory: d = defaultdict(list); d['key'].append(val). Auto-creates missing keys."),
377
+ ("collections.Counter", "Count occurrences: Counter(['a','b','a']).most_common(). Supports arithmetic operations."),
378
+ ("collections.deque", "Double-ended queue: d = deque(maxlen=10). Efficient append/pop from both ends. Useful for LRU."),
379
+ ("collections.namedtuple", "Immutable tuple with named fields: Point = namedtuple('Point', ['x', 'y']); p = Point(1, 2)."),
380
+ ("collections.OrderedDict", "Dict remembering insertion order. Now regular dict maintains order (3.7+). Still useful for move_to_end()."),
381
+
382
+ # itertools module
383
+ ("itertools.chain", "Flatten iterables: chain([1,2], [3,4]) yields 1,2,3,4. chain.from_iterable for nested."),
384
+ ("itertools.groupby", "Group consecutive elements: groupby(sorted(data), key=func). Must sort first for non-consecutive."),
385
+ ("itertools.combinations/permutations", "combinations('ABC', 2) yields AB,AC,BC. permutations includes order variations."),
386
+ ("itertools.islice", "Slice iterator: islice(iterable, stop) or islice(iterable, start, stop, step). Memory efficient."),
387
+ ("itertools.cycle", "Infinite cycle: cycle([1,2,3]) yields 1,2,3,1,2,3.... Use with islice or break condition."),
388
+
389
+ # functools module
390
+ ("functools.partial", "Partial function application: add5 = partial(add, 5). Creates new function with some args fixed."),
391
+ ("functools.reduce", "Reduce iterable: reduce(lambda a,b: a+b, [1,2,3]) returns 6. Import from functools."),
392
+ ("functools.total_ordering", "Class decorator: define __eq__ and one comparison, get all comparison operators."),
393
+ ("functools.singledispatch", "Generic function by type: @singledispatch def process(arg): pass; @process.register(int) def _(arg): pass."),
394
+
395
+ # pathlib module
396
+ ("pathlib.Path basics", "Object-oriented paths: Path('dir') / 'subdir' / 'file.txt'. Cross-platform path handling."),
397
+ ("Path.exists/is_file/is_dir", "Check: path.exists(), path.is_file(), path.is_dir(). Returns boolean."),
398
+ ("Path.read_text/write_text", "Read: path.read_text(encoding='utf-8'). Write: path.write_text(content). Simple file I/O."),
399
+ ("Path.glob/rglob", "Find files: path.glob('*.txt') non-recursive, path.rglob('*.txt') recursive. Returns generator."),
400
+ ("Path.mkdir/rmdir", "Create: path.mkdir(parents=True, exist_ok=True). Remove: path.rmdir() or shutil.rmtree(path)."),
401
+ ]
402
+
403
+ # JavaScript built-in methods and descriptions
404
+ JAVASCRIPT_DOCS = [
405
+ ("Array.from(arrayLike[, mapFn[, thisArg]])", "Creates a new, shallow-copied Array instance from an array-like or iterable object."),
406
+ ("Array.isArray(value)", "Determines whether the passed value is an Array."),
407
+ ("Array.of(element0[, element1[, ...[, elementN]]])", "Creates a new Array instance from a variable number of arguments."),
408
+ ("array.at(index)", "Returns the element at the specified index, allowing for positive and negative integers."),
409
+ ("array.concat(value1[, value2[, ...[, valueN]]])", "Returns a new array comprised of this array joined with other array(s) and/or value(s)."),
410
+ ("array.copyWithin(target, start[, end])", "Shallow copies part of an array to another location in the same array."),
411
+ ("array.entries()", "Returns a new Array Iterator object that contains the key/value pairs for each index."),
412
+ ("array.every(callback(element[, index[, array]])[, thisArg])", "Tests whether all elements pass the test implemented by the provided function."),
413
+ ("array.fill(value[, start[, end]])", "Fills all elements from a start index to an end index with a static value."),
414
+ ("array.filter(callback(element[, index[, array]])[, thisArg])", "Creates a new array with elements that pass the test implemented by the provided function."),
415
+ ("array.find(callback(element[, index[, array]])[, thisArg])", "Returns the first element that satisfies the provided testing function."),
416
+ ("array.findIndex(callback(element[, index[, array]])[, thisArg])", "Returns the index of the first element that satisfies the provided testing function."),
417
+ ("array.findLast(callback(element[, index[, array]])[, thisArg])", "Returns the last element that satisfies the provided testing function."),
418
+ ("array.flat([depth])", "Creates a new array with all sub-array elements concatenated into it recursively up to the specified depth."),
419
+ ("array.flatMap(callback(currentValue[, index[, array]])[, thisArg])", "Maps each element using a mapping function, then flattens the result into a new array."),
420
+ ("array.forEach(callback(currentValue[, index[, array]])[, thisArg])", "Executes a provided function once for each array element."),
421
+ ("array.includes(valueToFind[, fromIndex])", "Determines whether an array includes a certain value among its entries."),
422
+ ("array.indexOf(searchElement[, fromIndex])", "Returns the first index at which a given element can be found."),
423
+ ("array.join([separator])", "Joins all elements of an array into a string."),
424
+ ("array.keys()", "Returns a new Array Iterator object that contains the keys for each index."),
425
+ ("array.lastIndexOf(searchElement[, fromIndex])", "Returns the last index at which a given element can be found."),
426
+ ("array.map(callback(currentValue[, index[, array]])[, thisArg])", "Creates a new array populated with the results of calling a provided function on every element."),
427
+ ("array.pop()", "Removes the last element from an array and returns that element."),
428
+ ("array.push(element1[, ...[, elementN]])", "Adds one or more elements to the end of an array and returns the new length."),
429
+ ("array.reduce(callback(accumulator, currentValue[, index[, array]])[, initialValue])", "Executes a reducer function on each element, resulting in a single output value."),
430
+ ("array.reduceRight(callback(accumulator, currentValue[, index[, array]])[, initialValue])", "Applies a function against an accumulator and each value from right to left."),
431
+ ("array.reverse()", "Reverses an array in place. The first element becomes the last, and the last becomes the first."),
432
+ ("array.shift()", "Removes the first element from an array and returns that removed element."),
433
+ ("array.slice([start[, end]])", "Returns a shallow copy of a portion of an array into a new array object."),
434
+ ("array.some(callback(element[, index[, array]])[, thisArg])", "Tests whether at least one element passes the test implemented by the provided function."),
435
+ ("array.sort([compareFunction])", "Sorts the elements of an array in place and returns the sorted array."),
436
+ ("array.splice(start[, deleteCount[, item1[, item2[, ...]]]])", "Changes the contents of an array by removing or replacing existing elements."),
437
+ ("array.toLocaleString([locales[, options]])", "Returns a string representing the elements of the array."),
438
+ ("array.toString()", "Returns a string representing the specified array and its elements."),
439
+ ("array.unshift(element1[, ...[, elementN]])", "Adds one or more elements to the beginning of an array and returns the new length."),
440
+ ("array.values()", "Returns a new Array Iterator object that contains the values for each index."),
441
+ ("Object.assign(target, ...sources)", "Copies all enumerable own properties from one or more source objects to a target object."),
442
+ ("Object.create(proto[, propertiesObject])", "Creates a new object with the specified prototype object and properties."),
443
+ ("Object.defineProperty(obj, prop, descriptor)", "Defines a new property directly on an object, or modifies an existing property."),
444
+ ("Object.defineProperties(obj, props)", "Defines new or modifies existing properties directly on an object."),
445
+ ("Object.entries(obj)", "Returns an array of a given object's own enumerable string-keyed property [key, value] pairs."),
446
+ ("Object.freeze(obj)", "Freezes an object: other code cannot delete or change its properties."),
447
+ ("Object.fromEntries(iterable)", "Transforms a list of key-value pairs into an object."),
448
+ ("Object.getOwnPropertyDescriptor(obj, prop)", "Returns a property descriptor for an own property of a given object."),
449
+ ("Object.getOwnPropertyNames(obj)", "Returns an array of all properties found directly in a given object."),
450
+ ("Object.getOwnPropertySymbols(obj)", "Returns an array of all symbol properties found directly in a given object."),
451
+ ("Object.getPrototypeOf(obj)", "Returns the prototype of the specified object."),
452
+ ("Object.hasOwn(obj, prop)", "Returns true if the specified object has the indicated property as its own property."),
453
+ ("Object.is(value1, value2)", "Determines whether two values are the same value."),
454
+ ("Object.isExtensible(obj)", "Determines if an object is extensible (whether it can have new properties added to it)."),
455
+ ("Object.isFrozen(obj)", "Determines if an object is frozen."),
456
+ ("Object.isSealed(obj)", "Determines if an object is sealed."),
457
+ ("Object.keys(obj)", "Returns an array of a given object's own enumerable property names."),
458
+ ("Object.preventExtensions(obj)", "Prevents new properties from ever being added to an object."),
459
+ ("Object.seal(obj)", "Seals an object, preventing new properties from being added and marking all existing properties as non-configurable."),
460
+ ("Object.setPrototypeOf(obj, prototype)", "Sets the prototype of a specified object to another object or null."),
461
+ ("Object.values(obj)", "Returns an array of a given object's own enumerable property values."),
462
+ ("String.fromCharCode(num1[, ...[, numN]])", "Returns a string created from the specified sequence of UTF-16 code units."),
463
+ ("String.fromCodePoint(num1[, ...[, numN]])", "Returns a string created by using the specified sequence of code points."),
464
+ ("String.raw(callSite, ...substitutions)", "Returns a raw string from template literals, without processing escape sequences."),
465
+ ("string.at(index)", "Returns the character at the specified index, allowing for positive and negative integers."),
466
+ ("string.charAt(index)", "Returns the character at the specified index."),
467
+ ("string.charCodeAt(index)", "Returns an integer between 0 and 65535 representing the UTF-16 code unit at the given index."),
468
+ ("string.codePointAt(pos)", "Returns a non-negative integer that is the Unicode code point value at the given position."),
469
+ ("string.concat(str1[, str2[, ...[, strN]]])", "Combines the text of two or more strings and returns a new string."),
470
+ ("string.endsWith(searchString[, length])", "Determines whether a string ends with the characters of a specified string."),
471
+ ("string.includes(searchString[, position])", "Determines whether one string may be found within another string."),
472
+ ("string.indexOf(searchValue[, fromIndex])", "Returns the index of the first occurrence of the specified value."),
473
+ ("string.lastIndexOf(searchValue[, fromIndex])", "Returns the index of the last occurrence of the specified value."),
474
+ ("string.localeCompare(compareString[, locales[, options]])", "Returns a number indicating whether a reference string comes before, after, or is the same."),
475
+ ("string.match(regexp)", "Retrieves the result of matching a string against a regular expression."),
476
+ ("string.matchAll(regexp)", "Returns an iterator of all results matching a string against a regular expression."),
477
+ ("string.normalize([form])", "Returns the Unicode Normalization Form of the string."),
478
+ ("string.padEnd(targetLength[, padString])", "Pads the current string from the end with a given string."),
479
+ ("string.padStart(targetLength[, padString])", "Pads the current string from the start with a given string."),
480
+ ("string.repeat(count)", "Returns a new string with a specified number of copies of an existing string."),
481
+ ("string.replace(searchFor, replaceWith)", "Returns a new string with some or all matches of a pattern replaced by a replacement."),
482
+ ("string.replaceAll(searchFor, replaceWith)", "Returns a new string with all matches of a pattern replaced by a replacement."),
483
+ ("string.search(regexp)", "Executes a search for a match between a regular expression and this string."),
484
+ ("string.slice(beginIndex[, endIndex])", "Extracts a section of a string and returns it as a new string."),
485
+ ("string.split([separator[, limit]])", "Splits a String object into an array of strings by separating the string into substrings."),
486
+ ("string.startsWith(searchString[, position])", "Determines whether a string begins with the characters of a specified string."),
487
+ ("string.substring(indexStart[, indexEnd])", "Returns the part of the string between the start and end indexes."),
488
+ ("string.toLocaleLowerCase([locale, ...locales])", "Returns the string converted to lower case according to locale-specific rules."),
489
+ ("string.toLocaleUpperCase([locale, ...locales])", "Returns the string converted to upper case according to locale-specific rules."),
490
+ ("string.toLowerCase()", "Returns the string converted to lowercase."),
491
+ ("string.toString()", "Returns a string representing the specified object."),
492
+ ("string.toUpperCase()", "Returns the string converted to uppercase."),
493
+ ("string.trim()", "Removes whitespace from both ends of a string."),
494
+ ("string.trimEnd()", "Removes whitespace from the end of a string."),
495
+ ("string.trimStart()", "Removes whitespace from the beginning of a string."),
496
+ ("string.valueOf()", "Returns the primitive value of the specified object."),
497
+ ("Math.abs(x)", "Returns the absolute value of a number."),
498
+ ("Math.acos(x)", "Returns the arccosine (in radians) of a number."),
499
+ ("Math.acosh(x)", "Returns the hyperbolic arccosine of a number."),
500
+ ("Math.asin(x)", "Returns the arcsine (in radians) of a number."),
501
+ ("Math.asinh(x)", "Returns the hyperbolic arcsine of a number."),
502
+ ("Math.atan(x)", "Returns the arctangent (in radians) of a number."),
503
+ ("Math.atanh(x)", "Returns the hyperbolic arctangent of a number."),
504
+ ("Math.atan2(y, x)", "Returns the arctangent of the quotient of its arguments."),
505
+ ("Math.cbrt(x)", "Returns the cube root of a number."),
506
+ ("Math.ceil(x)", "Returns the smallest integer greater than or equal to a given number."),
507
+ ("Math.clz32(x)", "Returns the number of leading zero bits in the 32-bit binary representation."),
508
+ ("Math.cos(x)", "Returns the cosine of a number."),
509
+ ("Math.cosh(x)", "Returns the hyperbolic cosine of a number."),
510
+ ("Math.exp(x)", "Returns E^x, where x is the argument, and E is Euler's number."),
511
+ ("Math.expm1(x)", "Returns subtracting 1 from exp(x)."),
512
+ ("Math.floor(x)", "Returns the largest integer less than or equal to a given number."),
513
+ ("Math.fround(x)", "Returns the nearest 32-bit single precision float representation of a number."),
514
+ ("Math.hypot([value1[, value2[, ...]]])", "Returns the square root of the sum of squares of its arguments."),
515
+ ("Math.imul(a, b)", "Returns the result of the C-like 32-bit multiplication of the two parameters."),
516
+ ("Math.log(x)", "Returns the natural logarithm (base e) of a number."),
517
+ ("Math.log1p(x)", "Returns the natural logarithm (base e) of 1 + a number."),
518
+ ("Math.log10(x)", "Returns the base 10 logarithm of a number."),
519
+ ("Math.log2(x)", "Returns the base 2 logarithm of a number."),
520
+ ("Math.max([value1[, value2[, ...]]])", "Returns the largest of zero or more numbers."),
521
+ ("Math.min([value1[, value2[, ...]]])", "Returns the smallest of zero or more numbers."),
522
+ ("Math.pow(base, exponent)", "Returns base to the exponent power, that is, base^exponent."),
523
+ ("Math.random()", "Returns a pseudo-random number between 0 and 1."),
524
+ ("Math.round(x)", "Returns the value of a number rounded to the nearest integer."),
525
+ ("Math.sign(x)", "Returns the sign of the x, indicating whether x is positive, negative or zero."),
526
+ ("Math.sin(x)", "Returns the sine of a number."),
527
+ ("Math.sinh(x)", "Returns the hyperbolic sine of a number."),
528
+ ("Math.sqrt(x)", "Returns the positive square root of a number."),
529
+ ("Math.tan(x)", "Returns the tangent of a number."),
530
+ ("Math.tanh(x)", "Returns the hyperbolic tangent of a number."),
531
+ ("Math.trunc(x)", "Returns the integer part of a number by removing any fractional digits."),
532
+ ("Promise.all(iterable)", "Wait for all promises to be resolved, or for any to be rejected."),
533
+ ("Promise.allSettled(iterable)", "Wait until all promises have settled (each may resolve or reject)."),
534
+ ("Promise.any(iterable)", "Returns a promise that resolves as soon as any of the promises in the iterable fulfills."),
535
+ ("Promise.race(iterable)", "Wait until any of the promises is resolved or rejected."),
536
+ ("Promise.reject(reason)", "Returns a Promise object that is rejected with the given reason."),
537
+ ("Promise.resolve(value)", "Returns a Promise object that is resolved with the given value."),
538
+ ("promise.catch(onRejected)", "Appends a rejection handler callback to the promise."),
539
+ ("promise.finally(onFinally)", "Appends a handler to the promise that is called when the promise is settled."),
540
+ ("promise.then(onFulfilled[, onRejected])", "Appends fulfillment and rejection handlers to the promise."),
541
+ ("JSON.parse(text[, reviver])", "Parses a JSON string, constructing the JavaScript value or object described by the string."),
542
+ ("JSON.stringify(value[, replacer[, space]])", "Converts a JavaScript value to a JSON string."),
543
+ ("console.log(...data)", "Outputs a message to the web console."),
544
+ ("console.error(...data)", "Outputs an error message to the web console."),
545
+ ("console.warn(...data)", "Outputs a warning message to the web console."),
546
+ ("console.info(...data)", "Outputs an informational message to the web console."),
547
+ ("console.debug(...data)", "Outputs a message to the console with the log level debug."),
548
+ ("console.table(data[, columns])", "Displays tabular data as a table."),
549
+ ("console.time(label)", "Starts a timer you can use to track how long an operation takes."),
550
+ ("console.timeEnd(label)", "Stops a timer that was previously started by calling console.time()."),
551
+ ("console.trace(...data)", "Outputs a stack trace to the console."),
552
+ ("console.clear()", "Clears the console if the console allows it."),
553
+ ("console.count([label])", "Logs the number of times this particular call to count() has been called."),
554
+ ("console.countReset([label])", "Resets the counter used with console.count()."),
555
+ ("console.group([label])", "Creates a new inline group in the console."),
556
+ ("console.groupEnd()", "Exits the current inline group in the console."),
557
+ ("console.assert(assertion, ...data)", "Writes an error message to the console if the assertion is false."),
558
+ ("fetch(resource[, options])", "Starts the process of fetching a resource from the network, returning a promise."),
559
+ ("setTimeout(callback, delay[, ...args])", "Sets a timer which executes a function once the timer expires."),
560
+ ("setInterval(callback, delay[, ...args])", "Repeatedly calls a function with a fixed time delay between each call."),
561
+ ("clearTimeout(timeoutID)", "Cancels a timeout previously established by calling setTimeout()."),
562
+ ("clearInterval(intervalID)", "Cancels a timed, repeating action which was previously established by a call to setInterval()."),
563
+ ("parseInt(string[, radix])", "Parses a string argument and returns an integer of the specified radix."),
564
+ ("parseFloat(string)", "Parses an argument and returns a floating point number."),
565
+ ("isNaN(value)", "Determines whether a value is NaN or not."),
566
+ ("isFinite(value)", "Determines whether the passed value is a finite number."),
567
+ ("encodeURI(URI)", "Encodes a URI by replacing certain characters with UTF-8 escape sequences."),
568
+ ("encodeURIComponent(uriComponent)", "Encodes a URI component by replacing certain characters with UTF-8 escape sequences."),
569
+ ("decodeURI(encodedURI)", "Decodes a Uniform Resource Identifier (URI) previously created by encodeURI."),
570
+ ("decodeURIComponent(encodedURIComponent)", "Decodes a URI component previously created by encodeURIComponent."),
571
+ ]
572
+
573
+ # TypeScript type system, error patterns, and best practices
574
+ TYPESCRIPT_DOCS = [
575
+ # === TypeScript Error Codes and Fixes ===
576
+ ("TS2322: Type assignment error", "Error TS2322: Type 'X' is not assignable to type 'Y'. This occurs when trying to assign a value of one type to a variable of an incompatible type. Fix: Ensure the value matches the expected type, use type assertion if certain, or widen the target type."),
577
+ ("TS2322 fix: string to number", "TS2322: Type 'string' is not assignable to type 'number'. Fix: Use parseInt() or parseFloat() to convert string to number, or Number(value). Example: const num: number = parseInt(stringValue, 10);"),
578
+ ("TS2322 fix: union types", "TS2322: Type 'A' is not assignable to type 'B'. When working with union types, narrow the type first. Example: if (typeof value === 'string') { /* now value is string */ }"),
579
+ ("TS2339: Property does not exist", "Error TS2339: Property 'X' does not exist on type 'Y'. This occurs when accessing a property that TypeScript doesn't recognize. Fix: Add the property to the type definition, use type assertion, or check if the property exists."),
580
+ ("TS2339 fix: add to interface", "TS2339 fix: Define the property in your interface. interface User { name: string; email?: string; } // Now user.email is valid"),
581
+ ("TS2339 fix: type guard", "TS2339 fix: Use type guards to narrow types. if ('email' in user) { console.log(user.email); } // TypeScript now knows email exists"),
582
+ ("TS2339 fix: optional chaining", "TS2339 fix: Use optional chaining for potentially undefined properties. const email = user?.email; // Returns undefined if user is nullish"),
583
+ ("TS2345: Argument type mismatch", "Error TS2345: Argument of type 'X' is not assignable to parameter of type 'Y'. Function parameter types don't match. Fix: Ensure arguments match expected parameter types."),
584
+ ("TS2345 fix: callback types", "TS2345 fix for callbacks: array.map((item: Item) => item.value); // Explicitly type the callback parameter to match expected signature"),
585
+ ("TS2345 fix: overloads", "TS2345 with overloaded functions: Check which overload signature matches your use case. TypeScript picks the first matching overload."),
586
+ ("TS2532: Object possibly undefined", "Error TS2532: Object is possibly 'undefined'. Accessing a property on a potentially undefined value. Fix: Add null check, use optional chaining, or non-null assertion if certain."),
587
+ ("TS2532 fix: null check", "TS2532 fix: Add explicit null check. if (obj !== undefined && obj !== null) { obj.property; } // Or: if (obj) { obj.property; }"),
588
+ ("TS2532 fix: non-null assertion", "TS2532 fix: Use non-null assertion operator (!) only when certain value exists. const value = obj!.property; // Dangerous: bypasses type checking"),
589
+ ("TS2532 fix: nullish coalescing", "TS2532 fix: Use nullish coalescing for defaults. const value = obj?.property ?? 'default'; // Returns 'default' if undefined/null"),
590
+ ("TS7006: Implicit any parameter", "Error TS7006: Parameter 'X' implicitly has an 'any' type. Function parameter lacks type annotation. Fix: Add explicit type annotation or enable noImplicitAny: false (not recommended)."),
591
+ ("TS7006 fix: annotate parameters", "TS7006 fix: Always annotate function parameters. function greet(name: string): string { return `Hello, ${name}`; }"),
592
+ ("TS7006 fix: callback typing", "TS7006 fix for callbacks: array.forEach((item: ItemType) => {}); or use generic typing: array.forEach<ItemType>(item => {});"),
593
+ ("TS2531: Object possibly null", "Error TS2531: Object is possibly 'null'. Similar to TS2532 but specifically for null. Fix: Add null check or use non-null assertion."),
594
+ ("TS2564: Property not initialized", "Error TS2564: Property 'X' has no initializer and is not definitely assigned. Class property declared but not initialized. Fix: Initialize in constructor, use definite assignment assertion (!), or make optional."),
595
+ ("TS2564 fix: constructor init", "TS2564 fix: Initialize property in constructor. class User { name: string; constructor() { this.name = ''; } }"),
596
+ ("TS2564 fix: definite assignment", "TS2564 fix: Use definite assignment assertion if initialized elsewhere. class User { name!: string; init() { this.name = 'test'; } }"),
597
+ ("TS2769: No overload matches", "Error TS2769: No overload matches this call. None of the function's overload signatures match the provided arguments. Check each overload's parameter types."),
598
+ ("TS2304: Cannot find name", "Error TS2304: Cannot find name 'X'. Identifier is not defined or imported. Fix: Import the identifier, declare it, or check spelling."),
599
+ ("TS2307: Cannot find module", "Error TS2307: Cannot find module 'X'. Module import failed. Fix: Install the package, add @types package, or create declaration file."),
600
+ ("TS2307 fix: types package", "TS2307 fix: Install type definitions. npm install --save-dev @types/packagename. For packages without types, create a .d.ts file."),
601
+ ("TS2352: Conversion may be mistake", "Error TS2352: Conversion of type 'X' to type 'Y' may be a mistake. Type assertion might be incorrect. Fix: Use double assertion (as unknown as Y) or fix the underlying type issue."),
602
+ ("TS2416: Property incompatible", "Error TS2416: Property 'X' in type 'Y' is not assignable to the same property in base type. Subclass property has incompatible type. Fix: Ensure subclass property matches or extends base property type."),
603
+ ("TS2551: Did you mean", "Error TS2551: Property 'X' does not exist. Did you mean 'Y'? Typo in property name. Fix: Use the suggested property name or add the new property to the type."),
604
+ ("TS18046: Unknown type", "Error TS18046: 'X' is of type 'unknown'. Cannot use unknown value directly. Fix: Narrow the type with type guards before using."),
605
+ ("TS18046 fix: type narrowing", "TS18046 fix: Narrow unknown type. if (typeof value === 'string') { value.toUpperCase(); } // Now value is string"),
606
+
607
+ # === strictNullChecks Issues ===
608
+ ("strictNullChecks overview", "strictNullChecks: When enabled, null and undefined have their own distinct types and are not assignable to other types. This catches many null reference bugs at compile time."),
609
+ ("strictNullChecks: null vs undefined", "With strictNullChecks: null and undefined are NOT assignable to other types. let name: string = null; // Error! Use: let name: string | null = null;"),
610
+ ("strictNullChecks: function returns", "strictNullChecks with function returns: function find(): User | undefined { } const user = find(); user.name; // Error! user might be undefined"),
611
+ ("strictNullChecks: array methods", "strictNullChecks with array.find(): const item = array.find(x => x.id === 1); // Type is T | undefined, must check before using"),
612
+ ("strictNullChecks: optional params", "strictNullChecks with optional parameters: function greet(name?: string) { name.toUpperCase(); } // Error! name might be undefined"),
613
+ ("strictNullChecks: definite assignment", "strictNullChecks with class properties: Enable strictPropertyInitialization to catch uninitialized properties. Use ! for definite assignment."),
614
+ ("strictNullChecks: non-null map", "strictNullChecks pattern: Use Map<K,V>.get() returns V | undefined. Always check: const value = map.get(key); if (value !== undefined) { }"),
615
+
616
+ # === any vs unknown Usage ===
617
+ ("any type dangers", "any type: Disables type checking completely. Avoid using any as it defeats TypeScript's purpose. Use unknown or proper types instead."),
618
+ ("any type: when acceptable", "Acceptable any uses: During migration from JavaScript, for truly dynamic content, or when proper typing is impossible. Always document why."),
619
+ ("unknown type: safer any", "unknown type: Type-safe alternative to any. You must narrow the type before using the value. const data: unknown = JSON.parse(str);"),
620
+ ("unknown narrowing patterns", "Narrowing unknown: Use typeof for primitives, instanceof for classes, 'prop' in obj for objects, or custom type guards."),
621
+ ("unknown vs any comparison", "unknown vs any: any lets you do anything (unsafe). unknown requires type narrowing before use (safe). Prefer unknown for external data."),
622
+ ("unknown type guard example", "Type guard for unknown: function isUser(value: unknown): value is User { return typeof value === 'object' && value !== null && 'name' in value; }"),
623
+ ("any to unknown migration", "Migrating any to unknown: Replace any with unknown, then add type guards where the value is used. This reveals all unsafe type assumptions."),
624
+
625
+ # === Interface vs Type Patterns ===
626
+ ("interface vs type: basics", "interface vs type: Both define object shapes. Interfaces can be extended/merged, types can use unions/intersections. Choose based on use case."),
627
+ ("interface declaration merging", "Interface declaration merging: Multiple interface declarations with same name merge. interface User { name: string; } interface User { email: string; } // User has both"),
628
+ ("type alias unions", "Type alias for unions: type Status = 'pending' | 'active' | 'closed'; // Types excel at union types, interfaces cannot do this"),
629
+ ("type alias intersections", "Type alias for intersections: type UserWithRole = User & { role: string }; // Combine types with &"),
630
+ ("interface extends", "Interface extends: interface Admin extends User { permissions: string[]; } // Cleaner inheritance syntax than type intersections"),
631
+ ("interface implements", "Interface with implements: class UserImpl implements User { name: string; } // Interfaces work with class implements, types also work"),
632
+ ("type for function signatures", "Type for function signatures: type Handler = (event: Event) => void; // Types are cleaner for function type aliases"),
633
+ ("interface for object shapes", "Interface for object shapes: interface User { name: string; age: number; } // Interfaces are conventional for object shapes"),
634
+ ("mapped types require type", "Mapped types require type alias: type Optional<T> = { [K in keyof T]?: T[K] }; // Cannot do with interface"),
635
+ ("conditional types require type", "Conditional types require type alias: type NonNullable<T> = T extends null | undefined ? never : T;"),
636
+ ("when to use interface", "Use interface when: Defining object shapes, class contracts, extending existing types, or when declaration merging is needed."),
637
+ ("when to use type", "Use type when: Creating unions, intersections, mapped types, conditional types, or aliasing primitives/tuples."),
638
+
639
+ # === Generic Patterns ===
640
+ ("generic function basics", "Generic function: function identity<T>(arg: T): T { return arg; } // T is inferred from argument or explicitly provided"),
641
+ ("generic constraints", "Generic constraints: function getLength<T extends { length: number }>(arg: T): number { return arg.length; } // T must have length"),
642
+ ("generic interface", "Generic interface: interface Container<T> { value: T; getValue(): T; } // Type parameter for flexible containers"),
643
+ ("generic class", "Generic class: class Box<T> { constructor(public value: T) {} } const numBox = new Box<number>(42);"),
644
+ ("generic default type", "Generic default type: interface Response<T = any> { data: T; } // T defaults to any if not specified"),
645
+ ("multiple type parameters", "Multiple type parameters: function map<T, U>(arr: T[], fn: (item: T) => U): U[] { return arr.map(fn); }"),
646
+ ("generic constraint keyof", "keyof constraint: function getProperty<T, K extends keyof T>(obj: T, key: K): T[K] { return obj[key]; } // K must be key of T"),
647
+ ("generic inference", "Generic inference: const result = identity('hello'); // TypeScript infers T as string from argument"),
648
+ ("generic conditional types", "Generic conditional: type Flatten<T> = T extends Array<infer U> ? U : T; // Infer element type from array"),
649
+
650
+ # === Utility Types ===
651
+ ("Partial<T> utility", "Partial<T>: Makes all properties optional. interface User { name: string; age: number; } type PartialUser = Partial<User>; // { name?: string; age?: number; }"),
652
+ ("Required<T> utility", "Required<T>: Makes all properties required. type RequiredUser = Required<PartialUser>; // Opposite of Partial"),
653
+ ("Readonly<T> utility", "Readonly<T>: Makes all properties readonly. type ImmutableUser = Readonly<User>; // Cannot modify properties"),
654
+ ("Pick<T, K> utility", "Pick<T, K>: Select specific properties. type UserName = Pick<User, 'name'>; // { name: string; }"),
655
+ ("Omit<T, K> utility", "Omit<T, K>: Remove specific properties. type UserWithoutAge = Omit<User, 'age'>; // { name: string; }"),
656
+ ("Record<K, T> utility", "Record<K, T>: Create object type with keys K and values T. type UserMap = Record<string, User>; // { [key: string]: User }"),
657
+ ("Exclude<T, U> utility", "Exclude<T, U>: Remove types from union. type WithoutNull = Exclude<string | null, null>; // string"),
658
+ ("Extract<T, U> utility", "Extract<T, U>: Extract types from union. type OnlyStrings = Extract<string | number, string>; // string"),
659
+ ("NonNullable<T> utility", "NonNullable<T>: Remove null and undefined. type SafeString = NonNullable<string | null | undefined>; // string"),
660
+ ("ReturnType<T> utility", "ReturnType<T>: Get function return type. type Result = ReturnType<typeof myFunction>; // Extracts return type"),
661
+ ("Parameters<T> utility", "Parameters<T>: Get function parameter types as tuple. type Params = Parameters<typeof myFunction>; // [arg1Type, arg2Type]"),
662
+ ("InstanceType<T> utility", "InstanceType<T>: Get instance type of constructor. type UserInstance = InstanceType<typeof UserClass>;"),
663
+ ("Awaited<T> utility", "Awaited<T>: Unwrap Promise type. type Data = Awaited<Promise<string>>; // string. Works with nested promises."),
664
+
665
+ # === Declaration Files (.d.ts) ===
666
+ ("declaration file basics", "Declaration files (.d.ts): Provide type information for JavaScript code. Contains only type declarations, no implementations."),
667
+ ("declare module", "declare module: Define types for a module. declare module 'my-lib' { export function doSomething(): void; }"),
668
+ ("declare global", "declare global: Extend global scope. declare global { interface Window { myGlobal: string; } }"),
669
+ ("ambient declarations", "Ambient declarations: declare const, declare function, declare class. Describe existing JavaScript without implementing."),
670
+ ("triple-slash directives", "Triple-slash directives: /// <reference types='node' /> Include type definitions. Used at top of declaration files."),
671
+ ("@types packages", "@types packages: Community-maintained type definitions. npm install --save-dev @types/lodash. Automatically included by TypeScript."),
672
+
673
+ # === Common Type Patterns ===
674
+ ("discriminated unions", "Discriminated unions: Union types with a common property that distinguishes them. type Shape = { kind: 'circle'; radius: number } | { kind: 'square'; side: number }"),
675
+ ("exhaustive check pattern", "Exhaustive check: function assertNever(x: never): never { throw new Error('Unexpected: ' + x); } Use in switch default to catch unhandled cases."),
676
+ ("type narrowing", "Type narrowing: TypeScript narrows types based on control flow. if (typeof x === 'string') { /* x is string here */ }"),
677
+ ("type predicates", "Type predicates: function isString(value: unknown): value is string { return typeof value === 'string'; } // Custom type guard"),
678
+ ("assertion functions", "Assertion functions: function assert(condition: unknown): asserts condition { if (!condition) throw new Error(); } // Narrows after call"),
679
+ ("branded types", "Branded types: type UserId = string & { readonly brand: unique symbol }; // Create distinct types from primitives"),
680
+ ("template literal types", "Template literal types: type EventName = `on${Capitalize<string>}`; // 'onClick', 'onHover', etc."),
681
+ ("const assertions", "const assertions: const config = { name: 'app' } as const; // Makes object deeply readonly with literal types"),
682
+ ("satisfies operator", "satisfies operator: const config = { theme: 'dark' } satisfies Config; // Type check without widening"),
683
+ ("infer keyword", "infer keyword: type GetReturnType<T> = T extends (...args: any[]) => infer R ? R : never; // Extract types in conditionals"),
684
+
685
+ # === Async/Promise Typing ===
686
+ ("Promise type annotation", "Promise typing: async function fetch(): Promise<User> { } // Return type is Promise<User>"),
687
+ ("Promise.all typing", "Promise.all typing: const [user, posts] = await Promise.all([getUser(), getPosts()]); // Returns tuple of resolved types"),
688
+ ("async generator types", "Async generator: async function* stream(): AsyncGenerator<Data, void, unknown> { yield data; }"),
689
+ ("error handling types", "Error handling: try { } catch (error: unknown) { if (error instanceof Error) { error.message; } } // error is unknown in TS 4.4+"),
690
+
691
+ # === React TypeScript Patterns ===
692
+ ("React FC typing", "React FC: const Component: React.FC<Props> = ({ name }) => <div>{name}</div>; // Function component with props"),
693
+ ("React useState typing", "useState typing: const [user, setUser] = useState<User | null>(null); // Explicitly type state when initial value doesn't match"),
694
+ ("React useRef typing", "useRef typing: const inputRef = useRef<HTMLInputElement>(null); // Type the ref element"),
695
+ ("React event typing", "Event typing: const handleClick = (e: React.MouseEvent<HTMLButtonElement>) => { }; // Type event and element"),
696
+ ("React children typing", "Children typing: interface Props { children: React.ReactNode; } // ReactNode for any renderable content"),
697
+ ("React props with generics", "Generic props: interface ListProps<T> { items: T[]; render: (item: T) => React.ReactNode; }"),
698
+
699
+ # === Common Mistakes and Fixes ===
700
+ ("mistake: {} type", "Avoid {} type: {} means any non-nullish value, not empty object. Use Record<string, never> for empty object or object for any object."),
701
+ ("mistake: Object type", "Avoid Object type: Use object (lowercase) for non-primitive, or define specific shape. Object includes primitives via boxing."),
702
+ ("mistake: Function type", "Avoid Function type: Too loose. Use specific signature: type Handler = (event: Event) => void; or (...args: any[]) => any"),
703
+ ("mistake: any in catch", "Catch clause error type: In TS 4.4+ catch(e) has unknown type. Use: catch(e) { if (e instanceof Error) { } }"),
704
+ ("mistake: array type", "Array typing: Prefer Type[] over Array<Type> for simple arrays. Use Array<Type> for complex generics only."),
705
+ ("mistake: enum vs union", "Enum vs union: Prefer union types over enums. type Status = 'active' | 'inactive'; // Simpler, tree-shakeable"),
706
+ ("mistake: interface for primitives", "Don't use interface for primitives: type ID = string; // Not: interface ID extends String {}"),
707
+ ("mistake: mutation in reduce", "Reduce typing: array.reduce<Accumulator>((acc, item) => acc, initialValue); // Type the accumulator explicitly"),
708
+ ("mistake: object index signature", "Index signature: interface Dict { [key: string]: number; } // Returns number | undefined with noUncheckedIndexedAccess"),
709
+ ]
710
+
711
+ # Common programming concepts and patterns
712
+ PROGRAMMING_CONCEPTS = [
713
+ ("async/await pattern", "A way to write asynchronous code that looks and behaves like synchronous code. async functions return Promises and await pauses execution until a Promise resolves."),
714
+ ("callback function", "A function passed as an argument to another function, to be called back at a later time when some operation completes."),
715
+ ("closure", "A function that has access to variables from its outer scope, even after the outer function has returned."),
716
+ ("currying", "The technique of converting a function that takes multiple arguments into a sequence of functions that each take a single argument."),
717
+ ("debouncing", "A technique to ensure that a function is not called too frequently. It delays execution until after a specified time has passed since the last call."),
718
+ ("decorator pattern", "A design pattern that allows behavior to be added to an individual object dynamically, without affecting other objects of the same class."),
719
+ ("dependency injection", "A technique where an object receives its dependencies from external sources rather than creating them internally."),
720
+ ("destructuring assignment", "A syntax that makes it possible to unpack values from arrays or properties from objects into distinct variables."),
721
+ ("event delegation", "A technique where a single event listener is attached to a parent element to handle events for its child elements."),
722
+ ("factory pattern", "A creational design pattern that uses factory methods to create objects without specifying the exact class of the object to be created."),
723
+ ("higher-order function", "A function that takes one or more functions as arguments or returns a function as its result."),
724
+ ("hoisting", "JavaScript's default behavior of moving declarations to the top of their scope before code execution."),
725
+ ("immutability", "The concept of data that cannot be changed after it's created. New data structures are created instead of modifying existing ones."),
726
+ ("memoization", "An optimization technique that stores the results of expensive function calls and returns the cached result when the same inputs occur again."),
727
+ ("middleware", "Software that acts as a bridge between different applications or components, processing requests before they reach their final destination."),
728
+ ("module pattern", "A design pattern used to create self-contained pieces of code with private and public parts."),
729
+ ("observer pattern", "A design pattern where an object maintains a list of dependents and notifies them automatically of any state changes."),
730
+ ("polymorphism", "The ability of different classes to be treated as instances of the same class through inheritance or interfaces."),
731
+ ("promise chaining", "A technique where multiple asynchronous operations are executed in sequence by chaining .then() methods."),
732
+ ("prototype chain", "The mechanism by which JavaScript objects inherit features from one another through their prototype property."),
733
+ ("pure function", "A function that always returns the same result for the same arguments and has no side effects."),
734
+ ("recursion", "A technique where a function calls itself to solve smaller instances of the same problem."),
735
+ ("rest parameters", "A syntax that allows a function to accept an indefinite number of arguments as an array."),
736
+ ("singleton pattern", "A design pattern that restricts the instantiation of a class to a single instance."),
737
+ ("spread operator", "A syntax that allows an iterable to be expanded in places where zero or more arguments or elements are expected."),
738
+ ("state machine", "A model where an object can be in one of a finite number of states and can transition between states based on events."),
739
+ ("throttling", "A technique that ensures a function is called at most once in a specified time period."),
740
+ ("type coercion", "The automatic or implicit conversion of values from one data type to another."),
741
+ ("variable shadowing", "When a variable in a local scope has the same name as a variable in an outer scope."),
742
+ ("virtual DOM", "A programming concept where a virtual representation of a UI is kept in memory and synced with the real DOM."),
743
+ ("generator function", "A function that can be paused and resumed, yielding multiple values over time."),
744
+ ("iterator protocol", "A standard way to produce a sequence of values, one at a time, in an object."),
745
+ ("proxy pattern", "A design pattern that provides a surrogate or placeholder for another object to control access to it."),
746
+ ("reflection", "The ability of a program to examine and modify its own structure and behavior at runtime."),
747
+ ("lazy evaluation", "A strategy that delays the evaluation of an expression until its value is needed."),
748
+ ("tail call optimization", "A compiler optimization that reuses the current stack frame for the next function call when possible."),
749
+ ("event loop", "A mechanism that handles execution of code, collecting and processing events, and executing queued sub-tasks."),
750
+ ("lexical scope", "The scope determined by the physical placement of the code, where inner functions have access to variables declared in their outer scope."),
751
+ ("monadic pattern", "A design pattern that wraps a value and provides methods to transform it while maintaining the wrapped structure."),
752
+ ("composition over inheritance", "A design principle that favors combining simple objects to achieve more complex behavior rather than using class hierarchies."),
753
+ ]
754
+
755
+
756
+ def get_conn():
757
+ """Get database connection"""
758
+ return psycopg2.connect(**OVERFLOW_DB)
759
+
760
+
761
+ def count_training_entries() -> int:
762
+ """Count existing training data entries"""
763
+ conn = get_conn()
764
+ try:
765
+ with conn.cursor() as cur:
766
+ cur.execute("SELECT COUNT(*) FROM training_data")
767
+ return cur.fetchone()[0]
768
+ finally:
769
+ conn.close()
770
+
771
+
772
+ def seed_docs():
773
+ """Seed database with Python, JavaScript, and TypeScript documentation"""
774
+ conn = get_conn()
775
+
776
+ try:
777
+ existing = count_training_entries()
778
+ print(f"Existing training entries: {existing}")
779
+
780
+ if existing >= MIN_SAMPLES:
781
+ print(f"Already have {existing} samples (min: {MIN_SAMPLES}). Skipping seed.")
782
+ return
783
+
784
+ print(f"Seeding {len(PYTHON_DOCS)} Python docs...")
785
+ print(f"Seeding {len(JAVASCRIPT_DOCS)} JavaScript docs...")
786
+ print(f"Seeding {len(TYPESCRIPT_DOCS)} TypeScript docs...")
787
+ print(f"Seeding {len(PROGRAMMING_CONCEPTS)} programming concepts...")
788
+
789
+ all_docs = []
790
+
791
+ # Python docs
792
+ for name, desc in PYTHON_DOCS:
793
+ all_docs.append(('python', f"Python: {name} - {desc}"))
794
+
795
+ # JavaScript docs
796
+ for name, desc in JAVASCRIPT_DOCS:
797
+ all_docs.append(('javascript', f"JavaScript: {name} - {desc}"))
798
+
799
+ # TypeScript docs
800
+ for name, desc in TYPESCRIPT_DOCS:
801
+ all_docs.append(('typescript', f"TypeScript: {name} - {desc}"))
802
+
803
+ # Programming concepts
804
+ for name, desc in PROGRAMMING_CONCEPTS:
805
+ all_docs.append(('concepts', f"Programming concept: {name} - {desc}"))
806
+
807
+ inserted = 0
808
+ with conn.cursor() as cur:
809
+ for service, text in all_docs:
810
+ input_hash = hashlib.sha256(text.encode()).hexdigest()[:32]
811
+ size_bytes = len(text.encode())
812
+
813
+ try:
814
+ cur.execute("""
815
+ INSERT INTO training_data
816
+ (service, input_text, input_hash, size_bytes)
817
+ VALUES (%s, %s, %s, %s)
818
+ ON CONFLICT (input_hash) DO NOTHING
819
+ """, (service, text, input_hash, size_bytes))
820
+ if cur.rowcount > 0:
821
+ inserted += 1
822
+ except Exception as e:
823
+ print(f" Error inserting: {e}")
824
+
825
+ conn.commit()
826
+
827
+ print(f"\nSeeded {inserted} new entries")
828
+ print(f"Total training entries: {count_training_entries()}")
829
+
830
+ finally:
831
+ conn.close()
832
+
833
+
834
+ def show_stats():
835
+ """Show training data statistics"""
836
+ conn = get_conn()
837
+ try:
838
+ with conn.cursor() as cur:
839
+ cur.execute("""
840
+ SELECT service, COUNT(*), SUM(size_bytes)
841
+ FROM training_data
842
+ GROUP BY service
843
+ ORDER BY COUNT(*) DESC
844
+ """)
845
+
846
+ print("\nTraining Data by Service:")
847
+ print("-" * 50)
848
+ total = 0
849
+ total_size = 0
850
+ for row in cur:
851
+ service, count, size = row
852
+ size = size or 0
853
+ print(f" {service}: {count} entries ({size/1024:.1f} KB)")
854
+ total += count
855
+ total_size += size
856
+
857
+ print("-" * 50)
858
+ print(f" TOTAL: {total} entries ({total_size/1024:.1f} KB)")
859
+ print(f" Min required for PCA: {MIN_SAMPLES}")
860
+ print(f" Status: {'READY' if total >= MIN_SAMPLES else 'NEED MORE SAMPLES'}")
861
+
862
+ finally:
863
+ conn.close()
864
+
865
+
866
+ if __name__ == '__main__':
867
+ import argparse
868
+ parser = argparse.ArgumentParser(description='Seed Python/JS/TS docs for PCA training')
869
+ parser.add_argument('--seed', action='store_true', help='Seed the database')
870
+ parser.add_argument('--stats', action='store_true', help='Show statistics')
871
+ parser.add_argument('--force', action='store_true', help='Force re-seed even if samples exist')
872
+
873
+ args = parser.parse_args()
874
+
875
+ if args.stats:
876
+ show_stats()
877
+ elif args.seed or args.force:
878
+ if args.force:
879
+ print("Force seeding...")
880
+ seed_docs()
881
+ show_stats()
882
+ else:
883
+ print("Usage: python seed_docs.py --seed|--stats|--force")
884
+ print("\nThis script pre-loads Python, JavaScript, and TypeScript documentation")
885
+ print("into the training database to ensure PCA has enough samples.")