@tonycasey/lisa 1.2.0 → 2.0.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/README.md +22 -15
- package/dist/hooks/session-start.js +43114 -0
- package/dist/hooks/session-stop.js +42699 -0
- package/dist/hooks/user-prompt-submit.js +42757 -0
- package/dist/lib/application/handlers/PromptSubmitHandler.d.ts +27 -0
- package/dist/lib/application/handlers/PromptSubmitHandler.d.ts.map +1 -0
- package/dist/lib/application/handlers/PromptSubmitHandler.js +53 -0
- package/dist/lib/application/handlers/PromptSubmitHandler.js.map +1 -0
- package/dist/lib/application/handlers/SessionStartHandler.d.ts +50 -0
- package/dist/lib/application/handlers/SessionStartHandler.d.ts.map +1 -0
- package/dist/lib/application/handlers/SessionStartHandler.js +448 -0
- package/dist/lib/application/handlers/SessionStartHandler.js.map +1 -0
- package/dist/lib/application/handlers/SessionStopHandler.d.ts +15 -0
- package/dist/lib/application/handlers/SessionStopHandler.d.ts.map +1 -0
- package/dist/lib/application/handlers/SessionStopHandler.js +35 -0
- package/dist/lib/application/handlers/SessionStopHandler.js.map +1 -0
- package/dist/lib/application/handlers/index.d.ts +8 -0
- package/dist/lib/application/handlers/index.d.ts.map +1 -0
- package/dist/lib/application/handlers/index.js +14 -0
- package/dist/lib/application/handlers/index.js.map +1 -0
- package/dist/lib/application/index.d.ts +13 -0
- package/dist/lib/application/index.d.ts.map +1 -0
- package/dist/lib/application/index.js +31 -0
- package/dist/lib/application/index.js.map +1 -0
- package/dist/lib/application/interfaces/ISessionStartResult.d.ts +22 -0
- package/dist/lib/application/interfaces/ISessionStartResult.d.ts.map +1 -0
- package/dist/lib/application/interfaces/ISessionStartResult.js +3 -0
- package/dist/lib/application/interfaces/ISessionStartResult.js.map +1 -0
- package/dist/lib/application/interfaces/index.d.ts +5 -0
- package/dist/lib/application/interfaces/index.d.ts.map +1 -0
- package/dist/lib/application/interfaces/index.js +6 -0
- package/dist/lib/application/interfaces/index.js.map +1 -0
- package/dist/lib/cli.d.ts +34 -0
- package/dist/lib/cli.d.ts.map +1 -0
- package/dist/lib/cli.js +664 -0
- package/dist/lib/cli.js.map +1 -0
- package/dist/lib/domain/errors/LisaError.d.ts +41 -0
- package/dist/lib/domain/errors/LisaError.d.ts.map +1 -0
- package/dist/lib/domain/errors/LisaError.js +69 -0
- package/dist/lib/domain/errors/LisaError.js.map +1 -0
- package/dist/lib/domain/errors/index.d.ts +5 -0
- package/dist/lib/domain/errors/index.d.ts.map +1 -0
- package/dist/lib/domain/errors/index.js +14 -0
- package/dist/lib/domain/errors/index.js.map +1 -0
- package/dist/lib/domain/index.d.ts +14 -0
- package/dist/lib/domain/index.d.ts.map +1 -0
- package/dist/lib/domain/index.js +33 -0
- package/dist/lib/domain/index.js.map +1 -0
- package/dist/lib/domain/interfaces/IEventEmitter.d.ts +32 -0
- package/dist/lib/domain/interfaces/IEventEmitter.d.ts.map +1 -0
- package/dist/lib/domain/interfaces/IEventEmitter.js +3 -0
- package/dist/lib/domain/interfaces/IEventEmitter.js.map +1 -0
- package/dist/lib/domain/interfaces/ILisaContext.d.ts +25 -0
- package/dist/lib/domain/interfaces/ILisaContext.d.ts.map +1 -0
- package/dist/lib/domain/interfaces/ILisaContext.js +3 -0
- package/dist/lib/domain/interfaces/ILisaContext.js.map +1 -0
- package/dist/lib/domain/interfaces/ILisaServices.d.ts +34 -0
- package/dist/lib/domain/interfaces/ILisaServices.d.ts.map +1 -0
- package/dist/lib/domain/interfaces/ILisaServices.js +3 -0
- package/dist/lib/domain/interfaces/ILisaServices.js.map +1 -0
- package/dist/lib/domain/interfaces/ILogger.d.ts +94 -0
- package/dist/lib/domain/interfaces/ILogger.d.ts.map +1 -0
- package/dist/lib/domain/interfaces/ILogger.js +3 -0
- package/dist/lib/domain/interfaces/ILogger.js.map +1 -0
- package/dist/lib/domain/interfaces/IMcpClient.d.ts +31 -0
- package/dist/lib/domain/interfaces/IMcpClient.d.ts.map +1 -0
- package/dist/lib/domain/interfaces/IMcpClient.js +3 -0
- package/dist/lib/domain/interfaces/IMcpClient.js.map +1 -0
- package/dist/lib/domain/interfaces/IMemoryService.d.ts +56 -0
- package/dist/lib/domain/interfaces/IMemoryService.d.ts.map +1 -0
- package/dist/lib/domain/interfaces/IMemoryService.js +3 -0
- package/dist/lib/domain/interfaces/IMemoryService.js.map +1 -0
- package/dist/lib/domain/interfaces/IRecursionService.d.ts +52 -0
- package/dist/lib/domain/interfaces/IRecursionService.d.ts.map +1 -0
- package/dist/lib/domain/interfaces/IRecursionService.js +3 -0
- package/dist/lib/domain/interfaces/IRecursionService.js.map +1 -0
- package/dist/lib/domain/interfaces/ISessionCaptureService.d.ts +16 -0
- package/dist/lib/domain/interfaces/ISessionCaptureService.d.ts.map +1 -0
- package/dist/lib/domain/interfaces/ISessionCaptureService.js +3 -0
- package/dist/lib/domain/interfaces/ISessionCaptureService.js.map +1 -0
- package/dist/lib/domain/interfaces/ITaskService.d.ts +52 -0
- package/dist/lib/domain/interfaces/ITaskService.d.ts.map +1 -0
- package/dist/lib/domain/interfaces/ITaskService.js +3 -0
- package/dist/lib/domain/interfaces/ITaskService.js.map +1 -0
- package/dist/lib/domain/interfaces/dal/IConnectionManager.d.ts +110 -0
- package/dist/lib/domain/interfaces/dal/IConnectionManager.d.ts.map +1 -0
- package/dist/lib/domain/interfaces/dal/IConnectionManager.js +8 -0
- package/dist/lib/domain/interfaces/dal/IConnectionManager.js.map +1 -0
- package/dist/lib/domain/interfaces/dal/IMemoryRepository.d.ts +93 -0
- package/dist/lib/domain/interfaces/dal/IMemoryRepository.d.ts.map +1 -0
- package/dist/lib/domain/interfaces/dal/IMemoryRepository.js +9 -0
- package/dist/lib/domain/interfaces/dal/IMemoryRepository.js.map +1 -0
- package/dist/lib/domain/interfaces/dal/IRepositoryRouter.d.ts +88 -0
- package/dist/lib/domain/interfaces/dal/IRepositoryRouter.d.ts.map +1 -0
- package/dist/lib/domain/interfaces/dal/IRepositoryRouter.js +23 -0
- package/dist/lib/domain/interfaces/dal/IRepositoryRouter.js.map +1 -0
- package/dist/lib/domain/interfaces/dal/ITaskRepository.d.ts +87 -0
- package/dist/lib/domain/interfaces/dal/ITaskRepository.d.ts.map +1 -0
- package/dist/lib/domain/interfaces/dal/ITaskRepository.js +9 -0
- package/dist/lib/domain/interfaces/dal/ITaskRepository.js.map +1 -0
- package/dist/lib/domain/interfaces/dal/index.d.ts +14 -0
- package/dist/lib/domain/interfaces/dal/index.d.ts.map +1 -0
- package/dist/lib/domain/interfaces/dal/index.js +15 -0
- package/dist/lib/domain/interfaces/dal/index.js.map +1 -0
- package/dist/lib/domain/interfaces/dal/types.d.ts +81 -0
- package/dist/lib/domain/interfaces/dal/types.d.ts.map +1 -0
- package/dist/lib/domain/interfaces/dal/types.js +28 -0
- package/dist/lib/domain/interfaces/dal/types.js.map +1 -0
- package/dist/lib/domain/interfaces/events/IMemoryEvent.d.ts +27 -0
- package/dist/lib/domain/interfaces/events/IMemoryEvent.d.ts.map +1 -0
- package/dist/lib/domain/interfaces/events/IMemoryEvent.js +26 -0
- package/dist/lib/domain/interfaces/events/IMemoryEvent.js.map +1 -0
- package/dist/lib/domain/interfaces/events/IPromptSubmitEvent.d.ts +20 -0
- package/dist/lib/domain/interfaces/events/IPromptSubmitEvent.d.ts.map +1 -0
- package/dist/lib/domain/interfaces/events/IPromptSubmitEvent.js +16 -0
- package/dist/lib/domain/interfaces/events/IPromptSubmitEvent.js.map +1 -0
- package/dist/lib/domain/interfaces/events/ISessionStartEvent.d.ts +19 -0
- package/dist/lib/domain/interfaces/events/ISessionStartEvent.d.ts.map +1 -0
- package/dist/lib/domain/interfaces/events/ISessionStartEvent.js +15 -0
- package/dist/lib/domain/interfaces/events/ISessionStartEvent.js.map +1 -0
- package/dist/lib/domain/interfaces/events/ISessionStopEvent.d.ts +22 -0
- package/dist/lib/domain/interfaces/events/ISessionStopEvent.d.ts.map +1 -0
- package/dist/lib/domain/interfaces/events/ISessionStopEvent.js +15 -0
- package/dist/lib/domain/interfaces/events/ISessionStopEvent.js.map +1 -0
- package/dist/lib/domain/interfaces/events/LisaEvent.d.ts +13 -0
- package/dist/lib/domain/interfaces/events/LisaEvent.d.ts.map +1 -0
- package/dist/lib/domain/interfaces/events/LisaEvent.js +3 -0
- package/dist/lib/domain/interfaces/events/LisaEvent.js.map +1 -0
- package/dist/lib/domain/interfaces/events/index.d.ts +9 -0
- package/dist/lib/domain/interfaces/events/index.d.ts.map +1 -0
- package/dist/lib/domain/interfaces/events/index.js +16 -0
- package/dist/lib/domain/interfaces/events/index.js.map +1 -0
- package/dist/lib/domain/interfaces/index.d.ts +16 -0
- package/dist/lib/domain/interfaces/index.d.ts.map +1 -0
- package/dist/lib/domain/interfaces/index.js +25 -0
- package/dist/lib/domain/interfaces/index.js.map +1 -0
- package/dist/lib/domain/interfaces/types/ICapturedWork.d.ts +14 -0
- package/dist/lib/domain/interfaces/types/ICapturedWork.d.ts.map +1 -0
- package/dist/lib/domain/interfaces/types/ICapturedWork.js +14 -0
- package/dist/lib/domain/interfaces/types/ICapturedWork.js.map +1 -0
- package/dist/lib/domain/interfaces/types/IMemoryResult.d.ts +39 -0
- package/dist/lib/domain/interfaces/types/IMemoryResult.d.ts.map +1 -0
- package/dist/lib/domain/interfaces/types/IMemoryResult.js +29 -0
- package/dist/lib/domain/interfaces/types/IMemoryResult.js.map +1 -0
- package/dist/lib/domain/interfaces/types/ITask.d.ts +46 -0
- package/dist/lib/domain/interfaces/types/ITask.d.ts.map +1 -0
- package/dist/lib/domain/interfaces/types/ITask.js +17 -0
- package/dist/lib/domain/interfaces/types/ITask.js.map +1 -0
- package/dist/lib/domain/interfaces/types/index.d.ts +7 -0
- package/dist/lib/domain/interfaces/types/index.d.ts.map +1 -0
- package/dist/lib/domain/interfaces/types/index.js +14 -0
- package/dist/lib/domain/interfaces/types/index.js.map +1 -0
- package/dist/lib/domain/types/ISOTimestamp.d.ts +19 -0
- package/dist/lib/domain/types/ISOTimestamp.d.ts.map +1 -0
- package/dist/lib/domain/types/ISOTimestamp.js +18 -0
- package/dist/lib/domain/types/ISOTimestamp.js.map +1 -0
- package/dist/lib/domain/types/index.d.ts +7 -0
- package/dist/lib/domain/types/index.d.ts.map +1 -0
- package/dist/lib/domain/types/index.js +12 -0
- package/dist/lib/domain/types/index.js.map +1 -0
- package/dist/lib/infrastructure/adapters/claude/index.d.ts +8 -0
- package/dist/lib/infrastructure/adapters/claude/index.d.ts.map +1 -0
- package/dist/lib/infrastructure/adapters/claude/index.js +18 -0
- package/dist/lib/infrastructure/adapters/claude/index.js.map +1 -0
- package/dist/lib/infrastructure/adapters/claude/session-start.d.ts +9 -0
- package/dist/lib/infrastructure/adapters/claude/session-start.d.ts.map +1 -0
- package/dist/lib/infrastructure/adapters/claude/session-start.js +54 -0
- package/dist/lib/infrastructure/adapters/claude/session-start.js.map +1 -0
- package/dist/lib/infrastructure/adapters/claude/session-stop.d.ts +13 -0
- package/dist/lib/infrastructure/adapters/claude/session-stop.d.ts.map +1 -0
- package/dist/lib/infrastructure/adapters/claude/session-stop.js +43 -0
- package/dist/lib/infrastructure/adapters/claude/session-stop.js.map +1 -0
- package/dist/lib/infrastructure/adapters/claude/stdin.d.ts +13 -0
- package/dist/lib/infrastructure/adapters/claude/stdin.d.ts.map +1 -0
- package/dist/lib/infrastructure/adapters/claude/stdin.js +36 -0
- package/dist/lib/infrastructure/adapters/claude/stdin.js.map +1 -0
- package/dist/lib/infrastructure/adapters/claude/user-prompt-submit.d.ts +13 -0
- package/dist/lib/infrastructure/adapters/claude/user-prompt-submit.d.ts.map +1 -0
- package/dist/lib/infrastructure/adapters/claude/user-prompt-submit.js +58 -0
- package/dist/lib/infrastructure/adapters/claude/user-prompt-submit.js.map +1 -0
- package/dist/lib/infrastructure/adapters/opencode/index.d.ts +7 -0
- package/dist/lib/infrastructure/adapters/opencode/index.d.ts.map +1 -0
- package/dist/lib/infrastructure/adapters/opencode/index.js +18 -0
- package/dist/lib/infrastructure/adapters/opencode/index.js.map +1 -0
- package/dist/lib/infrastructure/adapters/opencode/opencode-events.d.ts +73 -0
- package/dist/lib/infrastructure/adapters/opencode/opencode-events.d.ts.map +1 -0
- package/dist/lib/infrastructure/adapters/opencode/opencode-events.js +131 -0
- package/dist/lib/infrastructure/adapters/opencode/opencode-events.js.map +1 -0
- package/dist/lib/infrastructure/adapters/opencode/plugin.d.ts +60 -0
- package/dist/lib/infrastructure/adapters/opencode/plugin.d.ts.map +1 -0
- package/dist/lib/infrastructure/adapters/opencode/plugin.js +147 -0
- package/dist/lib/infrastructure/adapters/opencode/plugin.js.map +1 -0
- package/dist/lib/infrastructure/context/ContextDetector.d.ts +92 -0
- package/dist/lib/infrastructure/context/ContextDetector.d.ts.map +1 -0
- package/dist/lib/infrastructure/context/ContextDetector.js +415 -0
- package/dist/lib/infrastructure/context/ContextDetector.js.map +1 -0
- package/dist/lib/infrastructure/context/index.d.ts +5 -0
- package/dist/lib/infrastructure/context/index.d.ts.map +1 -0
- package/dist/lib/infrastructure/context/index.js +9 -0
- package/dist/lib/infrastructure/context/index.js.map +1 -0
- package/dist/lib/infrastructure/dal/RepositoryFactory.d.ts +71 -0
- package/dist/lib/infrastructure/dal/RepositoryFactory.d.ts.map +1 -0
- package/dist/lib/infrastructure/dal/RepositoryFactory.js +134 -0
- package/dist/lib/infrastructure/dal/RepositoryFactory.js.map +1 -0
- package/dist/lib/infrastructure/dal/connections/McpConnectionManager.d.ts +56 -0
- package/dist/lib/infrastructure/dal/connections/McpConnectionManager.d.ts.map +1 -0
- package/dist/lib/infrastructure/dal/connections/McpConnectionManager.js +98 -0
- package/dist/lib/infrastructure/dal/connections/McpConnectionManager.js.map +1 -0
- package/dist/lib/infrastructure/dal/connections/Neo4jConnectionManager.d.ts +60 -0
- package/dist/lib/infrastructure/dal/connections/Neo4jConnectionManager.d.ts.map +1 -0
- package/dist/lib/infrastructure/dal/connections/Neo4jConnectionManager.js +181 -0
- package/dist/lib/infrastructure/dal/connections/Neo4jConnectionManager.js.map +1 -0
- package/dist/lib/infrastructure/dal/connections/ZepConnectionManager.d.ts +53 -0
- package/dist/lib/infrastructure/dal/connections/ZepConnectionManager.d.ts.map +1 -0
- package/dist/lib/infrastructure/dal/connections/ZepConnectionManager.js +168 -0
- package/dist/lib/infrastructure/dal/connections/ZepConnectionManager.js.map +1 -0
- package/dist/lib/infrastructure/dal/connections/index.d.ts +9 -0
- package/dist/lib/infrastructure/dal/connections/index.d.ts.map +1 -0
- package/dist/lib/infrastructure/dal/connections/index.js +18 -0
- package/dist/lib/infrastructure/dal/connections/index.js.map +1 -0
- package/dist/lib/infrastructure/dal/index.d.ts +27 -0
- package/dist/lib/infrastructure/dal/index.d.ts.map +1 -0
- package/dist/lib/infrastructure/dal/index.js +50 -0
- package/dist/lib/infrastructure/dal/index.js.map +1 -0
- package/dist/lib/infrastructure/dal/repositories/index.d.ts +7 -0
- package/dist/lib/infrastructure/dal/repositories/index.d.ts.map +1 -0
- package/dist/lib/infrastructure/dal/repositories/index.js +19 -0
- package/dist/lib/infrastructure/dal/repositories/index.js.map +1 -0
- package/dist/lib/infrastructure/dal/repositories/mcp/McpMemoryRepository.d.ts +54 -0
- package/dist/lib/infrastructure/dal/repositories/mcp/McpMemoryRepository.d.ts.map +1 -0
- package/dist/lib/infrastructure/dal/repositories/mcp/McpMemoryRepository.js +131 -0
- package/dist/lib/infrastructure/dal/repositories/mcp/McpMemoryRepository.js.map +1 -0
- package/dist/lib/infrastructure/dal/repositories/mcp/McpTaskRepository.d.ts +60 -0
- package/dist/lib/infrastructure/dal/repositories/mcp/McpTaskRepository.d.ts.map +1 -0
- package/dist/lib/infrastructure/dal/repositories/mcp/McpTaskRepository.js +182 -0
- package/dist/lib/infrastructure/dal/repositories/mcp/McpTaskRepository.js.map +1 -0
- package/dist/lib/infrastructure/dal/repositories/mcp/index.d.ts +6 -0
- package/dist/lib/infrastructure/dal/repositories/mcp/index.d.ts.map +1 -0
- package/dist/lib/infrastructure/dal/repositories/mcp/index.js +11 -0
- package/dist/lib/infrastructure/dal/repositories/mcp/index.js.map +1 -0
- package/dist/lib/infrastructure/dal/repositories/neo4j/Neo4jMemoryRepository.d.ts +47 -0
- package/dist/lib/infrastructure/dal/repositories/neo4j/Neo4jMemoryRepository.d.ts.map +1 -0
- package/dist/lib/infrastructure/dal/repositories/neo4j/Neo4jMemoryRepository.js +144 -0
- package/dist/lib/infrastructure/dal/repositories/neo4j/Neo4jMemoryRepository.js.map +1 -0
- package/dist/lib/infrastructure/dal/repositories/neo4j/Neo4jTaskRepository.d.ts +46 -0
- package/dist/lib/infrastructure/dal/repositories/neo4j/Neo4jTaskRepository.d.ts.map +1 -0
- package/dist/lib/infrastructure/dal/repositories/neo4j/Neo4jTaskRepository.js +160 -0
- package/dist/lib/infrastructure/dal/repositories/neo4j/Neo4jTaskRepository.js.map +1 -0
- package/dist/lib/infrastructure/dal/repositories/neo4j/index.d.ts +6 -0
- package/dist/lib/infrastructure/dal/repositories/neo4j/index.d.ts.map +1 -0
- package/dist/lib/infrastructure/dal/repositories/neo4j/index.js +11 -0
- package/dist/lib/infrastructure/dal/repositories/neo4j/index.js.map +1 -0
- package/dist/lib/infrastructure/dal/repositories/zep/ZepMemoryRepository.d.ts +55 -0
- package/dist/lib/infrastructure/dal/repositories/zep/ZepMemoryRepository.d.ts.map +1 -0
- package/dist/lib/infrastructure/dal/repositories/zep/ZepMemoryRepository.js +165 -0
- package/dist/lib/infrastructure/dal/repositories/zep/ZepMemoryRepository.js.map +1 -0
- package/dist/lib/infrastructure/dal/repositories/zep/ZepTaskRepository.d.ts +58 -0
- package/dist/lib/infrastructure/dal/repositories/zep/ZepTaskRepository.d.ts.map +1 -0
- package/dist/lib/infrastructure/dal/repositories/zep/ZepTaskRepository.js +206 -0
- package/dist/lib/infrastructure/dal/repositories/zep/ZepTaskRepository.js.map +1 -0
- package/dist/lib/infrastructure/dal/repositories/zep/index.d.ts +6 -0
- package/dist/lib/infrastructure/dal/repositories/zep/index.d.ts.map +1 -0
- package/dist/lib/infrastructure/dal/repositories/zep/index.js +11 -0
- package/dist/lib/infrastructure/dal/repositories/zep/index.js.map +1 -0
- package/dist/lib/infrastructure/dal/routing/RepositoryRouter.d.ts +73 -0
- package/dist/lib/infrastructure/dal/routing/RepositoryRouter.d.ts.map +1 -0
- package/dist/lib/infrastructure/dal/routing/RepositoryRouter.js +170 -0
- package/dist/lib/infrastructure/dal/routing/RepositoryRouter.js.map +1 -0
- package/dist/lib/infrastructure/dal/routing/index.d.ts +5 -0
- package/dist/lib/infrastructure/dal/routing/index.d.ts.map +1 -0
- package/dist/lib/infrastructure/dal/routing/index.js +10 -0
- package/dist/lib/infrastructure/dal/routing/index.js.map +1 -0
- package/dist/lib/infrastructure/di/ServiceFactory.d.ts +44 -0
- package/dist/lib/infrastructure/di/ServiceFactory.d.ts.map +1 -0
- package/dist/lib/infrastructure/di/ServiceFactory.js +141 -0
- package/dist/lib/infrastructure/di/ServiceFactory.js.map +1 -0
- package/dist/lib/infrastructure/di/index.d.ts +5 -0
- package/dist/lib/infrastructure/di/index.d.ts.map +1 -0
- package/dist/lib/infrastructure/di/index.js +10 -0
- package/dist/lib/infrastructure/di/index.js.map +1 -0
- package/dist/lib/infrastructure/index.d.ts +17 -0
- package/dist/lib/infrastructure/index.d.ts.map +1 -0
- package/dist/lib/infrastructure/index.js +41 -0
- package/dist/lib/infrastructure/index.js.map +1 -0
- package/dist/lib/infrastructure/logging/Logger.d.ts +50 -0
- package/dist/lib/infrastructure/logging/Logger.d.ts.map +1 -0
- package/dist/lib/infrastructure/logging/Logger.js +167 -0
- package/dist/lib/infrastructure/logging/Logger.js.map +1 -0
- package/dist/lib/infrastructure/logging/context.d.ts +51 -0
- package/dist/lib/infrastructure/logging/context.d.ts.map +1 -0
- package/dist/lib/infrastructure/logging/context.js +77 -0
- package/dist/lib/infrastructure/logging/context.js.map +1 -0
- package/dist/lib/infrastructure/logging/factory.d.ts +36 -0
- package/dist/lib/infrastructure/logging/factory.d.ts.map +1 -0
- package/dist/lib/infrastructure/logging/factory.js +122 -0
- package/dist/lib/infrastructure/logging/factory.js.map +1 -0
- package/dist/lib/infrastructure/logging/index.d.ts +26 -0
- package/dist/lib/infrastructure/logging/index.d.ts.map +1 -0
- package/dist/lib/infrastructure/logging/index.js +45 -0
- package/dist/lib/infrastructure/logging/index.js.map +1 -0
- package/dist/lib/infrastructure/mcp/McpClient.d.ts +36 -0
- package/dist/lib/infrastructure/mcp/McpClient.d.ts.map +1 -0
- package/dist/lib/infrastructure/mcp/McpClient.js +155 -0
- package/dist/lib/infrastructure/mcp/McpClient.js.map +1 -0
- package/dist/lib/infrastructure/mcp/index.d.ts +5 -0
- package/dist/lib/infrastructure/mcp/index.d.ts.map +1 -0
- package/dist/lib/infrastructure/mcp/index.js +9 -0
- package/dist/lib/infrastructure/mcp/index.js.map +1 -0
- package/dist/lib/infrastructure/services/EventEmitter.d.ts +24 -0
- package/dist/lib/infrastructure/services/EventEmitter.d.ts.map +1 -0
- package/dist/lib/infrastructure/services/EventEmitter.js +41 -0
- package/dist/lib/infrastructure/services/EventEmitter.js.map +1 -0
- package/dist/lib/infrastructure/services/MemoryService.d.ts +48 -0
- package/dist/lib/infrastructure/services/MemoryService.d.ts.map +1 -0
- package/dist/lib/infrastructure/services/MemoryService.js +298 -0
- package/dist/lib/infrastructure/services/MemoryService.js.map +1 -0
- package/dist/lib/infrastructure/services/RecursionService.d.ts +50 -0
- package/dist/lib/infrastructure/services/RecursionService.d.ts.map +1 -0
- package/dist/lib/infrastructure/services/RecursionService.js +233 -0
- package/dist/lib/infrastructure/services/RecursionService.js.map +1 -0
- package/dist/lib/infrastructure/services/SessionCaptureService.d.ts +31 -0
- package/dist/lib/infrastructure/services/SessionCaptureService.d.ts.map +1 -0
- package/dist/lib/infrastructure/services/SessionCaptureService.js +38 -0
- package/dist/lib/infrastructure/services/SessionCaptureService.js.map +1 -0
- package/dist/lib/infrastructure/services/TaskService.d.ts +38 -0
- package/dist/lib/infrastructure/services/TaskService.d.ts.map +1 -0
- package/dist/lib/infrastructure/services/TaskService.js +227 -0
- package/dist/lib/infrastructure/services/TaskService.js.map +1 -0
- package/dist/lib/infrastructure/services/index.d.ts +9 -0
- package/dist/lib/infrastructure/services/index.d.ts.map +1 -0
- package/dist/lib/infrastructure/services/index.js +17 -0
- package/dist/lib/infrastructure/services/index.js.map +1 -0
- package/dist/lib/interfaces/IDockerClient.d.ts +6 -0
- package/dist/lib/interfaces/IDockerClient.d.ts.map +1 -0
- package/dist/lib/interfaces/IDockerClient.js +1 -0
- package/dist/lib/interfaces/IDockerClient.js.map +1 -0
- package/dist/lib/interfaces/IMcpClient.d.ts +7 -0
- package/dist/lib/interfaces/IMcpClient.d.ts.map +1 -0
- package/dist/lib/interfaces/IMcpClient.js +1 -0
- package/dist/lib/interfaces/IMcpClient.js.map +1 -0
- package/dist/lib/interfaces/IServices.d.ts +9 -0
- package/dist/lib/interfaces/IServices.d.ts.map +1 -0
- package/dist/lib/interfaces/IServices.js +1 -0
- package/dist/lib/interfaces/IServices.js.map +1 -0
- package/dist/lib/interfaces/ITemplateCopier.d.ts +6 -0
- package/dist/lib/interfaces/ITemplateCopier.d.ts.map +1 -0
- package/dist/lib/interfaces/ITemplateCopier.js +1 -0
- package/dist/lib/interfaces/ITemplateCopier.js.map +1 -0
- package/dist/lib/mcp.d.ts +5 -0
- package/dist/lib/mcp.d.ts.map +1 -0
- package/dist/lib/mcp.js +12 -1
- package/dist/lib/mcp.js.map +1 -0
- package/dist/lib/scanner/analyzer.d.ts +51 -0
- package/dist/lib/scanner/analyzer.d.ts.map +1 -0
- package/dist/lib/scanner/analyzer.js +6 -1
- package/dist/lib/scanner/analyzer.js.map +1 -0
- package/dist/lib/scanner/discovery.d.ts +25 -0
- package/dist/lib/scanner/discovery.d.ts.map +1 -0
- package/dist/lib/scanner/discovery.js +4 -3
- package/dist/lib/scanner/discovery.js.map +1 -0
- package/dist/lib/scanner/facts.d.ts +33 -0
- package/dist/lib/scanner/facts.d.ts.map +1 -0
- package/dist/lib/scanner/facts.js +23 -5
- package/dist/lib/scanner/facts.js.map +1 -0
- package/dist/lib/scanner/index.d.ts +31 -0
- package/dist/lib/scanner/index.d.ts.map +1 -0
- package/dist/lib/scanner/index.js +1 -6
- package/dist/lib/scanner/index.js.map +1 -0
- package/dist/lib/scanner/reviewer.d.ts +62 -0
- package/dist/lib/scanner/reviewer.d.ts.map +1 -0
- package/dist/lib/scanner/reviewer.js +26 -8
- package/dist/lib/scanner/reviewer.js.map +1 -0
- package/dist/lib/services.d.ts +7 -0
- package/dist/lib/services.d.ts.map +1 -0
- package/dist/lib/services.js +1 -0
- package/dist/lib/services.js.map +1 -0
- package/dist/opencode/lisa.js +43344 -0
- package/dist/package.json +15 -3
- package/dist/project/.lisa/.env.template +18 -0
- package/dist/{templates → project/.lisa}/rules/shared/git-rules.md +6 -6
- package/dist/project/.lisa/skills/common/group-id.d.ts.map +1 -0
- package/dist/{templates/agents → project/.lisa}/skills/common/group-id.js +1 -0
- package/dist/project/.lisa/skills/common/group-id.js.map +1 -0
- package/dist/project/.lisa/skills/common/type-mappings.d.ts.map +1 -0
- package/dist/project/.lisa/skills/common/type-mappings.js +93 -0
- package/dist/project/.lisa/skills/common/type-mappings.js.map +1 -0
- package/dist/{templates/agents → project/.lisa}/skills/git/SKILL.md +7 -7
- package/dist/project/.lisa/skills/git/scripts/bump-version.d.ts.map +1 -0
- package/dist/project/.lisa/skills/git/scripts/bump-version.js +58 -0
- package/dist/project/.lisa/skills/git/scripts/bump-version.js.map +1 -0
- package/dist/{templates/agents → project/.lisa}/skills/init-review/SKILL.md +2 -2
- package/dist/project/.lisa/skills/init-review/scripts/ai-enrich.d.ts.map +1 -0
- package/dist/project/.lisa/skills/init-review/scripts/ai-enrich.js +177 -0
- package/dist/project/.lisa/skills/init-review/scripts/ai-enrich.js.map +1 -0
- package/dist/project/.lisa/skills/init-review/scripts/init-review.d.ts.map +1 -0
- package/dist/project/.lisa/skills/init-review/scripts/init-review.js +143 -0
- package/dist/project/.lisa/skills/init-review/scripts/init-review.js.map +1 -0
- package/dist/project/.lisa/skills/jira/scripts/jira.d.ts.map +1 -0
- package/dist/project/.lisa/skills/jira/scripts/jira.js +159 -0
- package/dist/project/.lisa/skills/jira/scripts/jira.js.map +1 -0
- package/dist/{templates/agents → project/.lisa}/skills/lisa/SKILL.md +17 -15
- package/dist/project/.lisa/skills/lisa/scripts/compile-skills.d.ts.map +1 -0
- package/dist/project/.lisa/skills/lisa/scripts/compile-skills.js +75 -0
- package/dist/project/.lisa/skills/lisa/scripts/compile-skills.js.map +1 -0
- package/dist/project/.lisa/skills/lisa/scripts/storage.d.ts.map +1 -0
- package/dist/project/.lisa/skills/lisa/scripts/storage.js +114 -0
- package/dist/project/.lisa/skills/lisa/scripts/storage.js.map +1 -0
- package/dist/{templates/agents → project/.lisa}/skills/memory/SKILL.md +3 -3
- package/dist/project/.lisa/skills/memory/scripts/memory.d.ts.map +1 -0
- package/dist/project/.lisa/skills/memory/scripts/memory.js +95 -0
- package/dist/project/.lisa/skills/memory/scripts/memory.js.map +1 -0
- package/dist/{templates/agents → project/.lisa}/skills/prompt/SKILL.md +1 -1
- package/dist/project/.lisa/skills/prompt/scripts/prompt.d.ts.map +1 -0
- package/dist/project/.lisa/skills/prompt/scripts/prompt.js +80 -0
- package/dist/project/.lisa/skills/prompt/scripts/prompt.js.map +1 -0
- package/dist/project/.lisa/skills/shared/clients/McpClient.d.ts.map +1 -0
- package/dist/project/.lisa/skills/shared/clients/McpClient.js +117 -0
- package/dist/project/.lisa/skills/shared/clients/McpClient.js.map +1 -0
- package/dist/project/.lisa/skills/shared/clients/Neo4jClient.d.ts.map +1 -0
- package/dist/project/.lisa/skills/shared/clients/Neo4jClient.js +81 -0
- package/dist/project/.lisa/skills/shared/clients/Neo4jClient.js.map +1 -0
- package/dist/project/.lisa/skills/shared/clients/ZepClient.d.ts.map +1 -0
- package/dist/project/.lisa/skills/shared/clients/ZepClient.js +238 -0
- package/dist/project/.lisa/skills/shared/clients/ZepClient.js.map +1 -0
- package/dist/project/.lisa/skills/shared/clients/index.d.ts.map +1 -0
- package/dist/project/.lisa/skills/shared/clients/index.js +33 -0
- package/dist/project/.lisa/skills/shared/clients/index.js.map +1 -0
- package/dist/project/.lisa/skills/shared/clients/interfaces/IMcpClient.d.ts.map +1 -0
- package/dist/project/.lisa/skills/shared/clients/interfaces/IMcpClient.js +3 -0
- package/dist/project/.lisa/skills/shared/clients/interfaces/IMcpClient.js.map +1 -0
- package/dist/project/.lisa/skills/shared/clients/interfaces/INeo4jClient.d.ts.map +1 -0
- package/dist/project/.lisa/skills/shared/clients/interfaces/INeo4jClient.js +3 -0
- package/dist/project/.lisa/skills/shared/clients/interfaces/INeo4jClient.js.map +1 -0
- package/dist/project/.lisa/skills/shared/clients/interfaces/IZepClient.d.ts.map +1 -0
- package/dist/project/.lisa/skills/shared/clients/interfaces/IZepClient.js +3 -0
- package/dist/project/.lisa/skills/shared/clients/interfaces/IZepClient.js.map +1 -0
- package/dist/project/.lisa/skills/shared/clients/interfaces/index.d.ts.map +1 -0
- package/dist/project/.lisa/skills/shared/clients/interfaces/index.js +23 -0
- package/dist/project/.lisa/skills/shared/clients/interfaces/index.js.map +1 -0
- package/dist/project/.lisa/skills/shared/group-id.d.ts.map +1 -0
- package/dist/project/.lisa/skills/shared/group-id.js +18 -0
- package/dist/project/.lisa/skills/shared/group-id.js.map +1 -0
- package/dist/project/.lisa/skills/shared/index.d.ts.map +1 -0
- package/dist/project/.lisa/skills/shared/index.js +31 -0
- package/dist/project/.lisa/skills/shared/index.js.map +1 -0
- package/dist/project/.lisa/skills/shared/logger.d.ts.map +1 -0
- package/dist/project/.lisa/skills/shared/logger.js +18 -0
- package/dist/project/.lisa/skills/shared/logger.js.map +1 -0
- package/dist/project/.lisa/skills/shared/services/InitReviewService.d.ts.map +1 -0
- package/dist/project/.lisa/skills/shared/services/InitReviewService.js +287 -0
- package/dist/project/.lisa/skills/shared/services/InitReviewService.js.map +1 -0
- package/dist/project/.lisa/skills/shared/services/JiraService.d.ts.map +1 -0
- package/dist/project/.lisa/skills/shared/services/JiraService.js +257 -0
- package/dist/project/.lisa/skills/shared/services/JiraService.js.map +1 -0
- package/dist/project/.lisa/skills/shared/services/MemoryCliService.d.ts.map +1 -0
- package/dist/project/.lisa/skills/shared/services/MemoryCliService.js +36 -0
- package/dist/project/.lisa/skills/shared/services/MemoryCliService.js.map +1 -0
- package/dist/project/.lisa/skills/shared/services/MemoryService.d.ts.map +1 -0
- package/dist/project/.lisa/skills/shared/services/MemoryService.js +146 -0
- package/dist/project/.lisa/skills/shared/services/MemoryService.js.map +1 -0
- package/dist/project/.lisa/skills/shared/services/PromptService.d.ts.map +1 -0
- package/dist/project/.lisa/skills/shared/services/PromptService.js +53 -0
- package/dist/project/.lisa/skills/shared/services/PromptService.js.map +1 -0
- package/dist/project/.lisa/skills/shared/services/SkillCompilerService.d.ts.map +1 -0
- package/dist/project/.lisa/skills/shared/services/SkillCompilerService.js +115 -0
- package/dist/project/.lisa/skills/shared/services/SkillCompilerService.js.map +1 -0
- package/dist/project/.lisa/skills/shared/services/StorageService.d.ts.map +1 -0
- package/dist/project/.lisa/skills/shared/services/StorageService.js +257 -0
- package/dist/project/.lisa/skills/shared/services/StorageService.js.map +1 -0
- package/dist/project/.lisa/skills/shared/services/TaskCliService.d.ts.map +1 -0
- package/dist/project/.lisa/skills/shared/services/TaskCliService.js +40 -0
- package/dist/project/.lisa/skills/shared/services/TaskCliService.js.map +1 -0
- package/dist/project/.lisa/skills/shared/services/TaskService.d.ts.map +1 -0
- package/dist/project/.lisa/skills/shared/services/TaskService.js +158 -0
- package/dist/project/.lisa/skills/shared/services/TaskService.js.map +1 -0
- package/dist/project/.lisa/skills/shared/services/VersionService.d.ts.map +1 -0
- package/dist/project/.lisa/skills/shared/services/VersionService.js +88 -0
- package/dist/project/.lisa/skills/shared/services/VersionService.js.map +1 -0
- package/dist/project/.lisa/skills/shared/services/index.d.ts.map +1 -0
- package/dist/project/.lisa/skills/shared/services/index.js +47 -0
- package/dist/project/.lisa/skills/shared/services/index.js.map +1 -0
- package/dist/project/.lisa/skills/shared/services/interfaces/IMemoryService.d.ts.map +1 -0
- package/dist/project/.lisa/skills/shared/services/interfaces/IMemoryService.js +7 -0
- package/dist/project/.lisa/skills/shared/services/interfaces/IMemoryService.js.map +1 -0
- package/dist/project/.lisa/skills/shared/services/interfaces/ITaskService.d.ts.map +1 -0
- package/dist/project/.lisa/skills/shared/services/interfaces/ITaskService.js +7 -0
- package/dist/project/.lisa/skills/shared/services/interfaces/ITaskService.js.map +1 -0
- package/dist/project/.lisa/skills/shared/services/interfaces/index.d.ts.map +1 -0
- package/dist/project/.lisa/skills/shared/services/interfaces/index.js +22 -0
- package/dist/project/.lisa/skills/shared/services/interfaces/index.js.map +1 -0
- package/dist/project/.lisa/skills/shared/utils/FileCache.d.ts.map +1 -0
- package/dist/project/.lisa/skills/shared/utils/FileCache.js +119 -0
- package/dist/project/.lisa/skills/shared/utils/FileCache.js.map +1 -0
- package/dist/project/.lisa/skills/shared/utils/Logger.d.ts.map +1 -0
- package/dist/project/.lisa/skills/shared/utils/Logger.js +197 -0
- package/dist/project/.lisa/skills/shared/utils/Logger.js.map +1 -0
- package/dist/project/.lisa/skills/shared/utils/cache.d.ts.map +1 -0
- package/dist/project/.lisa/skills/shared/utils/cache.js +76 -0
- package/dist/project/.lisa/skills/shared/utils/cache.js.map +1 -0
- package/dist/project/.lisa/skills/shared/utils/cli.d.ts.map +1 -0
- package/dist/project/.lisa/skills/shared/utils/cli.js +87 -0
- package/dist/project/.lisa/skills/shared/utils/cli.js.map +1 -0
- package/dist/project/.lisa/skills/shared/utils/env.d.ts.map +1 -0
- package/dist/project/.lisa/skills/shared/utils/env.js +103 -0
- package/dist/project/.lisa/skills/shared/utils/env.js.map +1 -0
- package/dist/project/.lisa/skills/shared/utils/group-id.d.ts.map +1 -0
- package/dist/project/.lisa/skills/shared/utils/group-id.js +91 -0
- package/dist/project/.lisa/skills/shared/utils/group-id.js.map +1 -0
- package/dist/project/.lisa/skills/shared/utils/index.d.ts.map +1 -0
- package/dist/project/.lisa/skills/shared/utils/index.js +55 -0
- package/dist/project/.lisa/skills/shared/utils/index.js.map +1 -0
- package/dist/project/.lisa/skills/shared/utils/interfaces/ICache.d.ts.map +1 -0
- package/dist/project/.lisa/skills/shared/utils/interfaces/ICache.js +3 -0
- package/dist/project/.lisa/skills/shared/utils/interfaces/ICache.js.map +1 -0
- package/dist/project/.lisa/skills/shared/utils/interfaces/ILogger.d.ts.map +1 -0
- package/dist/project/.lisa/skills/shared/utils/interfaces/ILogger.js +3 -0
- package/dist/project/.lisa/skills/shared/utils/interfaces/ILogger.js.map +1 -0
- package/dist/project/.lisa/skills/shared/utils/interfaces/index.d.ts.map +1 -0
- package/dist/project/.lisa/skills/shared/utils/interfaces/index.js +22 -0
- package/dist/project/.lisa/skills/shared/utils/interfaces/index.js.map +1 -0
- package/dist/{templates/agents → project/.lisa}/skills/tasks/SKILL.md +2 -2
- package/dist/project/.lisa/skills/tasks/scripts/tasks.d.ts.map +1 -0
- package/dist/project/.lisa/skills/tasks/scripts/tasks.js +98 -0
- package/dist/project/.lisa/skills/tasks/scripts/tasks.js.map +1 -0
- package/package.json +31 -10
- package/scripts/postinstall.js +93 -60
- package/dist/cli.js +0 -414
- package/dist/templates/agents/.sample.env +0 -12
- package/dist/templates/agents/docs/EXTENDING-SKILLS.md +0 -291
- package/dist/templates/agents/docs/EXTENDING-rules.md +0 -57
- package/dist/templates/agents/docs/STORAGE_SETUP.md +0 -161
- package/dist/templates/agents/skills/git/scripts/bump-version.js +0 -112
- package/dist/templates/agents/skills/init-review/scripts/ai-enrich.js +0 -258
- package/dist/templates/agents/skills/init-review/scripts/init-review.js +0 -769
- package/dist/templates/agents/skills/jira/scripts/jira.js +0 -406
- package/dist/templates/agents/skills/lisa/scripts/compile-skills.js +0 -177
- package/dist/templates/agents/skills/lisa/scripts/storage.js +0 -374
- package/dist/templates/agents/skills/memory/scripts/memory.js +0 -533
- package/dist/templates/agents/skills/prompt/scripts/prompt.js +0 -184
- package/dist/templates/agents/skills/tasks/scripts/tasks.js +0 -489
- package/dist/templates/claude/config.js +0 -40
- package/dist/templates/claude/hooks/README.md +0 -158
- package/dist/templates/claude/hooks/common/complexity-rater.js +0 -290
- package/dist/templates/claude/hooks/common/context.js +0 -263
- package/dist/templates/claude/hooks/common/group-id.js +0 -188
- package/dist/templates/claude/hooks/common/mcp-client.js +0 -131
- package/dist/templates/claude/hooks/common/transcript-parser.js +0 -256
- package/dist/templates/claude/hooks/common/zep-client.js +0 -175
- package/dist/templates/claude/hooks/session-start.js +0 -511
- package/dist/templates/claude/hooks/session-stop-worker.js +0 -484
- package/dist/templates/claude/hooks/session-stop.js +0 -122
- package/dist/templates/claude/hooks/user-prompt-submit.js +0 -479
- package/dist/templates/claude/settings.json +0 -46
- package/dist/templates/docker/.env.lisa.example +0 -17
- /package/dist/{templates → project/.lisa}/docker/docker-compose.graphiti.yml +0 -0
- /package/dist/{templates → project/.lisa}/rules/shared/clean-architecture.md +0 -0
- /package/dist/{templates → project/.lisa}/rules/shared/code-quality-rules.md +0 -0
- /package/dist/{templates → project/.lisa}/rules/shared/git-rules.local.md +0 -0
- /package/dist/{templates → project/.lisa}/rules/shared/testing-principles.md +0 -0
- /package/dist/{templates → project/.lisa}/rules/typescript/coding-standards.md +0 -0
- /package/dist/{templates → project/.lisa}/rules/typescript/testing.md +0 -0
- /package/dist/{templates → project/.lisa}/rules/typescript/typescript-config-guide.md +0 -0
- /package/dist/{templates/agents → project/.lisa}/skills/git/scripts/poll-ci.sh +0 -0
- /package/dist/{templates/agents → project/.lisa}/skills/jira/SKILL.md +0 -0
- /package/dist/{templates/agents → project/.lisa}/skills/lisa/cache/.gitkeep +0 -0
|
@@ -1,511 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
"use strict";
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
/**
|
|
5
|
-
* Claude Code - Session Start Hook
|
|
6
|
-
*
|
|
7
|
-
* Loads memory context from Graphiti MCP at the start of a new Claude session.
|
|
8
|
-
* This ensures Claude has access to prior work, tasks, and project context.
|
|
9
|
-
*
|
|
10
|
-
* Handles all SessionStart trigger types:
|
|
11
|
-
* - startup: Initial session start
|
|
12
|
-
* - resume: Resuming an existing session
|
|
13
|
-
* - compact: After auto-compact operation (context was summarized)
|
|
14
|
-
* - clear: After /clear command
|
|
15
|
-
*
|
|
16
|
-
* Configuration: .claude/settings.json -> hooks.SessionStart
|
|
17
|
-
*/
|
|
18
|
-
const { rpcCall, withGroup, getCurrentGroupId, getHierarchicalGroupIds } = require('./common/mcp-client');
|
|
19
|
-
const { detectRepo, detectBranch, repoTags, getUserName, getProjectAliases } = require('./common/context');
|
|
20
|
-
const { detectFolderMetadata, formatFolderMetadata } = require('./common/group-id');
|
|
21
|
-
/**
|
|
22
|
-
* Read hook input from stdin (JSON with trigger type and session info)
|
|
23
|
-
*/
|
|
24
|
-
async function readStdin() {
|
|
25
|
-
return new Promise((resolve) => {
|
|
26
|
-
let data = '';
|
|
27
|
-
process.stdin.setEncoding('utf8');
|
|
28
|
-
process.stdin.on('readable', () => {
|
|
29
|
-
let chunk;
|
|
30
|
-
while ((chunk = process.stdin.read()) !== null) {
|
|
31
|
-
data += chunk;
|
|
32
|
-
}
|
|
33
|
-
});
|
|
34
|
-
process.stdin.on('end', () => {
|
|
35
|
-
try {
|
|
36
|
-
resolve(JSON.parse(data));
|
|
37
|
-
}
|
|
38
|
-
catch {
|
|
39
|
-
resolve({});
|
|
40
|
-
}
|
|
41
|
-
});
|
|
42
|
-
// Timeout if no stdin after 100ms (for manual testing)
|
|
43
|
-
setTimeout(() => {
|
|
44
|
-
if (!data)
|
|
45
|
-
resolve({});
|
|
46
|
-
}, 100);
|
|
47
|
-
});
|
|
48
|
-
}
|
|
49
|
-
/**
|
|
50
|
-
* Get trigger-specific messaging
|
|
51
|
-
*/
|
|
52
|
-
function getTriggerMessage(trigger) {
|
|
53
|
-
switch (trigger) {
|
|
54
|
-
case 'startup':
|
|
55
|
-
return 'Memory loaded for session start.';
|
|
56
|
-
case 'resume':
|
|
57
|
-
return 'Memory loaded for session resume.';
|
|
58
|
-
case 'compact':
|
|
59
|
-
return 'Memory reloaded after context compaction.';
|
|
60
|
-
case 'clear':
|
|
61
|
-
return 'Memory loaded after context clear.';
|
|
62
|
-
default:
|
|
63
|
-
return 'Memory loaded for session start.';
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
/**
|
|
67
|
-
* Get trigger-specific reminders (shown after compact/clear)
|
|
68
|
-
*/
|
|
69
|
-
function getTriggerReminders(trigger) {
|
|
70
|
-
const reminders = [];
|
|
71
|
-
if (trigger === 'compact') {
|
|
72
|
-
reminders.push('Note: Context was compacted. Previously loaded skills may need to be re-invoked if needed.');
|
|
73
|
-
}
|
|
74
|
-
if (trigger === 'clear') {
|
|
75
|
-
reminders.push('Note: Context was cleared. Start fresh or use /memory to recall prior work.');
|
|
76
|
-
}
|
|
77
|
-
return reminders;
|
|
78
|
-
}
|
|
79
|
-
// Configuration for recent memories display
|
|
80
|
-
const RECENT_HOURS = 24;
|
|
81
|
-
const MAX_RECENT_MEMORIES = 5;
|
|
82
|
-
// Low-level relationship types to exclude (system noise, not meaningful work)
|
|
83
|
-
const EXCLUDED_RELATIONSHIPS = new Set([
|
|
84
|
-
// System/debug noise
|
|
85
|
-
'USER_SUBMITS_DIRECTION', 'DIRECTION_IS_TOPIC',
|
|
86
|
-
'EXPANDED_ENTITY_TYPES_TRACKED',
|
|
87
|
-
// Overly granular
|
|
88
|
-
'TESTS', 'ASSESSES',
|
|
89
|
-
]);
|
|
90
|
-
function getTaskId(tags = []) {
|
|
91
|
-
const t = tags.find((x) => x.startsWith('task_id:'));
|
|
92
|
-
return t ? t.replace('task_id:', '') : null;
|
|
93
|
-
}
|
|
94
|
-
function getTaskNum(tags = []) {
|
|
95
|
-
const t = tags.find((x) => x.startsWith('task_num:'));
|
|
96
|
-
return t ? t.replace('task_num:', '') : null;
|
|
97
|
-
}
|
|
98
|
-
function getTaskStatus(tags = []) {
|
|
99
|
-
const t = tags.find((x) => x.startsWith('status:'));
|
|
100
|
-
return t ? t.replace('status:', '').toLowerCase() : 'unknown';
|
|
101
|
-
}
|
|
102
|
-
function pickLatest(a = {}, b = {}) {
|
|
103
|
-
const ad = a.created_at ? new Date(a.created_at).getTime() : 0;
|
|
104
|
-
const bd = b.created_at ? new Date(b.created_at).getTime() : 0;
|
|
105
|
-
return bd > ad ? b : a;
|
|
106
|
-
}
|
|
107
|
-
/**
|
|
108
|
-
* Filter memories to meaningful ones from the last N hours (excludes noise)
|
|
109
|
-
*/
|
|
110
|
-
function filterRecentMemories(memories, hoursAgo = RECENT_HOURS) {
|
|
111
|
-
const cutoff = new Date(Date.now() - hoursAgo * 60 * 60 * 1000);
|
|
112
|
-
return memories.filter((m) => {
|
|
113
|
-
// Must have timestamp
|
|
114
|
-
if (!m.created_at)
|
|
115
|
-
return false;
|
|
116
|
-
const created = new Date(m.created_at);
|
|
117
|
-
if (created < cutoff)
|
|
118
|
-
return false;
|
|
119
|
-
// Exclude known noise relationship types
|
|
120
|
-
if (m.name && EXCLUDED_RELATIONSHIPS.has(m.name)) {
|
|
121
|
-
return false;
|
|
122
|
-
}
|
|
123
|
-
return true;
|
|
124
|
-
});
|
|
125
|
-
}
|
|
126
|
-
/**
|
|
127
|
-
* Format a date relative to now (today, yesterday, or date)
|
|
128
|
-
*/
|
|
129
|
-
function formatRelativeDate(date) {
|
|
130
|
-
const now = new Date();
|
|
131
|
-
const today = new Date(now.getFullYear(), now.getMonth(), now.getDate());
|
|
132
|
-
const yesterday = new Date(today.getTime() - 24 * 60 * 60 * 1000);
|
|
133
|
-
const dateOnly = new Date(date.getFullYear(), date.getMonth(), date.getDate());
|
|
134
|
-
const time = date.toLocaleTimeString('en-US', {
|
|
135
|
-
hour: '2-digit',
|
|
136
|
-
minute: '2-digit',
|
|
137
|
-
hour12: false,
|
|
138
|
-
});
|
|
139
|
-
if (dateOnly.getTime() === today.getTime()) {
|
|
140
|
-
return `Today ${time}`;
|
|
141
|
-
}
|
|
142
|
-
else if (dateOnly.getTime() === yesterday.getTime()) {
|
|
143
|
-
return `Yesterday ${time}`;
|
|
144
|
-
}
|
|
145
|
-
else {
|
|
146
|
-
const month = date.toLocaleString('en-US', { month: 'short' });
|
|
147
|
-
const day = date.getDate();
|
|
148
|
-
return `${month} ${day} ${time}`;
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
// Time window for grouping memories (in minutes)
|
|
152
|
-
const GROUP_WINDOW_MINUTES = 5;
|
|
153
|
-
/**
|
|
154
|
-
* Extract common theme from a group of memory facts
|
|
155
|
-
*/
|
|
156
|
-
function extractGroupSummary(memories) {
|
|
157
|
-
if (memories.length === 1) {
|
|
158
|
-
return memories[0].fact || memories[0].name || '<unknown>';
|
|
159
|
-
}
|
|
160
|
-
// Get all fact texts
|
|
161
|
-
const facts = memories.map((m) => m.fact || m.name || '').filter(Boolean);
|
|
162
|
-
if (!facts.length)
|
|
163
|
-
return `${memories.length} items`;
|
|
164
|
-
// Find common prefix/theme by looking for repeated phrases
|
|
165
|
-
const words = facts[0].split(/\s+/);
|
|
166
|
-
let commonPrefix = '';
|
|
167
|
-
// Find longest common prefix of words
|
|
168
|
-
for (let i = 0; i < Math.min(words.length, 8); i++) {
|
|
169
|
-
const prefix = words.slice(0, i + 1).join(' ');
|
|
170
|
-
const allMatch = facts.every((f) => f.startsWith(prefix));
|
|
171
|
-
if (allMatch) {
|
|
172
|
-
commonPrefix = prefix;
|
|
173
|
-
}
|
|
174
|
-
else {
|
|
175
|
-
break;
|
|
176
|
-
}
|
|
177
|
-
}
|
|
178
|
-
// Clean up the prefix (remove trailing articles, prepositions)
|
|
179
|
-
commonPrefix = commonPrefix.replace(/\s+(the|a|an|is|are|was|were|includes?|has|have|with|for|to|of|in|on|at)$/i, '');
|
|
180
|
-
if (commonPrefix.length > 15) {
|
|
181
|
-
return `${commonPrefix} (${memories.length} items)`;
|
|
182
|
-
}
|
|
183
|
-
// Fallback: use first fact truncated
|
|
184
|
-
const firstFact = facts[0];
|
|
185
|
-
if (firstFact.length > 60) {
|
|
186
|
-
return `${firstFact.slice(0, 57)}... (+${memories.length - 1} more)`;
|
|
187
|
-
}
|
|
188
|
-
return `${firstFact} (+${memories.length - 1} more)`;
|
|
189
|
-
}
|
|
190
|
-
/**
|
|
191
|
-
* Group memories by time window and create summaries
|
|
192
|
-
*/
|
|
193
|
-
function groupMemoriesByTime(memories, windowMinutes = GROUP_WINDOW_MINUTES) {
|
|
194
|
-
if (!memories.length)
|
|
195
|
-
return [];
|
|
196
|
-
// Sort by created_at descending (most recent first)
|
|
197
|
-
const sorted = [...memories].sort((a, b) => {
|
|
198
|
-
const ad = a.created_at ? new Date(a.created_at).getTime() : 0;
|
|
199
|
-
const bd = b.created_at ? new Date(b.created_at).getTime() : 0;
|
|
200
|
-
return bd - ad;
|
|
201
|
-
});
|
|
202
|
-
const groups = [];
|
|
203
|
-
let currentGroup = [];
|
|
204
|
-
let groupStartTime = null;
|
|
205
|
-
for (const memory of sorted) {
|
|
206
|
-
const memTime = memory.created_at ? new Date(memory.created_at).getTime() : 0;
|
|
207
|
-
if (groupStartTime === null) {
|
|
208
|
-
// Start new group
|
|
209
|
-
groupStartTime = memTime;
|
|
210
|
-
currentGroup = [memory];
|
|
211
|
-
}
|
|
212
|
-
else if (groupStartTime - memTime <= windowMinutes * 60 * 1000) {
|
|
213
|
-
// Within window, add to current group
|
|
214
|
-
currentGroup.push(memory);
|
|
215
|
-
}
|
|
216
|
-
else {
|
|
217
|
-
// Outside window, save current group and start new one
|
|
218
|
-
groups.push({
|
|
219
|
-
timestamp: new Date(groupStartTime),
|
|
220
|
-
memories: currentGroup,
|
|
221
|
-
summary: extractGroupSummary(currentGroup),
|
|
222
|
-
});
|
|
223
|
-
groupStartTime = memTime;
|
|
224
|
-
currentGroup = [memory];
|
|
225
|
-
}
|
|
226
|
-
}
|
|
227
|
-
// Don't forget the last group
|
|
228
|
-
if (currentGroup.length && groupStartTime !== null) {
|
|
229
|
-
groups.push({
|
|
230
|
-
timestamp: new Date(groupStartTime),
|
|
231
|
-
memories: currentGroup,
|
|
232
|
-
summary: extractGroupSummary(currentGroup),
|
|
233
|
-
});
|
|
234
|
-
}
|
|
235
|
-
return groups;
|
|
236
|
-
}
|
|
237
|
-
/**
|
|
238
|
-
* Format memory groups as summary lines with relative dates
|
|
239
|
-
* Grouped by time, limited to max groups
|
|
240
|
-
*/
|
|
241
|
-
function formatMemorySummary(memories, limit = MAX_RECENT_MEMORIES) {
|
|
242
|
-
const groups = groupMemoriesByTime(memories);
|
|
243
|
-
// Take top N groups
|
|
244
|
-
const topGroups = groups.slice(0, limit);
|
|
245
|
-
// Format each group
|
|
246
|
-
return topGroups.map((group) => {
|
|
247
|
-
const dateStr = formatRelativeDate(group.timestamp);
|
|
248
|
-
return ` ${dateStr} - ${group.summary}`;
|
|
249
|
-
});
|
|
250
|
-
}
|
|
251
|
-
// Overall timeout for memory loading to avoid blocking session start
|
|
252
|
-
const MEMORY_LOAD_TIMEOUT_MS = 5000; // 5 seconds max
|
|
253
|
-
/**
|
|
254
|
-
* Load all memory with an overall timeout
|
|
255
|
-
* Returns partial results if timeout occurs
|
|
256
|
-
*/
|
|
257
|
-
async function loadMemoryWithTimeout(aliases, hierarchicalGroups, branch) {
|
|
258
|
-
const result = {
|
|
259
|
-
facts: [],
|
|
260
|
-
nodes: [],
|
|
261
|
-
tasks: [],
|
|
262
|
-
initReview: null,
|
|
263
|
-
timedOut: false,
|
|
264
|
-
};
|
|
265
|
-
let sessionId = null;
|
|
266
|
-
const loadPromise = async () => {
|
|
267
|
-
// Load init-review memory first (codebase summary)
|
|
268
|
-
try {
|
|
269
|
-
const initParams = {
|
|
270
|
-
query: 'init-review',
|
|
271
|
-
max_facts: 1,
|
|
272
|
-
order: 'desc',
|
|
273
|
-
group_ids: hierarchicalGroups,
|
|
274
|
-
tags: ['type:init-review'],
|
|
275
|
-
};
|
|
276
|
-
const [initResp, sid] = (await rpcCall('search_memory_facts', initParams, sessionId));
|
|
277
|
-
sessionId = sid;
|
|
278
|
-
const initFacts = initResp?.result?.facts || initResp?.facts || [];
|
|
279
|
-
if (initFacts.length > 0) {
|
|
280
|
-
const fact = initFacts[0];
|
|
281
|
-
result.initReview = fact.fact || fact.name || null;
|
|
282
|
-
}
|
|
283
|
-
}
|
|
284
|
-
catch {
|
|
285
|
-
// Continue if init-review load fails
|
|
286
|
-
}
|
|
287
|
-
// Load recent facts/nodes from memory using hierarchical groups
|
|
288
|
-
try {
|
|
289
|
-
const seenUuids = new Set();
|
|
290
|
-
// Query with hierarchical groups (current folder + all parents)
|
|
291
|
-
const recentParams = { query: '*', max_facts: 100, order: 'desc', group_ids: hierarchicalGroups };
|
|
292
|
-
const [recentResp, sid] = (await rpcCall('search_memory_facts', recentParams, sessionId));
|
|
293
|
-
sessionId = sid;
|
|
294
|
-
const recentFacts = recentResp?.result?.facts || recentResp?.facts || [];
|
|
295
|
-
for (const fact of recentFacts) {
|
|
296
|
-
const uuid = fact.uuid || `${fact.name}-${fact.fact}`;
|
|
297
|
-
if (!seenUuids.has(uuid)) {
|
|
298
|
-
seenUuids.add(uuid);
|
|
299
|
-
result.facts.push(fact);
|
|
300
|
-
}
|
|
301
|
-
}
|
|
302
|
-
// Also query by repo aliases to catch any repo-specific memories
|
|
303
|
-
for (const alias of aliases) {
|
|
304
|
-
const baseParams = { query: alias, tags: repoTags({ repo: alias, branch }) };
|
|
305
|
-
const factParams = { ...baseParams, max_facts: 50, order: 'desc', group_ids: hierarchicalGroups };
|
|
306
|
-
const [factResp] = (await rpcCall('search_memory_facts', factParams, sessionId));
|
|
307
|
-
const aliasedFacts = factResp?.result?.facts || factResp?.facts || [];
|
|
308
|
-
for (const fact of aliasedFacts) {
|
|
309
|
-
const uuid = fact.uuid || `${fact.name}-${fact.fact}`;
|
|
310
|
-
if (!seenUuids.has(uuid)) {
|
|
311
|
-
seenUuids.add(uuid);
|
|
312
|
-
result.facts.push(fact);
|
|
313
|
-
}
|
|
314
|
-
}
|
|
315
|
-
}
|
|
316
|
-
// Fall back to nodes if no facts found
|
|
317
|
-
if (!result.facts.length) {
|
|
318
|
-
for (const alias of aliases) {
|
|
319
|
-
const baseParams = { query: alias, tags: repoTags({ repo: alias, branch }) };
|
|
320
|
-
const nodeParams = { ...baseParams, max_nodes: 20, group_ids: hierarchicalGroups };
|
|
321
|
-
const [nodeResp] = (await rpcCall('search_nodes', nodeParams, sessionId));
|
|
322
|
-
const aliasedNodes = nodeResp?.result?.nodes || nodeResp?.nodes || [];
|
|
323
|
-
for (const node of aliasedNodes) {
|
|
324
|
-
const uuid = node.uuid || `${node.name}-${node.fact}`;
|
|
325
|
-
if (!seenUuids.has(uuid)) {
|
|
326
|
-
seenUuids.add(uuid);
|
|
327
|
-
result.nodes.push(node);
|
|
328
|
-
}
|
|
329
|
-
}
|
|
330
|
-
}
|
|
331
|
-
}
|
|
332
|
-
}
|
|
333
|
-
catch {
|
|
334
|
-
// Continue if memory load fails
|
|
335
|
-
}
|
|
336
|
-
// Load tasks for this repo
|
|
337
|
-
try {
|
|
338
|
-
const seenTaskUuids = new Set();
|
|
339
|
-
for (const alias of aliases) {
|
|
340
|
-
const taskParams = {
|
|
341
|
-
query: 'task',
|
|
342
|
-
tags: ['type:task', ...repoTags({ repo: alias, branch })],
|
|
343
|
-
max_nodes: 200,
|
|
344
|
-
group_ids: hierarchicalGroups,
|
|
345
|
-
};
|
|
346
|
-
const [taskResp] = (await rpcCall('search_nodes', taskParams, sessionId));
|
|
347
|
-
const aliasedTasks = taskResp?.result?.nodes || taskResp?.nodes || [];
|
|
348
|
-
for (const task of aliasedTasks) {
|
|
349
|
-
const uuid = task.uuid || `${task.name}-${task.fact}`;
|
|
350
|
-
if (!seenTaskUuids.has(uuid)) {
|
|
351
|
-
seenTaskUuids.add(uuid);
|
|
352
|
-
result.tasks.push(task);
|
|
353
|
-
}
|
|
354
|
-
}
|
|
355
|
-
}
|
|
356
|
-
}
|
|
357
|
-
catch {
|
|
358
|
-
// Continue if task load fails
|
|
359
|
-
}
|
|
360
|
-
};
|
|
361
|
-
// Race between loading and timeout
|
|
362
|
-
const timeoutPromise = new Promise((resolve) => {
|
|
363
|
-
setTimeout(() => {
|
|
364
|
-
result.timedOut = true;
|
|
365
|
-
resolve();
|
|
366
|
-
}, MEMORY_LOAD_TIMEOUT_MS);
|
|
367
|
-
});
|
|
368
|
-
await Promise.race([loadPromise(), timeoutPromise]);
|
|
369
|
-
return result;
|
|
370
|
-
}
|
|
371
|
-
async function main() {
|
|
372
|
-
// Read hook input to get trigger type (startup, resume, compact, clear)
|
|
373
|
-
const hookInput = await readStdin();
|
|
374
|
-
const trigger = hookInput.trigger || hookInput.session_type || 'startup';
|
|
375
|
-
const repo = detectRepo();
|
|
376
|
-
const branch = detectBranch();
|
|
377
|
-
const aliases = getProjectAliases(); // Get all aliases including folder name
|
|
378
|
-
const user = getUserName();
|
|
379
|
-
// Folder-based group hierarchy
|
|
380
|
-
const hierarchicalGroups = getHierarchicalGroupIds();
|
|
381
|
-
const folderMetadata = detectFolderMetadata();
|
|
382
|
-
const folderType = formatFolderMetadata(folderMetadata);
|
|
383
|
-
const cwd = process.cwd();
|
|
384
|
-
// Load memory with timeout to avoid blocking session start
|
|
385
|
-
const memoryResult = await loadMemoryWithTimeout(aliases, hierarchicalGroups, branch);
|
|
386
|
-
const facts = memoryResult.facts;
|
|
387
|
-
const nodes = memoryResult.nodes;
|
|
388
|
-
const taskNodes = memoryResult.tasks;
|
|
389
|
-
const initReview = memoryResult.initReview;
|
|
390
|
-
// Process items (rest of the function continues as before)
|
|
391
|
-
// Note: We removed the inline loading code and now use memoryResult
|
|
392
|
-
// Build task list from loaded task nodes
|
|
393
|
-
const tasksByKey = new Map();
|
|
394
|
-
taskNodes.forEach((n) => {
|
|
395
|
-
const key = getTaskNum(n.tags) || getTaskId(n.tags);
|
|
396
|
-
if (!key)
|
|
397
|
-
return;
|
|
398
|
-
const existing = tasksByKey.get(key);
|
|
399
|
-
const latest = existing ? pickLatest(existing, n) : n;
|
|
400
|
-
tasksByKey.set(key, latest);
|
|
401
|
-
});
|
|
402
|
-
const tasks = Array.from(tasksByKey.entries()).map(([key, n]) => {
|
|
403
|
-
const status = getTaskStatus(n.tags);
|
|
404
|
-
const title = n.name || n.fact || n.uuid || '<untitled>';
|
|
405
|
-
const blocked = (n.tags || []).filter((t) => t.startsWith('blocked_by:')).map((t) => t.replace('blocked_by:', ''));
|
|
406
|
-
return { key, status, title, blocked, created_at: n.created_at };
|
|
407
|
-
});
|
|
408
|
-
tasks.sort((a, b) => {
|
|
409
|
-
const ad = a.created_at ? new Date(a.created_at).getTime() : 0;
|
|
410
|
-
const bd = b.created_at ? new Date(b.created_at).getTime() : 0;
|
|
411
|
-
return bd - ad;
|
|
412
|
-
});
|
|
413
|
-
// Count tasks by status
|
|
414
|
-
const counts = {
|
|
415
|
-
ready: 0,
|
|
416
|
-
'in-progress': 0,
|
|
417
|
-
blocked: 0,
|
|
418
|
-
done: 0,
|
|
419
|
-
closed: 0,
|
|
420
|
-
unknown: 0,
|
|
421
|
-
};
|
|
422
|
-
tasks.forEach((t) => {
|
|
423
|
-
const key = counts[t.status] === undefined ? 'unknown' : t.status;
|
|
424
|
-
counts[key] += 1;
|
|
425
|
-
});
|
|
426
|
-
const active = tasks.filter((t) => t.status === 'in-progress');
|
|
427
|
-
const ready = tasks.filter((t) => t.status === 'ready');
|
|
428
|
-
// Build output - show folder context with type
|
|
429
|
-
const repoLabel = `${repo}${branch ? ' (' + branch + ')' : ''}`;
|
|
430
|
-
const items = facts.length ? facts : nodes;
|
|
431
|
-
// Filter to last 24 hours and format for display
|
|
432
|
-
const recentItems = filterRecentMemories(items, RECENT_HOURS);
|
|
433
|
-
const recentFormatted = formatMemorySummary(recentItems, MAX_RECENT_MEMORIES);
|
|
434
|
-
const lines = [];
|
|
435
|
-
// Show trigger-specific message with timeout warning if applicable
|
|
436
|
-
const baseMessage = getTriggerMessage(trigger);
|
|
437
|
-
if (memoryResult.timedOut) {
|
|
438
|
-
lines.push(`${baseMessage.replace('.', '')} (partial - timed out after ${MEMORY_LOAD_TIMEOUT_MS / 1000}s).`);
|
|
439
|
-
}
|
|
440
|
-
else {
|
|
441
|
-
lines.push(baseMessage);
|
|
442
|
-
}
|
|
443
|
-
// Add trigger-specific reminders (for compact/clear)
|
|
444
|
-
const reminders = getTriggerReminders(trigger);
|
|
445
|
-
if (reminders.length) {
|
|
446
|
-
reminders.forEach((r) => lines.push(r));
|
|
447
|
-
}
|
|
448
|
-
// Show folder path with detected type (e.g., "TypeScript/React project")
|
|
449
|
-
const folderDisplay = cwd.replace(process.env.HOME || '', '~');
|
|
450
|
-
lines.push(`User: ${user} | Folder: ${folderDisplay} (${folderType})`);
|
|
451
|
-
lines.push(`Repo: ${repoLabel}`);
|
|
452
|
-
// Show init-review (codebase summary) if available
|
|
453
|
-
if (initReview) {
|
|
454
|
-
lines.push('');
|
|
455
|
-
lines.push('Codebase Summary:');
|
|
456
|
-
lines.push(` ${initReview}`);
|
|
457
|
-
lines.push('');
|
|
458
|
-
}
|
|
459
|
-
// Show recent memories from last 24 hours
|
|
460
|
-
if (recentFormatted.length) {
|
|
461
|
-
lines.push(`Recent memories (last ${RECENT_HOURS}h):`);
|
|
462
|
-
lines.push(...recentFormatted);
|
|
463
|
-
}
|
|
464
|
-
else if (items.length) {
|
|
465
|
-
lines.push(`Recent memories (last ${RECENT_HOURS}h): none (older memories exist)`);
|
|
466
|
-
}
|
|
467
|
-
if (tasks.length) {
|
|
468
|
-
const summaryParts = [];
|
|
469
|
-
if (counts['in-progress'])
|
|
470
|
-
summaryParts.push(`${counts['in-progress']} in-progress`);
|
|
471
|
-
if (counts.ready)
|
|
472
|
-
summaryParts.push(`${counts.ready} ready`);
|
|
473
|
-
if (counts.blocked)
|
|
474
|
-
summaryParts.push(`${counts.blocked} blocked`);
|
|
475
|
-
if (counts.done)
|
|
476
|
-
summaryParts.push(`${counts.done} done`);
|
|
477
|
-
if (counts.closed)
|
|
478
|
-
summaryParts.push(`${counts.closed} closed`);
|
|
479
|
-
lines.push(`Tasks: ${summaryParts.join(', ') || 'none active'}`);
|
|
480
|
-
if (active.length) {
|
|
481
|
-
lines.push(`Active: ${active[0].key} - ${active[0].title}`);
|
|
482
|
-
}
|
|
483
|
-
if (ready.length) {
|
|
484
|
-
const readyList = ready
|
|
485
|
-
.slice(0, 2)
|
|
486
|
-
.map((t) => `${t.key} - ${t.title}`)
|
|
487
|
-
.join(' | ');
|
|
488
|
-
lines.push(`Ready: ${readyList}`);
|
|
489
|
-
}
|
|
490
|
-
}
|
|
491
|
-
else {
|
|
492
|
-
lines.push('Tasks: none found for this repo');
|
|
493
|
-
}
|
|
494
|
-
// Output goes to Claude as system-reminder context (stdout)
|
|
495
|
-
console.log(lines.join('\n'));
|
|
496
|
-
// Visible confirmation to user (stderr) - brief summary
|
|
497
|
-
const itemCount = items.length;
|
|
498
|
-
const taskCount = tasks.length;
|
|
499
|
-
let summary = itemCount || taskCount ? `${itemCount} memories, ${taskCount} tasks` : 'no prior context';
|
|
500
|
-
if (memoryResult.timedOut) {
|
|
501
|
-
summary += ' (partial)';
|
|
502
|
-
}
|
|
503
|
-
// Show trigger type for transparency
|
|
504
|
-
const triggerLabel = trigger === 'startup' ? '' : ` (${trigger})`;
|
|
505
|
-
console.error(`[Memory loaded${triggerLabel}: ${summary}]`);
|
|
506
|
-
}
|
|
507
|
-
main().catch((err) => {
|
|
508
|
-
// Don't block session start on errors - just log and exit cleanly
|
|
509
|
-
console.log(`Memory load skipped: ${err.message}`);
|
|
510
|
-
process.exit(0);
|
|
511
|
-
});
|