@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,406 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
"use strict";
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
/**
|
|
5
|
-
* Model-neutral Jira helper using Atlassian REST API v3.
|
|
6
|
-
*
|
|
7
|
-
* Commands:
|
|
8
|
-
* node jira.js create --type <type> --project <key> --summary "..." [--description "..."] [--parent KEY] [--assign me]
|
|
9
|
-
* node jira.js list [--project <key>] [--jql "..."] [--mine] [--limit N]
|
|
10
|
-
* node jira.js view <issue-key>
|
|
11
|
-
* node jira.js assign <issue-key> --to <user|me>
|
|
12
|
-
* node jira.js transition <issue-key> --to "Status Name"
|
|
13
|
-
* node jira.js change-type <issue-key> --to <epic|story|task|subtask|bug>
|
|
14
|
-
*
|
|
15
|
-
* Configuration:
|
|
16
|
-
* ~/.jira.d/config.yml - endpoint, user
|
|
17
|
-
* ~/.jira.d/api-token - raw API token
|
|
18
|
-
*/
|
|
19
|
-
const fs = require('fs');
|
|
20
|
-
const path = require('path');
|
|
21
|
-
const os = require('os');
|
|
22
|
-
// ============================================================================
|
|
23
|
-
// Configuration
|
|
24
|
-
// ============================================================================
|
|
25
|
-
const JIRA_CONFIG_DIR = path.join(os.homedir(), '.jira.d');
|
|
26
|
-
const CONFIG_FILE = path.join(JIRA_CONFIG_DIR, 'config.yml');
|
|
27
|
-
const TOKEN_FILE = path.join(JIRA_CONFIG_DIR, 'api-token');
|
|
28
|
-
// Issue type IDs (standard Jira Cloud defaults)
|
|
29
|
-
const ISSUE_TYPES = {
|
|
30
|
-
epic: '10000',
|
|
31
|
-
story: '10001',
|
|
32
|
-
task: '10002',
|
|
33
|
-
subtask: '10003',
|
|
34
|
-
bug: '10004',
|
|
35
|
-
};
|
|
36
|
-
function loadConfig() {
|
|
37
|
-
if (!fs.existsSync(CONFIG_FILE)) {
|
|
38
|
-
throw new Error(`Config not found: ${CONFIG_FILE}. Run setup first.`);
|
|
39
|
-
}
|
|
40
|
-
const configText = fs.readFileSync(CONFIG_FILE, 'utf8');
|
|
41
|
-
const config = {};
|
|
42
|
-
// Simple YAML parsing for key: value format
|
|
43
|
-
configText.split('\n').forEach((line) => {
|
|
44
|
-
const match = line.match(/^(\w[\w-]*)\s*:\s*(.+)$/);
|
|
45
|
-
if (match) {
|
|
46
|
-
config[match[1]] = match[2].trim().replace(/^["']|["']$/g, '');
|
|
47
|
-
}
|
|
48
|
-
});
|
|
49
|
-
if (!config.endpoint)
|
|
50
|
-
throw new Error('Missing endpoint in config.yml');
|
|
51
|
-
if (!config.user)
|
|
52
|
-
throw new Error('Missing user in config.yml');
|
|
53
|
-
return config;
|
|
54
|
-
}
|
|
55
|
-
function loadToken() {
|
|
56
|
-
if (!fs.existsSync(TOKEN_FILE)) {
|
|
57
|
-
throw new Error(`Token not found: ${TOKEN_FILE}. Create file with your API token.`);
|
|
58
|
-
}
|
|
59
|
-
return fs.readFileSync(TOKEN_FILE, 'utf8').trim();
|
|
60
|
-
}
|
|
61
|
-
// ============================================================================
|
|
62
|
-
// API Client
|
|
63
|
-
// ============================================================================
|
|
64
|
-
async function jiraFetch(endpoint, user, token, urlPath, options = {}) {
|
|
65
|
-
const url = `${endpoint}/rest/api/3${urlPath}`;
|
|
66
|
-
const auth = Buffer.from(`${user}:${token}`).toString('base64');
|
|
67
|
-
const response = await fetch(url, {
|
|
68
|
-
...options,
|
|
69
|
-
headers: {
|
|
70
|
-
Authorization: `Basic ${auth}`,
|
|
71
|
-
'Content-Type': 'application/json',
|
|
72
|
-
Accept: 'application/json',
|
|
73
|
-
...(options.headers || {}),
|
|
74
|
-
},
|
|
75
|
-
});
|
|
76
|
-
const text = await response.text();
|
|
77
|
-
let data;
|
|
78
|
-
try {
|
|
79
|
-
data = text ? JSON.parse(text) : {};
|
|
80
|
-
}
|
|
81
|
-
catch {
|
|
82
|
-
throw new Error(`Invalid JSON response: ${text.slice(0, 200)}`);
|
|
83
|
-
}
|
|
84
|
-
if (!response.ok) {
|
|
85
|
-
const errData = data;
|
|
86
|
-
const errorMsg = errData.errorMessages?.join(', ') || (errData.errors ? JSON.stringify(errData.errors) : `HTTP ${response.status}`);
|
|
87
|
-
throw new Error(errorMsg);
|
|
88
|
-
}
|
|
89
|
-
return data;
|
|
90
|
-
}
|
|
91
|
-
// ============================================================================
|
|
92
|
-
// Atlassian Document Format (ADF) Helper
|
|
93
|
-
// ============================================================================
|
|
94
|
-
function textToAdf(text) {
|
|
95
|
-
if (!text)
|
|
96
|
-
return undefined;
|
|
97
|
-
// Simple conversion: split by newlines, create paragraphs
|
|
98
|
-
const paragraphs = text.split('\n').filter((p) => p.trim());
|
|
99
|
-
return {
|
|
100
|
-
type: 'doc',
|
|
101
|
-
version: 1,
|
|
102
|
-
content: paragraphs.map((p) => ({
|
|
103
|
-
type: 'paragraph',
|
|
104
|
-
content: [{ type: 'text', text: p }],
|
|
105
|
-
})),
|
|
106
|
-
};
|
|
107
|
-
}
|
|
108
|
-
// ============================================================================
|
|
109
|
-
// Commands
|
|
110
|
-
// ============================================================================
|
|
111
|
-
async function getCurrentUser(endpoint, user, token) {
|
|
112
|
-
const data = await jiraFetch(endpoint, user, token, '/myself');
|
|
113
|
-
return data;
|
|
114
|
-
}
|
|
115
|
-
async function createIssue(config, token, args) {
|
|
116
|
-
const { type, project, summary, description, parent, assign } = args;
|
|
117
|
-
if (!type)
|
|
118
|
-
throw new Error('--type required (epic, story, task, subtask, bug)');
|
|
119
|
-
if (!project)
|
|
120
|
-
throw new Error('--project required');
|
|
121
|
-
if (!summary)
|
|
122
|
-
throw new Error('--summary required');
|
|
123
|
-
const issueTypeId = ISSUE_TYPES[type.toLowerCase()];
|
|
124
|
-
if (!issueTypeId)
|
|
125
|
-
throw new Error(`Unknown issue type: ${type}`);
|
|
126
|
-
const fields = {
|
|
127
|
-
project: { key: project },
|
|
128
|
-
summary: summary,
|
|
129
|
-
issuetype: { id: issueTypeId },
|
|
130
|
-
};
|
|
131
|
-
if (description) {
|
|
132
|
-
fields.description = textToAdf(description);
|
|
133
|
-
}
|
|
134
|
-
// Link to parent for sub-tasks
|
|
135
|
-
if (parent) {
|
|
136
|
-
fields.parent = { key: parent };
|
|
137
|
-
}
|
|
138
|
-
// Assign to user
|
|
139
|
-
if (assign) {
|
|
140
|
-
if (assign === 'me') {
|
|
141
|
-
const me = await getCurrentUser(config.endpoint, config.user, token);
|
|
142
|
-
fields.assignee = { accountId: me.accountId };
|
|
143
|
-
}
|
|
144
|
-
else {
|
|
145
|
-
// Search for user by email
|
|
146
|
-
const users = await jiraFetch(config.endpoint, config.user, token, `/user/search?query=${encodeURIComponent(assign)}`);
|
|
147
|
-
if (users.length === 0)
|
|
148
|
-
throw new Error(`User not found: ${assign}`);
|
|
149
|
-
fields.assignee = { accountId: users[0].accountId };
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
|
-
const data = await jiraFetch(config.endpoint, config.user, token, '/issue', {
|
|
153
|
-
method: 'POST',
|
|
154
|
-
body: JSON.stringify({ fields }),
|
|
155
|
-
});
|
|
156
|
-
return {
|
|
157
|
-
status: 'ok',
|
|
158
|
-
action: 'create',
|
|
159
|
-
issue: {
|
|
160
|
-
key: data.key,
|
|
161
|
-
url: `${config.endpoint}/browse/${data.key}`,
|
|
162
|
-
summary: summary,
|
|
163
|
-
type: type,
|
|
164
|
-
},
|
|
165
|
-
};
|
|
166
|
-
}
|
|
167
|
-
async function listIssues(config, token, args) {
|
|
168
|
-
const { project, jql, mine, limit = 20 } = args;
|
|
169
|
-
let query = jql;
|
|
170
|
-
if (!query) {
|
|
171
|
-
const conditions = [];
|
|
172
|
-
if (project)
|
|
173
|
-
conditions.push(`project = ${project}`);
|
|
174
|
-
if (mine)
|
|
175
|
-
conditions.push('assignee = currentUser()');
|
|
176
|
-
if (conditions.length === 0)
|
|
177
|
-
conditions.push('assignee = currentUser()');
|
|
178
|
-
query = conditions.join(' AND ') + ' ORDER BY created DESC';
|
|
179
|
-
}
|
|
180
|
-
const data = await jiraFetch(config.endpoint, config.user, token, '/search/jql', {
|
|
181
|
-
method: 'POST',
|
|
182
|
-
body: JSON.stringify({
|
|
183
|
-
jql: query,
|
|
184
|
-
maxResults: parseInt(String(limit)),
|
|
185
|
-
fields: ['summary', 'status', 'assignee', 'issuetype', 'parent'],
|
|
186
|
-
}),
|
|
187
|
-
});
|
|
188
|
-
const issues = (data.issues || []).map((issue) => ({
|
|
189
|
-
key: issue.key,
|
|
190
|
-
summary: issue.fields.summary || '',
|
|
191
|
-
status: issue.fields.status?.name || '',
|
|
192
|
-
assignee: issue.fields.assignee?.accountId ? 'Assigned' : 'Unassigned',
|
|
193
|
-
type: issue.fields.issuetype?.name || '',
|
|
194
|
-
parent: issue.fields.parent?.key || '',
|
|
195
|
-
}));
|
|
196
|
-
return {
|
|
197
|
-
status: 'ok',
|
|
198
|
-
action: 'list',
|
|
199
|
-
issues: issues,
|
|
200
|
-
total: data.total || issues.length,
|
|
201
|
-
};
|
|
202
|
-
}
|
|
203
|
-
async function viewIssue(config, token, issueKey) {
|
|
204
|
-
if (!issueKey)
|
|
205
|
-
throw new Error('Issue key required');
|
|
206
|
-
const data = await jiraFetch(config.endpoint, config.user, token, `/issue/${issueKey}?fields=summary,description,status,assignee,reporter,created,updated,issuetype,parent,subtasks`);
|
|
207
|
-
// Extract text from ADF description
|
|
208
|
-
let descriptionText = '';
|
|
209
|
-
if (data.fields.description?.content) {
|
|
210
|
-
descriptionText = data.fields.description.content
|
|
211
|
-
.filter((block) => block.type === 'paragraph')
|
|
212
|
-
.map((block) => block.content?.map((c) => c.text).join('') || '')
|
|
213
|
-
.join('\n');
|
|
214
|
-
}
|
|
215
|
-
return {
|
|
216
|
-
status: 'ok',
|
|
217
|
-
action: 'view',
|
|
218
|
-
issue: {
|
|
219
|
-
key: data.key,
|
|
220
|
-
url: `${config.endpoint}/browse/${data.key}`,
|
|
221
|
-
summary: data.fields.summary || '',
|
|
222
|
-
description: descriptionText,
|
|
223
|
-
status: data.fields.status?.name || '',
|
|
224
|
-
assignee: data.fields.assignee?.accountId ? 'Assigned' : 'Unassigned',
|
|
225
|
-
reporter: data.fields.reporter?.displayName || '',
|
|
226
|
-
type: data.fields.issuetype?.name || '',
|
|
227
|
-
parent: data.fields.parent?.key || '',
|
|
228
|
-
created: data.fields.created || '',
|
|
229
|
-
updated: data.fields.updated || '',
|
|
230
|
-
subtasks: (data.fields.subtasks || []).map((st) => ({
|
|
231
|
-
key: st.key,
|
|
232
|
-
summary: st.fields.summary,
|
|
233
|
-
status: st.fields.status?.name || '',
|
|
234
|
-
})),
|
|
235
|
-
},
|
|
236
|
-
};
|
|
237
|
-
}
|
|
238
|
-
async function assignIssue(config, token, issueKey, args) {
|
|
239
|
-
if (!issueKey)
|
|
240
|
-
throw new Error('Issue key required');
|
|
241
|
-
if (!args.to)
|
|
242
|
-
throw new Error('--to required (user email or "me")');
|
|
243
|
-
let accountId;
|
|
244
|
-
if (args.to === 'me') {
|
|
245
|
-
const me = await getCurrentUser(config.endpoint, config.user, token);
|
|
246
|
-
accountId = me.accountId;
|
|
247
|
-
}
|
|
248
|
-
else {
|
|
249
|
-
const users = await jiraFetch(config.endpoint, config.user, token, `/user/search?query=${encodeURIComponent(args.to)}`);
|
|
250
|
-
if (users.length === 0)
|
|
251
|
-
throw new Error(`User not found: ${args.to}`);
|
|
252
|
-
accountId = users[0].accountId;
|
|
253
|
-
}
|
|
254
|
-
await jiraFetch(config.endpoint, config.user, token, `/issue/${issueKey}/assignee`, {
|
|
255
|
-
method: 'PUT',
|
|
256
|
-
body: JSON.stringify({ accountId }),
|
|
257
|
-
});
|
|
258
|
-
return {
|
|
259
|
-
status: 'ok',
|
|
260
|
-
action: 'assign',
|
|
261
|
-
issue: issueKey,
|
|
262
|
-
assignee: args.to,
|
|
263
|
-
};
|
|
264
|
-
}
|
|
265
|
-
async function transitionIssue(config, token, issueKey, args) {
|
|
266
|
-
if (!issueKey)
|
|
267
|
-
throw new Error('Issue key required');
|
|
268
|
-
if (!args.to)
|
|
269
|
-
throw new Error('--to required (status name)');
|
|
270
|
-
// Get available transitions
|
|
271
|
-
const transitions = await jiraFetch(config.endpoint, config.user, token, `/issue/${issueKey}/transitions`);
|
|
272
|
-
const targetStatus = args.to.toLowerCase();
|
|
273
|
-
const transition = transitions.transitions?.find((t) => t.name.toLowerCase() === targetStatus || t.to.name.toLowerCase() === targetStatus);
|
|
274
|
-
if (!transition) {
|
|
275
|
-
const available = transitions.transitions?.map((t) => t.name).join(', ') || 'none';
|
|
276
|
-
throw new Error(`Transition "${args.to}" not found. Available: ${available}`);
|
|
277
|
-
}
|
|
278
|
-
await jiraFetch(config.endpoint, config.user, token, `/issue/${issueKey}/transitions`, {
|
|
279
|
-
method: 'POST',
|
|
280
|
-
body: JSON.stringify({ transition: { id: transition.id } }),
|
|
281
|
-
});
|
|
282
|
-
return {
|
|
283
|
-
status: 'ok',
|
|
284
|
-
action: 'transition',
|
|
285
|
-
issue: issueKey,
|
|
286
|
-
from: transition.name,
|
|
287
|
-
to: transition.to.name,
|
|
288
|
-
};
|
|
289
|
-
}
|
|
290
|
-
async function changeIssueType(config, token, issueKey, args) {
|
|
291
|
-
if (!issueKey)
|
|
292
|
-
throw new Error('Issue key required');
|
|
293
|
-
if (!args.to)
|
|
294
|
-
throw new Error('--to required (type name: epic, story, task, subtask, bug)');
|
|
295
|
-
const targetType = args.to.toLowerCase();
|
|
296
|
-
const typeId = ISSUE_TYPES[targetType];
|
|
297
|
-
if (!typeId) {
|
|
298
|
-
throw new Error(`Unknown type: ${args.to}. Valid types: ${Object.keys(ISSUE_TYPES).join(', ')}`);
|
|
299
|
-
}
|
|
300
|
-
// Get current issue to show before/after
|
|
301
|
-
const currentIssue = await jiraFetch(config.endpoint, config.user, token, `/issue/${issueKey}`);
|
|
302
|
-
const currentType = currentIssue.fields.issuetype?.name || '';
|
|
303
|
-
// Change the issue type
|
|
304
|
-
await jiraFetch(config.endpoint, config.user, token, `/issue/${issueKey}`, {
|
|
305
|
-
method: 'PUT',
|
|
306
|
-
body: JSON.stringify({
|
|
307
|
-
fields: {
|
|
308
|
-
issuetype: { id: typeId },
|
|
309
|
-
},
|
|
310
|
-
}),
|
|
311
|
-
});
|
|
312
|
-
return {
|
|
313
|
-
status: 'ok',
|
|
314
|
-
action: 'change-type',
|
|
315
|
-
issue: {
|
|
316
|
-
key: issueKey,
|
|
317
|
-
url: `${config.endpoint}/browse/${issueKey}`,
|
|
318
|
-
previousType: currentType,
|
|
319
|
-
newType: args.to,
|
|
320
|
-
},
|
|
321
|
-
};
|
|
322
|
-
}
|
|
323
|
-
// ============================================================================
|
|
324
|
-
// CLI Parser
|
|
325
|
-
// ============================================================================
|
|
326
|
-
function parseArgs(argv) {
|
|
327
|
-
const args = {};
|
|
328
|
-
let command = null;
|
|
329
|
-
const positional = [];
|
|
330
|
-
for (let i = 2; i < argv.length; i++) {
|
|
331
|
-
const arg = argv[i];
|
|
332
|
-
if (arg.startsWith('--')) {
|
|
333
|
-
const key = arg.slice(2);
|
|
334
|
-
const next = argv[i + 1];
|
|
335
|
-
if (next && !next.startsWith('--')) {
|
|
336
|
-
args[key] = next;
|
|
337
|
-
i++;
|
|
338
|
-
}
|
|
339
|
-
else {
|
|
340
|
-
args[key] = true;
|
|
341
|
-
}
|
|
342
|
-
}
|
|
343
|
-
else if (!command) {
|
|
344
|
-
command = arg;
|
|
345
|
-
}
|
|
346
|
-
else {
|
|
347
|
-
positional.push(arg);
|
|
348
|
-
}
|
|
349
|
-
}
|
|
350
|
-
return { command, args, positional };
|
|
351
|
-
}
|
|
352
|
-
// ============================================================================
|
|
353
|
-
// Main
|
|
354
|
-
// ============================================================================
|
|
355
|
-
async function main() {
|
|
356
|
-
try {
|
|
357
|
-
const { command, args, positional } = parseArgs(process.argv);
|
|
358
|
-
if (!command) {
|
|
359
|
-
console.log(JSON.stringify({
|
|
360
|
-
status: 'error',
|
|
361
|
-
error: 'No command specified',
|
|
362
|
-
usage: 'jira.js <create|list|view|assign|transition|change-type> [options]',
|
|
363
|
-
}));
|
|
364
|
-
process.exit(1);
|
|
365
|
-
}
|
|
366
|
-
const config = loadConfig();
|
|
367
|
-
const token = loadToken();
|
|
368
|
-
let result;
|
|
369
|
-
switch (command) {
|
|
370
|
-
case 'create':
|
|
371
|
-
result = await createIssue(config, token, args);
|
|
372
|
-
break;
|
|
373
|
-
case 'list':
|
|
374
|
-
result = await listIssues(config, token, args);
|
|
375
|
-
break;
|
|
376
|
-
case 'view':
|
|
377
|
-
result = await viewIssue(config, token, positional[0] || args.issue);
|
|
378
|
-
break;
|
|
379
|
-
case 'assign':
|
|
380
|
-
result = await assignIssue(config, token, positional[0] || args.issue, args);
|
|
381
|
-
break;
|
|
382
|
-
case 'transition':
|
|
383
|
-
result = await transitionIssue(config, token, positional[0] || args.issue, args);
|
|
384
|
-
break;
|
|
385
|
-
case 'change-type':
|
|
386
|
-
result = await changeIssueType(config, token, positional[0] || args.issue, args);
|
|
387
|
-
break;
|
|
388
|
-
default:
|
|
389
|
-
result = {
|
|
390
|
-
status: 'error',
|
|
391
|
-
error: `Unknown command: ${command}`,
|
|
392
|
-
available: ['create', 'list', 'view', 'assign', 'transition', 'change-type'],
|
|
393
|
-
};
|
|
394
|
-
}
|
|
395
|
-
console.log(JSON.stringify(result, null, 2));
|
|
396
|
-
}
|
|
397
|
-
catch (error) {
|
|
398
|
-
const message = error instanceof Error ? error.message : String(error);
|
|
399
|
-
console.log(JSON.stringify({
|
|
400
|
-
status: 'error',
|
|
401
|
-
error: message,
|
|
402
|
-
}));
|
|
403
|
-
process.exit(1);
|
|
404
|
-
}
|
|
405
|
-
}
|
|
406
|
-
main();
|
|
@@ -1,177 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
"use strict";
|
|
3
|
-
/**
|
|
4
|
-
* Compile Skills - Merge SKILL.local.md extensions with base SKILL.md files
|
|
5
|
-
*
|
|
6
|
-
* Usage:
|
|
7
|
-
* node compile-skills.js [--dir <skills-dir>]
|
|
8
|
-
*
|
|
9
|
-
* This script:
|
|
10
|
-
* 1. Finds all SKILL.local.md files in the skills directory
|
|
11
|
-
* 2. Merges each with its corresponding SKILL.md
|
|
12
|
-
* 3. Preserves the original SKILL.local.md for future updates
|
|
13
|
-
*
|
|
14
|
-
* Run this after creating or modifying SKILL.local.md files.
|
|
15
|
-
*/
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
const fs = require('fs');
|
|
18
|
-
const path = require('path');
|
|
19
|
-
/**
|
|
20
|
-
* Parse YAML frontmatter from a markdown file.
|
|
21
|
-
*/
|
|
22
|
-
function parseMarkdownWithFrontmatter(content) {
|
|
23
|
-
const match = content.match(/^---\r?\n([\s\S]*?)\r?\n---\r?\n([\s\S]*)$/);
|
|
24
|
-
if (!match) {
|
|
25
|
-
return { frontmatter: {}, body: content };
|
|
26
|
-
}
|
|
27
|
-
const frontmatter = {};
|
|
28
|
-
const yamlLines = match[1].split(/\r?\n/);
|
|
29
|
-
for (const line of yamlLines) {
|
|
30
|
-
const kvMatch = line.match(/^(\w+):\s*"?([^"]*)"?$/);
|
|
31
|
-
if (kvMatch) {
|
|
32
|
-
frontmatter[kvMatch[1]] = kvMatch[2];
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
return { frontmatter, body: match[2] };
|
|
36
|
-
}
|
|
37
|
-
/**
|
|
38
|
-
* Merge a base SKILL.md with a SKILL.local.md extension.
|
|
39
|
-
*/
|
|
40
|
-
function mergeSkillFiles(baseContent, localContent) {
|
|
41
|
-
const base = parseMarkdownWithFrontmatter(baseContent);
|
|
42
|
-
const local = parseMarkdownWithFrontmatter(localContent);
|
|
43
|
-
// Merge frontmatter (local overrides base, except for 'extends')
|
|
44
|
-
const mergedFrontmatter = { ...base.frontmatter };
|
|
45
|
-
for (const [key, value] of Object.entries(local.frontmatter)) {
|
|
46
|
-
if (key !== 'extends') {
|
|
47
|
-
// Append to description if both have it
|
|
48
|
-
if (key === 'description' && mergedFrontmatter.description) {
|
|
49
|
-
mergedFrontmatter.description = `${mergedFrontmatter.description} ${value}`;
|
|
50
|
-
}
|
|
51
|
-
else {
|
|
52
|
-
mergedFrontmatter[key] = value;
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
// Build merged content
|
|
57
|
-
let merged = '---\n';
|
|
58
|
-
for (const [key, value] of Object.entries(mergedFrontmatter)) {
|
|
59
|
-
merged += `${key}: "${value}"\n`;
|
|
60
|
-
}
|
|
61
|
-
merged += '---\n';
|
|
62
|
-
// Add base body
|
|
63
|
-
merged += base.body;
|
|
64
|
-
// Add separator and local body
|
|
65
|
-
if (local.body.trim()) {
|
|
66
|
-
merged += '\n\n<!-- Local Extensions (from SKILL.local.md) -->\n\n';
|
|
67
|
-
merged += local.body;
|
|
68
|
-
}
|
|
69
|
-
return merged;
|
|
70
|
-
}
|
|
71
|
-
/**
|
|
72
|
-
* Find all directories containing SKILL.local.md files
|
|
73
|
-
*/
|
|
74
|
-
function findSkillLocalFiles(skillsDir) {
|
|
75
|
-
const results = [];
|
|
76
|
-
if (!fs.existsSync(skillsDir)) {
|
|
77
|
-
return results;
|
|
78
|
-
}
|
|
79
|
-
const entries = fs.readdirSync(skillsDir, { withFileTypes: true });
|
|
80
|
-
for (const entry of entries) {
|
|
81
|
-
if (entry.isDirectory()) {
|
|
82
|
-
const localPath = path.join(skillsDir, entry.name, 'SKILL.local.md');
|
|
83
|
-
if (fs.existsSync(localPath)) {
|
|
84
|
-
results.push(entry.name);
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
return results;
|
|
89
|
-
}
|
|
90
|
-
/**
|
|
91
|
-
* Compile (merge) all skill extensions
|
|
92
|
-
*/
|
|
93
|
-
function compileSkills(skillsDir) {
|
|
94
|
-
const results = [];
|
|
95
|
-
const skillsWithLocal = findSkillLocalFiles(skillsDir);
|
|
96
|
-
if (skillsWithLocal.length === 0) {
|
|
97
|
-
return results;
|
|
98
|
-
}
|
|
99
|
-
for (const skillName of skillsWithLocal) {
|
|
100
|
-
const basePath = path.join(skillsDir, skillName, 'SKILL.md');
|
|
101
|
-
const localPath = path.join(skillsDir, skillName, 'SKILL.local.md');
|
|
102
|
-
if (!fs.existsSync(basePath)) {
|
|
103
|
-
results.push({
|
|
104
|
-
skill: skillName,
|
|
105
|
-
status: 'skipped',
|
|
106
|
-
message: `No base SKILL.md found`,
|
|
107
|
-
});
|
|
108
|
-
continue;
|
|
109
|
-
}
|
|
110
|
-
try {
|
|
111
|
-
const baseContent = fs.readFileSync(basePath, 'utf8');
|
|
112
|
-
const localContent = fs.readFileSync(localPath, 'utf8');
|
|
113
|
-
// Check if already merged (contains the marker comment)
|
|
114
|
-
if (baseContent.includes('<!-- Local Extensions (from SKILL.local.md) -->')) {
|
|
115
|
-
// Need to restore original base before re-merging
|
|
116
|
-
// For now, skip if already merged
|
|
117
|
-
results.push({
|
|
118
|
-
skill: skillName,
|
|
119
|
-
status: 'skipped',
|
|
120
|
-
message: `Already merged (run after lisa update to re-merge)`,
|
|
121
|
-
});
|
|
122
|
-
continue;
|
|
123
|
-
}
|
|
124
|
-
const merged = mergeSkillFiles(baseContent, localContent);
|
|
125
|
-
fs.writeFileSync(basePath, merged, 'utf8');
|
|
126
|
-
results.push({
|
|
127
|
-
skill: skillName,
|
|
128
|
-
status: 'merged',
|
|
129
|
-
message: `Successfully merged SKILL.local.md`,
|
|
130
|
-
});
|
|
131
|
-
}
|
|
132
|
-
catch (err) {
|
|
133
|
-
results.push({
|
|
134
|
-
skill: skillName,
|
|
135
|
-
status: 'error',
|
|
136
|
-
message: err.message,
|
|
137
|
-
});
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
return results;
|
|
141
|
-
}
|
|
142
|
-
function main() {
|
|
143
|
-
// Parse arguments
|
|
144
|
-
const args = process.argv.slice(2);
|
|
145
|
-
let skillsDir = path.join(process.cwd(), '.agents', 'skills');
|
|
146
|
-
for (let i = 0; i < args.length; i++) {
|
|
147
|
-
if (args[i] === '--dir' && args[i + 1]) {
|
|
148
|
-
skillsDir = path.resolve(args[i + 1]);
|
|
149
|
-
i++;
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
|
-
// Run compilation
|
|
153
|
-
const results = compileSkills(skillsDir);
|
|
154
|
-
// Output JSON for scripting
|
|
155
|
-
const output = {
|
|
156
|
-
status: 'ok',
|
|
157
|
-
action: 'compile-skills',
|
|
158
|
-
skillsDir,
|
|
159
|
-
results,
|
|
160
|
-
merged: results.filter((r) => r.status === 'merged').length,
|
|
161
|
-
skipped: results.filter((r) => r.status === 'skipped').length,
|
|
162
|
-
errors: results.filter((r) => r.status === 'error').length,
|
|
163
|
-
};
|
|
164
|
-
console.log(JSON.stringify(output, null, 2));
|
|
165
|
-
// Human-readable summary to stderr
|
|
166
|
-
if (results.length === 0) {
|
|
167
|
-
console.error('No SKILL.local.md files found.');
|
|
168
|
-
}
|
|
169
|
-
else {
|
|
170
|
-
console.error(`\nCompiled ${output.merged} skill(s), skipped ${output.skipped}, errors ${output.errors}`);
|
|
171
|
-
for (const r of results) {
|
|
172
|
-
const icon = r.status === 'merged' ? '✓' : r.status === 'skipped' ? '⊘' : '✗';
|
|
173
|
-
console.error(` ${icon} ${r.skill}: ${r.message}`);
|
|
174
|
-
}
|
|
175
|
-
}
|
|
176
|
-
}
|
|
177
|
-
main();
|