@pcircle/memesh 2.10.1 → 2.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.mcp.json +2 -5
- package/README.md +48 -248
- package/dist/cli/view.d.ts +3 -0
- package/dist/cli/view.d.ts.map +1 -0
- package/dist/cli/view.js +484 -0
- package/dist/cli/view.js.map +1 -0
- package/dist/db.d.ts +5 -0
- package/dist/db.d.ts.map +1 -0
- package/dist/db.js +80 -0
- package/dist/db.js.map +1 -0
- package/dist/index.d.ts +3 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -33
- package/dist/index.js.map +1 -1
- package/dist/knowledge-graph.d.ts +48 -0
- package/dist/knowledge-graph.d.ts.map +1 -0
- package/dist/knowledge-graph.js +186 -0
- package/dist/knowledge-graph.js.map +1 -0
- package/dist/mcp/server.d.ts +1 -25
- package/dist/mcp/server.d.ts.map +1 -1
- package/dist/mcp/server.js +33 -319
- package/dist/mcp/server.js.map +1 -1
- package/dist/mcp/tools.d.ts +93 -0
- package/dist/mcp/tools.d.ts.map +1 -0
- package/dist/mcp/tools.js +183 -0
- package/dist/mcp/tools.js.map +1 -0
- package/hooks/hooks.json +1 -41
- package/package.json +8 -90
- package/plugin.json +5 -8
- package/scripts/hooks/post-commit.js +132 -299
- package/scripts/hooks/session-start.js +84 -629
- package/README.de.md +0 -212
- package/README.es.md +0 -212
- package/README.fr.md +0 -212
- package/README.id.md +0 -212
- package/README.ja.md +0 -212
- package/README.ko.md +0 -212
- package/README.th.md +0 -212
- package/README.vi.md +0 -212
- package/README.zh-CN.md +0 -212
- package/README.zh-TW.md +0 -286
- package/dist/cli/config.d.ts +0 -36
- package/dist/cli/config.d.ts.map +0 -1
- package/dist/cli/config.js +0 -398
- package/dist/cli/config.js.map +0 -1
- package/dist/cli/credentials.d.ts +0 -12
- package/dist/cli/credentials.d.ts.map +0 -1
- package/dist/cli/credentials.js +0 -44
- package/dist/cli/credentials.js.map +0 -1
- package/dist/cli/daemon.d.ts +0 -3
- package/dist/cli/daemon.d.ts.map +0 -1
- package/dist/cli/daemon.js +0 -413
- package/dist/cli/daemon.js.map +0 -1
- package/dist/cli/dashboard.d.ts +0 -2
- package/dist/cli/dashboard.d.ts.map +0 -1
- package/dist/cli/dashboard.js +0 -300
- package/dist/cli/dashboard.js.map +0 -1
- package/dist/cli/index.d.ts +0 -3
- package/dist/cli/index.d.ts.map +0 -1
- package/dist/cli/index.js +0 -188
- package/dist/cli/index.js.map +0 -1
- package/dist/cli/login.d.ts +0 -4
- package/dist/cli/login.d.ts.map +0 -1
- package/dist/cli/login.js +0 -230
- package/dist/cli/login.js.map +0 -1
- package/dist/cli/logout.d.ts +0 -3
- package/dist/cli/logout.d.ts.map +0 -1
- package/dist/cli/logout.js +0 -23
- package/dist/cli/logout.js.map +0 -1
- package/dist/cli/setup-wizard.d.ts +0 -18
- package/dist/cli/setup-wizard.d.ts.map +0 -1
- package/dist/cli/setup-wizard.js +0 -267
- package/dist/cli/setup-wizard.js.map +0 -1
- package/dist/cli/stats.d.ts +0 -34
- package/dist/cli/stats.d.ts.map +0 -1
- package/dist/cli/stats.js +0 -479
- package/dist/cli/stats.js.map +0 -1
- package/dist/cli/tutorial.d.ts +0 -27
- package/dist/cli/tutorial.d.ts.map +0 -1
- package/dist/cli/tutorial.js +0 -430
- package/dist/cli/tutorial.js.map +0 -1
- package/dist/cloud/MeMeshCloudClient.d.ts +0 -88
- package/dist/cloud/MeMeshCloudClient.d.ts.map +0 -1
- package/dist/cloud/MeMeshCloudClient.js +0 -177
- package/dist/cloud/MeMeshCloudClient.js.map +0 -1
- package/dist/cloud/index.d.ts +0 -3
- package/dist/cloud/index.d.ts.map +0 -1
- package/dist/cloud/index.js +0 -2
- package/dist/cloud/index.js.map +0 -1
- package/dist/config/index.d.ts +0 -61
- package/dist/config/index.d.ts.map +0 -1
- package/dist/config/index.js +0 -105
- package/dist/config/index.js.map +0 -1
- package/dist/config/models.d.ts +0 -47
- package/dist/config/models.d.ts.map +0 -1
- package/dist/config/models.js +0 -57
- package/dist/config/models.js.map +0 -1
- package/dist/config/simple-config.d.ts +0 -35
- package/dist/config/simple-config.d.ts.map +0 -1
- package/dist/config/simple-config.js +0 -246
- package/dist/config/simple-config.js.map +0 -1
- package/dist/core/AgentRegistry.d.ts +0 -31
- package/dist/core/AgentRegistry.d.ts.map +0 -1
- package/dist/core/AgentRegistry.js +0 -281
- package/dist/core/AgentRegistry.js.map +0 -1
- package/dist/core/CheckpointDetector.d.ts +0 -25
- package/dist/core/CheckpointDetector.d.ts.map +0 -1
- package/dist/core/CheckpointDetector.js +0 -67
- package/dist/core/CheckpointDetector.js.map +0 -1
- package/dist/core/GitCommandParser.d.ts +0 -11
- package/dist/core/GitCommandParser.d.ts.map +0 -1
- package/dist/core/GitCommandParser.js +0 -43
- package/dist/core/GitCommandParser.js.map +0 -1
- package/dist/core/HealthCheck.d.ts +0 -39
- package/dist/core/HealthCheck.d.ts.map +0 -1
- package/dist/core/HealthCheck.js +0 -219
- package/dist/core/HealthCheck.js.map +0 -1
- package/dist/core/HookIntegration.d.ts +0 -47
- package/dist/core/HookIntegration.d.ts.map +0 -1
- package/dist/core/HookIntegration.js +0 -275
- package/dist/core/HookIntegration.js.map +0 -1
- package/dist/core/MCPToolInterface.d.ts +0 -120
- package/dist/core/MCPToolInterface.d.ts.map +0 -1
- package/dist/core/MCPToolInterface.js +0 -376
- package/dist/core/MCPToolInterface.js.map +0 -1
- package/dist/core/MistakePatternManager.d.ts +0 -31
- package/dist/core/MistakePatternManager.d.ts.map +0 -1
- package/dist/core/MistakePatternManager.js +0 -137
- package/dist/core/MistakePatternManager.js.map +0 -1
- package/dist/core/ResourceMonitor.d.ts +0 -32
- package/dist/core/ResourceMonitor.d.ts.map +0 -1
- package/dist/core/ResourceMonitor.js +0 -243
- package/dist/core/ResourceMonitor.js.map +0 -1
- package/dist/core/ServiceLocator.d.ts +0 -10
- package/dist/core/ServiceLocator.d.ts.map +0 -1
- package/dist/core/ServiceLocator.js +0 -30
- package/dist/core/ServiceLocator.js.map +0 -1
- package/dist/core/TestOutputParser.d.ts +0 -20
- package/dist/core/TestOutputParser.d.ts.map +0 -1
- package/dist/core/TestOutputParser.js +0 -144
- package/dist/core/TestOutputParser.js.map +0 -1
- package/dist/core/types.d.ts +0 -66
- package/dist/core/types.d.ts.map +0 -1
- package/dist/core/types.js +0 -11
- package/dist/core/types.js.map +0 -1
- package/dist/db/ConnectionPool.d.ts +0 -50
- package/dist/db/ConnectionPool.d.ts.map +0 -1
- package/dist/db/ConnectionPool.js +0 -569
- package/dist/db/ConnectionPool.js.map +0 -1
- package/dist/db/IDatabaseAdapter.d.ts +0 -25
- package/dist/db/IDatabaseAdapter.d.ts.map +0 -1
- package/dist/db/IDatabaseAdapter.js +0 -2
- package/dist/db/IDatabaseAdapter.js.map +0 -1
- package/dist/db/QueryCache.d.ts +0 -46
- package/dist/db/QueryCache.d.ts.map +0 -1
- package/dist/db/QueryCache.js +0 -232
- package/dist/db/QueryCache.js.map +0 -1
- package/dist/db/adapters/BetterSqlite3Adapter.d.ts +0 -15
- package/dist/db/adapters/BetterSqlite3Adapter.d.ts.map +0 -1
- package/dist/db/adapters/BetterSqlite3Adapter.js +0 -127
- package/dist/db/adapters/BetterSqlite3Adapter.js.map +0 -1
- package/dist/embeddings/EmbeddingService.d.ts +0 -23
- package/dist/embeddings/EmbeddingService.d.ts.map +0 -1
- package/dist/embeddings/EmbeddingService.js +0 -131
- package/dist/embeddings/EmbeddingService.js.map +0 -1
- package/dist/embeddings/InMemoryVectorAdapter.d.ts +0 -15
- package/dist/embeddings/InMemoryVectorAdapter.d.ts.map +0 -1
- package/dist/embeddings/InMemoryVectorAdapter.js +0 -58
- package/dist/embeddings/InMemoryVectorAdapter.js.map +0 -1
- package/dist/embeddings/ModelManager.d.ts +0 -18
- package/dist/embeddings/ModelManager.d.ts.map +0 -1
- package/dist/embeddings/ModelManager.js +0 -84
- package/dist/embeddings/ModelManager.js.map +0 -1
- package/dist/embeddings/SqliteVecAdapter.d.ts +0 -15
- package/dist/embeddings/SqliteVecAdapter.d.ts.map +0 -1
- package/dist/embeddings/SqliteVecAdapter.js +0 -107
- package/dist/embeddings/SqliteVecAdapter.js.map +0 -1
- package/dist/embeddings/VectorExtension.d.ts +0 -17
- package/dist/embeddings/VectorExtension.d.ts.map +0 -1
- package/dist/embeddings/VectorExtension.js +0 -107
- package/dist/embeddings/VectorExtension.js.map +0 -1
- package/dist/embeddings/VectorSearchAdapter.d.ts +0 -17
- package/dist/embeddings/VectorSearchAdapter.d.ts.map +0 -1
- package/dist/embeddings/VectorSearchAdapter.js +0 -2
- package/dist/embeddings/VectorSearchAdapter.js.map +0 -1
- package/dist/embeddings/index.d.ts +0 -9
- package/dist/embeddings/index.d.ts.map +0 -1
- package/dist/embeddings/index.js +0 -7
- package/dist/embeddings/index.js.map +0 -1
- package/dist/errors/ErrorClassifier.d.ts +0 -60
- package/dist/errors/ErrorClassifier.d.ts.map +0 -1
- package/dist/errors/ErrorClassifier.js +0 -415
- package/dist/errors/ErrorClassifier.js.map +0 -1
- package/dist/errors/index.d.ts +0 -63
- package/dist/errors/index.d.ts.map +0 -1
- package/dist/errors/index.js +0 -127
- package/dist/errors/index.js.map +0 -1
- package/dist/i18n/index.d.ts +0 -9
- package/dist/i18n/index.d.ts.map +0 -1
- package/dist/i18n/index.js +0 -78
- package/dist/i18n/index.js.map +0 -1
- package/dist/i18n/locales/en.d.ts +0 -3
- package/dist/i18n/locales/en.d.ts.map +0 -1
- package/dist/i18n/locales/en.js +0 -32
- package/dist/i18n/locales/en.js.map +0 -1
- package/dist/i18n/locales/index.d.ts +0 -5
- package/dist/i18n/locales/index.d.ts.map +0 -1
- package/dist/i18n/locales/index.js +0 -5
- package/dist/i18n/locales/index.js.map +0 -1
- package/dist/i18n/locales/ja.d.ts +0 -3
- package/dist/i18n/locales/ja.d.ts.map +0 -1
- package/dist/i18n/locales/ja.js +0 -30
- package/dist/i18n/locales/ja.js.map +0 -1
- package/dist/i18n/locales/zh-CN.d.ts +0 -3
- package/dist/i18n/locales/zh-CN.d.ts.map +0 -1
- package/dist/i18n/locales/zh-CN.js +0 -30
- package/dist/i18n/locales/zh-CN.js.map +0 -1
- package/dist/i18n/locales/zh-TW.d.ts +0 -3
- package/dist/i18n/locales/zh-TW.d.ts.map +0 -1
- package/dist/i18n/locales/zh-TW.js +0 -30
- package/dist/i18n/locales/zh-TW.js.map +0 -1
- package/dist/i18n/types.d.ts +0 -11
- package/dist/i18n/types.d.ts.map +0 -1
- package/dist/i18n/types.js +0 -3
- package/dist/i18n/types.js.map +0 -1
- package/dist/integrations/session-memory/SessionContextInjector.d.ts +0 -30
- package/dist/integrations/session-memory/SessionContextInjector.d.ts.map +0 -1
- package/dist/integrations/session-memory/SessionContextInjector.js +0 -192
- package/dist/integrations/session-memory/SessionContextInjector.js.map +0 -1
- package/dist/integrations/session-memory/SessionMemoryIngester.d.ts +0 -15
- package/dist/integrations/session-memory/SessionMemoryIngester.d.ts.map +0 -1
- package/dist/integrations/session-memory/SessionMemoryIngester.js +0 -229
- package/dist/integrations/session-memory/SessionMemoryIngester.js.map +0 -1
- package/dist/integrations/session-memory/SessionMemoryParser.d.ts +0 -16
- package/dist/integrations/session-memory/SessionMemoryParser.d.ts.map +0 -1
- package/dist/integrations/session-memory/SessionMemoryParser.js +0 -271
- package/dist/integrations/session-memory/SessionMemoryParser.js.map +0 -1
- package/dist/integrations/session-memory/SessionMemoryPipeline.d.ts +0 -20
- package/dist/integrations/session-memory/SessionMemoryPipeline.d.ts.map +0 -1
- package/dist/integrations/session-memory/SessionMemoryPipeline.js +0 -60
- package/dist/integrations/session-memory/SessionMemoryPipeline.js.map +0 -1
- package/dist/integrations/session-memory/SessionMemoryWatcher.d.ts +0 -27
- package/dist/integrations/session-memory/SessionMemoryWatcher.d.ts.map +0 -1
- package/dist/integrations/session-memory/SessionMemoryWatcher.js +0 -145
- package/dist/integrations/session-memory/SessionMemoryWatcher.js.map +0 -1
- package/dist/integrations/session-memory/index.d.ts +0 -9
- package/dist/integrations/session-memory/index.d.ts.map +0 -1
- package/dist/integrations/session-memory/index.js +0 -6
- package/dist/integrations/session-memory/index.js.map +0 -1
- package/dist/integrations/session-memory/types.d.ts +0 -74
- package/dist/integrations/session-memory/types.d.ts.map +0 -1
- package/dist/integrations/session-memory/types.js +0 -22
- package/dist/integrations/session-memory/types.js.map +0 -1
- package/dist/knowledge-graph/ContentHasher.d.ts +0 -4
- package/dist/knowledge-graph/ContentHasher.d.ts.map +0 -1
- package/dist/knowledge-graph/ContentHasher.js +0 -8
- package/dist/knowledge-graph/ContentHasher.js.map +0 -1
- package/dist/knowledge-graph/KGSearchEngine.d.ts +0 -37
- package/dist/knowledge-graph/KGSearchEngine.d.ts.map +0 -1
- package/dist/knowledge-graph/KGSearchEngine.js +0 -257
- package/dist/knowledge-graph/KGSearchEngine.js.map +0 -1
- package/dist/knowledge-graph/index.d.ts +0 -64
- package/dist/knowledge-graph/index.d.ts.map +0 -1
- package/dist/knowledge-graph/index.js +0 -681
- package/dist/knowledge-graph/index.js.map +0 -1
- package/dist/knowledge-graph/types.d.ts +0 -38
- package/dist/knowledge-graph/types.d.ts.map +0 -1
- package/dist/knowledge-graph/types.js +0 -2
- package/dist/knowledge-graph/types.js.map +0 -1
- package/dist/management/UninstallManager.d.ts +0 -23
- package/dist/management/UninstallManager.d.ts.map +0 -1
- package/dist/management/UninstallManager.js +0 -186
- package/dist/management/UninstallManager.js.map +0 -1
- package/dist/management/index.d.ts +0 -3
- package/dist/management/index.d.ts.map +0 -1
- package/dist/management/index.js +0 -2
- package/dist/management/index.js.map +0 -1
- package/dist/mcp/BuddyCommands.d.ts +0 -24
- package/dist/mcp/BuddyCommands.d.ts.map +0 -1
- package/dist/mcp/BuddyCommands.js +0 -423
- package/dist/mcp/BuddyCommands.js.map +0 -1
- package/dist/mcp/ClaudeMdReloader.d.ts +0 -37
- package/dist/mcp/ClaudeMdReloader.d.ts.map +0 -1
- package/dist/mcp/ClaudeMdReloader.js +0 -92
- package/dist/mcp/ClaudeMdReloader.js.map +0 -1
- package/dist/mcp/HumanInLoopUI.d.ts +0 -23
- package/dist/mcp/HumanInLoopUI.d.ts.map +0 -1
- package/dist/mcp/HumanInLoopUI.js +0 -92
- package/dist/mcp/HumanInLoopUI.js.map +0 -1
- package/dist/mcp/ProgressReporter.d.ts +0 -14
- package/dist/mcp/ProgressReporter.d.ts.map +0 -1
- package/dist/mcp/ProgressReporter.js +0 -22
- package/dist/mcp/ProgressReporter.js.map +0 -1
- package/dist/mcp/SamplingClient.d.ts +0 -32
- package/dist/mcp/SamplingClient.d.ts.map +0 -1
- package/dist/mcp/SamplingClient.js +0 -63
- package/dist/mcp/SamplingClient.js.map +0 -1
- package/dist/mcp/ServerInitializer.d.ts +0 -40
- package/dist/mcp/ServerInitializer.d.ts.map +0 -1
- package/dist/mcp/ServerInitializer.js +0 -147
- package/dist/mcp/ServerInitializer.js.map +0 -1
- package/dist/mcp/SessionBootstrapper.d.ts +0 -13
- package/dist/mcp/SessionBootstrapper.d.ts.map +0 -1
- package/dist/mcp/SessionBootstrapper.js +0 -82
- package/dist/mcp/SessionBootstrapper.js.map +0 -1
- package/dist/mcp/StdinBufferManager.d.ts +0 -11
- package/dist/mcp/StdinBufferManager.d.ts.map +0 -1
- package/dist/mcp/StdinBufferManager.js +0 -62
- package/dist/mcp/StdinBufferManager.js.map +0 -1
- package/dist/mcp/ToolDefinitions.d.ts +0 -44
- package/dist/mcp/ToolDefinitions.d.ts.map +0 -1
- package/dist/mcp/ToolDefinitions.js +0 -445
- package/dist/mcp/ToolDefinitions.js.map +0 -1
- package/dist/mcp/ToolRouter.d.ts +0 -27
- package/dist/mcp/ToolRouter.d.ts.map +0 -1
- package/dist/mcp/ToolRouter.js +0 -179
- package/dist/mcp/ToolRouter.js.map +0 -1
- package/dist/mcp/daemon/DaemonBootstrap.d.ts +0 -33
- package/dist/mcp/daemon/DaemonBootstrap.d.ts.map +0 -1
- package/dist/mcp/daemon/DaemonBootstrap.js +0 -155
- package/dist/mcp/daemon/DaemonBootstrap.js.map +0 -1
- package/dist/mcp/daemon/DaemonLockManager.d.ts +0 -47
- package/dist/mcp/daemon/DaemonLockManager.d.ts.map +0 -1
- package/dist/mcp/daemon/DaemonLockManager.js +0 -417
- package/dist/mcp/daemon/DaemonLockManager.js.map +0 -1
- package/dist/mcp/daemon/DaemonProtocol.d.ts +0 -127
- package/dist/mcp/daemon/DaemonProtocol.d.ts.map +0 -1
- package/dist/mcp/daemon/DaemonProtocol.js +0 -452
- package/dist/mcp/daemon/DaemonProtocol.js.map +0 -1
- package/dist/mcp/daemon/DaemonSocketServer.d.ts +0 -71
- package/dist/mcp/daemon/DaemonSocketServer.d.ts.map +0 -1
- package/dist/mcp/daemon/DaemonSocketServer.js +0 -384
- package/dist/mcp/daemon/DaemonSocketServer.js.map +0 -1
- package/dist/mcp/daemon/GracefulShutdownCoordinator.d.ts +0 -67
- package/dist/mcp/daemon/GracefulShutdownCoordinator.d.ts.map +0 -1
- package/dist/mcp/daemon/GracefulShutdownCoordinator.js +0 -206
- package/dist/mcp/daemon/GracefulShutdownCoordinator.js.map +0 -1
- package/dist/mcp/daemon/IpcTransport.d.ts +0 -42
- package/dist/mcp/daemon/IpcTransport.d.ts.map +0 -1
- package/dist/mcp/daemon/IpcTransport.js +0 -231
- package/dist/mcp/daemon/IpcTransport.js.map +0 -1
- package/dist/mcp/daemon/StdioProxyClient.d.ts +0 -84
- package/dist/mcp/daemon/StdioProxyClient.d.ts.map +0 -1
- package/dist/mcp/daemon/StdioProxyClient.js +0 -574
- package/dist/mcp/daemon/StdioProxyClient.js.map +0 -1
- package/dist/mcp/daemon/VersionManager.d.ts +0 -35
- package/dist/mcp/daemon/VersionManager.d.ts.map +0 -1
- package/dist/mcp/daemon/VersionManager.js +0 -169
- package/dist/mcp/daemon/VersionManager.js.map +0 -1
- package/dist/mcp/daemon/index.d.ts +0 -9
- package/dist/mcp/daemon/index.d.ts.map +0 -1
- package/dist/mcp/daemon/index.js +0 -9
- package/dist/mcp/daemon/index.js.map +0 -1
- package/dist/mcp/handlers/BuddyHandlers.d.ts +0 -18
- package/dist/mcp/handlers/BuddyHandlers.d.ts.map +0 -1
- package/dist/mcp/handlers/BuddyHandlers.js +0 -179
- package/dist/mcp/handlers/BuddyHandlers.js.map +0 -1
- package/dist/mcp/handlers/BuddyRecordMistake.d.ts +0 -17
- package/dist/mcp/handlers/BuddyRecordMistake.d.ts.map +0 -1
- package/dist/mcp/handlers/BuddyRecordMistake.js +0 -147
- package/dist/mcp/handlers/BuddyRecordMistake.js.map +0 -1
- package/dist/mcp/handlers/HookToolHandler.d.ts +0 -10
- package/dist/mcp/handlers/HookToolHandler.d.ts.map +0 -1
- package/dist/mcp/handlers/HookToolHandler.js +0 -92
- package/dist/mcp/handlers/HookToolHandler.js.map +0 -1
- package/dist/mcp/handlers/MemoryToolHandler.d.ts +0 -21
- package/dist/mcp/handlers/MemoryToolHandler.d.ts.map +0 -1
- package/dist/mcp/handlers/MemoryToolHandler.js +0 -433
- package/dist/mcp/handlers/MemoryToolHandler.js.map +0 -1
- package/dist/mcp/handlers/ResourceHandlers.d.ts +0 -3
- package/dist/mcp/handlers/ResourceHandlers.d.ts.map +0 -1
- package/dist/mcp/handlers/ResourceHandlers.js +0 -133
- package/dist/mcp/handlers/ResourceHandlers.js.map +0 -1
- package/dist/mcp/handlers/SystemToolHandler.d.ts +0 -14
- package/dist/mcp/handlers/SystemToolHandler.d.ts.map +0 -1
- package/dist/mcp/handlers/SystemToolHandler.js +0 -224
- package/dist/mcp/handlers/SystemToolHandler.js.map +0 -1
- package/dist/mcp/handlers/ToolHandlers.d.ts +0 -26
- package/dist/mcp/handlers/ToolHandlers.d.ts.map +0 -1
- package/dist/mcp/handlers/ToolHandlers.js +0 -41
- package/dist/mcp/handlers/ToolHandlers.js.map +0 -1
- package/dist/mcp/handlers/index.d.ts +0 -7
- package/dist/mcp/handlers/index.d.ts.map +0 -1
- package/dist/mcp/handlers/index.js +0 -7
- package/dist/mcp/handlers/index.js.map +0 -1
- package/dist/mcp/index.d.ts +0 -5
- package/dist/mcp/index.d.ts.map +0 -1
- package/dist/mcp/index.js +0 -3
- package/dist/mcp/index.js.map +0 -1
- package/dist/mcp/resources/ResourceRegistry.d.ts +0 -23
- package/dist/mcp/resources/ResourceRegistry.d.ts.map +0 -1
- package/dist/mcp/resources/ResourceRegistry.js +0 -26
- package/dist/mcp/resources/ResourceRegistry.js.map +0 -1
- package/dist/mcp/resources/URITemplateHandler.d.ts +0 -8
- package/dist/mcp/resources/URITemplateHandler.d.ts.map +0 -1
- package/dist/mcp/resources/URITemplateHandler.js +0 -29
- package/dist/mcp/resources/URITemplateHandler.js.map +0 -1
- package/dist/mcp/resources/best-practices.md +0 -53
- package/dist/mcp/resources/buddy-do-skill.md +0 -84
- package/dist/mcp/resources/ccb-complete-guide.md +0 -247
- package/dist/mcp/resources/examples.md +0 -47
- package/dist/mcp/resources/handlers/AgentStatusHandler.d.ts +0 -7
- package/dist/mcp/resources/handlers/AgentStatusHandler.d.ts.map +0 -1
- package/dist/mcp/resources/handlers/AgentStatusHandler.js +0 -41
- package/dist/mcp/resources/handlers/AgentStatusHandler.js.map +0 -1
- package/dist/mcp/resources/handlers/TaskLogsHandler.d.ts +0 -7
- package/dist/mcp/resources/handlers/TaskLogsHandler.d.ts.map +0 -1
- package/dist/mcp/resources/handlers/TaskLogsHandler.js +0 -35
- package/dist/mcp/resources/handlers/TaskLogsHandler.js.map +0 -1
- package/dist/mcp/resources/quick-reference.md +0 -71
- package/dist/mcp/resources/usage-guide.md +0 -74
- package/dist/mcp/schemas/OutputSchemas.d.ts +0 -437
- package/dist/mcp/schemas/OutputSchemas.d.ts.map +0 -1
- package/dist/mcp/schemas/OutputSchemas.js +0 -215
- package/dist/mcp/schemas/OutputSchemas.js.map +0 -1
- package/dist/mcp/server-bootstrap.d.ts +0 -3
- package/dist/mcp/server-bootstrap.d.ts.map +0 -1
- package/dist/mcp/server-bootstrap.js +0 -391
- package/dist/mcp/server-bootstrap.js.map +0 -1
- package/dist/mcp/tools/add-observations.d.ts +0 -48
- package/dist/mcp/tools/add-observations.d.ts.map +0 -1
- package/dist/mcp/tools/add-observations.js +0 -64
- package/dist/mcp/tools/add-observations.js.map +0 -1
- package/dist/mcp/tools/buddy-do.d.ts +0 -15
- package/dist/mcp/tools/buddy-do.d.ts.map +0 -1
- package/dist/mcp/tools/buddy-do.js +0 -191
- package/dist/mcp/tools/buddy-do.js.map +0 -1
- package/dist/mcp/tools/buddy-help.d.ts +0 -13
- package/dist/mcp/tools/buddy-help.d.ts.map +0 -1
- package/dist/mcp/tools/buddy-help.js +0 -44
- package/dist/mcp/tools/buddy-help.js.map +0 -1
- package/dist/mcp/tools/buddy-remember.d.ts +0 -24
- package/dist/mcp/tools/buddy-remember.d.ts.map +0 -1
- package/dist/mcp/tools/buddy-remember.js +0 -304
- package/dist/mcp/tools/buddy-remember.js.map +0 -1
- package/dist/mcp/tools/create-entities.d.ts +0 -66
- package/dist/mcp/tools/create-entities.d.ts.map +0 -1
- package/dist/mcp/tools/create-entities.js +0 -224
- package/dist/mcp/tools/create-entities.js.map +0 -1
- package/dist/mcp/tools/create-relations.d.ts +0 -60
- package/dist/mcp/tools/create-relations.d.ts.map +0 -1
- package/dist/mcp/tools/create-relations.js +0 -84
- package/dist/mcp/tools/create-relations.js.map +0 -1
- package/dist/mcp/tools/generate-tests.d.ts +0 -11
- package/dist/mcp/tools/generate-tests.d.ts.map +0 -1
- package/dist/mcp/tools/generate-tests.js +0 -19
- package/dist/mcp/tools/generate-tests.js.map +0 -1
- package/dist/mcp/tools/health-check.d.ts +0 -10
- package/dist/mcp/tools/health-check.d.ts.map +0 -1
- package/dist/mcp/tools/health-check.js +0 -37
- package/dist/mcp/tools/health-check.js.map +0 -1
- package/dist/mcp/tools/memesh-agent-register.d.ts +0 -20
- package/dist/mcp/tools/memesh-agent-register.d.ts.map +0 -1
- package/dist/mcp/tools/memesh-agent-register.js +0 -80
- package/dist/mcp/tools/memesh-agent-register.js.map +0 -1
- package/dist/mcp/tools/memesh-cloud-sync.d.ts +0 -30
- package/dist/mcp/tools/memesh-cloud-sync.d.ts.map +0 -1
- package/dist/mcp/tools/memesh-cloud-sync.js +0 -257
- package/dist/mcp/tools/memesh-cloud-sync.js.map +0 -1
- package/dist/mcp/tools/memesh-metrics.d.ts +0 -13
- package/dist/mcp/tools/memesh-metrics.d.ts.map +0 -1
- package/dist/mcp/tools/memesh-metrics.js +0 -193
- package/dist/mcp/tools/memesh-metrics.js.map +0 -1
- package/dist/mcp/tools/recall-memory.d.ts +0 -31
- package/dist/mcp/tools/recall-memory.d.ts.map +0 -1
- package/dist/mcp/tools/recall-memory.js +0 -31
- package/dist/mcp/tools/recall-memory.js.map +0 -1
- package/dist/mcp/validation.d.ts +0 -76
- package/dist/mcp/validation.d.ts.map +0 -1
- package/dist/mcp/validation.js +0 -106
- package/dist/mcp/validation.js.map +0 -1
- package/dist/memory/AutoMemoryRecorder.d.ts +0 -35
- package/dist/memory/AutoMemoryRecorder.d.ts.map +0 -1
- package/dist/memory/AutoMemoryRecorder.js +0 -164
- package/dist/memory/AutoMemoryRecorder.js.map +0 -1
- package/dist/memory/AutoTagger.d.ts +0 -9
- package/dist/memory/AutoTagger.d.ts.map +0 -1
- package/dist/memory/AutoTagger.js +0 -149
- package/dist/memory/AutoTagger.js.map +0 -1
- package/dist/memory/BuiltInRules.d.ts +0 -54
- package/dist/memory/BuiltInRules.d.ts.map +0 -1
- package/dist/memory/BuiltInRules.js +0 -161
- package/dist/memory/BuiltInRules.js.map +0 -1
- package/dist/memory/EnhancedRetrieval.d.ts +0 -22
- package/dist/memory/EnhancedRetrieval.d.ts.map +0 -1
- package/dist/memory/EnhancedRetrieval.js +0 -63
- package/dist/memory/EnhancedRetrieval.js.map +0 -1
- package/dist/memory/EntityTypes.d.ts +0 -14
- package/dist/memory/EntityTypes.d.ts.map +0 -1
- package/dist/memory/EntityTypes.js +0 -19
- package/dist/memory/EntityTypes.js.map +0 -1
- package/dist/memory/MemorySearchEngine.d.ts +0 -17
- package/dist/memory/MemorySearchEngine.d.ts.map +0 -1
- package/dist/memory/MemorySearchEngine.js +0 -88
- package/dist/memory/MemorySearchEngine.js.map +0 -1
- package/dist/memory/MistakePatternEngine.d.ts +0 -15
- package/dist/memory/MistakePatternEngine.d.ts.map +0 -1
- package/dist/memory/MistakePatternEngine.js +0 -99
- package/dist/memory/MistakePatternEngine.js.map +0 -1
- package/dist/memory/PreventionHook.d.ts +0 -28
- package/dist/memory/PreventionHook.d.ts.map +0 -1
- package/dist/memory/PreventionHook.js +0 -21
- package/dist/memory/PreventionHook.js.map +0 -1
- package/dist/memory/ProactiveRecaller.d.ts +0 -26
- package/dist/memory/ProactiveRecaller.d.ts.map +0 -1
- package/dist/memory/ProactiveRecaller.js +0 -96
- package/dist/memory/ProactiveRecaller.js.map +0 -1
- package/dist/memory/ProjectAutoTracker.d.ts +0 -80
- package/dist/memory/ProjectAutoTracker.d.ts.map +0 -1
- package/dist/memory/ProjectAutoTracker.js +0 -386
- package/dist/memory/ProjectAutoTracker.js.map +0 -1
- package/dist/memory/ProjectMemoryCleanup.d.ts +0 -17
- package/dist/memory/ProjectMemoryCleanup.d.ts.map +0 -1
- package/dist/memory/ProjectMemoryCleanup.js +0 -57
- package/dist/memory/ProjectMemoryCleanup.js.map +0 -1
- package/dist/memory/ProjectMemoryManager.d.ts +0 -19
- package/dist/memory/ProjectMemoryManager.d.ts.map +0 -1
- package/dist/memory/ProjectMemoryManager.js +0 -62
- package/dist/memory/ProjectMemoryManager.js.map +0 -1
- package/dist/memory/SmartMemoryQuery.d.ts +0 -9
- package/dist/memory/SmartMemoryQuery.d.ts.map +0 -1
- package/dist/memory/SmartMemoryQuery.js +0 -66
- package/dist/memory/SmartMemoryQuery.js.map +0 -1
- package/dist/memory/UnifiedMemoryStore.d.ts +0 -27
- package/dist/memory/UnifiedMemoryStore.d.ts.map +0 -1
- package/dist/memory/UnifiedMemoryStore.js +0 -536
- package/dist/memory/UnifiedMemoryStore.js.map +0 -1
- package/dist/memory/UserPreferenceEngine.d.ts +0 -18
- package/dist/memory/UserPreferenceEngine.d.ts.map +0 -1
- package/dist/memory/UserPreferenceEngine.js +0 -117
- package/dist/memory/UserPreferenceEngine.js.map +0 -1
- package/dist/memory/config/semantic-groups.d.ts +0 -9
- package/dist/memory/config/semantic-groups.d.ts.map +0 -1
- package/dist/memory/config/semantic-groups.js +0 -22
- package/dist/memory/config/semantic-groups.js.map +0 -1
- package/dist/memory/index.d.ts +0 -16
- package/dist/memory/index.d.ts.map +0 -1
- package/dist/memory/index.js +0 -12
- package/dist/memory/index.js.map +0 -1
- package/dist/memory/types/index.d.ts +0 -7
- package/dist/memory/types/index.d.ts.map +0 -1
- package/dist/memory/types/index.js +0 -4
- package/dist/memory/types/index.js.map +0 -1
- package/dist/memory/types/memory-scope.d.ts +0 -27
- package/dist/memory/types/memory-scope.d.ts.map +0 -1
- package/dist/memory/types/memory-scope.js +0 -67
- package/dist/memory/types/memory-scope.js.map +0 -1
- package/dist/memory/types/pattern-types.d.ts +0 -66
- package/dist/memory/types/pattern-types.d.ts.map +0 -1
- package/dist/memory/types/pattern-types.js +0 -2
- package/dist/memory/types/pattern-types.js.map +0 -1
- package/dist/memory/types/preference-types.d.ts +0 -28
- package/dist/memory/types/preference-types.d.ts.map +0 -1
- package/dist/memory/types/preference-types.js +0 -2
- package/dist/memory/types/preference-types.js.map +0 -1
- package/dist/memory/types/unified-memory.d.ts +0 -29
- package/dist/memory/types/unified-memory.d.ts.map +0 -1
- package/dist/memory/types/unified-memory.js +0 -21
- package/dist/memory/types/unified-memory.js.map +0 -1
- package/dist/prompts/templates/PromptTemplates.d.ts +0 -11
- package/dist/prompts/templates/PromptTemplates.d.ts.map +0 -1
- package/dist/prompts/templates/PromptTemplates.js +0 -942
- package/dist/prompts/templates/PromptTemplates.js.map +0 -1
- package/dist/prompts/templates/index.d.ts +0 -2
- package/dist/prompts/templates/index.d.ts.map +0 -1
- package/dist/prompts/templates/index.js +0 -2
- package/dist/prompts/templates/index.js.map +0 -1
- package/dist/skills/SkillManager.d.ts +0 -33
- package/dist/skills/SkillManager.d.ts.map +0 -1
- package/dist/skills/SkillManager.js +0 -153
- package/dist/skills/SkillManager.js.map +0 -1
- package/dist/skills/index.d.ts +0 -3
- package/dist/skills/index.d.ts.map +0 -1
- package/dist/skills/index.js +0 -2
- package/dist/skills/index.js.map +0 -1
- package/dist/telemetry/TelemetryCollector.d.ts +0 -19
- package/dist/telemetry/TelemetryCollector.d.ts.map +0 -1
- package/dist/telemetry/TelemetryCollector.js +0 -62
- package/dist/telemetry/TelemetryCollector.js.map +0 -1
- package/dist/telemetry/TelemetryStore.d.ts +0 -20
- package/dist/telemetry/TelemetryStore.d.ts.map +0 -1
- package/dist/telemetry/TelemetryStore.js +0 -127
- package/dist/telemetry/TelemetryStore.js.map +0 -1
- package/dist/telemetry/index.d.ts +0 -8
- package/dist/telemetry/index.d.ts.map +0 -1
- package/dist/telemetry/index.js +0 -33
- package/dist/telemetry/index.js.map +0 -1
- package/dist/telemetry/sanitization.d.ts +0 -6
- package/dist/telemetry/sanitization.d.ts.map +0 -1
- package/dist/telemetry/sanitization.js +0 -180
- package/dist/telemetry/sanitization.js.map +0 -1
- package/dist/telemetry/types.d.ts +0 -73
- package/dist/telemetry/types.d.ts.map +0 -1
- package/dist/telemetry/types.js +0 -16
- package/dist/telemetry/types.js.map +0 -1
- package/dist/tools/TestGenerator.d.ts +0 -8
- package/dist/tools/TestGenerator.d.ts.map +0 -1
- package/dist/tools/TestGenerator.js +0 -54
- package/dist/tools/TestGenerator.js.map +0 -1
- package/dist/types/AgentClassification.d.ts +0 -30
- package/dist/types/AgentClassification.d.ts.map +0 -1
- package/dist/types/AgentClassification.js +0 -19
- package/dist/types/AgentClassification.js.map +0 -1
- package/dist/types/Checkpoint.d.ts +0 -12
- package/dist/types/Checkpoint.d.ts.map +0 -1
- package/dist/types/Checkpoint.js +0 -13
- package/dist/types/Checkpoint.js.map +0 -1
- package/dist/types/toonify.d.ts +0 -91
- package/dist/types/toonify.d.ts.map +0 -1
- package/dist/types/toonify.js +0 -18
- package/dist/types/toonify.js.map +0 -1
- package/dist/ui/AsciiProgressBar.d.ts +0 -29
- package/dist/ui/AsciiProgressBar.d.ts.map +0 -1
- package/dist/ui/AsciiProgressBar.js +0 -130
- package/dist/ui/AsciiProgressBar.js.map +0 -1
- package/dist/ui/AttributionManager.d.ts +0 -19
- package/dist/ui/AttributionManager.d.ts.map +0 -1
- package/dist/ui/AttributionManager.js +0 -107
- package/dist/ui/AttributionManager.js.map +0 -1
- package/dist/ui/Dashboard.d.ts +0 -24
- package/dist/ui/Dashboard.d.ts.map +0 -1
- package/dist/ui/Dashboard.js +0 -135
- package/dist/ui/Dashboard.js.map +0 -1
- package/dist/ui/LoadingIndicator.d.ts +0 -53
- package/dist/ui/LoadingIndicator.d.ts.map +0 -1
- package/dist/ui/LoadingIndicator.js +0 -211
- package/dist/ui/LoadingIndicator.js.map +0 -1
- package/dist/ui/MetricsStore.d.ts +0 -15
- package/dist/ui/MetricsStore.d.ts.map +0 -1
- package/dist/ui/MetricsStore.js +0 -131
- package/dist/ui/MetricsStore.js.map +0 -1
- package/dist/ui/ProgressIndicator.d.ts +0 -35
- package/dist/ui/ProgressIndicator.d.ts.map +0 -1
- package/dist/ui/ProgressIndicator.js +0 -177
- package/dist/ui/ProgressIndicator.js.map +0 -1
- package/dist/ui/ProgressRenderer.d.ts +0 -24
- package/dist/ui/ProgressRenderer.d.ts.map +0 -1
- package/dist/ui/ProgressRenderer.js +0 -143
- package/dist/ui/ProgressRenderer.js.map +0 -1
- package/dist/ui/ResponseFormatter.d.ts +0 -57
- package/dist/ui/ResponseFormatter.d.ts.map +0 -1
- package/dist/ui/ResponseFormatter.js +0 -513
- package/dist/ui/ResponseFormatter.js.map +0 -1
- package/dist/ui/UIEventBus.d.ts +0 -38
- package/dist/ui/UIEventBus.d.ts.map +0 -1
- package/dist/ui/UIEventBus.js +0 -173
- package/dist/ui/UIEventBus.js.map +0 -1
- package/dist/ui/accessibility.d.ts +0 -28
- package/dist/ui/accessibility.d.ts.map +0 -1
- package/dist/ui/accessibility.js +0 -97
- package/dist/ui/accessibility.js.map +0 -1
- package/dist/ui/design-tokens.d.ts +0 -36
- package/dist/ui/design-tokens.d.ts.map +0 -1
- package/dist/ui/design-tokens.js +0 -94
- package/dist/ui/design-tokens.js.map +0 -1
- package/dist/ui/index.d.ts +0 -8
- package/dist/ui/index.d.ts.map +0 -1
- package/dist/ui/index.js +0 -6
- package/dist/ui/index.js.map +0 -1
- package/dist/ui/theme.d.ts +0 -313
- package/dist/ui/theme.d.ts.map +0 -1
- package/dist/ui/theme.js +0 -198
- package/dist/ui/theme.js.map +0 -1
- package/dist/ui/types.d.ts +0 -146
- package/dist/ui/types.d.ts.map +0 -1
- package/dist/ui/types.js +0 -16
- package/dist/ui/types.js.map +0 -1
- package/dist/utils/ILogger.d.ts +0 -7
- package/dist/utils/ILogger.d.ts.map +0 -1
- package/dist/utils/ILogger.js +0 -2
- package/dist/utils/ILogger.js.map +0 -1
- package/dist/utils/MinHeap.d.ts +0 -15
- package/dist/utils/MinHeap.d.ts.map +0 -1
- package/dist/utils/MinHeap.js +0 -69
- package/dist/utils/MinHeap.js.map +0 -1
- package/dist/utils/PathResolver.d.ts +0 -13
- package/dist/utils/PathResolver.d.ts.map +0 -1
- package/dist/utils/PathResolver.js +0 -77
- package/dist/utils/PathResolver.js.map +0 -1
- package/dist/utils/RateLimiter.d.ts +0 -28
- package/dist/utils/RateLimiter.d.ts.map +0 -1
- package/dist/utils/RateLimiter.js +0 -115
- package/dist/utils/RateLimiter.js.map +0 -1
- package/dist/utils/SystemResources.d.ts +0 -40
- package/dist/utils/SystemResources.d.ts.map +0 -1
- package/dist/utils/SystemResources.js +0 -216
- package/dist/utils/SystemResources.js.map +0 -1
- package/dist/utils/errorHandler.d.ts +0 -49
- package/dist/utils/errorHandler.d.ts.map +0 -1
- package/dist/utils/errorHandler.js +0 -397
- package/dist/utils/errorHandler.js.map +0 -1
- package/dist/utils/index.d.ts +0 -17
- package/dist/utils/index.d.ts.map +0 -1
- package/dist/utils/index.js +0 -15
- package/dist/utils/index.js.map +0 -1
- package/dist/utils/json.d.ts +0 -13
- package/dist/utils/json.d.ts.map +0 -1
- package/dist/utils/json.js +0 -95
- package/dist/utils/json.js.map +0 -1
- package/dist/utils/logger.d.ts +0 -16
- package/dist/utils/logger.d.ts.map +0 -1
- package/dist/utils/logger.js +0 -125
- package/dist/utils/logger.js.map +0 -1
- package/dist/utils/lru-cache.d.ts +0 -47
- package/dist/utils/lru-cache.d.ts.map +0 -1
- package/dist/utils/lru-cache.js +0 -239
- package/dist/utils/lru-cache.js.map +0 -1
- package/dist/utils/memory.d.ts +0 -20
- package/dist/utils/memory.d.ts.map +0 -1
- package/dist/utils/memory.js +0 -53
- package/dist/utils/memory.js.map +0 -1
- package/dist/utils/money.d.ts +0 -10
- package/dist/utils/money.d.ts.map +0 -1
- package/dist/utils/money.js +0 -25
- package/dist/utils/money.js.map +0 -1
- package/dist/utils/pathValidation.d.ts +0 -2
- package/dist/utils/pathValidation.d.ts.map +0 -1
- package/dist/utils/pathValidation.js +0 -62
- package/dist/utils/pathValidation.js.map +0 -1
- package/dist/utils/paths.d.ts +0 -4
- package/dist/utils/paths.d.ts.map +0 -1
- package/dist/utils/paths.js +0 -28
- package/dist/utils/paths.js.map +0 -1
- package/dist/utils/requestId.d.ts +0 -4
- package/dist/utils/requestId.d.ts.map +0 -1
- package/dist/utils/requestId.js +0 -17
- package/dist/utils/requestId.js.map +0 -1
- package/dist/utils/retry.d.ts +0 -20
- package/dist/utils/retry.d.ts.map +0 -1
- package/dist/utils/retry.js +0 -226
- package/dist/utils/retry.js.map +0 -1
- package/dist/utils/safeMath.d.ts +0 -11
- package/dist/utils/safeMath.d.ts.map +0 -1
- package/dist/utils/safeMath.js +0 -92
- package/dist/utils/safeMath.js.map +0 -1
- package/dist/utils/toonify-adapter.d.ts +0 -77
- package/dist/utils/toonify-adapter.d.ts.map +0 -1
- package/dist/utils/toonify-adapter.js +0 -282
- package/dist/utils/toonify-adapter.js.map +0 -1
- package/dist/utils/tracing/TraceContext.d.ts +0 -23
- package/dist/utils/tracing/TraceContext.d.ts.map +0 -1
- package/dist/utils/tracing/TraceContext.js +0 -127
- package/dist/utils/tracing/TraceContext.js.map +0 -1
- package/dist/utils/tracing/index.d.ts +0 -2
- package/dist/utils/tracing/index.d.ts.map +0 -1
- package/dist/utils/tracing/index.js +0 -2
- package/dist/utils/tracing/index.js.map +0 -1
- package/dist/utils/tracing/middleware.d.ts +0 -15
- package/dist/utils/tracing/middleware.d.ts.map +0 -1
- package/dist/utils/tracing/middleware.js +0 -49
- package/dist/utils/tracing/middleware.js.map +0 -1
- package/dist/utils/validation.d.ts +0 -12
- package/dist/utils/validation.d.ts.map +0 -1
- package/dist/utils/validation.js +0 -87
- package/dist/utils/validation.js.map +0 -1
- package/scripts/health-check.js +0 -331
- package/scripts/hooks/README.md +0 -230
- package/scripts/hooks/__tests__/hook-test-harness.js +0 -218
- package/scripts/hooks/__tests__/hooks.test.js +0 -267
- package/scripts/hooks/__tests__/post-tool-use-recall.test.js +0 -192
- package/scripts/hooks/__tests__/session-start-recall.test.js +0 -86
- package/scripts/hooks/hook-utils.js +0 -899
- package/scripts/hooks/post-tool-use-recall-utils.js +0 -74
- package/scripts/hooks/post-tool-use.js +0 -895
- package/scripts/hooks/pre-tool-use.js +0 -491
- package/scripts/hooks/session-start-recall-utils.js +0 -40
- package/scripts/hooks/stop.js +0 -673
- package/scripts/hooks/subagent-stop.js +0 -184
- package/scripts/postinstall-lib.js +0 -242
- package/scripts/postinstall-new.js +0 -191
- package/scripts/skills/comprehensive-code-review/SKILL.md +0 -276
|
@@ -1,218 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Hook Test Harness — Simulates Claude Code hook execution.
|
|
5
|
-
*
|
|
6
|
-
* Pipes mock stdin JSON to a hook script and validates the output.
|
|
7
|
-
* Does NOT require Claude Code runtime.
|
|
8
|
-
*
|
|
9
|
-
* Usage:
|
|
10
|
-
* node hook-test-harness.js <hook-script> <mock-stdin-json>
|
|
11
|
-
* node hook-test-harness.js ../pre-tool-use.js '{"tool_name":"Bash","tool_input":{"command":"git commit -m test"}}'
|
|
12
|
-
*
|
|
13
|
-
* Or programmatically:
|
|
14
|
-
* import { runHook, assertJSON, assertContains } from './hook-test-harness.js';
|
|
15
|
-
*/
|
|
16
|
-
|
|
17
|
-
import { execFile } from 'child_process';
|
|
18
|
-
import path from 'path';
|
|
19
|
-
import { fileURLToPath } from 'url';
|
|
20
|
-
|
|
21
|
-
const __filename = fileURLToPath(import.meta.url);
|
|
22
|
-
const __dirname = path.dirname(__filename);
|
|
23
|
-
|
|
24
|
-
// ============================================================================
|
|
25
|
-
// Core Test Functions
|
|
26
|
-
// ============================================================================
|
|
27
|
-
|
|
28
|
-
/**
|
|
29
|
-
* Run a hook script with mock stdin and capture output.
|
|
30
|
-
*
|
|
31
|
-
* @param {string} hookPath - Path to hook script (relative to hooks/ dir or absolute)
|
|
32
|
-
* @param {Object|string} stdinData - JSON data to pipe as stdin
|
|
33
|
-
* @param {Object} options - Options
|
|
34
|
-
* @param {number} options.timeout - Timeout in ms (default: 10000)
|
|
35
|
-
* @param {Object} options.env - Additional environment variables
|
|
36
|
-
* @returns {Promise<{ stdout: string, stderr: string, exitCode: number, parsed: Object|null }>}
|
|
37
|
-
*/
|
|
38
|
-
export function runHook(hookPath, stdinData, options = {}) {
|
|
39
|
-
const { timeout = 10000, env = {} } = options;
|
|
40
|
-
|
|
41
|
-
// Resolve hook path relative to hooks directory
|
|
42
|
-
const resolvedPath = path.isAbsolute(hookPath)
|
|
43
|
-
? hookPath
|
|
44
|
-
: path.resolve(__dirname, '..', hookPath);
|
|
45
|
-
|
|
46
|
-
const stdinStr = typeof stdinData === 'string'
|
|
47
|
-
? stdinData
|
|
48
|
-
: JSON.stringify(stdinData);
|
|
49
|
-
|
|
50
|
-
return new Promise((resolve) => {
|
|
51
|
-
const child = execFile('node', [resolvedPath], {
|
|
52
|
-
encoding: 'utf-8',
|
|
53
|
-
timeout,
|
|
54
|
-
env: { ...process.env, ...env },
|
|
55
|
-
}, (error, stdout, stderr) => {
|
|
56
|
-
let parsed = null;
|
|
57
|
-
try {
|
|
58
|
-
if (stdout.trim()) {
|
|
59
|
-
parsed = JSON.parse(stdout.trim());
|
|
60
|
-
}
|
|
61
|
-
} catch {
|
|
62
|
-
// Not JSON output — that's fine for some hooks
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
resolve({
|
|
66
|
-
stdout: stdout || '',
|
|
67
|
-
stderr: stderr || '',
|
|
68
|
-
exitCode: error ? (error.code || 1) : 0,
|
|
69
|
-
parsed,
|
|
70
|
-
});
|
|
71
|
-
});
|
|
72
|
-
|
|
73
|
-
// Pipe stdin
|
|
74
|
-
if (child.stdin) {
|
|
75
|
-
child.stdin.write(stdinStr);
|
|
76
|
-
child.stdin.end();
|
|
77
|
-
}
|
|
78
|
-
});
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
// ============================================================================
|
|
82
|
-
// Assertion Helpers
|
|
83
|
-
// ============================================================================
|
|
84
|
-
|
|
85
|
-
/**
|
|
86
|
-
* Assert that the hook output is valid JSON with expected structure.
|
|
87
|
-
* @param {Object} result - Result from runHook()
|
|
88
|
-
* @param {string} hookEventName - Expected hookEventName
|
|
89
|
-
* @returns {boolean}
|
|
90
|
-
*/
|
|
91
|
-
export function assertHookResponse(result, hookEventName) {
|
|
92
|
-
if (!result.parsed) {
|
|
93
|
-
console.error(` FAIL: No JSON output`);
|
|
94
|
-
return false;
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
const output = result.parsed.hookSpecificOutput;
|
|
98
|
-
if (!output) {
|
|
99
|
-
console.error(` FAIL: Missing hookSpecificOutput`);
|
|
100
|
-
return false;
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
if (output.hookEventName !== hookEventName) {
|
|
104
|
-
console.error(` FAIL: hookEventName is "${output.hookEventName}", expected "${hookEventName}"`);
|
|
105
|
-
return false;
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
return true;
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
/**
|
|
112
|
-
* Assert that stdout contains a substring.
|
|
113
|
-
* @param {Object} result - Result from runHook()
|
|
114
|
-
* @param {string} substring - Expected substring
|
|
115
|
-
* @returns {boolean}
|
|
116
|
-
*/
|
|
117
|
-
export function assertContains(result, substring) {
|
|
118
|
-
const fullOutput = result.stdout + result.stderr;
|
|
119
|
-
if (!fullOutput.includes(substring)) {
|
|
120
|
-
console.error(` FAIL: Output does not contain "${substring}"`);
|
|
121
|
-
return false;
|
|
122
|
-
}
|
|
123
|
-
return true;
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
/**
|
|
127
|
-
* Assert hook exited silently (no stdout, exit 0).
|
|
128
|
-
* @param {Object} result - Result from runHook()
|
|
129
|
-
* @returns {boolean}
|
|
130
|
-
*/
|
|
131
|
-
export function assertSilent(result) {
|
|
132
|
-
if (result.stdout.trim() !== '') {
|
|
133
|
-
console.error(` FAIL: Expected silent exit, got stdout: ${result.stdout.substring(0, 100)}`);
|
|
134
|
-
return false;
|
|
135
|
-
}
|
|
136
|
-
return true;
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
// ============================================================================
|
|
140
|
-
// Test Runner
|
|
141
|
-
// ============================================================================
|
|
142
|
-
|
|
143
|
-
/**
|
|
144
|
-
* Simple test runner for hook tests.
|
|
145
|
-
* @param {string} suiteName - Test suite name
|
|
146
|
-
* @param {Array<{name: string, fn: Function}>} tests - Test cases
|
|
147
|
-
*/
|
|
148
|
-
export async function runTests(suiteName, tests) {
|
|
149
|
-
console.log(`\n ${suiteName}`);
|
|
150
|
-
console.log(' ' + '─'.repeat(50));
|
|
151
|
-
|
|
152
|
-
let passed = 0;
|
|
153
|
-
let failed = 0;
|
|
154
|
-
|
|
155
|
-
for (const test of tests) {
|
|
156
|
-
try {
|
|
157
|
-
const result = await test.fn();
|
|
158
|
-
if (result !== false) {
|
|
159
|
-
console.log(` ✅ ${test.name}`);
|
|
160
|
-
passed++;
|
|
161
|
-
} else {
|
|
162
|
-
console.log(` ❌ ${test.name}`);
|
|
163
|
-
failed++;
|
|
164
|
-
}
|
|
165
|
-
} catch (error) {
|
|
166
|
-
console.log(` ❌ ${test.name}`);
|
|
167
|
-
console.error(` Error: ${error.message}`);
|
|
168
|
-
failed++;
|
|
169
|
-
}
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
console.log(' ' + '─'.repeat(50));
|
|
173
|
-
console.log(` Results: ${passed} passed, ${failed} failed\n`);
|
|
174
|
-
|
|
175
|
-
return { passed, failed };
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
// ============================================================================
|
|
179
|
-
// CLI Mode
|
|
180
|
-
// ============================================================================
|
|
181
|
-
|
|
182
|
-
async function main() {
|
|
183
|
-
const args = process.argv.slice(2);
|
|
184
|
-
|
|
185
|
-
if (args.length < 2) {
|
|
186
|
-
console.log('Usage: node hook-test-harness.js <hook-script> <mock-stdin-json>');
|
|
187
|
-
console.log('');
|
|
188
|
-
console.log('Examples:');
|
|
189
|
-
console.log(' node hook-test-harness.js pre-tool-use.js \'{"tool_name":"Bash","tool_input":{"command":"git commit -m test"}}\'');
|
|
190
|
-
console.log(' node hook-test-harness.js post-tool-use.js \'{"tool_name":"Read","tool_input":{"file_path":"/tmp/test.js"}}\'');
|
|
191
|
-
process.exit(0);
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
const [hookScript, stdinJSON] = args;
|
|
195
|
-
|
|
196
|
-
console.log(`\nRunning: ${hookScript}`);
|
|
197
|
-
console.log(`Stdin: ${stdinJSON.substring(0, 100)}...`);
|
|
198
|
-
console.log('');
|
|
199
|
-
|
|
200
|
-
const result = await runHook(hookScript, stdinJSON);
|
|
201
|
-
|
|
202
|
-
console.log(`Exit code: ${result.exitCode}`);
|
|
203
|
-
if (result.stdout.trim()) {
|
|
204
|
-
console.log(`Stdout: ${result.stdout.trim()}`);
|
|
205
|
-
}
|
|
206
|
-
if (result.stderr.trim()) {
|
|
207
|
-
console.log(`Stderr: ${result.stderr.trim()}`);
|
|
208
|
-
}
|
|
209
|
-
if (result.parsed) {
|
|
210
|
-
console.log(`Parsed JSON:`);
|
|
211
|
-
console.log(JSON.stringify(result.parsed, null, 2));
|
|
212
|
-
}
|
|
213
|
-
}
|
|
214
|
-
|
|
215
|
-
// Run CLI mode if invoked directly
|
|
216
|
-
if (process.argv[1] && process.argv[1].includes('hook-test-harness')) {
|
|
217
|
-
main().catch(console.error);
|
|
218
|
-
}
|
|
@@ -1,267 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Hook Tests — Validates hook behavior without Claude Code runtime.
|
|
5
|
-
*
|
|
6
|
-
* Run: node scripts/hooks/__tests__/hooks.test.js
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
import { runHook, assertHookResponse, assertSilent, runTests } from './hook-test-harness.js';
|
|
10
|
-
|
|
11
|
-
// ============================================================================
|
|
12
|
-
// PreToolUse Tests
|
|
13
|
-
// ============================================================================
|
|
14
|
-
|
|
15
|
-
const preToolUseTests = [
|
|
16
|
-
{
|
|
17
|
-
name: 'Git commit without review triggers reminder or silent exit',
|
|
18
|
-
fn: async () => {
|
|
19
|
-
const result = await runHook('pre-tool-use.js', {
|
|
20
|
-
tool_name: 'Bash',
|
|
21
|
-
tool_input: { command: 'git commit -m "test commit"' },
|
|
22
|
-
});
|
|
23
|
-
// Should produce JSON output with review reminder
|
|
24
|
-
// OR exit silently if codeReviewDone=true from prior test
|
|
25
|
-
if (result.parsed) {
|
|
26
|
-
return assertHookResponse(result, 'PreToolUse');
|
|
27
|
-
}
|
|
28
|
-
// Silent exit is acceptable (review already done or no session file)
|
|
29
|
-
return assertSilent(result);
|
|
30
|
-
},
|
|
31
|
-
},
|
|
32
|
-
{
|
|
33
|
-
name: 'Non-git-commit Bash exits silently',
|
|
34
|
-
fn: async () => {
|
|
35
|
-
const result = await runHook('pre-tool-use.js', {
|
|
36
|
-
tool_name: 'Bash',
|
|
37
|
-
tool_input: { command: 'ls -la' },
|
|
38
|
-
});
|
|
39
|
-
return assertSilent(result);
|
|
40
|
-
},
|
|
41
|
-
},
|
|
42
|
-
{
|
|
43
|
-
name: 'Non-Bash tool exits silently',
|
|
44
|
-
fn: async () => {
|
|
45
|
-
const result = await runHook('pre-tool-use.js', {
|
|
46
|
-
tool_name: 'Read',
|
|
47
|
-
tool_input: { file_path: '/tmp/test.js' },
|
|
48
|
-
});
|
|
49
|
-
return assertSilent(result);
|
|
50
|
-
},
|
|
51
|
-
},
|
|
52
|
-
{
|
|
53
|
-
name: 'Git amend exits silently',
|
|
54
|
-
fn: async () => {
|
|
55
|
-
const result = await runHook('pre-tool-use.js', {
|
|
56
|
-
tool_name: 'Bash',
|
|
57
|
-
tool_input: { command: 'git commit --amend -m "fix"' },
|
|
58
|
-
});
|
|
59
|
-
return assertSilent(result);
|
|
60
|
-
},
|
|
61
|
-
},
|
|
62
|
-
{
|
|
63
|
-
name: 'Empty stdin exits without error',
|
|
64
|
-
fn: async () => {
|
|
65
|
-
const result = await runHook('pre-tool-use.js', '');
|
|
66
|
-
return result.exitCode === 0;
|
|
67
|
-
},
|
|
68
|
-
},
|
|
69
|
-
];
|
|
70
|
-
|
|
71
|
-
// ============================================================================
|
|
72
|
-
// PreToolUse — Smart Router Tests (1B)
|
|
73
|
-
// ============================================================================
|
|
74
|
-
|
|
75
|
-
const smartRouterTests = [
|
|
76
|
-
{
|
|
77
|
-
name: 'Task(Explore) gets model routing or silent exit',
|
|
78
|
-
fn: async () => {
|
|
79
|
-
const result = await runHook('pre-tool-use.js', {
|
|
80
|
-
tool_name: 'Task',
|
|
81
|
-
tool_input: { subagent_type: 'Explore', prompt: 'find auth code' },
|
|
82
|
-
});
|
|
83
|
-
// Either: hook produces routing output with haiku, or exits silently (no config)
|
|
84
|
-
if (!result.parsed) {
|
|
85
|
-
return assertSilent(result); // No output = no config, valid
|
|
86
|
-
}
|
|
87
|
-
const output = result.parsed?.hookSpecificOutput;
|
|
88
|
-
if (!output) return false; // Parsed but no hookSpecificOutput = malformed
|
|
89
|
-
// If routing was applied, model should be haiku
|
|
90
|
-
if (output.updatedInput?.model) {
|
|
91
|
-
return output.updatedInput.model === 'haiku';
|
|
92
|
-
}
|
|
93
|
-
// Output present but no model routing = other handler fired, OK
|
|
94
|
-
return true;
|
|
95
|
-
},
|
|
96
|
-
},
|
|
97
|
-
{
|
|
98
|
-
name: 'Task with explicit model preserves user choice',
|
|
99
|
-
fn: async () => {
|
|
100
|
-
const result = await runHook('pre-tool-use.js', {
|
|
101
|
-
tool_name: 'Task',
|
|
102
|
-
tool_input: { subagent_type: 'Explore', model: 'opus', prompt: 'deep analysis' },
|
|
103
|
-
});
|
|
104
|
-
// Should NOT override user's explicit model
|
|
105
|
-
if (result.parsed?.hookSpecificOutput?.updatedInput?.model) {
|
|
106
|
-
// Any model override when user specified 'opus' is wrong
|
|
107
|
-
return false;
|
|
108
|
-
}
|
|
109
|
-
// No model override = correct behavior
|
|
110
|
-
return true;
|
|
111
|
-
},
|
|
112
|
-
},
|
|
113
|
-
{
|
|
114
|
-
name: 'Task(Plan) gets planning template injected',
|
|
115
|
-
fn: async () => {
|
|
116
|
-
const result = await runHook('pre-tool-use.js', {
|
|
117
|
-
tool_name: 'Task',
|
|
118
|
-
tool_input: { subagent_type: 'Plan', prompt: 'plan the auth refactor' },
|
|
119
|
-
});
|
|
120
|
-
if (!result.parsed) {
|
|
121
|
-
// No output = template file not found. Acceptable but log it.
|
|
122
|
-
return assertSilent(result);
|
|
123
|
-
}
|
|
124
|
-
const output = result.parsed?.hookSpecificOutput;
|
|
125
|
-
if (!output) return false; // Parsed but no hookSpecificOutput = malformed
|
|
126
|
-
// Prompt should contain original + template content
|
|
127
|
-
if (output.updatedInput?.prompt) {
|
|
128
|
-
const prompt = output.updatedInput.prompt;
|
|
129
|
-
// Must contain original prompt AND some template content
|
|
130
|
-
return prompt.includes('plan the auth refactor') &&
|
|
131
|
-
(prompt.includes('Required Plan Sections') || prompt.includes('---'));
|
|
132
|
-
}
|
|
133
|
-
// No prompt modification = handler didn't fire, unexpected
|
|
134
|
-
return false;
|
|
135
|
-
},
|
|
136
|
-
},
|
|
137
|
-
{
|
|
138
|
-
name: 'EnterPlanMode gets context with template reference',
|
|
139
|
-
fn: async () => {
|
|
140
|
-
const result = await runHook('pre-tool-use.js', {
|
|
141
|
-
tool_name: 'EnterPlanMode',
|
|
142
|
-
tool_input: {},
|
|
143
|
-
});
|
|
144
|
-
if (!result.parsed) {
|
|
145
|
-
// No output = template file not found. Acceptable.
|
|
146
|
-
return assertSilent(result);
|
|
147
|
-
}
|
|
148
|
-
const output = result.parsed?.hookSpecificOutput;
|
|
149
|
-
if (!output) return false; // Parsed but no hookSpecificOutput = malformed
|
|
150
|
-
if (output.additionalContext) {
|
|
151
|
-
return output.additionalContext.includes('PLANNING MODE');
|
|
152
|
-
}
|
|
153
|
-
// hookSpecificOutput without additionalContext = wrong handler response
|
|
154
|
-
return false;
|
|
155
|
-
},
|
|
156
|
-
},
|
|
157
|
-
{
|
|
158
|
-
name: 'Non-Task tool is not affected by routing',
|
|
159
|
-
fn: async () => {
|
|
160
|
-
const result = await runHook('pre-tool-use.js', {
|
|
161
|
-
tool_name: 'Grep',
|
|
162
|
-
tool_input: { pattern: 'test', path: '/tmp' },
|
|
163
|
-
});
|
|
164
|
-
return assertSilent(result);
|
|
165
|
-
},
|
|
166
|
-
},
|
|
167
|
-
];
|
|
168
|
-
|
|
169
|
-
// ============================================================================
|
|
170
|
-
// PostToolUse Tests
|
|
171
|
-
// ============================================================================
|
|
172
|
-
|
|
173
|
-
const postToolUseTests = [
|
|
174
|
-
{
|
|
175
|
-
name: 'Read tool exits silently',
|
|
176
|
-
fn: async () => {
|
|
177
|
-
const result = await runHook('post-tool-use.js', {
|
|
178
|
-
tool_name: 'Read',
|
|
179
|
-
tool_input: { file_path: '/tmp/test.js' },
|
|
180
|
-
success: true,
|
|
181
|
-
});
|
|
182
|
-
return assertSilent(result);
|
|
183
|
-
},
|
|
184
|
-
},
|
|
185
|
-
{
|
|
186
|
-
name: 'Bash tool exits silently',
|
|
187
|
-
fn: async () => {
|
|
188
|
-
const result = await runHook('post-tool-use.js', {
|
|
189
|
-
tool_name: 'Bash',
|
|
190
|
-
tool_input: { command: 'echo hello' },
|
|
191
|
-
success: true,
|
|
192
|
-
});
|
|
193
|
-
return assertSilent(result);
|
|
194
|
-
},
|
|
195
|
-
},
|
|
196
|
-
{
|
|
197
|
-
name: 'Empty stdin exits without error',
|
|
198
|
-
fn: async () => {
|
|
199
|
-
const result = await runHook('post-tool-use.js', '');
|
|
200
|
-
return result.exitCode === 0;
|
|
201
|
-
},
|
|
202
|
-
},
|
|
203
|
-
];
|
|
204
|
-
|
|
205
|
-
// ============================================================================
|
|
206
|
-
// PostCommit Tests
|
|
207
|
-
// ============================================================================
|
|
208
|
-
|
|
209
|
-
const postCommitTests = [
|
|
210
|
-
{
|
|
211
|
-
name: 'Non-git-commit exits silently',
|
|
212
|
-
fn: async () => {
|
|
213
|
-
const result = await runHook('post-commit.js', {
|
|
214
|
-
tool_name: 'Read',
|
|
215
|
-
tool_input: { file_path: '/tmp/test.js' },
|
|
216
|
-
success: true,
|
|
217
|
-
});
|
|
218
|
-
return assertSilent(result);
|
|
219
|
-
},
|
|
220
|
-
},
|
|
221
|
-
{
|
|
222
|
-
name: 'Failed command exits silently',
|
|
223
|
-
fn: async () => {
|
|
224
|
-
const result = await runHook('post-commit.js', {
|
|
225
|
-
tool_name: 'Bash',
|
|
226
|
-
tool_input: { command: 'git commit -m "test"' },
|
|
227
|
-
success: false,
|
|
228
|
-
});
|
|
229
|
-
return assertSilent(result);
|
|
230
|
-
},
|
|
231
|
-
},
|
|
232
|
-
];
|
|
233
|
-
|
|
234
|
-
// ============================================================================
|
|
235
|
-
// Run All Tests
|
|
236
|
-
// ============================================================================
|
|
237
|
-
|
|
238
|
-
async function main() {
|
|
239
|
-
console.log('\n🧪 Hook Test Suite\n');
|
|
240
|
-
|
|
241
|
-
let totalPassed = 0;
|
|
242
|
-
let totalFailed = 0;
|
|
243
|
-
|
|
244
|
-
const suites = [
|
|
245
|
-
{ name: 'PreToolUse Hook (Code Review)', tests: preToolUseTests },
|
|
246
|
-
{ name: 'PreToolUse Hook (Smart Router)', tests: smartRouterTests },
|
|
247
|
-
{ name: 'PostToolUse Hook', tests: postToolUseTests },
|
|
248
|
-
{ name: 'PostCommit Hook', tests: postCommitTests },
|
|
249
|
-
];
|
|
250
|
-
|
|
251
|
-
for (const suite of suites) {
|
|
252
|
-
const { passed, failed } = await runTests(suite.name, suite.tests);
|
|
253
|
-
totalPassed += passed;
|
|
254
|
-
totalFailed += failed;
|
|
255
|
-
}
|
|
256
|
-
|
|
257
|
-
console.log('═'.repeat(55));
|
|
258
|
-
console.log(` Total: ${totalPassed} passed, ${totalFailed} failed`);
|
|
259
|
-
console.log('═'.repeat(55));
|
|
260
|
-
|
|
261
|
-
process.exit(totalFailed > 0 ? 1 : 0);
|
|
262
|
-
}
|
|
263
|
-
|
|
264
|
-
main().catch(error => {
|
|
265
|
-
console.error('Test runner error:', error);
|
|
266
|
-
process.exit(1);
|
|
267
|
-
});
|
|
@@ -1,192 +0,0 @@
|
|
|
1
|
-
import { describe, it, expect } from 'vitest';
|
|
2
|
-
import {
|
|
3
|
-
isTestCommand,
|
|
4
|
-
extractTestFailureContext,
|
|
5
|
-
buildTestFailureQuery,
|
|
6
|
-
buildErrorQuery,
|
|
7
|
-
} from '../post-tool-use-recall-utils.js';
|
|
8
|
-
|
|
9
|
-
describe('isTestCommand', () => {
|
|
10
|
-
it('detects "npm test"', () => {
|
|
11
|
-
expect(isTestCommand('npm test')).toBe(true);
|
|
12
|
-
});
|
|
13
|
-
|
|
14
|
-
it('detects "npm run test"', () => {
|
|
15
|
-
expect(isTestCommand('npm run test')).toBe(true);
|
|
16
|
-
});
|
|
17
|
-
|
|
18
|
-
it('detects "npx vitest"', () => {
|
|
19
|
-
expect(isTestCommand('npx vitest')).toBe(true);
|
|
20
|
-
});
|
|
21
|
-
|
|
22
|
-
it('detects "vitest run"', () => {
|
|
23
|
-
expect(isTestCommand('vitest run')).toBe(true);
|
|
24
|
-
});
|
|
25
|
-
|
|
26
|
-
it('detects "vitest" alone', () => {
|
|
27
|
-
expect(isTestCommand('vitest')).toBe(true);
|
|
28
|
-
});
|
|
29
|
-
|
|
30
|
-
it('detects "npx jest"', () => {
|
|
31
|
-
expect(isTestCommand('npx jest')).toBe(true);
|
|
32
|
-
});
|
|
33
|
-
|
|
34
|
-
it('detects "jest" alone', () => {
|
|
35
|
-
expect(isTestCommand('jest')).toBe(true);
|
|
36
|
-
});
|
|
37
|
-
|
|
38
|
-
it('detects "pytest"', () => {
|
|
39
|
-
expect(isTestCommand('pytest')).toBe(true);
|
|
40
|
-
});
|
|
41
|
-
|
|
42
|
-
it('detects "bun test"', () => {
|
|
43
|
-
expect(isTestCommand('bun test')).toBe(true);
|
|
44
|
-
});
|
|
45
|
-
|
|
46
|
-
it('detects "mocha"', () => {
|
|
47
|
-
expect(isTestCommand('mocha')).toBe(true);
|
|
48
|
-
});
|
|
49
|
-
|
|
50
|
-
it('rejects "ls -la"', () => {
|
|
51
|
-
expect(isTestCommand('ls -la')).toBe(false);
|
|
52
|
-
});
|
|
53
|
-
|
|
54
|
-
it('rejects "git commit"', () => {
|
|
55
|
-
expect(isTestCommand('git commit -m "test"')).toBe(false);
|
|
56
|
-
});
|
|
57
|
-
|
|
58
|
-
it('rejects "echo test"', () => {
|
|
59
|
-
expect(isTestCommand('echo test')).toBe(false);
|
|
60
|
-
});
|
|
61
|
-
|
|
62
|
-
it('rejects empty string', () => {
|
|
63
|
-
expect(isTestCommand('')).toBe(false);
|
|
64
|
-
});
|
|
65
|
-
|
|
66
|
-
it('rejects null/undefined', () => {
|
|
67
|
-
expect(isTestCommand(null)).toBe(false);
|
|
68
|
-
expect(isTestCommand(undefined)).toBe(false);
|
|
69
|
-
});
|
|
70
|
-
|
|
71
|
-
it('is case-insensitive', () => {
|
|
72
|
-
expect(isTestCommand('NPM TEST')).toBe(true);
|
|
73
|
-
expect(isTestCommand('Vitest Run')).toBe(true);
|
|
74
|
-
});
|
|
75
|
-
});
|
|
76
|
-
|
|
77
|
-
describe('extractTestFailureContext', () => {
|
|
78
|
-
it('returns null for null/undefined/empty input', () => {
|
|
79
|
-
expect(extractTestFailureContext(null)).toBeNull();
|
|
80
|
-
expect(extractTestFailureContext(undefined)).toBeNull();
|
|
81
|
-
expect(extractTestFailureContext('')).toBeNull();
|
|
82
|
-
});
|
|
83
|
-
|
|
84
|
-
it('returns null for passing test output', () => {
|
|
85
|
-
const output = `
|
|
86
|
-
✓ src/utils/helper.test.ts (3 tests) 12ms
|
|
87
|
-
Test Files 1 passed (1)
|
|
88
|
-
Tests 3 passed (3)
|
|
89
|
-
`;
|
|
90
|
-
expect(extractTestFailureContext(output)).toBeNull();
|
|
91
|
-
});
|
|
92
|
-
|
|
93
|
-
it('extracts from vitest FAIL output', () => {
|
|
94
|
-
const output = `
|
|
95
|
-
FAIL src/mcp/handlers/HookToolHandler.test.ts
|
|
96
|
-
✕ should process tool use (5ms)
|
|
97
|
-
Error: expect(received).toBe(expected)
|
|
98
|
-
`;
|
|
99
|
-
const ctx = extractTestFailureContext(output);
|
|
100
|
-
expect(ctx).not.toBeNull();
|
|
101
|
-
expect(ctx.testName).toBe('src/mcp/handlers/HookToolHandler.test.ts');
|
|
102
|
-
expect(ctx.errorMessage).toMatch(/Error/);
|
|
103
|
-
});
|
|
104
|
-
|
|
105
|
-
it('extracts from jest-style FAIL output', () => {
|
|
106
|
-
const output = `
|
|
107
|
-
FAIL src/auth/login.test.js
|
|
108
|
-
● should validate credentials
|
|
109
|
-
expect(received).toBe(expected)
|
|
110
|
-
`;
|
|
111
|
-
const ctx = extractTestFailureContext(output);
|
|
112
|
-
expect(ctx).not.toBeNull();
|
|
113
|
-
expect(ctx.testName).toBe('src/auth/login.test.js');
|
|
114
|
-
});
|
|
115
|
-
|
|
116
|
-
it('extracts error message from output with "failed"', () => {
|
|
117
|
-
const output = `
|
|
118
|
-
Tests: 2 failed, 5 passed
|
|
119
|
-
Error: Connection refused
|
|
120
|
-
`;
|
|
121
|
-
const ctx = extractTestFailureContext(output);
|
|
122
|
-
expect(ctx).not.toBeNull();
|
|
123
|
-
expect(ctx.errorMessage).toMatch(/Error.*Connection refused/);
|
|
124
|
-
});
|
|
125
|
-
|
|
126
|
-
it('handles output with ✕ marker', () => {
|
|
127
|
-
const output = `
|
|
128
|
-
✕ my test case
|
|
129
|
-
`;
|
|
130
|
-
const ctx = extractTestFailureContext(output);
|
|
131
|
-
expect(ctx).not.toBeNull();
|
|
132
|
-
});
|
|
133
|
-
});
|
|
134
|
-
|
|
135
|
-
describe('buildTestFailureQuery', () => {
|
|
136
|
-
it('combines short test name + error message', () => {
|
|
137
|
-
const result = buildTestFailureQuery('src/utils/helper.test.ts', 'Connection refused');
|
|
138
|
-
expect(result).toBe('helper Connection refused');
|
|
139
|
-
});
|
|
140
|
-
|
|
141
|
-
it('strips directory path and test/spec suffix', () => {
|
|
142
|
-
const result = buildTestFailureQuery('src/mcp/handlers/HookToolHandler.test.ts', 'error');
|
|
143
|
-
expect(result).toBe('HookToolHandler error');
|
|
144
|
-
});
|
|
145
|
-
|
|
146
|
-
it('strips spec suffix', () => {
|
|
147
|
-
const result = buildTestFailureQuery('auth.spec.js', 'fail');
|
|
148
|
-
expect(result).toBe('auth fail');
|
|
149
|
-
});
|
|
150
|
-
|
|
151
|
-
it('handles unknown test name', () => {
|
|
152
|
-
const result = buildTestFailureQuery('unknown test', 'some error');
|
|
153
|
-
expect(result).toBe('unknown test some error');
|
|
154
|
-
});
|
|
155
|
-
|
|
156
|
-
it('handles empty error message', () => {
|
|
157
|
-
const result = buildTestFailureQuery('src/foo.test.ts', '');
|
|
158
|
-
expect(result).toBe('foo');
|
|
159
|
-
});
|
|
160
|
-
});
|
|
161
|
-
|
|
162
|
-
describe('buildErrorQuery', () => {
|
|
163
|
-
it('combines error type + first line of message', () => {
|
|
164
|
-
const result = buildErrorQuery('TypeError', 'Cannot read property x of undefined');
|
|
165
|
-
expect(result).toBe('TypeError Cannot read property x of undefined');
|
|
166
|
-
});
|
|
167
|
-
|
|
168
|
-
it('uses only first line of multiline message', () => {
|
|
169
|
-
const result = buildErrorQuery('ReferenceError', 'x is not defined\n at foo.js:10\n at bar.js:20');
|
|
170
|
-
expect(result).toBe('ReferenceError x is not defined');
|
|
171
|
-
});
|
|
172
|
-
|
|
173
|
-
it('handles null/undefined error type', () => {
|
|
174
|
-
const result = buildErrorQuery(null, 'something broke');
|
|
175
|
-
expect(result).toBe('Error something broke');
|
|
176
|
-
});
|
|
177
|
-
|
|
178
|
-
it('handles undefined error type', () => {
|
|
179
|
-
const result = buildErrorQuery(undefined, 'something broke');
|
|
180
|
-
expect(result).toBe('Error something broke');
|
|
181
|
-
});
|
|
182
|
-
|
|
183
|
-
it('handles null/undefined error message', () => {
|
|
184
|
-
const result = buildErrorQuery('SyntaxError', null);
|
|
185
|
-
expect(result).toBe('SyntaxError');
|
|
186
|
-
});
|
|
187
|
-
|
|
188
|
-
it('handles empty inputs', () => {
|
|
189
|
-
const result = buildErrorQuery('', '');
|
|
190
|
-
expect(result).toBe('Error');
|
|
191
|
-
});
|
|
192
|
-
});
|