@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,374 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
"use strict";
|
|
3
|
-
// Lisa storage mode management script.
|
|
4
|
-
// Commands:
|
|
5
|
-
// node storage.js status [--cache] Show current storage mode and connection status
|
|
6
|
-
// node storage.js switch <mode> [--cache] Switch to local or zep-cloud mode
|
|
7
|
-
// Options:
|
|
8
|
-
// --cache Write successful responses to cache and use as fallback on errors.
|
|
9
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
const fs = require('fs');
|
|
11
|
-
const path = require('path');
|
|
12
|
-
const { execSync } = require('child_process');
|
|
13
|
-
// Constants
|
|
14
|
-
const ZEP_BASE_URL = 'https://api.getzep.com/api/v2';
|
|
15
|
-
const DEFAULT_LOCAL_ENDPOINT = 'http://localhost:8010/mcp/';
|
|
16
|
-
const DEFAULT_ZEP_ENDPOINT = 'https://api.getzep.com/mcp/';
|
|
17
|
-
// Read environment config from .agents/skills/.env
|
|
18
|
-
function readEnvConfig() {
|
|
19
|
-
// Path: .agents/skills/lisa/scripts/ -> .agents/skills/.env (2 levels up)
|
|
20
|
-
const envPath = path.join(__dirname, '..', '..', '.env');
|
|
21
|
-
const out = {};
|
|
22
|
-
try {
|
|
23
|
-
const raw = fs.readFileSync(envPath, 'utf8');
|
|
24
|
-
raw.split(/\r?\n/).forEach((line) => {
|
|
25
|
-
if (!line || line.startsWith('#'))
|
|
26
|
-
return;
|
|
27
|
-
const idx = line.indexOf('=');
|
|
28
|
-
if (idx === -1)
|
|
29
|
-
return;
|
|
30
|
-
const key = line.slice(0, idx).trim();
|
|
31
|
-
const val = line.slice(idx + 1).trim();
|
|
32
|
-
out[key] = val;
|
|
33
|
-
});
|
|
34
|
-
}
|
|
35
|
-
catch (_) {
|
|
36
|
-
// optional .env; ignore if missing
|
|
37
|
-
}
|
|
38
|
-
return out;
|
|
39
|
-
}
|
|
40
|
-
// Update STORAGE_MODE in .agents/skills/.env (preserves comments and other vars)
|
|
41
|
-
function updateEnvStorageMode(newMode) {
|
|
42
|
-
const envPath = path.join(__dirname, '..', '..', '.env');
|
|
43
|
-
let content;
|
|
44
|
-
try {
|
|
45
|
-
content = fs.readFileSync(envPath, 'utf8');
|
|
46
|
-
}
|
|
47
|
-
catch (_) {
|
|
48
|
-
// Create new .env if it doesn't exist
|
|
49
|
-
content = '';
|
|
50
|
-
}
|
|
51
|
-
const lines = content.split(/\r?\n/);
|
|
52
|
-
let foundMode = false;
|
|
53
|
-
let foundEndpoint = false;
|
|
54
|
-
const newEndpoint = newMode === 'zep-cloud' ? DEFAULT_ZEP_ENDPOINT : DEFAULT_LOCAL_ENDPOINT;
|
|
55
|
-
const updatedLines = lines.map((line) => {
|
|
56
|
-
// Update STORAGE_MODE
|
|
57
|
-
if (line.startsWith('STORAGE_MODE=') || line.startsWith('STORAGE_MODE =')) {
|
|
58
|
-
foundMode = true;
|
|
59
|
-
return `STORAGE_MODE=${newMode}`;
|
|
60
|
-
}
|
|
61
|
-
// Update GRAPHITI_ENDPOINT
|
|
62
|
-
if (line.startsWith('GRAPHITI_ENDPOINT=') || line.startsWith('GRAPHITI_ENDPOINT =')) {
|
|
63
|
-
foundEndpoint = true;
|
|
64
|
-
return `GRAPHITI_ENDPOINT=${newEndpoint}`;
|
|
65
|
-
}
|
|
66
|
-
return line;
|
|
67
|
-
});
|
|
68
|
-
// Add STORAGE_MODE if not found
|
|
69
|
-
if (!foundMode) {
|
|
70
|
-
// Find a good place to insert (after GRAPHITI_GROUP_ID or at end)
|
|
71
|
-
const groupIdx = updatedLines.findIndex((l) => l.startsWith('GRAPHITI_GROUP_ID'));
|
|
72
|
-
if (groupIdx !== -1) {
|
|
73
|
-
updatedLines.splice(groupIdx + 1, 0, `STORAGE_MODE=${newMode}`);
|
|
74
|
-
}
|
|
75
|
-
else {
|
|
76
|
-
updatedLines.push(`STORAGE_MODE=${newMode}`);
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
// Add GRAPHITI_ENDPOINT if not found
|
|
80
|
-
if (!foundEndpoint) {
|
|
81
|
-
const modeIdx = updatedLines.findIndex((l) => l.startsWith('STORAGE_MODE'));
|
|
82
|
-
if (modeIdx !== -1) {
|
|
83
|
-
updatedLines.splice(modeIdx + 1, 0, `GRAPHITI_ENDPOINT=${newEndpoint}`);
|
|
84
|
-
}
|
|
85
|
-
else {
|
|
86
|
-
updatedLines.push(`GRAPHITI_ENDPOINT=${newEndpoint}`);
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
// Write back
|
|
90
|
-
fs.writeFileSync(envPath, updatedLines.join('\n'), 'utf8');
|
|
91
|
-
}
|
|
92
|
-
// Check if Docker daemon is running
|
|
93
|
-
function checkDockerRunning() {
|
|
94
|
-
try {
|
|
95
|
-
execSync('docker info', { stdio: 'pipe', timeout: 5000 });
|
|
96
|
-
return { running: true };
|
|
97
|
-
}
|
|
98
|
-
catch (err) {
|
|
99
|
-
const message = err instanceof Error ? err.message : String(err);
|
|
100
|
-
if (message.includes('Cannot connect') || message.includes('Is the docker daemon running')) {
|
|
101
|
-
return { running: false, error: 'Docker daemon is not running. Start Docker Desktop or run `dockerd`.' };
|
|
102
|
-
}
|
|
103
|
-
if (message.includes('command not found') || message.includes('not recognized')) {
|
|
104
|
-
return { running: false, error: 'Docker is not installed. Install Docker from https://docker.com' };
|
|
105
|
-
}
|
|
106
|
-
return { running: false, error: `Docker check failed: ${message}` };
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
// Check if ZEP_API_KEY exists
|
|
110
|
-
function checkZepApiKeyExists(env) {
|
|
111
|
-
const apiKey = env.ZEP_API_KEY || process.env.ZEP_API_KEY;
|
|
112
|
-
if (apiKey && apiKey.length > 0 && !apiKey.startsWith('${')) {
|
|
113
|
-
return { exists: true };
|
|
114
|
-
}
|
|
115
|
-
return {
|
|
116
|
-
exists: false,
|
|
117
|
-
error: 'ZEP_API_KEY not configured. Add ZEP_API_KEY to .agents/.env or set it as an environment variable.'
|
|
118
|
-
};
|
|
119
|
-
}
|
|
120
|
-
// Ping local MCP endpoint
|
|
121
|
-
async function pingLocalMcp(endpoint) {
|
|
122
|
-
try {
|
|
123
|
-
const body = {
|
|
124
|
-
jsonrpc: '2.0',
|
|
125
|
-
id: 'ping',
|
|
126
|
-
method: 'initialize',
|
|
127
|
-
params: {
|
|
128
|
-
protocolVersion: '2024-11-05',
|
|
129
|
-
capabilities: {},
|
|
130
|
-
clientInfo: { name: 'storage-skill', version: '0.1.0' },
|
|
131
|
-
},
|
|
132
|
-
};
|
|
133
|
-
const resp = await fetch(endpoint, {
|
|
134
|
-
method: 'POST',
|
|
135
|
-
headers: {
|
|
136
|
-
'Content-Type': 'application/json',
|
|
137
|
-
Accept: 'application/json, text/event-stream',
|
|
138
|
-
},
|
|
139
|
-
body: JSON.stringify(body),
|
|
140
|
-
signal: AbortSignal.timeout(10000),
|
|
141
|
-
});
|
|
142
|
-
if (resp.ok) {
|
|
143
|
-
return { reachable: true };
|
|
144
|
-
}
|
|
145
|
-
return { reachable: false, error: `HTTP ${resp.status}` };
|
|
146
|
-
}
|
|
147
|
-
catch (err) {
|
|
148
|
-
const message = err instanceof Error ? err.message : String(err);
|
|
149
|
-
return { reachable: false, error: message };
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
|
-
// Ping Zep Cloud API
|
|
153
|
-
async function pingZepCloud(apiKey) {
|
|
154
|
-
try {
|
|
155
|
-
const resp = await fetch(`${ZEP_BASE_URL}/users`, {
|
|
156
|
-
method: 'GET',
|
|
157
|
-
headers: {
|
|
158
|
-
'Content-Type': 'application/json',
|
|
159
|
-
Authorization: `Api-Key ${apiKey}`,
|
|
160
|
-
},
|
|
161
|
-
signal: AbortSignal.timeout(10000),
|
|
162
|
-
});
|
|
163
|
-
// Even 404 or 400 means the API is reachable and auth worked
|
|
164
|
-
if (resp.ok || resp.status === 404 || resp.status === 400) {
|
|
165
|
-
return { reachable: true };
|
|
166
|
-
}
|
|
167
|
-
if (resp.status === 401 || resp.status === 403) {
|
|
168
|
-
return { reachable: false, error: 'Invalid API key' };
|
|
169
|
-
}
|
|
170
|
-
return { reachable: false, error: `HTTP ${resp.status}` };
|
|
171
|
-
}
|
|
172
|
-
catch (err) {
|
|
173
|
-
const message = err instanceof Error ? err.message : String(err);
|
|
174
|
-
return { reachable: false, error: message };
|
|
175
|
-
}
|
|
176
|
-
}
|
|
177
|
-
// Argument parsing
|
|
178
|
-
const args = process.argv.slice(2);
|
|
179
|
-
function popFlag(name, fallback) {
|
|
180
|
-
const idx = args.indexOf(name);
|
|
181
|
-
if (idx === -1)
|
|
182
|
-
return fallback;
|
|
183
|
-
const val = args[idx + 1];
|
|
184
|
-
args.splice(idx, 2);
|
|
185
|
-
return val ?? fallback;
|
|
186
|
-
}
|
|
187
|
-
function hasFlag(name) {
|
|
188
|
-
const idx = args.indexOf(name);
|
|
189
|
-
if (idx === -1)
|
|
190
|
-
return false;
|
|
191
|
-
args.splice(idx, 1);
|
|
192
|
-
return true;
|
|
193
|
-
}
|
|
194
|
-
const command = args.shift() ?? '';
|
|
195
|
-
const useCache = hasFlag('--cache');
|
|
196
|
-
const targetMode = args.shift() ?? '';
|
|
197
|
-
const cacheFile = path.join(__dirname, '..', 'cache', 'storage.log');
|
|
198
|
-
function writeCache(obj) {
|
|
199
|
-
try {
|
|
200
|
-
const cacheDir = path.dirname(cacheFile);
|
|
201
|
-
if (!fs.existsSync(cacheDir)) {
|
|
202
|
-
fs.mkdirSync(cacheDir, { recursive: true });
|
|
203
|
-
}
|
|
204
|
-
const line = JSON.stringify({ ts: new Date().toISOString(), ...obj });
|
|
205
|
-
fs.appendFileSync(cacheFile, `${line}\n`, 'utf8');
|
|
206
|
-
}
|
|
207
|
-
catch (_) {
|
|
208
|
-
// cache failures should not crash command
|
|
209
|
-
}
|
|
210
|
-
}
|
|
211
|
-
function readCacheFallback() {
|
|
212
|
-
try {
|
|
213
|
-
const data = fs.readFileSync(cacheFile, 'utf8').trim().split('\n').filter(Boolean);
|
|
214
|
-
if (!data.length)
|
|
215
|
-
return null;
|
|
216
|
-
return data.slice(-1).map((l) => JSON.parse(l))[0];
|
|
217
|
-
}
|
|
218
|
-
catch (_) {
|
|
219
|
-
return null;
|
|
220
|
-
}
|
|
221
|
-
}
|
|
222
|
-
// Status command
|
|
223
|
-
async function statusCommand() {
|
|
224
|
-
const env = readEnvConfig();
|
|
225
|
-
const mode = env.STORAGE_MODE || process.env.STORAGE_MODE || 'local';
|
|
226
|
-
const endpoint = env.GRAPHITI_ENDPOINT || process.env.GRAPHITI_ENDPOINT || DEFAULT_LOCAL_ENDPOINT;
|
|
227
|
-
const groupId = env.GRAPHITI_GROUP_ID || process.env.GRAPHITI_GROUP_ID || 'lisa';
|
|
228
|
-
let isConnected = false;
|
|
229
|
-
let connectionError;
|
|
230
|
-
if (mode === 'zep-cloud') {
|
|
231
|
-
const apiKey = env.ZEP_API_KEY || process.env.ZEP_API_KEY || '';
|
|
232
|
-
if (apiKey && !apiKey.startsWith('${')) {
|
|
233
|
-
const result = await pingZepCloud(apiKey);
|
|
234
|
-
isConnected = result.reachable;
|
|
235
|
-
connectionError = result.error;
|
|
236
|
-
}
|
|
237
|
-
else {
|
|
238
|
-
connectionError = 'ZEP_API_KEY not configured';
|
|
239
|
-
}
|
|
240
|
-
}
|
|
241
|
-
else if (mode === 'local') {
|
|
242
|
-
const dockerCheck = checkDockerRunning();
|
|
243
|
-
if (!dockerCheck.running) {
|
|
244
|
-
connectionError = dockerCheck.error;
|
|
245
|
-
}
|
|
246
|
-
else {
|
|
247
|
-
const result = await pingLocalMcp(endpoint);
|
|
248
|
-
isConnected = result.reachable;
|
|
249
|
-
connectionError = result.error;
|
|
250
|
-
}
|
|
251
|
-
}
|
|
252
|
-
else {
|
|
253
|
-
connectionError = `Unknown mode: ${mode}`;
|
|
254
|
-
}
|
|
255
|
-
return {
|
|
256
|
-
status: 'ok',
|
|
257
|
-
action: 'status',
|
|
258
|
-
mode,
|
|
259
|
-
endpoint,
|
|
260
|
-
groupId,
|
|
261
|
-
isConnected,
|
|
262
|
-
...(connectionError ? { connectionError } : {}),
|
|
263
|
-
};
|
|
264
|
-
}
|
|
265
|
-
// Switch command
|
|
266
|
-
async function switchCommand(newMode) {
|
|
267
|
-
const validModes = ['local', 'zep-cloud'];
|
|
268
|
-
if (!validModes.includes(newMode)) {
|
|
269
|
-
return {
|
|
270
|
-
status: 'error',
|
|
271
|
-
action: 'switch',
|
|
272
|
-
message: `Invalid mode: ${newMode}. Valid modes are: ${validModes.join(', ')}`,
|
|
273
|
-
};
|
|
274
|
-
}
|
|
275
|
-
const env = readEnvConfig();
|
|
276
|
-
const previousMode = env.STORAGE_MODE || process.env.STORAGE_MODE || 'local';
|
|
277
|
-
// Same mode check
|
|
278
|
-
if (previousMode === newMode) {
|
|
279
|
-
return {
|
|
280
|
-
status: 'ok',
|
|
281
|
-
action: 'switch',
|
|
282
|
-
previousMode,
|
|
283
|
-
newMode,
|
|
284
|
-
verified: true,
|
|
285
|
-
message: `Already using ${newMode} mode.`,
|
|
286
|
-
};
|
|
287
|
-
}
|
|
288
|
-
// Validation before switching
|
|
289
|
-
if (newMode === 'local') {
|
|
290
|
-
const dockerCheck = checkDockerRunning();
|
|
291
|
-
if (!dockerCheck.running) {
|
|
292
|
-
return {
|
|
293
|
-
status: 'error',
|
|
294
|
-
action: 'switch',
|
|
295
|
-
message: `Cannot switch to local: ${dockerCheck.error}`,
|
|
296
|
-
};
|
|
297
|
-
}
|
|
298
|
-
}
|
|
299
|
-
else if (newMode === 'zep-cloud') {
|
|
300
|
-
const zepCheck = checkZepApiKeyExists(env);
|
|
301
|
-
if (!zepCheck.exists) {
|
|
302
|
-
return {
|
|
303
|
-
status: 'error',
|
|
304
|
-
action: 'switch',
|
|
305
|
-
message: `Cannot switch to zep-cloud: ${zepCheck.error}`,
|
|
306
|
-
};
|
|
307
|
-
}
|
|
308
|
-
}
|
|
309
|
-
// Update the .env file
|
|
310
|
-
updateEnvStorageMode(newMode);
|
|
311
|
-
// Re-read config to get updated endpoint
|
|
312
|
-
const updatedEnv = readEnvConfig();
|
|
313
|
-
const newEndpoint = updatedEnv.GRAPHITI_ENDPOINT || (newMode === 'zep-cloud' ? DEFAULT_ZEP_ENDPOINT : DEFAULT_LOCAL_ENDPOINT);
|
|
314
|
-
// Verify connection after switch
|
|
315
|
-
let verified = false;
|
|
316
|
-
let verifyError;
|
|
317
|
-
if (newMode === 'zep-cloud') {
|
|
318
|
-
const apiKey = updatedEnv.ZEP_API_KEY || process.env.ZEP_API_KEY || '';
|
|
319
|
-
const result = await pingZepCloud(apiKey);
|
|
320
|
-
verified = result.reachable;
|
|
321
|
-
verifyError = result.error;
|
|
322
|
-
}
|
|
323
|
-
else {
|
|
324
|
-
const result = await pingLocalMcp(newEndpoint);
|
|
325
|
-
verified = result.reachable;
|
|
326
|
-
verifyError = result.error;
|
|
327
|
-
}
|
|
328
|
-
const message = verified
|
|
329
|
-
? `Successfully switched from ${previousMode} to ${newMode}. Connection verified.`
|
|
330
|
-
: `Switched from ${previousMode} to ${newMode}, but connection verification failed: ${verifyError}`;
|
|
331
|
-
return {
|
|
332
|
-
status: 'ok',
|
|
333
|
-
action: 'switch',
|
|
334
|
-
previousMode,
|
|
335
|
-
newMode,
|
|
336
|
-
endpoint: newEndpoint,
|
|
337
|
-
verified,
|
|
338
|
-
message,
|
|
339
|
-
...(verifyError && !verified ? { verifyError } : {}),
|
|
340
|
-
};
|
|
341
|
-
}
|
|
342
|
-
async function main() {
|
|
343
|
-
try {
|
|
344
|
-
if (!['status', 'switch'].includes(command)) {
|
|
345
|
-
throw new Error('command must be status|switch');
|
|
346
|
-
}
|
|
347
|
-
let out;
|
|
348
|
-
if (command === 'status') {
|
|
349
|
-
out = await statusCommand();
|
|
350
|
-
}
|
|
351
|
-
else {
|
|
352
|
-
// switch
|
|
353
|
-
if (!targetMode) {
|
|
354
|
-
throw new Error('switch requires a mode argument (local or zep-cloud)');
|
|
355
|
-
}
|
|
356
|
-
out = await switchCommand(targetMode);
|
|
357
|
-
}
|
|
358
|
-
if (useCache && out.status === 'ok') {
|
|
359
|
-
writeCache(out);
|
|
360
|
-
}
|
|
361
|
-
console.log(JSON.stringify(out, null, 2));
|
|
362
|
-
}
|
|
363
|
-
catch (err) {
|
|
364
|
-
const message = err instanceof Error ? err.message : String(err);
|
|
365
|
-
const fallback = useCache ? readCacheFallback() : null;
|
|
366
|
-
if (fallback) {
|
|
367
|
-
console.log(JSON.stringify({ status: 'fallback', error: message, fallback }, null, 2));
|
|
368
|
-
return;
|
|
369
|
-
}
|
|
370
|
-
console.error(message);
|
|
371
|
-
process.exit(1);
|
|
372
|
-
}
|
|
373
|
-
}
|
|
374
|
-
main();
|