@langadventurellc/task-trellis-mcp 0.1.0-rc.3 → 1.0.0-rc.2
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 +60 -6
- package/dist/__tests__/e2e/configuration/activation.e2e.test.d.ts +2 -0
- package/dist/__tests__/e2e/configuration/activation.e2e.test.d.ts.map +1 -0
- package/dist/__tests__/e2e/configuration/activation.e2e.test.js +130 -0
- package/dist/__tests__/e2e/configuration/activation.e2e.test.js.map +1 -0
- package/dist/__tests__/e2e/configuration/commandLineArgs.e2e.test.d.ts +2 -0
- package/dist/__tests__/e2e/configuration/commandLineArgs.e2e.test.d.ts.map +1 -0
- package/dist/__tests__/e2e/configuration/commandLineArgs.e2e.test.js +125 -0
- package/dist/__tests__/e2e/configuration/commandLineArgs.e2e.test.js.map +1 -0
- package/dist/__tests__/e2e/configuration/directorySetup.e2e.test.d.ts +2 -0
- package/dist/__tests__/e2e/configuration/directorySetup.e2e.test.d.ts.map +1 -0
- package/dist/__tests__/e2e/configuration/directorySetup.e2e.test.js +262 -0
- package/dist/__tests__/e2e/configuration/directorySetup.e2e.test.js.map +1 -0
- package/dist/__tests__/e2e/configuration/invalidConfig.e2e.test.d.ts +2 -0
- package/dist/__tests__/e2e/configuration/invalidConfig.e2e.test.d.ts.map +1 -0
- package/dist/__tests__/e2e/configuration/invalidConfig.e2e.test.js +243 -0
- package/dist/__tests__/e2e/configuration/invalidConfig.e2e.test.js.map +1 -0
- package/dist/__tests__/e2e/configuration/preActivation.e2e.test.d.ts +2 -0
- package/dist/__tests__/e2e/configuration/preActivation.e2e.test.d.ts.map +1 -0
- package/dist/__tests__/e2e/configuration/preActivation.e2e.test.js +123 -0
- package/dist/__tests__/e2e/configuration/preActivation.e2e.test.js.map +1 -0
- package/dist/__tests__/e2e/crud/createObject.e2e.test.d.ts +2 -0
- package/dist/__tests__/e2e/crud/createObject.e2e.test.d.ts.map +1 -0
- package/dist/__tests__/e2e/crud/createObject.e2e.test.js +376 -0
- package/dist/__tests__/e2e/crud/createObject.e2e.test.js.map +1 -0
- package/dist/__tests__/e2e/crud/deleteObject.e2e.test.d.ts +2 -0
- package/dist/__tests__/e2e/crud/deleteObject.e2e.test.d.ts.map +1 -0
- package/dist/__tests__/e2e/crud/deleteObject.e2e.test.js +391 -0
- package/dist/__tests__/e2e/crud/deleteObject.e2e.test.js.map +1 -0
- package/dist/__tests__/e2e/crud/fileValidation.e2e.test.d.ts +2 -0
- package/dist/__tests__/e2e/crud/fileValidation.e2e.test.d.ts.map +1 -0
- package/dist/__tests__/e2e/crud/fileValidation.e2e.test.js +409 -0
- package/dist/__tests__/e2e/crud/fileValidation.e2e.test.js.map +1 -0
- package/dist/__tests__/e2e/crud/getObject.e2e.test.d.ts +2 -0
- package/dist/__tests__/e2e/crud/getObject.e2e.test.d.ts.map +1 -0
- package/dist/__tests__/e2e/crud/getObject.e2e.test.js +447 -0
- package/dist/__tests__/e2e/crud/getObject.e2e.test.js.map +1 -0
- package/dist/__tests__/e2e/crud/listObjects.e2e.test.d.ts +2 -0
- package/dist/__tests__/e2e/crud/listObjects.e2e.test.d.ts.map +1 -0
- package/dist/__tests__/e2e/crud/listObjects.e2e.test.js +593 -0
- package/dist/__tests__/e2e/crud/listObjects.e2e.test.js.map +1 -0
- package/dist/__tests__/e2e/crud/replaceObjectBodyRegex.e2e.test.d.ts +2 -0
- package/dist/__tests__/e2e/crud/replaceObjectBodyRegex.e2e.test.d.ts.map +1 -0
- package/dist/__tests__/e2e/crud/replaceObjectBodyRegex.e2e.test.js +693 -0
- package/dist/__tests__/e2e/crud/replaceObjectBodyRegex.e2e.test.js.map +1 -0
- package/dist/__tests__/e2e/crud/updateObject.e2e.test.d.ts +2 -0
- package/dist/__tests__/e2e/crud/updateObject.e2e.test.d.ts.map +1 -0
- package/dist/__tests__/e2e/crud/updateObject.e2e.test.js +662 -0
- package/dist/__tests__/e2e/crud/updateObject.e2e.test.js.map +1 -0
- package/dist/__tests__/e2e/infrastructure/client.e2e.test.d.ts +2 -0
- package/dist/__tests__/e2e/infrastructure/client.e2e.test.d.ts.map +1 -0
- package/dist/__tests__/e2e/infrastructure/client.e2e.test.js +68 -0
- package/dist/__tests__/e2e/infrastructure/client.e2e.test.js.map +1 -0
- package/dist/__tests__/e2e/infrastructure/server.e2e.test.d.ts +2 -0
- package/dist/__tests__/e2e/infrastructure/server.e2e.test.d.ts.map +1 -0
- package/dist/__tests__/e2e/infrastructure/server.e2e.test.js +37 -0
- package/dist/__tests__/e2e/infrastructure/server.e2e.test.js.map +1 -0
- package/dist/__tests__/e2e/utils/HierarchyOptions.d.ts +7 -0
- package/dist/__tests__/e2e/utils/HierarchyOptions.d.ts.map +1 -0
- package/dist/__tests__/e2e/utils/HierarchyOptions.js +3 -0
- package/dist/__tests__/e2e/utils/HierarchyOptions.js.map +1 -0
- package/dist/__tests__/e2e/utils/ObjectData.d.ts +17 -0
- package/dist/__tests__/e2e/utils/ObjectData.d.ts.map +1 -0
- package/dist/__tests__/e2e/utils/ObjectData.js +3 -0
- package/dist/__tests__/e2e/utils/ObjectData.js.map +1 -0
- package/dist/__tests__/e2e/utils/cleanup.d.ts +10 -0
- package/dist/__tests__/e2e/utils/cleanup.d.ts.map +1 -0
- package/dist/__tests__/e2e/utils/cleanup.js +99 -0
- package/dist/__tests__/e2e/utils/cleanup.js.map +1 -0
- package/dist/__tests__/e2e/utils/createObjectContent.d.ts +6 -0
- package/dist/__tests__/e2e/utils/createObjectContent.d.ts.map +1 -0
- package/dist/__tests__/e2e/utils/createObjectContent.js +34 -0
- package/dist/__tests__/e2e/utils/createObjectContent.js.map +1 -0
- package/dist/__tests__/e2e/utils/createObjectFile.d.ts +6 -0
- package/dist/__tests__/e2e/utils/createObjectFile.d.ts.map +1 -0
- package/dist/__tests__/e2e/utils/createObjectFile.js +88 -0
- package/dist/__tests__/e2e/utils/createObjectFile.js.map +1 -0
- package/dist/__tests__/e2e/utils/fileExists.d.ts +5 -0
- package/dist/__tests__/e2e/utils/fileExists.d.ts.map +1 -0
- package/dist/__tests__/e2e/utils/fileExists.js +52 -0
- package/dist/__tests__/e2e/utils/fileExists.js.map +1 -0
- package/dist/__tests__/e2e/utils/folderExists.d.ts +5 -0
- package/dist/__tests__/e2e/utils/folderExists.d.ts.map +1 -0
- package/dist/__tests__/e2e/utils/folderExists.js +52 -0
- package/dist/__tests__/e2e/utils/folderExists.js.map +1 -0
- package/dist/__tests__/e2e/utils/index.d.ts +15 -0
- package/dist/__tests__/e2e/utils/index.d.ts.map +1 -0
- package/dist/__tests__/e2e/utils/index.js +32 -0
- package/dist/__tests__/e2e/utils/index.js.map +1 -0
- package/dist/__tests__/e2e/utils/mcpTestClient.d.ts +13 -0
- package/dist/__tests__/e2e/utils/mcpTestClient.d.ts.map +1 -0
- package/dist/__tests__/e2e/utils/mcpTestClient.js +79 -0
- package/dist/__tests__/e2e/utils/mcpTestClient.js.map +1 -0
- package/dist/__tests__/e2e/utils/parseGetObjectResponse.d.ts +5 -0
- package/dist/__tests__/e2e/utils/parseGetObjectResponse.d.ts.map +1 -0
- package/dist/__tests__/e2e/utils/parseGetObjectResponse.js +15 -0
- package/dist/__tests__/e2e/utils/parseGetObjectResponse.js.map +1 -0
- package/dist/__tests__/e2e/utils/parseListObjectsResponse.d.ts +5 -0
- package/dist/__tests__/e2e/utils/parseListObjectsResponse.d.ts.map +1 -0
- package/dist/__tests__/e2e/utils/parseListObjectsResponse.js +15 -0
- package/dist/__tests__/e2e/utils/parseListObjectsResponse.js.map +1 -0
- package/dist/__tests__/e2e/utils/parseReplaceObjectBodyRegexResponse.d.ts +10 -0
- package/dist/__tests__/e2e/utils/parseReplaceObjectBodyRegexResponse.d.ts.map +1 -0
- package/dist/__tests__/e2e/utils/parseReplaceObjectBodyRegexResponse.js +40 -0
- package/dist/__tests__/e2e/utils/parseReplaceObjectBodyRegexResponse.js.map +1 -0
- package/dist/__tests__/e2e/utils/parseUpdateObjectResponse.d.ts +5 -0
- package/dist/__tests__/e2e/utils/parseUpdateObjectResponse.d.ts.map +1 -0
- package/dist/__tests__/e2e/utils/parseUpdateObjectResponse.js +15 -0
- package/dist/__tests__/e2e/utils/parseUpdateObjectResponse.js.map +1 -0
- package/dist/__tests__/e2e/utils/pathExists.d.ts +5 -0
- package/dist/__tests__/e2e/utils/pathExists.d.ts.map +1 -0
- package/dist/__tests__/e2e/utils/pathExists.js +50 -0
- package/dist/__tests__/e2e/utils/pathExists.js.map +1 -0
- package/dist/__tests__/e2e/utils/readObjectFile.d.ts +10 -0
- package/dist/__tests__/e2e/utils/readObjectFile.d.ts.map +1 -0
- package/dist/__tests__/e2e/utils/readObjectFile.js +54 -0
- package/dist/__tests__/e2e/utils/readObjectFile.js.map +1 -0
- package/dist/__tests__/e2e/utils/serverProcess.d.ts +11 -0
- package/dist/__tests__/e2e/utils/serverProcess.d.ts.map +1 -0
- package/dist/__tests__/e2e/utils/serverProcess.js +119 -0
- package/dist/__tests__/e2e/utils/serverProcess.js.map +1 -0
- package/dist/__tests__/e2e/utils/testEnvironment.d.ts +9 -0
- package/dist/__tests__/e2e/utils/testEnvironment.d.ts.map +1 -0
- package/dist/__tests__/e2e/utils/testEnvironment.js +74 -0
- package/dist/__tests__/e2e/utils/testEnvironment.js.map +1 -0
- package/dist/__tests__/e2e/workflow/appendLog.e2e.test.d.ts +2 -0
- package/dist/__tests__/e2e/workflow/appendLog.e2e.test.d.ts.map +1 -0
- package/dist/__tests__/e2e/workflow/appendLog.e2e.test.js +175 -0
- package/dist/__tests__/e2e/workflow/appendLog.e2e.test.js.map +1 -0
- package/dist/__tests__/e2e/workflow/claimTask.e2e.test.d.ts +2 -0
- package/dist/__tests__/e2e/workflow/claimTask.e2e.test.d.ts.map +1 -0
- package/dist/__tests__/e2e/workflow/claimTask.e2e.test.js +154 -0
- package/dist/__tests__/e2e/workflow/claimTask.e2e.test.js.map +1 -0
- package/dist/__tests__/e2e/workflow/completeTask.e2e.test.d.ts +2 -0
- package/dist/__tests__/e2e/workflow/completeTask.e2e.test.d.ts.map +1 -0
- package/dist/__tests__/e2e/workflow/completeTask.e2e.test.js +129 -0
- package/dist/__tests__/e2e/workflow/completeTask.e2e.test.js.map +1 -0
- package/dist/__tests__/e2e/workflow/prerequisites.e2e.test.d.ts +2 -0
- package/dist/__tests__/e2e/workflow/prerequisites.e2e.test.d.ts.map +1 -0
- package/dist/__tests__/e2e/workflow/prerequisites.e2e.test.js +547 -0
- package/dist/__tests__/e2e/workflow/prerequisites.e2e.test.js.map +1 -0
- package/dist/__tests__/e2e/workflow/pruneClosed.e2e.test.d.ts +2 -0
- package/dist/__tests__/e2e/workflow/pruneClosed.e2e.test.d.ts.map +1 -0
- package/dist/__tests__/e2e/workflow/pruneClosed.e2e.test.js +352 -0
- package/dist/__tests__/e2e/workflow/pruneClosed.e2e.test.js.map +1 -0
- package/dist/__tests__/e2e/workflow/taskLifecycle.e2e.test.d.ts +2 -0
- package/dist/__tests__/e2e/workflow/taskLifecycle.e2e.test.d.ts.map +1 -0
- package/dist/__tests__/e2e/workflow/taskLifecycle.e2e.test.js +385 -0
- package/dist/__tests__/e2e/workflow/taskLifecycle.e2e.test.js.map +1 -0
- package/dist/models/TrellisObject.d.ts +2 -0
- package/dist/models/TrellisObject.d.ts.map +1 -1
- package/dist/models/__tests__/isClaimable.test.js +8 -0
- package/dist/models/__tests__/isClaimable.test.js.map +1 -1
- package/dist/models/__tests__/isClosed.test.js +6 -0
- package/dist/models/__tests__/isClosed.test.js.map +1 -1
- package/dist/models/__tests__/isOpen.test.js +6 -0
- package/dist/models/__tests__/isOpen.test.js.map +1 -1
- package/dist/repositories/local/__tests__/getChildrenByFilePath.test.d.ts +2 -0
- package/dist/repositories/local/__tests__/getChildrenByFilePath.test.d.ts.map +1 -0
- package/dist/repositories/local/__tests__/getChildrenByFilePath.test.js +118 -0
- package/dist/repositories/local/__tests__/getChildrenByFilePath.test.js.map +1 -0
- package/dist/repositories/local/__tests__/getObjectByFilePath.test.js +13 -1
- package/dist/repositories/local/__tests__/getObjectByFilePath.test.js.map +1 -1
- package/dist/repositories/local/__tests__/getObjectById.test.js +2 -0
- package/dist/repositories/local/__tests__/getObjectById.test.js.map +1 -1
- package/dist/repositories/local/__tests__/getObjectFilePath.test.js +2 -0
- package/dist/repositories/local/__tests__/getObjectFilePath.test.js.map +1 -1
- package/dist/repositories/local/deleteObjectById.js +2 -2
- package/dist/repositories/local/deleteObjectById.js.map +1 -1
- package/dist/repositories/local/findMarkdownFiles.d.ts.map +1 -1
- package/dist/repositories/local/findMarkdownFiles.js +6 -1
- package/dist/repositories/local/findMarkdownFiles.js.map +1 -1
- package/dist/repositories/local/getChildrenByFilePath.d.ts +14 -0
- package/dist/repositories/local/getChildrenByFilePath.d.ts.map +1 -0
- package/dist/repositories/local/getChildrenByFilePath.js +93 -0
- package/dist/repositories/local/getChildrenByFilePath.js.map +1 -0
- package/dist/repositories/local/getObjectByFilePath.d.ts.map +1 -1
- package/dist/repositories/local/getObjectByFilePath.js +5 -1
- package/dist/repositories/local/getObjectByFilePath.js.map +1 -1
- package/dist/repositories/local/getObjectById.d.ts.map +1 -1
- package/dist/repositories/local/getObjectById.js +4 -1
- package/dist/repositories/local/getObjectById.js.map +1 -1
- package/dist/repositories/local/getObjects.js +1 -1
- package/dist/repositories/local/getObjects.js.map +1 -1
- package/dist/repositories/local/saveObject.d.ts +1 -0
- package/dist/repositories/local/saveObject.d.ts.map +1 -1
- package/dist/repositories/local/saveObject.js +46 -0
- package/dist/repositories/local/saveObject.js.map +1 -1
- package/dist/server.js +52 -17
- package/dist/server.js.map +1 -1
- package/dist/tools/__tests__/appendObjectLogTool.test.js +2 -0
- package/dist/tools/__tests__/appendObjectLogTool.test.js.map +1 -1
- package/dist/tools/__tests__/claimTaskTool.test.js +4 -0
- package/dist/tools/__tests__/claimTaskTool.test.js.map +1 -1
- package/dist/tools/__tests__/completeTaskTool.test.js +2 -0
- package/dist/tools/__tests__/completeTaskTool.test.js.map +1 -1
- package/dist/tools/__tests__/createObjectTool.test.js +18 -0
- package/dist/tools/__tests__/createObjectTool.test.js.map +1 -1
- package/dist/tools/__tests__/getObjectTool.test.js +4 -0
- package/dist/tools/__tests__/getObjectTool.test.js.map +1 -1
- package/dist/tools/__tests__/listObjectsTool.test.js +4 -0
- package/dist/tools/__tests__/listObjectsTool.test.js.map +1 -1
- package/dist/tools/__tests__/pruneClosedTool.test.d.ts +2 -0
- package/dist/tools/__tests__/pruneClosedTool.test.d.ts.map +1 -0
- package/dist/tools/__tests__/pruneClosedTool.test.js +171 -0
- package/dist/tools/__tests__/pruneClosedTool.test.js.map +1 -0
- package/dist/tools/__tests__/replaceObjectBodyRegexTool.test.d.ts +2 -0
- package/dist/tools/__tests__/replaceObjectBodyRegexTool.test.d.ts.map +1 -0
- package/dist/tools/__tests__/replaceObjectBodyRegexTool.test.js +258 -0
- package/dist/tools/__tests__/replaceObjectBodyRegexTool.test.js.map +1 -0
- package/dist/tools/__tests__/updateObjectTool.test.js +2 -0
- package/dist/tools/__tests__/updateObjectTool.test.js.map +1 -1
- package/dist/tools/activateTool.d.ts +1 -1
- package/dist/tools/activateTool.d.ts.map +1 -1
- package/dist/tools/activateTool.js +35 -1
- package/dist/tools/activateTool.js.map +1 -1
- package/dist/tools/appendObjectLogTool.d.ts +1 -1
- package/dist/tools/appendObjectLogTool.d.ts.map +1 -1
- package/dist/tools/appendObjectLogTool.js +27 -1
- package/dist/tools/appendObjectLogTool.js.map +1 -1
- package/dist/tools/claimTaskTool.d.ts +1 -1
- package/dist/tools/claimTaskTool.d.ts.map +1 -1
- package/dist/tools/claimTaskTool.js +34 -5
- package/dist/tools/claimTaskTool.js.map +1 -1
- package/dist/tools/completeTaskTool.d.ts +1 -1
- package/dist/tools/completeTaskTool.d.ts.map +1 -1
- package/dist/tools/completeTaskTool.js +30 -1
- package/dist/tools/completeTaskTool.js.map +1 -1
- package/dist/tools/createObjectTool.d.ts +1 -1
- package/dist/tools/createObjectTool.d.ts.map +1 -1
- package/dist/tools/createObjectTool.js +43 -2
- package/dist/tools/createObjectTool.js.map +1 -1
- package/dist/tools/deleteObjectTool.d.ts +1 -1
- package/dist/tools/deleteObjectTool.d.ts.map +1 -1
- package/dist/tools/deleteObjectTool.js +23 -1
- package/dist/tools/deleteObjectTool.js.map +1 -1
- package/dist/tools/getObjectTool.d.ts +1 -1
- package/dist/tools/getObjectTool.d.ts.map +1 -1
- package/dist/tools/getObjectTool.js +21 -1
- package/dist/tools/getObjectTool.js.map +1 -1
- package/dist/tools/index.d.ts +1 -0
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js +4 -1
- package/dist/tools/index.js.map +1 -1
- package/dist/tools/listObjectsTool.d.ts +1 -1
- package/dist/tools/listObjectsTool.d.ts.map +1 -1
- package/dist/tools/listObjectsTool.js +37 -1
- package/dist/tools/listObjectsTool.js.map +1 -1
- package/dist/tools/pruneClosedTool.d.ts +3 -3
- package/dist/tools/pruneClosedTool.d.ts.map +1 -1
- package/dist/tools/pruneClosedTool.js +82 -11
- package/dist/tools/pruneClosedTool.js.map +1 -1
- package/dist/tools/replaceObjectBodyRegexTool.d.ts +35 -0
- package/dist/tools/replaceObjectBodyRegexTool.d.ts.map +1 -0
- package/dist/tools/replaceObjectBodyRegexTool.js +145 -0
- package/dist/tools/replaceObjectBodyRegexTool.js.map +1 -0
- package/dist/tools/updateObjectTool.d.ts +1 -1
- package/dist/tools/updateObjectTool.d.ts.map +1 -1
- package/dist/tools/updateObjectTool.js +35 -1
- package/dist/tools/updateObjectTool.js.map +1 -1
- package/dist/utils/MultipleMatchesError.d.ts +7 -0
- package/dist/utils/MultipleMatchesError.d.ts.map +1 -0
- package/dist/utils/MultipleMatchesError.js +15 -0
- package/dist/utils/MultipleMatchesError.js.map +1 -0
- package/dist/utils/ReplaceStringOptions.d.ts +12 -0
- package/dist/utils/ReplaceStringOptions.d.ts.map +1 -0
- package/dist/utils/ReplaceStringOptions.js +3 -0
- package/dist/utils/ReplaceStringOptions.js.map +1 -0
- package/dist/utils/__tests__/checkPrerequisitesComplete.test.js +2 -0
- package/dist/utils/__tests__/checkPrerequisitesComplete.test.js.map +1 -1
- package/dist/utils/__tests__/deserializeTrellisObject.test.js +48 -0
- package/dist/utils/__tests__/deserializeTrellisObject.test.js.map +1 -1
- package/dist/utils/__tests__/filterUnavailableObjects.test.js +11 -10
- package/dist/utils/__tests__/filterUnavailableObjects.test.js.map +1 -1
- package/dist/utils/__tests__/isRequiredForOtherObjects.test.js +2 -0
- package/dist/utils/__tests__/isRequiredForOtherObjects.test.js.map +1 -1
- package/dist/utils/__tests__/replaceStringWithRegex.test.d.ts +2 -0
- package/dist/utils/__tests__/replaceStringWithRegex.test.d.ts.map +1 -0
- package/dist/utils/__tests__/replaceStringWithRegex.test.js +263 -0
- package/dist/utils/__tests__/replaceStringWithRegex.test.js.map +1 -0
- package/dist/utils/__tests__/serializationRoundTrip.test.js +24 -0
- package/dist/utils/__tests__/serializationRoundTrip.test.js.map +1 -1
- package/dist/utils/__tests__/serializeTrellisObject.test.js +40 -0
- package/dist/utils/__tests__/serializeTrellisObject.test.js.map +1 -1
- package/dist/utils/__tests__/sortTrellisObjects.test.js +2 -0
- package/dist/utils/__tests__/sortTrellisObjects.test.js.map +1 -1
- package/dist/utils/checkPrerequisitesComplete.d.ts.map +1 -1
- package/dist/utils/checkPrerequisitesComplete.js +3 -4
- package/dist/utils/checkPrerequisitesComplete.js.map +1 -1
- package/dist/utils/deserializeTrellisObject.d.ts.map +1 -1
- package/dist/utils/deserializeTrellisObject.js +5 -0
- package/dist/utils/deserializeTrellisObject.js.map +1 -1
- package/dist/utils/filterUnavailableObjects.d.ts.map +1 -1
- package/dist/utils/filterUnavailableObjects.js +5 -6
- package/dist/utils/filterUnavailableObjects.js.map +1 -1
- package/dist/utils/index.d.ts +3 -0
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +5 -1
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/isRequiredForOtherObjects.d.ts.map +1 -1
- package/dist/utils/isRequiredForOtherObjects.js +2 -4
- package/dist/utils/isRequiredForOtherObjects.js.map +1 -1
- package/dist/utils/replaceStringWithRegex.d.ts +45 -0
- package/dist/utils/replaceStringWithRegex.d.ts.map +1 -0
- package/dist/utils/replaceStringWithRegex.js +82 -0
- package/dist/utils/replaceStringWithRegex.js.map +1 -0
- package/dist/utils/serializeTrellisObject.d.ts.map +1 -1
- package/dist/utils/serializeTrellisObject.js +3 -0
- package/dist/utils/serializeTrellisObject.js.map +1 -1
- package/dist/validation/__tests__/validateObjectCreation.test.js +2 -0
- package/dist/validation/__tests__/validateObjectCreation.test.js.map +1 -1
- package/dist/validation/__tests__/validateParentExists.test.js +2 -0
- package/dist/validation/__tests__/validateParentExists.test.js.map +1 -1
- package/dist/validation/__tests__/validateStatusTransition.test.js +2 -0
- package/dist/validation/__tests__/validateStatusTransition.test.js.map +1 -1
- package/package.json +8 -3
package/README.md
CHANGED
|
@@ -1,15 +1,69 @@
|
|
|
1
1
|
# Task Trellis MCP
|
|
2
2
|
|
|
3
|
-
An MCP (Model Context Protocol) server for Task Trellis, a task management
|
|
3
|
+
An MCP (Model Context Protocol) server for Task Trellis, a tool to help AI coding agents break down complex work into manageable tasks that allow it to work effectively. This server provides a structured task hierarchy and workflow management system, enabling AI agents to claim, complete, and manage tasks efficiently.
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## Available Tools
|
|
6
6
|
|
|
7
|
-
This
|
|
7
|
+
This MCP server provides comprehensive task management functionality through the following tools:
|
|
8
8
|
|
|
9
|
-
###
|
|
9
|
+
### Core Object Management
|
|
10
10
|
|
|
11
|
-
- **
|
|
12
|
-
-
|
|
11
|
+
- **create_object**: Creates new objects (projects, epics, features, tasks) in the task hierarchy
|
|
12
|
+
- Supports parent-child relationships and prerequisites
|
|
13
|
+
- Validates hierarchy constraints (project → epic → feature → task)
|
|
14
|
+
- Parameters: type, title, parent (optional), priority, status, prerequisites, description
|
|
15
|
+
|
|
16
|
+
- **update_object**: Updates existing objects with new properties
|
|
17
|
+
- Change status, priority, prerequisites, or content
|
|
18
|
+
- Validates status transitions and maintains object integrity
|
|
19
|
+
- Parameters: id, priority, status, prerequisites, body, force
|
|
20
|
+
|
|
21
|
+
- **replace_object_body_regex**: Performs targeted regex-based replacements within object body content
|
|
22
|
+
- Enables surgical text edits without recreating entire body content
|
|
23
|
+
- Safer and more efficient than wholesale body replacement for specific modifications
|
|
24
|
+
- Parameters: id, regex, replacement, allowMultipleOccurrences (optional)
|
|
25
|
+
|
|
26
|
+
- **get_object**: Retrieves detailed information about a specific object by ID
|
|
27
|
+
- Returns complete object data including metadata, relationships, and history
|
|
28
|
+
- Parameters: id
|
|
29
|
+
|
|
30
|
+
- **delete_object**: Permanently removes objects from the system
|
|
31
|
+
- Validates relationships and prevents deletion of objects with dependencies
|
|
32
|
+
- Parameters: id, force
|
|
33
|
+
|
|
34
|
+
- **list_objects**: Retrieves and filters objects based on various criteria
|
|
35
|
+
- Filter by type, status, priority, scope, or closed status
|
|
36
|
+
- Essential for discovering and managing work items
|
|
37
|
+
- Parameters: type, scope (optional), status (optional), priority (optional), includeClosed
|
|
38
|
+
|
|
39
|
+
### Task Workflow Management
|
|
40
|
+
|
|
41
|
+
- **claim_task**: Claims available tasks for execution by AI agents
|
|
42
|
+
- Automatically selects highest priority ready tasks
|
|
43
|
+
- Validates prerequisites and readiness criteria
|
|
44
|
+
- Parameters: scope (optional), taskId (optional), force
|
|
45
|
+
|
|
46
|
+
- **complete_task**: Marks tasks as completed and records completion details
|
|
47
|
+
- Documents file changes and completion summary
|
|
48
|
+
- Updates task status and triggers dependent task progression
|
|
49
|
+
- Parameters: taskId, summary, filesChanged
|
|
50
|
+
|
|
51
|
+
- **append_object_log**: Adds progress updates and notes to object activity logs
|
|
52
|
+
- Essential for tracking work history and documenting decisions
|
|
53
|
+
- Creates permanent audit trail for retrospectives and debugging
|
|
54
|
+
- Parameters: id, contents
|
|
55
|
+
|
|
56
|
+
### System Management
|
|
57
|
+
|
|
58
|
+
- **activate**: Initializes the task trellis system in local or remote mode
|
|
59
|
+
- Only needs to be run if the server wasn't started with command line arguments (`--projectRootFolder` for local mode or `--mode remote` for remote mode)
|
|
60
|
+
- Configures data storage and validates connectivity
|
|
61
|
+
- Parameters: mode, projectRoot (local), apiToken (remote), remoteProjectId (remote), url (optional)
|
|
62
|
+
|
|
63
|
+
- **prune_closed**: Maintenance tool to remove old completed/cancelled objects
|
|
64
|
+
- Improves system performance and reduces clutter
|
|
65
|
+
- Validates relationships before deletion to maintain integrity
|
|
66
|
+
- Parameters: age, scope (optional)
|
|
13
67
|
|
|
14
68
|
### Usage
|
|
15
69
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"activation.e2e.test.d.ts","sourceRoot":"","sources":["../../../../src/__tests__/e2e/configuration/activation.e2e.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const index_js_1 = require("@modelcontextprotocol/sdk/client/index.js");
|
|
7
|
+
const stdio_js_1 = require("@modelcontextprotocol/sdk/client/stdio.js");
|
|
8
|
+
const types_js_1 = require("@modelcontextprotocol/sdk/types.js");
|
|
9
|
+
const utils_1 = require("../utils");
|
|
10
|
+
const path_1 = __importDefault(require("path"));
|
|
11
|
+
describe("E2E Configuration - Activation", () => {
|
|
12
|
+
let testEnv;
|
|
13
|
+
let client = null;
|
|
14
|
+
let transport = null;
|
|
15
|
+
beforeEach(() => {
|
|
16
|
+
testEnv = new utils_1.TestEnvironment();
|
|
17
|
+
testEnv.setup();
|
|
18
|
+
});
|
|
19
|
+
afterEach(async () => {
|
|
20
|
+
if (client) {
|
|
21
|
+
await client.close();
|
|
22
|
+
client = null;
|
|
23
|
+
}
|
|
24
|
+
if (transport) {
|
|
25
|
+
await transport.close();
|
|
26
|
+
transport = null;
|
|
27
|
+
}
|
|
28
|
+
testEnv?.cleanup();
|
|
29
|
+
});
|
|
30
|
+
async function connectWithoutProjectRoot() {
|
|
31
|
+
transport = new stdio_js_1.StdioClientTransport({
|
|
32
|
+
command: "node",
|
|
33
|
+
args: ["dist/server.js", "--mode", "local"], // No --projectRootFolder
|
|
34
|
+
});
|
|
35
|
+
client = new index_js_1.Client({ name: "test-client", version: "1.0.0" }, { capabilities: {} });
|
|
36
|
+
await client.connect(transport);
|
|
37
|
+
}
|
|
38
|
+
async function callTool(name, args = {}) {
|
|
39
|
+
if (!client) {
|
|
40
|
+
throw new Error("Client not connected");
|
|
41
|
+
}
|
|
42
|
+
return client.request({
|
|
43
|
+
method: "tools/call",
|
|
44
|
+
params: { name, arguments: args },
|
|
45
|
+
}, types_js_1.CallToolResultSchema);
|
|
46
|
+
}
|
|
47
|
+
describe("Local Mode Activation", () => {
|
|
48
|
+
it("should activate server with local mode and create .trellis directory", async () => {
|
|
49
|
+
await connectWithoutProjectRoot();
|
|
50
|
+
const response = await callTool("activate", {
|
|
51
|
+
mode: "local",
|
|
52
|
+
projectRoot: testEnv.projectRoot,
|
|
53
|
+
});
|
|
54
|
+
expect(response.content[0].type).toBe("text");
|
|
55
|
+
expect(response.content[0].text).toMatch(/Activated in local mode/);
|
|
56
|
+
expect(response.content[0].text).toContain(testEnv.projectRoot);
|
|
57
|
+
expect(response.content[0].text).toContain("planningRootFolder");
|
|
58
|
+
// Verify .trellis directory exists after creating an object
|
|
59
|
+
await callTool("create_object", {
|
|
60
|
+
type: "project",
|
|
61
|
+
title: "Test Project",
|
|
62
|
+
});
|
|
63
|
+
const trellisDir = path_1.default.join(testEnv.projectRoot, ".trellis");
|
|
64
|
+
expect(await (0, utils_1.pathExists)(trellisDir)).toBe(true);
|
|
65
|
+
});
|
|
66
|
+
it("should allow tool usage after activation", async () => {
|
|
67
|
+
await connectWithoutProjectRoot();
|
|
68
|
+
// Try to use tool before activation - should fail
|
|
69
|
+
const errorResponse = await callTool("list_objects", {});
|
|
70
|
+
expect(errorResponse.content[0].text).toContain("Planning root folder is not configured");
|
|
71
|
+
// Activate
|
|
72
|
+
await callTool("activate", {
|
|
73
|
+
mode: "local",
|
|
74
|
+
projectRoot: testEnv.projectRoot,
|
|
75
|
+
});
|
|
76
|
+
// Should now work
|
|
77
|
+
const response = await callTool("list_objects", { type: "project" });
|
|
78
|
+
expect(response.content[0].text).not.toContain("not configured");
|
|
79
|
+
});
|
|
80
|
+
it("should handle multiple activations with different paths", async () => {
|
|
81
|
+
await connectWithoutProjectRoot();
|
|
82
|
+
// First activation
|
|
83
|
+
await callTool("activate", {
|
|
84
|
+
mode: "local",
|
|
85
|
+
projectRoot: testEnv.projectRoot,
|
|
86
|
+
});
|
|
87
|
+
// Create an object
|
|
88
|
+
await callTool("create_object", {
|
|
89
|
+
type: "project",
|
|
90
|
+
title: "Test Project",
|
|
91
|
+
});
|
|
92
|
+
// Second activation with different path
|
|
93
|
+
const newPath = path_1.default.join(testEnv.projectRoot, "subdir");
|
|
94
|
+
await callTool("activate", {
|
|
95
|
+
mode: "local",
|
|
96
|
+
projectRoot: newPath,
|
|
97
|
+
});
|
|
98
|
+
// Objects from first activation should not be visible
|
|
99
|
+
const response = await callTool("list_objects", { type: "project" });
|
|
100
|
+
expect(response.content[0].text).toBe("[]");
|
|
101
|
+
});
|
|
102
|
+
});
|
|
103
|
+
describe("Remote Mode Activation", () => {
|
|
104
|
+
it("should activate server with remote mode parameters", async () => {
|
|
105
|
+
await connectWithoutProjectRoot();
|
|
106
|
+
const response = await callTool("activate", {
|
|
107
|
+
mode: "remote",
|
|
108
|
+
apiToken: "test-token",
|
|
109
|
+
url: "https://api.example.com",
|
|
110
|
+
remoteProjectId: "proj-123",
|
|
111
|
+
});
|
|
112
|
+
expect(response.content[0].text).toMatch(/Activated in remote mode/);
|
|
113
|
+
expect(response.content[0].text).toContain("test-token");
|
|
114
|
+
expect(response.content[0].text).toContain("https://api.example.com");
|
|
115
|
+
expect(response.content[0].text).toContain("proj-123");
|
|
116
|
+
});
|
|
117
|
+
});
|
|
118
|
+
describe("Parameter Validation", () => {
|
|
119
|
+
it("should handle local mode without projectRoot", async () => {
|
|
120
|
+
await connectWithoutProjectRoot();
|
|
121
|
+
const response = await callTool("activate", {
|
|
122
|
+
mode: "local",
|
|
123
|
+
});
|
|
124
|
+
// Should succeed but planningRootFolder will be undefined
|
|
125
|
+
expect(response.content[0].text).toContain("Activated in local mode");
|
|
126
|
+
expect(response.content[0].text).not.toContain("planningRootFolder");
|
|
127
|
+
});
|
|
128
|
+
});
|
|
129
|
+
});
|
|
130
|
+
//# sourceMappingURL=activation.e2e.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"activation.e2e.test.js","sourceRoot":"","sources":["../../../../src/__tests__/e2e/configuration/activation.e2e.test.ts"],"names":[],"mappings":";;;;;AAAA,wEAAmE;AACnE,wEAAiF;AACjF,iEAA0E;AAC1E,oCAAuD;AACvD,gDAAwB;AAExB,QAAQ,CAAC,gCAAgC,EAAE,GAAG,EAAE;IAC9C,IAAI,OAAwB,CAAC;IAC7B,IAAI,MAAM,GAAkB,IAAI,CAAC;IACjC,IAAI,SAAS,GAAgC,IAAI,CAAC;IAElD,UAAU,CAAC,GAAG,EAAE;QACd,OAAO,GAAG,IAAI,uBAAe,EAAE,CAAC;QAChC,OAAO,CAAC,KAAK,EAAE,CAAC;IAClB,CAAC,CAAC,CAAC;IAEH,SAAS,CAAC,KAAK,IAAI,EAAE;QACnB,IAAI,MAAM,EAAE,CAAC;YACX,MAAM,MAAM,CAAC,KAAK,EAAE,CAAC;YACrB,MAAM,GAAG,IAAI,CAAC;QAChB,CAAC;QACD,IAAI,SAAS,EAAE,CAAC;YACd,MAAM,SAAS,CAAC,KAAK,EAAE,CAAC;YACxB,SAAS,GAAG,IAAI,CAAC;QACnB,CAAC;QACD,OAAO,EAAE,OAAO,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CAAC,CAAC;YACrE,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,SAAS,CAAC,YAAY,CAAC,CAAC;YACzD,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,SAAS,CAAC,yBAAyB,CAAC,CAAC;YACtE,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC;QACzD,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,QAAQ,CAAC,sBAAsB,EAAE,GAAG,EAAE;QACpC,EAAE,CAAC,8CAA8C,EAAE,KAAK,IAAI,EAAE;YAC5D,MAAM,yBAAyB,EAAE,CAAC;YAElC,MAAM,QAAQ,GAAG,MAAM,QAAQ,CAAC,UAAU,EAAE;gBAC1C,IAAI,EAAE,OAAO;aACd,CAAC,CAAC;YAEH,0DAA0D;YAC1D,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,SAAS,CAAC,yBAAyB,CAAC,CAAC;YACtE,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,SAAS,CAAC,oBAAoB,CAAC,CAAC;QACvE,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"commandLineArgs.e2e.test.d.ts","sourceRoot":"","sources":["../../../../src/__tests__/e2e/configuration/commandLineArgs.e2e.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const index_js_1 = require("@modelcontextprotocol/sdk/client/index.js");
|
|
7
|
+
const stdio_js_1 = require("@modelcontextprotocol/sdk/client/stdio.js");
|
|
8
|
+
const types_js_1 = require("@modelcontextprotocol/sdk/types.js");
|
|
9
|
+
const utils_1 = require("../utils");
|
|
10
|
+
const path_1 = __importDefault(require("path"));
|
|
11
|
+
describe("E2E Configuration - Command Line Arguments", () => {
|
|
12
|
+
let testEnv;
|
|
13
|
+
let client = null;
|
|
14
|
+
let transport = null;
|
|
15
|
+
beforeEach(() => {
|
|
16
|
+
testEnv = new utils_1.TestEnvironment();
|
|
17
|
+
testEnv.setup();
|
|
18
|
+
});
|
|
19
|
+
afterEach(async () => {
|
|
20
|
+
if (client) {
|
|
21
|
+
await client.close();
|
|
22
|
+
client = null;
|
|
23
|
+
}
|
|
24
|
+
if (transport) {
|
|
25
|
+
await transport.close();
|
|
26
|
+
transport = null;
|
|
27
|
+
}
|
|
28
|
+
testEnv?.cleanup();
|
|
29
|
+
});
|
|
30
|
+
async function startServerWithArgs(args) {
|
|
31
|
+
transport = new stdio_js_1.StdioClientTransport({
|
|
32
|
+
command: "node",
|
|
33
|
+
args: ["dist/server.js", ...args],
|
|
34
|
+
});
|
|
35
|
+
client = new index_js_1.Client({ name: "test-client", version: "1.0.0" }, { capabilities: {} });
|
|
36
|
+
await client.connect(transport);
|
|
37
|
+
}
|
|
38
|
+
async function callTool(name, args = {}) {
|
|
39
|
+
if (!client) {
|
|
40
|
+
throw new Error("Client not connected");
|
|
41
|
+
}
|
|
42
|
+
return client.request({
|
|
43
|
+
method: "tools/call",
|
|
44
|
+
params: { name, arguments: args },
|
|
45
|
+
}, types_js_1.CallToolResultSchema);
|
|
46
|
+
}
|
|
47
|
+
it("should start server with --mode local", async () => {
|
|
48
|
+
await startServerWithArgs(["--mode", "local"]);
|
|
49
|
+
const toolsResponse = await client.request({ method: "tools/list" }, types_js_1.ListToolsResultSchema);
|
|
50
|
+
expect(toolsResponse).toBeDefined();
|
|
51
|
+
expect(Array.isArray(toolsResponse.tools)).toBe(true);
|
|
52
|
+
});
|
|
53
|
+
it("should start server with --projectRootFolder", async () => {
|
|
54
|
+
await startServerWithArgs([
|
|
55
|
+
"--mode",
|
|
56
|
+
"local",
|
|
57
|
+
"--projectRootFolder",
|
|
58
|
+
testEnv.projectRoot,
|
|
59
|
+
]);
|
|
60
|
+
// Should be able to use tools without activation
|
|
61
|
+
const response = await callTool("list_objects", { type: "project" });
|
|
62
|
+
expect(response.content[0].text).not.toContain("not configured");
|
|
63
|
+
});
|
|
64
|
+
it("should default to local mode when --mode not specified", async () => {
|
|
65
|
+
await startServerWithArgs([]);
|
|
66
|
+
// Try to activate in local mode to verify default
|
|
67
|
+
const response = await callTool("activate", {
|
|
68
|
+
mode: "local",
|
|
69
|
+
projectRoot: testEnv.projectRoot,
|
|
70
|
+
});
|
|
71
|
+
expect(response.content[0].text).toContain("Activated in local mode");
|
|
72
|
+
});
|
|
73
|
+
it("should handle --mode remote", async () => {
|
|
74
|
+
await startServerWithArgs(["--mode", "remote"]);
|
|
75
|
+
const response = await callTool("activate", {
|
|
76
|
+
mode: "remote",
|
|
77
|
+
apiToken: "token",
|
|
78
|
+
remoteProjectId: "proj-1",
|
|
79
|
+
});
|
|
80
|
+
expect(response.content[0].text).toContain("Activated in remote mode");
|
|
81
|
+
});
|
|
82
|
+
it("should override CLI args with activate tool", async () => {
|
|
83
|
+
await startServerWithArgs([
|
|
84
|
+
"--mode",
|
|
85
|
+
"local",
|
|
86
|
+
"--projectRootFolder",
|
|
87
|
+
testEnv.projectRoot,
|
|
88
|
+
]);
|
|
89
|
+
// Should work initially
|
|
90
|
+
let response = await callTool("list_objects", { type: "project" });
|
|
91
|
+
expect(response.content[0].text).not.toContain("not configured");
|
|
92
|
+
// Override with different path
|
|
93
|
+
const newPath = path_1.default.join(testEnv.projectRoot, "new");
|
|
94
|
+
await callTool("activate", {
|
|
95
|
+
mode: "local",
|
|
96
|
+
projectRoot: newPath,
|
|
97
|
+
});
|
|
98
|
+
// Should now use new path
|
|
99
|
+
response = await callTool("create_object", {
|
|
100
|
+
type: "project",
|
|
101
|
+
title: "Test",
|
|
102
|
+
});
|
|
103
|
+
expect(response).toBeDefined();
|
|
104
|
+
});
|
|
105
|
+
it("should preserve server configuration between tool calls", async () => {
|
|
106
|
+
await startServerWithArgs([
|
|
107
|
+
"--mode",
|
|
108
|
+
"local",
|
|
109
|
+
"--projectRootFolder",
|
|
110
|
+
testEnv.projectRoot,
|
|
111
|
+
]);
|
|
112
|
+
// First tool call
|
|
113
|
+
await callTool("create_object", {
|
|
114
|
+
type: "project",
|
|
115
|
+
title: "Project 1",
|
|
116
|
+
});
|
|
117
|
+
// Second tool call should still work without re-activation
|
|
118
|
+
const response = await callTool("create_object", {
|
|
119
|
+
type: "project",
|
|
120
|
+
title: "Project 2",
|
|
121
|
+
});
|
|
122
|
+
expect(response.content[0].text).toContain("Created object");
|
|
123
|
+
});
|
|
124
|
+
});
|
|
125
|
+
//# sourceMappingURL=commandLineArgs.e2e.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"commandLineArgs.e2e.test.js","sourceRoot":"","sources":["../../../../src/__tests__/e2e/configuration/commandLineArgs.e2e.test.ts"],"names":[],"mappings":";;;;;AAAA,wEAAmE;AACnE,wEAAiF;AACjF,iEAG4C;AAC5C,oCAA2C;AAC3C,gDAAwB;AAExB,QAAQ,CAAC,4CAA4C,EAAE,GAAG,EAAE;IAC1D,IAAI,OAAwB,CAAC;IAC7B,IAAI,MAAM,GAAkB,IAAI,CAAC;IACjC,IAAI,SAAS,GAAgC,IAAI,CAAC;IAElD,UAAU,CAAC,GAAG,EAAE;QACd,OAAO,GAAG,IAAI,uBAAe,EAAE,CAAC;QAChC,OAAO,CAAC,KAAK,EAAE,CAAC;IAClB,CAAC,CAAC,CAAC;IAEH,SAAS,CAAC,KAAK,IAAI,EA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C;QAEH,2DAA2D;QAC3D,MAAM,QAAQ,GAAG,MAAM,QAAQ,CAAC,eAAe,EAAE;YAC/C,IAAI,EAAE,SAAS;YACf,KAAK,EAAE,WAAW;SACnB,CAAC,CAAC;QAEH,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,SAAS,CAAC,gBAAgB,CAAC,CAAC;IAC/D,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"directorySetup.e2e.test.d.ts","sourceRoot":"","sources":["../../../../src/__tests__/e2e/configuration/directorySetup.e2e.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,262 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const index_js_1 = require("@modelcontextprotocol/sdk/client/index.js");
|
|
7
|
+
const stdio_js_1 = require("@modelcontextprotocol/sdk/client/stdio.js");
|
|
8
|
+
const types_js_1 = require("@modelcontextprotocol/sdk/types.js");
|
|
9
|
+
const utils_1 = require("../utils");
|
|
10
|
+
const promises_1 = require("fs/promises");
|
|
11
|
+
const path_1 = __importDefault(require("path"));
|
|
12
|
+
describe("E2E Configuration - Directory Setup", () => {
|
|
13
|
+
let testEnv;
|
|
14
|
+
let client = null;
|
|
15
|
+
let transport = null;
|
|
16
|
+
beforeEach(async () => {
|
|
17
|
+
testEnv = new utils_1.TestEnvironment();
|
|
18
|
+
testEnv.setup();
|
|
19
|
+
transport = new stdio_js_1.StdioClientTransport({
|
|
20
|
+
command: "node",
|
|
21
|
+
args: ["dist/server.js", "--mode", "local"],
|
|
22
|
+
});
|
|
23
|
+
client = new index_js_1.Client({ name: "test-client", version: "1.0.0" }, { capabilities: {} });
|
|
24
|
+
await client.connect(transport);
|
|
25
|
+
}, 30000);
|
|
26
|
+
afterEach(async () => {
|
|
27
|
+
if (client) {
|
|
28
|
+
await client.close();
|
|
29
|
+
client = null;
|
|
30
|
+
}
|
|
31
|
+
if (transport) {
|
|
32
|
+
await transport.close();
|
|
33
|
+
transport = null;
|
|
34
|
+
}
|
|
35
|
+
testEnv?.cleanup();
|
|
36
|
+
});
|
|
37
|
+
async function callTool(name, args = {}) {
|
|
38
|
+
if (!client) {
|
|
39
|
+
throw new Error("Client not connected");
|
|
40
|
+
}
|
|
41
|
+
return client.request({
|
|
42
|
+
method: "tools/call",
|
|
43
|
+
params: { name, arguments: args },
|
|
44
|
+
}, types_js_1.CallToolResultSchema);
|
|
45
|
+
}
|
|
46
|
+
describe(".trellis Directory Creation", () => {
|
|
47
|
+
it("should create .trellis directory on first object creation", async () => {
|
|
48
|
+
await callTool("activate", {
|
|
49
|
+
mode: "local",
|
|
50
|
+
projectRoot: testEnv.projectRoot,
|
|
51
|
+
});
|
|
52
|
+
const trellisPath = path_1.default.join(testEnv.projectRoot, ".trellis");
|
|
53
|
+
// Directory should not exist yet
|
|
54
|
+
expect(await (0, utils_1.pathExists)(trellisPath)).toBe(false);
|
|
55
|
+
// Create first object
|
|
56
|
+
await callTool("create_object", {
|
|
57
|
+
type: "project",
|
|
58
|
+
title: "Test Project",
|
|
59
|
+
});
|
|
60
|
+
// Now directory should exist
|
|
61
|
+
expect(await (0, utils_1.pathExists)(trellisPath)).toBe(true);
|
|
62
|
+
// Verify it's a directory
|
|
63
|
+
const stats = await (0, promises_1.stat)(trellisPath);
|
|
64
|
+
expect(stats.isDirectory()).toBe(true);
|
|
65
|
+
});
|
|
66
|
+
it("should create subdirectory structure for projects", async () => {
|
|
67
|
+
await callTool("activate", {
|
|
68
|
+
mode: "local",
|
|
69
|
+
projectRoot: testEnv.projectRoot,
|
|
70
|
+
});
|
|
71
|
+
await callTool("create_object", {
|
|
72
|
+
type: "project",
|
|
73
|
+
title: "Test Project",
|
|
74
|
+
});
|
|
75
|
+
const projectDir = path_1.default.join(testEnv.projectRoot, ".trellis", "p", "P-test-project");
|
|
76
|
+
expect(await (0, utils_1.pathExists)(projectDir)).toBe(true);
|
|
77
|
+
const files = await (0, promises_1.readdir)(projectDir);
|
|
78
|
+
expect(files).toContain("P-test-project.md");
|
|
79
|
+
});
|
|
80
|
+
it("should create nested structure for epics", async () => {
|
|
81
|
+
await callTool("activate", {
|
|
82
|
+
mode: "local",
|
|
83
|
+
projectRoot: testEnv.projectRoot,
|
|
84
|
+
});
|
|
85
|
+
// Create project first
|
|
86
|
+
await callTool("create_object", {
|
|
87
|
+
type: "project",
|
|
88
|
+
title: "Parent Project",
|
|
89
|
+
});
|
|
90
|
+
// Create epic
|
|
91
|
+
await callTool("create_object", {
|
|
92
|
+
type: "epic",
|
|
93
|
+
title: "Test Epic",
|
|
94
|
+
parent: "P-parent-project",
|
|
95
|
+
});
|
|
96
|
+
const epicDir = path_1.default.join(testEnv.projectRoot, ".trellis", "p", "P-parent-project", "e", "E-test-epic");
|
|
97
|
+
expect(await (0, utils_1.pathExists)(epicDir)).toBe(true);
|
|
98
|
+
});
|
|
99
|
+
it("should create nested structure for features", async () => {
|
|
100
|
+
await callTool("activate", {
|
|
101
|
+
mode: "local",
|
|
102
|
+
projectRoot: testEnv.projectRoot,
|
|
103
|
+
});
|
|
104
|
+
// Create hierarchy
|
|
105
|
+
await callTool("create_object", {
|
|
106
|
+
type: "project",
|
|
107
|
+
title: "Project",
|
|
108
|
+
});
|
|
109
|
+
await callTool("create_object", {
|
|
110
|
+
type: "epic",
|
|
111
|
+
title: "Epic",
|
|
112
|
+
parent: "P-project",
|
|
113
|
+
});
|
|
114
|
+
await callTool("create_object", {
|
|
115
|
+
type: "feature",
|
|
116
|
+
title: "Feature",
|
|
117
|
+
parent: "E-epic",
|
|
118
|
+
});
|
|
119
|
+
const featureDir = path_1.default.join(testEnv.projectRoot, ".trellis", "p", "P-project", "e", "E-epic", "f", "F-feature");
|
|
120
|
+
expect(await (0, utils_1.pathExists)(featureDir)).toBe(true);
|
|
121
|
+
});
|
|
122
|
+
it("should create task structure within features", async () => {
|
|
123
|
+
await callTool("activate", {
|
|
124
|
+
mode: "local",
|
|
125
|
+
projectRoot: testEnv.projectRoot,
|
|
126
|
+
});
|
|
127
|
+
// Create feature
|
|
128
|
+
await callTool("create_object", {
|
|
129
|
+
type: "feature",
|
|
130
|
+
title: "Feature",
|
|
131
|
+
});
|
|
132
|
+
// Create task
|
|
133
|
+
await callTool("create_object", {
|
|
134
|
+
type: "task",
|
|
135
|
+
title: "Open Task",
|
|
136
|
+
parent: "F-feature",
|
|
137
|
+
status: "open",
|
|
138
|
+
});
|
|
139
|
+
// Check task is in the correct location
|
|
140
|
+
const taskPath = path_1.default.join(testEnv.projectRoot, ".trellis", "f", "F-feature", "t");
|
|
141
|
+
expect(await (0, utils_1.pathExists)(taskPath)).toBe(true);
|
|
142
|
+
// Check task is created in status subdirectory
|
|
143
|
+
const files = await (0, promises_1.readdir)(taskPath);
|
|
144
|
+
expect(files).toContain("open");
|
|
145
|
+
// Check task file exists in the open subdirectory
|
|
146
|
+
const openTaskFiles = await (0, promises_1.readdir)(path_1.default.join(taskPath, "open"));
|
|
147
|
+
expect(openTaskFiles.some((f) => f.includes("open-task") || f.startsWith("T-"))).toBe(true);
|
|
148
|
+
});
|
|
149
|
+
it("should handle standalone tasks", async () => {
|
|
150
|
+
await callTool("activate", {
|
|
151
|
+
mode: "local",
|
|
152
|
+
projectRoot: testEnv.projectRoot,
|
|
153
|
+
});
|
|
154
|
+
// Create standalone task
|
|
155
|
+
await callTool("create_object", {
|
|
156
|
+
type: "task",
|
|
157
|
+
title: "Standalone Task",
|
|
158
|
+
status: "open",
|
|
159
|
+
});
|
|
160
|
+
// Check task is in standalone location
|
|
161
|
+
const taskPath = path_1.default.join(testEnv.projectRoot, ".trellis", "t");
|
|
162
|
+
expect(await (0, utils_1.pathExists)(taskPath)).toBe(true);
|
|
163
|
+
const files = await (0, promises_1.readdir)(taskPath);
|
|
164
|
+
expect(files).toContain("open");
|
|
165
|
+
// Check task file exists in the open subdirectory
|
|
166
|
+
const openTaskFiles = await (0, promises_1.readdir)(path_1.default.join(taskPath, "open"));
|
|
167
|
+
expect(openTaskFiles.some((f) => f.includes("standalone-task") || f.startsWith("T-"))).toBe(true);
|
|
168
|
+
});
|
|
169
|
+
});
|
|
170
|
+
describe("Directory Permissions", () => {
|
|
171
|
+
it("should create directories with proper permissions", async () => {
|
|
172
|
+
await callTool("activate", {
|
|
173
|
+
mode: "local",
|
|
174
|
+
projectRoot: testEnv.projectRoot,
|
|
175
|
+
});
|
|
176
|
+
await callTool("create_object", {
|
|
177
|
+
type: "project",
|
|
178
|
+
title: "Test",
|
|
179
|
+
});
|
|
180
|
+
const trellisPath = path_1.default.join(testEnv.projectRoot, ".trellis");
|
|
181
|
+
const stats = await (0, promises_1.stat)(trellisPath);
|
|
182
|
+
// Check directory is readable and writable
|
|
183
|
+
expect(stats.mode & 0o400).toBeTruthy(); // Readable
|
|
184
|
+
expect(stats.mode & 0o200).toBeTruthy(); // Writable
|
|
185
|
+
});
|
|
186
|
+
});
|
|
187
|
+
describe("Existing Files Handling", () => {
|
|
188
|
+
it("should handle existing .trellis directory", async () => {
|
|
189
|
+
const trellisPath = path_1.default.join(testEnv.projectRoot, ".trellis");
|
|
190
|
+
await (0, promises_1.mkdir)(trellisPath, { recursive: true });
|
|
191
|
+
await callTool("activate", {
|
|
192
|
+
mode: "local",
|
|
193
|
+
projectRoot: testEnv.projectRoot,
|
|
194
|
+
});
|
|
195
|
+
// Should work with existing directory
|
|
196
|
+
await callTool("create_object", {
|
|
197
|
+
type: "project",
|
|
198
|
+
title: "Test",
|
|
199
|
+
});
|
|
200
|
+
expect(await (0, utils_1.pathExists)(path_1.default.join(trellisPath, "p", "P-test"))).toBe(true);
|
|
201
|
+
});
|
|
202
|
+
it("should handle existing subdirectories and files", async () => {
|
|
203
|
+
const projectPath = path_1.default.join(testEnv.projectRoot, ".trellis", "p", "P-existing");
|
|
204
|
+
await (0, promises_1.mkdir)(projectPath, { recursive: true });
|
|
205
|
+
await (0, promises_1.writeFile)(path_1.default.join(projectPath, "P-existing.md"), "---\nkind: project\nid: P-existing\ntitle: Existing\nstatus: open\npriority: normal\ncreated: 2025-01-01T00:00:00.000Z\nupdated: 2025-01-01T00:00:00.000Z\nschema_version: 1.1\n---\nExisting project\n");
|
|
206
|
+
await callTool("activate", {
|
|
207
|
+
mode: "local",
|
|
208
|
+
projectRoot: testEnv.projectRoot,
|
|
209
|
+
});
|
|
210
|
+
// Should be able to read existing objects
|
|
211
|
+
const response = await callTool("get_object", {
|
|
212
|
+
id: "P-existing",
|
|
213
|
+
});
|
|
214
|
+
expect(response.content[0].text).toContain("P-existing");
|
|
215
|
+
// And create new ones
|
|
216
|
+
await callTool("create_object", {
|
|
217
|
+
type: "project",
|
|
218
|
+
title: "New",
|
|
219
|
+
});
|
|
220
|
+
const newProjectPath = path_1.default.join(testEnv.projectRoot, ".trellis", "p", "P-new");
|
|
221
|
+
expect(await (0, utils_1.pathExists)(newProjectPath)).toBe(true);
|
|
222
|
+
});
|
|
223
|
+
});
|
|
224
|
+
describe("Complex Hierarchy Creation", () => {
|
|
225
|
+
it("should create full project hierarchy structure", async () => {
|
|
226
|
+
await callTool("activate", {
|
|
227
|
+
mode: "local",
|
|
228
|
+
projectRoot: testEnv.projectRoot,
|
|
229
|
+
});
|
|
230
|
+
// Create complete hierarchy
|
|
231
|
+
await callTool("create_object", {
|
|
232
|
+
type: "project",
|
|
233
|
+
title: "Full Project",
|
|
234
|
+
});
|
|
235
|
+
await callTool("create_object", {
|
|
236
|
+
type: "epic",
|
|
237
|
+
title: "Epic One",
|
|
238
|
+
parent: "P-full-project",
|
|
239
|
+
});
|
|
240
|
+
await callTool("create_object", {
|
|
241
|
+
type: "feature",
|
|
242
|
+
title: "Feature Alpha",
|
|
243
|
+
parent: "E-epic-one",
|
|
244
|
+
});
|
|
245
|
+
await callTool("create_object", {
|
|
246
|
+
type: "task",
|
|
247
|
+
title: "Task Beta",
|
|
248
|
+
parent: "F-feature-alpha",
|
|
249
|
+
});
|
|
250
|
+
// Verify complete path exists
|
|
251
|
+
const fullPath = path_1.default.join(testEnv.projectRoot, ".trellis", "p", "P-full-project", "e", "E-epic-one", "f", "F-feature-alpha", "t");
|
|
252
|
+
expect(await (0, utils_1.pathExists)(fullPath)).toBe(true);
|
|
253
|
+
// Verify task directory structure exists
|
|
254
|
+
const files = await (0, promises_1.readdir)(fullPath);
|
|
255
|
+
expect(files).toContain("open");
|
|
256
|
+
// Check task file exists in the open subdirectory
|
|
257
|
+
const openTaskFiles = await (0, promises_1.readdir)(path_1.default.join(fullPath, "open"));
|
|
258
|
+
expect(openTaskFiles.some((f) => f.includes("task-beta") || f.startsWith("T-"))).toBe(true);
|
|
259
|
+
});
|
|
260
|
+
});
|
|
261
|
+
});
|
|
262
|
+
//# sourceMappingURL=directorySetup.e2e.test.js.map
|